adeponte has quit [Remote host closed the connection]
enroxorz has quit [Ping timeout: 240 seconds]
enroxorz has joined #ruby
qwerxy has quit [Quit: offski]
maletor has quit [Quit: Computer has gone to sleep.]
dross_ is now known as dross
enroxorz has quit [Ping timeout: 240 seconds]
enroxorz has joined #ruby
Rochefort has quit [Remote host closed the connection]
locriani has quit [Ping timeout: 268 seconds]
Kabie has joined #ruby
Banistergalaxy has joined #ruby
daniel_hinojosa has quit [Ping timeout: 244 seconds]
havenn has joined #ruby
enroxorz has quit [Ping timeout: 240 seconds]
Kabie has left #ruby [#ruby]
jumpingcloud has joined #ruby
linoj has joined #ruby
darren has joined #ruby
drewbug02 has joined #ruby
g_rotbart has joined #ruby
drewbug02 has quit [Client Quit]
welterde has joined #ruby
igotnolegs has quit [Quit: Computer has gone to sleep.]
banisterfiend has joined #ruby
hunglin has joined #ruby
hunglin has quit [Client Quit]
Banistergalaxy has quit [Ping timeout: 240 seconds]
pygospa_ has joined #ruby
maletor has joined #ruby
<bperry>
therealfakemoot: only the ones coming from ruby
<bperry>
if you have types floating around in the C code, then you will use ints or char[], whatever
mrdodo has quit [Remote host closed the connection]
<bperry>
but for any callbacks that get consumed in ruby, the vars will have to be VALUE
<bperry>
all callbacks will have at least an arity of one, it will have at least one argument
<bperry>
that is self
<bperry>
it enables to you to interact with the object as if it were object oriented in C code
<pygospa_>
Hi! I've got a crazy question, I guess. But still it bothers me ;) I know that Ruby was influenced by Smalltalk (actually I used to program in Smalltalk), and that it implements the idea of Smalltalk, that _everything_ is an object, and that there are no statements, only messages between objects.
graspee has quit [Quit: leaving]
<bperry>
where did you hear the latter part of that?
<pygospa_>
Now in Smalltalk if-then-else is implemented as method (Boolean#ifTrue and Boolean#ifFalse) in the Boolean class… but I could't find a class implementing the if-then-else structure in Ruby… so I wonder: how is this handled in Ruby?
<therealfakemoot>
bperry: Okay, that makes sense
sepp2k has quit [Remote host closed the connection]
<banisterfiend>
pygospa_: if/then/else are not methods in ruby, but it's easy to implement it if you want that
<banisterfiend>
pygospa_: if/then/else are keywords much like in python
velikasha has joined #ruby
velikasha has left #ruby [#ruby]
<bperry>
who makes the claim there are no statements, only messages between objects?
<bperry>
is this a ruby idiom?
<nedbat>
my understanding is that it's in the middle: there are no statements, only expressions, but it isn't as reductionist as smalltalk
<therealfakemoot>
https://gist.github.com/322a07049c0c857da63a So I'm trying to use FFI to wrap an .so I have. I'm getting the error in the second half of the pastebin when trying to invoke splice.rb via irb
<pygospa_>
Oh. Okey. I was reading a book "Engineering Long-Lasting Software: An Agile Approach Using SaaS and Cloud Computing" (by Fox and Patterson), and it said something along the lines of everything being method calls with explicit or implicit receiver, and every method always having an object returned as answer to the method…
mahmoudimus has joined #ruby
<pygospa_>
Which I didn't question in any ways (at first), because as mentioned I come from Smalltalk
<bperry>
ruby returns the last object touched
adeponte has joined #ruby
<therealfakemoot>
I don't get how the module I'm defining is supposed to be initialized.
<banisterfiend>
pygospa_: ruby still has keywords, it's just that we have less keywords than other languages. Many things are methods in ruby that in other languages would be keywords
<banisterfiend>
pygospa_: like 'loop' and 'attr_accessor' and 'raise', etc
<banisterfiend>
(all methods)
<pygospa_>
Yes, I've stumbled upon those as well… which even strengthened my believe that everything must be method calls ;)
<banisterfiend>
nup
<bperry>
extend FFI:Library
<bperry>
should be extend FFI::Library
<bperry>
no?
<pygospa_>
But then that was wrong… I'll try to find the passage in the book where it said that everything was a method… maybe I got mixed up…
<pygospa_>
Thanks for your help!
<MarioEIU>
pygospa_: Good choice on the book btw. I took the course they offered on Coursera and picked the book up to supplement it
<therealfakemoot>
bperry: I realized that a few seconds ago
mrdodo has joined #ruby
hsbt has quit [Read error: Connection reset by peer]
hsbt has joined #ruby
nobitanobi has joined #ruby
nobitanobi has left #ruby [#ruby]
justsee is now known as justsee|away
liluo has quit [Remote host closed the connection]
eikko has joined #ruby
leoncame` has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
linoj has quit [Quit: linoj]
leoncamel has joined #ruby
waxjar has quit [Ping timeout: 240 seconds]
freeayu has joined #ruby
mrdodo has quit [Remote host closed the connection]
chichou has quit [Remote host closed the connection]
linoj has joined #ruby
iori has joined #ruby
adelcampo has quit [Quit: Leaving...]
waxjar has joined #ruby
adelcampo has joined #ruby
<therealfakemoot>
So I have main.rb which contains "require 'splice.rb' " in the same directory as splice.rb. When I try to invoke main.rb, I get an error about "cannot load such file splice.rb"
<therealfakemoot>
What's the deal?
<bperry>
remove the .rb
ForSpareParts has quit [Ping timeout: 240 seconds]
<bperry>
just require 'splice'
<therealfakemoot>
Cannot load such file -- splice
<bperry>
require_relative './splice'
<bperry>
that may be frowned upon
<bperry>
not really sure
bambanx has joined #ruby
<therealfakemoot>
In Python, rleative imports are bad
<therealfakemoot>
and this feels like a bad hack
bambanx has quit [Read error: Connection reset by peer]
<therealfakemoot>
but it worked
<bperry>
yes, I agree
Eplemosen has quit [Quit: NOPE]
<therealfakemoot>
I wish I could learn why it didn't work the way it should've.
joephelius has quit [Quit: WeeChat 0.3.8]
<bperry>
I think you need to set some specific env vars in order for ruby to look in the current dir
<bperry>
it has a similar thing to $PATH
<jumpingcloud>
therealfakemoot: does 'load' work in place of 'require' ?
<therealfakemoot>
jumpingcloud: Negative.
<jumpingcloud>
therealfakemoot: i had an issue like this before, i think bperry is right about the $PATH
banisterfiend has quit [Remote host closed the connection]
<havenn>
banisterfiend: GC?? Okay, that is truly confusing (to me at least >.>)
jarred has quit [Quit: jarred]
<maletor>
FWIW, the usec is off.
Markvilla has quit [Ping timeout: 244 seconds]
n_blownapart has joined #ruby
justsee is now known as justsee|away
<n_blownapart>
hi I'm wondering why, with @seats = 2 set for the tandem bike, why the output in pry is seats = 1 from the superClass. thanks: http://pastie.org/4463787
ddouglas has joined #ruby
patient has quit [Quit: leaving]
darren has joined #ruby
Spooner has quit [Ping timeout: 265 seconds]
nu7hatch has left #ruby [#ruby]
havenn has quit [Remote host closed the connection]
<ddouglas>
hello comrades, I'm getting a "invalid multibyte char (US-ASCII)" error from Postgres/Rails when trying to do some stuff with DateTime elements.... I've posted the method on https://gist.github.com/3336474 if you think you might know something about DateTime data-type errors in SQL dbs
nwest has joined #ruby
Banistergalaxy has joined #ruby
cwang has joined #ruby
tommyvyo has quit [Quit: Computer has gone to sleep.]
justsee|away is now known as justsee
iamjarvo has joined #ruby
tommyvyo has joined #ruby
havenn has joined #ruby
joast has joined #ruby
Markvilla has joined #ruby
pingfloyd has joined #ruby
dangsos has joined #ruby
apok has joined #ruby
<dangsos>
anyone ever used refinery cms gem?
adeponte has joined #ruby
pygospa_ has left #ruby [#ruby]
Markvilla has quit [Ping timeout: 244 seconds]
lledet has joined #ruby
<_br_>
n_blownapart: In Byclyle set the seats variable like this @seats ||= 1 That will only set the variable if it doesn't exist already (as in your case).
<n_blownapart>
_br_: cool thanks I'll try it. (the pastie is precisely how the textbook has it).
sazboom has quit [Ping timeout: 246 seconds]
justsee is now known as justsee|away
jarred has joined #ruby
lledet has quit [Client Quit]
<nedbat>
_br_: but he sets @seats = 2 after calling super in Tandem. Shouldn't that take care of it?
banisterfiend has joined #ruby
Banistergalaxy has quit [Ping timeout: 240 seconds]
<ryanf>
that code works fine for me already n_blownapart
<ryanf>
perhaps you aren't running the code you think you are?
daemoen has quit [Disconnected by services]
<n_blownapart>
ryanf: well, the code ran fine, but the output had seats = 1. I included the output in the pastie. I thought it was odd. thanks!
<n_blownapart>
^^ I ran it in pry.
nedbat has quit [Ping timeout: 250 seconds]
<fowl>
n_blownapart: we're missing the part where you instantiate Tandem
mmercer has joined #ruby
<n_blownapart>
ryanf: fowl hold on thanks
<n_blownapart>
fowl ryanf I just put person_2 = Tandem.new ... that gave the output in the pastie
lledet has joined #ruby
<n_blownapart>
I'm trying it from an editor file since it worked for ryanf
<n_blownapart>
fowl ryanf I just initialized it with (gears = 1) in new pastie. It ran, but originally I ran it in pry and got the output on line 20. (@seats = 1)
<seanstickle>
Wait, we have keyword arguments now?
<bperry>
n_blownapart: super gears
<bperry>
maybe?
<ryanf>
no
<ryanf>
super passes all params if you don't give it empty parens
<bperry>
I see
jso has joined #ruby
Hawklord has joined #ruby
<seanstickle>
n_blownapart: what version of Ruby?
<n_blownapart>
ok, when I ran it at first in pry, I didn't initialize Tandem.new with any argument. line 20 was the output with @seats = 2 succeeding super. ryanf fowl seanstickle
<seanstickle>
Because with 1.9.3, I get #<Tandem:0x007ff3c4108668 @wheels=2, @seats=2, @gears=1>
<n_blownapart>
seanstickle: this is a book example (1.9.1) I'm running 1.9.3
aezop has quit [Read error: Connection reset by peer]
<n_blownapart>
seanstickle: you ran it in pry/irb?
<seanstickle>
Yup
joekarma has quit [Quit: joekarma]
sazboom has quit [Ping timeout: 246 seconds]
<seanstickle>
Although that gears=1 doesn't mean anything
<n_blownapart>
seanstickle: yikes, let me try it in pry. I had no args. on line 18 at first in pry.
<n_blownapart>
thanks for schlepping seanstickle
banisterfiend has quit [Ping timeout: 256 seconds]
<seanstickle>
Suretainly
banisterfiend has joined #ruby
TorpedoSkyline has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
yasushi has joined #ruby
pygospa has joined #ruby
havenn has quit [Remote host closed the connection]
yasushi has quit [Remote host closed the connection]
yasushi has joined #ruby
<n_blownapart>
seanstickle: yeah I got it to work. I hadn't initialize person_2 = Tandem.new with (1) on my first go. but oddly, the output gave me a new Tandem object, with only 1 seat. why would it do that?
kyb3r has joined #ruby
<n_blownapart>
^^ on the first go, it gave me one seat. the second go worked with seats = 2 as output.
ananthakumaran has quit [Quit: Leaving.]
yasushi has quit [Ping timeout: 245 seconds]
<seanstickle>
I'd have to see your code
<seanstickle>
I can't visualize this
<n_blownapart>
seanstickle: this is the corrected prog if you're not yet sick with boredom. thanks http://pastie.org/4463787
jumpingcloud has quit [Ping timeout: 240 seconds]
<n_blownapart>
this one worked. the only difference in the first run was line 18, where I had : person_2 = Tandem.new ... without arg
<bnagy>
no
waxjar has quit [Quit: Ah! Well, prepare to put mustard on those words, for you will soon be consuming them along with this slice of humble pie that comes direct from the oven of shame, set at gas mark "egg on your face"! I sort of forget what I was talking about.]
<bnagy>
I reject your assertion
<bnagy>
you must have changed something else without noticing
<bnagy>
use ideone or codepad, they run the code for you
<seanstickle>
I agree.
<seanstickle>
Something else changed.
<n_blownapart>
bnagy: the pry log is right here ..its very strange
<seanstickle>
You wouldn't have been able to run Tandem.new
<seanstickle>
It would have given you an argument error
linoj has quit [Quit: linoj]
<bnagy>
n_blownapart: replicate the behaviour and paste to ideone or codepad, then I'll believe you :)
<n_blownapart>
seanstickle: bnagy ok I figured out something. when I ran it in pry I misspelled initialize(gears) in line 12 : intialize . I missed the i. the prog. I pasted was from the book's prog. files online. so it ran with that word misspelled.
<seanstickle>
That'll do it
<bnagy>
that'd do it
<banisterfiend>
that did it
<n_blownapart>
bnagy: seanstickle but the prog still ran and gave me seats = 1. without Tandem initialized, the super just read the instance vars. from the superclass?
<seanstickle>
At this point, all I remember is you mistyped a bunch of stuff and weird things happened
<seanstickle>
I'm not going to unpack the history of it for curiosity's sake
maletor has quit [Quit: Computer has gone to sleep.]
<n_blownapart>
good idea. thanks very much seanstickle bnagy
<seanstickle>
Sure thing
jumpingcloud has joined #ruby
v0n has quit [Ping timeout: 244 seconds]
n_blownapart has quit [Remote host closed the connection]
htroyack has joined #ruby
<bnagy>
n_blownapart: if you misspell initialize in the subclass it just becomes some random method called initrujfsddsg or whatever
<bnagy>
so the only available initialize is from the parent class
<bnagy>
so that's all that runs
insecurlex has joined #ruby
alexim has joined #ruby
alexim has quit [Client Quit]
mockra has quit [Remote host closed the connection]
mockra has joined #ruby
apok has quit [Quit: apok]
tobyo has joined #ruby
Markvilla has joined #ruby
ananthakumaran has joined #ruby
pygospa has quit [Quit: pygospa]
mockra has quit [Remote host closed the connection]
burgestrand has joined #ruby
vitor-br has quit [Ping timeout: 276 seconds]
yasushi has joined #ruby
Markvilla has quit [Ping timeout: 245 seconds]
jrajav has quit [Quit: The best darkness is strange and surprising]
justsee|away is now known as justsee
justsee has quit [Quit: Leaving...]
tk_ has joined #ruby
beneggett has joined #ruby
jonahR has joined #ruby
vertroa_ has quit [Ping timeout: 240 seconds]
mockra has joined #ruby
vertroa_ has joined #ruby
hemanth has quit [Read error: Connection reset by peer]
dhruvasagar has quit [Ping timeout: 240 seconds]
savage- has quit [Remote host closed the connection]
tommyvyo has quit [Quit: Computer has gone to sleep.]
jonahR has quit [Quit: jonahR]
mockra has quit [Remote host closed the connection]
beneggett has quit [Quit: Computer has gone to sleep.]
burgestrand has quit [Quit: Leaving.]
maxmmurphy has quit [Quit: maxmmurphy]
blast_hardcheese has quit [Ping timeout: 276 seconds]
mikepack has quit [Remote host closed the connection]
dhruvasagar has joined #ruby
jeff_sebring has joined #ruby
yasushi has quit [Remote host closed the connection]
yasushi has joined #ruby
seanstickle has quit [Quit: seanstickle]
Konboi has joined #ruby
htroyack has quit [Quit: 1:40 a.m. here in Brazil. Must sleep... BRB]
yasushi has quit [Ping timeout: 240 seconds]
s1n4 has joined #ruby
Konboi has quit [Ping timeout: 248 seconds]
ryanf_ has joined #ruby
gavit has quit [Read error: Connection timed out]
gavit has joined #ruby
Axsuul has quit [Ping timeout: 252 seconds]
masteraka has joined #ruby
Axsuul has joined #ruby
joekarma has joined #ruby
Konboi has joined #ruby
justsee has joined #ruby
mockra has joined #ruby
Konboi has quit [Remote host closed the connection]
blast_hardcheese has joined #ruby
Axsuul has quit [Client Quit]
blast_hardcheese has quit [Excess Flood]
cloud|droid has joined #ruby
r0bby has joined #ruby
strnx has quit [Excess Flood]
araujo has quit [Quit: Leaving]
mockra has quit [Ping timeout: 246 seconds]
robbyoconnor has quit [Ping timeout: 240 seconds]
a_a_g has joined #ruby
timonv has joined #ruby
r0bby is now known as robbyoconnor
vectorshelve has joined #ruby
brianpWins has joined #ruby
mike4_ has quit [Quit: bbl]
centipedefarmer has quit [Quit: This computer has gone to sleep]
mbuf has joined #ruby
MarioEIU has quit [Quit: Leaving]
<mbuf>
anyone here used bzconsole from ruby-bugzilla? using bzconsole getbug gives me unknown command: getbug, even though the -h lists it as an available command
noyb has joined #ruby
burgestrand has joined #ruby
perryh_away is now known as perryh
strnx has joined #ruby
blast_hardcheese has joined #ruby
blast_hardcheese has quit [Excess Flood]
savage- has joined #ruby
jso has quit []
perryh is now known as perry
uris has quit [Quit: leaving]
a_a_g has quit [Quit: Leaving.]
tonini has joined #ruby
a_a_g has joined #ruby
chylli has joined #ruby
<chylli>
hi everyone. Should I install ruby first before install rvm ?
dhruvasagar has quit [Ping timeout: 252 seconds]
<luckyruby>
chylli: i wouldn't
<burgestrand>
chylli: no, you install ruby with rvm once you have rvm installed :)
<bnagy>
rvm relies on ruby
<bnagy>
but your old crappy system ruby should work
<burgestrand>
chylli: most systems have a ruby installed already, which you use to install rvm
<fowl>
bnagy: cant tell if you're being serious or not
a_a_g has quit [Client Quit]
<fowl>
lol
<bnagy>
fowl: one of the many reasons imho rbenv > rvm
<burgestrand>
banisterfiend: yeah that’s the one I found very surprising
blast_hardcheese has joined #ruby
blast_hardcheese has quit [Excess Flood]
<burgestrand>
bnagy: just rename current_session on both places to page
<bnagy>
burgestrand: oic so literally just override page instead of current_session?
heftig has quit [Remote host closed the connection]
heftig has joined #ruby
blast_hardcheese has joined #ruby
artOfWar has quit [Ping timeout: 240 seconds]
nobitanobi has joined #ruby
nobitanobi has quit [Read error: Connection reset by peer]
g4_ has joined #ruby
g4 has quit [Read error: Operation timed out]
<burgestrand>
banisterfiend: I’ve concluded however the most annoying issues are gems who print out warnings, but don’t show where the warnings are coming from so I can’t figure out how to fix them
Markvilla has joined #ruby
eregon has quit [Read error: Operation timed out]
<burgestrand>
like, "using X is deprecated, use Y instead" and the issue comes from one of my like… forty gems >.>
<burgestrand>
nobdraisentone: just search for "ruby class variables"
<nobitanobi>
burgestrand: Thanks for the suggestions. Was wondering if somebody had some nice to read and understand article over here :)
<burgestrand>
nobdraisentone: I wouldn’t expect there to be too much information, as pretty much everybody avoids class variables like the plague.
yxhuvud has joined #ruby
<nobitanobi>
burgestrand: ok. Thanks :)
<burgestrand>
bnagy: that error does not happen on MRI?
<bnagy>
burgestrand: no it doesn't
<bnagy>
also, it seems to work with capybara-webkit
<burgestrand>
bnagy: it looks like poltergeist is sending some command to the underlying driver via JSON, but the string coming in is in BINARY (i.e. no encoding information) for some reason
<bnagy>
I guess I can just force_encoding on it
alvaro_o_ has joined #ruby
<burgestrand>
bnagy: yeah if you can figure out why the command has a weird encoding
<burgestrand>
bnagy: ruby -e 'p "".encoding' — what does that show in both jruby and mri?
indian has quit [Ping timeout: 240 seconds]
<bnagy>
yeah that does it
<bnagy>
wacky, I just force_encoding before I pass it to the search method
<burgestrand>
bnagy: try just slapping an encoding: utf-8 on the top of your file, might remedy the issue
<burgestrand>
from the file you’re calling search from that is
<bnagy>
yah good point
alvaro_o has quit [Ping timeout: 245 seconds]
ChampS666 has joined #ruby
<bnagy>
hm no luck with that
<bnagy>
I can still have ausr bin env shebang before the encoding comment right?
<burgestrand>
yeah
<bnagy>
anyway I think I'll stick with force_encoding
<bnagy>
cause then I can comment it
<burgestrand>
bnagy: just be careful and make sure your strings really are in the encoding you say they are in, if it ever changes (because of your system perhaps) the errors will be about the same but even weirder :p
<nobitanobi>
burgestrand: that page you gave is pretty good actually. Thank you.
<burgestrand>
nobdraisentone: :)
<nobitanobi>
gnight
timonv has joined #ruby
wereHamster has quit [Quit: Lost terminal]
timonv has quit [Remote host closed the connection]
nobitanobi has quit [Read error: Connection reset by peer]
<bnagy>
burgestrand: thanks a lot for that, now I can be MRI free again
<burgestrand>
bnagy: \o/
nobitanobi has joined #ruby
nobitanobi has left #ruby [#ruby]
vectorshelve has joined #ruby
timonv has joined #ruby
pen has quit [Remote host closed the connection]
ddouglas has quit [Quit: Ex-Chat]
wereHamster has joined #ruby
MarGarina has joined #ruby
apok has joined #ruby
abstrusenick has joined #ruby
ringotwo has quit [Remote host closed the connection]
Eldariof-ru has joined #ruby
lolmaus has joined #ruby
benatkin has joined #ruby
MarGarina has quit [Ping timeout: 240 seconds]
banisterfiend has quit [Ping timeout: 268 seconds]
<fowl>
its only 10% more work to use gosu and put graphics to it
<shevy>
eh 10% ;P
shadoi has joined #ruby
jeff_sebring has quit [Ping timeout: 276 seconds]
arvidkahl has quit [Quit: arvidkahl]
<vectorshelve>
shevy: yes :)
becomingGuru has joined #ruby
tewecske has quit [Quit: Leaving.]
<fowl>
shevy: probably less
<shevy>
hmm
twinturbo has quit [Quit: twinturbo]
<vectorshelve>
shevy: you liked it ? ;)
macer_ has joined #ruby
<shevy>
vectorshelve didn't look at it yet, was waiting to see whether it is your repo or whether you just linked any-other-random-guy's repo here :D
<vectorshelve>
shevy: no it is mine dude... that pic is mine.. why would I lie ? haha ;D
<shevy>
testing now
<shevy>
vectorshelve, no, I really had no idea. I also dont keep IRC logs, and tend to forget what happened ~3 days ago :(
<vectorshelve>
shevy: ok
<vectorshelve>
shevy: hows the code... ur thoughts are very valuable to me.. would definitely work on it
<shevy>
dunno
<shevy>
semi-ok I think
<shevy>
code like this though confuses me:
<shevy>
def update; each(&:update)
<shevy>
this just updates each entry?
<shevy>
but I see you managed to reduce the amount of lines
<shevy>
lol
<shevy>
if cell_is_lonely?
<shevy>
oh no wait
<shevy>
if_cell_lonely?
<shevy>
hehe
dhruvasagar has quit [Ping timeout: 265 seconds]
Hawklord has quit [Ping timeout: 276 seconds]
dhruvasagar has joined #ruby
workmad3 has quit [Ping timeout: 252 seconds]
subbyyy has quit [Quit: Leaving.]
timonv has joined #ruby
burgestrand has quit [Quit: Leaving.]
arietis has joined #ruby
brdude has joined #ruby
twinturbo has joined #ruby
hoelzro|away is now known as hoelzro
jeff_sebring has joined #ruby
aezop has quit [Read error: Operation timed out]
Rochefort has joined #ruby
ph^ has joined #ruby
<hoelzro>
morning Ruby folk
ph^_ has joined #ruby
xorigin has joined #ruby
unixf00l has left #ruby [#ruby]
burgestrand has joined #ruby
maxmmurphy has joined #ruby
y2k has joined #ruby
<shevy>
holzo! hello!
<vectorshelve>
shevy: doesnt that method name make sense from the context of the game ? :(
ph^ has quit [Ping timeout: 265 seconds]
<shevy>
vectorshelve I think update is a logical name for a method name
opus has joined #ruby
<shevy>
I dont really know what the game is about hahaha
opus has quit [Client Quit]
opus has joined #ruby
<vectorshelve>
shevy: but you were talking about if_cell_lonely?
specialGuest has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
<hoelzro>
so, a question for those of you more grounded in Ruby in I. I'd like to automate Gemfile creation for a gem I'm making (and future gems). I've seen that Bundler can do this, but Bundler seems a bit too heavy for just that task. Are there any alternatives for this sort of thing?
arkiver has joined #ruby
ryanf has quit [Quit: leaving]
Hanmac1 is now known as Hanmac
<burgestrand>
hoelzro: automate gemfile creation?
<shevy>
vectorshelve ah yes, I found the method name funny
<burgestrand>
hoelzro: ah, you mean gemspec?
<shevy>
vectorshelve, I have mixed feelings about if_foo
<shevy>
vectorshelve, normally, you would rather see code like this:
<shevy>
if cell.is_lonely?
<shevy>
or
<shevy>
if cell.lonely?
<shevy>
it's a bit odd to see
<shevy>
if if_cell_lonely?(i)
specialGuest has quit [Changing host]
specialGuest has joined #ruby
<shevy>
or
<shevy>
array << i if_cell_lonely?(i)
<shevy>
hmm wait
<shevy>
array << i if if_cell_lonely?(i)
<hoelzro>
burgestrand: I believe so
<hoelzro>
I wrote a library, and I'd like to package it up as a Gem
dhruvasagar has quit [Ping timeout: 260 seconds]
khakimov has quit [Quit: Computer has gone to sleep.]
<burgestrand>
hoelzro: as far as automatic gemspec creation I did automate it for me personally once but it actually went faster to just copy an old gemspec and modify the points I needed to change, the annoying things to set up for each new gem is the directory structure, license file, tests, rakefile and documentation
<bnagy>
the ruby hard way stuff covers this and recommends having a 'skeleton' dir with all the basics and you just tweak values per new gem
MonsterWithin has quit [Ping timeout: 244 seconds]
<bnagy>
which is probably imho not a bad approach
thone_ has joined #ruby
<burgestrand>
Yeah. I use bundler to generate a new gem, which essentially is the same as doing that skeleton thing. The trick is to remember to change all placeholder values :)
<bnagy>
I still find th gem stuff pretty arcane, tbh
<apeiros_>
macer_: be aware that a class *itself* can very well have an @variable and that this @variable is *different* from @variables in *instances* of said class.
<bnagy>
but it will change in that instance (wtfobject)
<macer_>
o.O
dhruvasagar has quit [Ping timeout: 244 seconds]
hoelzro|away is now known as hoelzro
<burgestrand>
instance variables vs instance variables, simple really
* burgestrand
asplodes
<macer_>
actually my real code is a little more complicated :p
ph^ has joined #ruby
<burgestrand>
It always is, but I think your question is not your question so I would like to question your question and ask for the real question
<Inoperable>
bnagy: [word, word, word, word, word, word, word,] into ["word", "word", "word", ...]
<macer1>
[word,word,word].map &:to_s
<burgestrand>
:p
<macer1>
:)
<Inoperable>
macer1: ...
<Inoperable>
macer1: can you elaborate a bit? ;)
<macer1>
...
<burgestrand>
Inoperable: you really have a trailing comma?
<burgestrand>
Inoperable: also, can words contain commas?
<Inoperable>
its an example
<bnagy>
is the first thing a string, or what?
<burgestrand>
I know, that’s why I ask, why are you not answring :(
<Inoperable>
i need to put " " around some words
<bnagy>
words.map {|w| "\"#{w}\""}
<Inoperable>
bnagy: pure regxp
<bnagy>
why on earth would you use a regexp for that?
<burgestrand>
Beginning to sound like homework
<macer1>
:p
* burgestrand
coughs
<Inoperable>
i asked about regexp, right?
<qko>
burgestrand: beginning?:D
<Inoperable>
;)
<Inoperable>
cant learn regexp when i dont understand it
<Spooner>
I suspect it is just about a really vague question being answered in 100 reasonable ways, but not the right one, because the specification is so broken :)
<chiel>
regular-expressions.info :p
dhruvasagar has quit [Ping timeout: 244 seconds]
<qko>
Inoperable: I know that the sed command for something like that would be something like s/(*)/"$1"/ or something among those lines
<Spooner>
Inoperable : Why not tell us what you are trying to achieve instead of giving us broken code and expecting us to know how you want it to be fixed?
dhruvasagar has joined #ruby
burgestrand has quit [Quit: Leaving.]
lkba has joined #ruby
<shevy>
Inoperable regexinfo page is useful
<shevy>
yeah
<shevy>
regular-expressions.info
<bnagy>
QKO: you need a specifier - .* probably
<shevy>
Inoperable dedicate a full day to understand regexes
<macer1>
Bot is dead...back to work :P
cascalheir has joined #ruby
<bnagy>
"cat".sub(/.*/) {|s| "\"#{s}\""} would work I guess
<shevy>
macer1 how did it die?
<Inoperable>
shevy: yeah, just grabbed the oreilly ebook for it
<macer1>
half-dead*
<bnagy>
I hate the \1 $1 stuff :(
<macer1>
>> "I am half dead and lagging so much"
<bnagy>
actually I mostly hate regexp
<al2o3cr>
(String) "I am half dead and lagging so much"
<chiel>
Inoperable: that book is pretty good. there's 2, one is more of a reference guide
fermion_ has joined #ruby
<chiel>
the actual book on it is pretty awesome
<macer1>
>> ping
<al2o3cr>
stderr was too long, I PMed it to you
<al2o3cr>
exit status: 1
<Inoperable>
bnagy: im not asking about ruby way but about correct regexp to select \+w and wrap it in " " or {} or $ $, is that enough well specified?
<bnagy>
Inoperable: regexps match stuff, they don't tell you how to replace stuff
<bnagy>
the match you want is /.*/
<qko>
bnagy: myeah, been out of that for quite a while
<Inoperable>
chiel: i grab the thin one
<qko>
Inoperable: and you put () around what you want to store it
emmanuelux has joined #ruby
<chiel>
Inoperable: yeah, that one is more of a reference guide I believe, but should be just fine
<bnagy>
except you don't need to group there, the block form captures your match, and you want to match the whole string
<dr_bob>
Inoperable: str.gsub /\w+/, '"\\&"'
<chiel>
not like you really need to know the internals of the engine.
yuriy has joined #ruby
<Inoperable>
dr_bob: perfect, thanks
cascalheira has quit [Ping timeout: 276 seconds]
<dr_bob>
YWC, if you need to change in place use gsub!
<dr_bob>
i.e. with exclamation mark
Stalkr_ has joined #ruby
timonv has joined #ruby
<Inoperable>
shevy: yeah, i need more time to get my head over regexp. was avoiding it long enough ;)
yuriy has quit [Read error: Connection reset by peer]
<Inoperable>
is the standard regexp implemented in all linux gawk, grep, sed the same way?
<dr_bob>
Inoperable: I didn't read all the history, were you recommended "Mastering Regular Expressions" (O'Reilly)? Other than that, the program "The Regex Coach" is really helpful to understand how matching works. Unfortunately it's windows only.
justsee is now known as justsee|away
r0bby has joined #ruby
<shevy>
Inoperable, same here. regexes make my brain go very slowly... and my brain is already very slow
<dr_bob>
Inoperable: no unfortunately not
<chiel>
Inoperable: there's subtle differences usually
<Inoperable>
dr_bob: windows only? hehe
<shevy>
Inoperable easy solution - give up on gawk grep and sed, and use ruby
<chiel>
like every implementation :p
<dr_bob>
Inoperable: might work under WINE as well
<chiel>
most implementations of regex try to be perl-compatible versions, as far as I'm aware
<Inoperable>
shevy: gawk grep and sed are being used since 30+ years so i think im gonna stick with them
cascalheir is now known as cascalheira
<shevy>
we used to have horses rather than cars too in the past
<Inoperable>
true
robbyoconnor has quit [Ping timeout: 276 seconds]
<shevy>
they worked very well for thousand years so let's use them
becomingGuru1 has quit [Quit: Leaving.]
<bnagy>
TIL horses were invented in 1012
<shevy>
Inoperable, the thing I dont like about these tools is that they assume different options or syntax... especially awk
<Inoperable>
if henry ford would ask ppl what they like to have back then, they will tell him faster horses though
<zii>
bnagy, r/circlejerk?
<shevy>
grep I actually like
<shevy>
Inoperable, do you know why he used black paint for his cars?
<shevy>
Inoperable, it was cheaper and also dried faster than other colours
<Inoperable>
was a standard bakc then?
<shevy>
well kinda
<shevy>
I guess pink cars would have been more difficult
<shevy>
back then perhaps
<shevy>
today we can have DIAMOND CARS IN 10000 COLOURS
<Spooner>
Inoperable : Not necessarily. More likely to be horses that didn't get sick and die all the time (this was a major problem in New York just before the cars appeared) :)
<shevy>
out from a 3D printer
r0bby is now known as robbyoconnor
<qko>
shevy: actually, the dutch monarchs still go by horse at times
<Inoperable>
i dont see colors propery, so i don't care ;]
<qko>
(pisses me off)
urbann has joined #ruby
<Spooner>
shevy : The "Any colo(u)r as long as it is black" is a fallacy, I think.
urbann has left #ruby [#ruby]
crodas has quit [Quit: Disconnecting from stoned server.]
crodas has joined #ruby
<Inoperable>
QKO: they go by horse where? around the castle?
<workmad3>
Spooner: it's an urban legend, iirc :)
<qko>
Inoperable: pretty much
<workmad3>
(that's also to shevy btw)
<qko>
just enough to annoy the crap out of every driver that has to go to work
<Inoperable>
well, horses need their daily walk i guess
<chridal>
Could anyone please do me a favor? And see if you can connect to irc.esper.net . I was just unable to connect, but am now unable to. Really apreciate it!
xclite has joined #ruby
Criztian has joined #ruby
nedbat has joined #ruby
<chiel>
you were unable twice? :D
nanderoo has joined #ruby
xclite has quit [Read error: Connection reset by peer]
<chridal>
yea, typo.
<chridal>
I was able to, but now uanble to :)
fearoffish has joined #ruby
xorox90 has quit [Ping timeout: 260 seconds]
<chiel>
:D
<chridal>
did you have any luck?
xclite has joined #ruby
<chiel>
I didn't try :p
<chiel>
hang on.
<chiel>
port 6667?
<chridal>
yes
<chiel>
works for me
<chridal>
that is so weird.
<chridal>
But thanks!
<chridal>
must be my client
<chiel>
just did /connect irc.esper.net
<chiel>
in irssi
<chridal>
yea, im in irssi as well.
<chridal>
will have to check conf.
<chridal>
ty.
chridal has quit [Client Quit]
<chiel>
hmm
* workmad3
wonders if chridal knows that sometimes servers become inaccessible from locations
<chiel>
weird :)
<chiel>
they should have something downjustformeorforeveryone for irc
<anoldhacker>
Actually, I get the same thing with a trivial example: /\G(\w+)/
<Spooner>
anoldhacker : What are you trying to do exactly?
<anoldhacker>
It's in the 1.9.3 docs
yasushi has joined #ruby
niklasb has joined #ruby
<anoldhacker>
I'm trying to break up a line consisting of numbers, dates, and strings. The fields are space separated, and spaces inside the strings are allowed.
<bnagy>
but depends exactly what you want to end up with
xorox90 has joined #ruby
<bnagy>
that \G voodoo looks horrible though
<bnagy>
but from a quick skim, it matches where the last match finished, and there's no last match in your examples
yasushi has quit [Remote host closed the connection]
charliesome has joined #ruby
<anoldhacker>
In my case, the field set is fixed. So a generated regexp will solve the problem. But \G (which is REALLY powerful) appears to be broken...
yasushi has joined #ruby
<anoldhacker>
1.9.3p194 on Darwin
<bnagy>
ok well if I found that regexp in any code I was working on I would go and stab the comitter
yuriy has joined #ruby
himsin has quit [Remote host closed the connection]
doherty has joined #ruby
yasushi has quit [Ping timeout: 268 seconds]
<doherty>
I was trying to do `sudo gem install bundle` and it bailed out with "File not found: lib ERROR: While generating documentation for bundle-0.0.1" What should I be doing to fix this?
yasushi has joined #ruby
<fowl>
doherty: doc generation is done after the gem installs
<fowl>
doherty: so if you dont need them locally you're fine
<doherty>
Yes, I saw that
<doherty>
I would prefer to have them locally
<fowl>
gem install rdoc to update rdoc
<Muz>
doherty: you really mean 'gem install bundler'
<banisterfiend>
doherty: if you're using pry to read documentation, u dont need them pregenerated as it grabs them only when it needs them
<Muz>
'bundle' is a placeholder gem that depends on bundler, to have it install bundler.
<doherty>
but I was more concerned that not being able to generate documents indicated a serious problem with the ruby setup. It's a fairly basic functionality so when the very first ruby command you run dies, you start wondering if you've chosen the right tool :)
<Muz>
That error doesn't really matter, it's just the placehlder gem being shoddily written.
<banisterfiend>
doherty: take the time to setup rvm or rbenv
<fowl>
+1 banisterfiend
<Muz>
What you're really be worried about and referencing is the bundler ri/rdoc.
<banisterfiend>
there's usually something busted about distro versions of ruby
<bnagy>
rbenv rbenv rbenv
<doherty>
I'll take a look
yasushi has quit [Ping timeout: 240 seconds]
bluenemo_ has joined #ruby
bluenemo_ has quit [Changing host]
bluenemo_ has joined #ruby
yasushi has joined #ruby
tommyvyo has joined #ruby
elhu has joined #ruby
<dr_bob>
anoldhacker: you said fields are space delimited but spaces are allowed in fields. That does not work.
Eplemosen has quit [Quit: NOPE]
<dr_bob>
What exactly is the format?
<anoldhacker>
In general, no. But if you don't allow successive string fields, it can work. (Dates and numbers start with digits...)
<anoldhacker>
Very ugly, but what I'm supposed to support.
<dr_bob>
So you have alternating fields starting with a digit and fields starting with no digit?
tiripamwe has quit [Ping timeout: 244 seconds]
<anoldhacker>
My original regexp had problems even without the \G thing. But, as I said, this works better with a composed regexp
liluo has quit [Remote host closed the connection]
nanderoo has quit [Quit: Leaving.]
liluo has joined #ruby
jgarvey has joined #ruby
senny has quit [Remote host closed the connection]
<bnagy>
how about splitting on space and just using a simple token parser?
jrajav has joined #ruby
<bnagy>
by the sounds all you need to do is rejoin any \w+ next to \w+ and the rest are correct
<jrajav>
dominikh: Yeah I was clearly being literal, and I was also clearly referring to just the act of typing. You should try coffee instead of being an ass for no apparent reason -- might start your morning off a little better
<dr_bob>
because \s* matches the empty string, i.e. everywhere
<bnagy>
oh right I see
emsilva has joined #ruby
arietis has joined #ruby
<dr_bob>
fields which are not numbers might contain digits, I figure
<bnagy>
hard to see why \b...\b? isn't just better then :/
Paul-Atreides has left #ruby ["Leaving"]
<dominikh>
first of all, my morning started 10 hours ago. second, coffee would give me diarrhea, so probably not better, no.
fmcgeough has joined #ruby
<dr_bob>
\s* will eat the whitespace and avoid split
<dr_bob>
err strip
<bnagy>
and yet... still retraded, unreadable and breakable
Inoperable has joined #ruby
<dr_bob>
like?
vectorshelve has quit [Quit: Page closed]
<bnagy>
well not for this input, but he said something about dates for example
aezop has joined #ruby
CptJeanLucPicard has joined #ruby
<Inoperable>
huh TextMate sources are on git
<bnagy>
anyway I have said my thing
<Inoperable>
i missed that
<Inoperable>
somehow
<jrajav>
Inoperable: Well it only happened what, two days ago?
<macer1>
textmate is open source?
<macer1>
x.x
<Muz>
The source for the alpha, at least.
snearch has joined #ruby
bluenemo_ has quit [Remote host closed the connection]
<Muz>
"Come, find and report our bugs for free, then let us charge you for the luxury of pre-compiling it!"
<Inoperable>
i booted into os x like after few weeks
<macer1>
D:
<Inoperable>
and suddenly text mate2 gets an update and tells me its opensource
<Inoperable>
and i bought sublime for 59$ yesterday..
<Inoperable>
hehe
<macer1>
sublime text 2 > text mate
<jrajav>
^
<chiel>
vim > * ;D
<chiel>
oh yeah I went there, sorry!
* chiel
hides
<jrajav>
I use both
<macer1>
sublime text have vim mode
<macer1>
it's cool
<Inoperable>
chiel yup, nothing can beat vim
<jrajav>
macer1: Heh, do you actually use it?
sendoushi has quit [Read error: Connection reset by peer]
<chiel>
but why would I buy st2, when i already have vim?
<chiel>
vim is free
<macer1>
not really
Musok has joined #ruby
<chiel>
you can find just about ANY plugin for it, too :p
<jrajav>
hoelzro: That might be a good idea, but it would mess with muscle memory of how many tabs it takes to get to someone for any given prefix string
<shevy>
jrajav, they broke your bot earlier
<jrajav>
shevy: Oh?
<jrajav>
Then how is it still running
<jrajav>
?
<shevy>
<macer1> Bot is dead...back to work :P
<shevy>
^^^ macer1 did
<jrajav>
Like it wasn't responding for a while?
<hoelzro>
jrajav: perhaps, if you use that type of completion
<workmad3>
hoelzro: yeah, I always get annoyed with that... I used to use a client that went 'most recently active' for tab-completion and it's ruined me for other clients :)
<macer1>
emm no
<macer1>
I said it was lagging
<workmad3>
>> "Shevy lies!"
<al2o3cr>
(String) "Shevy lies!"
<shevy>
jrajav, dunno. I am just showing you who must be punished :-)
<hoelzro>
I don't see why it'd be undoable in irssi
nari_ has joined #ruby
<macer1>
>> "Hi jrajav. I am so laggy today :("
<al2o3cr>
(String) "Hi jrajav. I am so laggy today :("
franckverrot has left #ruby [#ruby]
cantbecool has joined #ruby
becomingGuru has joined #ruby
Musok has quit [Remote host closed the connection]
<macer1>
would you mind if I'll try to kill the bot jrajav :P?
miho has joined #ruby
banisterfiend has quit [Ping timeout: 252 seconds]
<jrajav>
Not right now
banisterfiend has joined #ruby
jjbohn has joined #ruby
tcopp has joined #ruby
Inoperable has quit [Quit: Inoperable]
<macer1>
Not right now = don't kill the bot, or don't kill the bot right now :P?
<macer1>
I mean
<macer1>
you can kill the bot or dont kill right now
<jrajav>
I don't think you CAN kill the bot, but just in case, don't try right now ;)
<macer1>
ok :P
<jrajav>
I'm working on it
<jrajav>
atm
the_jeebster has joined #ruby
cakehero has joined #ruby
uris has joined #ruby
freeayu has joined #ruby
<Muz>
jrajav: :).
pu22l3r has joined #ruby
Jay_Levitt has joined #ruby
cousine has joined #ruby
<jrajav>
I'm going to change the way the bot treats stdout and stderr
<jrajav>
To complete my shameless copying of ##javascript's ecmabot
<jrajav>
The constant PMing is getting kind of annoying, and it makes it harder for everyone to see what's going on rather than just the person running it
<macer1>
jrajav: can you share the source :P?
<macer1>
it will be interesting to look at it
<jrajav>
Of course
<jrajav>
I already have the old version (which was in node.js) on github
<jrajav>
I'll replace it with this one today
centipedefarmer has quit [Quit: This computer has gone to sleep]
<macer1>
I see
vlad_starkov has quit [Remote host closed the connection]
<jrajav>
Spoilers: It's pretty boring
t6222 has joined #ruby
<jrajav>
Check out cinch and Open3.popen3 and you basically know all of it
<macer1>
only 50 lines of code? o.O
<jrajav>
That, plus a clever combination of a chroot and sudo
<jrajav>
Less than that even
<macer1>
al2o3cr: ping
<jrajav>
Did you find the node.js version?
<macer1>
al2o3cr: version
<macer1>
yes :S
<jrajav>
I thought ping was kind of redundant when you can just try a script :P
<jrajav>
Alos
<jrajav>
>> RUBY_VERSION
<al2o3cr>
stderr:
<al2o3cr>
exit status: 1
<al2o3cr>
[FATAL] Failed to create timer thread (errno: 11)
<jrajav>
:O
RegEchse has joined #ruby
<macer1>
DUM DUM DUMMM
<iamtakingiteasy>
>> echo god
<al2o3cr>
[FATAL] Failed to create timer thread (errno: 11)
<al2o3cr>
stderr:
<al2o3cr>
exit status: 1
<macer1>
@_@
<macer1>
tango down? :D
<jrajav>
Huh.
<macer1>
>> `echo @_@`
<al2o3cr>
[FATAL] Failed to create timer thread (errno: 11)
<al2o3cr>
exit status: 1
<al2o3cr>
stderr:
<macer1>
it's not me this time
<macer1>
:P
pu22l3r has quit [Remote host closed the connection]
<jrajav>
I need to start logging it
<jrajav>
My scrollback is like barely 3 screens
<jrajav>
:P
a_a_g has quit [Quit: Leaving.]
centipedefarmer has joined #ruby
<macer1>
>> ":("
<al2o3cr>
stderr:
<al2o3cr>
exit status: 1
<al2o3cr>
[FATAL] Failed to create timer thread (errno: 11)
<macer1>
al2o3cr: pls work k thx
<jrajav>
Well, time to kill the old bot
al2o3cr has quit [Remote host closed the connection]
<jrajav>
You will be missed
miho has quit [Read error: Connection reset by peer]
<macer1>
:(
<macer1>
we will remember you forever al2
uris has quit [Ping timeout: 240 seconds]
miho has joined #ruby
<macer1>
run the new one :D
dpk has quit [Quit: Asleep at the keyboard.]
jrist-afk is now known as jrist
<jrajav>
macer1: Still writing it, and doing other stuff at the same time
becomingGuru has quit [Quit: Leaving.]
* macer1
afk
<macer1>
have fun with bots and stuff ^^
vegeek-ng has quit [Ping timeout: 240 seconds]
bequick has joined #ruby
tayy has joined #ruby
k_89 has quit [Ping timeout: 268 seconds]
carloslopes has joined #ruby
Inoperable has joined #ruby
pu22l3r has joined #ruby
bluenemo_ has joined #ruby
bluenemo_ has quit [Read error: Connection reset by peer]
jjbohn has quit [Read error: Connection reset by peer]
jjbohn has joined #ruby
andrewhl has joined #ruby
v0n has joined #ruby
vitor-br has joined #ruby
vlad_starkov has joined #ruby
mahmoudimus has joined #ruby
t6222 has quit [Remote host closed the connection]
t54764 has joined #ruby
nacengineer has joined #ruby
mahmoudimus has quit [Client Quit]
becomingGuru has joined #ruby
imami|afk is now known as banseljaj
Speed has joined #ruby
Speed has joined #ruby
Speed has quit [Changing host]
Criztian has quit [Remote host closed the connection]
adeponte has joined #ruby
devdazed has quit [Quit: Bye]
ananthakumaran has joined #ruby
sendoushi has joined #ruby
becomingGuru has quit [Client Quit]
tayy has quit [Remote host closed the connection]
Criztian has joined #ruby
devdazed has joined #ruby
adeponte has quit [Ping timeout: 268 seconds]
eikko has quit [Ping timeout: 244 seconds]
lolmaus has quit []
FriedBob has joined #ruby
sendoushi has quit [Remote host closed the connection]
dhruvasagar has joined #ruby
<FriedBob>
When setting up a rdoc command, what would the syntax be for using multiple patterns for the --exclude option? I haven't been able to find anything that says anything about doing that.
emmanuelux has quit [Ping timeout: 246 seconds]
johnlcox has joined #ruby
stopbit has joined #ruby
bbttxu has joined #ruby
axl_ has joined #ruby
internet_user has joined #ruby
dereknelson has quit []
pen has joined #ruby
ph^_ has quit [Ping timeout: 245 seconds]
sailias has joined #ruby
beneggett has joined #ruby
dpk has joined #ruby
s1n4 has joined #ruby
fbrn has joined #ruby
<fbrn>
hy all
s1n4 has quit [Client Quit]
<fbrn>
this room official ruby language?
awarner has joined #ruby
g_rotbart has quit [Remote host closed the connection]
clocKwize has joined #ruby
axl_ has quit [Read error: Connection reset by peer]
v0n has quit [Ping timeout: 246 seconds]
axl_ has joined #ruby
<FriedBob>
fbrn: Given that it is #ruby and not ##ruby, I would assume so based on Freenode policies.
jrajav has quit [Quit: The best darkness is strange and surprising]
axl_ has quit [Read error: Connection reset by peer]
Targen has quit [Read error: Connection reset by peer]
<FriedBob>
Is there somewhere I can get more indepth information on rdoc, specifically the --exclude? Someone told me it can take multiple exclude options, though I don't see that mentioned in the documenation. Nor do I see a way to specify multiple explude paths using a seperator for the regex pattern.
bequick has quit []
brasten has joined #ruby
yasushi has quit [Ping timeout: 246 seconds]
<fowl>
FriedBob: --help says --include can be used more than once so many --exclude can too
<fowl>
maybe*
darren_ has quit [Remote host closed the connection]
<FriedBob>
fowl: Yeah. I was just hoping to get something more solid before I started patchign this program and protentially breaking things.
sendoushi has joined #ruby
pyreal has joined #ruby
Middy has joined #ruby
macer1 has quit [Ping timeout: 272 seconds]
yasushi has joined #ruby
beneggett has quit [Quit: Computer has gone to sleep.]
v0n has joined #ruby
d3vic3 has joined #ruby
monobit has joined #ruby
erichmenge has joined #ruby
MissionCritical has joined #ruby
monobit is now known as asteve
d3vic3 has quit [Client Quit]
whicling has joined #ruby
<shevy>
FriedBob software tends to break all the time :)
axisys_ has joined #ruby
tagrudev has quit [Remote host closed the connection]
<pi3r>
and wanted to refactor some classes into modules :)
<apeiros_>
what you *can* do is extend a class (or module) with a module. that will give you the module's instance methods as class methods on the extended object
jso has quit [Max SendQ exceeded]
Doc_X has quit [Quit: Leaving.]
beneggett has joined #ruby
<pi3r>
apeiros_: yep
yasushi has quit [Remote host closed the connection]
<apeiros_>
shevy: the only thing I want in core ruby is being able to un-include/un-extend a module
MarioEIU has joined #ruby
<apeiros_>
shevy: that's one way
jso has quit [Max SendQ exceeded]
<apeiros_>
module_function works the same as private/protected/public
<shevy>
interesting. never saw that before
<apeiros_>
i.e., either provide it a name (as symbol or string) or don't provide it any argument, which means every subsequently defined instance method will be made a module_function
jso has joined #ruby
haxrbyte_ has quit [Ping timeout: 240 seconds]
<apeiros_>
oh, actually my paste won't work. if you truly want class methods, callable from external, then module_function is the wrong tool
<davidcelis>
CS doesn't really fix the stupid parts of JS, though; just makes it look like Ruby
<kalleth>
workmad3: yes, but i'm not a real developer
<kalleth>
workmad3: thereofre i don't use C/C++
<kalleth>
:p
<pi3r>
This page requires a browser that supports WebGL. :( I guess i'll just have to get back to work :D
<kalleth>
work? hahahahahahha
<davidcelis>
once you're familiar with the dumb parts of javascript, they are easily avoidable, so why add the extra compilation layer? just for syntactic sugar and to feel like you're still programming in Ruby?
<kalleth>
i'm on the last 24hours of my notice period
<davidcelis>
not worth it IMO
ninegrid has quit [Quit: brb]
<kalleth>
davidcelis: perhaps, perhaps not
<fowl>
pi3r: if you're in chrome to go chrome://flags and enable webgl and native client
<kalleth>
i've worked in CS's object model and in Js's
<shevy>
I have not used CS but it's syntax is much nicer than JS
yasushi has joined #ruby
<shevy>
its syntax
<shevy>
hmmm
<shevy>
english. difficult language!
<kalleth>
oh, its not
<shevy>
whoa... llvmruby?
jso has joined #ruby
<fowl>
what do you mean shevy
snearch has quit [Quit: Verlassend]
<fowl>
syntax is the same (c-like)
kernelpanix has joined #ruby
<workmad3>
kalleth: probably take a bit of work, but I bet someone dedicated (like you :P ) could start writing ruby that goes to LLVM, goes through emscripten and comes out as JS ready for the browser ;)
davidcelis has quit [Quit: K-Lined.]
<kalleth>
yeah, but i'm lazy
<kalleth>
:|
* kalleth
looks round to make sure his future boss isn't in this channel
jso has quit [Max SendQ exceeded]
<workmad3>
heh
beneggett has quit [Quit: Computer has gone to sleep.]
<kalleth>
start new job on thurs
<kalleth>
actually getting to play with rails properly
<kalleth>
though less pure ruby work
jso has joined #ruby
<kalleth>
more frontend, more smaller projects using actual up to date libs :)
emmanuelux has joined #ruby
Doc_X has quit [Remote host closed the connection]
Doc_X has joined #ruby
yasushi has quit [Ping timeout: 268 seconds]
jso has quit [Max SendQ exceeded]
becomingGuru has quit [Quit: Leaving.]
djdb has quit [Quit: Ухожу я от вас (xchat 2.4.5 или старше)]
ckrailo has joined #ruby
maesbn has quit [Remote host closed the connection]
rob_ has joined #ruby
<rob_>
hi, can anyone tell me why when i do 'rackup 2>&1 | logger' stdout doens't get logged to syslog?
baroquebobcat has joined #ruby
v0n has quit [Ping timeout: 246 seconds]
mockra has joined #ruby
axl_ has quit [Read error: Connection reset by peer]
<al2o3cr>
-e:1:in `eval': Permission denied - echo sad macer1 :( (Errno::EACCES), from (eval):1:in `<main>', from -e:1:in `eval', from -e:1:in `<main>'
<macer1>
em
<macer1>
I want echo back :(
<jrajav>
Permission denied? Uh.
<jrajav>
That should be a shell builtin right? :/
<jrajav>
Does `` go to a shell or just path lookups?
jchauncey has quit [Quit: jchauncey]
<macer1>
hmm
DrShoggoth has joined #ruby
<macer1>
executing programs from path
<macer1>
I think
<macer1>
like echo,cat etc
<jrajav>
Well, the only programs on the path in the chroot are sudo and ruby :P
<macer1>
meh
<jrajav>
But I wouldn't have expected a Permission denied
theRoUS has joined #ruby
theRoUS has joined #ruby
theRoUS has quit [Changing host]
<Muz>
>> `ruby -pe "penis"`
<al2o3cr>
-e:1:in `eval': Permission denied - ruby -pe "penis" (Errno::EACCES), from (eval):1:in `<main>', from -e:1:in `eval', from -e:1:in `<main>'
shevy has quit [Ping timeout: 268 seconds]
jlogsdon has joined #ruby
<macer1>
Muz: you are not allowed to use penis on a bot :P
dr_bob has left #ruby [#ruby]
GordonFreeman has quit [Ping timeout: 245 seconds]
ephemerian has joined #ruby
carloslopes has quit [Quit: Leaving.]
peterhellberg has quit [Remote host closed the connection]
vitor-br has joined #ruby
burgestrand has quit [Quit: Leaving.]
<macer1>
uh
<macer1>
how was ruby string replacing
<macer1>
not #replace
dhruvasagar has quit [Ping timeout: 244 seconds]
burgestrand1 has joined #ruby
davidcelis has joined #ruby
davidcelis is now known as Guest16595
TheShadowFog has quit [Read error: Connection reset by peer]
<chiel>
macer1: gsub
benson has joined #ruby
<chiel>
macer1: or gsub!
<macer1>
ok
<macer1>
thx
<chiel>
depending on whether you want it to be destructive
<jrajav>
Muz: Huh. That should have worked
Guest16595 has quit [Client Quit]
<chiel>
macer1: basically if you use regular gsub (without!), you'll need to store the return value somewhere
<jrajav>
>> `ruby -e "puts 'erm'"`
<al2o3cr>
-e:1:in `eval': Permission denied - ruby -e "puts 'erm'" (Errno::EACCES), from (eval):1:in `<main>', from -e:1:in `eval', from -e:1:in `<main>'
davidcel_ has joined #ruby
baphled has quit [Read error: Operation timed out]
aezop has quit [Ping timeout: 272 seconds]
<jrajav>
I guess `` is the thing that's raising permission denied?
<macer1>
but why
<jrajav>
I unno
davidcel_ is now known as davidcelis
davidcelis has quit [Changing host]
davidcelis has joined #ruby
<jrajav>
Is there really a good reason to have access to it?
<jrajav>
All you can run is ruby and sudo
alvaro_o__ has joined #ruby
<jrajav>
And you're already running ruby
<davidcelis>
>> `sudo ruby`
<al2o3cr>
-e:1:in `eval': No such file or directory - sudo ruby (Errno::ENOENT), from (eval):1:in `<main>', from -e:1:in `eval', from -e:1:in `<main>'
<macer1>
`echo`
<macer1>
is cool
<macer1>
:D
becomingGuru has joined #ruby
becomingGuru has quit [Remote host closed the connection]
bradhe has joined #ruby
<jrajav>
>> puts 'Why is this not good enough?'
<al2o3cr>
(NilClass) nil, Console: Why is this not good enough?
becomingGuru has joined #ruby
Criztian has quit [Remote host closed the connection]
<unrar>
Yes Muz, I asked Python developers and now I ask Ruby developers :P
* Muz
just shakes his head.
<davidcelis>
unrar: programming language benchmarks are rarely useful, fyi. ruby and python are extremely comparable in speed. ruby's slowness is a myth
<canton7>
and I'm willing to bet they all said 'no', and we'll all say 'yes' :P
arturaz has quit [Ping timeout: 276 seconds]
verto|off is now known as verto
<davidcelis>
canton7: i'm gonna say "no"
<canton7>
shock horror! :O
<davidcelis>
canton7: lets not pollute the community with people who can't make their own decisions :)
<fowl>
lol
<Muz>
davidcelis: we have enough of those people. They use Rails. ;)
savage- has joined #ruby
<davidcelis>
Muz: ಠ_ಠ
<shevy>
unrar the main difference between ruby and python is the philosophy
<Muz>
I'm sure there's a boilerplate template or blog post instructing me on how this joke should go.
<davidcelis>
Muz: `rails g scaffold Joke` ?
<Muz>
:)
<canton7>
python bungs way too much stuff into the global namespace, and has much uglier "map/reduce" syntax
<canton7>
(imo)
<unrar>
and what things are different of the philosophy, shevy?
<shevy>
unrar the whole point about "more than one way to do it" also means that people try to find new ways in a creative or explorative manner. see the creativity you found in _why for instance
<canton7>
also python lacks blocks. blocks are one of ruby's hugely strong points
faen has quit [Ping timeout: 265 seconds]
pu22l3r has quit [Remote host closed the connection]
<unrar>
more than one way to do it... i think that it's from Perl :P
<shevy>
unrar, well consider this - in python, self is explicit. I dont think a real OOP language should be too stupid to know what is self
<unrar>
there's more than a way to do it is a typical phrase of Programming Perl
ChampS666 has joined #ruby
kyktommy has quit [Quit: kyktommy]
<shevy>
ruby is perl with the better syntax
<unrar>
I also like Perl
<shevy>
if you'd be a perl hacker, ruby would be nicer for you
randomautomator has joined #ruby
<shevy>
with python, it is harder to say
<fowl>
lol perl my arg = shift @_ <- what the fuck is this archaic shit i just want to pass parameters
<shevy>
hehe
chridal has quit [Quit: leaving]
jjbohn has joined #ruby
<shevy>
unrar, python also has some very good things. better documentation often, better bindings to GUI than ruby too
kn330 has joined #ruby
<pen>
ruby is perl??
<unrar>
well, there are some things of Perl i hate
<shevy>
ruby is the better perl
<pen>
how come?
<shevy>
perl OOP is unusuable shit
<macer2>
jrajav: can you add gem install :p?
burgestrand1 has quit [Quit: Leaving.]
<shevy>
my ($self) = @_;
<unrar>
I remember I did two IRC bots some months ago: one in perl and one in Python, they did the same
<al2o3cr>
-e:1:in `eval': cannot load such file -- active_support (LoadError), from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require', from (eval):1:in `<main>', from -e:1:in `eval', from -e:1:in `<main>'
<unrar>
Perl were about 3 times larger than Python
<unrar>
and I also did one in PHP
<shevy>
my $self = { _firstName => undef }:
<shevy>
perl must die
<unrar>
perl is oldie, very oldie
<shevy>
but it's the grandpa of ruby, so we should be nicer to it
<unrar>
i just played with it because of Programming Perl book
<shevy>
PHP is ugly but it kind of dominates the www
<macer2>
^
<unrar>
I like PHP for www, well, I preffer PHP that CGI with perl
<unrar>
shevy: I preffer Python for the "old-style" programming, but I preffer Ruby for OOP
<atmosx>
old style meaning procedural?
<unrar>
Well, I did more OOP things in Ruby that in Python
<atmosx>
I need to learn C (some day in the future, when I grow old)
<unrar>
yes, I didn't remember the word :P
<shevy>
unrar, I really think the philosophy is the biggest difference
dtribble has joined #ruby
indian has quit [Ping timeout: 245 seconds]
<unrar>
And where can I see the differences between the 2 philosophies?
<shevy>
in ruby you can pass a block to any method
<shevy>
in python... I dont know... decorators? can they do the same?
<unrar>
I have Programming Perl 4th Edition, Learning Python 4th Edition, Programming Python 4th Edition
<unrar>
but i have nothing of Ruby :(
<shevy>
unrar, did you read the old interview from matz?
<atmosx>
unrar pragmatic bookshelf
<shevy>
from 2003
<unrar>
nope, i came from Perl
Quadrant_ has quit [Ping timeout: 245 seconds]
<shevy>
unrar, http://www.artima.com/intv/rubyP.html I read it back then. I switched from PHP and considered both python and ruby. that interview made me choose ruby first, and I sticked with it
<unrar>
I just started exploring Py a few months ago, and Ruby... I remembered Ruby yesterday lol
<unrar>
But i read that Python's GUIs are very pretty
<fowl>
unrar: the indentation is limiting
carloslopes has quit [Client Quit]
<unrar>
but i never tested, i have to read Learning Python and Programming Python
jasonLaster has quit [Remote host closed the connection]
<unrar>
but I haven't "Learning Ruby" or "Programming Ruby" :(
<fowl>
unrar: for example in python you can't have a lambda that is more complicated than one expression
clocKwize has quit [Quit: clocKwize]
carloslopes has joined #ruby
<unrar>
Isn't there any eBook with a good Ruby book?
<unrar>
fowl: lambdas are those "x * x in x = 3" or something like that?
<unrar>
there is something like that in Haskell, I think
froy has joined #ruby
<fowl>
being a rubyist, i thought maybe i could wrap the lambda in () like in almost every other programming language ever.. nope.
Tomasso has joined #ruby
maxmmurphy has quit [Quit: maxmmurphy]
<fowl>
unrar: no lambdas are anonymous functions
williamcotton has joined #ruby
<Mon_Ouie>
In Haskell it's \x -> x * 2
<shevy>
wow
<shevy>
I never knew that the indentation limited lambdas
<fowl>
you use them like map(lambda x: x * 2, list)
<fowl>
or maybe the other way around
<shevy>
why did guido decide to use indent anyway?
fbrn has left #ruby [#ruby]
gavit has quit [Read error: Connection timed out]
<nedbat>
shevy: until you get to lambdas, it's not a problem, and then it really is.
gavit has joined #ruby
FriedBob has left #ruby [#ruby]
<fowl>
shevy: i dunno but wherever you would be limited by indentation in nimrod you *can* wrap in () so its not a problem
beneggett has joined #ruby
<nedbat>
shevy: guido has already said that if he were to design a new language now, he wouldn't use indents, because it's a huge distraction. I don't know if he really meant it.
beakerma_ has joined #ruby
<shevy>
hmm
<nedbat>
shevy: btw, I'm a pythonista, here b/c i'm learning about ruby, if you need someone to speak for the python mindset.
axl__ has joined #ruby
<unrar>
So, how can I learn more ruby
<uris>
unrar: read a book, and write some code
atmosx has quit [Quit: Computer has gone to sleep.]
<uris>
you might not even need a book: rubylearning.com
Morkel has quit [Quit: Morkel]
talsamon has joined #ruby
ianbrandt has joined #ruby
beakerman has quit [Ping timeout: 260 seconds]
td123 has joined #ruby
<unrar>
I love O'Reilly books, but they preffer Perl and Python :P
axl_ has quit [Ping timeout: 276 seconds]
axl__ is now known as axl_
williamcotton has quit [Quit: williamcotton]
elaptics is now known as elaptics`away
elaptics`away is now known as elaptics
bam has joined #ruby
jchauncey has quit [Quit: jchauncey]
pdtpatrick has joined #ruby
tvw has quit [Remote host closed the connection]
<shevy>
I see nedbat . I wanted to learn python, but this transition phase is no fun
<shevy>
I will wait until python 2 is dead
himsin has joined #ruby
miho has quit [Quit: miho]
<davidcelis>
like that will happen
miho has joined #ruby
<unrar>
Oh nedbat
<unrar>
The thing i hate of Python is this version caos between 2.X and 3.X
ChampS666 has quit [Ping timeout: 268 seconds]
mrsolo has joined #ruby
haxrbyte_ has quit [Remote host closed the connection]
<shevy>
davidcelis well in the long run
<shevy>
I am sure it'll get better month by month
<davidcelis>
shevy: i want to believe
<davidcelis>
i want to
<doherty>
How can I dump out the contents of some data structure or object in a human-readable way?
<nedbat>
unrar: the concepts are not so different between the two
gavit has quit [Read error: Connection timed out]
bier has joined #ruby
gavit has joined #ruby
elhu has quit [Quit: Computer has gone to sleep.]
<shevy>
unrar for me it is a bit difficult to switch now, because I maintain a few libraries and projects in ruby now
Hawklord has joined #ruby
Hawklord has quit [Client Quit]
<Spooner>
shevy : Refusing to use unshift, rather tahn push, does mean it is much more likely to fail to load properly (since it will try to load your file in every gem before your lib). Most of the time it will work...
<shevy>
they have become quite important in that I would try to maintain them in other languages too
mike4_ has joined #ruby
<shevy>
dunno
MissionCritical has quit [Ping timeout: 252 seconds]
<mike4_>
is ruby OO?
<shevy>
I never use array.unshift
<shevy>
though
<mike4_>
lol
<shevy>
I do use array[0,1] = "foo"
<nedbat>
mike4_: almost everything these days is OO
<mike4_>
seems so.
<Spooner>
mike4_ : Ruby is more 00 than any other language I've heard of (which is not all).
<shevy>
or array[-1,1] = "bla"
<shevy>
mike4_, object.method("argument")
<nedbat>
Spooner: smalltalk probably wins.
<mike4_>
sounds nice. k
khakimov has joined #ruby
<shevy>
in php... $object->method("argument");
<Spooner>
nedbat : I dunno. There is OO and OO. Ruby is at quite a different end of OO from most things.
<shevy>
ruby is a bit prototypic too
<nedbat>
Spooner: no doubt. i was just pointing out the language out beyond it.
<shevy>
Struct.new
<mike4_>
I was wanting to learn either PERL, Ruby, or Python. Im leaning for ruby, cuz its kinda popular.
<shevy>
x = method(:bla)
<shevy>
x.call
<shevy>
introspection in the Io language was awesome though
<shevy>
mike4_ hmm why perl?
<Spooner>
mike4_ : Choose the one you prefer. They are all OO, to different extents.
elaptics is now known as elaptics`away
<shevy>
ruby and python I can understand
<doherty>
mike4_: Perl and Python are also very popular.
<Spooner>
And all do the same sort of thing.
<shevy>
yeah, they have very much overlapping niches
<doherty>
mike4_: What do you plan on doing, aside from learning?
faen has joined #ruby
<shevy>
they are like brothers
bluenemo has joined #ruby
bluenemo has joined #ruby
bluenemo has quit [Changing host]
pu22l3r has joined #ruby
<shevy>
even PHP
<mike4_>
I see.
* Spooner
kicks PHP until it bleeds.
<uris>
OO is a programming paradigm, you can do OOP in almost any language
<shevy>
yeah
<uris>
just because a language supports OOP, doesn't mean your program is OO
<Spooner>
Ruby/Python/Perl are somewhat supersets of PHP. PHP isn't a general purpose language and thus is extremely limited.
<shevy>
and there are different ways to define it too
<uris>
i've seen some shity stuff in ruby/java taht isn't OO
dpk has quit [Quit: Asleep at the keyboard.]
<davidcelis>
you should try object oriented brainfuck
<shevy>
for me, I lean more towards the prototypic way to define OOP... but there are less prototypic based languages and their syntax is ALL crap...
<doherty>
object oriented assembly :)
<shevy>
Io uses := or =: for assignment (I forgot ) ... and = means "update slot"... I hate this :(
<Spooner>
Actually, I've written ASM using OO concepts (I had data structures with "method" pointers and data in it). Really.
<shevy>
data structures
TPFC-SYSTEM has joined #ruby
<shevy>
data structures are a very important concept
<shevy>
in OOP
<shevy>
much more so than "how to define inheritance" in my opinion
<Spooner>
shevy Do you mean Pascal? That has x := 1 (like our =) and x = 1 (like our ==)
* doherty
enjoyed when the professor said "Obviously, a constructor has /no/ return type, or return value"
<fowl>
Spooner: stop impressing me
<davidcelis>
assembly does a good job of domain-specific problems, but i don't feel like it handles multiple inheritance very well out of the box
<doherty>
Having built constructors before, I was like o______________________________________________________________O
<shevy>
Spooner, hmm no... Io uses stuff like x := "foo" for assignment. And = for updating this variable... I think the last time I wrote anything in Pascal was in school... 15 years ago or some such :P
<Spooner>
fowl It was a washing machine simulator. Mine had animated ascii art and OO. It was epic overengineering.
<davidcelis>
Spooner: link
<fowl>
lol a washing machine simulator thats a first i think
<davidcelis>
Spooner: i once overengineered a Java program that made a bunch of turtles do the Can-Can... but that was long ago
<Spooner>
A difference between assign and update? How very odd.
<uris>
and workign in mars
workmad3 has quit [Ping timeout: 260 seconds]
<Spooner>
davidcelis : Sadly, it was a million years ago for a uni project. Code long since been eaten by time, I'm afraid.
<davidcelis>
Spooner: yeah likewise
<davidcelis>
wow i was about to say how awesome that JLouisRamblings blog looked
<davidcelis>
and then realized it's just a fucking blogspot
<davidcelis>
blogspot lookin' pretty good now
mathie has quit [Quit: Sleeping...]
<fowl>
shevy: in io := is actually a shortcut for setSlot() if you show the code of the method you'll see that
havenn has joined #ruby
<fowl>
getSlot("method") code
chichou has quit [Remote host closed the connection]
chichou has joined #ruby
jrajav has quit []
MissionCritical has joined #ruby
nobitanobi has joined #ruby
<davidcelis>
hahahahhahah RVM
* lupine_85
snuggles rvm
<davidcelis>
shit like `time gem --version` doesn't work if you use RVM
<davidcelis>
because it replaces `gem` with a function
<davidcelis>
but then again, what the fuck doesn't RVM replace with a function
<nobitanobi>
Trying to create a gem wrapper for the Yelp API. I have this: https://gist.github.com/3342596 — but getting 'uninitialized constant Yelpi::Client::Oauth' — What should I do to make it accessible?
<davidcelis>
let's break UNIX. that sounds like a good idea
apok has joined #ruby
beneggett has quit [Quit: Computer has gone to sleep.]
maxmmurphy has left #ruby [#ruby]
pu22l3r has quit [Remote host closed the connection]
chichou has quit [Ping timeout: 260 seconds]
<Spooner>
nobitanobi : It is OAuth, not Oauth
<fowl>
davidcelis: i hear you have to have ruby installed to install rvm, lul
pu22l3r has joined #ruby
<Spooner>
You need ruby installed to install pik (on Windows), which is nice :)
adamkittelson has joined #ruby
* nobitanobi
hides from Spooner
<nobitanobi>
thanks.
<fowl>
Spooner: at that point i would have already installed the latest ruby and dev kit and been done with it
<Spooner>
fowl But if you have the latest ruby and dev kit, why use pik? :D
baphled has joined #ruby
<fowl>
exactly
axl_ has quit [Read error: Connection reset by peer]
voodoofish430 has joined #ruby
axl_ has joined #ruby
tk_ has quit [Quit: ばいばい]
<pen>
:o
jrajav has joined #ruby
<jrajav>
macer2: What do you mean by gem install?
<macer2>
installing gem for bot
<macer2>
bot: gem install rails
<jrajav>
Hm.
<jrajav>
Sure, why not. I'll add it to the todo list
<jrajav>
As long as someone doesn't go ahead and install ALL of them, that would probably fill up the partition :P
khakimov has quit [Quit: Computer has gone to sleep.]
cantonic has quit [Quit: cantonic]
havenn has quit [Remote host closed the connection]
edmmd has joined #ruby
<edmmd>
he guys
<edmmd>
my jekyll doesn't generate my new post
<edmmd>
there is no error, if someone has any ideas ...
<jrajav>
I have many ideas
jbw has quit [Read error: Operation timed out]
<davidcelis>
>> RUBY_VERSION
<al2o3cr>
(String) "1.9.3"
specialGuest has joined #ruby
miho has quit [Quit: miho]
<Spooner>
edmmd : Tried in #jekyll?
<jrajav>
davidcelis: Did you know that the bot's code is up on github now?
<davidcelis>
jrajav: yep, saw it
<davidcelis>
4 space tabs
<davidcelis>
tsk tsk
elux_ has joined #ruby
micadeyeye has joined #ruby
<jrajav>
Okay seriously does EVERYONE in here swear by 2 space tabs? :P
<davidcelis>
yeah
<davidcelis>
except shevy
<jrajav>
And me
ph^ has joined #ruby
tommyvyo_ has joined #ruby
<davidcelis>
he uses 8 spaces
<micadeyeye>
can't install oversip in Fedora. here is the error I keep getting - http://fpaste.org/1zoR/
<davidcelis>
and by 8 spaces, i mean shevy uses two 4-space hard tabs
<jrajav>
Which would be 16 spaces in vanilla vim
<jrajav>
:P
<unrar>
I think i'll preffer Ruby, I bought some books
<micadeyeye>
kindly help!!\
<fowl>
micadeyeye: do you have make? `which make`
<unrar>
The Ruby Programming Language, Learning Ruby and Ruby's Cookbook
<jrajav>
2 spaces is just too confined for me. I don't find it as readable
<micadeyeye>
fowl, [micadeyeye@micadeyeye opt]$ which make
<micadeyeye>
/usr/bin/make
<TTilus>
ive been thinking of switching to three spaces
<unrar>
Or I also can use both python and ruby and stop this punishment
<micadeyeye>
bash: ./home/micadeyeye/.gem/ruby/1.9.1/gems/oversip-1.0.5/ext/stud/gem_make.out: No such file or directory
<jrajav>
Yes to first, no to second
<micadeyeye>
I don't know which of them you wanted.
fastred has quit [Ping timeout: 276 seconds]
fascik is now known as fastred
<fowl>
micadeyeye: i dunno there's no useful info there, is there a mkmf.log somewhere?
<micadeyeye>
nope
miho has joined #ruby
<fowl>
ill try to install and see if i get an error
<banseljaj>
hey any of you guys know anything about RuGUI?
<micadeyeye>
i just tried installing another app - compass - and it was successful.
flak has joined #ruby
hynkle has quit [Quit: Computer has gone to sleep.]
<unrar>
jrajav: i'm spanish, i did a custom translation :P
flak is now known as Guest18558
<unrar>
What's dyanamically typed then?
shadoi has joined #ruby
<unrar>
and another question: what are the symbols for?
<Spooner>
Can anyone help me with this: /home/spooner/scripts/something.rb:99 NonSpecificError: Something went wrong!
<fowl>
micadeyeye: yep i get error too
jjbohn is now known as jjbohn|verifying
lkba has quit [Ping timeout: 240 seconds]
whalesalad has joined #ruby
hynkle has joined #ruby
dhruvasagar has joined #ruby
<fowl>
micadeyeye: file an issue
<micadeyeye>
hmm
<whalesalad>
hey guys I am new to ruby, writing a data importer. right now my class loads some data as a property, and when I instantiate an object in the irb it prints all the data, what is called when you create a new object to represent it in the shell?
<jrajav>
nedbat: That's not necessarily true, and it's overly simplified anyway
<jrajav>
Spooner: *I* never assume an encoding, Cinch might
<micadeyeye>
fowl, where?
<fowl>
whalesalad: you should check out pry too it will speed up your learning to be able to type `show-doc String#scan` and have it right there
<micadeyeye>
i don't know ruby bug tracker.
jbw has joined #ruby
<jrajav>
Spooner: All I'm doing is calling 'print query' to the runner script's stdin, where query is the captured scriptlet that Cinch gives me (from the regex event)
flype has joined #ruby
ananthakumaran1 has quit [Quit: Leaving.]
Astral_ has quit [Quit: Leaving]
Guest18558 has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<Spooner>
jrajav : I haven't used Cinch, so I haven't a clue about that.
<whalesalad>
fowl: rad! I imagined there must be an improved irb.
rippa has joined #ruby
ananthakumaran has joined #ruby
<fowl>
micadeyeye: find the gem on http://rubygems.org/ click on homepage it will take you to the project's github page where you report issue
AlbireoX has joined #ruby
<Spooner>
fowl Hasn't banisterfiend managed to get Pry to replace irb in Ruby distros yet? Slacker!
<fowl>
micadeyeye: i'd link you to the github page directly but i already forgot what the gem was called
<slyv>
How would I be able get an unknown string in-between two characters, like: "<asdh>" I don't know what asdh would be, but I know it's in between < and >. I think scan might be able to do so, but I haven't quite figured it out.
<fowl>
Spooner: i doubt it will, it has too many dependencies
<clop>
is it "fast" to create a string by repeatedly appending small amounts of text with +?
cascalheira has quit [Quit: Leaving...]
emmanuelux has quit [Ping timeout: 240 seconds]
juarlex_ has joined #ruby
<matti>
clop: Not very efficient.
<Spooner>
clop Use s = "frog"; s << "3" --- don't use s += "3"
bglusman has joined #ruby
<clop>
ah thanks, didn't know about <<
<eam>
clop: it's because + doesn't append, it returns a new string object
Guest36615 is now known as ged
<matti>
;)
iamjarvo has joined #ruby
<eam>
Spooner: does << really behave differently from += though? Sounds like a bug
<Spooner>
clop Ruby reallocates the string with s += "2" because it is really just doing s = s + "2" (+= is pure sugar, not a real operator)
<eam>
ruby ought to optimize that
<Spooner>
eam no, because it is doing what you asked it to :)
<eam>
don't give me that -- failure to optimize is a bug
<Spooner>
If you wanted to append, you'd use <<
<Spooner>
So you don't.
juarlex has quit [Ping timeout: 240 seconds]
<eam>
next you'll say gcc shouldn't find more efficient code to represent the functions I hand it
<eam>
Spooner: you are wrong
<Mon_Ouie>
Except += isn't equivalent to <<
<eam>
the role of the compiler or interpreter is to optimize code to do what you say in the most efficient way possible
<eam>
Mon_Ouie: how so?
jimeh3 has quit [Ping timeout: 248 seconds]
<davidcelis>
eam: bro, += isn't the concatenation operator so why would it concatenate
jrajav has joined #ruby
<eam>
davidcelis: how does it differ?
<Mon_Ouie>
+= creates a new object — it doesn't affect old references to the other string
<davidcelis>
they already told you
<Mon_Ouie>
+= is a syntax sugar for a = a + b, << is just a method call
havenn has joined #ruby
<eam>
so the answer to "does it behave differently" is "yes"
<eam>
not "no, but interpreters shouldn't optimize"
the_jeebster has left #ruby [#ruby]
the_jeebster has joined #ruby
<Spooner>
They shouldn't alter what you ask them to do in order to optimise.
<eam>
absolutely incorrect
<davidcelis>
lol what
<davidcelis>
so a programming language should do something OTHER than what i tell it to?
<davidcelis>
seems legit
ananthakumaran has quit [Quit: Leaving.]
<eam>
davidcelis: to achieve the same effect within the definition of the language? absolutely
<eam>
that is how optimization works
<Spooner>
It isn't the same effect. You think it is, we think it isn't. It just happens that x += "frog" in C works one way, which doesn't mean it has to work the same in Ruby (in fact, the Ruby version makes a lot more sense).
kvirani has quit [Ping timeout: 244 seconds]
<eam>
x += "frog" doesn't work at all in C
schaerli has joined #ruby
<unrar>
Isn't there an increment operator as x++=
<unrar>
*?
<Spooner>
unrar : Nope, just x += 1
andrewhl has quit [Remote host closed the connection]
steffes has quit [Remote host closed the connection]
<Spooner>
Sorry, C++
maxmmurphy_ has joined #ruby
jimeh3 has joined #ruby
kvirani has joined #ruby
resure has joined #ruby
havenn has quit [Ping timeout: 246 seconds]
<Spooner>
where x is a string object, not a char* (if we want to be pedantic).
Doc_X has quit [Read error: Connection reset by peer]
<jrajav>
x ++= wouldn't make a lot of sense, since ++ is a unary operator
Doc_X has joined #ruby
<eam>
Spooner: again, I think you're missing the point. IF there are two equivalent methods, the language implementation should chose the most efficient
<Spooner>
And it isn't the compiler magically optimising +=, there is a specific operator += that on a string "happens" to be implemented as append.
<eam>
you seem to be missing the "IF" that I predicated all my statements upon
davidcelis has quit [Ping timeout: 260 seconds]
<Spooner>
You are the only person here who things they are equivalent in Ruby. They aren't which is why they behave differently.
<eam>
Spooner: I did not say they were
centipedefarmer has quit [Quit: This computer has gone to sleep]
<eam>
I asked, and you gave the wrong answer
mockra has quit [Remote host closed the connection]
maxmmurphy_ is now known as maxmmurphy
mockra has joined #ruby
<Spooner>
I now realise why the other peopel trying to correct you gave up a long time before me :)
<eam>
I'm in agreement with them
<eam>
our only issue is that you seem to believe that interpreters or compilers should not optimize
<Spooner>
I never said that, but I'm done.
a_a_g has left #ruby [#ruby]
<eam>
well, next time when someone says "if X is so,then Y" you might want to address X before starting an argument about Y
davidcelis has joined #ruby
<unrar>
jrajav: I meant "x++?"
<wmoxam>
lol
<unrar>
but i wrote "x++=" for error :P
maxmmurphy_ has joined #ruby
* wmoxam
read the backscroll
<unrar>
i'm now discovering that Ruby is better than Python
kirun has joined #ruby
<wmoxam>
unrar: how so?
maxmmurphy_ has quit [Read error: Connection reset by peer]
<unrar>
i.e, "Actually the counter is #{x}" in python is "Actually the counter is "+str(x) or "Actually, the counter is %s" % (x)
maxmmurphy_ has joined #ruby
<jrajav>
>> "Ruby".length < "Python".length
<al2o3cr>
(TrueClass) true
<jrajav>
This clearly shows that Ruby is more efficient
<wmoxam>
unrar: it's probably more sugary
<wmoxam>
'better' is pretty subjective
<Spooner>
unrar : It is both of those in Ruby too ("Actually the counter is "+x.to_s OR "Actually, the counter is %s" % x)
<fowl>
unrar: ruby also has String#%
maxmmurphy_ has quit [Read error: Connection reset by peer]
maxmmurphy_ has joined #ruby
<unrar>
But in Python there isn't #{x}, no?
<jrajav>
unrar: I actually like the simplicity of only having + in Javascript (I don't use Python)
Denommus has joined #ruby
<jrajav>
That doesn't mean I won't use #{} in Ruby of course :P
<Denommus>
the more I read about Lisp, more I think Ruby is a valid Lisp
<whalesalad>
what is preferred in a class method, @blah or self.blah ?
<canton7>
yeah, but JS's weak typing makes that lowly + a minefield if you're not wary
moshee has quit [Ping timeout: 276 seconds]
edmmd has quit [Quit: Page closed]
<apeiros_>
Spooner: don't feel too bad. it's certainly a broken optimization when the interpreter suddenly mutates an object instead of creating a new one (which I'd assume is what you meant by "it shouldn't change what I tell it to do")
moshee has joined #ruby
<unrar>
wmoxam: yes, in somethings (as OOP) Ruby is better (for me) and in other things (i don't discovered them yet) Python is better (for me, I suppose)
<apeiros_>
(or rather: it'd be a broken optimization - since luckily, ruby doesn't do that)
monkegjinni has joined #ruby
maxmmurphy has quit [Ping timeout: 276 seconds]
maxmmurphy_ is now known as maxmmurphy
<jrajav>
I've heard Python is better for functional programming
<wmoxam>
unrar: Python has better library support IMO, especially with things like GUI libs
<Denommus>
everybody says "but Lisp's basic data is a list, and even the code is a list and blah blah blah". But, as far as I used Ruby, the same is truth for Ruby and objects. Everything is an object in Ruby, and you can manipulate everything as such
<Spooner>
apeiros_ : Indeed. We were comparing apples and oranges a bit there :)
<fowl>
you can be functional in ruby
jjbohn|afk is now known as jjbohn
<fowl>
just define functions outside of a class
<unrar>
woo
<unrar>
I don't know, i'm starting to like Ruby
<Denommus>
jrajav: that's a lie. Ruby has a lot of support for functional programming
<unrar>
let it discover itself :P
<fowl>
i used to love to write functional things and pester #ruby-lang with them
<Denommus>
jrajav: you can pass a function to other with procs, lambdas or blocks. Each of them acts differently. It's awesome
darren has joined #ruby
waxjar has joined #ruby
<Spooner>
unrar : The thing from your example that gets me is str(x) vs x.to_s. The former is a built in method. The latter is a method that you can override in your classes to produce exactly what you want (I admit it is possible that str(x) calls something like __please_make_yourself_into_a_string__ in Python, but it is more direct in Ruby).
theRoUS has quit [Ping timeout: 265 seconds]
<wmoxam>
I heard that Ruby has a lot of support for not scaling
<apeiros_>
lol
<shevy>
davidcelis I gave up on tabs forever. 2 spaces are my indent level until I die
* wmoxam
trolls
IrishGringo has quit [Quit: ChatZilla 0.9.88.2 [Firefox 14.0.1/20120713134347]]
<shevy>
unrar Did you read the interview?
<fowl>
lol wmoxam
MissionCritical has quit [Ping timeout: 245 seconds]
<unrar>
yes shevy
<apeiros_>
wmoxam: yeah, but just do Scaling.remove_const(:FullyBlocked)
<unrar>
a little part :P
<shevy>
ok :)
<shevy>
whaaat!
<unrar>
hahahah
<shevy>
it's the philosophy man! that is more important than 100 specific tutorials!
<Spooner>
wmoxam : Not as much as it has a lot of support for real-time applications (the GC is pretty much perfect for games, for example).
<unrar>
i'll read it then, i'm doing kindle things now
fermion has quit [Quit: P]
<unrar>
i have 3 Ruby books in my kindle :P
<shevy>
unrar \o/
<wmoxam>
;)
<apeiros_>
Spooner: you should talk with whitequark
<shevy>
way too much
<unrar>
haha
<shevy>
the interview is only like 4 DinA4 pages
<unrar>
and 2 Python books
<Spooner>
Oops, I mean CRuby GC :)
<Denommus>
wmoxam: just like MongoDB scales better. You know, because it's dynamic. Because when we talk about DB's being dynamic is better. But being static is better with languages. Shut up, it makes sense
<apeiros_>
he's working on getting ruby (or actually a derivative) on embedded systems
<unrar>
and 2 Perl books
<unrar>
Ruby wins!
bglusman has quit [Remote host closed the connection]
<Spooner>
apeiros_ : whitequark?
<apeiros_>
I'm not quite sure how he gets around with the memory constraints…
<apeiros_>
yes
<Spooner>
Oh, I see.
<Spooner>
Sounds like hell.
<apeiros_>
sounds like shitloads of fun :)
<unrar>
oops no, i just have 2 python
<apeiros_>
I'd love to do such stuff on paid time…
<jrajav>
unrar: It's the V8 engine running standalone, basically
<wmoxam>
don't jizz on your monitor too much
<flori>
ruby isn't that different from Perl, see [ 1,2,3 ].map &-> _ { _ + 1 }
<jrajav>
unrar: Plus Node.js, which is some additions for filesystem, network access, etc.
<eam>
dr_bob: clear, readable scope declaration. Doesn't exist at all in 1.8, and it's ugly in 1.9
<Denommus>
wmoxam: I want to have your children
<jrajav>
unrar: Basically the server-side stuff that Javascript is missing
<wmoxam>
Denommus: probably not. I run Ubuntu+Unity
<eam>
it's horrifying that in 1.8 you can't pass a block without potentially stomping on variables in the containing scope
fantazo has quit [Remote host closed the connection]
savage-_ has joined #ruby
<Denommus>
wmoxam: now I can abort your children
<Denommus>
*I want to
<wmoxam>
lolz
A124 has left #ruby [#ruby]
<jrajav>
unrar: The hype about "scaling" is mainly because it makes it very natural to write blocking code asynchronously, and also that the V8 engine is ridiculously fast
<dr_bob>
eam, Ruby has Modules and Classes which server as namespaces, def and begin end and do end. It did not really change much between 1.8 and 1.9 - only semtics of blcoks were changed in 1.9 - to the better
<eam>
dr_bob: the 1.9 fix of do |a,b,c;x,y,z| is not great
<fowl>
wmoxam: i've also heard that any technological discussions and opinions on reddit are worthless, instead we trust in the folks on hackernews
snearch has joined #ruby
<jrajav>
Denommus: I don't remember saying "Ruby doesn't have functional programming"
<eam>
dr_bob: and AFAIK it's still not possible to declare variables local to an arbitrary scope in 1.9
<Denommus>
wmoxam: no, seriously, I love Ubuntu, too. My home computer runs it. But my personal notebook runs Arch because it runs *exactly* how I want it to run
<wmoxam>
fowl: I may have helped spread those rumours. I take it all back now
wallerdev has quit [Quit: wallerdev]
<eam>
eg, in perl I can start a block with { and say my $foo; } and scope to a block
wallerdev has joined #ruby
<fowl>
wmoxam: i dont disagree about the reddit part but the hackernews fanboyism kills me
<jrajav>
Denommus: But that's not necessarily clear-cut either; not everyone thinks that lambdas and first-class functions are all you need for functional programming
savage- has quit [Ping timeout: 244 seconds]
<Denommus>
jrajav: you didn't say. But I see Python and Ruby as equivalent on functional programming. But this thing about blocking overriding local variables is indeed awful :(
<wmoxam>
Denommus: yeah, I ran Arch a while back. It can be fun. In general I don't like Linux on laptops (just run it on a desktop)
<dr_bob>
eam, I really don't miss anything. You could look at it from another perspective: too good scoping constructs will invite people to write long methods with a lot nested scopes. That isn't good for readability.
<wmoxam>
basically don't like how it sucks a battery dry :p
<fowl>
eam: you might have heard but 1.8 is old, slow, and not being updated any more
<fowl>
eam: also when you do x = 4 that is a local variable so what are you talking about the only scoping being |,,|
<eam>
fowl: and it's probably 90% or more of existing installations, and is the ruby shipped with every major distro
<unrar>
I love Ruby yes yes I love it
<unrar>
:·3
<eam>
fowl: and |,;,| is 1.9
<eam>
not 1.8
* unrar
is so excited
jjbohn is now known as jjbohn|afk
<eam>
it's even uglier and less readable
<matti>
Hmmm...
<jrajav>
Denommus: I don't know anything about Python; all I said was that "I've heard it's better for functional programming," as a response to someone asking what Ruby and Python are better for in comparison
<fowl>
eam: huh? whats that syntax called
<fowl>
eam: i want to google it but |,;,| isnt going to fly
<jrajav>
I've always been meaning to try Python someday but other things have always seemed more interesting
<eam>
fowl: it's how 1.9 allows you to declare a block scoped variable
<dr_bob>
eam, quoting Perl for "clear, glyph-free readable syntax" is kind of funny...
<Denommus>
jrajav: so I don't think we can discuss much about the subject. I know a bunch about Python, but not enough
<matti>
Anyone looks for Ruby / Systems person perhaps?
<eam>
dr_bob: truth is stranger than fiction
<jrajav>
I know a bunch about functional programming, but not enough about either Ruby or Python to comment either
<fowl>
you dont have to declare a block scoped variable...
<eam>
fowl: if you don't, you clobber the parent scope
<Denommus>
jrajav: now I'm taking a look at emacs Lisp. Makes me wish for emacs rewritten in Ruby. Lisp is awesome, but ugly
<eam>
fowl: that's the source of the complaint -- ruby has very poor scoping mechanisms
<fowl>
proc { x = 5 } <- x is local to the block
<jrajav>
You don't think curves are sexy?
<jrajav>
:P
<eam>
fowl: it clobbers x if it happens to exist outside the block
<eam>
that's the problem
cascalheira has joined #ruby
<eam>
you can't scope
Spooner has quit [Ping timeout: 252 seconds]
<fowl>
ah, so it does
<Mon_Ouie>
Here's a funny thing: def let; yield; end
<eam>
1.9 added a semicolon to the || variable definition syntax to hack around this issue
<Mon_Ouie>
x = 5; let { |x = 3| puts x }; puts x
<matti>
Mon_Ouie ;-)
<eam>
Mon_Ouie: yes. And I would much rather have a normal scope function
<macer1>
hmm
<macer1>
is there some lib
<unrar>
What's let?
sendoushi has quit [Remote host closed the connection]
<macer1>
to convert bash ansi escapes colors
<macer1>
to html?
theRoUS has joined #ruby
theRoUS has joined #ruby
theRoUS has quit [Changing host]
<eam>
something generic and non-specialized
cascalheira has quit [Client Quit]
<Mon_Ouie>
unrar: Common syntax for creating variables restricted to a certain scope in many languages
clocKwize has joined #ruby
<Denommus>
Mon_Ouie: I would find awesome to have it embedded in main Ruby
Mission-Critical is now known as MissionCritical
Criztian has joined #ruby
<apeiros_>
dunno, but if you've got troubles separating your local variables, you have another problem (but yes, I agree that there are issues with the way rubys scoping works, but more than scoping, with the way its closures work)
<Denommus>
unrar: it's something based on Lisp. You use let to create local variables inside of that block.
<unrar>
I never used Lisp :P
<eam>
well, it's not just "based on lisp" -- pretty much all mature languages have the ability to declare variables with a scope
qwerxy has joined #ruby
<eam>
eg C's stack variables
TPFC-SYSTEM has quit [Quit: TPFC-SYSTEM]
faen has quit [Read error: Connection reset by peer]
savage- has joined #ruby
<Denommus>
eam: Lisp started it, as far as I know
<Denommus>
eam: Lisp is older than C
<macer1>
if I have some exception
<eam>
ruby's syntax is derived from C, as is Perl's and most other languages with a generic procedural syntax involving blocks
<macer1>
how can I check from which class is it
<eam>
in C, a {} pair allows you to manipulate the stack
<Mon_Ouie>
An exception is a regular object
<Mon_Ouie>
You can use #class, etc. on it
<macer1>
no no
<macer1>
I mean
<eam>
and create temporary variables on the stack, which are popped off when the {} scope is exited
<macer1>
i.e class Encryption raised exception
<Mon_Ouie>
A class doesn't raise an exception
<macer1>
I want to know it was that class or no
<macer1>
-_-
<macer1>
from which class is code
<macer1>
...
<Denommus>
macer1: you can check the stack message to know where the exception came from
Lachryma has quit [Quit: Leaving]
savage-_ has quit [Ping timeout: 240 seconds]
<eam>
eg { int a; // variable is on the stack, and is freed when block ends }
<macer1>
I know
<macer1>
I see
<macer1>
from encryption.rb
bananastalktome has quit [Quit: bananastalktome]
<macer1>
but parsing stacktraces is not a good idea
<eam>
higher level languages like ruby or perl approximate this scoping behavior, but the way ruby does it is arguably buggy
faen has joined #ruby
<eam>
or, at the very least ugly
<apeiros_>
eam: first thing to do is probably to realize that the only thing rubys blocks and C's blocks share are the name and the {}
<fowl>
you can avoid name clashes if you try *really hard*
<Mon_Ouie>
Are you trying to do something different depending on the source of the exception?
<fowl>
lol..
<eam>
apeiros_: that's right
<eam>
and it's unfortunate
<apeiros_>
and the second thing is to stop trying to think of trying to use ruby as if it was C. if you want C, use C.
<apeiros_>
no, no, that part is certainly not.
<apeiros_>
again, if you've got trouble with your local variables, you're already knee-deep in bad code.
<eam>
to be clear, you're saying it's not unfortunate that ruby 1.8 cannot declare scoped variables?
<apeiros_>
and blaming the language for not giving you tools to deal with bad code… well… that's just stupid.
<Denommus>
eam: I don't think so. Ruby is for Rubyists. I love both C and Ruby. If I want something with C style, I'll use C, if I want something with Ruby style, I'll use Ruby
<eam>
and you're saying the |,;,| syntax addition in 1.9 isn't ugly as sin?
erratic has quit []
_JamieD_ has quit [Quit: _JamieD_]
<apeiros_>
eam: your claim is wrong.
<eam>
Denommus: ruby is a C style language, that is its heritage
<apeiros_>
eam: ruby HAS scoped variables. even in 1.8.
<apeiros_>
but you're clinging on blocks.
<eam>
apeiros_: not fully generic
<apeiros_>
yeah, not a problem.
<jrajav>
Ruby is a C style language?
<jrajav>
lol
<eam>
there are many contexts where they cannot be created
<Denommus>
eam: no, Ruby is a Lisp/Smalltalk style language. There is very little similar to C
<apeiros_>
again, not a problem. unless you try to pretend ruby was C.
<eam>
Denommus: haha
<apeiros_>
it isn't. get your head around it and move on.
<fowl>
Denommus: uhh you're forgetting the braces brah!
<eam>
Denommus: have you ever *used* either of those?
<infinitiguy>
quick question - if I call a function in ruby say.. myfunction()
<infinitiguy>
if I put content between the parens …. myfunction(hello)
<Mon_Ouie>
Someone is going to say it isn't a function
<infinitiguy>
what is hello called and how is it referenced?
<eam>
Denommus: or do you just read blogs and parrot them?
<macer1>
if exception.fromclass == Encryption; puts "OMGOMG ENCRYPTION ERROR!"
* apeiros_
hopes Mon_Ouie is that someone :)
opus has quit [Quit:]
<Denommus>
eam: yes. I'm an emacs user, and I checked a little on Smalltalk. And hell, even Matz admits the similarities
<jrajav>
eam: You seem to be basing your arguments entirely on syntactic elements
<Mon_Ouie>
infinitiguy: It's a method, not a function ;)
<apeiros_>
hurray! :D
<infinitiguy>
whoops :)
<eam>
jrajav: hardly
<Denommus>
eam: the fact that Ruby uses "{ }" does not makes Ruby similar to C. It's not similar. At all
<jrajav>
So which of Ruby's semantics do you find to be similar to C
<eam>
Denommus: it has nothing to do with {}
<Mon_Ouie>
macer1: In that case, you shouldn't be checking the source of the Exception, you should be using a different kind of exception
<apeiros_>
Denommus: but but but it uses = for assignment too!!!
<fowl>
infinitiguy: by what is it called do you mean what is it refered to by in the myfunction() method?
<macer1>
hmmm
<macer1>
ohh
<eam>
Denommus: pascal is also a C family language, and does not have {}
<macer1>
class EncryptionError < Exception;end
<jrajav>
Ruby also uses () to delimit function arguments!
<macer1>
is that good?
<infinitiguy>
yes - so I want to be able to say mymethod(hello) and then assign hello to some variable inside of mymethod to do something with
<fowl>
infinitiguy: def myfunction(zoot) <- it's called zoot
<Mon_Ouie>
No, use StandardError
<infinitiguy>
in my case - enable or disable an api object
<macer1>
why?
qwerxy has quit [Quit: offski]
<macer1>
maybe I want some other exceptions...
<Denommus>
eam: the only thing similar between them is that both of them are procedural. But this does not have anything to do with C
<macer1>
rescue that then that rescue other then sthing other
<Mon_Ouie>
rescue without specifying a class is rescue StandarError, not rescue Exception
<macer1>
>.>
<infinitiguy>
currently in my def I only have def mymethod() nothing defined along with it
<eam>
Denommus: you are completely wrong, but this argument isn't worth pursuing
tatsuya_o has joined #ruby
<fowl>
infinitiguy: then you cannot pass it any arguments, you'll get argumenterror because it expects none but you passed it one
<lectrick>
Is there any way to have a def...end return the symbolized method name? That way I could just do >>> private def methodname; ...; end And it all works sweet.
Markvilla has joined #ruby
<eam>
Denommus: most of the languages ruby is based on, of which perl is one, are in turn derived in no small part from C and C style syntax
<eam>
if that sounds wrong to you, you likely lack historical perspective
<Denommus>
eam: so, how are you right? You didn't explain what are the similarities between the languages. The internals are different, the style is different, the way you treat code is different
<wmoxam>
eam: C is just an Algol style language
<eam>
wmoxam: sure
<fowl>
who cares
ringotwo has joined #ruby
<eam>
fowl: I agree, this is a red herring
<fowl>
eam: your point is moot and you will change nothing by droning on about it
mmercer has quit [Ping timeout: 244 seconds]
<eam>
fowl: which point?
<fowl>
all of them
<whalesalad>
guys how can this be rewritten as a one liner?
<fowl>
yes, lets talk about our favorite celebrity instead
<eam>
seems off topic
<Synthead>
why doesn't this match? '20120808154946.jpg'.match(/\A[0-9]{14}\.pdf\z/)
bier has quit [Quit: Ex-Chat]
aaroncm has joined #ruby
<Denommus>
eam: Ruby is not similar to C. There are A LOT of things that you can do in Ruby that you can't do as easily in C, and vice-versa
<infinitiguy>
right - but if I def mymethod(somevarname) and then when I call it do.. mymethod(differentvalue) if within mymethod should I be able to puts somevarname and get "differentvalue" as the result
<wmoxam>
fowl: OMG, did you see Miley's new haircut
<wmoxam>
?
<eam>
Denommus: you are missing the point by at least a mile
<slyv>
Is there an easy way to remove accents from a string?
<Synthead>
oh damn, I did .pdf
<wmoxam>
Edgey and cute
<fowl>
wmoxam: link plz
MarGarina has joined #ruby
<apeiros_>
Denommus: you can construct an almost arbitrarily long list of similarities and dissimilarities between ruby and C. it's really not worth to pursue it.
<Denommus>
eam: because you didn't explain your point. The fact that they share some family does not mean much. Java is also from C family, but what does Java has to do with Ruby?
<eam>
Denommus: java is from the C family? But "Java is not similar to C. There are A LOT of things that you can do in Java that you can't do as easily in C, and vice-versa"
<apeiros_>
eam: rubys similarity or dissimilarity to/with C is irrelevant. ruby *is not* C. there's nothing really more to say about that part.
<eam>
Denommus: do you see why this argument isn't worth pursuing?
<eam>
your entire position is fallacious
tatsuya_o has quit [Ping timeout: 276 seconds]
<eam>
I would rather talk about the subject *I* introduced, which is the lack of proper scoping in ruby
<fowl>
wmoxam: she looks like she got in a fight with a barber and the barber won
moshef has joined #ruby
<wmoxam>
fowl: it's hip and edgey. It's got the twitters abuzz
<wmoxam>
I want to be like her when I grow up
<apeiros_>
eam: and your position on ruby lacking proper scoping is entirely fallacious
<eam>
apeiros_: how so?
<apeiros_>
it has proper scoping.
bier has joined #ruby
<eam>
ok, how do I declare a variable as scoped to its containing block?
snearch has quit [Quit: Verlassend]
<apeiros_>
def foo; x = 1; end
<apeiros_>
voilà, x is scope only and only to the method foo
<Denommus>
eam: but that's exactly my point. The fact that Java is "derived" from C does not mean much
<eam>
that's a function. How do I do it for 5.times do end ?
<eam>
Denommus: this conversation has ended
<apeiros_>
eam: same
<eam>
apeiros_: that's not correct
kalleth has quit [Read error: Operation timed out]
<apeiros_>
you're very much mistaken
<apeiros_>
def foo; x=1; 5.times do … end; end # x is still scoped, properly
<eam>
apeiros_: I explained this to fowl above
<eam>
that is incorrect, x exists outside the loop scope
<apeiros_>
eam: yes, I'm aware. your claim is still wrong.
<eam>
you will change the variable "x" if it exists outside the loop
<apeiros_>
you're making a broad claim which is wrong. you have an issue with how blocks work
<eam>
I have an issue with lack of scoping
<apeiros_>
that's an *entirely* different proposition from *not having proper scoping*
<Denommus>
eam: I still don't understand your complaining about scoping. Could you post some example explaining what's happening?
<apeiros_>
eam: yes, and you're making completely wrong claims about it.
<eam>
Denommus: x = 5; 1.times do x = 6; end; puts x
<eam>
the "x" is not scoped to the do/end block
<wmoxam>
eam: nor should it be
kn330 has quit [Ping timeout: 252 seconds]
<eam>
ruby 1.9 introduces the |;| syntax for this
<Denommus>
eam: oh, now I get it. So, what's the issue?
<eam>
but it's ugly
<apeiros_>
eam: and again, for probably the third time - if you run into troubles with how the scoping of blocks works (and that'd be the closure part, which again is a different beast and until apple introduced it was absent from C entirely) you're already knee-deep in bad code
<Denommus>
eam: try let
<eam>
Denommus: the issue is in defining a proper scope. The reason languages have scope is to prevent change outside of the intended context (I can't believe I'm explaining this)
<savage->
Any popular tools that you guys recommend to diagnose memory leaks in 1.9.3?
<savage->
Most of the good tools seem to be 1.8.x only.
<apeiros_>
eam: no, it's you having an issue because you fail at coding and blame the tool for it.
<eam>
apeiros_: sorry, instead of resorting to ad-hom attacks could you explain your issue? What is the failure?
<apeiros_>
sorry, bad if you need a hand-holding language, ruby may be the wrong tool. it allows to shoot your foot in a thousand ways.
kn330 has joined #ruby
<Denommus>
eam: ruby's blocks work as closures. Closures have access to the variables on the declaring scope. But, if you want to protect your variables, try this
<eam>
apeiros_: I asked you a very clear question "how can this be scoped" and the code you provided fails to create a scope
<apeiros_>
eam: show me an example where your claim matters.
pu22l3r has joined #ruby
davidcelis has quit [Quit: K-Lined.]
<apeiros_>
eam: incorrect. x was scoped. to the method.
cantonic has joined #ruby
<Denommus>
def let; yield; end; def foo; x = 5; let { |x| x=6; puts x }; puts x; end
<eam>
apeiros_: yes, and I am talking about block scope
unrar has quit [Quit: boo]
Bosma has joined #ruby
<apeiros_>
eam: which - again - is irrelevant.
<eam>
apeiros_: it's not irrelevant, it's the subject
<apeiros_>
you want a hammer to be a screwdriver. it isn't.
<eam>
apeiros_: you seem to be having a conversation unrelated to the one Denommus and I are having, perhaps you should have it elsewhere?
<apeiros_>
eam: you claimed the subject was "lack of proper scoping"
tvw has joined #ruby
<fowl>
christ
<apeiros_>
you didn't claim the subject to be "lack of procs that can scope"
<eam>
Denommus: yes, exactly
<fowl>
eam you have no tact
<eam>
Denommus: you can also do it with |;x| in ruby 1.9
<apeiros_>
eam: but interesting how you did not come up yet with an example where it'd matter.
<eam>
Denommus: the problem is that it is *ugly*
<apeiros_>
but I guess I'm feeding a troll anyway.
<aaroncm>
'lack of proper scoping' == 'I dont like the way the scoping works'
<wmoxam>
eam is a good troll. Been at this for an hour or so
<Denommus>
eam: |;| may be ugly, but the "fix" is easy. But I really think "let" should be adopted as a standard
<apeiros_>
aaroncm: exactly.
<eam>
apeiros_: if you don't understand why scoping is important I don't think I can help you
<jrajav>
Wow Denommus, you're screwing up a lot today. Continuing conversations eam has ended, not providing code that does precisely what eam vaguely defines
<eam>
Denommus: I agree!
MarGarina has quit [Ping timeout: 245 seconds]
<eam>
Denommus: and I'm not sure why folks like apeiros_ are so against the idea
<eam>
it's bizarre
<apeiros_>
eam: lol, *I* don't need help
<apeiros_>
eam: you're the one who's troubled with rubys scoping.
<fowl>
get some damn tact
<fowl>
forget about ruby
<fowl>
learn how to talk to people
havenn has joined #ruby
<eam>
it's almost as if there's a fear of acknowledging that ruby syntax might not be beautiful or perfect
<Denommus>
eam: I don't think that |;| is exactly bizarre, but I can't disagree because this is subjective. But it is an easy fix, so I don't see why this should be a problem
<apeiros_>
eam: um, no. but I say your issue is only an issue if you're badly coding already. so where's your example?
<eam>
Denommus: well, this subject came up because people were complaining about Perl and obscure ]glyphs
<aaroncm>
eam: or people just don't have a problem with it like you do. this is not a reason to impugn their motives.
<eam>
Denommus: so, put it in that context
<Denommus>
eam: that's a common programming trope
<jrajav>
Perl's problem is not obscure glyphs
<Denommus>
eam: just like Lisp's ))))))))))
<eam>
Denommus: I agree
Axsuul has joined #ruby
cantonic has quit [Read error: Connection reset by peer]
<eam>
Denommus: my only point -- a reasonable point -- is that ruby has lots of ugly corners with obscure glyphs. And there are more than a few cases where Perl can express the same thing in a more readable fashion
<eam>
the example I offered was variable scope
<eam>
and for some reason, this demonstrably true point caused quite a bit of upset
cantonic has joined #ruby
<apeiros_>
"demonstrably" - follow suit and demonstrate.
<infinitiguy>
I got variables passed through a method working - how can I get the value of a variable out of a method and into another method?
<eam>
fowl: and by the way, I would say the same to others in this channel, regarding tact. Especially apeiros_
<apeiros_>
with a nice example in code. lets see.
<infinitiguy>
i tried return variablename but that didn't seem to do it
jjbohn|afk is now known as jjbohn
davidcelis has joined #ruby
<slyv>
Hey, is there a simple way to remove accents from a string?
<Denommus>
eam: uh... I just tested it. x = 5; 10.times { |x| puts x }; puts x
<eam>
Denommus: remove the ||
<jrajav>
infinitiguy: Paste all of the relevant code if you can
syamajala has quit [Ping timeout: 276 seconds]
<apeiros_>
translation: Denommus: tell the language to not do what you want it to do and see how it does not do what you want it to do!
ph^ has quit [Remote host closed the connection]
<jrajav>
>> def func(var) return var end; func(3)
<al2o3cr>
(Fixnum) 3
havenn has quit [Ping timeout: 240 seconds]
<jrajav>
Looks like return works fine to me
syamajala has joined #ruby
<eam>
Denommus: the issue is variables not set in ||, for example a temporary variable -- like 10.times { |x| y = x * x; puts y };
syamajala has quit [Read error: Connection reset by peer]
gavit has quit [Read error: Connection timed out]
syamajala has joined #ruby
bowlowni has joined #ruby
<Denommus>
eam: oh. Right. If that's an issue for you, what could I do?
<eam>
Denommus: in ruby 1.8, both stomp on x
gavit has joined #ruby
<infinitiguy>
will do - 1 minute
<eam>
Denommus: I am merely suggesting that ruby ought to have variable declaration, for the same reason that other properly structured languages have it
<eam>
apeiros_: it depends on whether you are using 1.8 or 1.9
<krzysz00>
How do I read something thats been 'pp'ed to a file.
<krzysz00>
*?
<infinitiguy>
I get an undefined local variable when I try to puts fun (my variable) or call a method something (different method trying to access variable fun defined in a previous method).
<slyv>
@jrajav: I had tried that, didn't' seem to work for me but I'll look at it again.
<Mon_Ouie>
You want to get back the object?
<jrajav>
slyv: Listen to Mon_Ouie
<Denommus>
apeiros_: his claim is that you can't "declare" the variable inside of the |x|. I don't think that's an issue for most of rubyists, so it's not worth of discussing
<fowl>
krzysz00: cat the file?
<Denommus>
sorry, ||
peterhellberg has joined #ruby
Asher has quit [Quit: Leaving.]
<krzysz00>
Yes, I want the array (of arrays, and hashes)) back.
<eam>
Denommus: you can in 1.9
<apeiros_>
Denommus: I agree. and it's what I said before. if it becomes an issue, you're already knee-deep in bad code.
<apeiros_>
said that time and time before.
qwerxy has joined #ruby
<Denommus>
eam: how so? I couldn't manage to
faen has joined #ruby
<apeiros_>
because the only real case where it becomes an issue is when you have lvar-creep.
<apeiros_>
which in turn only happens if you have huge methods
<apeiros_>
Denommus: and of course, eam failed to provide a practical example where it mattered.
<fowl>
krzysz00: if you're storing objects for later you should marshal them
<apeiros_>
and honestly, I don't expect him to. chances that he's a troll are stellar.
<slyv>
@Mon_Ouie: I get an error: "invalid encoding ("ASCI", "UTF-8")" when I try that.
<eam>
I did fail to provide a full explanation of why scope matters
Asher has joined #ruby
<krzysz00>
Catting the file in would work, probably.
<apeiros_>
eam: it was never about scope
<eam>
it's not something I'm up for explaining, especially not to this crowd
<apeiros_>
eam: it was always about the scope of blocks
<Denommus>
I just don't think this discussion is worth of the effort. It's an issue for him, but we don't see it as an issue
tehgeekmeister has joined #ruby
<apeiros_>
different thing, but seems you lack the competence to grasp that difference.
<slyv>
As well as: "iconv will be deprecated in the future, use String#encode instead."
<apeiros_>
anyway, I think majority thinks this is trolling.
<eam>
apeiros_: there's no need to namecall
<fowl>
eam: try #ruby-lang
CptJeanLucPicard has quit [Quit: Leaving]
<apeiros_>
eam: oh dear, clean up in front of your own house before whining.
<fowl>
eam: zenspider will talk to you for hours on this
<jrajav>
eam: You're treating literally everyone except you in the room antagonistically
<aaroncm>
eam: you'll probably be better off going away then, and go write a blog post about how the ruby community won't listen to criticism of the one true holy language.
<jrajav>
Pretty sure that's the definition of trolling
<eam>
jrajav: that is not true
Criztian has quit []
<eam>
I've been respectful and patient
<jrajav>
[14:32] <eam> it's not something I'm up for explaining, especially not to this crowd
<eam>
jrajav: I'm not up for it
<krzysz00>
I didn't know about Marshal, thanks.
<infinitiguy>
it sounds like what I might be looking for to be able to share variables between methods is a module
<infinitiguy>
does that sound right?
dhruvasagar has quit [Ping timeout: 252 seconds]
<fowl>
krzysz00: pp (prettyprint) is really only for outputting, marshal is the way to go :)
jrist-gym is now known as jrist
OmarLittle has joined #ruby
OmarLittle has quit [Changing host]
OmarLittle has joined #ruby
<shevy>
infinitiguy, if you are in a class, use @foo variables
<Denommus>
jrajav: I don't think that's trolling. Trolling is when you are polemic only for the sake of seeing people getting irritated. He just has a point that is irrelevant for most of us
<eam>
apeiros_: if you want to ban me for pointing out that you insulted me, go ahead
syamajala has quit [Read error: Connection reset by peer]
<infinitiguy>
what if I haven't defined a class? I've only been defining methods and then the plan was to require the rb file that contains the methods
syamajala has joined #ruby
<aaroncm>
infinitiguy: I think you might be engaged in an x-y problem here. you might be better off describing what you really want to do.
<jrajav>
Are we going to start debating the definition of trolling now? :P
<shevy>
infinitiguy then you can use @foo too
<jrajav>
That would pull this conversation into pretty meta territory
<wmoxam>
please remove the troll
<shevy>
you could also use $global variables
<davidcelis>
^
<infinitiguy>
I wanted to use @foo but I can't seem to define mymethod (@foo = "somevar")
<infinitiguy>
it gave me an error
<shevy>
what is the syntax you tried
<shevy>
the exact syntax ;)
<jrajav>
He pasted it
<Denommus>
jrajav: my point about trolling or not trolling is that he was not malicious, only insistent
<shevy>
jrajav omg
mmokrysz has joined #ruby
<infinitiguy>
I essentially want to be able to define a variable in a method - have it be able to be changed to something else when the method is called (enable/disable) and then have that variable be accessible by other methods
<shevy>
infinitiguy, if you tried that, that would not be valid ruby code!
<fowl>
infinitiguy: we could do def somemethod(@x) to automatically set @x to whatever was passed in, in 1.8, but not in 1.9
<jrajav>
Denommus: Eh, I don't really care anymore
mmokrysz has quit [Client Quit]
<shevy>
infinitiguy, use def foo(i = @foo); @foo = i + 5; end
<davidcelis>
infinitiguy: you defined `fun` as a local variable, accessible only inside of `mymethod`
fumduq has joined #ruby
<shevy>
yeah, infinitiguy do you know what a local variable is
<eam>
Denommus: indeed. I do not want to have this conversation if it isn't productive
<infinitiguy>
when I tried to define fun as an instance variable it complained
<shevy>
no
mmokrysz has joined #ruby
<shevy>
you must have used incorrect syntax infinitiguy
<shevy>
use pastie.org to paste
mmokrysz has left #ruby [#ruby]
<fowl>
infinitiguy: you can't do def somemethod(@foo) in 1.9
<infinitiguy>
i was in 1.8
<shevy>
the syntax, paste it ;P
<infinitiguy>
but I'd like to be able to come up with something that works in both
<infinitiguy>
if I have fun as a local var - it all works except it doesn't come out of the method (as expected)
cascalheira has joined #ruby
<infinitiguy>
with it as an instance I get "formal argument cannot be an instance variable"
<xclite>
because a formal argument cannot be an instance variable
<shevy>
ok first infinitiguy
<xclite>
a formal argument (aka the parameter name) is not the same thing as an instance variable
<shevy>
infinitiguy, try to have logical indent
<shevy>
it makes code more readable
<shevy>
after a:
<xclite>
@fun is an instance variable, which belongs to the class
<shevy>
def foo
<shevy>
|continue here
<shevy>
# <-- 2 spaces
<apeiros_>
"I do not want to have this conversation if it isn't productive" - translation: "I do not want to have this conversation if not everybody agrees with me" but true, it was unproductive. we had only a claim. not even backed up with a single practical example.
<shevy>
infinitiguy, change def mymethod (@fun="noval") to def mymethod (i="noval")
<shevy>
and this here
<shevy>
if 1 == 1
<shevy>
this does not make a lot of sense
<shevy>
that's like
<shevy>
if true
<fowl>
infinitiguy: yo dont do that def method(@foo) because you'll have to change it when you upgrade to 1.9
burgestrand has joined #ruby
<davidcelis>
why "noval", why not just nil
<fowl>
might as well do def method(foo) @foo = foo
<infinitiguy>
i know - i was just trying to put in a valid if statement because ive noticed that local variables within an if (i think it was an if) are contained within that block
<lectrick>
Is the ruby-core mailing list the place to suggest Ruby changes?
<jrajav>
if (the concept of truth exists);
<jrajav>
Try compiling that
<shevy>
lectrick, yeah. or the bug tracker of ruby, sometimes if approriat
<shevy>
appropriate
<infinitiguy>
so if I do def method (foo) @foo = foo then I should be able to use @foo elsewhere in other methods?
<infinitiguy>
that might be all I need
<shevy>
infinitiguy, yes
<apeiros_>
lectrick: I'd discuss it in ruby-talk first
<lectrick>
shevy: my idea was to have a def...end return the symbolized form of the new method name so that you could do things like protected def... end or private def... end
MarGarina has joined #ruby
<shevy>
aha
<apeiros_>
lectrick: that's not really a new proposal
<lectrick>
apeiros_: ok
<apeiros_>
I'd be all in favor of it, though.
<shevy>
well, go suggest it to them :D
<apeiros_>
anything is better than nil.
<lectrick>
apeiros_: yeah I wasn't sure... just occurred to me since it would be kind of nice syntactically
<shevy>
apeiros_, is nil better than nil?
<apeiros_>
shevy: of course!
<apeiros_>
isn't that obvious? :)
burgestrand has quit [Client Quit]
<shevy>
lectrick, usually you need to convince matz first
<lectrick>
apeiros_: yeah I agree, although to be honest, returning the symbolized form would have the small cost of creating that symbol
cascalheira has quit [Quit: Leaving...]
<shevy>
matz usually is sceptical by default so it might require good arguments to persuade him h ehehe
theRoUS has joined #ruby
jonathanwallace has quit [Remote host closed the connection]
<apeiros_>
lectrick: I actually wonder why it wasn't implemented. I mean it came up at least 6y ago already. if not even earlier.
<lectrick>
well, matz is on the payroll of my company, so perhaps I can influence him that way
burgestrand has joined #ruby
<shevy>
nah
<apeiros_>
lectrick: no, it wouldn't have that cost
<apeiros_>
lectrick: defining a method already creates that symbol
<lectrick>
apeiros_: well, awesome then (re: cost)
<infinitiguy>
@shevy - thanks for the help
<shevy>
you need to make good arguments, for instance, if it is a feature that is useful and worth having
<apeiros_>
lectrick: try: x = Symbol.all_symbols.dup; def sdfasdfasdf; end; Symbol.all_symbols-x
<shevy>
every new feature comes at a potential cost
<jrajav>
matz = matsumoto?
<shevy>
yeah
<apeiros_>
jrajav: yes
<jrajav>
:O
<lectrick>
apeiros_: I tried that, it returned an empty array?
Filuren has joined #ruby
<apeiros_>
lectrick: o0
locriani has joined #ruby
<lectrick>
apeiros_: maybe that changed in 1.9?
<jrajav>
>> x = Symbol.all_symbols.dup; def sdfasdfasdf; end; Symbol.all_symbols-x
<al2o3cr>
(Array) []
Stalkr_ has quit [Read error: Connection reset by peer]
Filuren is now known as Stalkr_
Spooner has joined #ruby
pu22l3r has quit [Remote host closed the connection]
<apeiros_>
lectrick: ah, no
<apeiros_>
it's because it's all on one line
<apeiros_>
so the symbol is already created at the first statement.
<apeiros_>
jrajav: does al2o3cr keep a session for users?
beneggett has quit [Quit: Computer has gone to sleep.]
<Majost>
What is the ruby equivalent of Python's __init__() for a class definition?
<al2o3cr>
-e:1:in `eval': undefined local variable or method `x' for main:Object (NameError), from (eval):1:in `eval', from (eval):1:in `<main>', from -e:1:in `eval', from -e:1:in `<main>'
havenn has quit [Read error: Connection reset by peer]
mockra has quit [Ping timeout: 260 seconds]
kenichi has quit [Remote host closed the connection]
elhu has joined #ruby
bradhe has quit [Remote host closed the connection]
bradhe has joined #ruby
adamkittelson has quit [Remote host closed the connection]
skipper has quit [Ping timeout: 268 seconds]
cousine has joined #ruby
pdtpatrick has quit [Quit: pdtpatrick]
td123 has quit [Read error: Connection reset by peer]
kenichi has joined #ruby
OmarLittle has quit [Quit: Leaving]
td123 has joined #ruby
t68948 has joined #ruby
Markvilla has joined #ruby
MarioEIU has quit [Quit: Leaving]
specialGuest1 has joined #ruby
mmokrysz has joined #ruby
havenn_ is now known as havenn
mockra_ has quit [Remote host closed the connection]
specialGuest1 has quit [Client Quit]
specialGuest has quit [Ping timeout: 244 seconds]
graspee has quit [Read error: Connection reset by peer]
adamkittelson has joined #ruby
Stalkr_ is now known as Staplr_
peterhellberg has quit [Read error: Connection reset by peer]
theRoUS has joined #ruby
peterhellberg has joined #ruby
Staplr_ is now known as Stalkr_
axl__ has joined #ruby
mmokrysz has left #ruby [#ruby]
answer_42 has quit [Ping timeout: 276 seconds]
axl__ has quit [Read error: Connection reset by peer]
axl_ has quit [Ping timeout: 265 seconds]
Araxia has joined #ruby
bradhe has quit []
axl_ has joined #ruby
y2k has left #ruby [#ruby]
bradhe has joined #ruby
eightfold has quit [Quit: eightfold]
Rajesh_ has joined #ruby
graspee has joined #ruby
y2k has joined #ruby
pdtpatrick has joined #ruby
Rajesh_ has quit [Max SendQ exceeded]
ReachingFarr has joined #ruby
jonahR has quit [Quit: jonahR]
<lectrick>
Can I do any interpolation in a %w[ this is a word but can i do#{this} ]
<asteve>
what is the purpose of %w[] ?
Markvilla has quit [Quit: Computer has gone to sleep.]
tcopp has left #ruby [#ruby]
axl_ has quit [Read error: Connection reset by peer]
gmci has joined #ruby
Markvilla has joined #ruby
savage-_ has joined #ruby
axl_ has joined #ruby
Solnse has joined #ruby
<fowl>
lectrick: yes use %W[]
ReachingFarr has left #ruby [#ruby]
<canton7>
%w is the same as ' %W is the same as "
Rajesh_ has joined #ruby
Markvilla has quit [Client Quit]
<lectrick>
fowl: awesome.
<apeiros_>
asteve: %w[] is an array literal
<apeiros_>
creates an array of strings
savage- has quit [Ping timeout: 252 seconds]
<apeiros_>
e.g. %w[foo bar baz] is equivalent to ['foo', 'bar', 'baz']
TorpedoSkyline has joined #ruby
<lectrick>
we have some simple object/string/hash/array monkeypatches in /lib/ like string_utils.rb so now I can just do %w[ object string hash array ].each{ |o| require_relative(File.join(%W[ .. .. lib #{o}_utils ]) } from my initializer
nathandim has joined #ruby
iMe has joined #ruby
<shevy>
guys
<shevy>
odd question upcoming
<shevy>
in terms of ansi-colours, when you write shell scripts or ruby scripts, that output colours
<shevy>
do you follow any convention for what colours to use, depending on whether this is a file, a symlink or a directory? or perhaps just important text, as opposed to normal text
<shevy>
(output results on the commandline terminal)
<shevy>
I have bright yellow right now for files...
Guedes has joined #ruby
bluenemo_ has joined #ruby
<lectrick>
shevy: I don't know if there is a real convention for that yet, but maybe make it configurable and let the end user choose
jlogsdon has quit [Remote host closed the connection]
<shevy>
yes, I already have that covered
<barefoot>
+1
<shevy>
I just wonder about the default
<shevy>
if people follow any convention
<shevy>
if not I just roll dice :\
<burgestrand>
Start a new terminal and fit the color scheme.
<burgestrand>
I mean, the default is pretty much black on white or the other way around.
<burgestrand>
Kinda boring. I have mine latte-coloured.
Rajesh_ has quit [Max SendQ exceeded]
<pnbeast>
shevy: You might want to investigate usability guidelines, with respect to things like color blindness and eyestrain, if nothing else presents itself.
<apeiros_>
lectrick: *shudder* @ require_relative - made worse by including lib in it…
<apeiros_>
lectrick: seriously, should just be require "#{o}_utils"
<shevy>
pnbeast heheh
jonahR has joined #ruby
virunga has joined #ruby
<shevy>
burgestrand, hmm do you happen to have some screenshot of your terminal available? with coloured output perhaps?
moshef has quit [Quit: moshef]
<barefoot>
could always just go with $LS_COLORS as a start
<shevy>
hmm yeah that's an idea
<lectrick>
apeiros_: I know. I think we've had this discussion before, about load paths. The complexity has to live somewhere. I agree that it should be in a central location but if it is I have to include that file everywhere, such as in all tests that I want to be able to run from the commandline directly. And I don't want to do that. So, I require_relative for now. I know that this concretes the relative
<lectrick>
file structure as a side effect. I'm OK with that for now.
havenn has quit [Remote host closed the connection]
<lectrick>
By "complexity" I mean "the load_path complexity for this repository"
<apeiros_>
lectrick: the central place is your app
<shevy>
ah ok
<apeiros_>
lectrick: you have two apps - whatever is in your bin, and your test runner
<shevy>
I use a dark background
<lupine_85>
I don't know what require_relative is, and by the sounds of it, I don't want to know
<shevy>
the red M is a normal character right? not some UTF special character
<apeiros_>
not that complex to add to load path in the latter (since you don't need it in the former - there it's handled by installing your lib)
<burgestrand>
I used to, but it buggered up my eyes in the dark.
<burgestrand>
shevy: yep, normal character.
specialGuest has joined #ruby
<shevy>
lupine_85 require_relative was added in ruby since ~1.9.x
Rajesh_ has joined #ruby
fmcgeough has quit [Quit: fmcgeough]
<lupine_85>
ah. I'm still not using it for much
<lectrick>
apeiros_: I like to do ruby test/path/to/test.rb... even if that could be test_runner test/path/to/test.rb, because it allows me to run files directly in editors such as Sublime, which pass the current file path directly to ruby in the editor
specialGuest has quit [Changing host]
specialGuest has joined #ruby
<shevy>
hmm ok I see burgestrand ... if I'd pick bright yellow for files, it would not work for you by default with that background... for my system, with black background, yellow would be ok-ish... hmm
<burgestrand>
require_relative in gems annoys me to pieces. You don’t get to decide if I can monkeypatch or not, tyvm.
<apeiros_>
lectrick: I do ruby test/runner.rb test/path/to/test.rb
<lupine_85>
alias ruby_with_lib ruby -Ilib ...
<apeiros_>
lectrick: there, easily solved
<lectrick>
lupine_85: require_relative is in 1.9.3 and requires a file relative to the location of the current file.
<burgestrand>
Or, in this case, monkeypath.
<lupine_85>
*shudder*
<apeiros_>
lectrick: alternatively: alias ruby_test='ruby -Ilib'
<shevy>
hehe monkeypath
<lectrick>
apeiros_: I did not know you could specify multiple ruby files to ruby. I thought I tried this in the past and it did not work.
<apeiros_>
lectrick: you can't :)
<burgestrand>
apeiros_: would changing RUBYOPT work as well?
<lectrick>
apeiros_: Are you sure you weren't using ruby -r test/runner path/to/test.rb
<burgestrand>
export RUBYOPT='-Ilib'
<burgestrand>
or whatever it is.
<apeiros_>
burgestrand: yeah, for that it'd even still be sane
<lectrick>
apeiros_: oh fuck. the runner takes an arg.
<lupine_85>
require_relative sounds like hell to pay
hoelzro|away is now known as hoelzro
<apeiros_>
lectrick: yupp ;-)
<apeiros_>
lectrick: it also performs all other setup
<burgestrand>
require File.expand_path() is often also annoying. >.:
<lectrick>
apeiros_: yeah i get it now
<apeiros_>
lectrick: meaning I have no duplicate code in my test files
linoj_ has joined #ruby
<apeiros_>
lectrick: I mean all those dozen of require_relative shit you see in most test files
<burgestrand>
Can bring some really weird load issues where files get required twice. Anyhoo…
delinquentme has joined #ruby
<shevy>
hmm ... if I have a class, and a class method... and in that class method, I create a new class
<delinquentme>
The value of a Ruby symbol's string part is the name of the symbol, minus the leading colon. << is this a true statement?
<apeiros_>
burgestrand: not in 1.9
<shevy>
let's say, the class is called Foo
<lectrick>
apeiros_: Well there's still the problem of how to convince my editor to run files with that file.
<shevy>
def self.create
<shevy>
Foo.new.do_something
<shevy>
or...
<shevy>
self.class.new.do_something
<shevy>
?
<shevy>
hmmm
<burgestrand>
apeiros_: expanded path always added to loaded features?
<apeiros_>
burgestrand: requiring the same file by different paths is a 1.8 problem. 1.9 no longer suffers from it.
<shevy>
nevermind, I think I stick to explicit name like Foo, it reads nicer there
centipedefarmer has joined #ruby
<delinquentme>
Because it seems like it *cannot* be correct because of this statement <% provide(:title, 'Home') %>
<lectrick>
burgestrand: Ruby is supposed to only require files once because it stores the absolute path to the file in a 'loaded' collection
<burgestrand>
lectrick: $LOADED_FEATURES :)
<lectrick>
burgestrand: exactly
linoj_ has quit [Client Quit]
davidcelis has quit [Ping timeout: 244 seconds]
hoelzro is now known as hoelzro|away
<lectrick>
burgestrand: are you saying that breaks sometimes? Because that would be bad.
rburton- has joined #ruby
<apeiros_>
lectrick: it was different in 1.8
<rburton->
Has anyone got Growl 1.4 + Bullet working? It seems like Bullet isn't connecting to Growl.
<apeiros_>
anyway, the problem was worse when you used File.expand trickery
linoj has quit [Ping timeout: 246 seconds]
<rburton->
As if its not registering with Growl
geekbri has quit [Remote host closed the connection]
<apeiros_>
instead of sticking with a proper require
SegFaultAX has quit [Quit: Lost terminal]
bluenemo_ has quit [Quit: Verlassend]
waxjar has quit [Quit: Ah! Well, prepare to put mustard on those words, for you will soon be consuming them along with this slice of humble pie that comes direct from the oven of shame, set at gas mark "egg on your face"! I sort of forget what I was talking about.]
brdude has quit [Quit: brdude]
davidcelis has joined #ruby
<peterhellberg>
One of my friends was tasked to rescue a project where a few "Java developers doing Ruby" had re-implemented require using File.open and eval
<peterhellberg>
That sucked.
<lupine_85>
:)
davidcelis is now known as Guest3113
<matti>
peterhellberg: LOL
<rburton->
Shame there are many shitty engineers out there.
<yxhuvud>
:D
<fowl>
haha
<wmoxam>
peterhellberg: what on earth compelled them to do that?
<wmoxam>
they just didn't realize that 'require' existed?
<lupine_85>
it's not *too* insane, though
<lectrick>
apeiros_: What about requiring things with File.join ?
opus has joined #ruby
<peterhellberg>
wmoxam: I have _NO_ idea…
Solnse has quit [Ping timeout: 252 seconds]
<lupine_85>
def my_require(filename) ; TOPLEVEL_BINDING.eval File.load filename ; end
any-key_ is now known as any-key
<rburton->
Bullet.growl = false #This makes me sad.
<rburton->
:D
timonv has quit [Remote host closed the connection]
<rburton->
well can't finger fuck this too long. Another day! :)
erichmenge has quit [Quit: Be back later]
sailias has quit [Ping timeout: 276 seconds]
<lectrick>
peterhellberg: I'm guessing they ran into a require issue and decided to reimplement it themselves since they would rather do that than figure out the actual problem
nobitanobi has quit [Quit: Leaving.]
<apeiros_>
lectrick: same thing. 1.8 would register a different path. '../../lib/foo/bar' was not the same as 'foo/bar'
<rburton->
peterhellberg: sorry to hear you have some shitty engineers on the team
<apeiros_>
and in 1.9 - still knowledge in the wrong place IMO
whowantstolivefo has joined #ruby
savage-_ has quit [Ping timeout: 252 seconds]
<apeiros_>
but as you said, we already had that discussion ;-)
hynkle has quit [Quit: Computer has gone to sleep.]
AndrzejKrzywda has joined #ruby
fantazo has joined #ruby
<rburton->
There are too many engineers that look to create their own solutions vs. actually understanding how a system/framework actually works.
<lectrick>
lupine_85: apeiros_ I thought I checked the source and found that it indexed by computing the absolute file path first
Seventoes has joined #ruby
Guest3113 has quit [Ping timeout: 244 seconds]
<apeiros_>
lectrick: as said, that was 1.8 behaviour
<peterhellberg>
rburton-: Not my team, or company, fortunately
<apeiros_>
1.9 indeed doesn't have that issue
savage- has joined #ruby
<lectrick>
apeiros_: ah ok
spree_josh has joined #ruby
<rburton->
I personally would walk over there and ask them nicely "What research have you done? Is this really the solution solution?" Then proceed to slam their keyboard across the desk telling them "Neve lie to my face."
davidcel_ has joined #ruby
<rburton->
:D
<whowantstolivefo>
hiya people, what is the best OS platform to work with ruby,rails and web technologies ? for advice i asking people who use ruby
<fowl>
whowantstolivefo: *nix is the best for developing on unless you're using a platform specific language like c# or objc
<lupine_85>
I have no idea why
<rburton->
Mac++
<burgestrand>
^
<fowl>
anybody who tells me you can compile objc in linux is getting shot in the face
<rburton->
Linux is good time but I love my mac
<rburton->
I get laid because of it.
<rburton->
:)
<lectrick>
i'm an apple whore who thinks all other OS'es are deeply flawed as general-purpose OS'es (windows: good just for games; linux: good just for servers)
<lupine_85>
you go to a ruby conference, and the vast majority of laptops are macs
<shevy>
don't lie rburton-
<lupine_85>
it's insane
<lectrick>
whowantstolivefo: ^
<shevy>
real devs have no time for getting laid. they hack code.
<rburton->
shevy: :( Okay I use my mac to beat off to porn.
<rburton->
It's very close!
<rburton->
I use Divvy, one side of my screen for porn and one side for code.
tatsuya_o has joined #ruby
<shevy>
with windows, young people use it because of gaming
* apeiros_
still wants a good OS - uses OSX until then
<lupine_85>
I honestly don't get the attraction of macs. I find the UI stifling
<shevy>
we linux users are totally outnumbered here
<fowl>
fie on osx
<apeiros_>
lupine_85: nothing wrong with that
<shevy>
DOWN WITH THE OSX HORDE!!!
<apeiros_>
tastes differ, that's ok
<shevy>
why does noone use windows here
<rburton->
I should sell a monitor protector called the "Porno Guardian"
<lupine_85>
I wouldn't mind a retina display, though
<lectrick>
i won't knock linux or unix peeps tho. Windows people who only develop in microsoft-originated technologies... I want to put them all in a sack and drown them in a river like so many unwanted kittens
* apeiros_
doesn't mind his retina display either
<apeiros_>
but the tech isn't there :(
<whowantstolivefo>
i got my answers, thank you ppl
<apeiros_>
on the discrete graphics, it gets insanely hot
<lupine_85>
I can't have a retina display until not-apple starts making them
<apeiros_>
many apps have troubles
<whowantstolivefo>
this is why i love open source
<shevy>
lectrick, my plan was to write ruby-gtk apps, then go back to windows and use ONLY ruby stuff on it
<forrest>
yeah i never understood the big attraction of os x; linux is great for developing
<fowl>
lectrick: but not people who develop mac-only programs? they are a-okay in your book?
<apeiros_>
lupine_85: I thought your issue was with apples software, not hardware?
<rburton->
When I got my first Mac, I hated it.
<lectrick>
shevy: And how did that work out? :)
<apeiros_>
it's not difficult to run linux on a mac…
dr_bob has quit [Quit: Tune in next week when you'll hear Dr. Bob say...]
<rburton->
When I got my first compliment for having one. I loved it!
r0bby is now known as robbyoconnor
<lupine_85>
apeiros_, nah, everyone would then think I was using a mac
<apeiros_>
rburton-: lol
Solnse has joined #ruby
<lupine_85>
and the hardware is far too overpriced anyway
<apeiros_>
bad argument for having one :-p
<lectrick>
fowl: Yes. They are A-OK. I know. It's a bias. At least I admit it.
<shevy>
lectrick, well... my ruby commandline scripts are quite ok now. but ruby + GUI stuff... I dont know :( I like ruby-gtk ... but there are WAY too many things to consider and keeping in mind...
<fowl>
rburton-: you .. what..?
<shevy>
I think HTML+CSS are kinda much easier and also much better
krzysz00 has left #ruby [#ruby]
<lupine_85>
I have made ruby GUIs before
<apeiros_>
lupine_85: so who's the one obsessed with superficialities? you or the mac users? :-p
<rburton->
fowl: I live for attention :)
<fowl>
i hate this channel and 70% of the people in it
<lupine_85>
QtRuby was the main one
<fowl>
you can all take your apples and shove them up your cupboard
<rburton->
fowl: I hate it for 71% of the people.
<lupine_85>
I didn't say mac users were obsessed with superficialities, I said I found the UI stifling
<shevy>
I would really like to use just ruby, and just one thing alone for GUI elements, that should work everywhere as I'd expect them to
fayimora has quit [Ping timeout: 244 seconds]
<rburton->
fowl: Aww jump on iChat and let's talk about it ;)
<lectrick>
If you like to attention-whore, Apples were way better about 4-5 years ago. Now it's pretty much de rigeur.
<shevy>
Jobs is gone. Apple lost its mojo.
* pnbeast
has been looking for a channel with activity, this afternoon. "Be careful what you wish for..."
<apeiros_>
pnbeast: :-p
<lupine_85>
the fun part of QtRuby is making sure you keep all your Qt objects in scope
<shevy>
pfft qtruby
<lupine_85>
if you don't, then bits of the GUI disppear when the garbage collector runs
<shevy>
does it still have only one dev?
<matti>
shevy: ;d
<lectrick>
shevy: It will take a few years for Jobs' absence to negatively affect the company. Pretty sure he left years of plans in the books.
<rburton->
Steve Jobs is not dead and neither is Tupac!
<lupine_85>
I discovered that one the fun way
<shevy>
lectrick, I think it won't be a few years, it will be earlier, but we will see :) Microsoft had no problem for a long time, then came google and HTML5 and today it is not as relevant anymore as it was like ~8 years ago
jonahR has quit [Quit: jonahR]
davidcel_ has quit [Remote host closed the connection]
Morkel has joined #ruby
<lectrick>
lupine_85: That is the funniest thing that only programmer geeks would understand that i've read today (about GUI elements going out of scope and just disappearing)
<lupine_85>
anyway, apple are obviously doing *something* right for developers, given the preponderance of macs at conferences
davidcel_ has joined #ruby
<lupine_85>
I just have no clue what that is
robbyoconnor has quit [Read error: Connection reset by peer]
davidcel_ is now known as davidcelis
davidcelis has quit [Changing host]
davidcelis has joined #ruby
spree_josh has quit []
spree_josh has joined #ruby
<lupine_85>
lectrick, I ended up just having a QT_OBJECTS global array and pushing everything into it at create, and removing at destroy
<RubyPanther>
I can tell you. It is *nix, but easier.
<lupine_85>
it was nasty
krz has joined #ruby
<lupine_85>
RubyPanther, I sit down at a mac machine, and I feel my productivity drop
<lupine_85>
precipitously
manizzle has quit [Quit: Leaving]
<lupine_85>
it's not like I haven't tried for extended periods of time to get this working
<shevy>
RubyPanther! you are back again!
carloslopes has quit [Quit: Leaving.]
<lectrick>
lupine_85: Awesome commandline and unix toolchain support, extremely reliable operation, free developer tools, great editors, great browsers, slick hardware, smooth OS, great screen readability, actual sleep/hibernate that won't crash programs ::cough:: windows, haha ::cough::.... What else?
<RubyPanther>
lupine_85: I find Gtk to give the best portability
<matti>
lupine_85: I am the same.
nedbat has joined #ruby
<matti>
lupine_85: I can't stand OS X.
macer1 has quit [Ping timeout: 268 seconds]
<lectrick>
lupine_85: Zero need for antivirus, antispyware, antianything?
<lupine_85>
lectrick, i;d like to be able to sit down at a mac and churn out code at the same rate as when I'm sat at a linux computer
<lupine_85>
but I can't
robbyoconnor has joined #ruby
<asteve>
that's strange
<fowl>
OSX is Satans Bunghole and thou art his Product.
<RubyPanther>
I don't even have to _think_ about ether OSes, and even a tray app works out of the box anywhere
manizzle has joined #ruby
n_blownapart has joined #ruby
<lupine_85>
mm, Qt has some problems
<lectrick>
lupine_85: That's just experience. Did you know you can hack the entire Cocoa text input system on OS X? Want vim or emacs bindings that work EVERYWHERE? You can hack that.
<lupine_85>
it's just the only one i've tried hard through windows
<lupine_85>
erm, ruby
<lupine_85>
derp derp
yxhuvud has quit [Ping timeout: 256 seconds]
cascalheira has joined #ruby
<lupine_85>
lectrick, I don't use anything like that on linux
<lupine_85>
(and I really wouldn't want it)
spree_josh has quit [Client Quit]
<fowl>
the #1 thing to hate about macs? they change people. your smugness levels will reach dangerous highs within hours of purchasing a mac
<lupine_85>
I use terminals and simple text editors, and a browser
<lectrick>
What the hell is a "tray app"?
spree_josh has joined #ruby
<lupine_85>
lectrick, look near your computer clock for some program icons
tommyvyo has joined #ruby
<lupine_85>
those are tray apps
<lupine_85>
(that's another point. I hate the term 'app')
<lectrick>
lupine_85: You mean those apps that completely clutter the lower right corner of the screen in windows without asking you, annoy the shit out of you when you least want them to, and occupy memory and CPU bandwidth?
<RubyPanther>
or like I use a Ruby gmail notifier. I can right click and get a little context menu
<lupine_85>
ja
davidcelis has quit [Ping timeout: 248 seconds]
<RubyPanther>
if it asks or not is an installer/config issue
<fowl>
"a tray app works out of the box anywhere" oh wow you mean there are benefits to having a monolithic UI?? gee willakers
<lectrick>
lupine_85: You mean in the upper right on a mac? Those aren't apps. Those are menus. And they won't nag the shit out of you. Ever.
<lupine_85>
wherever your clock is
<lupine_85>
I have no tray icons, myself
<n_blownapart>
then I thought, "why should someone new to programming easily grasp the method_missing method?" read: why is method_missing "overridden?"
<RubyPanther>
I think it is funny that somebody would be against the whole feature, and not even have any productivity apps that interface there.
<RubyPanther>
For example, a load monitor, volume control, etc
<lupine_85>
I have volume buttons on my keyboard :)
jonahR has joined #ruby
<RubyPanther>
sure but your user might not
<lupine_85>
and I can type 'top' into the terminal any time i'm curious. polling is the devil's work
<lectrick>
Anyone here use Skype on a Mac and Skype on Windows? How about AIM (or any chat) on Mac vs. AIM on Windows? Opening PDF's on Mac vs. opening them on Windows? For all of these examples, the Windows side is 1000% more annoying to work with
<forrest>
the daemon's work?
<lupine_85>
lectrick, I would never suggest using windows over using a mac
<lupine_85>
that would be brain-drooling idiocy
<n_blownapart>
ie why does my textbook #method_missing is "overridden," instead that it "overrides?"
havenn has joined #ruby
chessguy has quit [Remote host closed the connection]
<n_blownapart>
my textbook *say
davidcelis has joined #ruby
<lectrick>
lupine_85: I can text message my girlfriend via a mac app. For free. Send and receive. I think that's pretty rad. It's called... "Messages". It's very simple- I click her name, and I type. Nothing annoys me. Everything is responsive. Everything looks simple and great. Typical Apple. Love it.
<RubyPanther>
If you only choose portable tools, neither side will be very annoying it is only a matter of installation/setup
davidcelis is now known as Guest57479
<lupine_85>
I.... see
<lupine_85>
I'm sure my inability to be productive on a mac is entirely my fault, and nothing to do with the operating system, don't worry
<lteo>
my theory is that people are just wired differently
<fowl>
lectrick: there are websites that can do that too, there are phone services which connect texting and emails, etc
<lectrick>
lupine_85: OK, well I need to use more linux. I have some VM's with Ubuntu on them, I was impressed, but I didn't use them much yet. I was most impressed with how text rendering has improved over the years.
<fowl>
lectrick: what an amazing innovation you have there
chessguy has joined #ruby
<lupine_85>
I'm just reporting what happens to my productivity when I sit down in front of a mac, even after several weeks of sitting in front of a mc
<lupine_85>
mac*
<fowl>
lectrick: but if you're on a mac you dont call it text messaging you call it "composing" right?
<lectrick>
fowl: I know. I didn't say it was impossible on other os'es, that would be silly. But the *stuff you really want to do* is almost always easy to do.
<lectrick>
fowl: it's just called "messaging"
<lupine_85>
does it still store the root password in the clear in the directory ?
<RubyPanther>
The stuff you really want to do is always easy on any platform because you choose convenient tools, and activate them frequently.
<lupine_85>
that's something I always want to do
<lectrick>
lupine_85: lol, I really doubt that, and I never knew it did
<lteo>
RubyPanther: +1
rippa has quit [Ping timeout: 268 seconds]
Guest57479 has quit [Client Quit]
mmercer has joined #ruby
<lteo>
it just depends on what you want to do. i use both Mac and OpenBSD (with a tiling WM) as my desktops, for different reasons.
davidcelis_ has joined #ruby
havenn has quit [Ping timeout: 245 seconds]
<lectrick>
RubyPanther: Opening PDF's in a clean interface, quickly, without using nagware, free... Haven't seen it yet on either linux or windows, it's always an annoying experience
davidcelis_ has quit [Client Quit]
<lupine_85>
I use evince for my pdfs
fbernier has quit [Ping timeout: 276 seconds]
<lupine_85>
works fine
aezop has joined #ruby
<lectrick>
Now, Sublime is on all OS'es, so that might change the game for me a bit, since I use it as my editor
<RubyPanther>
lectrick: I either double click it, or type "evince blahblah<tab>"
davidcelis_ has joined #ruby
<lupine_85>
apparently, textmate is coming to linux
<lupine_85>
I might give that a try when it does
<shevy>
hmmmm
<lteo>
i discovered mupdf recently, it's awesome especially if you like vi
<shevy>
what is mupdf
<lectrick>
lupine_85: forget it. textmate has already been supplanted by Sublime which is better and already has a windows/linux version
<lteo>
shevy: really lightweight pdf viewer
<lupine_85>
sounds like effort
<rburton->
I love vim
<shevy>
lectrick, well. don't judge too early! I think sublime is nice... but I still use bluefish 1.0.7 :-)
<lectrick>
RubyPanther: lupine_85 I didn't know about Evince. Looks like someone finally got it close to right. :)
<rburton->
Sublime Text 2 is my primary Ruby IDE
<RubyPanther>
They have adobe on linux too, if you're into proprietary. More features, slower.
<lupine_85>
evince has been the standard for a pretty long time
<shevy>
adobe acrobat read + wine works fine
<shevy>
*reader
<lupine_85>
there is a native linux adobe acrobat
<lupine_85>
it's just an arse to use
<lectrick>
acrobat reader is the worst
<shevy>
I prefer wine, the native linux shit of proprietary software usually sux
<apeiros_>
I think acrobat is a horror on any platform
<lectrick>
ironically
<lteo>
OS X Preview does some pretty badass stuff though, like you can re-arrange pages and stuff without needing a real pdf editor.. iirc
<TTilus>
n_blownapart: if A < B, then it is pretty common to say A#foo is overriden by B#foo or that B#foo overrides A#foo
<shevy>
they seem to only add features nobody uses to their reader
<lectrick>
lteo: yeah, Preview.app is excellent
<lupine_85>
the latest horror that I've discovered is PDF forms
<TTilus>
n_blownapart: both make sense
davidcelis_ has quit [Client Quit]
<lupine_85>
I changed conveyancer, partly because of that
davidcelis_ has joined #ruby
<lupine_85>
oh, while we're bitching on apple, can someone fix their built-in VNC viewer?
<n_blownapart>
TTilus: thanks...why is that?
<lupine_85>
there's no point building it in if it doesn't talk VNC
lhk has joined #ruby
davidcelis_ is now known as davidcelis
davidcelis has quit [Changing host]
davidcelis has joined #ruby
<lhk>
hi
<lhk>
can you point me to a ruby programming quiz/challenge site ?
Solnse has quit [Read error: Connection reset by peer]
<fowl>
ruby koans
i0n has joined #ruby
i0n has quit [Changing host]
i0n has joined #ruby
<shevy>
ruby poans
nobitanobi has joined #ruby
<lupine_85>
project euler ?
<shevy>
lhk, or you could help in real existing projects! :)
<TTilus>
n_blownapart: well, its just plain english, if adam squigspiffles beth, beth is squigspiffled by adam
Doc_X has quit [Remote host closed the connection]
<RubyPanther>
You can just use TightVNC
bluOxigen has joined #ruby
<TTilus>
n_blownapart: or what you mean by "why is that"?
<lupine_85>
or chicken
<RubyPanther>
I don't expect a built-in viewer to be good, why would you expect an OS vendor to choose software that is optimal for your use cases?
<lhk>
shevy: nah, im not that good and dont have the time to get active
<lupine_85>
but if you're distributing a mac application that uses vnc, it'd be cool if you could just use open -w
<lupine_85>
but you can't
<lhk>
fowl: thanks that looks good
chessguy has quit [Remote host closed the connection]
<TTilus>
n_blownapart: and damn my example, it should be B < A (meaning theres class B < A; ...; end)
<n_blownapart>
TTilus: hold on please if you have to time I'm posting to pastie in a sec. thanks
<n_blownapart>
*have time
alexim has joined #ruby
<TTilus>
n_blownapart: pastie helps
vmatiyko has joined #ruby
<TTilus>
n_blownapart: i need to go (to sleep) soon, but there are a ton of people to pick the issue up, just pastie it
verto is now known as verto|off
<n_blownapart>
TTilus: thanks sleep well
fayimora has joined #ruby
pu22l3r has quit [Ping timeout: 252 seconds]
qwerxy has quit [Quit: offski]
asteve has quit []
Bosma has quit [Quit: leaving]
Quad is now known as Quadrant
tayy has joined #ruby
qwerxy has joined #ruby
shadoi has quit [Quit: Leaving.]
banseljaj is now known as imami|afk
elhu has quit [Ping timeout: 244 seconds]
shadoi has joined #ruby
schaerli has quit [Remote host closed the connection]
mockra has joined #ruby
SCommette has quit [Quit: SCommette]
qwerxy has quit [Client Quit]
GoGoGarrett has quit [Remote host closed the connection]
<fowl>
varelli its really simple, method_missing catches missing method calls
<lectrick>
Here's something worth arguing: I am thinking that backdenting "protected" and "private" to the class definition column is smarter than making them start with the same indentation as the methods they affect
<fowl>
m is the name of method you tried to call and *args is the arguments passed to it
chichou_ has joined #ruby
<sent-hil>
Does AS::SecureRandom.hex generate unique ids?
JC` has joined #ruby
<apeiros_>
lectrick: doing that
<apeiros_>
there's places where it looks silly, though :-/
<apeiros_>
sent-hil: basic maths would tell you that that'd be impossible
<sent-hil>
apeiros_: ?
<apeiros_>
ok, maybe that's not basic maths
qwerxy has joined #ruby
rburton- has quit [Quit: rburton-]
bam has quit [Quit: Leaving...]
<apeiros_>
sent-hil: random means it can randomly return the same result
chichou has quit [Ping timeout: 276 seconds]
opus has joined #ruby
<apeiros_>
the bigger the set and the better the distribution the more unlikely it is
<lectrick>
apeiros_: Maybe, but the ruby style guide on github seems to suggest that having "protected" and "private" the same indentation as the "def" is proper form
<apeiros_>
lectrick: it's a style guide
<lectrick>
apeiros_: :)
forrest has quit [Quit: Leaving]
<apeiros_>
there isn't such a thing as "the one true style"
stopbit has quit [Quit: Leaving]
SegFaultAX has quit [Quit: Lost terminal]
<apeiros_>
but going with the flow has its merrits
<fowl>
apeiros_: one style to bind them
<n_blownapart>
fowl thanks but as usual, there is a lot of context I don't understand for instance...
<lectrick>
Which is good. LOL fowl
<JC`>
hello, all. i've got a small script that worked pretty well in 1.8, but now behaves oddly in 1.9. http://pastebin.com/Dpz1y1SD <- only line 22 "misbehaves" now. the script is ran from within mutt, the unix mail client. it takes attachments and ships them off to a workstation with X for viewing. afterwards, it goes back and prompts for removal of the temporary file. in 1.8, it waits for the y/n removal of the file. in 1.9, the rm runs, the question is pose
asobrasil has left #ruby [#ruby]
balki_ has joined #ruby
<lupine_85>
I tend to put private / protected in the same indentation as class
<apeiros_>
fowl: the bondage style? :)
sazboom has quit [Ping timeout: 246 seconds]
qwerxy has quit [Client Quit]
alanp has joined #ruby
<lectrick>
And in the darkness find them?
<lupine_85>
I do the same with case/when and if/else
balki has quit [Read error: Connection reset by peer]
<fowl>
lectrick: +1 apeiros_: -1
alanp_ has quit [Read error: Connection reset by peer]
<lupine_85>
half-baked rationale: you're not adding something to the enclosing scope, you're specifying a condition for things that are being added to it
<lupine_85>
oh, also begin/rescue and begin/ensure
<n_blownapart>
why would a method called "grade_for_" be coming in with a Student object? and where would it come from? fowl
<fowl>
n_blownapart: it wouldnt. you're supposed to parse out the name
<apeiros_>
n_blownapart: since there's no method with that name, method_missing is invoked, and the first argument is :grade_for_chemistry
<apeiros_>
and in your example, you're supposed to parse out "chemistry", get the grade for that subject, and return it
<fowl>
you even have a helpful comment: #return the appropriate grade, based on parsing the method name.
<sent-hil>
what's a good way to generate uuids for urls? uuid/AS securerandom gives way too long entries
Bosma has joined #ruby
<apeiros_>
sent-hil: what about plain ruby's SecureRandom.uuid ?
<sent-hil>
apeiros_: too long
<lupine_85>
?
<lupine_85>
a UUID is always 128 bits long
<apeiros_>
sent-hil: um… you don't know what uuid means then
<lupine_85>
no exceptions
<apeiros_>
you know, there's a definition for them.
<n_blownapart>
apeiros_: fowl so the grade_for_chemistry would be a misplaced/misinformed method name that came in with a Student obj. ? I need to see the scenario in which the grade_for_math would come into the prog. in the first place. thanks
<savage->
sent-hil: how about SecureRandom.base64
<fowl>
sent-hil: md5(time())
<lupine_85>
:S
<fowl>
php^^
BrokenCog has joined #ruby
<lupine_85>
you can take the raw 128 bits and base64-encode them, I guess
<fowl>
n_blownapart: what do you mean?
DrShoggoth has quit [Quit: Leaving]
<lupine_85>
that'll be short
<apeiros_>
sent-hil: anyway, if you want a non-uuid random hex, SecureRandom.hex(n). but it's not a uuid then.
<fowl>
n_blownapart: i cant help you if its going to take so long for you to reply, i dont have the attention span
<sent-hil>
apeiros_: how do existing sites solve this problem then? just increment integers?
<apeiros_>
sent-hil: "this problem" being?
<fowl>
n_blownapart: if you dont know the scenario then why are you writing method_missing? you havent hit the problem yet that method_missing solves
t68948 has quit [Remote host closed the connection]
<apeiros_>
sent-hil: you know, I can't read minds…
geggam has joined #ruby
nicoulaj has quit [Remote host closed the connection]
t57827 has joined #ruby
ChampS666 has quit [Ping timeout: 268 seconds]
<n_blownapart>
sorry fowl I had to shut of the garden sprikler.
<n_blownapart>
off
sailias has joined #ruby
<n_blownapart>
fowl this is a textbook example that doesn't give the context for how to use it.
<lupine_85>
frankly, any field with a unique constraint will work, as long as you have the consistency part of CAP
<apeiros_>
Aristata: without looking at it: you're using it wrong. feel free to amend your problem description.
elhu has quit [Quit: Computer has gone to sleep.]
<lupine_85>
we use labels and names an awful lot internally, occasionally just the database 'id' column
<apeiros_>
(note that the reply is intentionally as bad as the problem description)
<lupine_85>
UUIDs only where things are being generated simultaneously on different hosts and have no chance of being made eventually consistent
<n_blownapart>
I understand it in a very limited context: return the grade based on a nonexistent? method name, or send the method call up the superclass lookup.
<n_blownapart>
fowl ^^ apeiros_
<n_blownapart>
*sprinkler
<fowl>
n_blownapart: what do you need context for? method_missing is called when you call a missing method..
<fowl>
Student.new.poop! for example
indian has joined #ruby
gfontenot has joined #ruby
<apeiros_>
n_blownapart: method_missing is called for any method not present in the method lookup chain.
mockra has joined #ruby
<apeiros_>
the last being Object#method_missing which in turn blows up with a NameError. (not necessarily the technical reality, but a good thought model)
<Aristata>
apeiros_: It should return a match of both emails, not just the one
<Aristata>
sorry
<sent-hil>
apeiros_: how to generate a id for each object, without incrementing it from 1?
<apeiros_>
because you want to get the grade for chemistry
Morkel has quit [Quit: Morkel]
<n_blownapart>
apeiros_: but that seems like a round a bout way of getting the data.
<apeiros_>
Aristata: match only returns the first match
<apeiros_>
Aristata: look at String#scan
cousine has quit [Remote host closed the connection]
<rking>
Do any of you know of a generic diff-based testing tool? For example, imagine recursively wget'ing your generated HTML into a "greenbar" dir in your repo, then re-spidering before committing, so you can see the diffs. (Here's another example of the same idea, but for a CLI script: https://github.com/exad/zu/blob/master/test/run )
<n_blownapart>
fowl too much buddhist chanting.
<apeiros_>
n_blownapart: it's an example
<fowl>
n_blownapart: yes ideally you would call somestudent.grade(:algebra) or something like that
fastred has quit [Quit: fastred]
<Aristata>
apeiros_: I figured it out, I needed parenthesis
<fowl>
n_blownapart: this should just show you that you can catch missing methods and do useful things with them, its an exercise
<apeiros_>
n_blownapart: also, we rubyists are obsessed with aesthetics. we much prefer student.algebra_grade over student.grades[:algebra] or similar
[Neurotic] has joined #ruby
Jonah11_ has joined #ruby
<n_blownapart>
fowl apeiros_ ok maybe I'm looking for more is there. I'm fastidious, so I'm thinking : why do it that way?
<apeiros_>
Aristata: match will only give you the first match with parentheses too…
<n_blownapart>
more *than
<JC`>
anyone know if there were any major Kernel#system changes between 1.8 and 1.9?
syamajala has quit [Remote host closed the connection]
beneggett has quit [Quit: Computer has gone to sleep.]
<Aristata>
apeiros_: No, I have it returning two
<apeiros_>
…
<fowl>
n_blownapart: why track students and their grades? what kind of creep are you? spying on kids isnt cool.. obviously this software wont actually be used by teachers.. its an exercise
<n_blownapart>
apeiros_: so in your comment about aesthetics, instead of using the symbol :algebra, you would just forego a normal sort of data input into the prog?
fowl has left #ruby ["Leaving"]
<apeiros_>
Aristata: you may want to pay closer attention to what your return value is
<shevy>
JC` I think system() stayed the same
<n_blownapart>
fowl !! you're the sick one !
<shevy>
he has that nick for a reason!!!
<lupine_85>
apeiros_, speak for yourself in that example ^^
<apeiros_>
lupine_85: which one? the email matching?
<JC`>
shevy: any idea why the code here, particularly line #22, would behave differently? http://pastebin.com/Dpz1y1SD
<lupine_85>
student.algebra_grades
chico_chicote has joined #ruby
<lupine_85>
I'd probably have student.grades_for :algebra instead
<apeiros_>
lupine_85: ah. I was intentionally overstating (hm, what's the proper term for that?)
MarGarina has quit [Ping timeout: 265 seconds]
<apeiros_>
lupine_85: I wasn't off, though. consider the whole lot of DSLs
<n_blownapart>
thanks fowl apeiros_ lupine_85 I think I get it well enough
<lupine_85>
there are certainly occasions where it increases clarity
Jonah11_ has quit [Quit: Leaving]
<apeiros_>
which is, to a big degree, an aesthetic measure :)
<Aristata>
apeiros_: Shit
ianbrandt has quit [Quit: ianbrandt]
<lupine_85>
but anywhere a new category could be arbitrarily added at any point, I consider encoding the category in a method name to be a bad idea
havenn has joined #ruby
<apeiros_>
Aristata: I'll refer you once again to String#scan.
<n_blownapart>
lupine_85: regarding the method_missing example?
<apeiros_>
lupine_85: I get it you'd never use an openstruct instead of a hash? :)
<lupine_85>
yeah. you can use metaprograming to handle new categories automatically in the called object, with method_missing and friends, but if you try to do the same at the caller end, you find yourself playing with send and constructing strings a lot
kpshek has quit []
<Aristata>
apeiros_: I am going to build a different system anyway :p
<beandip>
Hi all. I want to do an if/then if a vairable is defined. What is the best syntax to use?
<apeiros_>
Aristata: why did you ask then?
<Aristata>
??
Rajesh_ has quit [Quit: Leaving to Quit]
<lupine_85>
if defined?(var-name)
<Aristata>
What's it matter?
<n_blownapart>
lupine_85: that is somewhat over my head, but my sense is that it is an odd way to do things.
<lupine_85>
but when local variables can be defined or not is subject to some fun rules
<lupine_85>
(I don't really understand them myself, but apparently, if false; a = 1 ; end ; defined?(a) will return true)
<apeiros_>
also it's usually rather code-smelly if you have to test for lvar existence
velikasha has left #ruby [#ruby]
<apeiros_>
test for specific values of an lvar, not its existence (e.g. for nil)
infinitiguy has quit [Ping timeout: 244 seconds]
<beandip>
apeiros, the question is mainly asked for a chef recipe I'm writing
<lupine_85>
mm, if you're having to check whether it's been defined elsewhere in the code or not, you're looking at side-effect city
jgarvey has quit [Quit: Leaving]
<apeiros_>
beandip: that doesn't really change the nature of code-smell
mikepack has quit [Read error: Connection reset by peer]
mikepack_ has joined #ruby
<lupine_85>
but frameworks will force you to do these things sometimes
<apeiros_>
I seriously doubt chef does that
moshee has quit [Ping timeout: 244 seconds]
havenn has quit [Ping timeout: 244 seconds]
<apeiros_>
and I'd consider a framework an instafail which does
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
<lupine_85>
I once had to change a method called by rails so that it returned one thing when called from one section of rails, and another when called from a different section
<apeiros_>
ew
khakimov has joined #ruby
<lupine_85>
if caller[2] =~ /...\.rb/ ... else ... end IIRC
<n_blownapart>
apeiros_: so don't study rails? banisterfiend says he doesn't use it.
theRoUS has quit [Ping timeout: 244 seconds]
<lupine_85>
I felt *very* dirty, doing that
<apeiros_>
n_blownapart: I do. I'm not a fan of it. and it's certainly not a good source for role model code
<apeiros_>
lupine_85: I'd hope so!
<lupine_85>
and in fact, that code is still in production :S
<lupine_85>
(there is/was a bug in rails with decimal numbers where scale = 0)
<apeiros_>
n_blownapart: not to get me wrong - there is a lot of excellent code in rails
<lupine_85>
the schema generator turned them from decimal to integer, IIRC
<lupine_85>
this was way back in 2.3
<apeiros_>
but there's also a lot of very crappy code in it. and unless you already have the experience, you'll probably copy horrible code.
Goles has joined #ruby
vitor-br has joined #ruby
<lupine_85>
(of course, decimal(40), scale 0 is the best way to store IPv6 addresses in mysql)
<n_blownapart>
apeiros_: thanks I guess I'll come across more method_missing in the core language that will keep me busy. many thanks and to you too lupine_85
<apeiros_>
lupine_85: my favorite rails bug was in 3.x where the logger would crash when getting binary data
<lupine_85>
heh, not come across that one
<apeiros_>
(ooh, you have binary data in your sql? oooh I'm so terribly sorry but I'm gonna crash your app…)
banisterfiend has quit [Remote host closed the connection]
<ged>
beandip: if defined?( variable )
<apeiros_>
n_blownapart: you can live happily without method_missing. just to say.
<lupine_85>
which is lucky, actually, since we do push binary data into a few tables in one AR 3.0.9 project
<lupine_85>
3.0.7 *
ephemerian has quit [Quit: Leaving.]
<apeiros_>
oh, fun, I replaced the keycaps for the L and H key :)
banisterfiend` has joined #ruby
<apeiros_>
lupine_85: I'd hope it got fixed. I still have it on my todos to remove my fix and see whether it still works.
<lupine_85>
our rails stuff at work tends to ossify
<lupine_85>
there's more applications than people to maintain them
<apeiros_>
similar here
<lupine_85>
when I started, back in the 2.1 days, there were still pre-1.0 rails applications hanging around
pskosinski has quit [Ping timeout: 276 seconds]
<apeiros_>
should I mention that one of our apps is rails 1.2.3?
<savage->
apeiros_: wow! is there just no compelling reason to upgrade?
Hawklord has joined #ruby
<savage->
I find that it's hard to upgrade when you've monkey-patched the hell out of certain parts.
<apeiros_>
savage-: it works. no features need to be added. it's internal, so security isn't an issue.
stepnem has quit [Ping timeout: 245 seconds]
<savage->
ah, makes sense.
jasonLaster has quit [Remote host closed the connection]
<apeiros_>
savage-: so yes, upgrading would mean costs for no gains. it just keeps running.
vitor-br has quit [Ping timeout: 276 seconds]
jasonLaster has joined #ruby
<apeiros_>
oh, and it seems to be bug-free. which is great :)
<savage->
nice! :)
<savage->
apeiros_: you're not going to BaRuCo in barcelona in a few weeks, are you?
bluOxigen has quit [Ping timeout: 240 seconds]
<apeiros_>
savage-: no. been to railsberry & euruko this year already
stepnem has joined #ruby
<apeiros_>
considered frozenrails, but I think I'll pass.
<savage->
okay, just curious. :)
<savage->
apeiros_: have you ever given a talk at a ruby conference before?
<lupine_85>
I considered frozenrails, but the boss decided not to pay ^^
<lupine_85>
so I'm not going
beneggett has joined #ruby
<apeiros_>
savage-: nope :)
<savage->
apeiros_: you definitely should. :-) you have a lot of good material.
<apeiros_>
savage-: thanks for the heads up
<apeiros_>
but maybe I should have more finished material :o)
<apeiros_>
working on that, though
<savage->
I'm going to give a quick lightning talk on redis_failover at BaRuCo. I've never given one before, but I'm excited about it.
TorpedoSkyline has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<apeiros_>
nice
<apeiros_>
yeah, I think I'd shit my pants while giving a talk
<savage->
Let's see how many slides I can cram into 7 minutes. :)
t57827 has quit [Remote host closed the connection]
<savage->
hehe
<apeiros_>
even if "only" a lightning talk
t58298 has joined #ruby
<savage->
I've actually given talks before at local meetup groups here (hadoop, java-based stuff, etc).
jasonLaster has quit [Ping timeout: 260 seconds]
<savage->
But never anything related to ruby since I took the dive into Ruby a year ago. :-)
Inoperable has joined #ruby
<apeiros_>
yeah, still preparing one on deduplicating customer databases and handling addresses
Inoperable has quit [Excess Flood]
<apeiros_>
for a local meet-up I mean
jjbohn has quit [Quit: Leaving...]
dpk has quit [Quit: Asleep at the keyboard.]
<savage->
oh cool.
jrist is now known as jrist-afk
Inoperable has joined #ruby
Inoperable has quit [Excess Flood]
vmatiyko has left #ruby [#ruby]
nilg has quit [Remote host closed the connection]
Inoperable has joined #ruby
Inoperable has quit [Excess Flood]
gfontenot has quit [Ping timeout: 240 seconds]
kvirani has quit [Remote host closed the connection]
<apeiros_>
yeah, it's quite a difficult topic, and I think I have good solutions
Inoperable has joined #ruby
Inoperable has quit [Excess Flood]
wereHamster has quit [Quit: Lost terminal]
* TTilus
is going to frozenrails independent of anyone else paying...
Inoperable has joined #ruby
Inoperable has quit [Excess Flood]
Inoperable has joined #ruby
Inoperable has quit [Excess Flood]
Inoperable has joined #ruby
Inoperable has quit [Excess Flood]
bowlowni has quit [Remote host closed the connection]
Inoperable has joined #ruby
Inoperable has quit [Excess Flood]
cakehero has quit [Quit: Computer has gone to sleep.]
<lupine_85>
I only really wanted to go for the location, so it's not too surprising the boss didn't want to pay
<TTilus>
frozenrails for the location?
<TTilus>
a bit surprising, have to say
<TTilus>
take no offence if you live in helsinki
<apeiros_>
the location is a teaser to me too
v0n has quit [Ping timeout: 246 seconds]
the_jeebster has quit [Quit: Leaving.]
virunga has quit [Quit: Sto andando via]
<TTilus>
oh
<peterhellberg>
Best Ruby conference location so far (for me at least): Nordic Ruby this year
<TTilus>
imo HICSS or something like that would be "going for the location" ;)
<TTilus>
peterhellberg: it was that bath thing?
<peterhellberg>
TTilus: Yeah. At a Japanese Spa, close to Stockholm.
cousine has joined #ruby
<apeiros_>
haha
<apeiros_>
nice
<apeiros_>
too bad I missed that
* apeiros_
loves spa
<peterhellberg>
Next one up: Boulder, CO :)
n_blownapart has quit [Remote host closed the connection]
cousine has quit [Remote host closed the connection]
chrisbolton has quit [Quit: chrisbolton]
<atmosx>
so virunga replied correctly
<virunga>
slyv: (1..100).reduce(:+)
steffes has quit [Remote host closed the connection]
<virunga>
this should work
yoklov has quit [Quit: computer sleeping]
<atmosx>
well you can easily create a function to suit your formula
beneggett has quit [Quit: Computer has gone to sleep.]
<atmosx>
virunga: what the :+ means?
g_rotbart has joined #ruby
<virunga>
atmosx: i don't remember exactly but it returns a proc obj
<virunga>
because Symbol class has a method name to_proc that call that method (+)
<virunga>
more or less
chessguy has quit [Read error: Connection reset by peer]
<virunga>
sorry
luckyruby has quit [Read error: Connection reset by peer]
chessguy has joined #ruby
luckyruby has joined #ruby
<virunga>
it's the same as give a block
<virunga>
unfortunately i never use ruby :(
<lupine_85>
so the implementation of reduce has to do if arg.has_method?(:to_proc) ... ?
<lupine_85>
or does it get automatically converted in certain situations ?
<virunga>
so i forget things
<lupine_85>
(I'm used to ruby 1.9, where you'd do &method(:+))
<lupine_85>
erm, 1.8
<virunga>
lupine_85: sorry, i don't understand the question. My bad english
<virunga>
and hour :P
stepnem has quit [Ping timeout: 245 seconds]
jmeeuwen has quit [Quit: Disconnecting from stoned server.]
<lupine_85>
what it boils down to is whether, given reduce(:+), in the implementation of reduce, will block_given? return true?
kn330__ has joined #ruby
emmanuelux has joined #ruby
Aristata has quit [Quit: Leaving.]
jmeeuwen has joined #ruby
<lupine_85>
I guess I could write a test case :D
kn330_ has quit [Read error: Connection reset by peer]
poga has joined #ruby
<virunga>
lupine_85: you can also go to see the implementation on ruby-doc
<virunga>
click on show source code
duncanm has joined #ruby
<duncanm>
hmm
indian has quit [Ping timeout: 260 seconds]
<duncanm>
i have an issue with doing a POST in net/http in 1.9.3
<duncanm>
in `send_request_with_body': undefined method `bytesize' for #<Array:0x007fbd519cb538> (NoMethodError)
<duncanm>
and i can't seem to google any solution
stepnem has joined #ruby
SegFaultAX has joined #ruby
<virunga>
>> :+.to_proc
<al2o3cr>
(Proc) #<Proc:0x00000001270c58>
SegFaultAX has quit [Client Quit]
<virunga>
>> p = :+.to_proc; p.call(2, 40)
<al2o3cr>
(Fixnum) 42
<lupine_85>
right, it doesn't get automatically converted into the block for the method you're passing it as an argument to
<lupine_85>
which is a kind of relief, kind of shame
seanstickle has joined #ruby
<lupine_85>
so the implementation must do if block_given? ; yield ; else ; args[0].to_proc.call if args[0].respond_to?(:to_proc) ; end
<nobitanobi>
Anyone knows how to pass parameters in a hash form when using OAuth get method? Something like this: @photos = @access_token.get('/photos.xml', :parameters => {:id => 1} ) I can't find the way to do it in the Docs.
<lupine_85>
*shudder
ph^ has quit [Remote host closed the connection]
justsee|away is now known as justsee
nateberkopec has quit [Quit: Leaving...]
stepnem has quit [Excess Flood]
resure has quit [Remote host closed the connection]
mike4_ has quit [Ping timeout: 276 seconds]
Stalkr_ has quit [Quit: Leaving...]
virunga has quit [Quit: Sto andando via]
bluenemo has quit [Read error: Connection reset by peer]
havenn has joined #ruby
jjang has joined #ruby
xnm has joined #ruby
mikepack_ has quit [Remote host closed the connection]
<shevy>
my keyboard makes loud sounds when I type the space key :(
jjbohn has joined #ruby
specialGuest has quit [Quit: WeeChat 0.3.8]
<shevy>
it's noisy
<shevy>
are there extra silent keyboards?
micadeyeye has quit [Ping timeout: 272 seconds]
SCommette has joined #ruby
havenn has quit [Ping timeout: 240 seconds]
inteq has joined #ruby
micadeyeye has joined #ruby
<ggreer>
I hear the IBM Model M is a quiet keyboard
inteq has quit [Client Quit]
nobitanobi has quit [Read error: Connection reset by peer]
pskosinski has joined #ruby
nobitanobi has joined #ruby
<nobitanobi>
shevy: Do you happen to have a MB Air? A friend of mine is so frustrated with his space bar noise in his Air...
fayimora has quit [Read error: Connection reset by peer]
spree_josh has quit []
<shevy>
nobitanobi hmm no... dont think so... I have a Microsoft Wired Keyboard 200
tayy has quit [Remote host closed the connection]
<shevy>
but one month after buying it, the keys seem to have gotten louder :(
<nobitanobi>
shevy: oh ~~
<nobitanobi>
shevy: go tell em!
<shevy>
it's a good keyboard otherwise, but the typing sound annoys me
<shevy>
I used to have a really heavy MS Office keyboard... it was fairly silent
idoru has quit [Ping timeout: 600 seconds]
gmci has quit [Ping timeout: 276 seconds]
korczis has quit [Quit: Leaving]
korczis has joined #ruby
<nobitanobi>
shevy: I remember my old MS keyboard with the MS Explorer mouse. those were good stuff
<shevy>
I semi-watch a video while writing code, and it's on low volume to not distract me too much, and that typing noise distracts me, it's louder than the movie...
t58298 has quit [Remote host closed the connection]
<shevy>
haha the explorer mouse
dpk has quit [Quit: Asleep at the keyboard.]
<nobitanobi>
shevy: remember the explorer one ah?
t47000 has joined #ruby
SQLStud has quit [Read error: Connection reset by peer]
<nobitanobi>
shevy: I loved it...
chessguy has quit [Remote host closed the connection]
<ggreer>
I have that cheap amazon bluetooth keyboard. it's pretty quiet
manizzle is now known as WeLoveCP
<shevy>
I am not sure if I remember. the mice today are quite ok.. cheap and not annoying. and reliable
<graft>
okay... x = []; x[3] = 1; x.inject(:+) fails because + is not defined on nil. what do i do here?
<ggreer>
maybe you just hit the spacebar more authoritatively than most keys?
<shevy>
a few years ago I had a cheap mouse where the outer polish (that red colour) slowly fell apart in pieces... that was ugly to touch
<LiquidInsect>
graft: you made an array that looks like [nil, nil, nil, 3]
<ggreer>
or lubricate it?
<ggreer>
or both?
<LiquidInsect>
and tried to sum it
Synthead has quit [Quit: p33 ba115]
<graft>
LiquidInsect: yeah...
<shevy>
like when you scratch over a chalkboard with a knife... I get slight goose pimples from that sound
<LiquidInsect>
nil isn't a number so you can't do that
<shevy>
ggreer, will give it a try tomorrow. when I shake it, something rattles inside...
<shevy>
as if tiny pearls are in it
<shevy>
nobitanobi hmm I thought they were more primitive back then
ph^ has joined #ruby
WeLoveCP is now known as manizzle
<ggreer>
oh. it could be one of those springy bars on the sides of big keys. if one of those has come loose, the key won't go straight down if you press off-center
manizzle is now known as manizzle_
<peterhellberg>
graft: You could do x.compact.inject(:+)
<peterhellberg>
graft: If you just want to remove the nils
gmci has joined #ruby
<shevy>
I remember those mice with the teal middle wheel thing