apeiros_ changed the topic of #ruby to: Ruby 1.9.3-p194: http://ruby-lang.org || Paste >3 lines of text on gist.github.com || Rails is in #rubyonrails || Log: http://irclog.whitequark.org/ruby
rowanu has quit [Remote host closed the connection]
oooPaul has quit [Quit: Ciao for now!]
ben_alman has quit [Excess Flood]
ben_alman has joined #ruby
thomas`- has joined #ruby
Liothen has joined #ruby
bradhe has joined #ruby
mikeycgto has joined #ruby
mikeycgto has quit [Changing host]
mikeycgto has joined #ruby
<thomas`-> Hi all. I have a question about controllers. If you have all user operations in 1 file and you have all payment operations in another file, where do you put the code that converges both?
Ed__ has left #ruby [#ruby]
rjsamson has joined #ruby
kenichi has quit [Remote host closed the connection]
nai has joined #ruby
nari__ has quit [Ping timeout: 245 seconds]
rjsamson_ has joined #ruby
rjsamson has quit [Read error: Connection reset by peer]
<boobah> thomas`-: #rubyonrails
xaq has quit [Remote host closed the connection]
itnomad has quit [Ping timeout: 248 seconds]
<thomas`-> boobah, k thanks
thomas`- has left #ruby ["Leaving"]
rjsamson_ has quit [Client Quit]
rjsamson has joined #ruby
ianbrandt has quit [Quit: ianbrandt]
itnomad has joined #ruby
minijupe has joined #ruby
maahes has joined #ruby
saschagehlich has joined #ruby
davidcelis has quit [Ping timeout: 264 seconds]
yugui is now known as yugui_zzz
Spooner has quit [Read error: Connection reset by peer]
cakehero has quit [Quit: Computer has gone to sleep.]
seanstickle has joined #ruby
Sheehan has joined #ruby
maxmmurphy has quit [Quit: maxmmurphy]
Foxandxss has quit [Quit: KVIrc 4.0.4 Insomnia http://www.kvirc.net/]
Criztian has quit [Remote host closed the connection]
hynkle has joined #ruby
<rking> Hehe, my guard+rspec conf is somehow going crazy. It runs thrice per file modification.
minijupe has quit [Quit: minijupe]
jcromartie has joined #ruby
<rking> Might have something to do with this startup warning: DEPRECATION: Starting with Guard v1.1 the use of the 'run_on_change' method in the 'Guard::RSpec' guard is
<rking> deprecated.
Nies has quit [Quit: Saliendo]
hunglin has joined #ruby
nai has quit [Read error: Connection reset by peer]
nai has joined #ruby
liluo has quit [Remote host closed the connection]
jimeh has quit [Ping timeout: 246 seconds]
freeayu has joined #ruby
<offby1> I've seen that a lot but not had your problem
<offby1> where by "a lot" I mean "every time I do 'rake spec' in the Rails Tutorial"
kenperkins has quit [Quit: Computer has gone to sleep.]
nai has quit [Remote host closed the connection]
RainbowD_ has joined #ruby
sam113101 is now known as samantha113101
minijupe has joined #ruby
wallerdev has quit [Quit: wallerdev]
mockra has quit [Remote host closed the connection]
wallerdev has joined #ruby
Spooner has joined #ruby
bradhe has quit [Remote host closed the connection]
adamkitt_ has quit [Remote host closed the connection]
jitesh_shetty has quit [Remote host closed the connection]
berserkr has quit [Quit: Leaving.]
austinbv1 has quit [Ping timeout: 246 seconds]
sei has quit [Read error: Connection reset by peer]
indeterminate has joined #ruby
bricker88 has quit [Quit: Leaving.]
fbernier has joined #ruby
luxurymode has joined #ruby
* tama yawns
beneggett has joined #ruby
fulmato has quit [Ping timeout: 246 seconds]
ben_m has quit [Ping timeout: 248 seconds]
whuffor has quit [Read error: Connection reset by peer]
iocor has quit [Quit: Computer has gone to sleep.]
minijupe has quit [Quit: minijupe]
rafacv has joined #ruby
austinbv1 has joined #ruby
Progster has joined #ruby
Sheehan has quit [Quit: Sheehan]
jcromartie has quit [Quit: jcromartie]
adeponte has quit [Remote host closed the connection]
mockra has joined #ruby
RainbowD_ has quit [Quit: SLEEP MODE. I should stop shutting my MBP's lid less and get a QUIT message rotator.]
fbernier has quit [Ping timeout: 246 seconds]
mockra has quit [Ping timeout: 245 seconds]
ken_barber has quit [Remote host closed the connection]
saschagehlich has quit [Quit: saschagehlich]
liluo has joined #ruby
saschagehlich has joined #ruby
saschagehlich has quit [Client Quit]
rbanffy has quit [Ping timeout: 246 seconds]
rakunHo has joined #ruby
ben_m has joined #ruby
eywu has quit [Quit: Leaving.]
Ontolog has quit [Remote host closed the connection]
aantix_ has joined #ruby
Ontolog has joined #ruby
Aaton is now known as Aaton_off
jianxioy has joined #ruby
aantix has quit [Read error: Operation timed out]
jxpx777|afk is now known as jxpx777
jianxioy has quit [Client Quit]
grauwoelfchen has joined #ruby
jianxioy has joined #ruby
rbanffy has joined #ruby
wilmoore has quit [Remote host closed the connection]
Ontolog has quit [Ping timeout: 246 seconds]
aantix_ has quit [Ping timeout: 246 seconds]
schickung has joined #ruby
gtuckerkellogg has joined #ruby
davidcelis has joined #ruby
davidcelis has joined #ruby
macmartine has joined #ruby
undeclaredx has joined #ruby
undeclaredx has left #ruby [#ruby]
pen has quit [Remote host closed the connection]
ben_alman has quit [Excess Flood]
jxpx777 is now known as jxpx777|afk
Brandan has joined #ruby
iori has joined #ruby
cjs226 has quit []
Banistergalaxy has quit [Ping timeout: 265 seconds]
<offby1> NOOOO
ePirat_ has joined #ruby
dagnachewa has joined #ruby
wallerdev has quit [Quit: wallerdev]
v0n has joined #ruby
stephenjudkins has quit [Quit: stephenjudkins]
mucker has quit [Ping timeout: 252 seconds]
manizzle has quit [Read error: Operation timed out]
kenperkins has joined #ruby
ibash has joined #ruby
savage- has quit [Remote host closed the connection]
ibash has quit [Client Quit]
ibash has joined #ruby
CreativeEmbassy has joined #ruby
<ibash> how do I wrap a gem's method?
<ibash> I tried alias_method s but get stack level too deep when I call the original method
<ibash> tried like this: http://pastie.org/4163186
bambanx has joined #ruby
<bambanx> hi
ben_alman has joined #ruby
Squee-D has joined #ruby
seanstickle has quit [Quit: seanstickle]
<Squee-D> Writing a gem for set assertions. Wondering how i write a test that asserts an assertion fails ?
ePirat_ has quit [Remote host closed the connection]
ePirat_ has joined #ruby
liluo_ has joined #ruby
jamesaxl has quit [Read error: No route to host]
Targen_ has quit [Ping timeout: 264 seconds]
<Squee-D> see line 16: https://gist.github.com/3008118 (obviously i dont expect that to work)
liluo has quit [Ping timeout: 246 seconds]
centipedefarmer has joined #ruby
<SeanLazer> Squee-D: isn't there something like assert_not ?
<Squee-D> assert_not an assertion?
<Squee-D> the problem here, is i am testing assertions..
<SeanLazer> assert_not_identical_set?
apok_ has joined #ruby
<SeanLazer> i'm not sure, i haven't used test::unit in a long time
apok_ has quit [Client Quit]
<Squee-D> i would be testing a different assertion, or are you suggesting that there is some magic there?
<SeanLazer> it would be nice if there was some magic there but it appears there's not
<Squee-D> there is no magic
<rking> BTW my earlier issue with guard-rspec was resolved by using the git versions of guard and guard-rspec.
_Bairn has quit [Quit: _Bairn]
adeponte has joined #ruby
<SeanLazer> Squee-D: you could just write it as plain ruby?
apok has quit [Ping timeout: 265 seconds]
<Squee-D> I'm not sure what you mean.. I think i'll need rescue and look for a particular test-unit error
<SeanLazer> are you just trying to assert that two arrays aren't equal?
_Bairn has joined #ruby
ken_barber has joined #ruby
<_Bairn> Hey friends.
c0rn_ has quit [Quit: Computer has gone to sleep.]
<tama> is there a book that teaches you how to create ruby gems that properly use rake and rspec and rdoc and all that?
<tama> because i would very much like to buy it, if it exists
<SeanLazer> okay i have my own question, i'm writing a decorator that mainly wraps ActiveRecord objects and needs to implement as_json
<SeanLazer> here's my implementation so far, but it uses a class level variable and it doesn't work because the class level variable is shared across subclasses
<SeanLazer> can someone suggest a better way to do this?
pk1001100011 has quit [Quit: I've got a feeling there's a fish in the floor; I'd better squish it or he'll swim out the door; Sometimes they take me for a walk in the sun; I see my fish and I have to run]
<Squee-D> sean im testing set equality.
jitesh_shetty has joined #ruby
nari_ has joined #ruby
<Squee-D> sean use a class instance variable
<Squee-D> @json_methods
Nick_ has joined #ruby
savage- has joined #ruby
<Squee-D> I generally frown upon @@, it's largely useless (caveat that i may be wrong)
brianpWins has quit [Quit: brianpWins]
<Squee-D> the class instance variable will belong to the leaf class in the class heirarchy
bradhe has joined #ruby
<SeanLazer> isn't that just an instance variable?
CheeToS has joined #ruby
<Squee-D> not when defining a class method
<SeanLazer> Squee-D: well look at me learning
<Squee-D> @originators for example
akem has quit [Ping timeout: 255 seconds]
mrsolo has quit [Quit: Leaving]
savage- has quit [Remote host closed the connection]
<SeanLazer> ah, gotcha
<SeanLazer> i think the fact that i'm inheriting from BasicObject is going to make this a little trickier but i didn't realize you could do that, thank you
<Squee-D> in the mixed into class (call it Foo), i call validates_originators :person and then you'll find Foo.originators is [:person]
<Squee-D> try mixing in :D
<Squee-D> bblater
<Squee-D> and your welcome
TheFuzzball has quit [Ping timeout: 244 seconds]
wpaulson has joined #ruby
shadoi has quit [Quit: Leaving.]
davidokner has joined #ruby
<davidokner> Hi
<tama> Squee-D: hai!
<tama> how have you been, Squee-D ?
TheFuzzball has joined #ruby
<davidokner> This RubyMonk.com website is probably the best way to learn ruby I've seen. Better than the pick Ax book.
* tama checks.
Ontolog has joined #ruby
maxmmurphy has joined #ruby
<davidokner> The Pragmatic studio has a $200 video with online exercise series which might be similar. I think you need interaction. I need to do it to learn it, otherwise I'm just reading about it.
hynkle has quit [Ping timeout: 250 seconds]
Nick_ has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
hynkle has joined #ruby
ePirat_ has quit [Remote host closed the connection]
stkowski has quit [Quit: stkowski]
invsblduck has quit [Ping timeout: 248 seconds]
faulkner- is now known as faulkner
Hanmac1 has joined #ruby
Hanmac has quit [Read error: Operation timed out]
kevinbond has quit [Quit: kevinbond]
khakimov has quit [Quit: Computer has gone to sleep.]
frishi has joined #ruby
stewart_1 has quit [Read error: Connection reset by peer]
voodoofish430 has quit [Quit: Leaving.]
emmanuel__ has quit [Ping timeout: 265 seconds]
cjs has joined #ruby
ibash has quit [Quit: ibash]
bradhe has quit [Remote host closed the connection]
radic has quit [Read error: Operation timed out]
stewart_1 has joined #ruby
perryh_away is now known as perryh
dhruvasagar has joined #ruby
ken_barber has quit [Remote host closed the connection]
eywu has joined #ruby
eywu has quit [Client Quit]
bambanx has quit [Ping timeout: 255 seconds]
Natch has quit [Read error: Connection reset by peer]
Tricks has quit [Read error: Connection reset by peer]
Tricks_ has joined #ruby
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
x0F_ is now known as x0F
Natch has joined #ruby
wpaulson has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
Yarou_ has joined #ruby
ben_m` has joined #ruby
TheFuzzball has quit [Ping timeout: 240 seconds]
CheeToS has quit [Ping timeout: 252 seconds]
Juul has quit [Quit: Leaving]
wpaulson has joined #ruby
ePirat- has quit [Ping timeout: 246 seconds]
Yarou has quit [Ping timeout: 246 seconds]
ben_m has quit [Ping timeout: 246 seconds]
austinbv1 has quit [Ping timeout: 252 seconds]
Yugo has joined #ruby
radic has joined #ruby
shadoi has joined #ruby
Targen has joined #ruby
v0n has quit [Ping timeout: 245 seconds]
Nisstyre has quit [Quit: Leaving]
rbanffy has quit [Ping timeout: 246 seconds]
mdhopkins has quit [Quit: do de do]
bambanx has joined #ruby
<Squee-D> do i know you tama?
TheFuzzball has joined #ruby
nadirvardar has quit [Quit: Computer has gone to sleep.]
csprite has joined #ruby
Yugo has quit [Ping timeout: 255 seconds]
hiefhaifhif has joined #ruby
Brandan has quit [Ping timeout: 246 seconds]
<hiefhaifhif> hello
dbgster has joined #ruby
hiefhaifhif has quit [Client Quit]
perryh is now known as perry
ePirat- has joined #ruby
SirFunk has quit [Read error: Operation timed out]
fbernier has joined #ruby
Nisstyre has joined #ruby
UdontKnow has quit [Read error: Operation timed out]
adamkittelson has joined #ruby
UdontKnow has joined #ruby
<Squee-D> SeanLazer turs out the answer to my question was assert_fail_assertion.
<Squee-D> assert_fail_assertion {assert_equal("A", "B")} # -> pass
JustinCampbell has quit [Remote host closed the connection]
Brandan has joined #ruby
wilmoore has joined #ruby
SirFunk has joined #ruby
v0n has joined #ruby
frishi has quit [Quit: Leaving...]
jhunter has quit [Ping timeout: 248 seconds]
jhunter has joined #ruby
ben_m` has quit [Quit: Leaving]
mlue has quit [Remote host closed the connection]
schickung has quit [Quit: schickung]
fbernier_ has joined #ruby
advorak has joined #ruby
TheFuzzball has quit [Ping timeout: 252 seconds]
monkegjinni has quit [Remote host closed the connection]
TheFuzzball has joined #ruby
<williamcotton> Squee-D: you're nickname kind of looks like a dick
<williamcotton> er, your
<williamcotton> S====D
<williamcotton> haha
<Squee-D> if that's what you see, i figure i have less of a problem than you.
* williamcotton has all the problems
xclite_ has joined #ruby
wpaulson has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
tyman has quit [Ping timeout: 246 seconds]
xclite_ has quit [Quit: Leaving]
<SeanLazer> Squee-D: that's ugly! are you using test::unit for a reason?
<SeanLazer> Squee-D: also your class instance variable thing totally worked, thanks. i had to switch to BlankSlate from BasicObject though
<Squee-D> thats not ugly i am testing an extension to the assertions
<Squee-D> much like you would ad a matcher to rspec
<Squee-D> so i need to test the assertion itself
xclite__ has joined #ruby
<SeanLazer> i think i probably misunderstood your overarching goal
maxmmurphy has quit [Quit: maxmmurphy]
xclite__ has quit [Client Quit]
<Squee-D> if i needed a not_equal_set i would add that too, but i would also need to test that it fails, if you follow
xclite_ has joined #ruby
<SeanLazer> Squee-D: ahhh
<Squee-D> i use test unit because it's straightforward and clear :D
<Squee-D> and its included iin most things.
<SeanLazer> Squee-D: i didn't realize that you were writing a custom assertion there
<Squee-D> i didnt find rspec or cucumber added any value for me
<Squee-D> yah
<SeanLazer> that changes everything
Ontolog has quit [Remote host closed the connection]
<SeanLazer> i think i just like rspec because that was what was popular when i learned testing
<Squee-D> same here, but i learned to dumb it down
Ontolog has joined #ruby
<Squee-D> its not something that really calls for an extensive dsl (in my mind)
Ontolog has quit [Read error: Connection reset by peer]
<Squee-D> but i do believe in custom matchers.
stefanp has joined #ruby
stefanp has quit [Changing host]
stefanp has joined #ruby
Ontolog has joined #ruby
<Squee-D> and i've been meaning to move my embedded 'set' matchers to a gem. so thats what I'm doing now
dhruvasagar has quit [Ping timeout: 248 seconds]
bnewton has joined #ruby
williamcotton has quit [Quit: williamcotton]
iori has quit [Remote host closed the connection]
<SeanLazer> makes sense
stefanp_ has quit [Ping timeout: 265 seconds]
iori has joined #ruby
thomascioppettin has joined #ruby
mockra has joined #ruby
Banistergalaxy has joined #ruby
<bambanx> exit any framework for programming on ruby using html5 css too?
tamaska has quit [Ping timeout: 240 seconds]
<bambanx> this is find http://bowlineapp.com/ but dont have much docs
nari_ has quit [Ping timeout: 245 seconds]
rippa has joined #ruby
Enekoos has quit [Remote host closed the connection]
mockra has quit [Remote host closed the connection]
cakehero has joined #ruby
Boohbah has quit [Ping timeout: 276 seconds]
Boohbah has joined #ruby
MarcWebe1 has joined #ruby
MarcWeber has quit [Read error: Operation timed out]
ipoval has joined #ruby
kevinbond has joined #ruby
thomascioppettin has left #ruby [#ruby]
techhelp2 has joined #ruby
rafacv has quit [Quit: Leaving.]
ciopte7 has joined #ruby
csprite has quit [Quit: ChatZilla 0.9.88.2 [Firefox 13.0.1/20120614114901]]
wpaulson has joined #ruby
maxmmurphy has joined #ruby
rippa has quit [Ping timeout: 252 seconds]
<cakehero> anyone know if there is a ppa for lucid and 1.9.3?
techhelp has quit [Ping timeout: 265 seconds]
ibash has joined #ruby
nari_ has joined #ruby
dagnachewa has quit [Remote host closed the connection]
Spooner has quit [Quit: Miranda IM! Smaller, Faster, Easier. http://miranda-im.org]
seanstickle has joined #ruby
baroquebobcat has joined #ruby
univers has joined #ruby
univers has quit [Client Quit]
hynkle has quit [Quit: Computer has gone to sleep.]
nilg has joined #ruby
ElderFain has quit [Read error: Connection reset by peer]
techhelp has joined #ruby
ElderFain has joined #ruby
aantix has joined #ruby
ElderFain has quit [Client Quit]
andreime has joined #ruby
techhelp2 has quit [Ping timeout: 244 seconds]
aantix has quit [Client Quit]
rjsamson has quit [Remote host closed the connection]
ananthakumaran has joined #ruby
gilead has joined #ruby
Ontolog has quit [Remote host closed the connection]
bambanx has quit [Ping timeout: 255 seconds]
Ontolog has joined #ruby
Ontolog has quit [Read error: Connection reset by peer]
v0n has quit [Quit: Quitte]
<jd__> can i call a method from another method inside a class?
<banisterfiend> jd__: Yeah
thecreators has quit [Remote host closed the connection]
<jd__> that's what i thought
<jd__> do i have to use self.method?
ananthakumaran has quit [Quit: Leaving.]
<fowl> self is implied
centipedefarmer has quit [Quit: This computer has gone to sleep]
TheFuzzball has quit [Ping timeout: 250 seconds]
thecreators has joined #ruby
wpaulson has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
fbernier has quit [Ping timeout: 246 seconds]
fbernier_ has quit [Ping timeout: 264 seconds]
centipedefarmer has joined #ruby
Haribhau has joined #ruby
mockra has joined #ruby
davidokner has quit [Read error: Operation timed out]
yannis has joined #ruby
mikepack has joined #ruby
erichmenge has quit [Quit: erichmenge]
Yarou_ has quit [Quit: Leaving]
centipedefarmer has quit [Quit: This computer has gone to sleep]
TheFuzzball has joined #ruby
hunglin has quit [Quit: Leaving.]
tyman has joined #ruby
mockra has quit [Remote host closed the connection]
aantix has joined #ruby
tyman has quit [Client Quit]
Progster has quit [Ping timeout: 260 seconds]
ghanima has joined #ruby
minijupe has joined #ruby
davidokner has joined #ruby
luxurymode has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
CreativeEmbassy has quit [Quit: Computer has gone to sleep.]
cakehero has quit [Quit: Computer has gone to sleep.]
dylank_ has joined #ruby
maahes has quit [*.net *.split]
dymk has quit [*.net *.split]
kaneda has quit [*.net *.split]
mfridh has quit [*.net *.split]
jmcphers has quit [*.net *.split]
musl has quit [*.net *.split]
tama has quit [*.net *.split]
Axsuul has quit [*.net *.split]
ged has quit [*.net *.split]
nahhh has quit [*.net *.split]
ibash has quit [Quit: ibash]
<cuppsy> I'm trying to search for a word within a string, but I keep getting: "undefined method `indexOf' for #<String:0x4acf770>". I'm still new... is there something obvious I'm missing here? Shouldn't I be able to do indexOf on a string?
<davidcelis> ruby doesn't use camel case
flip_digits has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
AlbireoX`Laptop has quit [Remote host closed the connection]
<davidcelis> and the method is :index, not :index_of
CreativeEmbassy has joined #ruby
<cuppsy> Ah... duh. Sorry. I'm apparently getting sleepy.
<cuppsy> Thank you, guys. Sorry for that.
<davidcelis> i am but one man
<seanstickle> You've been eating too much Java again!
TheFuzzball has quit [Ping timeout: 244 seconds]
TheFuzzball has joined #ruby
mfridh_ has joined #ruby
maahes has joined #ruby
kaneda has joined #ruby
ged has joined #ruby
jmcphers has joined #ruby
musl has joined #ruby
tama has joined #ruby
Axsuul has joined #ruby
nahhh has joined #ruby
xnm has joined #ruby
iamjarvo has joined #ruby
skinny_much has joined #ruby
cearls has joined #ruby
khakimov has joined #ruby
maahes1 has joined #ruby
skinny_much has quit [*.net *.split]
ged has quit [*.net *.split]
mfridh_ has quit [*.net *.split]
maahes has quit [*.net *.split]
kaneda has quit [*.net *.split]
jmcphers has quit [*.net *.split]
musl has quit [*.net *.split]
Axsuul has quit [*.net *.split]
tama has quit [*.net *.split]
nahhh has quit [*.net *.split]
abstrusenick has joined #ruby
maahes1 is now known as maahes
mikepack has quit [Remote host closed the connection]
venkatk_ has joined #ruby
moted has quit [Ping timeout: 240 seconds]
ryanf_ has joined #ruby
ryanf has quit [Quit: leaving]
ryanf_ is now known as ryanf
Axsuul has joined #ruby
moted has joined #ruby
jmcphers has joined #ruby
ged has joined #ruby
tama has joined #ruby
kaneda has joined #ruby
nahhh has joined #ruby
AOC has quit [Ping timeout: 264 seconds]
igotnolegs has joined #ruby
musl has joined #ruby
ciopte7 has quit [Quit: ciopte7]
seanstickle has quit [Quit: Nihil sub sole novum]
macmartine has quit [Quit: macmartine]
yugui_zzz is now known as yugui
macmartine has joined #ruby
maahes has quit [Read error: Connection reset by peer]
mfridh has joined #ruby
maahes has joined #ruby
wallerdev has joined #ruby
musl has quit [Read error: Connection reset by peer]
mikeycgto has quit [Remote host closed the connection]
musl has joined #ruby
mfridh has quit [Ping timeout: 255 seconds]
CheeToS has joined #ruby
mockra has joined #ruby
xclite_ has quit [Remote host closed the connection]
CreativeEmbassy has quit [Quit: Computer has gone to sleep.]
dbgster has quit [Quit: dbgster]
mlue has joined #ruby
mlue has quit [Changing host]
mlue has joined #ruby
iamjarvo has quit [Quit: Leaving.]
Peregrinu5 has joined #ruby
mockra has quit [Remote host closed the connection]
<Peregrinu5> Can anyone assist with a noob questions relating to string compares? wondering what I am doing wrong in this one liner: print wmioutfile.read.to_s if ["string1","4432","432432","dsaddf"].include? wmioutfile.read
<Mon_Ouie> You're calling #read twice, but read moves the file cursor
<Mon_Ouie> So the second read is empty
<Peregrinu5> ah!
<Peregrinu5> start with the if :D
<Peregrinu5> thanks for that
ryanf_ has joined #ruby
bnewton has quit [Quit: bnewton]
thecreators has quit [Quit: thecreators]
ryanf_ has quit [Client Quit]
TheFuzzball has quit [Ping timeout: 246 seconds]
ryanf has quit [Ping timeout: 265 seconds]
mockra has joined #ruby
TheFuzzball has joined #ruby
jeff_sebring has quit [Quit: Leaving]
mfridh has joined #ruby
td123 has joined #ruby
williamcotton has joined #ruby
TheFuzzball has quit [Ping timeout: 246 seconds]
ananthakumaran has joined #ruby
cantelope has left #ruby [#ruby]
jeff_sebring has joined #ruby
TheFuzzball has joined #ruby
<bnagy> also you don't need the to_s
td123 has quit [Quit: WeeChat 0.3.8]
Hanmac1 is now known as Hanmac
jeff_sebring has quit [Remote host closed the connection]
<Peregrinu5> mm
<Peregrinu5> getting it to print is not fun because of that .read issue
<Peregrinu5> playing back the contents of a file inside of an until blah.eof?
TheFuzzball has quit [Ping timeout: 255 seconds]
<Mon_Ouie> Just store the result in a variable
andrewhl has quit [Remote host closed the connection]
<Peregrinu5> this is true.. :D
minijupe has quit [Quit: minijupe]
umttumt has joined #ruby
advorak has quit [Quit: This computer has gone to sleep]
L-----D has joined #ruby
schovi has joined #ruby
coderhut has joined #ruby
andreime has quit [Ping timeout: 252 seconds]
TheFuzzball has joined #ruby
ryanf has joined #ruby
<Hanmac> if ["string1","4432","432432","dsaddf"].include?(s = wmioutfile.read); print s;end
<davidcelis> %w(string1 4432 432432 dsaddf)
<davidcelis> moer liek
* Hanmac does not like the %*( ... ) stuff
<icy`> %w ftw
<davidcelis> that makes one of us
<otters> probably the only ruby user in the business
TPFC-SYSTEM has joined #ruby
<Hanmac> PS: in this chase %W is better then %w because all strings does not have any magic
yugui is now known as yugui_zzz
<icy`> :o
<icy`> like #{var} stuff?
hemanth has joined #ruby
<otters> yeah
schovi has quit [Remote host closed the connection]
<icy`> noted; will use %W from now on
aantix has quit [Quit: aantix]
yxhuvud has joined #ruby
RainbowDashh has joined #ruby
ciopte7 has joined #ruby
blumbri has quit [Remote host closed the connection]
blumbri has joined #ruby
hemanth has quit [Read error: Connection reset by peer]
hemanth has joined #ruby
ebanoid has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
jwmann has quit [Read error: Connection reset by peer]
austinbv1 has joined #ruby
jwmann has joined #ruby
tonini has joined #ruby
jwmann has quit [Max SendQ exceeded]
xnm has quit [Read error: Connection reset by peer]
savage- has joined #ruby
krusty_ar has quit [Ping timeout: 250 seconds]
timonv has joined #ruby
mockra_ has joined #ruby
RainbowDashh is now known as in
<Peregrinu5> perhaps i missed something around the %W aspect
<Peregrinu5> no errors but nothing prints. the contents of the file are fine though
mockra has quit [Ping timeout: 250 seconds]
<bnagy> there's no point having until eof? if you're going to read the whole file in one go
Sheehan has joined #ruby
<bnagy> why not just do fh.each_line.any? {|l| ... ?
<bnagy> also, do you want to see any lines that contain any of those strings, or are the strings supposed to be the entire line?
<Peregrinu5> any line that contains that string
in has quit [Excess Flood]
beneggett has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<bnagy> and you want to print it, or just match it?
mayankkohaley has quit [Ping timeout: 245 seconds]
<Peregrinu5> print that line
RainbowDashh has joined #ruby
<Peregrinu5> i clearly misunderstood .read
mayankkohaley has joined #ruby
<bnagy> should be something like fh.each_line {|l| print l if magic_stuff.any? {|str| l.include str} }
eywu has joined #ruby
<Peregrinu5> what is normally the purpose of until file.eof?
<bnagy> also, I'd feel happier if I knew for sure you were properly closing your file handle :) Normally we'd use the block form
<bnagy> like File.open( 'wmifilename', 'rb' ) {|fh| ...(as above) }
<bnagy> you might use it for reading fixed length records, etc?
<bnagy> but for line based stuff there are much better ways
<Peregrinu5> each_line certainly looks for more appropriate
<bnagy> all the file cursor stuff is lowlevel posixy style
<bnagy> oh that shold be l.include? str, typo sorry
prometheus has quit [Ping timeout: 246 seconds]
<bnagy> btw, are you actually using WMI?
<bnagy> cause there's a gem for that, you can use it directly from ruby
eywu has quit [Ping timeout: 246 seconds]
<Peregrinu5> i am, though i ended up writing system calls to dropping the results into a file .. woops :D
<Peregrinu5> day 2 ruby...
<bnagy> ok, if you're doing windows stuff, dberger has a really comprehensive selection of gems
AlbireoX`Laptop has joined #ruby
<Peregrinu5> thanks, I think I need to read up further on all of the above before pushing on too much further :)
_Bairn has quit [Quit: _Bairn]
macmartine has quit [Quit: macmartine]
jd__ has quit [Ping timeout: 246 seconds]
tomku has quit [Ping timeout: 246 seconds]
xubuntu5 has quit [Ping timeout: 264 seconds]
tomku has joined #ruby
nirakara has joined #ruby
djdb has joined #ruby
naz has joined #ruby
Sgeo has joined #ruby
Sgeo has left #ruby [#ruby]
fivetwentysix has joined #ruby
RainbowDashh has quit [Quit: SLEEP MODE. I should stop shutting my MBP's lid less and get a QUIT message rotator.]
jeff_sebring has joined #ruby
Targen has quit [Ping timeout: 252 seconds]
Sheehan has quit [Quit: Sheehan]
dhruvasagar has joined #ruby
brianpWins has joined #ruby
timonv has quit [Remote host closed the connection]
tomku has quit [Ping timeout: 264 seconds]
savage- has quit [Remote host closed the connection]
perry is now known as perryh_away
<nirakara> is there an xpath 1.0 equivalent for the contains function available in xpath 2.0
eurbach has joined #ruby
vectorshelve has joined #ruby
<vectorshelve> getting this error when I run rake cucumber -> http://pastie.org/4164080
<vectorshelve> hemanth: hai bhai
<hemanth> vectorshelve, hey
umttumt has quit [Remote host closed the connection]
codezombie has joined #ruby
tomku has joined #ruby
RainbowDashh has joined #ruby
skinny_much has joined #ruby
eurbach is now known as eu|afk
fivetwentysix has left #ruby [#ruby]
igotnolegs has quit [Quit: Computer has gone to sleep.]
umttumt has joined #ruby
wallerdev has quit [Quit: wallerdev]
tomku has quit [Ping timeout: 244 seconds]
shadoi has quit [Quit: Leaving.]
shadoi has joined #ruby
maesbn has joined #ruby
coderhut has quit [Ping timeout: 245 seconds]
jprovazn_away is now known as jprovazn
dhruvasagar has quit [Ping timeout: 240 seconds]
nopolitica has joined #ruby
dhruvasagar has joined #ruby
tomku has joined #ruby
fantazo has quit [Remote host closed the connection]
shadoi has quit [Ping timeout: 252 seconds]
dnyy has joined #ruby
dnyy has quit [Remote host closed the connection]
digitalcakestudi has quit [Ping timeout: 244 seconds]
RainbowDashh has quit [Quit: SLEEP MODE. I should stop shutting my MBP's lid less and get a QUIT message rotator.]
mohits has joined #ruby
mohits has quit [Changing host]
mohits has joined #ruby
bradhe has joined #ruby
cearls has quit [Quit: cearls]
naz has quit [Ping timeout: 248 seconds]
burgestrand has quit [Quit: Leaving.]
AOC has joined #ruby
ABK has joined #ruby
qwerxy has joined #ruby
gtuckerkellogg has quit [Quit: Computer has gone to sleep.]
eu|afk is now known as eurbach
ipoval has quit [Quit: ipoval]
coderhut has joined #ruby
bosphorus has joined #ruby
gtuckerkellogg has joined #ruby
cirwin has quit [Ping timeout: 246 seconds]
khakimov has quit [Quit: Computer has gone to sleep.]
<aces23up> how do i add all subdirectories recusively from a certain root directory to the load path?
Morkel has joined #ruby
<bnagy> that sounds very much like the questikon of someone Doing It Wrong
arkiver has joined #ruby
<bnagy> but you could look at Dir['./**'].select {|fn| File.directory? fn} or something
<bnagy> ** is the magic recursive glob
jimeh has joined #ruby
<aces23up> bnagy cool thanks.
RainbowDashh has joined #ruby
austinbv1 has quit [Ping timeout: 244 seconds]
zommi has joined #ruby
adamkittelson has quit [Remote host closed the connection]
hoelzro|away is now known as hoelzro
gtuckerkellogg has quit [Ping timeout: 264 seconds]
wallerdev has joined #ruby
araujo has quit [Quit: Leaving]
nadirvardar has joined #ruby
jimeh has quit [Read error: Operation timed out]
Renich has joined #ruby
<aces23up> bnagy how do i get the subdirectories of the subdirectories?
Nick_ has joined #ruby
<davidcelis> **/**
Eldariof-ru has joined #ruby
<Spaceghostc2c> The recursive flag or the almighty glob.
ananthakumaran has quit [Ping timeout: 244 seconds]
<bnagy> uh it's not **/* ?
tomku has quit [Ping timeout: 246 seconds]
<bnagy> seems they both work, but **/** freaks me out
<Spaceghostc2c> bnagy: The subdirectories of subdirectories is **/**
Renich has left #ruby [#ruby]
<bnagy> well Dir['**/**'] == Dir['**/*'] for me
hemanth has quit [Read error: Connection reset by peer]
maxmmurphy has quit [Quit: maxmmurphy]
hemanth has joined #ruby
ph^ has joined #ruby
tomku has joined #ruby
bosphorus has quit [Remote host closed the connection]
sepp2k has joined #ruby
apeiros_ has joined #ruby
lolmaus has joined #ruby
jonatha__ has joined #ruby
jonathanwallace has quit [Ping timeout: 265 seconds]
gtuckerkellogg has joined #ruby
adeponte has quit [Ping timeout: 245 seconds]
ananthakumaran has joined #ruby
samuel02 has joined #ruby
AOC_ has joined #ruby
andrewjf has quit [Ping timeout: 245 seconds]
AOC_ has quit [Remote host closed the connection]
Nick_ has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
AOC has quit [Ping timeout: 245 seconds]
nai has joined #ruby
AlbireoX`Laptop has quit [Remote host closed the connection]
nadirvardar has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
fra000 has joined #ruby
lessless has joined #ruby
QaDeS has joined #ruby
mockra_ has quit [Remote host closed the connection]
andrewjf has joined #ruby
mohits has quit [Quit: Leaving]
jeff_sebring has quit [Quit: Leaving]
Rochefort has joined #ruby
Squee-D has quit [Quit: The computer fell asleep]
nai has quit [Read error: Connection reset by peer]
nai has joined #ruby
yonggu_ has joined #ruby
williamcotton has quit [Quit: williamcotton]
regularfry has quit [Quit: Leaving]
yonggu has quit [Ping timeout: 246 seconds]
lessless has left #ruby ["system needs to be rebooted"]
sspiff has joined #ruby
sspiff has quit [Changing host]
sspiff has joined #ruby
bradhe has quit [Remote host closed the connection]
wallerdev has quit [Quit: wallerdev]
schovi has joined #ruby
nirakara has quit [Ping timeout: 244 seconds]
ryanf has quit [Quit: leaving]
berserkr has joined #ruby
Squee-D has joined #ruby
sspiff has quit [Ping timeout: 246 seconds]
Gneiss has joined #ruby
abstrusenick has quit [Quit: abstrusenick]
kiela has quit [Ping timeout: 246 seconds]
jeekl has quit [Ping timeout: 245 seconds]
<Gneiss> Hello?
kiela has joined #ruby
<apeiros_> hi?
<Gneiss> how are you? :P
<apeiros_> horrible
<apeiros_> learning pl/sql
<apeiros_> &u?
jeekl has joined #ruby
<Gneiss> Hahaha
<Gneiss> I'm alright
<Gneiss> Making some macaroni and cheese :)
<Gneiss> But I cut my finger open on my razor a couple minutes ago :S
araujo has joined #ruby
qwerxy has quit [Quit: offski]
timonv has joined #ruby
techhelp has quit [Quit: This computer has gone to sleep]
L-----D has quit [Quit: Leaving]
bier__ has quit [Ping timeout: 248 seconds]
Gneiss has quit [Quit: Gneiss]
bier__ has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
cezar has joined #ruby
cezar has quit [Client Quit]
dekroning has joined #ruby
blacktulip has joined #ruby
keymone has joined #ruby
mklappstuhl has quit [Ping timeout: 246 seconds]
dankest has joined #ruby
coderhut has quit [Quit: Page closed]
jimeh has joined #ruby
sys3nt3r has joined #ruby
sys3nt3r has left #ruby [#ruby]
prtksxna has joined #ruby
Tricks_ has quit [Ping timeout: 240 seconds]
robotmay has joined #ruby
Karmaon has quit [Ping timeout: 260 seconds]
prtksxna has quit [Remote host closed the connection]
gtuckerkellogg has quit [Quit: Computer has gone to sleep.]
maesbn has quit [Read error: Connection reset by peer]
maesbn has joined #ruby
AlbireoX`Laptop has joined #ruby
BiHi has joined #ruby
ephemerian has joined #ruby
workmad3 has joined #ruby
sspiff has joined #ruby
ankakusu has joined #ruby
arkiver has quit [Ping timeout: 255 seconds]
werdnativ has quit [Quit: werdnativ]
akem has joined #ruby
akem has quit [Changing host]
akem has joined #ruby
nopolitica has quit [Quit: leaving]
prtksxna has joined #ruby
nopolitica has joined #ruby
IPGlider has joined #ruby
<dekroning> anyone know an opensource project that uses 'minitest/spec' ?
AlbireoX`Laptop has quit [Read error: Connection reset by peer]
samuel02 has quit [Remote host closed the connection]
vlad_starkov has joined #ruby
davidw has joined #ruby
tomku has quit [Ping timeout: 245 seconds]
bosphorus has joined #ruby
RainbowDashh has quit [Excess Flood]
jameshyde has quit [Quit: Leaving]
RainbowDashh has joined #ruby
arkiver has joined #ruby
adeponte has joined #ruby
ukd1 has quit [Ping timeout: 246 seconds]
nirakara has joined #ruby
monkegjinni has joined #ruby
RainbowDashh has quit [Excess Flood]
RainbowDashh has joined #ruby
nirakara has quit [Client Quit]
ukd1 has joined #ruby
keymone has quit [Quit: keymone]
durre has quit [Quit: durre]
mohits has joined #ruby
<Tasser> dekroning, got a small one
<dekroning> Tasser: that would be great ;)
<Tasser> dekroning, http://sprunge.us/gCeA
<dekroning> smaller means, that I probably have more change to understand it
<Tasser> dekroning, does some table testing
<Tasser> because imo testing just one case sucks
schovi has quit [Remote host closed the connection]
<dekroning> right I understand what you mean indeed
schovi has joined #ruby
arkiver has quit [Ping timeout: 246 seconds]
TheHunter_1039 has quit [Quit: TheHunter_1039]
qwerxy has joined #ruby
Squee-D has quit []
arturaz has joined #ruby
<dekroning> Tasser: so in order to check if two strings are equal you use the .must_equal , I was looking for the rspec way like .should == "foo"
ciopte7 has quit [Quit: ciopte7]
cclplatinum has joined #ruby
ukd1 has quit [Ping timeout: 245 seconds]
fivetwentysix has joined #ruby
Occult has quit [Read error: Connection reset by peer]
Occult has joined #ruby
umttumt has quit [Remote host closed the connection]
Criztian has joined #ruby
Brandan has quit []
AndChat| has joined #ruby
<Tasser> dekroning, indeed
cjs has quit [Remote host closed the connection]
nai has quit [Ping timeout: 255 seconds]
flype has joined #ruby
Banistergalaxy has quit [Ping timeout: 246 seconds]
<dekroning> Tasser: also do you use mocking with minitest?
<dekroning> Tasser: i'm also wondering how to use stubbing the Minitest way
hemanth has quit [Read error: Connection reset by peer]
hemanth has joined #ruby
Dr4g|Away is now known as Dr4g
workmad3 has quit [Ping timeout: 246 seconds]
workmad3 has joined #ruby
skinny_much has quit [Ping timeout: 250 seconds]
akem has quit [Ping timeout: 245 seconds]
IPGlider has quit []
Progster has joined #ruby
CheeToS has quit [Ping timeout: 246 seconds]
akem has joined #ruby
Haribhau has quit [Quit: Page closed]
<Tasser> dekroning, nah
tonini has quit [Remote host closed the connection]
akem has quit [Read error: Operation timed out]
Rochefort has quit [Remote host closed the connection]
wilmoore has quit [Remote host closed the connection]
Foxandxss has joined #ruby
<hemanth> what are the specific scenarios that you can recall iterating an array with index?
fasta has joined #ruby
<banisterfiend> hemanth: that's quite a personal question
<banisterfiend> hemanth: but i use it when iterating through lines in a string and keeping track of line number
<fasta> How do I install a library as non-root?
mklappstuhl has joined #ruby
<fasta> I.e. a 'gem'.
<hemanth> banisterfiend, oh ok :) I use it in hashes with array in them; say json
samantha113101 has quit [Remote host closed the connection]
arkiver has joined #ruby
sam113101 has joined #ruby
Sonne has joined #ruby
<Sonne> greetings!
<Sonne> when using the post method from Net:HTTP, i get a HTTPOK object in return instead of an HTTPResponse object
<Sonne> is this something that happened to anyone else?
naquad has quit [Excess Flood]
<Sonne> as in... f = Net::HTTP.new(url); f.post('/foo',payload)
<Sonne> the same post returns data if called by wget
arkiver has quit [Ping timeout: 245 seconds]
naquad has joined #ruby
Xethron has quit [Ping timeout: 244 seconds]
<fasta> gem install watir-webdriver; irb require 'watir-webdriver' says that it cannot be loaded. Why not?
naquad has quit [Max SendQ exceeded]
Xethron has joined #ruby
<banisterfiend> fasta: maybe a bundler issue
<fasta> banisterfiend: I am not even using bundler.
<banisterfiend> fasta: are you using rvm?
<fasta> banisterfiend: I don't think so.
<banisterfiend> fasta: "dont think so" <---- huh?
<fasta> banisterfiend: which ruby => /usr/bin/ruby
<banisterfiend> either you are or you aren't
<banisterfiend> oh ok
<banisterfiend> fasta: do you have pry installed?
<fasta> banisterfiend: never heard of it.
<Hanmac> which gem ?
rushed has quit [Quit: rushed]
<fasta> banisterfiend: how do I check?
<banisterfiend> fasta: Hanmac has come to help u
<fasta> Hanmac: watir-webdriver
<fasta> Hanmac: installation worked, but then it isn't found.
<Hanmac> no i mean `which gem`
<fasta> Hanmac: /usr/bin/gem
Xethron_ has joined #ruby
naquad has joined #ruby
<Hanmac> `gem which watir-webdriver`
niklasb has joined #ruby
iocor has joined #ruby
<fasta> I already fixed it.
<fasta> You first need to require something else.
<fasta> rubygems
TaTonka has left #ruby [#ruby]
<fasta> Kind of retarded, imho.
<banisterfiend> fasta: you never said you were on ruby 1.8
<Hanmac> no it is not, your ruby is only to old
<banisterfiend> fasta: that's only a requirement of ruby 1.8
<fasta> banisterfiend: you never asked :)
dhruvasagar has quit [Ping timeout: 244 seconds]
<fasta> Ok, so I want 1.9 then?
<banisterfiend> fasta: that's information that should be volunteered, as the standard ruby is now 1.9
seitensei has quit [Remote host closed the connection]
<banisterfiend> fasta: and has been for > 2 years :)
<fasta> banisterfiend: apt-get install ruby gets me 1.8 on Ubuntu.
<Paradox> holy crap…there are already jellybean builds of android out in the wild
<fasta> banisterfiend: which was released only a few months ago.
<Paradox> i'll go away now
<Paradox> im just estatic
dhruvasagar has joined #ruby
<banisterfiend> fasta: yes, well, before you install ruby you should research the best way to install it...hint: apt-get install ruby is the worst way to install it ;)
<banisterfiend> fasta: go here: rvm.io
<Hanmac> fasta apt-get install ruby1.9-full
<fasta> Isn't there a command to just get the latest ruby?
<fasta> I am kind of allergic to specifying version numbers.
arturaz has quit [Remote host closed the connection]
arturaz has joined #ruby
<Hanmac> fasta, in the next ubuntu the ruby package is changed to link to ruby1.9
ramblex has joined #ruby
<banisterfiend> Hanmac: why are you even suggesting he should be using ubuntu packages? tell him to use rvm/rbenv
<banisterfiend> fasta: use rvm or rbenv, i gave u a link to rvm above: rvm.io
<bnagy> rbenv ftw
<banisterfiend> bnagy: have you heard of rbfu?
<banisterfiend> it's meant to be even more lightweight than rbenv
<bnagy> rbenv is fine
RainbowDashh has quit [Quit: SLEEP MODE. I should stop shutting my MBP's lid less and get a QUIT message rotator.]
nirakara has joined #ruby
nirakara has quit [Max SendQ exceeded]
jitesh_shetty has quit [Remote host closed the connection]
nirakara has joined #ruby
cantonic has joined #ruby
nirakara has quit [Max SendQ exceeded]
nirakara has joined #ruby
schickung has joined #ruby
schickung has quit [Client Quit]
RainbowDashh has joined #ruby
rdg has joined #ruby
nirakara has quit [Max SendQ exceeded]
nirakara has joined #ruby
Codif has joined #ruby
nirakara has quit [Max SendQ exceeded]
Codif has quit [Remote host closed the connection]
nirakara has joined #ruby
nirakara has quit [Max SendQ exceeded]
dekroning has quit [Ping timeout: 250 seconds]
iocor has quit [Quit: Computer has gone to sleep.]
schaerli has joined #ruby
fermion has joined #ruby
cclplatinum has quit [Quit: Leaving]
ramblex has quit [Quit: ramblex]
hemanth has quit [Read error: Connection reset by peer]
hemanth has joined #ruby
withnale has quit [Excess Flood]
withnale has joined #ruby
dekroning has joined #ruby
lkba has quit [Ping timeout: 246 seconds]
jeff_sebring has joined #ruby
tomku has joined #ruby
BiHi has quit [Quit: Computer has gone to sleep]
rdg has quit [Quit: ttfn]
RainbowDashh has quit [Quit: SLEEP MODE. I should stop shutting my MBP's lid less and get a QUIT message rotator.]
Vendethiel has joined #ruby
scrr has joined #ruby
tvw has joined #ruby
liluo_ has quit [Remote host closed the connection]
rudi has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
cantonic has quit [Quit: cantonic]
Spooner has joined #ruby
kill-9_ has joined #ruby
thone has quit [Ping timeout: 240 seconds]
iocor has joined #ruby
thone has joined #ruby
vlad_starkov has joined #ruby
RainbowDashh has joined #ruby
iocor has quit [Client Quit]
RainbowDashh has quit [Client Quit]
jcromartie has joined #ruby
akem has joined #ruby
akem has quit [Changing host]
akem has joined #ruby
fermion has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
fra000 has quit [Quit: Leaving]
iocor has joined #ruby
iocor has quit [Client Quit]
yannis has quit [Quit: yannis]
flype has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
fermion has joined #ruby
burgestrand has joined #ruby
yannis has joined #ruby
CreativeEmbassy has joined #ruby
ePirat_ has joined #ruby
arkiver has joined #ruby
ePirat_ has quit [Remote host closed the connection]
yannis has quit [Client Quit]
rkk has joined #ruby
tomask has joined #ruby
tomask has quit [Changing host]
tomask has joined #ruby
frishi has joined #ruby
rkk has quit [Quit: Leaving]
rkk has joined #ruby
ramblex has joined #ruby
iocor has joined #ruby
ramblex has quit [Client Quit]
prtksxna has quit [Remote host closed the connection]
ramblex has joined #ruby
rkk has quit [Client Quit]
ABK has quit [Ping timeout: 250 seconds]
iocor has quit [Client Quit]
CreativeEmbassy has quit [Quit: Computer has gone to sleep.]
schickung has joined #ruby
gilead has quit [Quit: This computer has gone to sleep]
jcromartie has quit [Quit: jcromartie]
kvirani has joined #ruby
Progster has quit [Ping timeout: 245 seconds]
ij has joined #ruby
nanderoo has joined #ruby
hynkle has joined #ruby
lkba has joined #ruby
iamjarvo has joined #ruby
kill-9_ has left #ruby [#ruby]
lxsameer has joined #ruby
lxsameer has quit [Changing host]
lxsameer has joined #ruby
arkiver has quit [Quit: Leaving]
jstew has joined #ruby
mklappstuhl has quit [Read error: Operation timed out]
tatsuya_o has joined #ruby
<ij> Is method swapping "A bad thing"? It looks
<ij> dirty
<hoelzro> it sounds dirty.
<ij> By method swapping I mean alias :same, :same_; def same; different code, which uses same_; end;
<hoelzro> oh, that looks like overriding to me
<ij> I heard it was called m. swapping here once.
Progster has joined #ruby
<workmad3> ij: it's called method chaining
<ij> chaining?
<workmad3> ij: yeah... you're chaining versions of 'same'
TheHunter_1039 has joined #ruby
<ij> hmm, I think chaining is lots of .calls... Like Foo.this.that.giant.trucks.and.the.right.return.in.the.end
<Tasser> alias chaning iirc
<workmad3> ij: you frequently alias the existing version to 'same_without_feature' and define your override
<workmad3> ij: which gives you a way to add new links to the chain without having to worry about overriding an existing link
<workmad3> Tasser: oh yeah, alias method chain, that's the one :)
hynkle has quit [Quit: Computer has gone to sleep.]
nopolitica has quit [Read error: Connection reset by peer]
<workmad3> ij: as for suitability... I believe it used to be used a lot in rails, and they since decided that yes, it's quite nasty, and instead they build up using modules and 'super' calls now
<ij> Give for an example of Module and super use.
<workmad3> ij: 'super if defined?(super)'
<ij> In the original method/
BiHi has joined #ruby
<workmad3> ij: that basically calls the method you just overrode from a module or superclass, if it existed
<workmad3> ij: in any method you want to compose
BiHi has quit [Client Quit]
<ij> Show the full example, I still don't get it.
fbernier_ has joined #ruby
BiHi has joined #ruby
* apeiros_ still thinks 'alias method chain' to be a horrible term :)
geekbri has joined #ruby
wvms has quit [Quit: wvms]
<workmad3> apeiros_: a horrible term for a horrible monkey patch? :)
imami|afk is now known as banseljaj
<ij> workmad3: That sucks. You always have to write the super line. That's not much better IMO.
niklasb has quit [Quit: WeeChat 0.3.8]
<workmad3> ij: it makes the composition explicit
<workmad3> ij: rather than hidden in aliases and 'method_x_without_feature_y'
richo has joined #ruby
nari_ has quit [Ping timeout: 248 seconds]
* Hanmac try to avoid alias
<ij> True. Better, but still awful in my opinion.
<apeiros_> workmad3: true. the thing itself is already horrible
<apeiros_> but that's no excuse for giving it a horrible name too :)
<richo> Is there a way to stub in a new definition via a mocha mock? (Yes, I knwo this is a code smell. Totally committed at this point though)
<workmad3> apeiros_: sure it is... it puts people off :P
<apeiros_> that rails makes you having to use it is just another sad story
<apeiros_> it's funny how many anti-patterns I only and only ever had to use in rails
<workmad3> ij: it's just a method call
gilead has joined #ruby
b26 has joined #ruby
<Hanmac> i have a system, when i call function_a it calls automaticly feature_a_function_a, feature_b_function_a and feature_c_function_a
<workmad3> ij: with a guard to make sure the method exists... not awful... I won't say it isn't a little bit annoying, but it's hardly heinous :)
<apeiros_> Hanmac: me too. I think the only valid use-case for aliasing is semantical identity. e.g. if == and === do the same, then an alias is ok. but something like aliasing map to collect is not.
ryan0x2 has quit [Read error: Operation timed out]
<apeiros_> err, not semantical identity. semantically different methods with the same implementation
<ij> workmad3: I don't like code that annoys me. Also, I didn't found any super if defined in rails gem.
<workmad3> ij: and it makes it clear from the method that it's a method that intends to be composed ;)
<apeiros_> (eql?, ==, === have different semantics, but they may share implementation)
<workmad3> ij: yeah, that's because the rails gem itself is almost code-free
<workmad3> ij: it's a meta gem to pull in the dependencies, active-support, active-record, etc
<ij> Oh, right. Active*
hemanth has quit [Read error: Connection reset by peer]
hemanth has joined #ruby
<Hanmac> apeiros_ what do you think about tny feature_*_function_* system? (its only for understanding, in my system the methods are named differently)
<apeiros_> Hanmac: I don't follow
<apeiros_> is that a naming scheme?
venkatk_ has quit [Quit: Leaving]
<workmad3> Hanmac: I'd worry about ordering and return values
niklasb has joined #ruby
<Hanmac> no ... function_a is a virtual function that calls this functions "feature_a_function_a", "feature_b_function_a" and "feature_c_function_a" ... with that i dont need alias
larissa has joined #ruby
<workmad3> Hanmac: if I needed feature_b to be called before feature_a, how would I ensure that? what if I needed the return value of feature_c, but needed it to run before feature_b?
<Hanmac> workmad3 the ordering is alphanumeric (using sort) and the return value is an Array of the other return values
<workmad3> Hanmac: so it's purely a way of hiding a group of method calls inside a single call?
schaerli has quit [Remote host closed the connection]
<workmad3> Hanmac: I don't see the point :P
<Hanmac> yeah, then you could do: function_a(value).inject(:+)
mucker has joined #ruby
<workmad3> Hanmac: I'd just write an explicit function_a that calls feature_a, feature_b and feature_c
wallerdev has joined #ruby
wallerdev has quit [Client Quit]
<Hanmac> but then i want my script extandable? so i dont know how many features are later in the code?
fulmato has joined #ruby
<workmad3> Hanmac: so you add an extra call to the method
<workmad3> Hanmac: and when the method gets massive, you have it clear in your code that you need to sort it out
gtuckerkellogg has joined #ruby
bambanx has joined #ruby
<Hanmac> "so you add an extra call to the method", but for that i would need alias again
<workmad3> Hanmac: your way hides design complexity, making it harder to spot when you have classes that are doing too much
Morkel has quit [Quit: Morkel]
<workmad3> Hanmac: no... it's your code... you have the method code in front of you, and you add an extra call
<bambanx> hi
<bambanx> good morning
Gavilan has left #ruby [#ruby]
<Hanmac> workmad3 i designed it for rgss scripts so they could react with eachother (like A and B works parted, but could also work together)
<unixabg> I have been working on rmagick convert images to video with webrick and I working when I run as root. My issue now is when I try to
schickung has quit [Quit: schickung]
<workmad3> Hanmac: hmm... sounds like you actually wanted publisher-subscriber mechanism thet
<workmad3> *then
<unixabg> run as a regular user I get an error. Here is the code I am using http://paste.debian.net/176795/
fbernier_ has quit [Ping timeout: 264 seconds]
<workmad3> Hanmac: some event happens in class A, and class B has registered itself as interested in that event, so class A notifies it (using a known interface)
<Hanmac> i dont know, maybe yeah :P
<unixabg> delegate failed `"ffmpeg" -v -1 -mbd rd -trellis 2 -cmp 2 -subcmp 2 -g 300 -pass 1/2 -i "%M%%d.jpg" "%u.%m" 2> "%Z"' @ error/delegate.c/InvokeDelegate/1061
<unixabg> is the error. Any help with this would be greatly appreciated.
emmanuel__ has joined #ruby
<apeiros_> Hanmac: sry, work interrupted
<apeiros_> got an example?
<workmad3> Hanmac: it's also known as an event listener, or the observer pattern... lots of names for it :)
jxpx777|afk is now known as jxpx777
jcromartie has joined #ruby
jxpx777 has quit [Quit: Mac is sleeping…]
<workmad3> Hanmac: I'm just always wary of code that magically bundles stuff together and doesn't give me ways to ensure things like ordering :)
<workmad3> Hanmac: order is frequently quite important ;)
<workmad3> Hanmac: and having to then wart my names to fit a lexical sort... not nice
JustinCampbell has joined #ruby
sailias has joined #ruby
<banisterfiend> apeiros_: hey, do you use rvm?
<apeiros_> banisterfiend: yupp
<banisterfiend> apeiros_: how do u feel about the implied/automatic 'bundle exec' they've got going now..
erichmenge has joined #ruby
<apeiros_> uh? haven't heard about that. is it opt-in?
<banisterfiend> apeiros_: no, it's by default
<banisterfiend> you hav eto explicitly turn it off if u dont want it
<banisterfiend> apeiros_: it confused me for about a week
<banisterfiend> none of the gems i was installing i could actually use...
<banisterfiend> it's a 'feature' apparently
<workmad3> banisterfiend: doesn't it work on whether you have a Gemfile though? rather than always on?
<workmad3> banisterfiend: so if you're in a bundler project, it tries to bundle-exec stuff
<banisterfiend> workmad3: yeah, but often i sit in a project's directory while i try other stuff, like messing around in pry installing gems and so on.
akem has quit [Ping timeout: 255 seconds]
frishi has quit [Quit: Leaving...]
<banisterfiend> workmad3: worse than that htough, for projects that use plugins (like pry) none of the plugins i install i can actually test
<workmad3> banisterfiend: :)
akem has joined #ruby
faitswulff has joined #ruby
<apeiros_> banisterfiend: if it's opt-out, then I don't like that part.
<apeiros_> but at least you can opt-out.
<apeiros_> I don't think it should be rvm's responsibility to auto-bundle-exec.
<apeiros_> but I'll have to look at how/what they did to make a real judgment
<banisterfiend> apeiros_: i agree, too much magic. And i dont think this major change was communicated effectively
<banisterfiend> i'd be less pissed off if i'd known about it and told how to opt out, so that i didnt waste my time and confusion wondering wtf was going on
kichawa has quit [Ping timeout: 245 seconds]
dankest has quit [Quit: Leaving...]
<faitswulff> banisterfiend: what major change are you and apeiros talking about?
<banisterfiend> faitswulff: rvm now auto bundle exec'ing if it sees a Gemfile
Rochefort has joined #ruby
<Mon_Ouie> How do you disable it though? I can't seem to find documentation about it
dbgster has joined #ruby
<banisterfiend> Mon_Ouie: export NOEXEC=0
<banisterfiend> Mon_Ouie: yeah that's teh stupid thing, ther'es no documentation on it, barely any mention of it
<faitswulff> banisterfiend: ah, thank you
<banisterfiend> and this is big change
hemanth has quit [Read error: Connection reset by peer]
regedarek has joined #ruby
hemanth has joined #ruby
krusty_ar has joined #ruby
ananthakumaran1 has joined #ruby
vectorshelve has quit [Quit: Page closed]
<Mon_Ouie> It seems to see this only happens if you install the rubygems-bundler gem
<banisterfiend> Mon_Ouie: it's default not, even if u dont intsall it i think
<banisterfiend> now*
<banisterfiend> Mon_Ouie: when did u last upgrade rvm?
<apeiros_> banisterfiend: a good strategy would probably have been to ask the first time it did it whether it should
<apeiros_> and keep the setting
kichawa has joined #ruby
<banisterfiend> apeiros_: strategy regarding what?
<apeiros_> communicating the feature
<Mon_Ouie> Some time ago. I don't update it often because I only need it to keep 1.8.7.
ananthakumaran has quit [Ping timeout: 246 seconds]
blumbri has quit [Ping timeout: 252 seconds]
<banisterfiend> apeiros_: yeah
<banisterfiend> Mon_Ouie: https://rvm.io/integration/bundler/
<hoelzro> is there a way to turn a Proc into an UnboundMethod?
<Mon_Ouie> Ah, yeah I just missed the line that said it installed it by default :p
schickung has joined #ruby
jgarvey has joined #ruby
<workmad3> banisterfiend: ah, it just installs the rubygems plugin by default?
kpshek has joined #ruby
<workmad3> banisterfiend: I much prefer the --binstubs approach
<banisterfiend> workmad3: i think so yes
CreativeEmbassy has joined #ruby
robbyoconnor has quit [Ping timeout: 252 seconds]
yannis has joined #ruby
<workmad3> banisterfiend: yeah, it's just in $rvm_path/gemsets/global.gems and then installed into @global
sailias has quit [Ping timeout: 246 seconds]
Nigel is now known as G
bj0ern has joined #ruby
hynkle has joined #ruby
<banisterfiend> workmad3: do u like it
<workmad3> banisterfiend: I just disabled it... I like the binstubs approach
<banisterfiend> workmad3: what's the binstubs approach
rakunHo has quit [Remote host closed the connection]
<workmad3> banisterfiend: you install with 'bundle install --binstubs', bundler generates wrappers for the gems in the bundle in (by default) ./bin, and then rvm has a hook you can enable to add that directory to your $PATH
<workmad3> banisterfiend: if the gem isn't in the bundle, no wrapper is generated so it goes through to the normal gem path, otherwise it hits the wrapper and enables bundler
Axsuul has quit [Ping timeout: 250 seconds]
<workmad3> banisterfiend: the rvm hook is just because you can specify the bin dir too... if you go for something like '--binstubs=./bundler-bin' then you could always add ./bundler-bin to your $PATH all the time and not have to enable the RVM hook
<workmad3> (which is an after-cd hook, so probably relies on rvm's cd function override)
<Tasser> HAPPY INTERNATIONAL CAPS LOCK DAY
<banisterfiend> workmad3: cool, i like that approach too. i hate the current one, it's almost reason enough to switch to rbfu as a way of saying FU to them
<workmad3> banisterfiend: RVM supports both, which is the annoying thing
<banisterfiend> RVM is getting ridiculous, have u ever run 'rvm help' ?
<banisterfiend> a vomit of so many options and blergh that it floods off yoru screen
jxpx777 has joined #ruby
<workmad3> banisterfiend: hell, I don't see why RVM couldn't have gone with a cleaner integration with --binstubs rather than rubygems-bundler
<workmad3> the rubygems-bundler approach seems too intrusive
<banisterfiend> workmad3: pls complain on #rvm maybe he'll change his mind if more people join a chorus against it. He just kind of slipped it in ther ehoping no one would notice
Foxandxss has quit [Quit: KVIrc 4.0.4 Insomnia http://www.kvirc.net/]
<banisterfiend> workmad3: pls, i'd like to see you argue your case on #rvm and see his response
<workmad3> banisterfiend: I'll try and remember later... I'm in need of lunch right now though
SeanLazer has quit [Quit: SeanLazer]
bambanx has quit [Ping timeout: 255 seconds]
lorandi has joined #ruby
malcolmva has quit [Ping timeout: 245 seconds]
mxweas_ has joined #ruby
Targen has joined #ruby
wobr has joined #ruby
lxsameer has quit [Quit: Leaving]
fmcgeough has joined #ruby
fivetwentysix has quit [Quit: fivetwentysix]
Progster has quit [Ping timeout: 244 seconds]
mohits has quit [Read error: Connection reset by peer]
Vert has joined #ruby
concave has joined #ruby
Morkel has joined #ruby
mxweas_ has quit [Ping timeout: 246 seconds]
jrist-afk is now known as jrist
austinbv1 has joined #ruby
ThePremier has joined #ruby
Targen has quit [Ping timeout: 244 seconds]
stefanp has quit [Quit: Linkinus - http://linkinus.com]
kichawa has quit [Ping timeout: 246 seconds]
mxweas_ has joined #ruby
bglusman has joined #ruby
bglusman has quit [Remote host closed the connection]
crankycoder has joined #ruby
bglusman has joined #ruby
ssa has joined #ruby
<ssa> new to ruby here
tomask has quit [Quit: Quit]
<ssa> why do some projects access attributes set using attr_accessor with self.myattr, and others just myattr?
Progster has joined #ruby
SeanLazer has joined #ruby
<hoelzro> ssa: I'd say style
<hoelzro> also, self.myattr is explicit
<hoelzro> it says "hey, myattr is *not* a variable!"
austinbv1 has quit [Ping timeout: 244 seconds]
<hoelzro> "and don't you forget it"
<ssa> i understand that
<banisterfiend> ssa: also if u want to use a setter then u *have* to use self.myattr = blah
<hoelzro> oh, good point
<hoelzro> I didn't even think of that!
<ssa> but that also means a class (not it's instance) can't have a method called self.myattr which would do something else
<ssa> banisterfiend: ah good point!
concave has quit []
mxweas_ has quit [Ping timeout: 244 seconds]
<hoelzro> ssa: sorry, what do you mean by that first bit?
bglusman has quit [Remote host closed the connection]
centipedefarmer has joined #ruby
mxweas_ has joined #ruby
<ssa> hoelzro: in objective-c, where i come from, self always refers to instance objects
<ssa> hoelzro: so you could have a +myattr (class method) and a -myattr (instance method), both doing different things
mklappstuhl has joined #ruby
bglusman has joined #ruby
kichawa has joined #ruby
<hoelzro> ok
<ssa> hoelzro: but in ruby, am i right that i cannot define a separately behaving method named self.myattr, because the class also has an attribute called so?
<ssa> also since @myattr is available to both instances and class/module, it's quite confusing
<ssa> based on how i would have structured the usage of that class or it's instance
freeayu has quit [Quit: 离开]
<hoelzro> you may define a myattr method as both a class and instance method, I think
b26 is now known as brendan`
<Hanmac> ssa: an class is an instance too so it can have instance_variables
<ssa> Hanmac: ah
<Mon_Ouie> And they aren't related to the ivars of its instances at all
dv310p3r has joined #ruby
<yellow5> hoelzro: that is correct, you can define methods with the same name for the instance and the class that do not collide
<ssa> Out of def self.myattr and def myattr, which one gets called when i read from self.myattr?
<hoelzro> ssa: depends on if you're in a class method or instance method =)
<Mon_Ouie> That just depends on what self is
fivetwentysix has joined #ruby
<ssa> hoelzro: ah! context matters
fivetwentysix_ has joined #ruby
rafacv has joined #ruby
<ssa> Mon_Ouie: right. like Hanmac said, self could be the class instance as well.
<ssa> my mind's clear about this now
<Mon_Ouie> class Foo; puts self; end # => Foo
<ssa> s/mind's/mind is/
<ssa> true
<Mon_Ouie> (will actually # => nil but you get my point)
coderhut has joined #ruby
<ssa> actually, i remember reading that in fact even class is not an instance, it just behaves like one.
<Mon_Ouie> I'm not sure what you mean. A class *is* an instance of the Class class.
petrjanda has joined #ruby
<ssa> so "class" is a dsl to Class.new?
<workmad3> ssa: it behaves a bit differently
ph^ has quit [Remote host closed the connection]
<workmad3> ssa: 'class' is a keyword... but it does create an instance of the class Class
fivetwentysix has quit [Ping timeout: 264 seconds]
ph^ has joined #ruby
fivetwentysix_ is now known as fivetwentysix
<ssa> workmad3: okay
jcromartie has quit [Quit: jcromartie]
ph^_ has joined #ruby
ph^_ has quit [Remote host closed the connection]
Elfix is now known as ELFIX
ph^_ has joined #ruby
ph^ has quit [Ping timeout: 246 seconds]
lorandi has quit [Quit: Leaving]
mohits has joined #ruby
mohits has quit [Changing host]
mohits has joined #ruby
mxweas_ has quit [Quit: Computer has gone to sleep.]
axl_ has joined #ruby
<ssa> Is "validate" a reserved keyword?
linoj has joined #ruby
<ssa> textmate highlights "validate" in a different color (the same as other reserved keywords)
ken_barber has joined #ruby
<ssa> Google could help me if active record validations didn't exist. haha
dbgster has quit [Quit: dbgster]
ph^_ has quit [Ping timeout: 264 seconds]
mohits has quit [Client Quit]
<apeiros_> ssa: no. but it's probably highlighted because of rails
tk___ has joined #ruby
<ssa> apeiros_: ah, thanks, it had the wrong scheme selected. thanks again!
jcromartie has joined #ruby
kvirani has quit [Remote host closed the connection]
asobrasil has joined #ruby
liluo has joined #ruby
mxweas_ has joined #ruby
savage- has joined #ruby
pu22l3r has joined #ruby
pu22l3r has quit [Remote host closed the connection]
pu22l3r has joined #ruby
rbanffy has joined #ruby
bashdy has joined #ruby
mxweas_ has quit [Ping timeout: 252 seconds]
plastics has quit [Ping timeout: 246 seconds]
twinturbo has joined #ruby
chson has quit [Remote host closed the connection]
graspee has joined #ruby
carloslopes has joined #ruby
sailias has joined #ruby
liluo has quit [Remote host closed the connection]
mxweas_ has joined #ruby
Jake232 has joined #ruby
jimeh has quit [Quit: bye]
faitswulff has left #ruby [#ruby]
jimeh has joined #ruby
<fasta> gem1.9.1 install watir-webdriver => results in failure
bglusman has quit [Remote host closed the connection]
mxweas_ has quit [Ping timeout: 246 seconds]
bglusman has joined #ruby
LBRapid has joined #ruby
liluo has joined #ruby
bglusman_ has joined #ruby
<ramblex> fasta: which OS are you on? are you using rvm?
rbanffy has quit [Ping timeout: 246 seconds]
<fasta> ramblex: Ubuntu
<fasta> ramblex: no
awarner has joined #ruby
uris has joined #ruby
<ramblex> fasta: Have you tried `sudo aptitude install ruby1.9.1-dev`?
<fasta> ramblex: no
<fasta> ramblex: if a package wants me to install that, they should tell me that.
<fasta> C programs also say that 'No suitable C compiler found'.
<fasta> It's called common sense to create installers that check dependencies.
bglusman has quit [Ping timeout: 245 seconds]
ixti has joined #ruby
<ramblex> well, it told you that you don't have mkmf so you should probably install something that provides it
liluo has quit [Remote host closed the connection]
<fasta> ramblex: yeah, but configure says it in a bit more human readable way.
<fasta> ramblex: anyway, thanks.
kevinbond has quit [Quit: kevinbond]
gtuckerkellogg has quit [Ping timeout: 250 seconds]
mockra has joined #ruby
fulmato has quit [Remote host closed the connection]
joshman_ has joined #ruby
fivetwentysix has quit [Quit: fivetwentysix]
BiHi has quit [Ping timeout: 246 seconds]
PaciFisT has joined #ruby
jianxioy has quit [Quit: Lost terminal]
niklasb_ has joined #ruby
internet_user has joined #ruby
niklasb has quit [Ping timeout: 252 seconds]
BiHi has joined #ruby
liluo has joined #ruby
savage- has quit [Remote host closed the connection]
carlyle has joined #ruby
altious has joined #ruby
cbuxton has joined #ruby
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
kvirani has joined #ruby
andrewhl has joined #ruby
coderhut has quit [Quit: Page closed]
iocor has joined #ruby
kvirani has quit [Remote host closed the connection]
yannis has quit [Quit: yannis]
carlyle has quit [Remote host closed the connection]
plastics has joined #ruby
kenperkins has quit [Quit: Computer has gone to sleep.]
carlyle has joined #ruby
neku has joined #ruby
kichawa has quit [Ping timeout: 244 seconds]
hunglin has joined #ruby
iocor has quit [Quit: Computer has gone to sleep.]
td123 has joined #ruby
Synthead has quit [Quit: p33 ba115]
kevinbond has joined #ruby
rippa has joined #ruby
Synthead has joined #ruby
<ij> Can I write "case; when a.x then 1; when a.y then 2; end" fancier?
Hanmac has quit [Ping timeout: 265 seconds]
kichawa has joined #ruby
kichawa has quit [Changing host]
kichawa has joined #ruby
CheeToS has joined #ruby
fbernier has joined #ruby
wubino has joined #ruby
<wubino> I have installed bundler twice but it never seems to work. Any ideas
<ij> post errors and what you did
senny has joined #ruby
<wubino> I have rvm installed
<wubino> gem install bundler
<wubino> it completes installation saying it is installed
bambanx_ has joined #ruby
<ramblex> wubino: are you using a gemset?
<wubino> then when I "bundle install" is says: ERROR: Gem bundler is not installed, run `gem install bundler` first.
Sheehan has joined #ruby
<wobr> ij: (1 if a.x) or (2 if a.y) ??
advorak has joined #ruby
ramblex has quit [Quit: ramblex]
<graspee> ij: a.x ? 1 : (a.y ? 2 : 0)
ramblex has joined #ruby
malcolmva has joined #ruby
<wubino> IDK, what is a gemset?
iori has quit [Remote host closed the connection]
<ramblex> a set of gems. I've had a problem before where I needed to tell rvm to use the gemset again after I installed bundler.
JustinCampbell has quit [Remote host closed the connection]
<ramblex> you could try `rvm use 1.9.3`
<ramblex> or whatever ruby version you're using
<ij> graspee: wobr: I was thinking about a optimised case variant" a.
JustinCampbell has joined #ruby
malcolmva has quit [Remote host closed the connection]
andrewhl has quit [Remote host closed the connection]
fbernier has quit [Ping timeout: 264 seconds]
malcolmva has joined #ruby
malcolmva has quit [Client Quit]
khakimov has joined #ruby
<wubino> ok, RVM is telling me I need to adjust the terminal to allow shell login
nirakara has joined #ruby
workmad3 has quit [Read error: Connection reset by peer]
fbernier has joined #ruby
senny has quit [Remote host closed the connection]
digitalcakestudi has joined #ruby
macmartine has joined #ruby
djdb has quit [Remote host closed the connection]
davidw has quit [Changing host]
davidw has joined #ruby
malcolmva has joined #ruby
TPFC-SYSTEM has quit [Quit: TPFC-SYSTEM]
SQLStud has joined #ruby
rbanffy has joined #ruby
tk___ has quit [Quit: ばいばい]
emmanuel__ has quit [Read error: Connection reset by peer]
niklasb_ is now known as niklasb
bambanx_ has quit [Ping timeout: 255 seconds]
ifnspifn has joined #ruby
mockra has quit [Remote host closed the connection]
<ifnspifn> Hey, I'm having some trouble with executing ruby code in a string... here it is:
<ifnspifn> "%{value} contains an invalid character: %{/[^A-Za-z0-9_\-]+/.match(value)[0]}"
<ifnspifn> value is printed just fine, but the regexp expression isn't
<ifnspifn> that gets printed verbatim
emmanuelux has joined #ruby
ThePremier has quit [Remote host closed the connection]
nirakara has quit [Ping timeout: 244 seconds]
<ramblex> ifnspifn: did you mean to use #{...}?
<ifnspifn> hm, I suppose I did, but what is the difference?
<ramblex> ifnspifn: i'm not sure what %{…} does, if anything
mxweas_ has joined #ruby
<ifnspifn> ramblex: perhaps it's rails-exclusive.. I got it from: http://guides.rubyonrails.org/active_record_validations_callbacks.html#allow_nil
ananthakumaran1 has quit [Quit: Leaving.]
<Mon_Ouie> %{…} is a string literal
<Mon_Ouie> If you want a regexp literal use %r{…}
xnm has joined #ruby
jcromartie has quit [Quit: jcromartie]
mxweas_ has quit [Ping timeout: 252 seconds]
<apeiros_> Mon_Ouie, ifnspifn, ramblex: na, %{} in a string is used for printf
<Mon_Ouie> Oh nvm, I was confused due to the regexp nested in the string
<apeiros_> outside a string of course it is a string literal ;-)
<apeiros_> e.g.: "%{greeting} %{entity}!" % {:greeting => "Hello", :entity => "World"} # => "Hello World!"
<ifnspifn> aperios_: is there any way I can execute code in a %{}? when I use #{}, it doesn't have access to the value variable that gets placed in %{value}
<apeiros_> you can't have arbitrary ruby code in it, though. so %{/[^A-Za-z0-9_\-]+/.match(value)[0]} can't work
<apeiros_> ifnspifn: use tab completion. makes you not typo nicks.
<ifnspifn> apeiros_: ah, many thanks :]
<apeiros_> ifnspifn: no. %{} is a simple key only. no code allowed.
dhruvasagar has quit [Ping timeout: 250 seconds]
mxweas_ has joined #ruby
centipedefarmer has quit [Quit: This computer has gone to sleep]
wilmoore has joined #ruby
<ifnspifn> hm. Is there any way I can access %{key} inside of code? perhaps a binding to a variable?
qwerxy_ has joined #ruby
kichawa has quit [Ping timeout: 246 seconds]
<ifnspifn> more specifically, the value variable in .match() is undefined at runtime, even though %{value} prints the expected value
<Mon_Ouie> Can you show an actual example?
pk1001100011 has joined #ruby
<ifnspifn> apeiros_, Mon_Ouie: "%{value} contains an invalid character: #{/[^A-Za-z0-9_\-]+/.match(value)[0]}"
cpruitt has joined #ruby
qwerxy has quit [Ping timeout: 244 seconds]
<apeiros_> ifnspifn: as said, no, you can't
schovi has quit [Remote host closed the connection]
<apeiros_> you have to do the matching outside of that
<apeiros_> also, /[^A-Za-z0-9_\-]+/.match(value)[0] --> value[/[^A-Za-z0-9_\-]+/]
<Mon_Ouie> value = "foo +/ bar"; puts "here: #{/[^A-Za-z0-9_\-]+/.match(value)[0]}" # prints the corect result
<apeiros_> which in turn (in 1.9): value[/[^\w-]+/]
<apeiros_> ifnspifn: using that in rails localizations?
<ifnspifn> this string is being passed to :message in an ActiveRecord validates definition (this is a rails question, I know)
mxweas_ has quit [Ping timeout: 246 seconds]
<ifnspifn> I believe so, but I'm very unfamiliar with rails
<apeiros_> ok. then as I said. you'll have to do the processing in the validator
<ifnspifn> as such, I've no idea what can be passed in ":message => ..."
<apeiros_> you can't have it in the string definition
<apeiros_> you shouldn't have code in locales anyway.
<ifnspifn> can I pass a block to :message?
moosya has quit [Quit: moosya]
Habib has joined #ruby
<apeiros_> o0
<Habib> hey everyone. what ide to use in linu?
<Habib> linux
<apeiros_> you are the implementer of that custom validator, right?
mxweas_ has joined #ruby
lorandi has joined #ruby
<ifnspifn> apeiros_: yes
<apeiros_> that's where you do it. anyway, that part is a #rubyonrails question
<ifnspifn> this is in the model, if that helps
<ifnspifn> funny enough, I'd asked this in #rails, which I assumed to be the RoR room
<ifnspifn> thanks, apeiros_ :]
zommi has quit [Remote host closed the connection]
khakimov has quit [Quit: Computer has gone to sleep.]
<apeiros_> nope, #rails is pretty much useless
kvirani has joined #ruby
TheHunter_1039 has quit [Quit: TheHunter_1039]
kichawa has joined #ruby
kichawa has quit [Changing host]
kichawa has joined #ruby
joel has joined #ruby
cakehero has joined #ruby
eurbach has quit [Quit: Leaving.]
<joel> I've got a ruby program that creates three threads, I call join on those three threads so the main program doesn't exit until they are finished. For some reason a data structure that gets passed into the third thread never comes in "cleanly", even though its clean before going in. thoughts?
maahes has quit [Read error: Connection reset by peer]
<Spooner> How do I find out the class from its metaclass?
akem has quit [Ping timeout: 245 seconds]
<apeiros_> I don't have a ruby program that creates three threads. problem solved :o)
eurbach has joined #ruby
ortho_stice has joined #ruby
ipoval has joined #ruby
<apeiros_> Spooner: no sane way
<apeiros_> Spooner: it's the same problem as "find all instances of class X"
mxweas_ has quit [Ping timeout: 244 seconds]
<apeiros_> it can be done using ObjectSpace.each_object. but that's insane.
<Spooner> No, I don't want it that badly :)
ph^ has joined #ruby
<joel> apeiros_...
emmanuelux has quit [Ping timeout: 252 seconds]
maahes has joined #ruby
<fowl> ahoy Spooner
<Spooner> Hi fowl
rbanffy has quit [Ping timeout: 246 seconds]
sirupsen has joined #ruby
mxweas_ has joined #ruby
<Spooner> Given up on games?
<fowl> nah im just trying different things
maesbn has quit [Remote host closed the connection]
nikky has quit [Ping timeout: 246 seconds]
<fowl> Spooner, im working ona game in nimrod right now
ckrailo has joined #ruby
<sirupsen> given an array of objects that respond to #key and #value, where some of these #key methods return the same, I'd like to create a hash where all the #value s for a #key are added together, like: r = {}; array.each { |e| r[e.key] = e.value }; return r — doesn't seem very Ruby-ish though, anybody got a better suggestion?
kenperkins has joined #ruby
<apeiros_> sirupsen: see group_by
Synthead has quit [Ping timeout: 244 seconds]
<apeiros_> sirupsen: r[e.key] = e.value isn't really "adding together", though
baroquebobcat has joined #ruby
jcromartie has joined #ruby
<joel> is there a way to pp the data passed to a subroutine without naming each item?
<sirupsen> apeiros_: sorry, +=
<apeiros_> by item, you mean argument?
ipoval has quit [Quit: ipoval]
<sirupsen> so I'd have to have to set the value to 0 if it's not already a number
<apeiros_> sirupsen: that code will fail then… nil += e.value won't work
<sirupsen> hence my edge-case fix^^
<apeiros_> group_by + map + inject
<sirupsen> man
<sirupsen> :D
<apeiros_> or just: r = Hash.new(0); …your loop…
Synthead has joined #ruby
iocor has joined #ruby
snip_it_ has joined #ruby
davidcelis has quit [Ping timeout: 265 seconds]
AxonetBE1 has joined #ruby
<AxonetBE1> if I have @orders_pending && the string "orders_pending" from params how I can get the object @orders_pending then?
Criztian has quit [Ping timeout: 246 seconds]
niku4i has joined #ruby
olrrai has joined #ruby
<hoelzro> AxonetBE1: instance_variable_get
<hoelzro> also, don't forget to validate
<hoelzro> like crazy =)
Sheehan has quit [Ping timeout: 250 seconds]
DrShoggoth has joined #ruby
mxweas_ has quit [Ping timeout: 246 seconds]
Criztian has joined #ruby
savage- has joined #ruby
sirupsen has quit [Quit: Page closed]
larissa has quit [Quit: Saindo]
mxweas_ has joined #ruby
savage- has quit [Remote host closed the connection]
nomad__ has joined #ruby
ryannielson has joined #ruby
rbanffy has joined #ruby
rbanffy has quit [Read error: Connection reset by peer]
prometheus has joined #ruby
plastics- has joined #ruby
theRoUS has quit [Ping timeout: 245 seconds]
<Synthead> is there a way to make an external command echo as it's being ran? kinda like `echo test && sleep 3 && echo test 2`: this would display "test" right away, then "test 2" 3 seconds after
joel has quit [Quit: ChatZilla 0.9.88.2 [Firefox 12.0/20120420145725]]
Habib has quit [Ping timeout: 248 seconds]
wilmoore has quit [Read error: Connection reset by peer]
apeiros_ has quit [Remote host closed the connection]
plastics has quit [Ping timeout: 244 seconds]
fivetwentysix has joined #ruby
mxweas_ has quit [Ping timeout: 252 seconds]
Morkel has quit [Quit: Morkel]
mxweas_ has joined #ruby
petrjanda has quit [Quit: petrjanda]
wubino has quit [Ping timeout: 246 seconds]
mnaser has joined #ruby
CreativeEmbassy has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
fivetwentysix has quit [Ping timeout: 265 seconds]
<ramblex> Synthead: system('cmd')?
Eldariof-ru has quit [Ping timeout: 246 seconds]
eurbach is now known as eu|eating
<Synthead> ramblex: ahhh, there we go :)
fangwen has joined #ruby
rdg has joined #ruby
mxweas_ has quit [Ping timeout: 255 seconds]
thomas is now known as THOMAS
<Synthead> ramblex: is there a way I can capture the output and put it into a block in real-time? I'm looking to add a time stamp to the output. system('cmd') do { |x| something_with x } maybe?
<Synthead> s/do //
AxonetBE1 has quit [Quit: Leaving.]
wallerdev has joined #ruby
nirakara has joined #ruby
<ramblex> I think I've used popen4 in the past to do something similar
mxweas_ has joined #ruby
oooPaul has joined #ruby
<Synthead> ramblex: any way I could do this without a gem? popen4 looks good though
Drewch has quit [Ping timeout: 272 seconds]
mohits has joined #ruby
Hanmac has joined #ruby
niku4i has quit [Remote host closed the connection]
ukd1 has joined #ruby
niku4i has joined #ruby
theRoUS has joined #ruby
mayankkohaley has quit [Ping timeout: 248 seconds]
chson has joined #ruby
Drewch has joined #ruby
pk1001100011 has quit [Quit: I've got a feeling there's a fish in the floor; I'd better squish it or he'll swim out the door; Sometimes they take me for a walk in the sun; I see my fish and I have to run]
mayankkohaley has joined #ruby
jgrevich has joined #ruby
Sonne has quit [Quit: Leaving]
rdg has quit [Quit: ttfn]
hoelzro is now known as hoelzro|away
niku4i has quit [Ping timeout: 240 seconds]
<cout> Synthead: popen() is fine
<cout> popen4 is if you need both input and output
<cout> and pid
tvw has quit [Read error: Connection reset by peer]
fbernier has quit [Ping timeout: 244 seconds]
<cout> so IO.popen('cmd') do |x| ... end
lorandi has quit [Ping timeout: 265 seconds]
nirakara has quit [Quit: This computer has gone to sleep]
davidw has quit [Read error: Operation timed out]
mnaser has quit [Ping timeout: 246 seconds]
robbyoconnor has joined #ruby
jprovazn is now known as jprovazn_away
digitalcakestudi has quit [Quit: Leaving.]
techhelp has joined #ruby
maxmmurphy has joined #ruby
maletor has joined #ruby
mnaser has joined #ruby
randomautomator has joined #ruby
mxweas_ has quit [Ping timeout: 264 seconds]
brendan` has quit [Read error: Operation timed out]
brendan` has joined #ruby
mxweas_ has joined #ruby
robotmay has quit [Remote host closed the connection]
fearoffish has joined #ruby
mnaser has quit [Ping timeout: 244 seconds]
Beoran_ has quit [Ping timeout: 240 seconds]
eu|eating is now known as eurbach
Rochefort has quit [Remote host closed the connection]
fangwen has left #ruby ["ERC Version 5.3 (IRC client for Emacs)"]
mnaser has joined #ruby
apeiros_ has joined #ruby
shevy has quit [Ping timeout: 248 seconds]
fbernier has joined #ruby
davidcelis has joined #ruby
davidcelis has quit [Changing host]
davidcelis has joined #ruby
bluenemo has joined #ruby
savage- has joined #ruby
savage-_ has joined #ruby
prometheus has quit [Ping timeout: 252 seconds]
mxweas_ has quit [Ping timeout: 244 seconds]
virunga has joined #ruby
mxweas_ has joined #ruby
dkissell_ has joined #ruby
minijupe has joined #ruby
williamcotton has joined #ruby
eywu has joined #ruby
savage- has quit [Ping timeout: 246 seconds]
TPFC-SYSTEM has joined #ruby
dkissell has quit [Ping timeout: 248 seconds]
dkissell_ is now known as dkissell
<Synthead> I uninstalled open4 and now I get INFO: gem "open4" is not installed. What does this mean? was it a "system" gem?
strnx has quit [Excess Flood]
andrewhl has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
AxonetBE has joined #ruby
ex0a has quit [Ping timeout: 265 seconds]
ukd1 has quit [Ping timeout: 250 seconds]
<Synthead> is Disk an internal class in ruby?
mklappstuhl has quit [Read error: Operation timed out]
strnx has joined #ruby
werdnativ has joined #ruby
apok has joined #ruby
ex0a has joined #ruby
rudi has quit [Quit: leaving]
<ortho_stice> Hi all, debugging tools question. I have a Perl background, and I miss doing 'perl -d script.pl'. (That starts the perl interpreter, and then stops before the first runtime statement - at which point you can step through the code). I have a misbehaving ruby script that I'd like to step through. irb is interactive, but 'irb scriptname ...' doesn't halt at the first statement - it just runs through, and I hit the
Targen has joined #ruby
timonv has quit [Remote host closed the connection]
<fowl> ortho_stice, you want pry
Beoran_ has joined #ruby
<ortho_stice> fowl: that looks promising. Many thanks!
mnaser has quit [Ping timeout: 265 seconds]
nomad__ has quit [Quit: Leaving]
THOMAS is now known as thomas
mxweas_ has quit [Ping timeout: 248 seconds]
aantix has joined #ruby
prometheus has joined #ruby
mnaser has joined #ruby
socomm has joined #ruby
aantix has quit [Read error: Connection reset by peer]
shevy has joined #ruby
aantix has joined #ruby
mxweas_ has joined #ruby
<Mon_Ouie> Synthead: That error message means nothing more than what it says: that gem isn't installed
<ij> Can ruby's case fallthrough?
<Mon_Ouie> ij: Nope
wilmoore has joined #ruby
<Synthead> Mon_Ouie: but the script doesn't require it
<ij> Oh, I still can when x || y
carloslopes has quit [Quit: Leaving.]
AxonetBE has quit [Quit: Leaving.]
wobr has quit [Quit: Leaving.]
Maniacal has joined #ruby
<Mon_Ouie> ij: Probably what you want is "when x, y"
<xclite> Synthead: probably more likely is you don't name it in a require in your script, but something you do require transitively causes you to require open4
<Mon_Ouie> Synthead: If you try to require a file that isn't in the load path, ruby raises a LoadError, it wouldn't print an informative message
wobr has joined #ruby
<Mon_Ouie> However, rubygems does print that message when you try to uninstall a gem that isn't installed — and thus, there's nothing that needs to be done
jxpx777 has quit [Quit: Mac is sleeping…]
maletor has joined #ruby
<xclite> Synthead: wait, if this isn't being printed when you run a script, what script are you talking about not requiring it?
Eiam has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
axl_ has quit [Read error: Connection reset by peer]
Ontolog has joined #ruby
akem has joined #ruby
wobr has quit [Ping timeout: 246 seconds]
akem has quit [Read error: Connection reset by peer]
akem has joined #ruby
axl__ has joined #ruby
ixti has quit [Read error: Connection reset by peer]
mneorr4 has joined #ruby
mengu has joined #ruby
artOfWar_ has joined #ruby
artOfWar_ has quit [Remote host closed the connection]
artOfWar_ has joined #ruby
mneorr3 has quit [Ping timeout: 246 seconds]
artOfWar has quit [Read error: Connection reset by peer]
kpshek has quit []
kpshek has joined #ruby
CheeToS has quit [Remote host closed the connection]
jfoley has joined #ruby
mxweas_ has quit [Ping timeout: 240 seconds]
thecreators has joined #ruby
jimeh has quit [Ping timeout: 246 seconds]
mxweas_ has joined #ruby
mikepack has joined #ruby
robbyoconnor has quit [Max SendQ exceeded]
robbyoconnor has joined #ruby
TheHunter_1039 has joined #ruby
mxweas_ has quit [Ping timeout: 250 seconds]
qwerxy_ has quit [Read error: Operation timed out]
<shevy> Synthead does not write back!
ixti has joined #ruby
mxweas_ has joined #ruby
qwerxy has joined #ruby
dankest has joined #ruby
ukd1 has joined #ruby
phantasm66 has joined #ruby
bitsar has quit [Remote host closed the connection]
ex0a has quit [Read error: Operation timed out]
mklappstuhl has joined #ruby
invsblduck has joined #ruby
mklappstuhl has quit [Client Quit]
lolmaus has quit []
ex0a has joined #ruby
kenichi has joined #ruby
stkowski has joined #ruby
Jake232 has quit [Read error: Connection reset by peer]
schovi has joined #ruby
QaDeS_ has joined #ruby
QaDeS_ has quit [Read error: Connection reset by peer]
Criztian has quit [Remote host closed the connection]
robbyoconnor has quit [Max SendQ exceeded]
<xclite> shevy: apparently not haha
ixti has quit [Quit: So Long, and Thanks for All the Fish!]
robbyoconnor has joined #ruby
ringotwo has joined #ruby
Targen has quit [Ping timeout: 245 seconds]
schovi has quit [Read error: Connection reset by peer]
virunga has quit [Read error: Connection reset by peer]
schovi has joined #ruby
ianbrandt has joined #ruby
mikepack has quit [Remote host closed the connection]
ukd1 has quit [Ping timeout: 246 seconds]
JStoker has quit [Excess Flood]
schovi_ has joined #ruby
kpshek has quit []
AlbireoX`Laptop has joined #ruby
jfoley has quit [Quit: jfoley]
mnaser has quit [Ping timeout: 255 seconds]
kpshek has joined #ruby
tewecske has joined #ruby
plastics- has quit [Ping timeout: 252 seconds]
Progster has quit [Ping timeout: 240 seconds]
schovi has quit [Ping timeout: 246 seconds]
ramblex has quit [Quit: ramblex]
mnaser has joined #ruby
Xethron has quit []
AlbireoX`Laptop has quit [Remote host closed the connection]
pygospa has quit [Ping timeout: 244 seconds]
bgupta has joined #ruby
ephemerian has quit [Quit: Leaving.]
ktilcu has joined #ruby
carloslopes has joined #ruby
pygospa has joined #ruby
Natch has quit [Remote host closed the connection]
c0rn_ has joined #ruby
AlbireoX`Laptop has joined #ruby
punkrawkR has joined #ruby
havenn has joined #ruby
bashdy has quit [Quit: bashdy]
carlyle has quit [Remote host closed the connection]
digitalcakestudi has joined #ruby
Natch has joined #ruby
rafacv has quit [Quit: Leaving.]
<digitalcakestudi> how can I do a similar split but with commas? split(/\s+/)
<rippa> split /,+/
<digitalcakestudi> thanks
JStoker has joined #ruby
<cakehero> I want to find the default installation options for a gem - how would I do that?
<cakehero> Someone overwrote one of the defaults when they installed it by passing it to gem install, but, I don't know how to figure out what the default would have been if they didnt'
<Hanmac> digitalcakestudi: shouldnt split ',' works the same?
wobr has joined #ruby
brianpWins has quit [Quit: brianpWins]
ukd1 has joined #ruby
robbyoconnor has quit [Read error: Connection reset by peer]
<xclite> Hanmac: try to split "1,,2"
<xclite> Hanmac: with each option
BiHi has quit [Quit: Computer has gone to sleep]
<Hanmac> xclite: yeah the result is different, but it depends what he wants
<Hanmac> i may that he wants to parse CSV files
wobr has quit [Client Quit]
mxweas_ has quit [Ping timeout: 264 seconds]
<xclite> Hanmac: my point is they don't work the same
lorandi has joined #ruby
rking has quit [Quit: BRB]
voodoofish430 has joined #ruby
mxweas_ has joined #ruby
rking has joined #ruby
schovi_ has quit [Remote host closed the connection]
mohits has quit [Read error: Connection reset by peer]
<Mon_Ouie> If he wants to parse CSV files, he should use the CSV module
<Mon_Ouie> CSV isn't a complicated format, but it's more than just split(",")
eywu has quit [Quit: Leaving.]
jfoley has joined #ruby
ananthakumaran has joined #ruby
cantonic has joined #ruby
rowanu has joined #ruby
<epochwolf> Mon_Ouie: CSV is complicated because it's not standardized very well.
rking has quit [Client Quit]
rking has joined #ruby
bgupta has quit [Read error: Connection reset by peer]
carloslopes has quit [Quit: Leaving.]
bgupta has joined #ruby
adamkittelson has joined #ruby
carloslopes has joined #ruby
bgupta has quit [Client Quit]
zacstewart has joined #ruby
bgupta has joined #ruby
fulmato has joined #ruby
eywu has joined #ruby
mxweas_ has quit [Ping timeout: 250 seconds]
kevinbond has quit [Quit: kevinbond]
dankest has quit [Quit: Leaving...]
<digitalcakestudi> Sorry I meant I need a watch for both the space and the comma for example I have a list of "1, 2, 3" but it turns into "1" " 2" " 3" with the two and the three both having an extra space infront
mxweas_ has joined #ruby
rbanffy has joined #ruby
<digitalcakestudi> I tried split(/,\s+/)
hadees has quit [Quit: hadees]
mockra has joined #ruby
<davidcelis> and that didn't work?
Xethron_ has quit [Ping timeout: 264 seconds]
<davidcelis> but like Mon_Ouie said, you should use something like FasterCSV if you're gonna be doing CSV parsing
yonggu_ has quit [Remote host closed the connection]
yonggu has joined #ruby
<digitalcakestudi> its for a tagging system
<davidcelis> you can't depend on whitespacing around commas. CSVs, in fact, should not have whitespacing around commas
<davidcelis> they,should,be,formatted like,this
<digitalcakestudi> so a blog post has "music, tv, some video game, ect"
<davidcelis> ah, tags
rushed has joined #ruby
<davidcelis> so why didn't your split work?
mxweas_ has quit [Ping timeout: 245 seconds]
<davidcelis> you should really be doing something more like .split(/\s*,\s*) though
<digitalcakestudi> I just found out that the front it is trying to wrap the many words with "
<davidcelis> because you shouldn't expect whitespacing
<digitalcakestudi> I ended up split(", ")
Xethron has joined #ruby
<davidcelis> so as soon as someone enters a list of tags like "music ,tv,some video game", your system breaks
<digitalcakestudi> good point did not think of that
<davidcelis> i'd recommend the split i mentioned above
<digitalcakestudi> (/\s*,\s*) will help with that?
<davidcelis> or you could .split(",").map(&:strip)
cpruitt has quit [Quit: cpruitt]
<davidcelis> but not having to map is better
<digitalcakestudi> I'm already having to make for the name @keywords.split(", ").map do |name|
mxweas_ has joined #ruby
<digitalcakestudi> cause then I check to see if the tag is already a row before making a new one
<davidcelis> well if you're already feeding into a map
<davidcelis> then just .split(",") and do a name.strip before you do anything else in that map
snip_it_ has left #ruby [#ruby]
Sheehan has joined #ruby
kenichi has quit [Remote host closed the connection]
Xethron has quit [Ping timeout: 246 seconds]
<digitalcakestudi> thanks davidcelis
cantonic has quit [Ping timeout: 248 seconds]
hynkle has quit [Quit: Computer has gone to sleep.]
mxweas_ has quit [Ping timeout: 246 seconds]
<digitalcakestudi> so how can I work in the proc with the map? .split(",").map &:strip do |name| ?
<digitalcakestudi> sorry I know thats a noob question
<davidcelis> no, call .strip on your block variable inside thep map you already have
<Mon_Ouie> split /\s*,\s*/
<davidcelis> you can't pass two blocks
<davidcelis> but i agree, i still think the split i mentioned before is better
<davidcelis> though if there are spaces after the last value, those will end up getting passed through
<Mon_Ouie> Oh, already suggested
Xethron has joined #ruby
kenichi has joined #ruby
akem has quit [Quit: Forget progress by proxy. Land on your own moon.]
mengu has quit [Remote host closed the connection]
burgestrand1 has joined #ruby
AxonetBE has joined #ruby
<digitalcakestudi> sorry got confused, makes sense now.
cirwin has joined #ruby
adeponte has quit [Remote host closed the connection]
dankest has joined #ruby
brianpWins has joined #ruby
<digitalcakestudi> errr regular expressions can burn your brain. :)
mxweas_ has joined #ruby
Xethron has quit [Ping timeout: 264 seconds]
<bj0ern> I always use this when I get confused: regexpal.com
jfoley has quit [Quit: jfoley]
<JustinCampbell> theres a great app called Patterns in the mac app store
blumbri has joined #ruby
cantonic has joined #ruby
<bj0ern> oh, thanks. that looks great.
mxweas_ has quit [Ping timeout: 248 seconds]
hadees has joined #ruby
mxweas_ has joined #ruby
<shevy> bugs bugs bugs...
hadees has quit [Remote host closed the connection]
<shevy> I am sick of them
<davidcelis> bj0ern: http://rubular.com/
mohits has joined #ruby
bluenemo has quit [Remote host closed the connection]
<bj0ern> also very interesting, thanks :)
mxweas_ has quit [Ping timeout: 252 seconds]
panzi has joined #ruby
jimeh has joined #ruby
celm has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
mxweas_ has joined #ruby
<panzi> is there a way with Curl::Easy (or any other http client lib) to only download a page if it has a certain COntent-Type (e.g. text/html) and is not bigger than a certain size?
krusty_ar has quit [Read error: Connection reset by peer]
<panzi> I need this for some very simple crawler that shall fetch images from an url, in case an url points to an html page
Progster has joined #ruby
mohits has quit [Ping timeout: 244 seconds]
maxmmurphy has quit [Quit: maxmmurphy]
<Mon_Ouie> Just do a head request then a get if the header matches what you need?
werdnativ has quit [Quit: werdnativ]
ghanima has quit [Quit: Leaving.]
akem has joined #ruby
akem has quit [Changing host]
akem has joined #ruby
<panzi> Mon_Ouie: *facepalm* you're right
mxweas_ has quit [Ping timeout: 246 seconds]
krusty_ar has joined #ruby
mxweas has quit [Ping timeout: 244 seconds]
jfischoff has joined #ruby
ukd1 is now known as Guest53099
kaneda is now known as Guest9927
ged is now known as Guest31454
shadoi has joined #ruby
td123 has quit [Ping timeout: 246 seconds]
mxweas has joined #ruby
Xethron_ has joined #ruby
Guest31454 is now known as ged
mxweas_ has joined #ruby
ged is now known as Guest52195
<Synthead> xclite: my own script
iamjarvo has quit [Quit: Leaving.]
<Synthead> Mon_Ouie: it isn't required in my script
Guest52195 is now known as ged
Progster has quit [Ping timeout: 244 seconds]
cantonic has quit [Quit: cantonic]
td123 has joined #ruby
brendan` has quit [Remote host closed the connection]
<jfischoff> I have a rake file and one step produces files. I want to make tasks based on the generated files. i don't know what they are at the start. What is the right way to handle this situation?
mxweas has quit [Ping timeout: 256 seconds]
mxweas_ is now known as mxweas
mxweas_ has joined #ruby
celm has quit [Quit: Leaving]
<shevy> yay! Synthead has returned \o/
<Synthead> schickung: hahaha
<Synthead> OOPS
`brendan has joined #ruby
<Synthead> shevy: ^
<shevy> Synthead makes it easier to solve problems when the replies are quick to come :P
rushed has quit [Quit: rushed]
rbanffy_ has joined #ruby
rbanffy has quit [Read error: Connection reset by peer]
<shevy> Synthead have you considered trying to use a thread yet?
<Synthead> shevy: heh, sorry man :) work calls
<schickung> Synthead: ??
<shevy> I see I see
monkegjinni has quit [Remote host closed the connection]
thecreators has quit [Ping timeout: 246 seconds]
<Synthead> schickung: sorry bout that :)
<shevy> well then beat up the work!
<Synthead> hahaha
<Synthead> all day err day
tatsuya_o has quit [Remote host closed the connection]
<schickung> Synthead: ok.... cu
<Synthead> shevy: I thought it was unusual that I installed popen4, then uninstalled it, now I'm getting errors. did this "upgrade" an existing gem, do you think?
<shevy> hmm you used "gem install popen4" ?
<shevy> Fetching: Platform-0.4.0.gem (100%)
<shevy> Fetching: open4-1.3.0.gem (100%)
<shevy> Fetching: popen4-0.1.2.gem (100%)
<Synthead> shevy: yeah
<shevy> gem uninstall popen4
<shevy> Successfully uninstalled popen4-0.1.2
<Synthead> exactly
mxweas_ has quit [Ping timeout: 244 seconds]
<shevy> seems it fetched the dependencies, via uninstall only popen4 is removed
<Synthead> shevy: and when I run any script, it complains about it
<shevy> I assume require 'open4' would work
<shevy> hmm
<shevy> it says "can not find popen4"?
<Synthead> theeere we go
<Synthead> shevy: no, I didn't require it and I still got errors
<shevy> well that sounds odd
<shevy> perhaps one of the other two gems tries to require it
<Synthead> shevy: yeah, agreed
<xclite> shevy: that's what I said an hour ago!
<Synthead> shevy: yeah, I uninstalled open4 too and bam
adeponte has joined #ruby
<Synthead> xclite: hahaha ... I was "testing"
<shevy> yeah open4 has popen4 specific code
fantazo has joined #ruby
Foxandxss has joined #ruby
mxweas_ has joined #ruby
<shevy> hmm
<shevy> or perhaps not
<shevy> lib/open4.rb: alias open4 popen4
<shevy> just aliases :P
Spooner has quit [Ping timeout: 246 seconds]
<Mon_Ouie> You said it printed "INFO: gem "…" isn't installed", that doesn't look like an error message
shadoi has quit [Quit: Leaving.]
mxweas_ has quit [Ping timeout: 240 seconds]
sailias has quit [Quit: Leaving.]
schickung has quit [Quit: schickung]
sailias has joined #ruby
sailias has quit [Client Quit]
jxpx777 has joined #ruby
mxweas_ has joined #ruby
ifnspifn has quit [Ping timeout: 245 seconds]
<moos3> if i do output = var.split('/').last how do i get the string out with out the => nil
eam has quit [Ping timeout: 265 seconds]
<shevy> nil what nil where
fridim__ has joined #ruby
hemanth has quit [Read error: Connection reset by peer]
davidcelis has quit [Ping timeout: 245 seconds]
andrewhl has quit [Remote host closed the connection]
hemanth has joined #ruby
<shevy> output = "moos3/will/conquer/the/world/with/ruby".split('/').last # => "ruby"
<moos3> i'm getting that
<shevy> that's the return value
<shevy> put it into a .rb script and run it, if irb confuses you
ddv is now known as Pope_ddv
<moos3> k
<shevy> or remove puts, in irb
<shevy> ;P
<shevy> then you will get
<shevy> # => ""shibboleth2.xml""
mockra has quit [Remote host closed the connection]
mxweas_ has quit [Ping timeout: 265 seconds]
kirun has joined #ruby
<fowl> moos3, ^
bricker88 has joined #ruby
<bricker88> Can anyone explain this behavior? https://gist.github.com/3013061 That last command, I thought, should make a query
Markvilla has joined #ruby
Pope_ddv is now known as ddv
davidcelis has joined #ruby
davidcelis has quit [Changing host]
davidcelis has joined #ruby
<moos3> fowl thanks
<bricker88> Actually I think I see why that wouldn't be the case maybe - I'm settings an instance variable on the class, not an instance of the class
eam has joined #ruby
<bricker88> maybe?
<fowl> bricker88, you know when you set @ar_records to nil its going to reset to BlogCategory.all
<Mon_Ouie> There is no instance of the class
wobr has joined #ruby
<Mon_Ouie> So BlogCategory.all does get called twice
<bricker88> fowl: Yes, that is what I'm trying to accomplish
<bricker88> fowl: so that I can make a new query next time the ar_records method is called
<fowl> bricker88, blogcategory caches its results?
ph^ has quit [Remote host closed the connection]
mxweas_ has joined #ruby
<fowl> bricker88, def WP::Category.raw_arrecords() @ar_records end
<bricker88> fowl: I'm just storing the results in that instance variable so it doesn't have to make a new query every time - I only reset the variable when I know something has been updated, so that I can make a new request
ryannielson is now known as Twixmix
bosphorus has quit [Remote host closed the connection]
<fowl> bricker88, why dont you start looking up the stack then, if you want it to run a new query you should know where the first query is ran
<fowl> do show-method BlogCategory.all
andrewhl has joined #ruby
<fowl> then kick yourself for not using pry
yannis has joined #ruby
<fowl> assuming that the problem isnt the SQL of course
wobr has quit [Quit: Leaving.]
mxweas_ has quit [Ping timeout: 265 seconds]
qwerxy has quit [Ping timeout: 244 seconds]
mxweas_ has joined #ruby
bradhe has joined #ruby
headius has joined #ruby
mxweas_ has quit [Ping timeout: 246 seconds]
Progster has joined #ruby
Foxandxss has quit [Quit: KVIrc 4.0.4 Insomnia http://www.kvirc.net/]
fearoffish has quit [Ping timeout: 244 seconds]
mxweas_ has joined #ruby
ph^ has joined #ruby
PaciFisT has quit [Quit: Leaving.]
mxweas_ has quit [Ping timeout: 248 seconds]
Axsuul has joined #ruby
bj0ern has quit [Quit: bj0ern]
mxweas_ has joined #ruby
mockra has joined #ruby
shadoi has joined #ruby
JStoker has quit [Excess Flood]
jfoley has joined #ruby
mxweas_ has quit [Ping timeout: 240 seconds]
chienpo has joined #ruby
Xethron_ is now known as Xethron
stickyboot has joined #ruby
Kwpolska has quit [Ping timeout: 252 seconds]
mockra has quit [Remote host closed the connection]
mxweas_ has joined #ruby
PaciFisT has joined #ruby
Targen has joined #ruby
ankakusu has quit [Ping timeout: 245 seconds]
phantasm66 has quit [Quit: *poof*]
elbee19 has joined #ruby
ssa has quit [Ping timeout: 245 seconds]
burgestrand has quit [Ping timeout: 245 seconds]
medik has quit [Remote host closed the connection]
<elbee19> Hello, does anyone use ruby with linux here?
Kwpolska has joined #ruby
jfoley has quit [Quit: jfoley]
_Setsuna_ has joined #ruby
<Hanmac> elbee19 i do
<epochwolf> elbee19: nope, ruby doesn't support linux.
dylank_ has quit [Quit: Leaving]
<rking> It's the connectors.
<epochwolf> :P
mxweas_ has quit [Ping timeout: 246 seconds]
<rking> When you use Ruby on Linux it melts the connectors.
werdnativ has joined #ruby
<rking> No good.
dylank_ has joined #ruby
nachtwandler has joined #ruby
mnaser has quit [Ping timeout: 244 seconds]
<elbee19> Hanmac, I have JUST started learning Ruby. I'm trying to type ("ruby -e puts '22'") on the terminal, but it doesn't show up anything. The same works on the windows command prompt. Am I doing something wrong?
AxonetBE has left #ruby [#ruby]
dylank_ has quit [Client Quit]
JStoker has joined #ruby
eph3meral has joined #ruby
<elbee19> sorry for the ambiguity, I mean I'm typing this > ruby -e puts '22'
mxweas_ has joined #ruby
<Kwpolska> elbee19: what "terminal"?
<elbee19> epochwolf, thank you. You response was immensely helpful :P
bradhe has quit [Read error: Connection reset by peer]
<elbee19> Kwpolska, ubuntu terminal
<Hanmac> elbee19 start irb, its better for learning
bradhe has joined #ruby
ktilcu has left #ruby [#ruby]
<elbee19> Hanmac, yes, irb does work. i was just wondering why this isn't working.
<eph3meral> elbee19, you probably mean gnome-terminal technically
mnaser has joined #ruby
<eph3meral> elbee19, there is no such thing as "ubuntu terminal"
<eph3meral> fyi
bradhe has quit [Read error: Connection reset by peer]
Aaton_off is now known as Aaton
<elbee19> eph3meral, Oh ok. Thank you for the correction. I have barely any experience with Ubuntu, Ruby or IRC actually
Tricks has joined #ruby
bradhe has joined #ruby
<Hanmac> you need this: ruby -e "puts '22'"
<Hanmac> not this: ruby -e puts '22'
v0n has joined #ruby
<elbee19> Hanmac, yes that works. Thank you so much. Damn I feel dumb
cdabba has quit [Quit: Leaving]
<epochwolf> you should
jfoley has joined #ruby
<Hanmac> you are only human :P
* epochwolf takes offense at being called him
<epochwolf> human*
<elbee19> epochwolf, Yes, I reaffirm.
mxweas_ has quit [Ping timeout: 250 seconds]
<graspee> epochwolf: that was epic: you insulted someone, interpreted something as an insult to you when it wasn't directed at you and wasn't an insult and made a typo, all in three lines
kirun_ has joined #ruby
kirun has quit [Ping timeout: 248 seconds]
<epochwolf> graspee: :) I try
<epochwolf> graspee: when someone askes if anyone uses ruby on linux, I can't resist.
jfoley has quit [Client Quit]
<elbee19> asks you meant
<elbee19> :P
kenichi has quit [Remote host closed the connection]
<epochwolf> elbee19: congrats, you have bested me at spelling.
b26 has joined #ruby
cearls has joined #ruby
`brendan has quit [Ping timeout: 240 seconds]
b26 is now known as `brendan
<elbee19> epochwolf, I try
akem has quit [Ping timeout: 246 seconds]
<elbee19> Okay gotta go be human at a few other channels. Hanmac, thanks again. epochwolf , later
* epochwolf watches elbee19
cearls has quit [Client Quit]
ken_barber has quit [Remote host closed the connection]
elbee19 has left #ruby ["Leaving"]
yonggu_ has joined #ruby
mxweas_ has joined #ruby
jianxioy has joined #ruby
linoj has quit [Quit: linoj]
yonggu has quit [Ping timeout: 246 seconds]
maahes has quit [Ping timeout: 240 seconds]
mxweas_ has quit [Ping timeout: 255 seconds]
noganex has joined #ruby
<shevy> epochwolf strike with teeth and claws
mxweas_ has joined #ruby
<epochwolf> shevy: later, I'm on duty right now
<Hanmac> and one time in a month, at newmoon he turns into an windows-user
* epochwolf switches his kvm to the windows machine
bglusman has joined #ruby
exchgr has joined #ruby
<epochwolf> okay, no guild wars updates
akem has joined #ruby
akem has quit [Changing host]
akem has joined #ruby
ephemerian has joined #ruby
Guest53099 has quit [Ping timeout: 240 seconds]
<shevy> lol
<shevy> downgraded to a windows wolf
socomm has quit [Quit: WeeChat 0.3.7]
mdhopkins has joined #ruby
exchgr has quit [Client Quit]
arkiver has joined #ruby
bglusman_ has quit [Ping timeout: 245 seconds]
* epochwolf prefers mac
qwerxy has joined #ruby
<eph3meral> hey windows isn't all bad
<eph3meral> just mostly bad
<epochwolf> eph3meral: I have one machine with Windows 7 just for games.
mxweas_ has quit [Ping timeout: 248 seconds]
Spooner has joined #ruby
workmad3 has joined #ruby
mxweas_ has joined #ruby
schickung has joined #ruby
rafacv has joined #ruby
aszurom has joined #ruby
mxweas_ has quit [Ping timeout: 244 seconds]
<shevy> that's about the only use case left for windows these days
<shevy> with windows 8, they admit their defeat. they no longer shape the desktop world, they FOLLOW the HTML5/CSS/Javascript evolution passively all of a sudden
<eph3meral> heh, actually it *is* the only use case left :P
digitalcakestudi has quit [Ping timeout: 264 seconds]
<shevy> well there are still many of those office-windows users out there
<shevy> but I mean like especially the gamers, are mostly younger folks
<eph3meral> yeah but the office users only really exist because of legacy/tradition
bosphorus has joined #ruby
mxweas_ has joined #ruby
<jstew> Well, there are low income families that can only afford cheap acers too.
<eph3meral> heh, true
cearls has joined #ruby
EzeQL has quit [Ping timeout: 250 seconds]
<eph3meral> and actually there's not much else quite as comprehensive in terms of domain-logon type systems with integrated groupware
* jstew installs linux on his family member's PCs.
<eph3meral> SBS is pretty common in the big financial corps etc
manizzle has joined #ruby
<jstew> Unless they really *need* windows. Most don't and are happy that they don't get viruses.
<eph3meral> yeh, if they don't need/want games, but heck, even if they do, there's a bunch more games for *nix these days
<eph3meral> free to play stuff
TPFC-SYSTEM has quit [Quit: TPFC-SYSTEM]
Spooner has quit [Ping timeout: 246 seconds]
<eph3meral> not the hot titles, but if Cruchy-O's are good enough for your kids, these are too :P
<jstew> Haha! True, very true...
mxweas_ has quit [Ping timeout: 246 seconds]
<jstew> If my 10 year old can use it, so can anyone else. We wrote a game with the ruby gosu library that we presented at a local barcamp. Pretty cool stuff.
arkiver has quit [Quit: Leaving]
<eph3meral> cool
<eph3meral> jstew, have you considered trying logo with him/her?
<eph3meral> jstew, they've got that book, The Great Logo Adventure, totally kids oriented
<jstew> eph3meral: Does logo even exist for modern computers? I started out with that on the commodore 64
<eph3meral> it's pretty powerful too
<eph3meral> yep it does
<eph3meral> there's even a full on 3d asteroids clone, written in logo
<jstew> Sweet! I'm going to check it out.
mxweas_ has joined #ruby
<aszurom> I like turtles
* aszurom seemed the time for that
olrrai has quit [Quit: Saliendo]
<eph3meral> lol
<jstew> I'm just happy that she'll sit down with me at the computer.
<eph3meral> and it was :)
<jstew> haha
<eph3meral> jstew, yeah that's pretty cool, i bet the logo thing could/would be enough of another interesting/fun/easy/different thing that you could get some more mileage out of that tendency in her
digitalcakestudi has joined #ruby
werdnativ_ has joined #ruby
<eph3meral> jstew, the one I remember off the top of my head is UCBLogo
<eph3meral> is kara anything like Karel the Robot?
pk1001100011 has joined #ruby
yannis has quit [Quit: yannis]
<jstew> We started out with kids ruby... It's a full limux distro with hackety hack and a few other cool things.
<jstew> UCBlogo.... Hmm. Evernoting that
andrewhl has quit [Remote host closed the connection]
<eph3meral> jstew, i've mostly played with MSWLogo which is a windows version
workmad3 has quit [Ping timeout: 264 seconds]
<eph3meral> jstew, but I did play with linux versions, there were two I recalled, but only one of them was worth anything or still maintained or recently updated, don't remember exactly
havenn has quit [Remote host closed the connection]
<aszurom> if I have an array and I'm using array.each to iterate through it, and I decide I want to discard the element I'm currently on...?
<eph3meral> jstew, and I think UCBLogo was the good one of the two i played with on linux, but just suffice it to say there's really only two good implementations on linux, UCBLogo is one of em
werdnativ has quit [Ping timeout: 246 seconds]
werdnativ_ is now known as werdnativ
<eph3meral> aszurom, Array#select
<aszurom> can you use that in a sentence?
<Mon_Ouie> I think you want the "next" keyword.
Twixmix has left #ruby [#ruby]
<aszurom> array.each do
<eph3meral> aszurom, sure
mxweas_ has quit [Ping timeout: 246 seconds]
<aszurom> here's what I want to have happen in plain english
Jay_Levitt has joined #ruby
<aszurom> the array is a CSV file
jcromartie has quit [Read error: Connection reset by peer]
<aszurom> so it'll be [a,b,c,d,e,f] for each element
jcromartie has joined #ruby
<eph3meral> aszurom, the documentation for Array#select can be found on this page https://www.google.com/search?q=ruby+array%23select
<aszurom> array[n][columns]
<aszurom> you mean there's not an AOL keyword for it?
andrewhl has joined #ruby
mxweas_ has joined #ruby
bradhe has quit [Remote host closed the connection]
<eph3meral> aszurom, you may prefer Array#delete_if
booginga has joined #ruby
<eph3meral> they're pretty similar
<eph3meral> one works in place, the other doesn't
<aszurom> ok
ukd1 has joined #ruby
<Mon_Ouie> select's in place variant is select!
<Mon_Ouie> (or keep_if with a very small variant)
ukd1 is now known as Guest98274
<eph3meral> keep_if is the same as select!
qwerxy has quit [Quit: offski]
<Mon_Ouie> They don't return the same thing
<eph3meral> ah, nm then
<Mon_Ouie> [1].select!{true} #=> nil
<Mon_Ouie> keep_if always returns the array
schickung has quit [Remote host closed the connection]
<aszurom> yeah, I was debating if I wanted to just step though the file one line at a time and build an array conditionally on the contents of the row, or actually read the whole csv in and then weed out the rows I don't want
abra has quit [Quit: Leaving]
sepp2k has quit [Read error: Connection reset by peer]
fmcgeough has quit [Quit: fmcgeough]
rbanffy_ has quit [Ping timeout: 246 seconds]
apok_ has joined #ruby
cearls has quit [Quit: cearls]
apok has quit [Ping timeout: 248 seconds]
apok_ is now known as apok
rbanffy_ has joined #ruby
ziyadb has left #ruby [#ruby]
ryanf has joined #ruby
fantazo has quit [Remote host closed the connection]
hemanth has quit [Read error: Connection reset by peer]
horrror has joined #ruby
Boohbah has quit [Write error: Connection reset by peer]
hemanth has joined #ruby
nimred_ has quit [Quit: leaving]
nimred has joined #ruby
nimred has quit [Changing host]
nimred has joined #ruby
jfoley has joined #ruby
xaq has joined #ruby
<eph3meral> aszurom, i don't think it matters much
<eph3meral> aszurom, I would personally probably tend to do things in "whole batches" so, read the file entirely
kenichi has joined #ruby
<eph3meral> then, in classic "functional style" map/reduce/etc until you've got what you want
jfischoff has left #ruby [#ruby]
<horrror> which is ruby'st best book?
<horrror> so ror book is required. if there are any recommendations..
davidw has joined #ruby
<eph3meral> horrror, try #rubyonrails
<horrror> and for Ruby?
davidw is now known as Guest45792
<Hanmac> horrror: the best way is to learn ruby frist ... and ror later
<horrror> i know ruby
qwerxy has joined #ruby
<shevy> ack
<shevy> rubyonrails book???
<shevy> horrror, these scary people hide on #rubyonrails
<horrror> and a ruby book?
<horrror> for reference
Targen has quit [Ping timeout: 240 seconds]
zamn has joined #ruby
<zamn> hey how would i go about setting up a timer in ruby
nyuszika7h has quit [Quit: WeeChat 0.3.9-dev]
<shevy> horrror the pickaxe book is ok
hakunin is now known as cheeseplus_bot
<zamn> well, what can i use
cheeseplus_bot is now known as hakunin
<shevy> zamn define timer. Thread.new { loop { sleep 1; puts 'zamn is doing fun with ruby' } }.join
twinturbo_ has joined #ruby
noganex has quit [Ping timeout: 264 seconds]
noganex has joined #ruby
<zamn> well i guess that leads into my second question
<zamn> what is the scope of a Thread
<zamn> meaning if I define a thread (like above) inside of a class can it access the classes instance variables?
<heftig> sure
<zamn> heh okay
twinturbo has quit [Ping timeout: 264 seconds]
twinturbo_ is now known as twinturbo
<zamn> im used to java where you have to make a whole new class that overrides the Thread interface *just* to make a new thread :p
<heftig> the closure you give to the thread is its context
werdnativ has quit [Quit: werdnativ]
plastics has joined #ruby
akem has quit [Quit: Forget progress by proxy. Land on your own moon.]
mxweas_ has quit [Ping timeout: 246 seconds]
invsblduck has quit [Quit: Lost terminal]
dnyy has joined #ruby
mxweas_ has joined #ruby
jfoley has quit [Quit: jfoley]
Sheehan has quit [Quit: Sheehan]
<zamn> heftig: what do you mean the closure
<zamn> i was asking about instance variables
manizzle has quit [Remote host closed the connection]
workmad3 has joined #ruby
timonv has joined #ruby
<yfeldblum> zamn, blocks, procs, and lambdas are also known as "closures"
<zamn> since when were lambdas also known as closures
<yfeldblum> zamn, closures in ruby have a `self`, which is how instance variables are found, so if you give a block to Thread.new, that block's self will be the self of whatever created it
werdnativ has joined #ruby
<yfeldblum> zamn, in ruby they are, since they close over the local scope
Sheehan has joined #ruby
Markvilla has quit [Ping timeout: 244 seconds]
mucker has quit [Quit: leaving]
<yfeldblum> http://en.wikipedia.org/wiki/Closure_(computer_science) ... this describes ruby's blocks, procs, and lambdas (which are all really the same thing anyway)
neku is now known as neku|away
nyuszika7h has joined #ruby
mxweas_ has quit [Ping timeout: 244 seconds]
horrror has quit [Quit: horrror]
vlad_starkov has quit [Remote host closed the connection]
manizzle has joined #ruby
ghanima has joined #ruby
mxweas_ has joined #ruby
bradhe has joined #ruby
jfoley has joined #ruby
hemanth has quit [Read error: Connection reset by peer]
hemanth has joined #ruby
fulmato has quit [Ping timeout: 245 seconds]
<moos3> how can i execute something and get the exit code
EzeQL has joined #ruby
neku|away is now known as neku
<zamn> what does `blahrg` return
mjb2k has joined #ruby
mxweas_ has quit [Ping timeout: 265 seconds]
<zamn> the output of the command?
<zamn> i think so
<zamn> if you want the exit code just do `command; echo $?`
maahes has joined #ruby
<moos3> k
<heftig> er, no
<moos3> that seems very bashy
<moos3> not very ruby like
<heftig> just `command` or system("command")
<heftig> afterwards, the exit code is in the ruby variable $?
<moos3> so output = $? ?
mxweas_ has joined #ruby
mnaser has quit [Ping timeout: 245 seconds]
<moos3> system("mycommand_of_awesomeness") output = $? if output == 0 blah else blah balh end
<Hanmac> yfeldblum: it depends on the function with gets the block ... and each { p self} does have a different scope then an instance_eval { p self}
mnaser has joined #ruby
krusty_ar has quit [Read error: Connection reset by peer]
<yfeldblum> Hanmac, yes, you can after-the-fact change aspects of the block's closed-over scope before executing it
<yfeldblum> Hanmac, however, when the block is created, it also gets attached to it the lexical scope of local variables and self
<yfeldblum> Hanmac, which you can then change if you like
lxsameer has joined #ruby
Gavilan has joined #ruby
mxweas_ has quit [Ping timeout: 252 seconds]
krusty_ar has joined #ruby
<heftig> moos3: output = $?.exitstatus
AtoxHybrid has joined #ruby
monkegjinni has joined #ruby
mxweas_ has joined #ruby
werdnativ has quit [Remote host closed the connection]
qwerxy has quit [Quit: offski]
Markvilla has joined #ruby
werdnativ has joined #ruby
qwerxy has joined #ruby
rook_flood has joined #ruby
headius has quit [Quit: headius]
<moos3> heftig thanks
timonv has quit [Remote host closed the connection]
mxweas_ has quit [Ping timeout: 248 seconds]
`damien has joined #ruby
lxsameer has quit [Ping timeout: 244 seconds]
tds has joined #ruby
<tds> where is #methods defined? it's not defined on Object…
mxweas_ has joined #ruby
oliwer has quit [Ping timeout: 272 seconds]
nanderoo has quit [Quit: Leaving.]
<workmad3> tds: probably on Kernel
<davidcelis> already checked Kernel
<tds> workmad3: it's not… i checked
<heftig> tds: no, on Object
<heftig> Object.public_instance_methods(false).include?(:methods) # => true
<tds> not in the API though?
<heftig> huh?
<tds> or docs i should say
<tds> on ruby-doc
neku is now known as neku|away
<davidcelis> The docs don't say where or how it's defined
LBRapid has quit [Quit: Computer has gone to sleep.]
<workmad3> tds, davidcelis: pry says it's on Kernel
<tds> also heftig
<tds> 1.9.3p194 :049 > Object.public_instance_methods(false).include?(:methods)
<tds> => false
<tds> how are we getting a different result…
mxweas_ has quit [Ping timeout: 255 seconds]
<heftig> hrm, must be my IRB
<workmad3> tds: 1.8.7 vs 1.9.3?
<tds> that could be it
neku|away is now known as neku
<heftig> ...right.
<heftig> ruby -ve 'p Kernel.instance_methods(false).include?(:methods)'
<heftig> ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
<heftig> true
<tds> i'm on 1.9.3
<workmad3> Kernel.public_instance_methods(false).include?(:methods) #=> true
mxweas_ has joined #ruby
jxpx777 is now known as jxpx777|afk
<workmad3> ah, as heftig just said :)
qwerxy has quit [Quit: offski]
<davidcelis> I get false on 1.8.7
<workmad3> davidcelis: with Object, or with Kernel?
<davidcelis> False on 1.9.3 as well
<davidcelis> for Object
<workmad3> davidcelis: 1.9.3 says kernel (as does pry)
<davidcelis> Kernel's true
<tds> yeah, i get true for kernel, false for object
<tds> interesting
<davidcelis> Why don't the docs mention #methods?
<tds> it's not in the docs for kernel
<workmad3> no, it's probably in the docs for Object
<davidcelis> just said it wasnt bro
<tds> it's not in the docs for either :/
<workmad3> ah, fair enough
<davidcelis> can't find #methods anywhere in the docs
<tds> really strange
<tds> the docs are normally quite thorough
ph^ has quit [Remote host closed the connection]
kenichi has quit [Remote host closed the connection]
aszurom has quit [Quit: Leaving]
jianxioy has quit [Quit: leaving]
ph^ has joined #ruby
cakehero has quit [Quit: Computer has gone to sleep.]
lorandi has quit [Quit: Leaving]
Morkel has joined #ruby
mxweas_ has quit [Ping timeout: 248 seconds]
<shevy> did they forgot to document it?
<shevy> it should reside in Kernel?
fermion has quit [Quit: P]
<shevy> object.c: rb_define_method(rb_mKernel, "methods", rb_obj_methods, -1);
<workmad3> I'm guessing just not docced
<shevy> class.c:rb_obj_methods(int argc, VALUE *argv, VALUE obj)
lxsameer has joined #ruby
lxsameer has quit [Changing host]
lxsameer has joined #ruby
<tds> weird
<shevy> " Returns a list of the names of public and protected methods of "
<shevy> class.c has the rdoc docu though
<Mon_Ouie> All that's missing is the /* in class.c */ comment
<`damien> Hey all! I'm trying to figure out how to profile the memory usage of rake task, has anyone done this before?
<Mon_Ouie> to make rdoc find the method
pk1001100011 has quit [Quit: I've got a feeling there's a fish in the floor; I'd better squish it or he'll swim out the door; Sometimes they take me for a walk in the sun; I see my fish and I have to run]
wpaulson has joined #ruby
ph^ has quit [Ping timeout: 240 seconds]
<workmad3> Mon_Ouie: haha
<shevy> hmm but it has the /* does it not?
jstew has quit [Quit: leaving]
rowanu has quit [Remote host closed the connection]
<Mon_Ouie> Yeah, the method is documented, but RDoc doesn't know in what file it is defined, since it's not object.c
mxweas_ has joined #ruby
<Mon_Ouie> So it needs a /* in class.c */ comment to know where to look for it
<shevy> aha
<shevy> I am going to file a bug report
lxsameer has quit [Ping timeout: 245 seconds]
<tds> haha
<workmad3> just like singleton_methods on the line below :)
lxsameer has joined #ruby
<shevy> hmm noone will need that :P
<workmad3> shevy: methods on the singleton class... not a singleton :P
nachtwandler has quit [Quit: leaving]
<unixabg> As a follow up on my webrick and imagamagick I have working as root and fails as regular user to img.write
timonv has joined #ruby
headius has joined #ruby
<unixabg> I have checked permissions and the webrick instance can write other files. So I am not sure how to debug this.
<Hanmac> what is very freaky: the singleton class of an object can have a singleton class too :P
cpruitt has joined #ruby
<unixabg> Any ideas on how I can debug this webrick issue?
mxweas_ has quit [Ping timeout: 245 seconds]
<xclite> unixabg: I scrolled up but couldn't find it -what's the issue?
Foxandxss has joined #ruby
havenn has joined #ruby
<unixabg> xclite: thank you so much for the response. mom and I will get a paste for you
mxweas_ has joined #ruby
workmad3 has quit [Ping timeout: 244 seconds]
lxsameer has quit [Ping timeout: 240 seconds]
vlad_starkov has joined #ruby
<unixabg> That is the code that works in my webrick instance if I run as root. However if I run as non privlaged user I get that error.
adeponte has quit [Remote host closed the connection]
<tds> Hanmac: just realized today that they are infinitely recursive
internet_user has quit [Remote host closed the connection]
<unixabg> xclite: with ruby 1.8.7 (2010-08-16 patchlevel 302) [x86_64-linux]
<xclite> unixabg: what other files did you check against? it looks like you're writing right into root, which is generally not gonna work unless you have sudo permissions
qwerxy has joined #ruby
SeanLazer has quit [Quit: SeanLazer]
vlad_starkov has quit [Remote host closed the connection]
<unixabg> xclite: that was just sample example, I can do things like FileUtils.touch('/var/lib/ifetch-tools/touchfile.txt')
<unixabg> and FileUtils.mkdir('/var/lib/ifetch-tools/v1')
prometheus has quit [Read error: Connection reset by peer]
al-ol has quit [Remote host closed the connection]
mxweas_ has quit [Ping timeout: 255 seconds]
<xclite> unixabg: can you paste me the results of "ls -l /"
<xclite> ?
digitalcakestudi has quit [Ping timeout: 240 seconds]
<xclite> I suspect your user has write permissions to /var but not /path
wpaulson has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
mxweas_ has joined #ruby
MrGando has joined #ruby
<unixabg> xclite: why would it allow me to touch files and mkdir in the /var/lib/ifetch-tools folder?
MrGando has quit [Client Quit]
Goles has joined #ruby
emmanuelux has joined #ruby
<unixabg> xclite: here is a ls of the /var/lib/ folder with the ifetch-tools folder drwxr-xr-x 4 ifetch-tools ifetch-tools 4096 Jun 28 15:52 ifetch-tools/
<unixabg> I have spent some time testing and I do not think it is a permission issue on the folder, but something with rmagick/imagemagick.write.
mrbrdo has joined #ruby
<xclite> unixabg: you didn't make those while sudod? with the same permissions i get permission denied with file.mkdir
<xclite> fileutils.mkdir
rafacv has quit [Read error: Connection reset by peer]
mxweas_ has quit [Ping timeout: 246 seconds]
fbernier has quit [Ping timeout: 264 seconds]
mxweas_ has joined #ruby
workmad3 has joined #ruby
Xethron has quit [Ping timeout: 252 seconds]
Eiam has joined #ruby
<unixabg> as default user I can create dirs and touch files in the /var/lib/ifetch-tools folder. But the img.write() call only seems to work as root
Xethron has joined #ruby
<unixabg> as normal user gives:
<unixabg> delegate failed `"ffmpeg" -v -1 -mbd rd -trellis 2 -cmp 2 -subcmp 2 -g 300 -pass 1/2 -i "%M%%d.jpg" "%u.%m" 2> "%Z"' @ error/delegate.c/InvokeDelegate/1061
ryanf has quit [Read error: Connection reset by peer]
lxsameer has joined #ruby
lxsameer has quit [Changing host]
lxsameer has joined #ruby
ryanf has joined #ruby
<unixabg> xclite: I am running with --debug to get extra output, is there some other way to get even more detials about error?
Xethron_ has joined #ruby
mxweas_ has quit [Ping timeout: 265 seconds]
prometheus has joined #ruby
<xclite> unixabg: I can't think of any other useful approaches to take at this point :\
khakimov has joined #ruby
timonv has quit [Remote host closed the connection]
<unixabg> xclite: ok. Please know that I appreciate your assistance and if you think of something else please ping.
mxweas_ has joined #ruby
Morkel has quit [Quit: Morkel]
neku has quit [Ping timeout: 265 seconds]
td123 has quit [Read error: Connection reset by peer]
Xethron_ has quit [Ping timeout: 264 seconds]
ph^ has joined #ruby
azm has joined #ruby
azm has quit [Changing host]
azm has joined #ruby
`damien has quit [Quit: `damien]
lxsameer has quit [Ping timeout: 255 seconds]
Jay_Levitt has quit [Quit: Linkinus - http://linkinus.com]
QKO_ has joined #ruby
lxsameer has joined #ruby
lxsameer has quit [Changing host]
lxsameer has joined #ruby
ebanoid has quit []
lxsameer has quit [Client Quit]
mxweas_ has quit [Ping timeout: 246 seconds]
Xethron_ has joined #ruby
Spooner has joined #ruby
rippa has quit [Ping timeout: 246 seconds]
QKO has quit [Ping timeout: 265 seconds]
mxweas_ has joined #ruby
invsblduck has joined #ruby
Xethron_ has quit [Ping timeout: 245 seconds]
qwerxy has quit [Quit: offski]
ghanima has quit [Read error: Operation timed out]
mxweas_ has quit [Ping timeout: 246 seconds]
<unixabg> xclite: wait maybe I am asking the wrong things, what would be an alternate way to take a set of jpeg files to a mpeg file?
Xethron_ has joined #ruby
<unixabg> I am only using rmagick since it is handy, if I had another method then I could perhaps overcome this issue.
adeponte has joined #ruby
ghanima has joined #ruby
qwerxy has joined #ruby
mxweas_ has joined #ruby
qwerxy has quit [Client Quit]
dankest has quit [Quit: Leaving...]
hemanth has quit [Read error: Connection reset by peer]
hemanth has joined #ruby
tintin has joined #ruby
khakimov has quit [Quit: Textual IRC Client: www.textualapp.com]
<tintin> Hi
QKO has joined #ruby
havenn has quit [Remote host closed the connection]
mxweas_ has quit [Ping timeout: 245 seconds]
QKO_ has quit [Read error: Operation timed out]
Xethron_ has quit [Ping timeout: 248 seconds]
plastics has quit [Ping timeout: 240 seconds]
mxweas_ has joined #ruby
tatsuya_o has joined #ruby
Xethron_ has joined #ruby
geekbri has quit [Remote host closed the connection]
monkegjinni has quit [Remote host closed the connection]
mxweas_ has quit [Ping timeout: 246 seconds]
heftig has quit [Quit: leaving]
davidcelis has quit [Read error: Connection reset by peer]
rook_flood has quit [Quit: bye~~]
bradhe has quit [Remote host closed the connection]
ortho_stice has quit [Quit: Leaving.]
davidcelis has joined #ruby
mxweas_ has joined #ruby
<tintin> Anyone?
strnx has quit [Excess Flood]
<Spooner> Ask your question, if you have one :)
kenichi has joined #ruby
<workmad3> Spooner: no... don't say that to tintin... don't open the can of worms!
<workmad3> I mean... hi tintin :P
strnx has joined #ruby
schovi has joined #ruby
khakimov has joined #ruby
booginga has quit [Quit: Leaving]
* apeiros_ hands Spooner pandoras box
yxhuvud has quit [Ping timeout: 250 seconds]
<apeiros_> enjoy!
<Spooner> I'll shut up next time :P
<tintin> lol
td123 has joined #ruby
heftig has joined #ruby
havenn has joined #ruby
<workmad3> Spooner: it's ok... if you close it quick enough you can trap all our hope!
<apeiros_> Spooner: just don't forget - *if* you open it, at least look down to the bottom… where the the hope lies…
<apeiros_> damit :D
mxweas_ has quit [Ping timeout: 240 seconds]
<Spooner> Seems like a lot of trouble. Opening and closing it all by myself. *ponders how many rubyists it takes to use Pandora's box safely*
mxweas_ has joined #ruby
joshman_ has quit [Ping timeout: 265 seconds]
fridim__ has quit [Ping timeout: 264 seconds]
<tintin> lol
Guest98274 has quit [Ping timeout: 244 seconds]
mxweas_ has quit [Ping timeout: 265 seconds]
<apeiros_> Spooner: 7
s0ber_ has joined #ruby
mxweas_ has joined #ruby
QKO_ has joined #ruby
s0ber has quit [Read error: Connection reset by peer]
avandenhoven has joined #ruby
s0ber_ is now known as s0ber
fridim__ has joined #ruby
stkowski has quit [Quit: stkowski]
tintin has left #ruby [#ruby]
qwerxy has joined #ruby
bradhe has joined #ruby
ben_alman has quit [Excess Flood]
qwerxy has quit [Client Quit]
QKO has quit [Ping timeout: 244 seconds]
kevinbond has joined #ruby
mxweas_ has quit [Ping timeout: 246 seconds]
mxweas_ has joined #ruby
bglusman has quit [Remote host closed the connection]
zamn has quit [Quit: leaving]
`brendan has quit [Quit: - nbs-irc 2.39 - www.nbs-irc.net -]
cearls has joined #ruby
mxweas_ has quit [Ping timeout: 252 seconds]
mengu has joined #ruby
wvms has joined #ruby
bglusman has joined #ruby
balki_ has joined #ruby
mpereira has quit [Ping timeout: 244 seconds]
Criztian has joined #ruby
mxweas_ has joined #ruby
balki has quit [Read error: Operation timed out]
bglusman has quit [Read error: Connection reset by peer]
bglusman has joined #ruby
ben_alman has joined #ruby
bglusman has quit [Read error: Connection reset by peer]
bglusman has joined #ruby
workmad3 has quit [Ping timeout: 248 seconds]
blacktulip has quit [Remote host closed the connection]
jfoley has quit [Remote host closed the connection]
jfoley has joined #ruby
bglusman_ has joined #ruby
axl_ has joined #ruby
bglusma__ has joined #ruby
andrewhl has quit [Remote host closed the connection]
schovi has quit [Remote host closed the connection]
bglusma__ has quit [Read error: Connection reset by peer]
mxweas_ has quit [Ping timeout: 248 seconds]
bglusma__ has joined #ruby
ph^ has quit [Remote host closed the connection]
bglusm___ has joined #ruby
mxweas_ has joined #ruby
bglusman has quit [Ping timeout: 248 seconds]
ph^ has joined #ruby
axl__ has quit [Ping timeout: 244 seconds]
bglusm___ has quit [Read error: Connection reset by peer]
axl_ has quit [Read error: Connection reset by peer]
Guest45792 has quit [Read error: Operation timed out]
mpereira has joined #ruby
bglusman has joined #ruby
bglusman_ has quit [Ping timeout: 240 seconds]
axl_ has joined #ruby
azm has quit [Ping timeout: 250 seconds]
dv310p3r has quit [Ping timeout: 245 seconds]
werdnativ_ has joined #ruby
olrrai has joined #ruby
axl__ has joined #ruby
jgarvey has quit [Quit: Leaving]
bglusma__ has quit [Ping timeout: 240 seconds]
Xethron has quit [Ping timeout: 246 seconds]
ukd1 has joined #ruby
Xethron has joined #ruby
ukd1 is now known as Guest35107
mxweas_ has quit [Ping timeout: 252 seconds]
ph^ has quit [Ping timeout: 246 seconds]
bglusman has quit [Ping timeout: 240 seconds]
werdnativ has quit [Ping timeout: 246 seconds]
mxweas_ has joined #ruby
werdnativ_ has quit [Ping timeout: 252 seconds]
axl_ has quit [Ping timeout: 252 seconds]
axl__ is now known as axl_
eywu has left #ruby [#ruby]
havenn has quit [Remote host closed the connection]
richo has quit [Ping timeout: 260 seconds]
wilmoore has quit [Remote host closed the connection]
Guest35107 has quit [Ping timeout: 240 seconds]
ph^ has joined #ruby
mxweas_ has quit [Ping timeout: 264 seconds]
fridim__ has quit [Ping timeout: 264 seconds]
asobrasil has left #ruby [#ruby]
mxweas_ has joined #ruby
eam has quit [Ping timeout: 264 seconds]
adeponte has quit [Remote host closed the connection]
jgrevich has quit [Read error: Connection reset by peer]
teratoma has joined #ruby
jgrevich has joined #ruby
ph^ has quit [Ping timeout: 246 seconds]
kirun_ has quit [Quit: Client exiting]
kevinbond has quit [Quit: kevinbond]
jxpx777|afk is now known as jxpx777
peregrine81 has joined #ruby
mxweas_ has quit [Ping timeout: 265 seconds]
hadees has joined #ruby
kpshek has quit []
uris has quit [Quit: leaving]
mxweas_ has joined #ruby
eam has joined #ruby
kevinbond has joined #ruby
ckrailo has quit [Quit: Leaving...]
ckrailo has joined #ruby
Criztian has quit [Ping timeout: 246 seconds]
mxweas_ has quit [Ping timeout: 246 seconds]
chson has quit [Remote host closed the connection]
seanstickle has joined #ruby
SyntaxNode has joined #ruby
mxweas_ has joined #ruby
hadees has quit [Quit: hadees]
azm has joined #ruby
azm has quit [Changing host]
azm has joined #ruby
cearls has quit [Quit: cearls]
jxpx777 is now known as jxpx777|afk
saneshark has joined #ruby
mxweas_ has quit [Ping timeout: 265 seconds]
<saneshark> Is there a way for a subclass which inherits from a superclass to add a method to the superclass? something like def self.class.METHODNAME ?
thecreators has joined #ruby
mxweas_ has joined #ruby
<saneshark> i want to avoid using class variables, but not sure there is a more elegant way
qwerxy has joined #ruby
philips has quit [Excess Flood]
<cirwin> saneshark: you can get at the super-class with self.ancestors
<cirwin> it's probably nicer to do that at method invocation time, and not define a method
<cirwin> (self.class.ancestors even)
qwerxy has quit [Client Quit]
jarred has joined #ruby
pu22l3r has quit [Ping timeout: 264 seconds]
philips has joined #ruby
<apeiros_> saneshark: sounds like a design flaw. seriously.
mjb2k has quit [Quit: Leaving]
<jarred> What method can I read query string options from using Sinatra? I tried params (like in RoR) but it's throwing a "can't convert nil to Hash" exception
<saneshark> so lets say i'm writing a blackjack application , and Dealer and Player both inherit from User… I should be able to get Player.dealers_first_card -- just pull that value without being able to modify it
gregorg_taf has joined #ruby
gregorg has quit [Read error: Connection reset by peer]
mxweas_ has quit [Ping timeout: 248 seconds]
theRoUS has quit [Ping timeout: 240 seconds]
<saneshark> I could I suppose abstract it out into a separate "Game" class, but this coding challenge specifically says User should be able to view Dealer's initial card… so i can't think of a better way of doing that
panzi has quit [Quit: ChatZilla 0.9.88.2 [Firefox 13.0/20120605112324]]
DrShoggoth has quit [Quit: Leaving]
mxweas_ has joined #ruby
<saneshark> cirwin: i agree with you on design flaw… this is not the approach i would take, i'd create a separate game class
eurbach has quit [Quit: Leaving.]
Progster has quit [Ping timeout: 244 seconds]
td123 has quit [Ping timeout: 264 seconds]
apeiros_ has quit [Remote host closed the connection]
qwerxy has joined #ruby
fbernier has joined #ruby
mxweas_ has quit [Ping timeout: 252 seconds]
hunglin1 has joined #ruby
hunglin1 has quit [Client Quit]
hunglin has quit [Ping timeout: 244 seconds]
pk1001100011 has joined #ruby
ben_alman has quit [Excess Flood]
awarner has quit [Remote host closed the connection]
QKO has joined #ruby
mxweas_ has joined #ruby
fbernier has quit [Ping timeout: 250 seconds]
QKO_ has quit [Ping timeout: 245 seconds]
ben_alman has joined #ruby
RudyValencia has joined #ruby
ryanf has quit [Read error: Connection reset by peer]
werdnativ has joined #ruby
ryanf has joined #ruby
saneshark has quit [Quit: saneshark]
cpruitt has quit [Quit: cpruitt]
fulmato has joined #ruby
richo has joined #ruby
richo has joined #ruby
richo has quit [Changing host]
Cong has joined #ruby
jimeh has quit [Ping timeout: 264 seconds]
mxweas_ has quit [Ping timeout: 250 seconds]
liuchong has joined #ruby
qwerxy has quit [Quit: offski]
richo has quit [Client Quit]
ringotwo has quit [Remote host closed the connection]
mxweas_ has joined #ruby
kenichi has quit [Remote host closed the connection]
saneshark has joined #ruby
jxpx777|afk is now known as jxpx777
kevinbond has quit [Quit: kevinbond]
tewecske has quit [Quit: Leaving.]
hadees has joined #ruby
trend has quit [Ping timeout: 252 seconds]
mxweas_ has quit [Ping timeout: 255 seconds]
AtoxHybrid has quit [Remote host closed the connection]
rbanffy_ has quit [Quit: Ex-Chat]
trend has joined #ruby
jarray52 has joined #ruby
Vendethiel has quit [Quit: je ne suis plus là, tqvu]
mxweas_ has joined #ruby
malcolmva has quit [Quit: Leaving]
jrist is now known as jrist-afk
malcolmva has joined #ruby
malcolmva has quit [Client Quit]
liuchong has quit [Quit: Leaving]
malcolmva has joined #ruby
jxpx777 is now known as jxpx777|afk
Cong has quit [Quit: You don't get to see what version I have.]
Enekoos has joined #ruby
minijupe has quit [Quit: minijupe]
jxpx777|afk is now known as jxpx777
khakimov has quit [Quit: Computer has gone to sleep.]
wpaulson has joined #ruby
SQLStud has quit [Quit: Leaving]
fantazo has joined #ruby
fulmato has quit [Ping timeout: 245 seconds]
Cicloid has joined #ruby
mxweas_ has quit [Ping timeout: 246 seconds]
jxpx777 is now known as jxpx777|afk
mxweas_ has joined #ruby
iaj has quit [Ping timeout: 260 seconds]
saneshark_ has joined #ruby
axiak has quit [Quit: leaving]
vladiim has joined #ruby
axiak has joined #ruby
tatsuya_o has quit [Remote host closed the connection]
saneshark has quit [Ping timeout: 240 seconds]
axiak has quit [Client Quit]
axiak has joined #ruby
ghanima has quit [Ping timeout: 244 seconds]
twinturbo has quit [Quit: twinturbo]
Goles has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
vladiim has quit [Client Quit]
niklasb has quit [Read error: Operation timed out]
baroquebobcat has quit [Quit: baroquebobcat]
saneshark_ has quit [Ping timeout: 246 seconds]
bradhe has quit [Remote host closed the connection]
saneshark has joined #ruby
savage- has joined #ruby
mrbrdo has quit [Quit: mrbrdo]
digitalcakestudi has joined #ruby
rasmusth has joined #ruby
nari_ has joined #ruby
iaj has joined #ruby
Nisstyre has quit [Read error: Connection reset by peer]
techhelp has quit [Quit: This computer has gone to sleep]
<rasmusth> can I define reader and writer attributes to use a different variable name, than the attribute name?
<rasmusth> if I for instance want my variable to be called _my_var
<rasmusth> but the reader to be my_var
bradhe has joined #ruby
wpaulson has quit [Read error: Connection reset by peer]
savage-_ has quit [Ping timeout: 246 seconds]
wpaulson has joined #ruby
Goles has joined #ruby
xaq has quit [Remote host closed the connection]
univers has joined #ruby
qwerxy has joined #ruby
beneggett has joined #ruby
vladiim has joined #ruby
Nisstyre has joined #ruby
azm has quit [Ping timeout: 255 seconds]
bijan0770 has joined #ruby
fulmato has joined #ruby
nwest has joined #ruby
qwerxy has quit [Client Quit]
gtuckerkellogg has joined #ruby
<shadoi> don't do that.
<shadoi> You can define whatever methods you want though.
kvirani has quit [Remote host closed the connection]
<shadoi> attr* are just convenience methods
dbgster has joined #ruby
<saneshark> General logic related question for something I have to write: Given that Dealer < User, how do you interpret "As a User I can see what card the dealer is showing"
<teratoma> how would i generate this by iterating over the list here?
<Gavilan> Dealer < User? what does that mean?
<saneshark> class Dealer inherits from class User
<Gavilan> saneshark: Why?
LBRapid has joined #ruby
<davidcelis> ...?
<davidcelis> Why not?
explody has joined #ruby
jarray52 has left #ruby [#ruby]
<Gavilan> davidcelis: Because there are probably best designs...
<saneshark> because the rest of the things i'm told to write have led me to interpret that Dealer is a subclass of User class, inherits from
Chryson has joined #ruby
LBRapid has quit [Client Quit]
wpaulson has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
<davidcelis> Gavilan: and what makes you think that this is a bad design?
<saneshark> otherwise in my opineion, it doesn't make sense for a more abstract class to need to know details of it's descendant
<Gavilan> saneshark: What does a Dealer do? What does an User do?
<Gavilan> davidcelis: Do you know what a Code Smell is?
<saneshark> scroll down to Simplified Blackjack
<davidcelis> Gavilan: yes, I know what code smell is
<saneshark> it's all common sense and logical to me, and i've implemented everything -- but i can't figure out how to do that one statement without introducing "class variables" <--- something i prefer to avoid
jfoley has quit [Quit: jfoley]
<davidcelis> Gavilan: Just explain; I'm a developer too. If for some reason I don't understand a term you use, I'll ask
bwlang has joined #ruby
prometheus has quit [Remote host closed the connection]
Sheehan has quit [Quit: Sheehan]
bradhe has quit [Remote host closed the connection]
<saneshark> to me all the User related methods i need to create appear to indicate that Dealer and Player should inherit from User… except for the one that says User, should be able to see Player's first card
Sheehan has joined #ruby
<saneshark> am I missing something from a logical standpoint?!?
flype has joined #ruby
mxweas_ has quit [Ping timeout: 264 seconds]
<saneshark> maybe it's a typo? i can't imagine they want me to write bad code -- it's an awful pattern to have a parent class access subclass methods, and the alternative of using class variables isn't much better, especially since it would need to be initialized to some arbitrary value in the parent class
tchebb1 has joined #ruby
Foxandxss has quit [Quit: KVIrc 4.0.4 Insomnia http://www.kvirc.net/]
mxweas_ has joined #ruby
<Gavilan> snapcase: The dealer and players shouldn't know what cards they got....
chson has joined #ruby
ianbrandt has quit [Quit: ianbrandt]
<saneshark> Gavilan: yes, player should be able to see dealer's initial card (that's how blackjack works).
<Gavilan> davidcelis: It's a code smell because a Dealer is a temporary role... A user it's more "permanent" in that context...
<Gavilan> saneshark: That's how blackjack works, but not how you should model it in a PC...
<davidcelis> Gavilan: Ah that's a good point
centipedefarmer has joined #ruby
bijan0770 has left #ruby [#ruby]
<Gavilan> saneshark: Why dealer shouldn't be a user? because a user seems to mean a Person... an a Dealer isn't a person...
skinny_m has joined #ruby
<Gavilan> in that game... the tests suggest it's automatic, and he stays at 17...
tds_ has joined #ruby
<Gavilan> BTW: you should also contemplate the fact that in an other "context" the dealer might be a user...
<saneshark> Gavilan: I totally agree with you, but wouldn't you interpret the statement "As a User I can see what card the dealer is showing" as meaning something to the effect of @player.dealers_first_card @user.dealers_first_card?
<Gavilan> You may have a lot of players, and a dealer, and you could change who the users are, and who are pc simulated...
tds has quit [Ping timeout: 265 seconds]
tds_ is now known as tds
<Gavilan> saneshark: No... What about if you have multiple games?
<Gavilan> with the same dealer and players at the same time?
<Gavilan> The "state" of the game... Should be "variables" of the game...
<Gavilan> Not the state of the player, nor the dealer...
<saneshark> Gavilan: yes i agree, but the only way to do that would be to have a class variable for what the dealers shown card is, right?
tchebb has quit [Ping timeout: 260 seconds]
<saneshark> Gavilan: this is a stupid exercise in my opinion, there has to be a type in that statement
<saneshark> I assumed, they want me to write a TEST for each of these statements, and then get those tests to pass
<saneshark> if i do that, i will have to introduce some pretty awful design, so what the hell are quizzing me on? my ability to write shitty code?
pk1001100011 has quit [Ping timeout: 245 seconds]
<saneshark> which leads me to believe it is a typo, but maybe i'm missing something!??
<Gavilan> saneshark: Why not do a "Great design"?
<saneshark> Gavilan: this is what i prefer, naturally. :)
oooPaul has quit [Quit: Ciao for now!]
Sheehan has quit [Quit: Sheehan]
<saneshark> Gavilan: I just want to make sure that i'm not misinterpreting the directions here… i'm about to create a Game class, and within the Game class my instances of Dealer and Player are set so to me it would be fine to just do @dealer.show_top_card
<saneshark> no reason to have @player.show_dealers_top_card
bolowni has joined #ruby
<saneshark> and if they tell me i did it wrong, i'll tell them that i wanted to avoid using class variables
SeanLazer has joined #ruby
minijupe has joined #ruby
minijupe has quit [Client Quit]
fulmato has quit [Remote host closed the connection]
<saneshark> Gavilan:but for curiosity sake, if you were to interpret and write this code, would you do it the way I'm proposing or is there some other interpretation or approach I should consider?
tds has quit [Ping timeout: 252 seconds]