apeiros changed the topic of #ruby to: Ruby 2.0.0-p247: http://ruby-lang.org (Ruby 1.9.3-p448) || Paste >3 lines of text on http://gist.github.com || this channel is logged at http://irclog.whitequark.org, other public logging is prohibited
slash_nick has quit [Ping timeout: 240 seconds]
<s2013> why cant the ruby programmer get a wife?
<s2013> cause he treats everyone like objects
pen has joined #ruby
pdimitrov has joined #ruby
<volty> it is allo about my nose (that usually captures smells quite well) and about statistics on ppl asking questions that I find to be a bit 'too vague', 'too vergin-like'
<s2013> muahhahaha :-\
mojjojo has quit [Quit: Leaving]
<volty> s2013: no, it's about typing, women do not like to be 'typed'
<s2013> hehehe
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
freezey has joined #ruby
baroquebobcat has joined #ruby
zcreative has joined #ruby
<dec> the thing I'm really struggling with, with Ruby, is - where are the official docs that define these basics? i.e. how do modules, classes, namespaces, etc. work?
<volty> there are plenty of tutorials and books around
DrOwl has quit [Read error: Connection reset by peer]
<s2013> how does ruby know which file a class is in
<volty> shevy (that is now after the damn «caller» :) ) has good urls for beginners
Soda has joined #ruby
bean__ has joined #ruby
predator217 has joined #ruby
tkuchiki has joined #ruby
Naoe-Kanno has quit [Quit: ネウロイを負かさなきゃならないね]
<dec> so I've looked through a bunch of tutorials - but they're all interpretations. Is there a Ruby spec that defines how this works?
freezey has quit [Ping timeout: 245 seconds]
<volty> ah! here we are! You are kinda scientist.
<volty> pleased to meet you :)
predator117 has quit [Ping timeout: 245 seconds]
DrOwl has joined #ruby
`Chris`_ has joined #ruby
julian-delphiki has quit [Ping timeout: 272 seconds]
narcan has joined #ruby
pen has quit [Remote host closed the connection]
Flashmasterson has joined #ruby
<Flashmasterson> i'm not sure why the variable 'likes' and 'lives' have to be plural but the variable 'computer' doesn't, in order for this gist to work https://gist.github.com/Flashmasterson/7189439
`Chris` has quit [Ping timeout: 268 seconds]
baroquebobcat has quit [Quit: baroquebobcat]
hiroyuki has quit [Read error: Connection reset by peer]
<popl> Flashmasterson: I'm not sure I understand your question.
<Flashmasterson> shouldn't it be 'like' and 'live'? to match the questions?
<Flashmasterson> i'll try to rephrase it...
<popl> your variables are likes, lives, and computer
<volty> likes is third person, not plural
<popl> your variables are not like, live, nor computers
<Flashmasterson> i know
<volty> (he is asking grammar questions :) )
<Flashmasterson> forget the computer question
<volty> the likes is plural (noun), he likes is singular, third person (verb)
<Flashmasterson> why aren't the variables 'like' and 'live' instead of 'likes' and 'lives'? that would match the puts'
<ShellFu> So I did some refactoring on my method based off some comments this morning. Functionally the same, but am curious if I has properly refactored using the extract method. Original: >http://pastebin.com/ZjQGfKVJ< New: >http://pastebin.com/sqDDBHzL<
SilverKey has quit [Quit: Sleep now]
<popl> because you didn't call them like and live
<ShellFu> More comments welcome before I carry this through to the rest of my methods
jonathanwallace has quit [Ping timeout: 260 seconds]
nazty has quit [Ping timeout: 245 seconds]
baroquebobcat has joined #ruby
<popl> s/call/name/
<Flashmasterson> popl: right but when i do, the gist doesn't work
<popl> Flashmasterson: what do you mean by "doesn't work"?
<volty> could we have entered another dimension, a kind of broken matrix ? :)
<Flashmasterson> crap, no i messed with another detail by mistake - sorry about that. changing them to 'like' and 'likes' work too, which is odd to me
<popl> :P
kvirani has quit [Remote host closed the connection]
<Flashmasterson> popl: yeah...
<volty> Odd New World
thesheff17 has joined #ruby
SilverKey has joined #ruby
<Flashmasterson> ok, a clearer question: why does the program work when the variables don't match exactly with what's in the puts'? likes and lives for example
lukec has joined #ruby
<dec> I seriously don't understand what I'm doing wrong here: https://gist.github.com/tomlanyon/7189402
jonr22 has joined #ruby
<dec> how do I define/call a module method? (*not* a class instance method)
ecksit has joined #ruby
<volty> Flashmasterson: choose one of these: 1) you need a rest, 2) you need to stop trolling
<popl> Flashmasterson: that's the same code
AlSquire has quit [Quit: This computer has gone to sleep]
yfeldblum has quit [Remote host closed the connection]
SteveBen_ has joined #ruby
thesheff17 has quit [Read error: Connection reset by peer]
mneorr has joined #ruby
yfeldblum has joined #ruby
thesheff17 has joined #ruby
<volty> dec step back and post it in eval.in
<dec> volty: it's OK, I figured out you need to call 'module_function :sym' to define the function as a module function.
<Flashmasterson> popl: sorry, here https://gist.github.com/Flashmasterson/7189602
<popl> that doesn't work
<volty> dec: yes, but please, eval.in from now on --- correcting there requires much less typing
<popl> foo.rb:19:in `<main>': undefined local variable or method `likes' for main:Object (NameError)
<popl> (I saved it as foo.rb)
<dec> volty: the topic tells me to gist...
jonr22 has quit [Ping timeout: 272 seconds]
baroquebobcat has quit [Quit: baroquebobcat]
<dec> volty: but no problem, will do.
ecksit has quit [Client Quit]
<Flashmasterson> right, but the variables match the puts', so that doesn't make sense to me
<popl> volty: gist is fine :P
<popl> what?
<popl> what do you mean Flashmasterson?
<popl> the text in the string?
pen has joined #ruby
<popl> that's just part of the string dude
<Flashmasterson> yes, sorry
Nilium has quit [Ping timeout: 245 seconds]
<popl> are you trolling or what?
MattB2 has quit [Ping timeout: 250 seconds]
freerobby has joined #ruby
earthquake has quit [Quit: earthquake]
<Flashmasterson> pop no man i'm just a noob who doesn't get it
baroquebobcat has joined #ruby
<volty> this is a job for shevy, #ruby-noobs :)
pen has quit [Remote host closed the connection]
<popl> #{likes} # the identifier is like, not likes, so ruby is going to generate an error when it cannot find the variable likes
mneorr has quit [Ping timeout: 272 seconds]
pen has joined #ruby
<popl> this is not indicative of a ruby-specific problem
<popl> Flashmasterson: Is ruby your first programming language?
matchaw has quit [Remote host closed the connection]
<Flashmasterson> popl: yeah other than that i know nothing
pencilcheck has joined #ruby
<Flashmasterson> i have the well grounded rubyist and am working on ruby the hard way
pr0ggie has quit [Read error: Operation timed out]
baroquebobcat has quit [Client Quit]
slash_nick has joined #ruby
<volty> thinking at first - I bet :)
<volty> Flashmasterson: what would be the 'easy way'?
baroquebobcat has joined #ruby
<Flashmasterson> volty: no i mean this http://ruby.learncodethehardway.org/book/
<davidcelis> he means the book
<davidcelis> learn ruby the hard way
SteveBen_ has quit [Remote host closed the connection]
<popl> volty: now you're trolling.
pr0ggie has joined #ruby
<Flashmasterson> voltty: people keep recommending i try that before going into the well grounded rubyist
<volty> ah! thx davidcelis // no book there 'Learn Ruby The Easy Way'?
<popl> maybe you'd like why's guide. that is a more gentle introduction to some of the basic concepts of programming in general.
<davidcelis> why's guide is an awful learning guide
pdimitrov has quit [Ping timeout: 248 seconds]
<Flashmasterson> terrific
<davidcelis> great literature, but far too obtuse to be a real learning tool
pen has quit [Ping timeout: 240 seconds]
jonathanwallace has joined #ruby
pdimitrov has joined #ruby
mercwithamouth has quit [Ping timeout: 265 seconds]
mixel has quit [Quit: mixel]
<volty> popl: we go in turn, ahahah
<popl> volty: we might as well exist on different planes. :P
mercwithamouth has joined #ruby
pherryman_ has quit [Ping timeout: 240 seconds]
matchaw has joined #ruby
ninegrid has joined #ruby
<volty> of course, i'm open for all possibilities -- nothing is excluded
agjacome has quit [Quit: leaving]
pherryman_ has joined #ruby
baroquebobcat has quit [Ping timeout: 240 seconds]
<volty> (except the scientist)
<volty> but where's shevy?
<popl> Flashmasterson: In any programming language, when you use an identifier (also called a variable), you must remember that it's just a symbol. if you change one part of that symbol (e.g. change «like» to «likes») then the computer is utterly lost.
<popl> computers are dumb.
goleldar has quit [Remote host closed the connection]
goleldar has joined #ruby
<volty> look Flashmasterson, if you tell to your mother «please, give me a check» she won't give you a cheque
baroquebobcat has joined #ruby
<Flashmasterson> i donn't get it
<Flashmasterson> *don't
<popl> what part?
pencilcheck has quit [Remote host closed the connection]
<Flashmasterson> what volty said
the_TORmentor has joined #ruby
the_TORmentor has left #ruby [#ruby]
<popl> forget what volty said.
baroquebobcat has quit [Client Quit]
<volty> it must be your mother's fault if you do not get it
<Flashmasterson> the variable link is clear, i feel confident with my basic understanding of what a variable is
<popl> volty: dude, you aren't helping
<volty> i'm helpless :)
ninegrid has quit [Ping timeout: 265 seconds]
<Flashmasterson> i'm sorry i just don't get why the program i gisted still runs when the identifiers don't match what's in the string
zcreative has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
hogeo has joined #ruby
fuleo has quit [Remote host closed the connection]
<popl> it doesn't
ninegrid has joined #ruby
fuleo has joined #ruby
goleldar has quit [Ping timeout: 240 seconds]
<popl> I just showed you the error message proving it didn't run.
<Flashmasterson> but this does https://gist.github.com/Flashmasterson/7189728
<popl> Flashmasterson: Do you mean something different? Do you understand that text inside a string is generally just treated as data?
<Flashmasterson> ah! no i don't
<Flashmasterson> i thought that was important if there is a variable or identifier with the same phrase
sepp2k1 has quit [Quit: Leaving.]
baroquebobcat has joined #ruby
<popl> not unless you are doing a substitution like you are in MESSAGE, e.g. «#{likes}» in which case it _must_ match the name of the variable you are using
<popl> otherwise it's just text
devoldmx has quit [Read error: Connection reset by peer]
devoldmx has joined #ruby
dbruns has joined #ruby
<popl> because in that substitution, you are inserting the _contents_ of the variable likes into that heredoc
dec has left #ruby [#ruby]
baroquebobcat has quit [Client Quit]
<Flashmasterson> hmm
ninegrid has quit [Ping timeout: 252 seconds]
Davey has quit [Quit: Computer has gone to sleep.]
jonathanwallace has quit [Ping timeout: 246 seconds]
ninegrid has joined #ruby
<popl> >> name = "Flashmasterson"; msg = "My name is #{name} as I am so named."; puts msg # #{name} is the only thing that is associated with "Flashmasterson" inside of msg
<eval-in> popl => My name is Flashmasterson as I am so named. ... (https://eval.in/57921)
jhn has joined #ruby
<popl> &
popl has quit [Quit: We must make an idol of our fear, and call it God.]
starfox21 has quit [Quit: starfox21]
popl has joined #ruby
popl has joined #ruby
popl has quit [Changing host]
gr33n7007h has quit [Ping timeout: 252 seconds]
samfisher has quit [Ping timeout: 251 seconds]
<davidcelis> >> name = 'davidcelis'; puts "My name is #{my_name}";
<eval-in> davidcelis => undefined local variable or method `my_name' for main:Object (NameError) ... (https://eval.in/57922)
Nilium has joined #ruby
<Flashmasterson> popl: that makes more sense
danshultz has joined #ruby
<Flashmasterson> davidcelis' just confused me again, because the variable is 'name', which doesn't match the identifier 'my_name'
<popl> which is why you get the error
<davidcelis> exactly. that's why it raised an error
<Flashmasterson> oh oh ok
<davidcelis> i never defined something called "my_name", so you get "undefined local variable or method `my_name' "
<popl> I have to go watch Walking Dead now.
<volty> >> like = "What have I done to you, oh the mightiest of the mightiests?"; p [defined? like, defined? likes, :hell]
<eval-in> volty => ["local-variable", nil, :hell] ... (https://eval.in/57925)
<volty> (and you go into hell if you ask what is doing that :hell there)
burlyscudd has joined #ruby
<Flashmasterson> hmm
<volty> stop with that 'hmm' --- I have the impression to talk to frankestin's creature
narcan has quit [Ping timeout: 272 seconds]
ewokchewy has quit [Remote host closed the connection]
pen has joined #ruby
sevenseacat has joined #ruby
freezey has joined #ruby
zipper has joined #ruby
mrsolo has quit [Quit: This computer has gone to sleep]
starfox21 has joined #ruby
<zipper> >> "abbccc az"[/az*/]
<eval-in> zipper => "a" (https://eval.in/57926)
<Flashmasterson> volty: i can't i'm too curious. Frankenstein didn't have that problem
<atmosx> I saw "man of steel". I want 2 hours of my life back (thank God I was compiling in the meantime)
<zipper> Isn't the above regexp supposed to evaluate to "" since we are looking for a "a" followed immediately by a "z"?
<atmosx> How can they waste so much money on a movie and make it so bad, it's beyond me.
slash_nick has quit [Quit: leaving]
<|jemc|> zipper: it matches anywhere in the string
<|jemc|> if you want it anchored to the start, ise ^
<|jemc|> s/ise/use
<zipper> If we wanted an a or a z it should've been `"abbccc az"[/[az*]/]`
<|jemc|> >> "abbccc az"[/^az*/]
<eval-in> |jemc| => "a" (https://eval.in/57927)
<atmosx> and there's another anchor for end $ or something, but he has a *
<atmosx> which means that other chars are about to follow
devoldmx has quit [Read error: Connection reset by peer]
<|jemc|> ha, that didn't work how I expected
devoldmx3 has joined #ruby
_dma has quit [Remote host closed the connection]
<atmosx> expect the unexpected
<zipper> |jemc|: If I were to use ^ that is just looking for a at the start of the line
<|jemc|> volty has it, use plus instead of *
freezey has quit [Ping timeout: 272 seconds]
<|jemc|> I thought you were saying you only wanted to match at the start of the line
<zipper> |jemc|: No I want to match an "a" followed directly by a "z"
<atmosx> for ruby regexp use http://rubular.com
<|jemc|> >> "abbccc az"[/az/]
<eval-in> |jemc| => "az" (https://eval.in/57931)
ludar has quit [Ping timeout: 246 seconds]
<|jemc|> there's an 'a' directly followed by a 'z' right there
<atmosx> yeap
<|jemc|> what were you expecting the * to do?
<atmosx> off to bed, I am
<atmosx> ll
<atmosx> bb
<zipper> Ok a lot of this hardly makes sense because I had understood/believed differently and I still do.
atmosx has quit [Quit: Lost in trance]
havenwood has quit [Remote host closed the connection]
<zipper> I even reinstalled ruby thinking that my interpreter had issues until I tried it with this bot.
<|jemc|> how are you epecting the match to behave?
jlast has joined #ruby
<zipper> |jemc|: I expected it not to match "az" because the "az" is after the whitespace.
Davey has joined #ruby
<zipper> |jemc|: I expected it to return blank
filipski has joined #ruby
<|jemc|> it doesn't care about the whitespace
v0n has quit [Ping timeout: 245 seconds]
<|jemc|> the whitespace is just another character that isn't 'a', from the perspective of the regexp parser
<|jemc|> and furthermore, it matches the original 'a' first anyway
<zipper> On tutorialspoint it reads: re* Matches 0 or more occurrences of preceding expression.
<|jemc|> because /az*/ is an 'a' followed by 0 or more 'z's
<zipper> The preceeding expr is az
<|jemc|> the first a meets that requirement, followed by 0 'z's
<|jemc|> ah
<zipper> |jemc|: wow makes sense
<zipper> Thanks man
<|jemc|> >> "abbccc az"[/(az)*/]
<eval-in> |jemc| => "" (https://eval.in/57935)
<zipper> or woman
<zipper> :P
<|jemc|> heheh
Levin_22 has quit [Quit: Levin_22]
<|jemc|> but I should point out
<|jemc|> if you are looking for zero or more (az)s
`Chris` has joined #ruby
<|jemc|> with nothing else attached
<zipper> |jemc|: go on
<|jemc|> it will always match the imaginary space at the start of the string that contains zero of the expression (az)
Spami has quit [Quit: This computer has gone to sleep]
<|jemc|> well, unless the first letters are az
`Chris`_ has quit [Ping timeout: 245 seconds]
<zipper> imaginary space?
<|jemc|> >> "anything" =~ /(az)*/
<eval-in> |jemc| => 0 (https://eval.in/57936)
<|jemc|> >> "anything" =~ /az/
<eval-in> |jemc| => nil (https://eval.in/57937)
<|jemc|> in the first case, it matches the 0th index, because it satisfies the requirement of zero (az)s
KobraKao has joined #ruby
postmodern has joined #ruby
mrsolo has joined #ruby
<|jemc|> in the second case, the match is nil because nothing satisfies the requirement of one (az)
mercwithamouth has quit [Ping timeout: 272 seconds]
<|jemc|> note that in both cases with your string indexing, you will get an empty string returned
<|jemc|> >> "anything"[/az/]
<eval-in> |jemc| => nil (https://eval.in/57942)
narcan has joined #ruby
<|jemc|> ha, scratch that last part
<zipper> Wow I am learning a lot here.
<|jemc|> but the above point stands
<zipper> Thanks again.
<|jemc|> no problem
timonv has joined #ruby
Spami has joined #ruby
<zipper> just saw the words ruby 1.9.3. I'm still on 1.8 from ubuntu repos. :C
noobpants has joined #ruby
<zipper> If only I was on arch.
noobpants has left #ruby [#ruby]
<zipper> bye and thanks
zipper has quit [Quit: bedtime]
<|jemc|> go ahead and get 2.0
<|jemc|> doh
<volty> gone -- too much ahead :)
yfeldblum has quit [Ping timeout: 245 seconds]
thatRD has joined #ruby
hamakn has quit [Remote host closed the connection]
hamakn has joined #ruby
dbruns has quit [Quit: dbruns]
matchaw has quit [Remote host closed the connection]
thatRD has quit [Client Quit]
timonv has quit [Ping timeout: 246 seconds]
jonathanwallace has joined #ruby
Guest76733 has joined #ruby
dkamioka has joined #ruby
lbwski has joined #ruby
starfox21 has quit [Quit: starfox21]
Xeago has quit [Remote host closed the connection]
matchaw has joined #ruby
mneorr has joined #ruby
hamakn has quit [Ping timeout: 245 seconds]
DanKnox is now known as DanKnox_away
burlyscudd has quit [Quit: Leaving.]
baroquebobcat has joined #ruby
jhn has quit [Quit: jhn]
mneorr has quit [Ping timeout: 272 seconds]
ewokchewy has joined #ruby
burlyscudd has joined #ruby
petey_ has joined #ruby
<Guest76733> Hey guys, got time for a quick Rails question?
<volty> #rubyonrails
<sam113101> we're all ready
<Guest76733> I've been trying to use a module in one of my models
<Guest76733> like so
mrsolo has quit [Quit: This computer has gone to sleep]
burlyscudd has quit [Client Quit]
<Guest76733> "comparison_type" => Telnyx::Comparison.guess_type(upload.path)
<Guest76733> It's giving me an error: uninitialized constant Upload::Telnyx
sergicles_ has joined #ruby
TheMoonMaster has quit [Excess Flood]
ewokchewy has quit [Client Quit]
danshultz has quit [Remote host closed the connection]
sergicles has quit [Ping timeout: 245 seconds]
sergicles_ is now known as sergicles
sergicles has quit [Remote host closed the connection]
danshultz has joined #ruby
TheMoonMaster has joined #ruby
dkamioka has quit [Remote host closed the connection]
<Guest76733> The module I'm using is under /lib/Telnyx/comparison.rb and I've tried editing application.rb under config to set config.autoload_paths += %W(#{config.root}/lib)
dkamioka has joined #ruby
petey_ has quit [Ping timeout: 272 seconds]
Guest76733 is now known as swash
earthquake has joined #ruby
Domon has joined #ruby
danshult_ has joined #ruby
danshultz has quit [Ping timeout: 268 seconds]
sergicles has joined #ruby
dkamioka has quit [Ping timeout: 245 seconds]
frustrum has joined #ruby
<swash> Any thoughts? I'm a little new to Rails and Googling didn't turn up much
nari has joined #ruby
Clooth has quit [Quit: Leaving...]
<sevenseacat> #rubyonrails
Domon has quit [Ping timeout: 272 seconds]
hamakn has joined #ruby
salt_ has joined #ruby
ixti has quit [Quit: WeeChat 0.4.2]
<salt_> is the #rubyonrails room down?
tatsuya_o has joined #ruby
<|jemc|> is your nick registered with NickServ?
<salt_> maybe not?
<volty> >> :rails_question? && '#rubyonrails'
<eval-in> volty => "#rubyonrails" (https://eval.in/57945)
<sevenseacat> its not down, we're all there quite happily.
kaspergrubbe has quit [Read error: Connection reset by peer]
kaspergr_ has joined #ruby
<|jemc|> register with NickServ
<volty> /msg nickserv help register
Jetchisel has left #ruby ["Unfortunately time is always against us -- *Morpheus*"]
<volty> #
lbwski has quit [Ping timeout: 246 seconds]
danshult_ has quit [Remote host closed the connection]
<salt_> will do
<salt_> thanks!
lbwski has joined #ruby
danshultz has joined #ruby
tatsuya_o has quit [Ping timeout: 265 seconds]
Olipro has quit [Ping timeout: 260 seconds]
dakotaben has quit [Ping timeout: 246 seconds]
pen has quit [Remote host closed the connection]
Jetchisel has joined #ruby
Es0teric has joined #ruby
Domon has joined #ruby
narcan has quit [Ping timeout: 272 seconds]
<shevy> what is the way to query if a method exists
nateberkopec has quit [Quit: Leaving...]
pkrnj has quit [Ping timeout: 268 seconds]
<volty> method_defined?
danshultz has quit [Ping timeout: 248 seconds]
<volty> on class, respond_to? - on object
randomnick_ has quit [Quit: Leaving]
baroquebobcat has quit [Quit: baroquebobcat]
swash has quit [Quit: Leaving]
dbruns has joined #ruby
dbruns has quit [Client Quit]
nwertman_ has joined #ruby
freezey has joined #ruby
earthquake has quit [Quit: earthquake]
<shevy> method_defined? ?
freezey has quit [Read error: Connection reset by peer]
<shevy> oh
<shevy> is there a way to trace back where a method was defined? like in a module or in a class
nateberkopec has joined #ruby
t_p has joined #ruby
<volty> yes, walking through ancestors
salt_ has left #ruby [#ruby]
<volty> wait, what do you mean by 'where'?
Jetchisel has quit [Quit: Unfortunately time is always against us -- *Morpheus*]
burlyscudd has joined #ruby
`Chris`_ has joined #ruby
nari has quit [Ping timeout: 272 seconds]
`Chris` has quit [Ping timeout: 272 seconds]
<shevy> like
Jetchisel has joined #ruby
<shevy> >> module Foo; def foo; puts 'hi from foo'; end; end; class Test; include Foo; def bar; puts 'hi bar'; end; end; Test.new
<eval-in> shevy => #<Test:0x40d70d80> (https://eval.in/57948)
<shevy> to trace the origina of foo() and bar()
<shevy> *origin
<shevy> ah well
<shevy> I think I need to get some sleep soon, my brain is only functioning at 2%
<volty> good idea, good night
dweeb_ has joined #ruby
<volty> if you go bellow 2 % you will not be able to know that it is functioning bellow 2 % :)
<volty> gn
volty has quit [Quit: Konversation terminated!]
jonr22 has joined #ruby
ecksit has joined #ruby
ngoldman has joined #ruby
kevinykchan has joined #ruby
vpretzel has joined #ruby
burlyscudd has quit [Ping timeout: 246 seconds]
vpretzel has quit [Remote host closed the connection]
jonathanwallace has quit [Ping timeout: 245 seconds]
vpretzel has joined #ruby
<ecksit> so i am getting started with begin/rescue/raise in ruby and i am not quite sure how to rewrite something like https://gist.github.com/jacobbednarz/c7c6433958e88adbf260. can anyone offer some guidance?
iamjarvo has joined #ruby
dweeb_ has quit [Ping timeout: 245 seconds]
jonr22 has quit [Ping timeout: 240 seconds]
brennanMKE has quit [Remote host closed the connection]
Flashmasterson has quit [Quit: Leaving.]
pen has joined #ruby
burgess has joined #ruby
kil0byte has quit [Remote host closed the connection]
Flashmasterson has joined #ruby
eka has quit [Quit: Computer has gone to sleep.]
kil0byte has joined #ruby
earthquake has joined #ruby
nateberkopec has quit [Quit: Leaving...]
kitak_ has joined #ruby
kitak has quit [Read error: Connection reset by peer]
kil0byte has quit [Ping timeout: 250 seconds]
threesome has quit [Ping timeout: 245 seconds]
<bnagy> rewrite it how?
<bnagy> does that code raise?
einarj has joined #ruby
sergicles has quit [Ping timeout: 252 seconds]
mneorr has joined #ruby
jlast has quit [Remote host closed the connection]
nari has joined #ruby
ewnd9 has joined #ruby
<ecksit> bnagy, nope. i am a little confused around the begin/rescue/raise situation.
<ecksit> here is my attempt at it.
<bnagy> where?
BraddBitt has joined #ruby
<ecksit> so basically, what i need to achieve is that i only want it to assign those values should it not return with an empty assignment.
zz_michael_mbp is now known as michael_mbp
pyx has joined #ruby
pyx has quit [Client Quit]
<bnagy> ok.. first up, never rescue Exception
<ecksit> I read raising "Exception" is bad because it raises everything.
einarj has quit [Ping timeout: 245 seconds]
judd7 has joined #ruby
<ecksit> ah yep. will change that once this actually works. :(
BraddPitt has quit [Ping timeout: 245 seconds]
<ecksit> i have a custom class for it.
sergicles has joined #ruby
mneorr has quit [Ping timeout: 268 seconds]
<bnagy> just saying 'rescue' will rescue anything that inherits StandardError, which is everything that you can usefully rescue
<bnagy> there are other classes, but it's stuff like SystemError which you can't really recover from
<bnagy> so rule of thumb - rescue, by itself or rescue SomeCustomException
<bnagy> neeext - if you can _not_ exception handle, then don't
<bnagy> eg if you can check for an empty response like retval.empty? or whatever, do that, don't use exception handling
freezey has joined #ruby
<bnagy> it's faster and clearer
Senjai has quit [Ping timeout: 248 seconds]
freezey has quit [Read error: Connection reset by peer]
<ecksit> ok, fair call. so my first way is probably better.
<bnagy> so, back to your code, the only thing that might raise is Netrc.read, so _that's_ what you need to wrap in begin // rescue
<bnagy> if it can raise - if it can't then don't
freezey has joined #ruby
<ecksit> cool, thanks
matchaw has quit [Remote host closed the connection]
BraddBitt has quit [Ping timeout: 273 seconds]
astrobunny has quit [Ping timeout: 248 seconds]
BraddBitt has joined #ruby
matchaw has joined #ruby
<bnagy> last thing that might not be obvious - you can rescue multiple times
SteveBenner09 has quit [Quit: Leaving]
<bnagy> begin; rescue SpecificCustomThing; #stuff; rescue OtherThing; #different; rescue #everything else ...
Soda has quit [Read error: Connection reset by peer]
sergicles has quit [Ping timeout: 245 seconds]
sergicles has joined #ruby
sevenseacat1 has joined #ruby
julweber_ has joined #ruby
nfk has quit [Quit: yawn]
astrobunny has joined #ruby
<ecksit> yeah, i have seen a couple of examples like that.
<ecksit> cheers again
sevenseacat has quit [Ping timeout: 245 seconds]
julweber has quit [Ping timeout: 245 seconds]
brennanMKE has joined #ruby
tatsuya_o has joined #ruby
w4pm has joined #ruby
iamjarvo has quit [Remote host closed the connection]
brennanMKE has quit [Ping timeout: 245 seconds]
iamjarvo has joined #ruby
tatsuya_o has quit [Ping timeout: 272 seconds]
Mr_Wharfsnort has quit [Quit: Leaving]
Mr_Wharfsnort has joined #ruby
mary5030 has joined #ruby
iamjarvo has quit [Ping timeout: 260 seconds]
Senjai has joined #ruby
Hanmac1 has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
Spami has joined #ruby
Hanmac has quit [Ping timeout: 272 seconds]
ewnd9 has quit [Remote host closed the connection]
ewnd9 has joined #ruby
xperement has quit [Read error: Connection reset by peer]
danshultz has joined #ruby
fgo has joined #ruby
Mr_Wharfsnort has quit [Ping timeout: 260 seconds]
kaspergr_ has quit [Remote host closed the connection]
kaspergrubbe has joined #ruby
astrobunny has quit [Ping timeout: 272 seconds]
v0n has joined #ruby
danshultz has quit [Ping timeout: 265 seconds]
timonv has joined #ruby
rehat has joined #ruby
sevenseacat has joined #ruby
Levin_22 has joined #ruby
sevenseacat1 has quit [Ping timeout: 268 seconds]
saarinen has joined #ruby
judd7 has quit [Quit: judd7]
kaspergrubbe has quit [Ping timeout: 260 seconds]
kil0byte has joined #ruby
astrobunny has joined #ruby
timonv has quit [Ping timeout: 248 seconds]
echevemaster has joined #ruby
kobain has joined #ruby
Senjai has quit [Remote host closed the connection]
<sam113101> I need to install ruby, how should I do it? rvm? something else?
Senjai has joined #ruby
saarinen has quit [Quit: saarinen]
astrobunny has quit [Ping timeout: 272 seconds]
<sevenseacat> ruby-install?
<jrobeson> sam113101, rvm, rbenv, and chruby (+ ruby-install) are popular choices to manage installed ruby versions
michael_mbp is now known as zz_michael_mbp
<jrobeson> i think rvm is too hacky
allaire has joined #ruby
<sevenseacat> with all the time you've been here, you've never installed ruby? :(
<bnagy> go chruby / ruby-install
<bnagy> rvm be tripping
saarinen has joined #ruby
<bnagy> I like rbenv, and can't be bothered switching, but if I started from now I'd go chruby
nisstyre has joined #ruby
saarinen has quit [Client Quit]
ewnd9 has quit [Ping timeout: 240 seconds]
astrobunny has joined #ruby
kaspergrubbe has joined #ruby
nism-pi has joined #ruby
Mr_Wharfsnort has joined #ruby
mrapple is now known as MonsieurApple
mneorr has joined #ruby
MonsieurApple is now known as mrapple
ninegrid has quit [Ping timeout: 272 seconds]
ninegrid has joined #ruby
pen has quit [Remote host closed the connection]
mneorr has quit [Ping timeout: 245 seconds]
petey_ has joined #ruby
pen has joined #ruby
kil0byte has quit [Ping timeout: 265 seconds]
devoldmx3 has quit [Ping timeout: 265 seconds]
Spami has quit [Quit: This computer has gone to sleep]
rjhunter has joined #ruby
Hganavak has quit [Quit: Leaving]
Spami has joined #ruby
yfeldblum has joined #ruby
freezey has quit [Remote host closed the connection]
yfeldblum has quit [Remote host closed the connection]
yfeldblum has joined #ruby
freezey has joined #ruby
petey_ has quit [Ping timeout: 240 seconds]
Flashmasterson has quit [Quit: Leaving.]
earthquake has quit [Quit: earthquake]
tkuchiki has quit [Remote host closed the connection]
freezey has quit [Ping timeout: 246 seconds]
narcan has joined #ruby
<|jemc|> oh no; just discovered preprocessor token concatenation in c and I'm thinking up all sorts of evil metaprogramming ideas for my c extension...
cads has joined #ruby
pen has quit []
osvico has quit [Ping timeout: 245 seconds]
kaspergrubbe has quit [Remote host closed the connection]
kaspergrubbe has joined #ruby
radic_ has joined #ruby
radic has quit [Disconnected by services]
earthquake has joined #ruby
astrobun_ has joined #ruby
brennanMKE has joined #ruby
KobraKao has left #ruby ["Leaving"]
tatsuya_o has joined #ruby
osvico has joined #ruby
astrobunny has quit [Ping timeout: 252 seconds]
petey_ has joined #ruby
ninegrid has quit [Ping timeout: 260 seconds]
tk___ has joined #ruby
kreeves has quit [Ping timeout: 245 seconds]
kaspergrubbe has quit [Ping timeout: 245 seconds]
ninegrid has joined #ruby
Mr_Wharfsnort has quit [Quit: Leaving]
mobileblue has quit [Ping timeout: 245 seconds]
brennanMKE has quit [Ping timeout: 245 seconds]
petey_ has quit [Client Quit]
tatsuya_o has quit [Ping timeout: 260 seconds]
endash has quit [Quit: endash]
mobileblue has joined #ruby
burgess has quit [Quit: ^zzz]
yfeldblum has quit [Remote host closed the connection]
ananthakumaran has joined #ruby
ananthakumaran has quit [Max SendQ exceeded]
ananthakumaran has joined #ruby
<sam113101> sevenseacat: I'm on a fresh install of ubuntu, and I never liked the way rvm poluted my shell rc files… so I'm just asking for opinions, really
<sevenseacat> cool :) i like chruby, and im still rocking an old version of ruby-build because i set this machine up before ruby-install came out
kvirani has joined #ruby
jonr22 has joined #ruby
kil0byte has joined #ruby
WickedAtMelb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
kvirani_ has joined #ruby
allaire has quit []
kvirani has quit [Read error: Connection reset by peer]
ninegrid has quit [Ping timeout: 245 seconds]
astrobun_ has quit [Ping timeout: 252 seconds]
ninegrid has joined #ruby
jonr22 has quit [Ping timeout: 245 seconds]
Spami has quit [Quit: This computer has gone to sleep]
pr0ggie has quit [Ping timeout: 252 seconds]
pdimitrov has quit [Ping timeout: 272 seconds]
pr0ggie has joined #ruby
Ox6abe has joined #ruby
pdimitrov has joined #ruby
astrobunny has joined #ruby
kobain has quit [Ping timeout: 268 seconds]
Ox6abe has quit [Ping timeout: 245 seconds]
<Nilium> Hahahaha, ruby-ffi is dead, I made the right choice
capicue has quit [Quit: Leaving...]
hiyosi has quit [Ping timeout: 245 seconds]
postmodern has quit [Quit: Leaving]
<sevenseacat> it apparently is indeed
astrobunny has quit [Ping timeout: 265 seconds]
<Nilium> I remember someone telling me I should've used it instead of fiddle, so ha.
<RubyPanther> sam113101: I use rbenv because it does things the simple unix symlink way
MrPoT4tO has joined #ruby
<RubyPanther> (with ruby-build)
mrpot4to_ has joined #ruby
kstephens has quit [Ping timeout: 272 seconds]
kobain has joined #ruby
kobain has quit [Excess Flood]
Guest27688 has joined #ruby
ageis has joined #ruby
Guest27688 has quit [Excess Flood]
kobain_ has joined #ruby
<ageis> I can't compile nokogiri gem. can someone look at my mkmf.log and tell me whats up?
fuleo has quit [Remote host closed the connection]
<RubyPanther> of course, I still have a line of crud in .profile, but it is probably avoidable just by adding the dir to PATH
kobain_ has quit [Excess Flood]
noop has quit [Ping timeout: 248 seconds]
kobain_ has joined #ruby
kobain_ has quit [Excess Flood]
Guest34552 has joined #ruby
fuleo has joined #ruby
Guest34552 is now known as kobain99
s3itz has joined #ruby
lukec has quit [Quit: lukec]
astrobunny has joined #ruby
mrapple is now known as MonsieurApple
MonsieurApple is now known as mrapple
nutella has joined #ruby
nutella is now known as Guest30128
justsee has joined #ruby
Heero has quit [Ping timeout: 240 seconds]
Heero has joined #ruby
ph8 has joined #ruby
astrobunny has quit [Ping timeout: 246 seconds]
Levin_22 has quit [Quit: Levin_22]
mneorr has joined #ruby
thepumpkin has quit [Remote host closed the connection]
narcan has quit [Ping timeout: 240 seconds]
mneorr has quit [Ping timeout: 246 seconds]
astrobunny has joined #ruby
Guest30128 has quit [Ping timeout: 252 seconds]
ngoldman has quit []
end_guy has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
fridim_ has quit [Ping timeout: 240 seconds]
capicue has joined #ruby
bassclef has quit [Ping timeout: 272 seconds]
ntzrmtthihu777 has joined #ruby
larissa has quit [Quit: Leaving]
<ntzrmtthihu777> hey. writing some java code for jruby, needa figure out how to create an instance variable in java; so to that interest could someone point me at a core ruby class/method with them so I can look at the jruby analog
<ntzrmtthihu777> ?
tkuchiki has joined #ruby
brennanMKE has joined #ruby
tatsuya_o has joined #ruby
huttan_ has quit [Ping timeout: 272 seconds]
aspires has joined #ruby
tatsuya_o has quit [Ping timeout: 245 seconds]
brennanMKE has quit [Ping timeout: 272 seconds]
Vaibhav_Rajput has joined #ruby
t_p has quit [Ping timeout: 268 seconds]
timonv has joined #ruby
kaspergrubbe has joined #ruby
aapzak has quit [Ping timeout: 272 seconds]
tomzx_mac has quit [Ping timeout: 240 seconds]
<|jemc|> mri c function is rb_iv_set
c0rn has joined #ruby
<|jemc|> take your pick of a core object source to find in the jruby source
timonv has quit [Ping timeout: 245 seconds]
MisutoWolf has quit [Quit: Leaving]
<|jemc|> but isn't there jruby documentation to look through?
Ripp__ has joined #ruby
fredjean has quit [Quit: Computer has gone to sleep.]
kaspergrubbe has quit [Ping timeout: 272 seconds]
postmodern has joined #ruby
<|jemc|> (that's an honest qeustion, I've never used jruby or tried to write a java extension for it)
aagdbl has joined #ruby
tabolario has joined #ruby
kil0byte has quit [Remote host closed the connection]
zeade has quit [Quit: Leaving.]
dawkirst has joined #ruby
kil0byte has joined #ruby
<ntzrmtthihu777> |jemc|: there is, but it seems to be few and far between
c0rn has quit [Ping timeout: 245 seconds]
<ntzrmtthihu777> |jemc|: you now what, lets put it this way. if I use the code @foo = foo, this creates the instance variable foo right on the spot, right
<ntzrmtthihu777> ?
<|jemc|> in ruby, yes, it creates/assigns to the instance variable @foo
<sam113101> I like the chruby + ruby-install combo so far
<sam113101> 10/
<sam113101> 10, would use again
<|jemc|> does this documentation help you: http://jruby.org/apidocs/org/jruby/RubyBasicObject.html
<ntzrmtthihu777> chruby?
<|jemc|> specifically setInstanceVariable
kil0byte has quit [Ping timeout: 245 seconds]
tkuchiki has quit [Ping timeout: 245 seconds]
Shidash has quit [Quit: Leaving.]
Shidash has joined #ruby
<ntzrmtthihu777> yeah, that takes the format setInstanceVariabl("@foo", foo) using our prior example
<|jemc|> yup
thesheff17 has quit [Ping timeout: 245 seconds]
<ntzrmtthihu777> I was just wondering about something javaside. you declare a variable like this: "int num" or "RubyFixnum foo", I was wondering if i had to do anything strange there to make an instance variable of the type RubyFixnum
mary5030 has quit [Remote host closed the connection]
hiyosi has joined #ruby
BinJoy has joined #ruby
fredjean has joined #ruby
c0rn has joined #ruby
mary5030 has joined #ruby
<|jemc|> as I said, I've never dealt with jruby until just now, but with the knowledge I have
mary5030 has quit [Read error: Connection reset by peer]
<|jemc|> I'd say that the foo in your setInstanceVariable("@foo", foo) would just be of type RubyFixnum
mary5030 has joined #ruby
<|jemc|> and that's how-it-know
<ntzrmtthihu777> |jemc|: so between "RubyFixnum foo" and setInstanceVariable("@foo", foo) I should be fine, then?
<|jemc|> heh, with all my expert jruby knowledge I declare it shall work!
capicue has quit [Ping timeout: 260 seconds]
<ntzrmtthihu777> XD
<ntzrmtthihu777> hey, my knowledge is pretty sparce XD
<ntzrmtthihu777> sparse*
havenwood has joined #ruby
wizard` has joined #ruby
yacks has quit [Quit: Leaving]
<ntzrmtthihu777> |jemc|: also, prolly a stupid rookie question, but is '0' a fixnum?
<|jemc|> >> 0.class
<eval-in> |jemc| => Fixnum (https://eval.in/57951)
freerobby has quit [Quit: Leaving.]
hiyosi has quit [Ping timeout: 252 seconds]
kevinykchan has quit [Ping timeout: 252 seconds]
<|jemc|> might want to verify that in your jruby irb, though
Ox6abe has joined #ruby
<ntzrmtthihu777> because I have a method 'set' that takes 4 fixnums (x, y, height, width) and I'd like to create an 'empty' method that runs set(0, 0, 0, 0), but java doesn't like it :/
mary5030 has quit [Remote host closed the connection]
DanKnox_away is now known as DanKnox
<|jemc|> meh, might want to /join #jruby
mary5030 has joined #ruby
<ntzrmtthihu777> |jemc|: I'm alredy there, but its dead silent :/
ninegrid has quit [Ping timeout: 260 seconds]
burgess has joined #ruby
ninegrid has joined #ruby
Ox6abe has quit [Ping timeout: 272 seconds]
fredjean has quit [Quit: Computer has gone to sleep.]
Monie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mary5030 has quit [Ping timeout: 246 seconds]
ananthakumaran has joined #ruby
Monie has joined #ruby
hashtd has joined #ruby
kvirani_ has quit [Remote host closed the connection]
ejfinneran has joined #ruby
Ox6abe has joined #ruby
ninegrid has quit [Ping timeout: 240 seconds]
rehat has quit [Remote host closed the connection]
havenwood has quit [Remote host closed the connection]
ninegrid has joined #ruby
dawkirst has quit [Ping timeout: 272 seconds]
platypine has quit [Ping timeout: 268 seconds]
mneorr has joined #ruby
SteveBenner9 has joined #ruby
burgess has quit [Quit: ^zzz]
mneorr has quit [Ping timeout: 245 seconds]
nwertman_ has quit [Ping timeout: 245 seconds]
Ox6abe has quit [Remote host closed the connection]
Ox6abe has joined #ruby
astrobunny has quit [Ping timeout: 245 seconds]
tk___ has quit [Quit: ばいばい]
c0rn has quit [Ping timeout: 272 seconds]
capicue has joined #ruby
dawkirst has joined #ruby
mary5030 has joined #ruby
WickedAtMelb has joined #ruby
Ox6abe has quit [Ping timeout: 252 seconds]
mary5030 has quit [Remote host closed the connection]
WickedAtMelb has quit [Max SendQ exceeded]
mary5030 has joined #ruby
Nanuq has quit [Ping timeout: 245 seconds]
tkuchiki has joined #ruby
astrobunny has joined #ruby
kevinykchan has joined #ruby
c0rn has joined #ruby
mary5030 has quit [Ping timeout: 252 seconds]
Monie has quit [Ping timeout: 245 seconds]
jonr22 has joined #ruby
WickedAtMelb has joined #ruby
WickedAtMelb has quit [Max SendQ exceeded]
ntzrmtth1hu777 has joined #ruby
tkuchiki has quit [Ping timeout: 245 seconds]
brennanMKE has joined #ruby
julweber_ has quit [Remote host closed the connection]
tatsuya_o has joined #ruby
julweber has joined #ruby
ntzrmtthihu777 has quit [Ping timeout: 248 seconds]
jonr22 has quit [Ping timeout: 245 seconds]
Nanuq has joined #ruby
rahulkmr has joined #ruby
aspires has quit [Quit: sudo making a sandwich]
fredjean has joined #ruby
brennanMKE has quit [Ping timeout: 268 seconds]
ph8 has quit [Ping timeout: 268 seconds]
Shidash has quit [Quit: Leaving.]
julweber has quit [Ping timeout: 265 seconds]
tatsuya_o has quit [Ping timeout: 272 seconds]
DanKnox is now known as DanKnox_away
Shidash has joined #ruby
kobain99 has quit []
earthquake has quit [Quit: earthquake]
Monie has joined #ruby
astrobunny has quit [Ping timeout: 252 seconds]
earthquake has joined #ruby
huttan has joined #ruby
arturro has joined #ruby
ph8 has joined #ruby
krz has joined #ruby
ntzrmtth1hu777 has quit [Ping timeout: 248 seconds]
fgo has quit [Remote host closed the connection]
astrobunny has joined #ruby
huttan has quit [Ping timeout: 252 seconds]
aspires has joined #ruby
fgo has joined #ruby
DanKnox_away is now known as DanKnox
vpretzel has quit [Remote host closed the connection]
vpretzel has joined #ruby
eject_ck has joined #ruby
osvico has quit [Ping timeout: 245 seconds]
Tearan has quit [Quit: Sleepy Badger....]
`Chris` has joined #ruby
hiyosi has joined #ruby
awarner has joined #ruby
Jeticus has quit []
pdimitrov has quit [Ping timeout: 252 seconds]
pr0ggie has quit [Ping timeout: 252 seconds]
capicue has quit [Ping timeout: 246 seconds]
pr0ggie has joined #ruby
pdimitrov has joined #ruby
sergicles has quit [Quit: sergicles]
awarner_ has quit [Ping timeout: 268 seconds]
WillAmes has quit [Remote host closed the connection]
`Chris`_ has quit [Ping timeout: 272 seconds]
hiyosi has quit [Read error: Operation timed out]
WillAmes has joined #ruby
filipski has quit [Remote host closed the connection]
dayepa has quit [Quit: dayepa]
Spami has joined #ruby
dayepa has joined #ruby
Abs has joined #ruby
apeiros has quit [Read error: Connection reset by peer]
apeiros_ has joined #ruby
cads has quit [Ping timeout: 245 seconds]
cohron has joined #ruby
Shidash has quit [Quit: Leaving.]
Shidash1 has joined #ruby
Abs has quit [Client Quit]
c0rn has quit [Quit: Computer has gone to sleep.]
BinJoy has quit [Quit: 离开]
Shidash1 has quit [Read error: Connection reset by peer]
brtdv has joined #ruby
dawkirst has quit [Quit: Leaving]
habanany has joined #ruby
habanany has quit [Client Quit]
relix has joined #ruby
thepumpkin has joined #ruby
mneorr has joined #ruby
timonv has joined #ruby
hiyosi has joined #ruby
ewnd9 has joined #ruby
ewnd9 has quit [Remote host closed the connection]
ewnd9 has joined #ruby
wereHams1er has joined #ruby
wereHams1er has quit [Changing host]
wereHams1er has joined #ruby
wereHams1er is now known as wereSheep
DonRichie has joined #ruby
cads has joined #ruby
wereSheep is now known as wereHamster|work
thepumpkin has quit [Ping timeout: 272 seconds]
mneorr has quit [Ping timeout: 272 seconds]
tagrudev has joined #ruby
hiyosi has quit [Read error: Operation timed out]
rahulkmr has quit [Ping timeout: 272 seconds]
vpretzel has quit [Remote host closed the connection]
noop has joined #ruby
vpretzel has joined #ruby
falood has joined #ruby
pherryman_ has quit [Read error: No route to host]
pherryman_ has joined #ruby
vpretzel has quit [Ping timeout: 260 seconds]
aspires has quit [Quit: sudo making a sandwich]
tjad has quit [Ping timeout: 260 seconds]
nisstyre has quit [Quit: Leaving]
t_p has joined #ruby
Ox6abe has joined #ruby
kil0byte has joined #ruby
burgess has joined #ruby
rahulkmr has joined #ruby
brennanMKE has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
tatsuya_o has joined #ruby
sayan has joined #ruby
brennanMKE has quit [Read error: Connection reset by peer]
zoee has joined #ruby
Ox6abe has quit [Ping timeout: 268 seconds]
brennanMKE has joined #ruby
brtdv has quit []
DanKnox is now known as DanKnox_away
zz_michael_mbp is now known as michael_mbp
caitp has quit [Ping timeout: 246 seconds]
tatsuya_o has quit [Ping timeout: 252 seconds]
apeiros_ has quit [Remote host closed the connection]
pr0ggie has quit [Read error: Operation timed out]
timonv has quit [Remote host closed the connection]
apeiros has joined #ruby
brennanMKE has quit [Ping timeout: 265 seconds]
michael_mbp is now known as zz_michael_mbp
pdimitrov has quit [Ping timeout: 248 seconds]
apeiros has quit [Ping timeout: 272 seconds]
Vaibhav_Rajput has quit [Ping timeout: 252 seconds]
Vaibhav_Rajput has joined #ruby
kleinerdrache has joined #ruby
roadt__ has quit [Ping timeout: 260 seconds]
Es0teric has quit [Quit: Computer has gone to sleep.]
cohron has quit [Remote host closed the connection]
terlar has joined #ruby
wallerdev has quit [Quit: wallerdev]
s2013 has quit [Quit: Leaving]
vpretzel has joined #ruby
tolman has joined #ruby
Vaibhav_Rajput has quit [Ping timeout: 246 seconds]
Vaibhav_Rajput has joined #ruby
Fire-Dragon-DoL has left #ruby [#ruby]
nfk has joined #ruby
astrobunny has quit [Ping timeout: 268 seconds]
w4pm has quit [Ping timeout: 245 seconds]
tolman has quit [Remote host closed the connection]
ctp has quit [Quit: Leaving...]
Gooder has joined #ruby
werries has joined #ruby
tjad has joined #ruby
s3itz has quit [Quit: Textual IRC Client: www.textualapp.com]
astrobunny has joined #ruby
dr0ff has quit []
adambeynon has joined #ruby
wildroman has joined #ruby
Vaibhav_Rajput has quit [Remote host closed the connection]
tonni_ has quit [Remote host closed the connection]
tonni has joined #ruby
earthquake has quit [Quit: earthquake]
arturro is now known as achru
nkts has quit [Quit: x]
wildroman has quit [Remote host closed the connection]
pyrac has joined #ruby
wildroman has joined #ruby
eject_ck has left #ruby [#ruby]
Astralum has joined #ruby
rahulkmr has quit [Read error: Connection reset by peer]
tonni has quit [Ping timeout: 252 seconds]
mneorr has joined #ruby
pranny has joined #ruby
astrobunny has quit [Ping timeout: 246 seconds]
wildroman has quit [Ping timeout: 272 seconds]
tharindu has joined #ruby
newbiehacker has joined #ruby
kstephens has joined #ruby
hiyosi has joined #ruby
mneorr has quit [Ping timeout: 245 seconds]
jonr22 has joined #ruby
bigkevmcd has joined #ruby
mengu has joined #ruby
mengu has quit [Changing host]
mengu has joined #ruby
astrobunny has joined #ruby
hiyosi has quit [Ping timeout: 263 seconds]
Senjai has quit [Remote host closed the connection]
tonni has joined #ruby
bricker`LA has quit [Ping timeout: 240 seconds]
tjad has quit [Quit: No Ping reply in 180 seconds.]
jonr22 has quit [Ping timeout: 245 seconds]
tjad has joined #ruby
tonni has quit [Read error: Connection reset by peer]
rahulkmr has joined #ruby
aganov has joined #ruby
vpretzel has quit [Ping timeout: 268 seconds]
tjad has quit [Remote host closed the connection]
adambeynon has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
LarsSmit has joined #ruby
huttan has joined #ruby
juniour1 has joined #ruby
<juniour1> hi guys u all there .ruby.bin eats my all cpu resources plz help??
tboerger has joined #ruby
tziOm has joined #ruby
tharindu has quit [Quit: Leaving...]
<canton7> ...are you running a ruby program which is eating your CPU? Try reading your question back to yourself - it contains nothing which might help us help you
user258467 has joined #ruby
<juniour1> canton7 it starts at start up. i alwasy need to kill it. i need it stop it from starup
`Chris` has quit [Read error: Connection reset by peer]
_jery has joined #ruby
<canton7> go on then :)
`Chris` has joined #ruby
tatsuya_o has joined #ruby
<canton7> windows or linux?
<Hanmac1> or Mac?
Hanmac1 is now known as Hanmac
brennanMKE has joined #ruby
huttan has quit [Ping timeout: 272 seconds]
tonni has joined #ruby
kleinerdrache has quit [Quit: Ex-Chat]
brtdv has joined #ruby
fgo has quit [Remote host closed the connection]
tatsuya_o has quit [Ping timeout: 272 seconds]
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
brennanMKE has quit [Ping timeout: 246 seconds]
zz_michael_mbp is now known as michael_mbp
Papipo has joined #ruby
tkuchiki has joined #ruby
<Papipo> Hi there
gr33n7007h has joined #ruby
Xeago has joined #ruby
<Papipo> Do you know if there is any ruby/rack implementation of a HTTP API based on JSON Schema models?
tatsuya_o has joined #ruby
zigomir has joined #ruby
fgo has joined #ruby
tkuchiki has quit [Ping timeout: 245 seconds]
bigmac_ has joined #ruby
kil0byte_ has joined #ruby
sbos99 has joined #ruby
ctp has joined #ruby
h_kon has joined #ruby
dabos has joined #ruby
i8igmac has quit [Ping timeout: 272 seconds]
sbos99 has quit [Client Quit]
kil0byte has quit [Ping timeout: 248 seconds]
jhaals has joined #ruby
|jemc| has quit [Ping timeout: 240 seconds]
tonni has quit [Read error: Connection reset by peer]
kleinerdrache has joined #ruby
ctp_ has joined #ruby
ctp has quit [Read error: Connection reset by peer]
bigmac_ is now known as i8igmac
kleinerdrache has quit [Read error: No route to host]
tharindu has joined #ruby
OdNairy has joined #ruby
jmoeller has joined #ruby
ctp_ has quit [Client Quit]
einarj has joined #ruby
achru has quit [Remote host closed the connection]
crus` has joined #ruby
achru has joined #ruby
crus has quit [Ping timeout: 245 seconds]
drumusician has joined #ruby
tonni has joined #ruby
achru has quit [Ping timeout: 240 seconds]
blaxter_ has joined #ruby
robbyoconnor has quit [Ping timeout: 268 seconds]
robbyoconnor has joined #ruby
coderhs has joined #ruby
dangerousdave has joined #ruby
achru has joined #ruby
burgess has quit [Quit: ^zzz]
leonidlm has joined #ruby
tesuji has joined #ruby
kevinykchan has quit [Ping timeout: 272 seconds]
camilasan has joined #ruby
aapzak has joined #ruby
jhaals has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
camilasan has quit [Remote host closed the connection]
camilasan has joined #ruby
justsee has quit [Ping timeout: 272 seconds]
thepumpkin has joined #ruby
roadt__ has joined #ruby
julweber has joined #ruby
astrobunny has quit [Ping timeout: 268 seconds]
sergicles has joined #ruby
sergicles has quit [Client Quit]
mneorr has joined #ruby
svennidal has joined #ruby
ehaliewi` has joined #ruby
claymore has joined #ruby
hiyosi has joined #ruby
krz has quit [Quit: krz]
kaspergrubbe has joined #ruby
ehaliewicz has quit [Remote host closed the connection]
vpretzel has joined #ruby
tonni has quit [Read error: Connection reset by peer]
mneorr has quit [Ping timeout: 252 seconds]
thepumpkin has quit [Ping timeout: 272 seconds]
TDJACR has quit [Ping timeout: 245 seconds]
fixl has joined #ruby
astrobunny has joined #ruby
sergicles has joined #ruby
sergicles has quit [Client Quit]
utkarsh has left #ruby ["Textual IRC Client: www.textualapp.com"]
justsee has joined #ruby
justsee has quit [Changing host]
justsee has joined #ruby
hiyosi has quit [Ping timeout: 252 seconds]
noname001 has joined #ruby
sergicles has joined #ruby
vpretzel has quit [Ping timeout: 245 seconds]
TDJACR has joined #ruby
popl has quit [Quit: We must make an idol of our fear, and call it God.]
adambeynon has joined #ruby
jhaals has joined #ruby
dayepa has quit [Ping timeout: 265 seconds]
kaspergr_ has joined #ruby
krz has joined #ruby
roadt__ has quit [Quit: 暂离]
timonv has joined #ruby
kaspergrubbe has quit [Ping timeout: 248 seconds]
dayepa has joined #ruby
tonni has joined #ruby
pyrac has quit [Quit: pyrac]
jeffdb has quit [Quit: jeffdb]
rahulkmr has quit [Ping timeout: 272 seconds]
burgess has joined #ruby
timonv has quit [Ping timeout: 252 seconds]
bassclef has joined #ruby
TDJACR has quit [Ping timeout: 245 seconds]
bassclef is now known as Guest88379
aapzak has quit [Ping timeout: 245 seconds]
caitp has joined #ruby
obs has joined #ruby
pixiebit has joined #ruby
<pixiebit> Hello. I was wondering how I could change/add a method to a class I did not write, like to the String class?
julweber has quit [Remote host closed the connection]
<hoelzro> pixiebit: that is highly discouraged.
brennanMKE has joined #ruby
utkarsh has joined #ruby
<pixiebit> I realize this is terrible practice, but I have to do it anyway.
julweber has joined #ruby
<hoelzro> why do you *have* to do it?
<hoelzro> maybe we can help you find a better way of solving your problem!
<pixiebit> For homework.
TDJACR has joined #ruby
<sevenseacat> lol
<tobiasvl> pixiebit: to answer your question, it's very simple, because you do it the same way as adding stuff to other classes.
<tobiasvl> now do your own homework. ;)
sander^work has quit [Ping timeout: 245 seconds]
<pixiebit> Okay but any way you slice it, I have to understand how to add methods to other classes to even attempt it. How will I do that?
<sevenseacat> theres no such thing as 'other classes'
rahulkmr has joined #ruby
<sevenseacat> classes are classes
tatsuya_o has quit [Read error: Connection reset by peer]
caitp has quit [Ping timeout: 272 seconds]
<tobiasvl> pixiebit: as i said, it's done the same way
tatsuya_o has joined #ruby
<Papipo> class String
<Papipo> [stuff]
<Papipo> end
<pixiebit> Sure, but from within a class, or just outside the area you would usually define methods?
<tobiasvl> Papipo: way to handhold
jonathanwallace has joined #ruby
<tobiasvl> pixiebit: what do you mean by that?
brennanMKE has quit [Ping timeout: 240 seconds]
julweber has quit [Ping timeout: 248 seconds]
<Papipo> That you should google instead of ask, I guess
<pixiebit> googling is weird for this question
<sevenseacat> no its not
tonni has quit [Remote host closed the connection]
<Papipo> weird? lol
aapzak has joined #ruby
<pixiebit> If I do class String [methods] end, it erases all the original String methods
<Papipo> does it?
<Papipo> really?
<tobiasvl> pixiebit: what? why do you think that?
<Papipo> have you tried that?
<pixiebit> It does if I don't know that term :)
<sevenseacat> no, it does not
<tobiasvl> there there, people. now that pixiebit has ended up here, we can actually help him/her understand it ;)
<tobiasvl> better than google can, at any rate
<Papipo> why do you think that would erase String methods?
<pixiebit> I tried it and it did
<Papipo> nopes
<Papipo> no way
dawkirst has joined #ruby
<tobiasvl> pixiebit: what exact code did you run?
ludar has joined #ruby
<Papipo> unless there is some ruby implementation I don't know about
leonidlm has quit [Ping timeout: 272 seconds]
nvrch has joined #ruby
ghr has joined #ruby
pyrac has joined #ruby
nomenkun has joined #ruby
burgess has quit [Quit: ^zzz]
codenapper has joined #ruby
<sevenseacat> well that will just generate an error
<pixiebit> right
<sevenseacat> because the class method explode isnt defined
Anticom has joined #ruby
<tobiasvl> pixiebit: the definition is fine. if you run "fsiojgjodjfgf".explode afterwards, it works
<tobiasvl> (that is, it always outputs 4)
jhaals has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Papipo> I think that you need to read some 101 tutorial about ruby
<pixiebit> method explode is defined though
<Papipo> learn its syntax and nuances first
i8igmac has quit [Quit: Leaving]
<pixiebit> i already did
<sevenseacat> apparently not
bigmac has joined #ruby
<Papipo> I don't think so
<Papipo> :)
bigmac is now known as i8igmac
<tobiasvl> pixiebit: there's a big difference between "this is a string instance".explode and String.explode
<Papipo> not properly at least
<pixiebit> ok but
<pixiebit> is there a 101 syntax ruby thing that covers all this
<tobiasvl> this isn't syntax :)
<Papipo> this is ruby basics
<pixiebit> but papipo said
<Papipo> classes and instances
<sevenseacat> surely you arent doing homework for a language you havent been taught anything about
<Papipo> you defined an instance method and called a class method
xk_id has quit [Ping timeout: 272 seconds]
habanany has joined #ruby
habanany has quit [Client Quit]
xk_id has joined #ruby
Azulinho has joined #ruby
ph8 has quit [Ping timeout: 245 seconds]
<Hanmac> pixiebit: if it helps you, you call it like a "static" method, but it is not "static" ... (even ruby does not have a static keyword)
crus` has quit [Quit: ( www.nnscript.com :: NoNameScript 4.22 :: www.esnation.com )]
<krz> what does ruby/rails use as convention. two or one word for file*name
MissionCritical has quit [Ping timeout: 245 seconds]
hashtd has quit [Read error: Connection reset by peer]
crus has joined #ruby
<pixiebit> Maybe I shouldn't try to learn Ruby through validating tests one by one.
yacks has joined #ruby
burgess has joined #ruby
leonidlm has joined #ruby
<pixiebit> Thanks for the help, though. I learned a lot.
jrhe has joined #ruby
kaldrenon has joined #ruby
tonni has joined #ruby
sayan has quit [Ping timeout: 272 seconds]
sevenseacat has quit [Remote host closed the connection]
<tobiasvl> pixiebit: good luck! feel free to ask more questions later
<krz> well?
relix has joined #ruby
timonv has joined #ruby
kaldrenon has quit [Read error: Operation timed out]
astrobunny has quit [Ping timeout: 268 seconds]
jonr22 has joined #ruby
apeiros has joined #ruby
Stygia has joined #ruby
elaptics`away is now known as elaptics
astrobunny has joined #ruby
avril14th has joined #ruby
bartj3 has joined #ruby
<pixiebit> amidoinitrite? http://pastebin.com/wJcmF7nh
tjaco has joined #ruby
rrichardsr3 has joined #ruby
rrichardsr3 has quit [Client Quit]
drumusician has quit [Ping timeout: 272 seconds]
jonr22 has quit [Ping timeout: 265 seconds]
rahulkmr has quit [Ping timeout: 260 seconds]
einarj has quit [Remote host closed the connection]
<Papipo> you need to learn about the map and inject methods
<Papipo> and each
Zai00 has joined #ruby
tonni has quit [Remote host closed the connection]
<Hanmac> in 99.999% of the cases "for .. in .." is bad ruby code
it_tard has joined #ruby
it_tard has joined #ruby
MissionCritical has joined #ruby
tonni has joined #ruby
sayan has joined #ruby
<pixiebit> darn
<Hanmac> but the pun is, for does also works with Enumerators:
<Hanmac> >> for c in "string".each_char; p c; end
<eval-in> Hanmac => "s" ... (https://eval.in/57981)
mneorr has joined #ruby
shaunbaker has joined #ruby
shaunbaker has quit [Remote host closed the connection]
shaunbaker has joined #ruby
tboerger has quit [Quit: leaving]
tboerger has joined #ruby
hiyosi has joined #ruby
huttan has joined #ruby
<tobiasvl> pixiebit: your code is fine procedural programming, but rubyists tend to think a little differently. http://ruby.bastardsbook.com/chapters/loops/#h-2-3
vpretzel has joined #ruby
vpretzel has quit [Read error: Connection reset by peer]
barratt has joined #ruby
vpretzel has joined #ruby
drumusician has joined #ruby
tjaco has quit [Read error: Connection reset by peer]
julweber has joined #ruby
mneorr has quit [Ping timeout: 272 seconds]
jrhe has quit [Quit: jrhe]
hiyosi has quit [Read error: Operation timed out]
wildroman has joined #ruby
spider-mario has joined #ruby
wildroman has quit [Remote host closed the connection]
Deele has joined #ruby
huttan has quit [Ping timeout: 252 seconds]
wildroman has joined #ruby
jmoeller has quit []
<pixiebit> For square!, I can't use self = self.square, right?
vpretzel has quit [Ping timeout: 272 seconds]
pyrac has quit [Quit: pyrac]
<apeiros> you can't assign to self, no
Jabberish has quit [Ping timeout: 246 seconds]
jmoeller has joined #ruby
<artmann_> Is there any tutorials for making changed to existing gems? Is the correct approach: Fork -> Do Changes -> build localy -> test -> push -> pullrequest ?
amacgregor has quit [Ping timeout: 246 seconds]
<Papipo> yes, you can do that
jmoeller has quit [Client Quit]
<Papipo> usually the changes are pushed on a separate branch
<pixiebit> omg ? im so sorry
drumusician has quit [Ping timeout: 245 seconds]
jmoeller has joined #ruby
burgess has quit [Quit: ^zzz]
jmoeller has quit [Client Quit]
ybart has joined #ruby
samfisher has joined #ruby
samfisher has joined #ruby
samfisher has quit [Changing host]
<artmann_> Papipo: oh yeah I forgot that step
troessner has joined #ruby
lkba has quit [Ping timeout: 272 seconds]
mengu has quit [Read error: Connection reset by peer]
drumusician has joined #ruby
workmad3 has joined #ruby
heftig has quit [Quit: Quitting]
jlebrech has joined #ruby
astrobunny has quit [Ping timeout: 245 seconds]
brennanMKE has joined #ruby
michael_mbp is now known as zz_michael_mbp
it_tard has quit [Read error: Connection reset by peer]
it_tard has joined #ruby
it_tard has joined #ruby
it_tard has quit [Changing host]
pixiebit has left #ruby [#ruby]
_jery has quit [Read error: Connection reset by peer]
astrobunny has joined #ruby
rdark has joined #ruby
leonidlm has quit [Read error: Connection reset by peer]
Davey has quit [Quit: Computer has gone to sleep.]
burgess has joined #ruby
brennanMKE has quit [Ping timeout: 272 seconds]
xk_id has quit [Quit:
Ripp__ has quit []
AlSquire has joined #ruby
threesome has joined #ruby
nari has quit [Ping timeout: 245 seconds]
_jery has joined #ruby
jhaals has joined #ruby
falood has quit [Remote host closed the connection]
mrpot4to_ has quit [Read error: Connection reset by peer]
MrPoT4tO has quit [Remote host closed the connection]
ephemerian has joined #ruby
polysics has joined #ruby
<polysics> hi!
<polysics> Guard users: why is guard not running all after pass if I have all_after_pass set to true? :)
<polysics> guard :rspec, all_after_pass: true, all_on_start: true do
leonidlm has joined #ruby
lkba has joined #ruby
Bry8Star{T2 has quit [Ping timeout: 240 seconds]
jibi has joined #ruby
sniffingcats has joined #ruby
Squarepy has joined #ruby
vpretzel has joined #ruby
starfox21 has joined #ruby
kirun has joined #ruby
sayan has quit [Ping timeout: 240 seconds]
wudofyr has quit [Ping timeout: 272 seconds]
rubyminer has joined #ruby
einarj has joined #ruby
vpretzel has quit [Ping timeout: 268 seconds]
pyrac has joined #ruby
lessless has left #ruby ["Ухожу я от вас (xchat 2.4.5 или старше)"]
aagdbl has quit [Quit: Leaving.]
kil0byte has joined #ruby
kil0byte_ has quit [Ping timeout: 246 seconds]
rjhunter has quit [Remote host closed the connection]
thepumpkin has joined #ruby
ecksit has quit [Quit: Laters.]
banisterfiend has quit [Quit: Computer has gone to sleep.]
banisterfiend has joined #ruby
Al_ has joined #ruby
burgess has quit [Quit: ^zzz]
mercwithamouth has joined #ruby
banisterfiend has quit [Client Quit]
mneorr has joined #ruby
lkba has quit [Ping timeout: 240 seconds]
LarsSmit has quit [Quit: Leaving.]
heftig has joined #ruby
hiyosi has joined #ruby
sniffingcats has quit [Quit: Til rivido Idisti!]
thepumpkin has quit [Ping timeout: 245 seconds]
LarsSmit has joined #ruby
ybart has quit [Read error: Connection reset by peer]
ybart has joined #ruby
mneorr has quit [Ping timeout: 245 seconds]
juniour1 has left #ruby [#ruby]
wudofyr has joined #ruby
hiyosi has quit [Ping timeout: 240 seconds]
lkba has joined #ruby
rickmasta has quit [Quit: Leaving...]
gr33n7007h has quit [Changing host]
gr33n7007h has joined #ruby
LarsSmit has quit [Quit: Leaving.]
t_p has quit [Quit: Computer has gone to sleep.]
<shevy> is it possible to generate methods dynamically, that also accept a variable amount of arguments, some of them being optional because they get set default values?
<shevy> in other words:
justsee has quit [Quit: leaving]
<shevy> def foo(a,b,c='',d='')
Domon has quit [Remote host closed the connection]
<shevy> but dynamically
h_kon has quit [Remote host closed the connection]
Nilium has quit [Disconnected by services]
<canton7> define_method :foo do |a, b=3| .... works for me
ldnunes has joined #ruby
<shevy> hmm lemme test
ybart has quit [Read error: Connection reset by peer]
ybart has joined #ruby
<shevy> cool
<shevy> works for me as well
<shevy> could swear it did not work yesterday... :¿
helpa has quit [Remote host closed the connection]
<shevy> thanks canton7
_HolyCow has quit [Ping timeout: 240 seconds]
tvw has joined #ruby
<canton7> :)
caitp has joined #ruby
h_kon has joined #ruby
it_tard has quit [Quit: yawn]
mengu has joined #ruby
mengu has quit [Changing host]
mengu has joined #ruby
jrhe has joined #ruby
nateberkopec has joined #ruby
gawaine has joined #ruby
adambeynon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
drumusician has quit [Ping timeout: 245 seconds]
rahulkmr has joined #ruby
caitp has quit [Ping timeout: 272 seconds]
rahulkmr has quit [Max SendQ exceeded]
banisterfiend has joined #ruby
rahulkmr has joined #ruby
drumusician has joined #ruby
Astralum has quit [Read error: Connection reset by peer]
Astralum has joined #ruby
svennidal has quit [Remote host closed the connection]
veleno has joined #ruby
LarsSmit has joined #ruby
pyrac has quit [Quit: pyrac]
`Chris` has quit [Read error: Connection reset by peer]
`Chris` has joined #ruby
drumusician has quit [Ping timeout: 260 seconds]
benregn has joined #ruby
sepp2k has joined #ruby
<benregn> hey, does anyone know if I can config thin to not run daemonized?
<benregn> in code, not yml
ewnd9_ has joined #ruby
heftig has quit [Quit: Quitting]
Ox6abe has joined #ruby
jrhe has quit [Quit: jrhe]
nateberkopec has quit [Quit: Leaving...]
Zai00 has quit [Read error: No route to host]
ewnd9 has quit [Ping timeout: 252 seconds]
derebos has joined #ruby
AndChat| has joined #ruby
nateberkopec has joined #ruby
jonr22 has joined #ruby
Liothen has quit [Quit: System of a down……]
Zai00 has joined #ruby
jrhe has joined #ruby
LLckfan2 has joined #ruby
<LLckfan2> I have an android tablet that I have put youtube app on. When I try to sign into youtubr it says an error occurred. Is there anything I can do to fix this? I did not get the app from Google Play as Google Play does not support my brand of tablet
sergicles has quit [Remote host closed the connection]
lkba has quit [Ping timeout: 245 seconds]
gr33n7007h has quit [Remote host closed the connection]
pyrac has joined #ruby
sergicles has joined #ruby
jonr22 has quit [Ping timeout: 248 seconds]
fixl has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
danshultz has joined #ruby
vpretzel has joined #ruby
hiyosi has joined #ruby
zz_michael_mbp is now known as michael_mbp
ejfinneran has quit [Ping timeout: 253 seconds]
matchaw has quit [Remote host closed the connection]
huttan has joined #ruby
heftig has joined #ruby
adambeynon has joined #ruby
ehaliewi` has quit [Ping timeout: 272 seconds]
Bofu2U has quit [Quit: I outta here.]
platypine has joined #ruby
matchaw has joined #ruby
vpretzel has quit [Ping timeout: 240 seconds]
amacgregor has joined #ruby
kaspergr_ has quit [Remote host closed the connection]
ludar has quit [Ping timeout: 252 seconds]
sayan has joined #ruby
wildroman has quit [Remote host closed the connection]
nowthatsamatt has quit [Quit: nowthatsamatt]
Bofu2U has joined #ruby
huttan has quit [Ping timeout: 245 seconds]
platypine has quit [Ping timeout: 272 seconds]
nari has joined #ruby
pherryman has joined #ruby
amacgregor has quit [Ping timeout: 245 seconds]
benregn has left #ruby [#ruby]
matchaw has quit [Remote host closed the connection]
h_kon has quit [Remote host closed the connection]
pherryman_ has quit [Ping timeout: 245 seconds]
jamblack has joined #ruby
allsystemsarego has joined #ruby
allsystemsarego has joined #ruby
allsystemsarego has quit [Changing host]
mneorr has joined #ruby
atmosx has joined #ruby
<atmosx> hello
matchaw has joined #ruby
<atmosx> I am writing a script for mysqldump and I'm using if system("which mysqldump") .. works fine but it ouputs in STOUT the path of the file. I just need the true/false which comes after... Any ideas?
<atmosx> on how to silence it?
includex has joined #ruby
includex has quit [Max SendQ exceeded]
<tobiasvl> the true/false is the return value
matchaw has quit [Remote host closed the connection]
mneorr has quit [Ping timeout: 260 seconds]
<atmosx> tobiasvl: yes but I want use only that
pyrac has quit [Quit: pyrac]
<tobiasvl> well then just pipe the output to another place than STDOUT
<tobiasvl> system("which mysqldump > /dev/null")
<tobiasvl> should work?
<atmosx> that's dirty
<LLckfan2> Hello
<LLckfan2> I have an android tablet that I have put youtube app on. When I try to sign into youtubr it says an error occurred. Is there anything I can do to fix this? I did not get the app from Google Play as Google Play does not support my brand of tablet
hogeo_ has joined #ruby
h_kon has joined #ruby
codelette has joined #ruby
matchaw has joined #ruby
<Hanmac> atmosx: are you sure you dont what `which mysqldump` ?
<tobiasvl> LLckfan2: that doesn't sound like a Ruby question
judd7 has joined #ruby
h_kon has quit [Remote host closed the connection]
jkamenik has joined #ruby
hogeo__ has joined #ruby
hogeo has quit [Ping timeout: 240 seconds]
LLckfan2 has left #ruby [#ruby]
matchaw has quit [Remote host closed the connection]
kaspergrubbe has joined #ruby
wak3r has joined #ruby
einarj has quit [Ping timeout: 248 seconds]
hogeo_ has quit [Ping timeout: 272 seconds]
<shevy> hehe
matchaw has joined #ruby
mojjojo has joined #ruby
hogeo__ has quit [Read error: Connection reset by peer]
hogeo has joined #ruby
srji has joined #ruby
Asher1 has joined #ruby
postmodern has quit [Quit: Leaving]
<atmosx> Hanmac: tried exec `` and system on irb, only system returns true/false
<atmosx> redirecting stderr to /dev/null works though
kaspergr_ has joined #ruby
Asher has quit [Read error: Connection reset by peer]
mist has quit [Quit: leaving]
casheew has quit [Read error: Operation timed out]
bier has quit [Read error: Operation timed out]
thelamest has quit [Read error: Operation timed out]
soukihei has quit [Read error: Connection reset by peer]
vadviktor_ has quit [Read error: Operation timed out]
Desert_eagle has quit [Read error: Operation timed out]
matchaw has quit [Remote host closed the connection]
Desert_eagle_ has joined #ruby
casheew has joined #ruby
soukihei_ has joined #ruby
kaspergrubbe has quit [Read error: Connection reset by peer]
bier has joined #ruby
<Hanmac> atmosx: !`which mysqldump`.empty? returns also true/false ..
vadviktor_ has joined #ruby
SilverKey has quit [Ping timeout: 252 seconds]
Ox6abe has quit [Remote host closed the connection]
pyrac has joined #ruby
<Hanmac> atmosx: if you want system with redirect, why not this? system("which mysqldump",:out => IO::NULL)
matchaw has joined #ruby
SilverKey has joined #ruby
judd7 has quit [Quit: judd7]
<atmosx> Hanmac: hmmm that would be awesome to get rid of the mysql password in cli error message actually :D
<atmosx> and I had the feeling that I can use the system redirect, didn't find anything in the documentation though :-/
<atmosx> how did you knew that?
brennanMKE has joined #ruby
kitak_ has quit [Remote host closed the connection]
allanm has quit [Read error: Connection reset by peer]
kaspergr_ has quit [Read error: Operation timed out]
RicFlair has joined #ruby
<Hanmac> atmosx: i asked "the great and mighty ri" ;P
jhaals has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kaspergrubbe has joined #ruby
amacgregor has joined #ruby
jhaals has joined #ruby
<Hanmac> atmosx:
<Hanmac> ri system: "The hash arguments, env and options, are same as exec and spawn. See Kernel.spawn for details."
<Hanmac> ri spawn: redirection: FD is one of follows :out => string redirect to file
<atmosx> mmm not working as expected in this scenario though
<atmosx> anyone not much time now, I'll work it out when I come back. Thanks for the tip :-) I never use 'ri'
brennanMKE has quit [Ping timeout: 272 seconds]
vidyashankar_ has joined #ruby
vidyashankar_ has quit [Client Quit]
ravster has joined #ruby
Papipo has quit [Quit: Leaving.]
atmosx has quit [Quit: Lost in trance]
Soda has joined #ruby
pyrac has quit [Quit: pyrac]
polysics has left #ruby [#ruby]
thelamest has joined #ruby
allanm has joined #ruby
amacgregor has quit [Ping timeout: 272 seconds]
OdNairy has quit [Ping timeout: 260 seconds]
mephux has quit [Ping timeout: 260 seconds]
kil0byte has quit [Remote host closed the connection]
blackmesa has joined #ruby
chiel has joined #ruby
mephux has joined #ruby
chiel has quit [Client Quit]
OdNairy has joined #ruby
nowthatsamatt has joined #ruby
chiel has joined #ruby
Banistergalaxy has joined #ruby
mrmist has joined #ruby
Beoran__ has joined #ruby
mrmist is now known as mist
michael_mbp is now known as zz_michael_mbp
Papipo has joined #ruby
Papipo has quit [Client Quit]
Beoran_ has quit [Ping timeout: 240 seconds]
wildroman has joined #ruby
janiz has joined #ruby
h_kon has joined #ruby
vpretzel has joined #ruby
mikecmpbll has joined #ruby
h_kon has quit [Remote host closed the connection]
pyrac has joined #ruby
jrhe has quit [Quit: jrhe]
mark_locklear has joined #ruby
janiz has left #ruby [#ruby]
elaptics is now known as elaptics`away
achru has quit [Remote host closed the connection]
wald0 has joined #ruby
<wald0> can be ruby a good bash (scripting) replacement ? specially for administrative purposes/scripts
achru has joined #ruby
<tobiasvl> sure, i use it for that all the time
vpretzel has quit [Ping timeout: 245 seconds]
`Chris` has quit [Remote host closed the connection]
<tobiasvl> it's more of a perl replacement though
tabolario has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
`Chris` has joined #ruby
`Chris` has quit [Remote host closed the connection]
`Chris` has joined #ruby
newbiehacker has quit [Quit: Leaving]
rahulkmr has quit [Ping timeout: 268 seconds]
achru has quit [Ping timeout: 260 seconds]
zz_michael_mbp is now known as michael_mbp
sayan has quit [Ping timeout: 246 seconds]
elaptics`away is now known as elaptics
thepumpkin has joined #ruby
veleno has quit [Quit: veleno]
nowthatsamatt has quit [Quit: nowthatsamatt]
dangerousdave has quit [Read error: Connection reset by peer]
vpretzel has joined #ruby
dangerousdave has joined #ruby
forced_request has joined #ruby
sunnymolini has joined #ruby
jrhe has joined #ruby
JeanMertz has joined #ruby
lbwski has quit [Quit: leaving]
lbwski has joined #ruby
Soda has quit [Ping timeout: 268 seconds]
thepumpkin has quit [Ping timeout: 272 seconds]
breakingthings has joined #ruby
rahulkmr has joined #ruby
rahulkmr has quit [Max SendQ exceeded]
tharindu has quit [Quit: Leaving...]
rahulkmr has joined #ruby
rahulkmr has quit [Max SendQ exceeded]
Olipro has joined #ruby
kaldrenon has joined #ruby
rahulkmr has joined #ruby
rahulkmr has quit [Max SendQ exceeded]
decoponio has joined #ruby
rahulkmr has joined #ruby
rahulkmr has quit [Max SendQ exceeded]
rahulkmr has joined #ruby
ewnd9_ has quit [Ping timeout: 240 seconds]
Coolhand has joined #ruby
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
dkamioka has joined #ruby
OdNairy has quit [Ping timeout: 265 seconds]
burlyscudd has joined #ruby
OdNairy has joined #ruby
gja has joined #ruby
goshakkk has joined #ruby
mengu has quit [Remote host closed the connection]
dkamioka has quit [Remote host closed the connection]
<wald0> tobiasvl: nice, so im searching something more powerful than bash for admin stuff but that stills friendly/handly
<wald0> unfortunately all the books that i see are more oriented to objects, data structre, and powerful applications
heftig has quit [Read error: Connection reset by peer]
<wald0> tobiasvl: do you know where i can find some source codes to use as example for get ideas?
brennanMKE has joined #ruby
<tobiasvl> hmm, not really, but there's probably lots on the web
Al_ has quit [Quit: Al_]
samfisher has quit [Quit: exit error code 434]
pyrac has quit [Quit: pyrac]
t_p has joined #ruby
mlpinit has joined #ruby
Xeago has quit [Remote host closed the connection]
<wald0> mmh, nice examples, fileutils looks nice
nowthatsamatt has joined #ruby
Soda has joined #ruby
Uranio has joined #ruby
brennanMKE has quit [Ping timeout: 268 seconds]
jonr22 has joined #ruby
Uranio has quit [Client Quit]
dkamioka has joined #ruby
Uranio has joined #ruby
dunderline has joined #ruby
Astral_ has joined #ruby
dkamioka has quit [Remote host closed the connection]
zxq9 has joined #ruby
<wald0> tobiasvl: did you have some "small scripts" in ruby that you can share, maybe?
Astralum has quit [Ping timeout: 272 seconds]
BizarreCake has joined #ruby
<dunderline> quick question on dynamically loading classes. I want to require all the ruby classes inside a directory and then instantiate the class and call a method on each of them.
caitp has joined #ruby
<dunderline> Something like this: Dir.glob(project_root + '/lib/extra_db_scripts/*') {|file| require file; file.constantize.new.run}
jonr22 has quit [Ping timeout: 268 seconds]
xk_id has joined #ruby
<dunderline> Is this a really dumb idea, or is there a better way?
werries has quit [Remote host closed the connection]
<dunderline> Also thinking of making each class inside of the directory inherit from another class and I can find all the children of that class to then process them.
ludar has joined #ruby
rurban has joined #ruby
angusiguess has joined #ruby
ninegrid_ has joined #ruby
jerius has joined #ruby
olivier_bK has joined #ruby
huttan has joined #ruby
ninegrid has quit [Ping timeout: 272 seconds]
nateberkopec has quit [Quit: Leaving...]
nari has quit [Ping timeout: 272 seconds]
AndChat- has joined #ruby
SilverKey has quit [Quit: Sleep now]
rickmasta has joined #ruby
huttan has quit [Ping timeout: 272 seconds]
pyrac has joined #ruby
nari has joined #ruby
geekbri has joined #ruby
ph8 has joined #ruby
achru has joined #ruby
Banistergalaxy has quit [Ping timeout: 245 seconds]
pen has joined #ruby
OdNairy has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
achru has quit [Client Quit]
olivier_bK has quit [Read error: No route to host]
thesheff17 has joined #ruby
ph8 has quit [Ping timeout: 272 seconds]
lukec has joined #ruby
asobrasil has joined #ruby
snovak has joined #ruby
allaire has joined #ruby
stringoO has joined #ruby
ludar has quit [Ping timeout: 272 seconds]
rurban has quit [Quit: Leaving.]
newbiehacker has joined #ruby
tomzx_mac has joined #ruby
fredjean has quit [Quit: Computer has gone to sleep.]
rahulkmr has quit [Ping timeout: 246 seconds]
Banistergalaxy has joined #ruby
Clooth has joined #ruby
<ravster> Hey all, how do I find out if a string is already urlencoded?
burlyscudd has quit [Quit: Leaving.]
jlast has joined #ruby
wildroman has quit [Remote host closed the connection]
wildroman has joined #ruby
AndChat- has quit [Ping timeout: 248 seconds]
sailias has joined #ruby
AlSquire has quit [Ping timeout: 252 seconds]
wildroman has quit [Remote host closed the connection]
freerobby has joined #ruby
<Radar> ravster: How do you even urlencode a string?
AlSquire has joined #ruby
burlyscudd has joined #ruby
wildroman has joined #ruby
<ravster> URI.escape?
<wald0> Is the packaging of gems (for debian) something not very supported? im thinking about the portability of use my ruby code in other debian computers
<ravster> Radar: URI.escape(foo) or URI.encode(foo)
nowthatsamatt has left #ruby [#ruby]
wesside has quit [Quit: Computer has gone to sleep.]
mneorr has joined #ruby
xk_id has quit [Quit:
eka has joined #ruby
joonty has joined #ruby
sayan has joined #ruby
vindictive27 has joined #ruby
pothibo has joined #ruby
pothibo has quit [Client Quit]
mneorr has quit [Ping timeout: 245 seconds]
larissa has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
pranny has quit [Quit: Leaving.]
devdazed has joined #ruby
sayan has quit [Ping timeout: 272 seconds]
tyleretters has joined #ruby
fridim_ has joined #ruby
<andrewvos> ravster: Are you doing this yourself? Why do you need to know if it is already encoded? Sounds like a design issue there
iamjarvo has joined #ruby
<ravster> andrewvos: yeah, I think I need to figure out a different set of checks for my data.
iamjarvo has quit [Read error: Connection reset by peer]
iamjarvo has joined #ruby
nateberkopec has joined #ruby
rahulkmr has joined #ruby
rahulkmr has quit [Max SendQ exceeded]
rahulkmr has joined #ruby
theRoUS has joined #ruby
rurban has joined #ruby
Azulinho has quit [Ping timeout: 245 seconds]
kil0byte has joined #ruby
cba has joined #ruby
burlyscudd has quit [Read error: Connection reset by peer]
burlyscudd1 has joined #ruby
goshakkk has quit [Quit: Textual IRC Client: www.textualapp.com]
freerobby has quit [Quit: Leaving.]
pothibo has joined #ruby
ahawkins has joined #ruby
arturaz has joined #ruby
tabolario has joined #ruby
sambao21 has joined #ruby
ffranz has joined #ruby
frustrum has quit [Quit: WeeChat 0.4.2]
Azulinho has joined #ruby
freerobby has joined #ruby
elux has joined #ruby
SilverKey has joined #ruby
alekst has joined #ruby
Papipo has joined #ruby
brennanMKE has joined #ruby
tabolario has quit [Quit: Textual IRC Client: www.textualapp.com]
ejfinneran has joined #ruby
Jetchisel has quit [Quit: Unfortunately time is always against us -- *Morpheus*]
tonni has quit [Remote host closed the connection]
<dunderline> How can I get a list of classes that have inherited from another class?
jkamenik has quit [Quit: Leaving.]
mrsolo has joined #ruby
iamjarvo has quit [Remote host closed the connection]
tonni has joined #ruby
<dunderline> If I put the following into a class method it works, "ObjectSpace.each_object(Class).select { |klass| klass < self }"
jbpros has joined #ruby
<dunderline> but it doesn't work from an instance
iamjarvo has joined #ruby
mercwithamouth has quit [Ping timeout: 245 seconds]
dkamioka has joined #ruby
bean has joined #ruby
voodoofish has quit [Quit: Leaving]
vindictive27 has quit [Quit: vindictive27]
brennanMKE has quit [Ping timeout: 272 seconds]
Xeago has joined #ruby
momomomomo has joined #ruby
burlyscudd1 has quit [Quit: Leaving.]
Al_ has joined #ruby
tonni has quit [Ping timeout: 245 seconds]
tkuchiki has joined #ruby
Soda has quit [Remote host closed the connection]
fmcgeough has joined #ruby
iamjarvo has quit [Ping timeout: 272 seconds]
burlyscudd has joined #ruby
ybart has quit [Quit: ybart]
<wald0> Is the packaging of gems (for debian) something not very supported? im thinking about the portability of use my ruby code in other debian computers
VTLob has joined #ruby
jojosch has joined #ruby
kil0byte_ has joined #ruby
freerobby has quit [Quit: Leaving.]
tkuchiki has quit [Ping timeout: 272 seconds]
huttan has joined #ruby
kil0byte has quit [Ping timeout: 252 seconds]
dkamioka has quit [Remote host closed the connection]
iamjarvo has joined #ruby
tomzx_mac has quit [Ping timeout: 252 seconds]
jojosch has quit [Client Quit]
dkamioka has joined #ruby
anderson has quit [Quit: Leaving]
lukec has quit [Quit: lukec]
<joelio> wald0: I'd just use native gems with bundler
mahlon_ is now known as mahlon
robbyoconnor has quit [Ping timeout: 248 seconds]
SilverKey has quit [Quit: Sleep now]
tris has quit [Excess Flood]
eichenwald has joined #ruby
tris has joined #ruby
dkamioka has quit [Ping timeout: 245 seconds]
lfox has joined #ruby
dkamioka has joined #ruby
drag00n has joined #ruby
ravster has quit [Quit: Leaving.]
ninegrid_ has quit [Remote host closed the connection]
mikecmpbll has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
ninegrid has joined #ruby
astrobunny has quit [Ping timeout: 245 seconds]
Czupa has joined #ruby
dunderline has quit [Quit: dunderline]
freezey has joined #ruby
mlpinit has quit [Remote host closed the connection]
nari has quit [Ping timeout: 268 seconds]
mlpinit has joined #ruby
<wald0> yeah but i wonder more about the compatiblity over "system" (not user), like packaging and install the package so that will work out of the box
astrobunny has joined #ruby
mary5030 has joined #ruby
hashpuppy has joined #ruby
snovak_ has joined #ruby
Monie has quit [Quit: Textual IRC Client: www.textualapp.com]
wereHamster|work has quit [Ping timeout: 272 seconds]
LarsSmit has quit [Quit: Leaving.]
jbpros has quit [Quit: jbpros]
mlpinit has quit [Ping timeout: 260 seconds]
ebetancourt has joined #ruby
<hashpuppy> i see this pattern a lot in ruby client wrapper libraries, where people use include over inheritance. why? https://github.com/mattmueller/foursquare2/blob/master/lib/foursquare2/client.rb
mlpinit has joined #ruby
maZtah has quit [Excess Flood]
<Hanmac> hashpuppy: what pattern do you mean?
snovak has quit [Ping timeout: 260 seconds]
maZtah has joined #ruby
<_maes_> this is because ruby does not support multiple inheritance
RORgasm has joined #ruby
<_maes_> afaiu
rahulkmr has quit [Ping timeout: 265 seconds]
hogeo has quit [Remote host closed the connection]
<hashpuppy> you see how on lines 14-25 he includes Venues, Events, etc... and then defines "def venues" and "def events" in each of those modules
hogeo has joined #ruby
jrhe has quit [Quit: jrhe]
seekwill has joined #ruby
thepumpkin has joined #ruby
wallerdev has joined #ruby
fridim_ has quit [Read error: Operation timed out]
maZtah has quit [Changing host]
maZtah has joined #ruby
burlyscudd has quit [Read error: Connection reset by peer]
burlyscudd has joined #ruby
<Hanmac> yeah, is there a problem?
rickmasta has quit [Quit: Leaving...]
jbpros has joined #ruby
mneorr has joined #ruby
fredjean has joined #ruby
hogeo has quit [Ping timeout: 240 seconds]
headius has joined #ruby
xxpor__ has quit [Ping timeout: 248 seconds]
thepumpkin has quit [Ping timeout: 272 seconds]
<Hanmac> im i would try to make the methods auto-generated ... i mean there is always an *single*(id), add_*single*(), search_*plural* and *single*_venues or something like that?
gja has quit [Quit: This computer has gone to sleep]
boxmein has joined #ruby
mneorr has quit [Ping timeout: 245 seconds]
Monie has joined #ruby
Monie has quit [Client Quit]
JMcAfreak has joined #ruby
kevind has joined #ruby
krawchyk has joined #ruby
iamjarvo_ has joined #ruby
nouitfvf has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
burlyscudd has quit [Quit: Leaving.]
zz_jrhorn424 is now known as jrhorn424
freerobby has joined #ruby
kvirani has joined #ruby
freezey has quit [Remote host closed the connection]
freezey has joined #ruby
iamjarvo has quit [Ping timeout: 260 seconds]
h_kon has joined #ruby
lharms has joined #ruby
lharms has quit [Client Quit]
rickmasta has joined #ruby
lmickh has joined #ruby
jonr22 has joined #ruby
zipper has joined #ruby
ReachingFarr has joined #ruby
<ReachingFarr> I'm having some trouble loading gems installed in my home directory (~/.gem). Right now when I try and run a script like Rake I get a LoadError.
brennanMKE has joined #ruby
freezey has quit [Ping timeout: 240 seconds]
ybart has joined #ruby
noop has quit [Ping timeout: 252 seconds]
blackmesa has quit [Quit: WeeChat 0.4.2]
<workmad3> ReachingFarr: any idea on ruby version?
interactionjaxsn has joined #ruby
<ReachingFarr> I've set GEM_HOME to ~/.gem, as well as added the path to gemhome and gempath in .gemrc.
<ReachingFarr> 2.0.0p247
iamjarvo_ has quit [Remote host closed the connection]
jonr22 has quit [Ping timeout: 252 seconds]
jrhorn424 is now known as zz_jrhorn424
iamjarvo has joined #ruby
<end_guy> What's your favorite thing about Ruby?
freezey has joined #ruby
tonni has joined #ruby
zipper_ has joined #ruby
<banisterfiend> end_guy good question
zipper is now known as Guest68572
<banisterfiend> end_guy in my case it would be executable class bodies i think
thepumpkin has joined #ruby
<banisterfiend> love that shit
<finnomenon> end_guy: modulo
zipper_ is now known as zipper
SilverKey has joined #ruby
Guest68572 has quit [Ping timeout: 240 seconds]
<end_guy> :)
d2dchat_ has joined #ruby
<ReachingFarr> workmad3: Any ideas?
pherryman has quit [Ping timeout: 263 seconds]
<workmad3> ReachingFarr: not from the info so far... what's inside ~/.gem though?
JRizzle has joined #ruby
RicFlair has quit [Read error: Connection reset by peer]
<ReachingFarr> workmad3: bin, build_info, cache, doc, gems, specifications, and specs. All directories.
iamjarvo_ has joined #ruby
RicFlair has joined #ruby
<workmad3> ReachingFarr: ok, that sounds about right... could you gist the exact commands and output you're getting then please?
iamjarvo has quit [Read error: Operation timed out]
velCzupa has joined #ruby
velCzupa has quit [Client Quit]
ph8 has joined #ruby
wald0 has quit [Quit: Lost terminal]
tesuji has quit [Read error: Connection reset by peer]
<banisterfiend> end_guy i also love all the introspection/reflection APIs
tesuji has joined #ruby
mrsolo has quit [Quit: This computer has gone to sleep]
<end_guy> I really like how easy meta programming is with class_eval
<banisterfiend> class_eval is often abused
<banisterfiend> IMO
kil0byte has joined #ruby
<end_guy> absolutely, but when used properly it gives me warm fuzzies
failshell has joined #ruby
dabos has quit [Quit: Leaving]
ph8 has quit [Max SendQ exceeded]
<banisterfiend> :))
<Hanmac> banisterfiend: eval is more abused ;P
danshultz has quit [Remote host closed the connection]
h_kon has quit [Remote host closed the connection]
<end_guy> eval(gets) <-- the famous ruby calculator
sambao21 has joined #ruby
JeanMertz has quit [Ping timeout: 268 seconds]
danshultz has joined #ruby
<banisterfiend> end_guy loop { p eval(gets).inspect }
<end_guy> hehe
zipper has quit [Ping timeout: 240 seconds]
<workmad3> banisterfiend: that's Pry, isn't it? :P
<banisterfiend> workmad3 pretty much ;)
<banisterfiend> err that was retarded, leave off the .inspect
<workmad3> :D
<banisterfiend> 'p' does that :)
kil0byte_ has quit [Ping timeout: 265 seconds]
<end_guy> Here's some cool use of instance_eval in a gem I wrote
<workmad3> end_guy: the instance_eval isn't needed there, you realise?
<end_guy> what else could I have used?
krz has quit [Quit: krz]
<workmad3> end_guy: obj.send(:define_method, :response) do |responding_obj=obj, options| ...
<end_guy> Goal: Know when HollaBack is included into a class and define a response method for that class
maZtah is now known as maZtah
momomomomo has quit [Quit: momomomomo]
<banisterfiend> workmad3 neither is the define_method ;)
<banisterfiend> 'def' would work fine
<workmad3> banisterfiend: he's wanting the 'obj' passed in
<end_guy> interesting
<banisterfiend> workmad3 but he's not closing over anything afaict?
<banisterfiend> and the method name is not dynamically generated
g0bl1n has joined #ruby
<banisterfiend> but correct me if i'm wrong, I'm a little tipsy
<workmad3> banisterfiend: only because he's using instance_eval to change 'self'
<end_guy> :)
<workmad3> banisterfiend: once you drop the instance_eval, you need to close over 'obj' as a default block param
cody-- has joined #ruby
burlyscudd has joined #ruby
dkamioka has quit [Remote host closed the connection]
<banisterfiend> workmad3 but he's not referring to 'obj' in the method at all
danshultz has quit [Ping timeout: 272 seconds]
tonni has quit [Ping timeout: 272 seconds]
<workmad3> banisterfiend: he's referring to 'self'
<workmad3> banisterfiend: inside an instance_eval
<banisterfiend> which is just 'self' instance_eval doesn't change self
<banisterfiend> it just changes the default definee
<workmad3> banisterfiend: instance_eval does change self
<banisterfiend> no bb
gangsta_ghost has joined #ruby
larissa has quit [Read error: Connection reset by peer]
<banisterfiend> 1.instance_eval { self }
<banisterfiend> >> 1.instance_eval { self }
<eval-in> banisterfiend => 1 (https://eval.in/58033)
<banisterfiend> >> "hello".instance_eval { self }
<eval-in> banisterfiend => "hello" (https://eval.in/58034)
svector has joined #ruby
<banisterfiend> but i think we're talking at cross purposes some how
larissa has joined #ruby
xeon_ has joined #ruby
ph8 has joined #ruby
svector has quit [Max SendQ exceeded]
<banisterfiend> you're right it changes self from the surrounding scope, but it doesn't change self from the receiver
xeon_ has quit [Max SendQ exceeded]
<workmad3> banisterfiend: yeah, it changes self from the surrounding scope to the receiver (of instance_eval) :)
xeon_ has joined #ruby
xeon_ has quit [Max SendQ exceeded]
mikepack has joined #ruby
xeon_ has joined #ruby
<banisterfiend> in this case he should be using class_eval, rather than instance_eval too
zoee has quit [Quit: zoee]
<banisterfiend> or just use your define_method trick
<workmad3> banisterfiend: however, I think you may be right in that 'def response(responding_obj = self, options)' may be correct
ph8 has quit [Max SendQ exceeded]
coderhs has quit [Quit: Leaving]
xeon_ has quit [Max SendQ exceeded]
danshultz has joined #ruby
xeon_ has joined #ruby
<banisterfiend> yeah either: send(:define_method) or class_eval { def response.. }
dkamioka has joined #ruby
mikepack has quit [Remote host closed the connection]
<workmad3> end_guy: so, it's entirely possible that you can drop that included hook and just do 'def response(responding_obj = self, options={}); ...; end' in your module there ;)
aapzak has quit [Ping timeout: 245 seconds]
dkamioka has quit [Remote host closed the connection]
dkamioka has joined #ruby
hiroyuki has joined #ruby
mikepack has joined #ruby
kil0byte has quit [Remote host closed the connection]
<end_guy> banisterfiend: so like this ? https://gist.github.com/dchapman1988/7198650
wallerdev has quit [Quit: wallerdev]
aapzak has joined #ruby
<banisterfiend> end_guy well that's equivalent to your last code sample :)
<end_guy> that's what I thought...
<andrewvos> it still has an eval in there
<andrewvos> /captain obvious
* andrewvos slinks back into the shadows
<end_guy> thanks, andrewvos :)
<Hanmac> hm the bad thing is that neigher class_eval nor instance_eval can add a class to an singleton_class :( ... you need class << self on the object, you cant use the #singleton_class method for that
failshell has quit []
<end_guy> banisterfiend: you mentioned I should use class eval?
ananthakumaran has joined #ruby
snovak_ has quit [Remote host closed the connection]
tonni has joined #ruby
blackmesa has joined #ruby
<end_guy> Hanmac: well I'm not trying to add a class, just define a method in a class instance
<banisterfiend> end_guy well it makes more sense to use class_eval than instance_eval, but as to whether you should be using any of the *_evals is another issue
baroquebobcat has joined #ruby
momomomomo has joined #ruby
lmickh has quit [Quit: lmickh]
gja has joined #ruby
snovak_ has joined #ruby
burlyscudd has quit [Quit: Leaving.]
danshultz has quit [Remote host closed the connection]
aapzak has quit [Ping timeout: 265 seconds]
Liquid-- has joined #ruby
<workmad3> Hanmac: class_eval and instance_eval don't touch Module.nesting :)
danshultz has joined #ruby
<banisterfiend> Hanmac what do u mean by "bad thing is that neigher class_eval nor instance_eval can add a class to an singleton_class"
aapzak has joined #ruby
maycon has joined #ruby
maycon has joined #ruby
maycon has quit [Changing host]
danshultz has quit [Read error: Connection reset by peer]
<workmad3> >> class << Object; class Foobar; end; end; Object.singleton_class::Foobar
<eval-in> workmad3 => Object::Foobar (https://eval.in/58035)
danshultz has joined #ruby
<workmad3> banisterfiend: ^^ I'm guessing something like that
kaspergrubbe has quit [Ping timeout: 248 seconds]
robbyoconnor has joined #ruby
<workmad3> banisterfiend: although I'm not sure it's a 'bad thing' that you can't do that :)
robbyoconnor has quit [Client Quit]
DrShoggoth has joined #ruby
IceDragon has joined #ruby
<banisterfiend> workmad3 oh because constants are looked up lexically
<banisterfiend> yeah i've had issues with that too
<banisterfiend> 1.9.1 allowed for that
<banisterfiend> but they reverted in 1.9.2
<workmad3> well, according to Module.nesting, which can be somewhat... odd :)
enebo has joined #ruby
<banisterfiend> workmad3 did u ever mess with 1.9.1? :)
<banisterfiend> that was an interesting ruby...
Methylated has joined #ruby
<workmad3> I didn't play with it much, no
<Methylated> I have an archaic ruby web app. It's 9k lines and includes the tests along with the procedues (no classes)
<Hanmac> >> class << (o=Object.new);class ABC;self;end;end
<eval-in> Hanmac => #<Class:0x41065108>::ABC (https://eval.in/58036)
<Methylated> What's the best way to go about refactoring this?
breakingthings has quit [Ping timeout: 245 seconds]
<Methylated> another thing: I cannot run it
TheMoonMaster has quit [Excess Flood]
<dkamioka> Methylated: by refactor, what do you mean? Make it run as it is, or migrate to rails or something like that?
breakingthings has joined #ruby
<Methylated> well I need to encapsulate it in a "main" method in a class, remove dependence on global variables, and be able to extend this class to add method hooks
endash has joined #ruby
ewnd9_ has joined #ruby
wald0 has joined #ruby
tagrudev has quit [Remote host closed the connection]
newbiehacker_ has joined #ruby
<wald0> if i do dirp = Dir.open("."), why i need to dirp.close later?
TheMoonMaster has joined #ruby
newbiehacker has quit [Read error: Connection reset by peer]
<Methylated> dkamioka: also, there are many comments, I'd like to create a doc from these comments but they are arbitrary (not rdoc, yard, etc)
<Methylated> What solutions are available for this?
lmickh has joined #ruby
<dkamioka> ... so you intend to stick with the legacy code?
terrellt has quit [Ping timeout: 272 seconds]
s_e has quit [Excess Flood]
<bean> wald0: so you dont leave file descriptors sitting around :)
pyrac has quit [Quit: pyrac]
s_e has joined #ruby
jonathanwallace has quit [Ping timeout: 272 seconds]
<wald0> bean: mmh, like a c pointer? i think that i dont have read about this yet in my ruby books
shaunbaker has quit [Read error: Connection reset by peer]
<andrewvos> It's not ruby
<andrewvos> It's the file system
<bean> that
<dkamioka> Methylated: well I dont know any solution of legacy code managing...
<Methylated> dkamioka: the legacy code is being rewritten from scratch but it wont be done until next week. right now we just need to benchmark this monster
Czupa has quit [Remote host closed the connection]
rahulkmr has joined #ruby
<Methylated> basically I want to add a before/after benchmark hook to every one of these hundreds of methods
Czupa has joined #ruby
pyrac has joined #ruby
Ox6abe has joined #ruby
<wald0> mmh, im trying to switch from bash, in bash you dont need to close it
cads has quit [Ping timeout: 245 seconds]
<dkamioka> I'd recommend exactly that, re-write everything. But first thing, I'd try to re-write the tests in a way that it could validate the new code.
bricker`LA has joined #ruby
<dkamioka> Methylated: as in ruby, I'd recommend rspec, if it's a more abstract or top level test cucumber with capybara (as you said it's a web app)
jonathanwallace has joined #ruby
interactionjaxsn has quit [Remote host closed the connection]
<dkamioka> cucumber+capybara is a nice way to make functional/product test. not unit tests...
<Methylated> dkamioka: the tests are laughable. It's a perl app written in Ruby.. regex, $ vars …
shaunbaker has joined #ruby
<Methylated> the new stack is using cuke/capybara/rspec
ph8 has joined #ruby
interactionjaxsn has joined #ruby
mary5030 has quit [Remote host closed the connection]
mary5030 has joined #ruby
maycon has quit [Read error: Connection reset by peer]
iamjarvo_ has quit [Ping timeout: 272 seconds]
<wald0> so how i can know when i need to close things?
interactionjaxsn has quit [Remote host closed the connection]
interactionjaxsn has joined #ruby
cads has joined #ruby
wildroman has quit [Remote host closed the connection]
mneorr has joined #ruby
<bean> wald0: if you .open a File (dir, etc) you should close it. Chances are that the GC will cover it for you but you dont want to run into a situation where your user can't ipen any more FDs
wildroman has joined #ruby
<dkamioka> Methylated: well, sorry i think I can't be of much help other than this tips...
lotherk has joined #ruby
<bean> open*
xk_id has joined #ruby
<wald0> i see
<dkamioka> Methylated: I think it's a case of more elbow grease than a "methodology", or "solution"...
<wald0> how i can know then if my script has "garbage" that i have not closed correctly?
<Methylated> dkamioka: it's alright, thanks. I just wanted to avoid doing it the hard way since this is being thrown out. http://ghendry.net/refactor.html is good enough. I was hoping for an analysis tool or some sort of shortcuts
maycon has joined #ruby
maycon has quit [Changing host]
maycon has joined #ruby
<shevy> wald0 dont think there is an easy way to check this. there is the GC module though
ph8 has quit [Max SendQ exceeded]
jonathanwallace has quit [Ping timeout: 240 seconds]
Voodoofish430 has joined #ruby
<shevy> wald0 File.open accepts a block, if you use the block form, you never have to apply .close again
mary5030 has quit [Ping timeout: 248 seconds]
camilasan has quit [Remote host closed the connection]
<shevy> File.open("your_file_name_here.yml","w") {|file| YAML.dump(your_data_here, file)}
camilasan has joined #ruby
mneorr has quit [Ping timeout: 245 seconds]
wildroman has quit [Ping timeout: 265 seconds]
ph8 has joined #ruby
<andrewvos> wald0: I think you may be asking the wrong thing. What are you doing with Dir.open?
lotherk has quit [Client Quit]
kil0byte has joined #ruby
mrsolo has joined #ruby
rippa has joined #ruby
<andrewvos> wald0: Also if you use `Dir.open {|d| #bla }` the dir will be closed when the block finishes executing
gangsta_ghost has quit [Quit: Leaving]
lukec has joined #ruby
mikecmpbll has joined #ruby
wallerdev has joined #ruby
mary5030 has joined #ruby
<wald0> andrewvos: actually im doing nothing, just reading ruby examples and reading ruby, trying to learn and understand it
mary5030 has quit [Remote host closed the connection]
yfeldblum has joined #ruby
RicFlair has quit [Remote host closed the connection]
<wald0> i want to use it for switch from bash scripting (admin/apps)
CaptainJet has joined #ruby
camilasan has quit [Ping timeout: 265 seconds]
mary5030 has joined #ruby
Xeago_ has joined #ruby
camilasan has joined #ruby
<andrewvos> coo
<andrewvos> l
<andrewvos> there is a thing about sandwich code somewhere
astrobun_ has joined #ruby
<andrewvos> read that
Monie has joined #ruby
<andrewvos> it's one of the nice things about ruby
wildroman has joined #ruby
maycon has quit [Ping timeout: 252 seconds]
julweber has quit [Remote host closed the connection]
xk_id has quit [Quit:
g0bl1n has quit [Quit: Ex-Chat]
julweber has joined #ruby
Liquid-- has quit [Quit: Computer has gone to sleep.]
jonathanwallace has joined #ruby
b00stfr3ak has joined #ruby
Xeago_ has quit [Ping timeout: 260 seconds]
astrobunny has quit [Ping timeout: 265 seconds]
forced_request has quit [Ping timeout: 245 seconds]
ejfinneran has quit [Quit: ejfinneran]
caitp has quit [Ping timeout: 245 seconds]
pyrac has quit [Quit: pyrac]
julweber has quit [Ping timeout: 272 seconds]
forced_request has joined #ruby
Vivekananda has joined #ruby
sayan has joined #ruby
coderhs has joined #ruby
burlyscudd has joined #ruby
|jemc| has joined #ruby
lsmola has joined #ruby
jonathanwallace has quit [Ping timeout: 240 seconds]
tonni has quit [Remote host closed the connection]
xk_id has joined #ruby
<shevy> wald0 \o/
lmickh has quit [Quit: lmickh]
<shevy> wald0 then you may possibly love "alias"
<shevy> for instance, to change directory in ruby you may have to do
ahawkins has quit [Ping timeout: 272 seconds]
<shevy> Dir.chdir 'name_of_directory_here'
<shevy> but noone wants to type that
<shevy> so you could either do a: def cd(i) or alias cd Dir.chdir
<shevy> hmm
ssvo has joined #ruby
<shevy> not that
<shevy> :(
Y_Ichiro_ has quit [Ping timeout: 245 seconds]
<bean> i built a "ruby shell" for a class project once
<bean> I'm gonna bet i deleted that
chihhsin has quit [Ping timeout: 240 seconds]
maycon has joined #ruby
tharindu has joined #ruby
lmickh has joined #ruby
OdNairy has joined #ruby
DanKnox_away is now known as DanKnox
CaptainJet has quit [Ping timeout: 248 seconds]
<shevy> hmm
Davey has joined #ruby
<shevy> if we could only replace bash ...
CaptainJet has joined #ruby
rickmasta has quit [Quit: Leaving...]
hamakn has quit [Remote host closed the connection]
OdNairy has quit [Read error: Connection reset by peer]
xeon_ has quit [Ping timeout: 245 seconds]
yacks has quit [Quit: Leaving]
mary5030 has quit [Remote host closed the connection]
tesuji has quit [Ping timeout: 248 seconds]
mary5030 has joined #ruby
Jeticus has joined #ruby
<shevy> if bean could replace zsh ...
CaptainJet has quit [Ping timeout: 245 seconds]
Kyushu_Yakushima has quit [Ping timeout: 245 seconds]
<bean> lol
<bean> I love my ZSH too much
<shevy> hehe
zeropx has joined #ruby
* bean is a sysadmin at heart.
olivier_bK has joined #ruby
<shevy> I think the biggest problem in wanting to replace bash is to become even as remotely as fast when doing anything, in ruby
<shevy> like, when you want to list 10.000 files
<shevy> in a directory
Kyushu_Yakushima has joined #ruby
gr33n7007h has joined #ruby
OdNairy has joined #ruby
<olivier_bK> i try to creat a irc bot but i have a littel problem i dont know why i get thi error https://gist.github.com/zyriuse75/60f0421b5d80a335315b
rickmasta has joined #ruby
OdNairy has quit [Read error: Connection reset by peer]
<wald0> andrewvos: thx, sandwitch reading was informative :), "ensure" looks very nice, i like ruby because i think that my code can be readed and modified by humans lol
<shevy> olivier_bK when does this error happen?
<shevy> I mean, in seconds
<wald0> bean: ruby shell? mmh, could be nice if i use that instead of bash, just to be familiarized
<bean> wald0: i mean, pry and irb do exist.
<wald0> i think that i learned bash because i used the terminal (than reading how to programm it) lol
<bean> they're more of a REPL though
jbpros has quit [Quit: jbpros]
theoretick has joined #ruby
<wald0> shevy: bad option why ? well maybe i would need to play with Dir.chdir for some time to learn/assimilate a bit of ruby code in my head :)
<olivier_bK> shevy, this error happend when i execute the script
<shevy> wald0 not bad option... but my example does not work :(
<shevy> alias cd Dir.chdir is a syntax error... :(
<shevy> apparently you can not have a '.' there
<shevy> well... I guess you can do this:
<shevy> >> class Dir; alias cd chdir; end
<eval-in> shevy => undefined method `chdir' for class `Dir' (NameError) ... (https://eval.in/58038)
<shevy> hmm no...
<shevy> this makes me angry
<|jemc|> olivier_bK: the IRC server wants an ident response
<wald0> bean: yes, pry is nice, but i dont think that i can use it as a shell system, mmh... or maybe yes ?
<|jemc|> olivier_bK: I don't remember the exact form of it
tylersmith has quit [Remote host closed the connection]
<bean> I doubt you can, wald0
<wald0> chsh pry :)
<|jemc|> olivier_bK: but it's some string including your nick
kevind_ has joined #ruby
<bean> I don't know how well a shell written in ruby would work.
pyrac has joined #ruby
<olivier_bK> |jemc|, okai i going to search thanks
jamblack has left #ruby [#ruby]
<|jemc|> olivier_bK: good luck
<olivier_bK> |jemc|, thanks :)
maZtah is now known as maztah
chrisja has joined #ruby
<shevy> wald0 pry only wants valid ruby code as input, so you would be limited if you want a replacement for bash
maztah is now known as maZtah
srji has quit [Quit: leaving]
<shevy> like you can do ... sed -bla /something/something/, or that in bash
<shevy> and it wouldn't be valid in pry or irb
<wald0> bean: why not ? well, maybe you dont have the full optimization/speed as other shells but could be something really nice for "practice ruby code while you use your shell" :)
<shevy> or was it awk, I dont remember. those ugly things are so awful...
<shevy> yah, a hybrid shell would be nice
<|jemc|> if you want it hybrid, just use backticks to invoke bash
sayan has quit [Read error: Connection reset by peer]
rubyminer has quit [Remote host closed the connection]
<wald0> shevy: mmh, this makes me think, would be really nice a shell that when you try to use sed (so you type it like unconscious), the shell tells you the "ruby equivalent of sed to use" :)
<|jemc|> although I don't actually think it would be useful to do so
kevind has quit [Ping timeout: 272 seconds]
kevind_ is now known as kevind
failshell has joined #ruby
<shevy> wald0 hmm... is possible... but first we'd need to have a project that does this sed->ruby translation
froy has joined #ruby
Authenti1ator is now known as Authenticator
<wald0> shevy: well, it can be much simpler, something like "the ruby equivalent of sed is gsub, you have also foo and bar, run Xcommand to view the doc of it"
aspires has joined #ruby
nari has joined #ruby
MrZYX|off is now known as MrZYX
sambao21 has quit [Quit: Computer has gone to sleep.]
Liquid-- has joined #ruby
jrhe has joined #ruby
kevinykchan has joined #ruby
snovak_ has quit [Remote host closed the connection]
sambao21 has joined #ruby
jbpros has joined #ruby
<gr33n7007h> >> puts "12345".reverse
<eval-in> gr33n7007h => 54321 ... (https://eval.in/58039)
<gr33n7007h> how to evaluate?
jbpros has quit [Client Quit]
snovak_ has joined #ruby
<gr33n7007h> Internet connection lagging sorry
nomenkun has quit [Ping timeout: 245 seconds]
sguselnikov has joined #ruby
havenwood has joined #ruby
maycon has quit [Quit: Saindo]
ace has joined #ruby
avril14th has quit [Remote host closed the connection]
JohnBat26 has joined #ruby
<wald0> i wonder if there's around some article/doc like "from bash to ruby" with a list of equivalent things to use
bartj3 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
derebos has quit [Ping timeout: 260 seconds]
OdNairy has joined #ruby
kpshek has joined #ruby
moted has joined #ruby
ybart has quit [Quit: ybart]
CocoStorm has joined #ruby
sguselnikov has quit [Client Quit]
lfox has quit [Quit: ZZZzzz…]
lfox has joined #ruby
MrZYX is now known as MrZYX|off
polaco_zZz is now known as polaco
nari has quit [Ping timeout: 272 seconds]
spider-mario has quit [Remote host closed the connection]
MrZYX|off is now known as MrZYX
juarlex has quit [Remote host closed the connection]
ybart has joined #ruby
whunt has quit [Write error: Broken pipe]
andikr has joined #ruby
jonr22 has joined #ruby
mneorr has joined #ruby
deegen has joined #ruby
<Morrolan> wald0: Forget everything you know from Bash, and start with a Ruby tutorial? :P
CocoStorm has left #ruby [#ruby]
<wald0> yuck, i would like to have printed the pixaxe book but is 50 bucks :/
caitp has joined #ruby
ace has quit [Ping timeout: 250 seconds]
<wald0> Morrolan: well, this is good and bad, i have learned a lot of things over the years so its not nice to forget these things, for example, i use a lot of variable="$( command | awk '{print $1}' )", its just like handy and without think for me (since i used it too much)
slash_nick has joined #ruby
drumusician has joined #ruby
RicFlair has joined #ruby
ananthakumaran1 has joined #ruby
<shevy> gr33n7007h what do you mean with evaluate
burlyscudd has quit [Quit: Leaving.]
ananthakumaran has quit [Read error: Connection reset by peer]
<shevy> wald0 this is a bit difficult because... do you mean only bash-internal commands, or also external things like sed and awk?
brtdv has quit []
<Morrolan> That awk command prints the first column, split by whitespace, iirc? Stuff like this is done slightly different in Ruby. You'd call the split method on the string, and then access the first element of the resulting array.
mneorr has quit [Ping timeout: 245 seconds]
<shevy> hehe
jbpros has joined #ruby
<shevy> the long explanation is much longer in english than in ruby code :)
<Morrolan> True. :)
jonr22 has quit [Ping timeout: 268 seconds]
polaco is now known as polaco_zZz
<Morrolan> And probably less clear. ^.^
mrsolo has quit [Quit: This computer has gone to sleep]
<Morrolan> That's probably why I'm a coder and not a poet. ;)
lfox has quit [Quit: ZZZzzz…]
aganov has quit [Quit: aganov]
drumsrgr8forn8 has joined #ruby
<havenwood> Morrolan: Coder poet.
drumsrgr8forn8 has quit [Remote host closed the connection]
drumsrgr8forn8 has joined #ruby
mrsolo has joined #ruby
<havenwood> reminds me of Black Perl
<havenwood> "BEFOREHAND: close door, each window & exit; wait until time."
* Morrolan proceeds to write his code in Limmericks
arietis has joined #ruby
<Morrolan> havenwood: Heh.
<havenwood> wald0: Indeed: variable = `command`.split.first
Xeago has quit [Remote host closed the connection]
osvico has joined #ruby
whunt has joined #ruby
<havenwood> Morrolan: I started making a haiku thingy to condense and summarize websites in haiku form, but turns out NLP is haard :P
momomomomo has quit [Quit: momomomomo]
<havenwood> Went on a tangent trying to figure out which periods were the end of sentences... never got back to the original task.
<billiam> That sounds really challenging.
<Morrolan> Haha.
Clooth has quit [Quit: Leaving...]
gawaine has quit [Quit: This computer has gone to sleep]
<havenwood> wald0: I'd suggest just going through the methods on String for a good start: http://ruby-doc.org/core-2.0.0/String.html
kevind has quit [Quit: kevind]
<havenwood> wald0: Then with Enumerable and Array you'll have enough to really do some damage. :)
Spami has joined #ruby
kevind has joined #ruby
pyrac has quit [Quit: pyrac]
noname001 has quit [Ping timeout: 272 seconds]
Ripp__ has joined #ruby
<havenwood> wald0: To get an Array #split a String, and to get back to a String #join the Array.
burlyscudd has joined #ruby
_jery has quit [Ping timeout: 248 seconds]
<gr33n7007h> shevy, Just test a statement but eval-in responded rather late most probably my connection that is all ;)
kevind_ has joined #ruby
adeponte has joined #ruby
zigomir has quit [Quit: zigomir]
OdNairy has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
terrellt has joined #ruby
sambao21 has quit [Read error: Connection reset by peer]
kpshek has quit []
goleldar has joined #ruby
bigkevmcd has quit [Quit: Ex-Chat]
failshe__ has joined #ruby
bigkevmcd has joined #ruby
failshell has quit [Ping timeout: 248 seconds]
mneorr has joined #ruby
maZtah has quit [Remote host closed the connection]
g0bl1n has joined #ruby
kevind has quit [Ping timeout: 272 seconds]
kevind_ is now known as kevind
Clooth has joined #ruby
<wald0> variable = `command`.split.first heh, sounds simple, by other side i dont like much the `` way of call, i had lots of problems with that in the past on bash, i dont remember what exactly
saarinen has joined #ruby
saarinen has quit [Client Quit]
Anticom has quit [Quit: Nettalk6 - www.ntalk.de]
`Chris` has quit [Read error: Connection reset by peer]
<shevy> wald0 he just shells out that way
failshe__ is now known as failshell
<shevy> in bash you could just type: sed, in ruby you would have to do: `sed`
`Chris` has joined #ruby
Es0teric has joined #ruby
<havenwood> wald0: Similar in looks to bash's backticks, and similar caveats (can't nest em without escaping).
<shevy> wald0 in theory you could use pure ruby for everything
<shevy> so, someone replace sed please!!!
sambao21 has joined #ruby
gyzmodo has joined #ruby
zastern has joined #ruby
<wald0> shevy: yeah, im trying to asimilate that lol
saarinen has joined #ruby
<havenwood> wald0: But no $() preffered way, back-ticks are all good and you can %x|| if you need to.
<MrZYX> what can sed do that ruby can't?
burlyscudd has quit [Quit: Leaving.]
p8952 has quit [Ping timeout: 248 seconds]
kirun has quit [Ping timeout: 272 seconds]
<billiam> run without ruby installed.
<shevy> hehehe
chihhsin has joined #ruby
<MrZYX> well, ruby can run without sed installed
<havenwood> sed can't run without sed installed, at least not unless they've added that feature recently
<havenwood> >.>
ffranz has quit [Ping timeout: 265 seconds]
<wald0> havenwood: well, i have read some exacmples about how to run commands in ruby, the optimal way that i have found was popen4 (yes, 4, not less), but by other side is much longer to code than `` lol
aspiers has quit [Ping timeout: 252 seconds]
<havenwood> wald0: Totally depends what you're doing.
<shevy> yes
<shevy> it's always longer
<shevy> that's why people use ``
<havenwood> wald0: pid = fork { exec 'command' }; Process.wait pid
<havenwood> wald0: ^ is backticks basically
<wald0> mmh
<shevy> cool
<shevy> `` gives back the pid?
zeade has joined #ruby
<havenwood> shevy: no, just grabbing that so we can wait on it, otherwise script just keeps going before shell returns
<shevy> I'd wish popen4 would be easier to use, I always have to lookup how to use it :(
<havenwood> shevy: i'd have to keep going to really be a full backticks
pel_daniel has joined #ruby
Shidash has joined #ruby
rurban has quit [Ping timeout: 263 seconds]
lukec has quit [Quit: lukec]
<havenwood> shevy: but not much more, just return the value
<wald0> shevy: i have read about it and seems to fit all the needs (stderr/stdin/stdout reading, pid, etc)
popl has joined #ruby
popl has joined #ruby
popl has quit [Changing host]
popl has quit [Client Quit]
nazty has joined #ruby
Guest67011 has joined #ruby
<havenwood> wald0: When ``, system, exec, and popen aren't enough, you've got popen2, popen3, popen4, why so many popen!?
ffranz has joined #ruby
RicFlair is now known as ArchBeOS
jbpros has quit [Quit: jbpros]
<havenwood> wald0: Or just plain ole popen :P http://www.ruby-doc.org/core-2.0.0/IO.html#method-c-popen
Guest67011 has quit [Client Quit]
popl_ has joined #ruby
popl_ has joined #ruby
popl_ has quit [Changing host]
Monie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
momomomomo has joined #ruby
anderson has joined #ruby
kpshek has joined #ruby
<wald0> havenwood: yeah, why so many popen, idk, i just have see that popen4 is the more complete one (with features that I may need)
<havenwood> wald0: Think `` for running and returning to parent process with the value, system for returning to parent process with `true` or `false`, exec for not returning to parent process at all just replacing
momomomomo has quit [Client Quit]
<havenwood> wald0: and yeah, popen or popen4 when you need more
bartj3 has joined #ruby
rickmasta has quit [Quit: Leaving...]
iamjarvo has joined #ruby
pyrac has joined #ruby
p8952 has joined #ruby
hashpuppy has quit [Quit: hashpuppy]
mrsolo has quit [Quit: This computer has gone to sleep]
s_e has quit [Excess Flood]
leonidlm has quit [Ping timeout: 245 seconds]
zastern has quit [Remote host closed the connection]
s_e has joined #ruby
mrsolo has joined #ruby
Monie has joined #ruby
Verbatino has joined #ruby
ninegrid has quit [Ping timeout: 260 seconds]
mrsolo has quit [Client Quit]
<cwong2012> i have an array hosts[host1, host2, host3], array ports[111, 222, 333]. i want to do a each loop to go thru the hosts list, then i would like to display the port number for that current element, as in ports[0], ports[1], and so on. not sure what the syntax..
nowthatsamatt has joined #ruby
Stygia has quit [Quit: Leaving]
mikepack has quit [Ping timeout: 245 seconds]
ghr has quit [Quit: Computer has gone to sleep.]
mrsolo has joined #ruby
failshell has quit [Remote host closed the connection]
michael_mbp is now known as zz_michael_mbp
failshell has joined #ruby
ezkl has joined #ruby
mmitchell has joined #ruby
<ReachingFarr> workmad3: Sorry, my boss showed up to talk. In case you were still willing to help: https://gist.github.com/chriswailes/7200825
jonathanwallace has joined #ruby
<havenwood> wald0: I guess IO.open being in core is nice, And then Open3.popen3 in stdlib is honestly the most I've needed, just a require away. I can't remember what exactly the POpen4 gem adds, looks like something about exit statuses.
<havenwood> ReachingFarr: gem install rake
<havenwood> or `bundle`
<MrZYX> cwong2012: where does that data come from? can't you build a hash instead?
<MrZYX> or an array of two element arrays?
<havenwood> wald0: Might consider using popen3 and drop a dependency, dunno.
Ripp__ has quit []
<cwong2012> MrZYX: if its possible i would like to have it in 2 arrays.
zigomir has joined #ruby
<MrZYX> okay, so the ugly way is to use #each_with_index on one, another option is to #zip them together
gawaine has joined #ruby
<workmad3> ReachingFarr: oh bleh, how did you install ruby?
ninegrid has joined #ruby
<havenwood> >> Hash[[:host1, :host2, :host3].zip [22, 433, 3000]]
<eval-in> havenwood => {:host1=>22, :host2=>433, :host3=>3000} (https://eval.in/58057)
gawaine has quit [Client Quit]
failshell has quit [Ping timeout: 260 seconds]
<havenwood> cwong2012: The zip way MrZYX mentioned.
<havenwood> ^
<wald0> havenwood: i dont remember what makes me research in popen4 that was not in 3 but yeah, maybe exit status (very needed)
sepp2k has quit [Quit: Konversation terminated!]
<havenwood> wald0: can still get with $:.exitstatus, but yeah maybe popen4 handles it more elegantly
kpshek has quit []
olivier_bK has quit [Ping timeout: 245 seconds]
<havenwood> $?.exitstatus**
<ReachingFarr> workmad3: This is on a Fedora 19 machine, so "sudo yum install ruby"
blackmesa has quit [Quit: WeeChat 0.4.2]
<havenwood> asking $LOAD_PATH for an exitstatus isn't going to work, confused on Perl gibberish ftl :P
lukec has joined #ruby
<havenwood> $? $? $?
g0bl1n has quit [Quit: g0bl1n]
<wald0> havenwood: $:.exitstatus? mmh, i think that i still need to read more ruby, btw what book you recommend me ?
fgo_ has joined #ruby
<havenwood> wald0: for this type stuff, Jesse Storimer
<workmad3> ReachingFarr: :(
OdNairy has joined #ruby
mary5030 has quit [Remote host closed the connection]
<|jemc|> ReachingFarr: I'm on Fedora - the distro like many others doesn't keep up quickly with new releases of ruby
<|jemc|> use rbenv or rvm or somesuch
<|jemc|> I use rbenv
<havenwood> Far as i heard, latest Fedora ships with 2.0.0-p247.
<havenwood> chruby.
mary5030 has joined #ruby
<havenwood> You guys just aren't using latest Fedora! :P
fgo has quit [Ping timeout: 268 seconds]
<|jemc|> Fedora 20 isn't released yet
<|jemc|> afaik
<havenwood> 19
Shidash has quit [Quit: Leaving.]
<havenwood> has 2.0.0-p247 no?
<havenwood> latest stable*
lfox has joined #ruby
<workmad3> |jemc|: the bigger problems I tend to see with package-installed rubies aren't to do with keeping up to date (although there can be a problem there)
<MrZYX> havenwood: yup
<workmad3> |jemc|: the problem is that they tend to mangle the hell out of the ruby installs :(
<havenwood> ReachingFarr: What Ruby do you have? Which gem?: command -v ruby; ruby -v; gem -v
boxmein has quit [Quit: [02:26.00] <Ristovski> mozzarella filofax fadget]
<ReachingFarr> havenwood: Ruby is 2.0.0-p247
<havenwood> I think Fedora did a great job, user gem installs, latest Ruby.
<|jemc|> there you go
<ReachingFarr> Gem is 2.0.12
<|jemc|> except I'm using 2.1 preview now anyway
<havenwood> ReachingFarr: Grab latest RubyGems too: gem update --system
kirun has joined #ruby
larissa has quit [Quit: Leaving]
nazty has quit [Ping timeout: 240 seconds]
superscott[8] has joined #ruby
<havenwood> |jemc|: aye, 2.1.10 :)
<havenwood> |jemc|: but that betrays we aren't using 2.1.0-preview1 or later for RubyGems 2.2 :P
Liquid-- has quit [Quit: Computer has gone to sleep.]
tylersmith has joined #ruby
<|jemc|> I downloaded it mostly to have fun with decorators
jkline has joined #ruby
<ReachingFarr> havenwood: Gem is installed from an RPM package. I'm not sure having it update itself is a great idea.
tharindu has quit [Quit: Linkinus - http://linkinus.com]
mikecmpbll has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<ReachingFarr> havenwood: Why do I need the latest gem version? This seems like it is a configuration error.
mary5030 has quit [Ping timeout: 240 seconds]
<havenwood> ReachingFarr: You're sure RubyGems didn't ship with Ruby?
<wald0> shevy: have you see "shirt" ? https://github.com/jstorimer/shirt/blob/master/shirt
<workmad3> ReachingFarr: the times I've seen that particular thing happen, it's because the system environment was screwed up and the binaries created when installing gems got really messed up paths to the ruby version to use
<shevy> I wear a shirt wald0
<shevy> but no trousers when I code
tharindu has joined #ruby
<shevy> wald0 just taking a stab at the name of the project ;)
<havenwood> ReachingFarr: They used to ship separate gem back in 1.8 when it didn't come with Ruby.
<workmad3> ReachingFarr: and it's been a toss-up between it being something messed up by a package installed ruby/rubygems and a system ruby messing up with something like chruby or rvm :)
<shevy> ruby has so many awful names for projects... "shoes" ... "god" ... "unicorn" ...
DrShoggoth has quit [Remote host closed the connection]
<shevy> "prawn"
<havenwood> ReachingFarr: I stick with ruby-install and chruby so I don't have to know these things. :P
Verbatino has quit [Ping timeout: 240 seconds]
arturro has joined #ruby
<havenwood> ReachingFarr: But you should use a version of RubyGems that is safe to update.
<ReachingFarr> havenwood: Yeah, it is a separate package.
<havenwood> ReachingFarr: Whew! I was worried there for a sec. :)
<wald0> shevy: is a ruby shell! :)
<shevy> wald0 that code is not easy to understand, there are lots of lambdas
<workmad3> havenwood: ^^ that's part of what I mean with 'package managers mess it up' :)
arturro has quit [Client Quit]
<shevy> I see
<shevy> 'cd' => lambda { |dir = ENV["HOME"]| Dir.chdir(dir) },
lfox has quit [Remote host closed the connection]
achru has joined #ruby
<havenwood> ReachingFarr: AFAIK RedHat guys did Ruby installs reasonably, it is Debian that made such a horrible mess of things.
shredding has joined #ruby
Verbatino has joined #ruby
<havenwood> shevy: :)
lfox has joined #ruby
chihhsin_ has joined #ruby
<shevy> I don't get it... why does it use shellwords wald0?
chihhsin has quit [Ping timeout: 272 seconds]
<cwong2012> does this not work? puts ports["#{index}"]
<havenwood> shevy: To split, like the shell does.
<shevy> hmm
<shredding> Anyone knows this fbgraph connections?
<workmad3> ReachingFarr: can you gist the output of 'cat ~/.gem/bin/rake' please? that's most likely where things are snotted up :)
codelette has quit [Remote host closed the connection]
<MrZYX> cwong2012: show more context
kpshek has joined #ruby
<shevy> cwong2012 ports[] seems to be an array, but the author seems to want to use it like a hash. so obviously there is a problem
<shredding> It's a bit strange, as i can do user.accounts.first, user.accounts[4], but not user.accounts.each { ...
<havenwood> cwong2012: prolly cause you're interpolating your index in a string when an int is expected, but yeah who knows
achru has quit [Client Quit]
achru has joined #ruby
bricker has joined #ruby
<havenwood> shredding: include Enumerable
`Chris` has quit [Read error: Connection reset by peer]
<cwong2012> so this is what i want to do: http://pastebin.com/V0d8yCkD
<cwong2012> its super simple but i am new to ruby.
<ReachingFarr> workmad3: It fails on `gem 'rake, version`. It can successfully find rubygems, but rubygems doesn't appear to be searching the include path correctly.
`Chris` has joined #ruby
<shredding> havenwood: It extends Array, doesn't array include Enumerable?
<Hanmac> shredding: what kind of object does accounts return??
<Hanmac> extending Array itself is a shitty idea ...
<workmad3> ReachingFarr: yeah... can you gist that file please?
bean has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<MrZYX> cwong2012: fixed version: ports[index], nice version: {'host' => 123}.each do |host, port|
<havenwood> shredding: Enumerable is an ancestor of Array.
<ReachingFarr> workmad3: $: doesn't list the /home/me/.gem directory.
<shredding> connection itself extends collection which in turn extends Array
achru has quit [Client Quit]
<ReachingFarr> workmad3: I can, but there isn't anything in there that helps.
<cwong2012> MrZYX: oh.. let me try
<workmad3> ReachingFarr: can you please just gist it?
achru has joined #ruby
<shevy> hehe
<workmad3> ReachingFarr: I have an idea of what I'm looking for...
pyrac has quit [Quit: pyrac]
<shredding> havenwood: that's what i was thinking, but somehow i can not iterate over it.
<shevy> gold nuggets
Squarepy has quit [Quit: Leaving]
<wald0> havenwood: maybe a bit "too focused on unix", im looking to something more global (but not novice) about learning/use ruby for apps, daemons, scripts, etc
<shredding> hu, havenwood , Hanmac : if i do to_enum() it works!
<shredding> Somewhat counterintuitive, but okay.
zastern has joined #ruby
<workmad3> ReachingFarr: and GEM_PATH and GEM_HOME are both set correctly?
krawchyk_ has joined #ruby
<havenwood> shredding: maybe define #each yourself: loop do; yield pop end
<shredding> havenwood: what's wrong with to_enum?
<havenwood> shredding: nothing
<shredding> :)
barratt has quit [Ping timeout: 248 seconds]
<workmad3> ReachingFarr: or rather, is GEM_PATH set correctly to both the system and your home gem repo? as iirc, GEM_PATH is the important one when loading gems (GEM_HOME is where gems are installed to, GEM_PATH is where gems are looked for)
<ReachingFarr> workmad3: I'm beginning to suspect not. What is the distinction between those two?
popl_ is now known as popl
<workmad3> ReachingFarr: and no, ~/.gem won't be on $:, it never is :)
<havenwood> ReachingFarr: GEM_PATH is a colon-separated list of gem repository directories and GEM_HOME is the default repository location for gem installation.
<workmad3> ReachingFarr: rubygems will activate a gem and then add the directories in that gem to $:
ananthakumaran1 has quit [Quit: Leaving.]
<ReachingFarr> workmad3: Right.
<ReachingFarr> havenwood: Thanks. Let me see if this fixes things.
rbennacer has joined #ruby
<rbennacer> hey guys
<rbennacer> anyone here>
<rbennacer> ?
<workmad3> rbennacer: nope
krawchyk has quit [Ping timeout: 265 seconds]
sepp2k has joined #ruby
* workmad3 always wonders what answer people expect to that
kevinykchan has quit [Ping timeout: 272 seconds]
axl_ has joined #ruby
<shevy> 42
jlebrech has quit [Quit: Konversation terminated!]
<MrZYX> 23
<shevy> rbennacer are you using ruby?
<rbennacer> yesss
<rbennacer> i love ruby
jlebrech has joined #ruby
kevinykchan has joined #ruby
<havenwood> ReachingFarr: chruby and its manpage are a nice reference for how to set everything up correctly, even if you don't opt to use chruby: https://github.com/postmodern/chruby#readme
<shevy> \o/
<shredding> havenwood: This enumerable module was the point where i fall in love with ruby, so i'll be using to_enum :)
<havenwood> <3
<ReachingFarr> OK, fixed.
<ReachingFarr> It was the mixup between GEM_PATH and GEM_HOME
<shevy> enumerable is really cool
Lewix has joined #ruby
Lewix has joined #ruby
Lewix has quit [Changing host]
<rbennacer> i was wondering if there is some sort of ruby gem that would help me to extract topics from a tweet
<ReachingFarr> Oddly, those don't seem to be getting set through .gemrc, or the environment variables are overriding them.
<shevy> rbennacer sounds a bit specialized. what kind of tweet? twitter?
<rbennacer> yes
kpshek has quit []
<MrZYX> topics = hashtags?
<rbennacer> no
<shevy> but I have no idea if it is useful
<rbennacer> general idea of what the tecxt is about
m8 has joined #ruby
<shevy> rbennacer, often though when these projects stink, they may still have some useful content, so you could perhaps build your own if these suck
<MrZYX> the twitter gem is pretty much a one to one API wrapper, last time I checked
<rbennacer> MrZYX, this is not what i am looking for though
kidoz has joined #ruby
<ReachingFarr> Thanks for the help everyone. Got to run.
<rbennacer> i am able to get the tweets and then i want to parse them and extract the topics so i can build a realtime heatmap
<MrZYX> yeah, I think you want to research general algorithms for that problem first, makes it easier to search for implementations of that algorithms in ruby
habanany has joined #ruby
aspiers has joined #ruby
<havenwood> shredding: Here's an example along the lines of what I was thinking: https://github.com/avdi/ruby/blob/6da6caa266609a1dc422bb5d77bbbee09db8ba56/lib/thread.rb#L255-268
<rbennacer> i have no idea where to start :)
Guest88379 has quit [Ping timeout: 245 seconds]
<havenwood> shredding: Basically a to_enum like you were doing, or a loop to iterate if a block is given.
tatsuya_o has quit [Remote host closed the connection]
<havenwood> shredding: Nothing wrong with a simple #to_enum though. :)
jibi has quit [Quit: .]
a1ph4g33k has joined #ruby
brtdv has joined #ruby
rezzack has joined #ruby
<shredding> havenwood: I guess I'll need other methods as well, already using select.
<shredding> havenwood: but thanks for the input, as I'm new to ruby it's really helpful!
kobain has joined #ruby
capicue has joined #ruby
<havenwood> shredding: i dunno the most elegant way to do it, nice to get all the enum methods
JRizzle has quit [Quit: This computer has gone to sleep]
Ox6abe has quit [Remote host closed the connection]
yfeldblu_ has joined #ruby
julian-delphiki has joined #ruby
<a1ph4g33k> Good morning folks ...
Ox6abe has joined #ruby
<havenwood> a1ph4g33k: g'morning
Liquid-- has joined #ruby
Liquid-- has quit [Client Quit]
<rbennacer> havenwood, there is no algorithm for topic extraction there
Liquid-- has joined #ruby
yfeldblu_ has quit [Read error: Connection reset by peer]
<shevy> in a regex... how could I optionally match for "either a following ' ' character, or end of line"?
kpshek has joined #ruby
JohnBat26 has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
<shevy> is that with | ?
zastern has quit [Remote host closed the connection]
yfeldblu_ has joined #ruby
<shevy> hmm
<shevy> rubular says yes
<a1ph4g33k> shevy, yes.
<havenwood> rbennacer: there is too :P
<shevy> okies
shaunbaker has quit [Ping timeout: 252 seconds]
kpshek has quit [Client Quit]
<a1ph4g33k> make a group, and use | within.
<havenwood> rbennacer: i meant to be linking to the embedded talk, but ilya does also has great writeups and links to such capable algorithms
<havenwood> also have**
yfeldblum has quit [Ping timeout: 245 seconds]
bean__ has quit [Ping timeout: 248 seconds]
<a1ph4g33k> example: /foo( |$)/
jhaals has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<a1ph4g33k> will match foo as end of word or end of line.
<havenwood> rbennacer: Wanna build your own, or you're looking for a gem that already has that functionality all wrapped up?
atmosx has joined #ruby
<havenwood> rbennacer: If the latter, disregard my link. :O Machine learning... hehe
<rbennacer> i would prefer to find a gem that has this functionality
tatsuya_o has joined #ruby
Ox6abe has quit [Ping timeout: 272 seconds]
<a1ph4g33k> so, havenwood, I've used pry ... but hear about a debugger that uses it ? and is there any extended stuff specific to rails also ?
<havenwood> a1ph4g33k: yeah, integration with rails console
<shevy> a1ph4g33k hmm, is the () group necessary?
<a1ph4g33k> I mean, I just use: require 'pry'; binding.pry ( on an error )
pyrac has joined #ruby
<havenwood> a1ph4g33k: if you're on 2.0, the debugger is pry-byebug: https://github.com/deivid-rodriguez/pry-byebug#readme
<a1ph4g33k> shevy, as long as it is only 1 char you care about, no.
Verbatino has left #ruby [#ruby]
<a1ph4g33k> otherwise, the group allows for : /foo( and more|$)/
Xeago has joined #ruby
<havenwood> next, next, finish :)
<a1ph4g33k> I'm all 2.0 @ this point.
camilasan has quit []
bassclef has joined #ruby
momomomomo has joined #ruby
<goleldar> anyone know how to disable cookies in a cucumber test using phantomjs?
c0rn has joined #ruby
<a1ph4g33k> other than normal pry functionality does the integration with the rails console provide any other benefits ( not that the normal functionality isn't enough ) ... just wanting to know if there are any bonus' features beyond the expected.
sambao21 has quit [Quit: Computer has gone to sleep.]
bassclef is now known as Guest68577
Notte has joined #ruby
<andrewvos> Given a path /one/two/three.file how do I safely get /two/three.file?
tharindu has quit [Quit: Linkinus - http://linkinus.com]
<andrewvos> Want to remove the first part
<havenwood> rbennacer: Maybe try the summarize gem, i've not personally used it but saw it used to neat effect in a project: https://github.com/ssoper/summarize#readme
<shevy> andrewvos you could .split('/') and rejoin all but the first element?
ph8 has quit [Ping timeout: 260 seconds]
carraroj has joined #ruby
dorei has joined #ruby
momomomomo has quit [Client Quit]
burlyscudd has joined #ruby
tharindu has joined #ruby
<havenwood> rbennacer: Not a lot of activity on the gem, but maybe it *just works*.
tatsuya_o has quit [Remote host closed the connection]
yfeldblu_ has quit [Remote host closed the connection]
Ox6abe has joined #ruby
<andrewvos> shevy: But what if the path contains \/?
tvw has quit []
bricker_ has joined #ruby
<rbennacer> havenwood, i will give it a try
<rbennacer> thanks
tatsuya_o has joined #ruby
bricker has quit [Ping timeout: 272 seconds]
<shevy> andrewvos well you could use a simple if/else and check for \/ first, then for /
bricker_ is now known as bricker`work
Xeago has quit [Ping timeout: 246 seconds]
<andrewvos> shevy: I was thinking more along the lines of a built in method
<|jemc|> File.dirname and File.basename exist, but neither is quite what you want
<havenwood> andrewvos: File.split('/two/three.file?')
<havenwood> andrewvos: but yeah, you could do it otherwise, hmm
<andrewvos> havenwood: Oh nice! I've never seen split :)
<a1ph4g33k> andrewvos, input.split( '/', 2 )[1]
bricker`LA has quit [Disconnected by services]
iamjarvo_ has joined #ruby
<a1ph4g33k> only thing it won't handle are files in the root directory ...
<andrewvos> havenwood: Oh wait that doesn't work
Zai00 has quit [Quit: Zai00]
iamjarvo_ has quit [Remote host closed the connection]
<|jemc|> you'll have to call File.split recursively
<a1ph4g33k> andrewvos, input.split( '/', ( input[0] == '/' ? 3, 2 ) ).last
iamjarvo_ has joined #ruby
<shevy> hmm ... regex question ...
<shevy> >> regex = /(\/.+)($| )/; string = "foo /Programs bar"; string.match(regex); puts $1
<eval-in> shevy => /Programs bar ... (https://eval.in/58061)
<andrewvos> >> File.split("/one/two/three.file")
<eval-in> andrewvos => ["/one/two", "three.file"] (https://eval.in/58062)
iamjarvo has quit [Read error: Connection reset by peer]
<andrewvos> lame
<shevy> why does this include "bar"? I'd like it to stop before it reaches the next word
<|jemc|> because '.' includes ' '
cina has joined #ruby
<shevy> aaaah
<a1ph4g33k> shevy, because .+ is greedy.
<|jemc|> so perhaps replace '.' with [^\s]
burlyscudd has quit [Ping timeout: 272 seconds]
<|jemc|> yeah, or replace + with +?
iamjarvo has joined #ruby
<andrewvos> File.split seems a bit weird to me
tatsuya_o has quit [Ping timeout: 260 seconds]
iamjarvo has quit [Remote host closed the connection]
<andrewvos> "See File.split. Returns the dirname and the basename in an Array."
<havenwood> andrewvos: base, dir = File.split(File.dirname(filename)), File.basename(filename)
iamjarvo_ has quit [Read error: Connection reset by peer]
kidoz has quit [Quit: Ухожу я от вас]
iamjarvo has joined #ruby
<shevy> |jemc| hmm what is +? it means optional?
<havenwood> dunno where i was going with that >.>
cina has quit [Remote host closed the connection]
<|jemc|> shevy: ? after + or * makes the + or * lazy instead of greedy
<a1ph4g33k> shevy, it tells the regex to match as small a portion as possible.
<shevy> aha
MrPoT4tO has joined #ruby
16WABCXCC has joined #ruby
<shevy> I did hear the word greedy quite often, but that is one of the few times I actually read about a lazy regex :)
<andrewvos> Seems to have the codez
osvico has quit [Ping timeout: 262 seconds]
<shevy> thanks, the regex seems to work now finally
<shevy> how or where did you guys learn about regexes?
sambao21 has joined #ruby
<MrZYX> the internet :P
cina has joined #ruby
<a1ph4g33k> lots of study.
<a1ph4g33k> ... and I don't believe lazy is the correct term ...
DonRichie has quit [Quit: Verlassend]
<a1ph4g33k> but ... after checking ... I'm wrong.
<shevy> MrZYX really?
<MrZYX> yeah
<shevy> hmm... I read a perl book once... but never finished... like 10 years ago. I feel as if I need to read something again, I struggle way too much :(
<a1ph4g33k> I've also heard reluctant and sadly "ungreedy"
<MrZYX> I think it helps to read through a sort of reference a few times, like http://www.regular-expressions.info, so you have an idea of what's there and then come back to it with actual problems you need to solve
arietis has quit [Quit: Computer has gone to sleep.]
<a1ph4g33k> shevy, a copy of "Mastering Regular Expressions" can take you a long way.
<dorei> aint regexes equivelant with deterministic automata?
jkline has quit [Quit: jkline]
<a1ph4g33k> many regex engines use finite automata.
ahawkins has joined #ruby
troessner has quit [Quit: Leaving]
noop has joined #ruby
gchristensen has joined #ruby
carraroj has quit [Ping timeout: 240 seconds]
<a1ph4g33k> brb
a1ph4g33k has quit [Quit: Leaving]
ph8 has joined #ruby
dkamioka has quit [Ping timeout: 240 seconds]
geekbri has quit [Remote host closed the connection]
iamjarvo_ has joined #ruby
interactionjaxsn has quit [Remote host closed the connection]
arietis has joined #ruby
interactionjaxsn has joined #ruby
endash has quit [Quit: endash]
dkamioka has joined #ruby
<havenwood> >> class File; def self.container filename; basename, dirname = File.split(filename); File.join(File.split(basename).last, dirname) end end; File.container "/one/two/three.file"
<eval-in> havenwood => "two/three.file" (https://eval.in/58064)
momomomomo has joined #ruby
kleinerdrache has joined #ruby
jkline has joined #ruby
<atmosx> bcrypt-ruby handles both hash and salt of passwords right?
<apeiros> >> filename = "/one/two/three.file"; filename[%r{[^/]+/[^/]+\z/]
<eval-in> apeiros => /tmp/execpad-ee7c996e63ea/source-ee7c996e63ea:2: unterminated regexp meets end of file ... (https://eval.in/58065)
<apeiros> blerp
<apeiros> >> filename = "/one/two/three.file"; filename[%r{[^/]+/[^/]+\z}]
<eval-in> apeiros => "two/three.file" (https://eval.in/58066)
lmadrigal has joined #ruby
iamjarvo has quit [Ping timeout: 272 seconds]
sbos99 has joined #ruby
ph8 has quit [Quit: Bye]
interactionjaxsn has quit [Ping timeout: 240 seconds]
obs has quit [Quit: ChatZilla 0.9.87 [Iceape 2.7.12/20130119095535]]
mneorr has quit [Remote host closed the connection]
interactionjaxsn has joined #ruby
rickmasta has joined #ruby
chihhsin_ has quit [Quit: leaving]
MrPoT4tO has quit [Read error: Connection reset by peer]
16WABCXCC has quit [Read error: Connection reset by peer]
chihhsin has joined #ruby
MrPoT4tO has joined #ruby
iamjarvo_ has quit [Ping timeout: 272 seconds]
barratt has joined #ruby
mrpot4to_ has joined #ruby
starfox21 has quit [Quit: starfox21]
cina has quit [Quit: leaving]
<havenwood> apeiros: nice :)
jonahR has joined #ruby
Linux_Extremist has joined #ruby
kenneth has joined #ruby
mikepack has joined #ruby
<havenwood> i can almost make out an emoji face too
adambeynon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<apeiros> I'd love to say "you learn that stuff when you have to process thousands of filenames and need it FAST" - but tbh I'm just lazy and that's the shortest code I could come up with in a reasonable time :D
jonahR has quit [Client Quit]
Senjai has joined #ruby
Senjai has quit [Changing host]
Senjai has joined #ruby
brennanMKE has quit [Remote host closed the connection]
<shevy> hmm with .include? we can check on a string for one argument, like '[', but is there a simple way to check a string for containing both two characters at the same time, '[' and ']' (closing tag for '['? I could use two separate .include? but that feels a bit cumbersome
jonr22 has joined #ruby
goleldar has quit []
carraroj has joined #ruby
tylersmith has quit [Remote host closed the connection]
lmadrigal has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
tylersmith has joined #ruby
<havenwood> shevy: class String; def include_all? *args; args.all? { |arg| include? arg } end end
geekbri has joined #ruby
mikepack has quit [Remote host closed the connection]
kevind has quit [Quit: kevind]
klaus_ has joined #ruby
bean has joined #ruby
jeer_ has quit [Ping timeout: 245 seconds]
<havenwood> i'm on a horrible freedom patching bent today... MONKEY PATCH ALL THE THINGS \o/
headius has quit [Quit: headius]
jonr22 has quit [Ping timeout: 264 seconds]
elaptics is now known as elaptics`away
<havenwood> shevy: "hiya there".include_all? 'ya', 'the' #=> true
snovak_ has quit [Read error: Connection reset by peer]
fgo_ has quit [Remote host closed the connection]
Sauvin has quit [Remote host closed the connection]
snovak has joined #ruby
Lewix has quit [Remote host closed the connection]
failshell has joined #ruby
<shevy> hehe
<shevy> I used to patch everything like that
<shevy> but when distributing to others, it becomes annoying to have to ensure that they also have all my modifications :(
zeropx has quit [Quit: has left the room … Or did he?]
<havenwood> refinements ftw?
<banisterfiend> shevy can i beat u around a bit
<banisterfiend> just a lil
snovak_ has joined #ruby
zeropx has joined #ruby
<shevy> I still have not truly understood refinements
aspires has quit [Quit: sudo making a sandwich]
<banisterfiend> they are a bit confusing
IceDragon has quit [Ping timeout: 240 seconds]
<banisterfiend> so is 'prepend' though
caitp has left #ruby ["Leaving"]
<havenwood> shevy: think a locally scoped monkeypatch, just applies in the module within the file it is actually in
failshell has quit [Remote host closed the connection]
failshell has joined #ruby
<havenwood> shevy: they change in 2.1 a bit, in a somewhat annoying way, as for the moment they don't work in top level
axl_ has quit [Quit: axl_]
klaus_ has quit [Quit: Verlassend]
<banisterfiend> havenwood what happens if you refine 'string' within a file, and then pass out that string to another method (defined in another file), i guess those refinements no longer apply?
<banisterfiend> so the same object behaves differently in two different contexts?
<havenwood> banisterfiend: yup, doesn't apply at all
mary5030 has joined #ruby
<havenwood> i want it back on top level
wildroman has quit []
<havenwood> don't make me go inside modules for include and using to work!!
ephemerian has quit [Quit: Leaving.]
mary5030 has quit [Remote host closed the connection]
axl_ has joined #ruby
snovak has quit [Ping timeout: 272 seconds]
kevind has joined #ruby
mary5030 has joined #ruby
tatsuya_o has joined #ruby
pr0ggie has joined #ruby
pdimitrov has joined #ruby
banisterfiend has quit [Quit: Computer has gone to sleep.]
mengu has joined #ruby
<havenwood> banisterfiend: oh yeah, kyrylo fixed prepend to work on top level like include: https://bugs.ruby-lang.org/issues/8959
gchristensen has left #ruby ["WeeChat 0.4.0"]
aspires has joined #ruby
banisterfiend has joined #ruby
<havenwood> now if someone would fix `using` to work likewise...
<havenwood> i need to learn C better (read 'at all')
pyrac has quit [Quit: pyrac]
<banisterfiend> havenwood so
<banisterfiend> havenwood if i pass a string created elsewhere into a module defined in a file that has a refined String class, then methods appear miraculously on the passed-in string?
<havenwood> sec phone, i need whole brain to try to think about this lol - back in a min
Lewix has joined #ruby
Lewix has joined #ruby
Lewix has quit [Changing host]
brennanMKE has joined #ruby
rahulkmr has quit [Ping timeout: 265 seconds]
Lewix has quit [Remote host closed the connection]
<shevy> hehe
Al_ has quit [Quit: Al_]
Tamae has quit [Ping timeout: 248 seconds]
felixjet has quit [Read error: Connection reset by peer]
pyrac has joined #ruby
einarj has joined #ruby
tharindu has quit [Quit: Leaving...]
achru has quit [Remote host closed the connection]
barratt has quit [Quit: Leaving...]
achru has joined #ruby
habanany has quit [Ping timeout: 240 seconds]
kleinerdrache has quit [Read error: No route to host]
anderson has quit [Ping timeout: 240 seconds]
mengu has quit [Remote host closed the connection]
IceDragon has joined #ruby
dkamioka has quit [Read error: Connection reset by peer]
mengu has joined #ruby
mengu has joined #ruby
mengu has quit [Changing host]
achru has quit [Read error: Operation timed out]
dkamioka has joined #ruby
awc737 has quit [Excess Flood]
kleinerdrache has joined #ruby
zeade has quit [Quit: Leaving.]
awc737 has joined #ruby
einarj has quit [Ping timeout: 272 seconds]
Karpuragauram has joined #ruby
hiyosi has quit [Ping timeout: 245 seconds]
zeade has joined #ruby
blaxter_ has quit [Quit: foo]
blackratdog has joined #ruby
chrisja has quit [Quit: leaving]
rdark has quit [Quit: leaving]
a1ph4g33k has joined #ruby
mengu has quit [Ping timeout: 256 seconds]
snovak_ has quit [Remote host closed the connection]
snovak has joined #ruby
rahulkmr has joined #ruby
rahulkmr has quit [Max SendQ exceeded]
bartj3 has quit [Quit: quit]
ybart has quit [Quit: ybart]
rahulkmr has joined #ruby
pyrac has quit [Quit: pyrac]
denken has quit [Quit: leaving]
bartj3 has joined #ruby
Karpuragauram has quit [Quit: Ex-Chat]
Vivekananda has quit [Quit: Ex-Chat]
Vivekananda has joined #ruby
kleinerdrache has quit [Read error: Operation timed out]
soheil has quit [Remote host closed the connection]
Liquid-- has quit [Ping timeout: 272 seconds]
soheil has joined #ruby
bartj3 has quit [Client Quit]
pyrac has joined #ruby
brtdv has quit []
bartj3 has joined #ruby
Vivekananda is now known as helloWorld
Ox6abe has quit [Remote host closed the connection]
helloWorld is now known as VivekanandaIndia
Ox6abe has joined #ruby
VivekanandaIndia is now known as Vivekananda
soheil has quit [Read error: Connection reset by peer]
soheil has joined #ruby
jkline has quit [Quit: jkline]
danshultz has quit [Remote host closed the connection]
goleldar has joined #ruby
danshultz has joined #ruby
burlyscudd has joined #ruby
danshultz has quit [Read error: Connection reset by peer]
gyzmodo has quit [Remote host closed the connection]
carif has quit [Ping timeout: 272 seconds]
danshultz has joined #ruby
bartj3 has quit [Client Quit]
c0rn has quit [Quit: Computer has gone to sleep.]
Ox6abe has quit [Ping timeout: 241 seconds]
<ageis> can someone look at my mkmf.log and tell me why nokogiri is not building
sambao21 has quit [Quit: Computer has gone to sleep.]
bartj3 has joined #ruby
<|jemc|> not if you don't post it somewhere for us to see
<popl> ^
kleinerdrache has joined #ruby
<popl> well unless he gives someone remote access to his machine
<|jemc|> I don't work at the NSA, so I don't
mlpinit has quit [Remote host closed the connection]
<Hanmac> ageis: did you have ruby-full package installed? and also make? (you also need C and maybe C++ compiler)
sambao21 has joined #ruby
Papipo has quit [Quit: Leaving.]
<popl> ageis: There's a pastebin URL in the topic. :)
yfeldblum has joined #ruby
<Hanmac> popl: wrong its a gist URL ;P
bartj3 has quit [Client Quit]
brennanMKE has quit [Remote host closed the connection]
<havenwood> banisterfiend: they've gone and confused the bejesus out of me with 2.1. :P I need to forget what i know and start over, lol.
yfeldblum has quit [Remote host closed the connection]
burlyscudd has quit [Ping timeout: 260 seconds]
brennanMKE has joined #ruby
<popl> Hanmac: I typed pastebin, not Pastebin.
mrsolo has quit [Quit: This computer has gone to sleep]
sambao21 has quit [Client Quit]
<Senjai> What should I set my max line length in my editor too again? Isn't the standard 80 characters?
<Senjai> iirc
<popl> there is no standard
<|jemc|> 80 is most common
<ageis> Hanmac: got all that mang. I've don this before. I'm downright perplexed. Will paste.
<havenwood> banisterfiend: at least they've already updated the documentation, i have a place to start :)
<jblack> Yeah, 80 is very common.
<a1ph4g33k> Senjai, the "standard" was defined when we were all using text terminals that were 80x25 ...
<havenwood> banisterfiend: " if you require or load a file or call a method that is defined outside the current scope the refinement will be deactivated"
<|jemc|> havenwood: ugh, I looked at refinements, thought they were cool at first, then started to think they were a bad idea
<Senjai> a1ph4g33k: right, but it's still a best practice isn't it
<a1ph4g33k> many people try to still adhere to it, but it is an artifact of a time long ago.
bartj3 has joined #ruby
<|jemc|> havenwood: but maybe my opinion will flip again
<a1ph4g33k> whatever your team wants to be the standard is best practice.
<havenwood> |jemc|: I think it is great, personally. I mean I don't have to implement it, so as just a lazy user i'm thrilled. :P
<|jemc|> the scoping of it throws me for a loop
<jblack> senjai: It's generally a good practice to keep your line complexity down, and that implies shorter lines.
<havenwood> |jemc|: i like the lexical scoping, while refined it is your thing, leave the class or even file, poof gone
tonni has joined #ruby
felixjet has joined #ruby
aspires has quit [Quit: sudo making a sandwich]
<|jemc|> I'm probably just being crochety
<|jemc|> need to give it a third look
mlpinit has joined #ruby
bartj3 has quit [Client Quit]
magbeat has joined #ruby
<havenwood> i like giving myself sugar without worrying about trampling, would be like if we'd never had local variables and they just got introduced :P
<ageis> Hanmac popl: https://gist.github.com/ageis/7202731 selected gem_make.out and mkmf.log
<jblack> Who wants to parse a 180 character line of code. The code would likely be more clear if it were moved into a descriptive subruotine
<popl> jblack: some people use large monitors in conjunction with higher resolutions.
<|jemc|> havenwood: yeah, I think it's addressing a very real need in Ruby - I can agree there
<a1ph4g33k> but ... it is very common for folks to use 80. ( for both the "long lines are harder to visualize" and the "some people don't like change" reasons )
<ageis> Hmac: I don't have ruby-full
<|jemc|> havenwood: monkey patching has some terrible consequences sometimes
<Senjai> I remember reading somewhere that line-lenghth also reduces stress for readers at the 80 - 120 character level
pyrac has quit [Quit: pyrac]
<|jemc|> havenwood: so have they nailed down the implementation of it yet, or is it still up in the air?
<ageis> Hmac: installed ruby-full, still same problem
<Hanmac> ageis: hm did you try nokogiri version 1.6.0 ?
<havenwood> |jemc|: yeah, nailed down, at least dropped the experimental bit
<|jemc|> havenwood: I thought I read that it was probably going to be different in the final release of 2.1
<|jemc|> havenwood: ah okay
<ageis> Hanmac: i suspect it's my gcc version
goleldar has quit [Remote host closed the connection]
<popl> ageis: "You have to install development tools first."
<|jemc|> havenwood: well, then it sounds like I need to go back to it then
<ageis> Hanmac: will now
<ageis> popl: everything is installed, trust me
<ageis> all ibraries, dependencies
<jblack> popl: I'm not even considering linewrapping. I'm thinking simple code complexity. if (this and that and theother and somelong_thing_here and hash[:this][:that] is far less readable than verify_valid(state)
<ageis> been over that
goleldar has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
aspires has joined #ruby
shredding has quit [Quit: shredding]
<Hanmac> ageis, hm yeah that maybe too ... i mean why is your GCC version only 4.4.7 ?
<jblack> I'm sure there's plenty of occasions where a long line is the most readable code, but as a rule of thumb, short is sweet
<popl> ageis: That phrase is silly. :P
<ageis> hanmac: I'm on a mixed- squeeze/wheezy system here, that's why I think this is happening. some of the shit got installed with the old gcc, and now its getting mixed w the new
<|jemc|> I like 80 columns, it fits just about right with two panes on my portrait mode display
<jblack> A line that is 200 characters long is trying to do more than one thing at once, and that's definitely a code smell.
<ageis> nokogiri 1.6.0 is compiling right now though
<havenwood> |jemc|: everyone says monkey-patching has terrible consequences sometimes but i've never seen the mayhem happen, i wish people would monkeypatch more until i get to see it
bartj3 has joined #ruby
tatsuya_o has quit [Remote host closed the connection]
<popl> We were not talking about lines that long were we?
<popl> Oh, 180 character. I see.
bartj3 has quit [Client Quit]
mrapple is now known as MonsieurApple
<popl> Were we counting whitespace? :P
<Hanmac> ageis: i upated my os on saucy ... it is fun .. you should test newer software if possible
<havenwood> |jemc|: nnoooooess, i'm already overriding Array.split, you too?! chaos!!!
goleldar has quit [Read error: No route to host]
<jblack> I made up 180 characters arbitrarily too. I was picking something "long". I suppose 83 characters is > 80 as well, and if 80 is good, then surely 83 is ok too....
<ageis> Hanmac: sucks because the server needs to be spec'd to host websites that depend on PHP 5.3
<|jemc|> havenwood: I think ruby is in need of a standard way to override a function while still calling the old one within - the current "standard" of aliasing it to some unique name before overriding is too clumsy
<jblack> for what it's worth, my console is 80 characters to this day. =)
weirdpercent has joined #ruby
<popl> I have colorcolumn=81 in ~/.vimrc
baordog_ has joined #ruby
goleldar has joined #ruby
<havenwood> |jemc|: hmm
<popl> I'm old, though.
<a1ph4g33k> ... I tend to use very small fonts on screen ... so 80 chars some times feels about as wide as most people keep their IM buddy list ...
<Hanmac> ageis: be happy its not php4 ;D
<a1ph4g33k> but I have my "warning" line @ 79 chars because 80 is the team standard here too.
rbennacer has left #ruby ["Leaving"]
<|jemc|> havenwood: it'd be great to be able to just override, and then call something like "super" within
shredding has joined #ruby
<|jemc|> havenwood: but not "super"
bartj3 has joined #ruby
<|jemc|> havenwood: otherwise, you have to worry about uniqueness of your alias name
<banisterfiend> havenwood how does it work in an instance_eval
efrainolivares has joined #ruby
<ageis> ok 1.6.0 success
<jblack> I prefer lines less than 40 characters as a rule of thumb
hiyosi has joined #ruby
jibi has joined #ruby
<ageis> but <1.6.0 is whats demanded by my Gemfile
<weirdpercent> I'm getting an error when starting any of the ruby webservers (rack, thin, unicorn) htts://gist.github.com/weirdpercent/7202891
arietis has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<|jemc|> havenwood: you can also capture the Method object before overriding, but you have to store that object with some name too
<|jemc|> havenwood: so that name has to be unique as well
<ageis> just edited and did bundle update hope that will work out
kevinykchan has quit [Quit: Computer has gone to sleep.]
mityaz has joined #ruby
<Hanmac> ageis: it should work too... the big difference is that nokogiri 1.6 ships with own xml lib ... so it does not access your system libs if not wanted
<|jemc|> havenwood: and by unique, I mean something that no other programmer that comes after you will pick, so aliasing :foo with :_old_foo doesn't cut it
<weirdpercent> correction the URL is http://gist.github.com/weirdpercent/7202891
<|jemc|> havenwood: it has to be something like :_old_foo_replaced_by_{my_gem}
Xeago has joined #ruby
Metal_01 has joined #ruby
lachesis has joined #ruby
<|jemc|> havenwood: it'd be super cool if ruby just tracked the whole definition history by itself, so that earlier definitions could be called from within the new ones
<shredding> Can someone help me on how to test which uri was given in this rspec test: http://jarrettmeyer.com/blog/2013/01/31/mocking-an-http-response-in-rspec
Linux_Extremist has quit [Quit: Leaving]
<lachesis> are ruby methods (defined with "def") closures?
<shredding> I use the same but want to test the url that was given
alvaro_o has joined #ruby
<banisterfiend> |jemc| you can override methods without having to do that horrible alias thing
Notte has quit [Remote host closed the connection]
<banisterfiend> |jemc| i never use alias
<ageis> Hmac: now here's my problem on RMagick https://gist.github.com/ageis/7202987
<|jemc|> banisterfiend: and without storing the Method object?
Notte has joined #ruby
hiyosi has quit [Ping timeout: 264 seconds]
<havenwood> banisterfiend: docs are still a bit scattered for refinements in 2.1, i'm reading the spec now :) http://bugs.ruby-lang.org/projects/ruby-trunk/wiki/RefinementsSpec
<banisterfiend> |jemc| No, i close over the UnboundMethod object, nothing wrong with that.. :)
<|jemc|> banisterfiend: if you close over it, it works
<ageis> ok, installing libjpeg8-dev...
<lachesis> i've got some odd rails gem DSL that i'm trying to figure out: http://pastebin.com/P6PtFJ7b
<banisterfiend> |jemc| you have something against that?
<havenwood> banisterfiend: best i can get from the docs :P You may activate refinements in a string passed to Kernel#eval that is evaluated at top-level. Refinements are active until the end of the file or the end of the eval string, respectively.
<weirdpercent> lachesis: ruby supports closures using proc and lambda
<havenwood> ^ forgot quotes
rahulkmr has quit [Read error: Connection reset by peer]
<banisterfiend> |jemc| i typically define a decorator that manages all that complexity for me
yacks has joined #ruby
<|jemc|> banisterfiend: yeah, that's pretty much what I've been using lately
tatsuya_o has joined #ruby
<banisterfiend> cool
<lachesis> this isn't doing what i expect: http://pastebin.com/6nhyGciN
<|jemc|> banisterfiend: a method you call on the method that closes over the unbound method then binds
bartj3 has quit [Quit: quit]
<lachesis> namely, it can't find uproc
apeiros has quit [Remote host closed the connection]
<|jemc|> banisterfiend: but would you not agree that it would be nifty to have a builin construct like that?
Xeago has quit [Ping timeout: 264 seconds]
bartj3 has joined #ruby
<lachesis> furthermore, how can it access those methods defined on that block?
<banisterfiend> |jemc| no, i think it's niftier that we can create something manually that looks like it's built-in ;)
apeiros has joined #ruby
codezomb has joined #ruby
<Hanmac> ageis i think try to install libz-dev or liblzma-dev ... or something similar
<|jemc|> banisterfiend: yeah, I suppose I could work on a generalized version of it so that I don't have to create a new decorator method every time
brennanMKE has quit [Remote host closed the connection]
<|jemc|> banisterfiend: like, you pass a block to the decorator that yields in the middle of it to the original method
<Hanmac> ageis: try to run "ldd /usr/lib/x86_64-linux-gnu/libxml2.so" in your shell and look if something is missing
tjbarber has joined #ruby
<|jemc|> banisterfiend: so you can intercept args, do before/after stuff, etc..
rickmasta has quit [Read error: Connection reset by peer]
brennanMKE has joined #ruby
bean__ has joined #ruby
<banisterfiend> |jemc| def before(name, &b1); m = instance_method(name); define_method(name) { |*args, &b2| b1.call; m.bind(self).call(*args, &b2) }; end
Ox6abe has joined #ruby
<banisterfiend> or something
bartj3 has quit [Remote host closed the connection]
Notte has quit [Ping timeout: 260 seconds]
bean__ has quit [Max SendQ exceeded]
<lachesis> finally, where on earth does params come from?
<ageis> Hanmac: I'm good now, these gem installs were just more excruciating than anything ever...
davidpk has joined #ruby
heftig has joined #ruby
davidpk has quit [Client Quit]
whunt has quit [Ping timeout: 272 seconds]
ebetancourt has quit [Ping timeout: 272 seconds]
moeSeth has quit [Ping timeout: 272 seconds]
pkondzior___ has quit [Ping timeout: 272 seconds]
sambao21 has joined #ruby
_FL1SK has joined #ruby
<|jemc|> banisterfiend: if you pass it a block that yields in the middle it could be even more general
bugsinlights has quit [Ping timeout: 272 seconds]
mlpinit has quit [Read error: Connection reset by peer]
<|jemc|> banisterfiend: and that middle yield is where it calls the original
mrpot4to__ has joined #ruby
kevind has quit [Ping timeout: 272 seconds]
mrpot4to_ has quit [Ping timeout: 272 seconds]
wak3r has quit [Ping timeout: 272 seconds]
TigerWolf has quit [Ping timeout: 272 seconds]
Spleeze has quit [Ping timeout: 272 seconds]
mlpinit has joined #ruby
<|jemc|> banisterfiend: sounds like a good project for me this evening when I get home
<lachesis> alright, i understand most of the rest of it, but how does params get defined in a rails block?
<banisterfiend> |jemc| go for it :)
bean has quit [Ping timeout: 272 seconds]
jlebrech has quit [Ping timeout: 272 seconds]
zigomir has quit [Ping timeout: 272 seconds]
cads has quit [Ping timeout: 272 seconds]
petey_ has joined #ruby
v0n has quit [Ping timeout: 272 seconds]
dziga has quit [Ping timeout: 272 seconds]
coaster has quit [Ping timeout: 272 seconds]
FL1SK has quit [Ping timeout: 272 seconds]
<havenwood> lachesis: uproc = Proc.new { |params| puts params }; uproc.class #=> Proc; uproc['hi'] #>> hi; uproc.('hi') #>> hi; uproc.call('hi') #=> hi
<havenwood> #>>**
apeiros has quit [Ping timeout: 265 seconds]
uxp_ has joined #ruby
whunt has joined #ruby
<havenwood> lachesis: When you call the proc, provide the argument for the block parameter `params`.
brennanMKE has quit [Read error: Connection reset by peer]
tboerger has quit [Ping timeout: 272 seconds]
spike|spiegel has quit [Ping timeout: 272 seconds]
QKO has quit [Ping timeout: 272 seconds]
pkondzior___ has joined #ruby
<havenwood> lachesis: Call with #[], #.(), or #call.
QKO has joined #ruby
moeSeth has joined #ruby
brennanMKE has joined #ruby
dziga has joined #ruby
Ox6abe has quit [Remote host closed the connection]
tboerger has joined #ruby
bugsinlights has joined #ruby
<lachesis> havenwood, makes sense for procs
ffranz has quit [Ping timeout: 272 seconds]
joast has quit [Ping timeout: 272 seconds]
<havenwood> lachesis: `proc` is sugar for `Proc.new` btw
bartj3 has joined #ruby
mikepack has joined #ruby
Ox6abe has joined #ruby
<lachesis> havenwood, but where does the params array come from when using a def method?
<lachesis> like in http://pastebin.com/P6PtFJ7b
theoretick has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
_jesse_ has quit [Ping timeout: 272 seconds]
mva3212 has quit [Ping timeout: 272 seconds]
uxp has quit [Ping timeout: 272 seconds]
<havenwood> lachesis: `uproc = Proc.new { |v| puts v }` is same as `uproc = proc { |v| puts v }` and similar to the lambda `uproc = ->(v){ puts v }`.
nomenkun has joined #ruby
heidi has quit [Excess Flood]
<havenwood> <3 stabby lambdas
ewnd9_ has quit [Ping timeout: 272 seconds]
mgorbach has quit [Ping timeout: 272 seconds]
joshwines has quit [Ping timeout: 272 seconds]
<havenwood> stab stab!
heidi has joined #ruby
<havenwood> lachesis: Where is that local variable or method defined you're asking?
<lachesis> yeah
joshwines has joined #ruby
_jesse_ has joined #ruby
<lachesis> what magic is the controller function doing to get params into the scope of those def'd methods?
<havenwood> lachesis: what is this, Rails?
<lachesis> havenwood, yeah, it's from ActiveAdmin, but seems to be a common rails pattern
<havenwood> lachesis: I have no idea where it is set, where'd the code come from?
<havenwood> aha
nkts has joined #ruby
nkts has quit [Max SendQ exceeded]
<havenwood> lachesis: #RubyOnRails
<lachesis> heh alright
<havenwood> lachesis: Who knows what dark magic they've brewed.
<lachesis> just curious _how_ it might be done
heidi is now known as heidi_ramen
tyleretters_ has joined #ruby
wak3r has joined #ruby
Spleeze has joined #ruby
tyleretters has quit [Ping timeout: 245 seconds]
tyleretters_ is now known as tyleretters
<havenwood> lachesis: Familiar with Rack?
bartj3 has quit [Client Quit]
nkts has joined #ruby
joshu has quit [Ping timeout: 272 seconds]
nkts has quit [Max SendQ exceeded]
nisstyre has joined #ruby
<lachesis> only as the tool i use to populate the DB before i start rails
bartj3 has joined #ruby
<sweeper> haha
bartj3 has quit [Client Quit]
<sweeper> you mean rake I think
nkts has joined #ruby
<lachesis> ah yep
joshu has joined #ruby
<lachesis> too many 4 letter names starting with r
<lachesis> well rails is 5 i guess
<havenwood> lachesis: Rack != Rake :P http://rack.rubyforge.org/doc/
mikepack has quit [Ping timeout: 264 seconds]
<lachesis> rails, rack, rake, ruby
<havenwood> snails, snack, snake, snuby
<lachesis> lol
jayne_ has joined #ruby
Ox6abe has quit [Ping timeout: 272 seconds]
mgorbach has joined #ruby
Xeago has joined #ruby
SeySayux has quit [Ping timeout: 245 seconds]
rezzack1 has joined #ruby
pyrac has joined #ruby
coaster has joined #ruby
<lachesis> so i'm trying to "inject" a variable into a def'd method like they did with params somehow
<lachesis> and more generally, i'm trying to figure out what in the hell is going on :)
SpinningWheels has joined #ruby
rezzack has quit [Ping timeout: 272 seconds]
rahulkmr has joined #ruby
spike|spiegel has joined #ruby
rahulkmr has quit [Max SendQ exceeded]
jayne has quit [Read error: Connection reset by peer]
ewnd9_ has joined #ruby
<banisterfiend> lachesis params is a method, not a variable
bartj3 has joined #ruby
ffranz has joined #ruby
rahulkmr has joined #ruby
<havenwood> lachesis: You can tell that by checking: defined? params
rahulkmr has quit [Max SendQ exceeded]
<banisterfiend> lachesis methods can look like variables because they can be invoked without params
<banisterfiend> err
<banisterfiend> parens
SeySayux has joined #ruby
v0n has joined #ruby
Xeago has quit [Ping timeout: 246 seconds]
<lachesis> aha!
<lachesis> ok
<havenwood> `barewords` is one thing to call em
<lachesis> that makes it all make sense
bartj3 has quit [Client Quit]
<banisterfiend> lachesis params[:hello] is really doing this: params()[:hello]
wald0 has quit [Remote host closed the connection]
<banisterfiend> (in other languages)
wald0 has joined #ruby
<lachesis> methods don't close over variables, but they can call other methods defined in their scopes
<havenwood> lachesis: the reason Rails and Sinatra and stuff all have it, is it comes from Rack, and those are all Rack frameworks.
rahulkmr has joined #ruby
rahulkmr has quit [Max SendQ exceeded]
<havenwood> lachesis: variables win that fight, the method never gets called
cads has joined #ruby
<havenwood> lachesis: finds first it gets to in the lookup order
rahulkmr has joined #ruby
<lachesis> awesome, thanks banisterfiend havenwood i actually understand wtf that thing is doing now
rahulkmr has quit [Max SendQ exceeded]
mrsolo has joined #ruby
<weirdpercent> I'm getting deprecation errors trying to run a webserver http://gist.github.com/weirdpercent/7202891
mva3212 has joined #ruby
theoretick has joined #ruby
rahulkmr has joined #ruby
rahulkmr has quit [Max SendQ exceeded]
bartj3 has joined #ruby
<lachesis> now is there some way to convert a Proc to a method?
andikr has quit [Remote host closed the connection]
<lachesis> not that i need to do that now, just curious
bartj3 has quit [Client Quit]
lfox has quit [Quit: ZZZzzz…]
randomnick_ has joined #ruby
rahulkmr has joined #ruby
headius has joined #ruby
rahulkmr has quit [Max SendQ exceeded]
SHyx0rmZ has joined #ruby
colonolGron has joined #ruby
rahulkmr has joined #ruby
rahulkmr has quit [Max SendQ exceeded]
<gr33n7007h> >> class Foo; def say_hello_to_ruby(message); puts "Hello Ruby #{message}"; end; end; o = Foo.new.say_hello_to_ruby("GODS")
<eval-in> gr33n7007h => Hello Ruby GODS ... (https://eval.in/58076)
rahulkmr has joined #ruby
rahulkmr has quit [Max SendQ exceeded]
rahulkmr has joined #ruby
bartj3 has joined #ruby
rahulkmr has quit [Max SendQ exceeded]
<|jemc|> lachesis: define_method can
rahulkmr has joined #ruby
rahulkmr has quit [Max SendQ exceeded]
<|jemc|> lachesis: define_method(:method_name, &my_proc)
jkline has joined #ruby
rahulkmr has joined #ruby
<lachesis> |jemc|, neato
rahulkmr has quit [Max SendQ exceeded]
<havenwood> lachesis: alambda = ->(params){ puts params }; define_method :amethod, alambda; amethod 'hi'
rahulkmr has joined #ruby
<havenwood> |jemc|: beat me to it, don't need to to_proc your my_proc, too much proccing! :O
rahulkmr has quit [Max SendQ exceeded]
joast has joined #ruby
robustus has quit [Ping timeout: 245 seconds]
<|jemc|> didn't realize it could take a callable as 2nd positional argument
decoponio has quit [Quit: Leaving...]
<|jemc|> rather than as the actual block argument
rahulkmr has joined #ruby
rahulkmr has quit [Max SendQ exceeded]
<banisterfiend> |jemc| yeah, in ruby 2.0 it can take an UnboundMethod too, iirc
gja has quit [Quit: This computer has gone to sleep]
rickmasta has joined #ruby
allaire has quit []
<|jemc|> >> def foo(&blockarg) blockarg.call; end; l = Proc.new{puts 'whup'}; foo(l)
<eval-in> |jemc| => wrong number of arguments (1 for 0) (ArgumentError) ... (https://eval.in/58077)
<|jemc|> yeah, so it has to be contructed to accept either
Metal_01 has quit [Ping timeout: 260 seconds]
BizarreCake has quit [Ping timeout: 245 seconds]
<|jemc|> it won't convert the positional arg to a block arg automatically - that's a relief
mikepack has joined #ruby
<|jemc|> just a feature of define_method
jaimef has quit [Excess Flood]
robustus has joined #ruby
rahulkmr has joined #ruby
rahulkmr has quit [Max SendQ exceeded]
mrsolo has quit [Quit: This computer has gone to sleep]
EddSeabrook has joined #ruby
io_syl has joined #ruby
jaimef has joined #ruby
terrellt has quit [Ping timeout: 272 seconds]
Liothen has joined #ruby
terrellt has joined #ruby
weirdpercent has quit [Quit: Leaving]
davidpk has joined #ruby
davidpk has quit [Client Quit]
astrobun_ has quit [Ping timeout: 272 seconds]
<Hanmac> |jemc|: you need & to tell the function: this is the block arg
yacks has quit [Quit: Leaving]
postmodern has joined #ruby
<Banistergalaxy> Hanmac did you like the truck fixing episode
<|jemc|> Hanmac: yeah, that's what I always believed: but I thought havenwood was saying otherwise
<|jemc|> havenwood> don't need to to_proc your my_proc, too much proccing! :O
coderhs has quit [Ping timeout: 260 seconds]
sambao21 has quit [Quit: Computer has gone to sleep.]
<|jemc|> it just happened to be that define_method accepts it as a positional arg as well
<Banistergalaxy> Yeah.
<Banistergalaxy> Hanmac in adventure time
zeade has quit [Quit: Leaving.]
sambao21 has joined #ruby
<Hanmac> Banistergalaxy: i didnt watch the episode yet ... i wait for the 1080p version ;P
c0rn has joined #ruby
havenwood has quit [Remote host closed the connection]
burlyscudd has joined #ruby
pyrac has quit [Quit: pyrac]
`Chris` has quit [Read error: Connection reset by peer]
raphaelivan has joined #ruby
astrobunny has joined #ruby
`Chris` has joined #ruby
iamjarvo has joined #ruby
pixelgremlins has joined #ruby
ravster has joined #ruby
danshultz has quit [Remote host closed the connection]
jayne_ is now known as jayne
aspires has quit [Quit: sudo making a sandwich]
danshultz has joined #ruby
ehaliewicz has joined #ruby
lfox has joined #ruby
burlyscudd has quit [Ping timeout: 240 seconds]
nixterrimus has joined #ruby
<a1ph4g33k> ... I know I asked this recently .. but in documentation ... Foo#bar <- Instance Method ? and Foo.bar <- Class Method ?
<Banistergalaxy> Yes
<a1ph4g33k> thanks again.
alex__c2022 has joined #ruby
kevinykchan has joined #ruby
<Hanmac> a1ph4g33k: PS: Foo.bar may be ambigous ... Foo::bar is better
havenwood has joined #ruby
<Banistergalaxy> Don't believe hanmac
<a1ph4g33k> heh.
<a1ph4g33k> I thought :: was inheritance ... as in Module::Class.method
<Banistergalaxy> :: should only be used for constants
<Banistergalaxy> ;)
<Banistergalaxy> :: is more ambiguous
<Hanmac> ask ri ... File.size shows both methods
danshultz has quit [Ping timeout: 272 seconds]
axl_ has quit [Quit: axl_]
cody-- has quit [Quit: derp]
<Hanmac> File::size shows only the class method, and File#size shows only the instance method
<|jemc|> I thought they were trying to phase out Foo::bar for methods - it definitely seems more ambiguous than Foo.bar
anderson has joined #ruby
timonv has quit [Remote host closed the connection]
timonv has joined #ruby
achru has joined #ruby
ebetancourt has joined #ruby
jrhe has quit [Quit: jrhe]
slash_nick has quit [Ping timeout: 252 seconds]
<Hanmac> |jemc|: it could be worse.. "[Array]" is the constant, "[Array(obj)]" is a method "[Array obj]" is a method too "[Array,obj]" is a constant again
drag00n has quit [Ping timeout: 246 seconds]
vpretzel has quit [Remote host closed the connection]
tonni has quit [Ping timeout: 246 seconds]
slash_nick has joined #ruby
vpretzel has joined #ruby
tonni has joined #ruby
`Chris` has quit [Read error: No route to host]
jonr22 has joined #ruby
coderhs has joined #ruby
`Chris` has joined #ruby
mengu has joined #ruby
ewnd9_ has quit [Remote host closed the connection]
mrsolo has joined #ruby
wak3r has quit [Ping timeout: 272 seconds]
alex__c2022 has quit [Quit: alex__c2022]
timonv has quit [Ping timeout: 272 seconds]
ldnunes has quit [Quit: Leaving]
nucatus has joined #ruby
nucatus has quit [Remote host closed the connection]
mercwithamouth has joined #ruby
nucatus has joined #ruby
hiyosi has joined #ruby
lmadrigal has joined #ruby
fmcgeough has quit [Quit: fmcgeough]
vpretzel has quit [Ping timeout: 265 seconds]
jonr22 has quit [Ping timeout: 265 seconds]
krawchyk_ has quit []
Jabberish has joined #ruby
amacgregor has joined #ruby
alex__c2022 has joined #ruby
dabos has joined #ruby
alex__c2022 has quit [Client Quit]
jzinedine has joined #ruby
wak3r has joined #ruby
alex__c2022 has joined #ruby
c0rn has quit [Quit: Computer has gone to sleep.]
jzinedine has quit [Client Quit]
Uranio has quit [Quit: while you reading this, a kitty dies]
atmosx has quit [Quit: Lost in trance]
jroes has joined #ruby
jrhe has joined #ruby
`Chris` has quit [Read error: Connection reset by peer]
hiyosi has quit [Ping timeout: 272 seconds]
jeer_ has joined #ruby
jeer_ has quit [Client Quit]
jzinedin_ has joined #ruby
<jroes> running a long-running import script and I'm watching the available memory on the server slowly creep toward OOM-land. is there anything I can do to prod the running ruby process and free up some space?
vpretzel has joined #ruby
Notte has joined #ruby
`Chris` has joined #ruby
<jroes> pretty sure it doesn't need 7gb of memory
jzinedin_ has quit [Client Quit]
vpretzel has quit [Remote host closed the connection]
sbos99 has quit [Ping timeout: 264 seconds]
vpretzel has joined #ruby
soheil has quit [Remote host closed the connection]
<|jemc|> GC should have triggered by now. you should make sure you let unused objects go out of scope
<|jemc|> that is, make sure nothing holds a reference to them anymore
soheil has joined #ruby
<|jemc|> GC will never deallocate an object if something is still holding a reference to it
bricker`1ork has joined #ruby
<|jemc|> keep closures and such in mind as well - closures can hold onto objects that should by other accounts be dead
c0rn has joined #ruby
vpretzel has quit [Ping timeout: 265 seconds]
bricker`work has quit [Ping timeout: 260 seconds]
randomnick_ has quit [Ping timeout: 248 seconds]
randomnick_ has joined #ruby
mklappstuhl has joined #ruby
mrsolo has quit [Quit: This computer has gone to sleep]
soheil has quit [Ping timeout: 265 seconds]
noop is now known as noopq
nutella has joined #ruby
nutella is now known as Guest37413
Astral_ has quit [Ping timeout: 240 seconds]
iamjarvo has quit [Read error: Connection reset by peer]
iamjarvo has joined #ruby
apeiros has joined #ruby
`Chris`_ has joined #ruby
Alina-malina has quit [Read error: Connection reset by peer]
`Chris` has quit [Ping timeout: 240 seconds]
nfk has quit [Quit: yawn]
Alina-malina has joined #ruby
cpruitt has joined #ruby
ephemerian has joined #ruby
lsmola has quit [Ping timeout: 272 seconds]
amacgregor has quit [Ping timeout: 246 seconds]
mrsolo has joined #ruby
bricker`1ork is now known as bricker
jzinedine has joined #ruby
nixterrimus has left #ruby [#ruby]
tspike has joined #ruby
nism-pi has quit [Remote host closed the connection]
soheil has joined #ruby
Jabberish has quit [Remote host closed the connection]
Guest37413 has quit [Ping timeout: 260 seconds]
shredding has quit [Quit: shredding]
aspires has joined #ruby
mark_locklear has quit [Ping timeout: 265 seconds]
nixterrimus has joined #ruby
shredding has joined #ruby
mikepack has quit [Ping timeout: 272 seconds]
soheil has quit [Remote host closed the connection]
<shevy> Hanmac I am bored
lsmola has joined #ruby
<Hanmac> download a big lib and compile something ;P
geekbri has quit [Remote host closed the connection]
rezzack1 has quit [Quit: Leaving.]
jzinedine has left #ruby [#ruby]
rezzack has joined #ruby
soheil has joined #ruby
mary5030 has quit [Remote host closed the connection]
Jabberish has joined #ruby
mary5030 has joined #ruby
mrsolo has quit [Quit: This computer has gone to sleep]
Ox6abe has joined #ruby
Dave has joined #ruby
Methylated1 has joined #ruby
nutella_ has joined #ruby
Dave is now known as Guest92620
achru has quit []
Naoe-Kanno has joined #ruby
<ShellFu> Hey all. I need some assistance simplifying this method. I have way to many if/then/else going on, and im not sure how to clean it up. >http://pastebin.com/QkaE7NRz<
chvnx has joined #ruby
<ShellFu> Ive been messing around with a recursive method to try and replace it, but I havent achieved the desired result
moted_ has joined #ruby
<chvnx> I want to start learning ruby. I know some python 2 and 3, a bit of perl, and know my way around bash and other shell scripting languages. Where should I begin with ruby? does anyone have suggestions for tutorials or books?
noopq has quit [Ping timeout: 260 seconds]
<chvnx> Also comfortable wrting lua, if that matters.
magbeat_ has joined #ruby
spike|spiegel| has joined #ruby
<ShellFu> chvnx, Solve a problem you would normally solve with bash. That would get your feet wet at least.
SHyx0rmZ has quit [Ping timeout: 246 seconds]
pothibo has quit [Ping timeout: 246 seconds]
spike|spiegel has quit [Ping timeout: 246 seconds]
magbeat has quit [Ping timeout: 246 seconds]
jhaals has joined #ruby
mrsolo_ has joined #ruby
moted has quit [Ping timeout: 246 seconds]
dangerousdave has quit [Ping timeout: 246 seconds]
Methylated has quit [Ping timeout: 246 seconds]
moted_ is now known as moted
<superscott[8]> : if i Thread.new a FileUtils.mkdir, would i be saving any time? or since i'm only creating one folder, it won't matter.
user258467 has quit [Ping timeout: 246 seconds]
mary5030 has quit [Ping timeout: 256 seconds]
ffranz has quit [Ping timeout: 246 seconds]
user258467 has joined #ruby
<apeiros> superscott[8]: you're probably wasting time and introducing a race condition
<shevy> is there any project that generates html tags?
vpretzel has joined #ruby
nutella_ has quit [Ping timeout: 264 seconds]
<shevy> chvnx if you know perl, ruby is very similar to it but with less line noise. there are some tutorials but honestly, the best is if you just start porting code like shell scripts into ruby and ask lots of questions here.
<superscott[8]> apeiros: thanks
<shevy> chvnx this is the best tutorial, work through it even though it is meant for a ruby, afterwards you will know how to use "yield" http://pine.fm/LearnToProgram/?Chapter=01
<Hanmac> apeiros: hm what about an new extension like rbz or similar for zip/gzip compressed ruby scripts? ;P
<shevy> *is meant for a newbie
nixterrimus1 has joined #ruby
<shevy> not for a ruby... I should multitask less :(
`Chris` has joined #ruby
vpretzel_ has joined #ruby
amacgregor has joined #ruby
vpretzel has quit [Read error: Connection reset by peer]
timonv has joined #ruby
<chvnx> shevy: That's what I had in mind; rewriting a few of my python scripts. However, I want to learn some basic best practices before I jus start putting anything down that will be time consuming.
efrainolivares has quit [Quit: efrainolivares]
Davey has quit [Quit: Computer has gone to sleep.]
<sweeper> chvnx: make a neat interface to something with rdialog
error404 has joined #ruby
jroes has left #ruby [#ruby]
nixterrimus has quit [Ping timeout: 256 seconds]
`Chris`_ has quit [Ping timeout: 240 seconds]
bricker_ has joined #ruby
bricker_ is now known as bricker`work
<apeiros> Hanmac: why not just .rb.gz?
bricker has quit [Disconnected by services]
bricker`work is now known as bricker
pkrnj has joined #ruby
<chvnx> sweeper: thanks for the link.
chvnx has left #ruby ["WeeChat 0.3.8"]
sambao21 has quit [Quit: Computer has gone to sleep.]
classix has quit [Ping timeout: 245 seconds]
motto has joined #ruby
pr0ggie has quit [Ping timeout: 240 seconds]
angusiguess has quit [Ping timeout: 245 seconds]
pdimitrov has quit [Ping timeout: 272 seconds]
Czupa has quit [Quit: Wychodzi]
pr0ggie has joined #ruby
gr33n7007h has quit [Ping timeout: 240 seconds]
pdimitrov has joined #ruby
m8 has quit [Ping timeout: 248 seconds]
<Hanmac> apeiros: that is possible too, i just thought about rbz as short form
kaspergrubbe has joined #ruby
gr33n7007h has joined #ruby
Zai00 has joined #ruby
mklappstuhl has quit [Read error: Connection reset by peer]
Xeago has joined #ruby
kaldrenon has quit [Remote host closed the connection]
DrCode has quit [Ping timeout: 240 seconds]
mary5030 has joined #ruby
vpretzel_ has quit [Ping timeout: 265 seconds]
Mitchellvanw has joined #ruby
gr33n7007h has quit [Changing host]
gr33n7007h has joined #ruby
kaldrenon has joined #ruby
c0rn_ has joined #ruby
ffranz has joined #ruby
yfeldblum has joined #ruby
adambeynon has joined #ruby
shredding has quit [Quit: shredding]
aspires has quit [Quit: sudo making a sandwich]
c0rn has quit [Ping timeout: 246 seconds]
Davey has joined #ruby
Tuxist has joined #ruby
tspike has quit [Quit: leaving]
zarubin has joined #ruby
slash_nick has quit [Changing host]
slash_nick has joined #ruby
Xiti` has quit [Ping timeout: 245 seconds]
timonv has quit [Remote host closed the connection]
kaldrenon has quit [Ping timeout: 260 seconds]
timonv has joined #ruby
aspires has joined #ruby
butblack has joined #ruby
soheil has quit [Remote host closed the connection]
barratt has joined #ruby
mixel has joined #ruby
sepp2k has quit [Ping timeout: 240 seconds]
erinb has joined #ruby
<sweeper> apeiros: he eventually wants to progress to gz'd Delphi
jhaals has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<sweeper> so he can have lots of .dbz files...
zeade has joined #ruby
navyant24 has joined #ruby
timonv has quit [Ping timeout: 264 seconds]
sambao21 has joined #ruby
OdNairy has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
AlSquire has quit [Quit: This computer has gone to sleep]
elux has quit [Quit: Bye!]
hiyosi has joined #ruby
sepp2k has joined #ruby
sepp2k has quit [Read error: Connection reset by peer]
sepp2k has joined #ruby
<a1ph4g33k> ... ugh ... trying to rebind an UnboundMethod object from within a call to define_method ... from within a call to instance_eval ...
<a1ph4g33k> any ideas ?
<a1ph4g33k> ( alternatively ... trying to do the same within a call to class_eval ) ...
blueOxigen has quit [Ping timeout: 268 seconds]
<|jemc|> what's your problem?
navyant24 has quit [Quit: navyant24]
<|jemc|> or rather, I should say: put what you have so far in a pastebin
heidi_ramen is now known as heidi
<a1ph4g33k> ... I am having trouble with the nested nature of calling define_method within instance_eval ...
hiyosi has quit [Read error: Operation timed out]
kleinerdrache has quit [Read error: No route to host]
<|jemc|> yeah, just show me what you have so far
aspires has quit [Quit: sudo making a sandwich]
astrobunny has quit [Ping timeout: 272 seconds]
<a1ph4g33k> can't really ... it's the last hiccup in a submission I need to provide along with my CV ...
<a1ph4g33k> I will keep working on it...
<|jemc|> so are you trying to define the method for just a single instance of the object?
<sweeper> that's pretty meta for a job application o.O
jkline has quit [Quit: jkline]
xk_id has quit [Quit:
<a1ph4g33k> no, I have a method I retrieved via ObjectSpace.const_get( klass ).instance_method( method_name_sym )
sepp2k has quit [Ping timeout: 260 seconds]
<|jemc|> oh, ha. it's for a job application?
mary5030 has quit [Ping timeout: 272 seconds]
<a1ph4g33k> ... so, now I am trying to call that method from within a instance_eval block.
<|jemc|> just send me the application heheheh
jkline has joined #ruby
<a1ph4g33k> yeah, I was just looking for hints regarding unboundmethod ... that's all.
<|jemc|> on which object are you calling instance_eval?
<a1ph4g33k> I'm not asking anybody to do the work for me.
<|jemc|> yeah, I'm just kidding
<a1ph4g33k> it's ok ... it was probably not the brightest idea to try to get help on it.
<a1ph4g33k> ( plus this irc is logged ).
<|jemc|> ha
<|jemc|> true that
<matled> and you have an awesome name
<popl> pfft
<a1ph4g33k> i try.
<a1ph4g33k> ;)
<popl> too hard
<|jemc|> I wish I had an employer that knew what an IRC log was...
<popl> Do you really?
<banisterfiend> a1ph4g33k weird firkin interview if you have to resort to magic like that ;) (but fun)
<a1ph4g33k> banisterfiend, I'll explain offline. It's a very meta job.
<banisterfiend> a1ph4g33k but you should bind the 'self' you want to a variable outside the instance_eval
astrobunny has joined #ruby
<banisterfiend> assuming i get what u're trying to do
<|jemc|> popl: yeah, I wouldn't be screwing around on IRC if I had an employer savvy enough to give me engaging work
<popl> yes you would
<popl> :P
breakingthings has quit []
Jetchisel has joined #ruby
Metal_01 has joined #ruby
<|jemc|> but yeah, if the startup I'm working on ever happens, there'll totally be meta-magic in the interview process
tatsuya_o has quit [Remote host closed the connection]
nixterrimus1 has quit [Quit: Leaving.]
<banisterfiend> don't make the question is too strange or you'll have Hanmac as your only employee ;)
mary5030 has joined #ruby
tatsuya_o has joined #ruby
<|jemc|> heh
<a1ph4g33k> I've got the solution mostly in the bag ... just this one final gotcha ... Already fought off a pile of others ( 4th version of the solution for me ).
mmitchell has quit [Remote host closed the connection]
<a1ph4g33k> anyways ... thanks for talking sense into me.
mmitchell has joined #ruby
<|jemc|> still willing to help if you want it, but yeah, I understand you not wanting it
dkamioka has quit [Remote host closed the connection]
interactionjaxsn has quit [Remote host closed the connection]
aspires has joined #ruby
zarubin has quit [Ping timeout: 264 seconds]
interactionjaxsn has joined #ruby
nomenkun has quit [Remote host closed the connection]
Xiti has joined #ruby
tatsuya_o has quit [Ping timeout: 265 seconds]
mklappstuhl has joined #ruby
aapzak has quit [Ping timeout: 272 seconds]
mmitchell has quit [Ping timeout: 248 seconds]
<Hanmac> banisterfiend: did you just use my name as a clinic condition ? ;P
<banisterfiend> Hanmac metaprogramitis
Tamal has joined #ruby
<banisterfiend> Hanmac did u have an amiga as a kid?
aapzak has joined #ruby
<Hanmac> nah, my first pc was a 386er with Win3.1
interactionjaxsn has quit [Ping timeout: 260 seconds]
`Chris` has quit [Remote host closed the connection]
<banisterfiend> Hanmac oh too bad, you missed that strange phase when there were more computers on offer than just the pc
codenapper has quit [Quit: codenapper]
`Chris` has joined #ruby
failshel_ has joined #ruby
<Hanmac> banisterfiend: http://support.kaspersky.com/tcpip ... ;P
mary5030 has quit [Ping timeout: 265 seconds]
<banisterfiend> haha
gyre007 has joined #ruby
amacgregor has quit [Read error: Connection reset by peer]
mlpinit has quit [Remote host closed the connection]
amacgregor has joined #ruby
<Hanmac> "sorry your computer does not have internet anymore, just download our fix to solve this problem" ;P
failshell has quit [Ping timeout: 260 seconds]
popl has left #ruby [#ruby]
Guest92620 has quit [Quit: Leaving...]
failshel_ has quit [Ping timeout: 272 seconds]
brianpWins has joined #ruby
c0rn_ has quit [Quit: Computer has gone to sleep.]
Deele has quit [Ping timeout: 260 seconds]
navyant24 has joined #ruby
navyant24 has quit [Client Quit]
kvirani_ has joined #ruby
achr3f has joined #ruby
alvaro_o has quit [Quit: Ex-Chat]
alex__c2022 has quit [Quit: alex__c2022]
sambao21 has quit [Quit: Computer has gone to sleep.]
achr3f has quit [Remote host closed the connection]
jaredlevitz has joined #ruby
kvirani has quit [Ping timeout: 272 seconds]
alvaro_o has joined #ruby
Metal_01 has quit [Ping timeout: 265 seconds]
allaire has joined #ruby
seoNinjaWarrior has quit [Quit: Computer has gone to sleep.]
einarj has joined #ruby
jaredlevitz has quit [Quit: WeeChat 0.4.0]
seoNinjaWarrior has joined #ruby
sepp2k has joined #ruby
ehc has joined #ruby
d2dchat_ has quit [Remote host closed the connection]
jaredlevitz has joined #ruby
efrainolivares has joined #ruby
pr0ggie has quit [Read error: Operation timed out]
kvirani_ is now known as kvirani
jaredlevitz has quit [Client Quit]
cody-- has joined #ruby
sailias has quit [Quit: Leaving.]
pdimitrov has quit [Ping timeout: 246 seconds]
allsystemsarego has quit [Quit: Leaving]
xk_id has joined #ruby
tyleretters has quit [Quit: l8r]
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ph8 has joined #ruby
colonolGron has quit [Quit: leaving]
drumsrgr8forn8 has quit [Ping timeout: 245 seconds]
Tamal has quit [Quit: Textual IRC Client: www.textualapp.com]
jkline has quit [Quit: jkline]
adambeynon has quit [Quit: Textual IRC Client: www.textualapp.com]
DrShoggoth has joined #ruby
rurban has joined #ruby
mengu has quit [Remote host closed the connection]
sambao21 has joined #ruby
aspires has quit [Quit: sudo making a sandwich]
Mitchellvanw has quit [Quit: Dozing off...]
mengu has joined #ruby
carraroj has quit [Quit: Konversation terminated!]
soheil has joined #ruby
DrShoggoth has quit [Remote host closed the connection]
wak3r has quit [Ping timeout: 260 seconds]
jkline has joined #ruby
workmad3 has quit [Ping timeout: 245 seconds]
vpretzel has joined #ruby
jonr22 has joined #ruby
mary5030 has joined #ruby
nixterrimus has joined #ruby
jeffdb has joined #ruby
cody-- has quit [Quit: derp]
mklappstuhl has quit [Remote host closed the connection]
tatsuya_o has joined #ruby
rurban has quit [Quit: Leaving.]
mengu has quit [Ping timeout: 246 seconds]
jerius has quit [Read error: Operation timed out]
vpretzel has quit [Ping timeout: 240 seconds]
erinb has left #ruby [":: waves bye ::"]
jonr22 has quit [Ping timeout: 240 seconds]
baordog_ has quit [Remote host closed the connection]
mary5030 has quit [Ping timeout: 272 seconds]
momomomomo has quit [Quit: momomomomo]
pdimitrov has joined #ruby
pr0ggie has joined #ruby
c0rn has joined #ruby
freerobby has quit [Quit: Leaving.]
asobrasil has left #ruby [#ruby]
pixelgremlins has quit [Ping timeout: 240 seconds]
pdimitrov has quit [Max SendQ exceeded]
ebetancourt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
aantix has joined #ruby
relix has joined #ruby
pdimitrov has joined #ruby
ahawkins_ has joined #ruby
ffranz has quit [Quit: Leaving]
fella6s has joined #ruby
nucatus has quit [Ping timeout: 240 seconds]
Xaitec has joined #ruby
huttan_ has joined #ruby
Xaitec has quit [Remote host closed the connection]
rjhunter has joined #ruby
octarine has quit [Read error: Connection reset by peer]
moeSeth has quit [Read error: Connection reset by peer]
pkondzior___ has quit [Write error: Connection reset by peer]
pipework has quit [Read error: Connection reset by peer]
Kabaka has quit [Ping timeout: 240 seconds]
mengu has joined #ruby
mengu has joined #ruby
mengu has quit [Changing host]
efrainolivares has quit [Read error: Connection reset by peer]
pkondzior___ has joined #ruby
moeSeth has joined #ruby
octarine has joined #ruby
pipework has joined #ruby
efrainolivares has joined #ruby
lmadrigal has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
dabos has quit [Ping timeout: 246 seconds]
ahawkins has quit [Read error: Connection reset by peer]
fella5s has quit [Ping timeout: 272 seconds]
Clooth has quit [Ping timeout: 272 seconds]
huttan has quit [Ping timeout: 272 seconds]
mikepack has joined #ruby
Nilium has joined #ruby
mengu has quit [Remote host closed the connection]
hiyosi has joined #ruby
iamjarvo has quit [Remote host closed the connection]
iamjarvo has joined #ruby
iamjarvo has quit [Read error: Operation timed out]
spider-mario has joined #ruby
lmadrigal has joined #ruby
iamjarvo has joined #ruby
mixel_ has joined #ruby
blackmesa has joined #ruby
matchaw has quit [Remote host closed the connection]
hiyosi has quit [Ping timeout: 264 seconds]
enebo has quit [Quit: enebo]
samfisher has joined #ruby
mixel has quit [Ping timeout: 264 seconds]
mixel_ is now known as mixel
<samfisher> I get a number as 0.523E10. How do I convert it to 523?
<samfisher> the value should be 523
iamjarvo has quit [Read error: Operation timed out]
<|jemc|> what do you want to happen if you get 0.523E9?
<samfisher> i want to move that decimal point
<|jemc|> or 0.52345E10?
<samfisher> no, i want it 523.45
kvirani_ has joined #ruby
<|jemc|> and you want 0.523E9 to yield 52.3?
<samfisher> yes
Senjai has quit [Ping timeout: 264 seconds]
<|jemc|> >> x=0.523E10; (x/1E7).to_i
<eval-in> |jemc| => 523 (https://eval.in/58091)
matchaw has joined #ruby
<|jemc|> or
<|jemc|> >> x=0.523E10; (x*1E-7).to_i
<eval-in> |jemc| => 523 (https://eval.in/58092)
<|jemc|> sorry, remove the to_i if you want it to not truncate
sergicles has quit [Quit: sergicles]
<|jemc|> >> x=0.52345E10; (x*1E-7)
<eval-in> |jemc| => 523.4499999999999 (https://eval.in/58093)
Ox6abe has quit [Remote host closed the connection]
drumusician has quit [Ping timeout: 240 seconds]
stringoO has quit [Quit: stringoO]
Ox6abe has joined #ruby
zipper has joined #ruby
<banisterfiend> talk something interesting people
kvirani has quit [Ping timeout: 272 seconds]
<banisterfiend> someone have any tricky metaprogramming problems they're working on?
burlyscudd has joined #ruby
<banisterfiend> im bored
nowthatsamatt has quit [Quit: nowthatsamatt]
Jetchisel has quit [Quit: Unfortunately time is always against us -- *Morpheus*]
theRoUS has quit [Ping timeout: 246 seconds]
<|jemc|> Well I do have a c extension design/philosophical question
b00stfr3ak has quit [Read error: Operation timed out]
<|jemc|> Your thoughts on coupling Ruby code into the C extension in such a way that the c code cannot stand on its own
Ox6abe has quit [Ping timeout: 240 seconds]
brianpWins has quit [Quit: brianpWins]
<|jemc|> with the benefit being
<banisterfiend> |jemc| only if you want to use the library outside of ruby
<banisterfiend> otherwise, who cares
DrCode has joined #ruby
<|jemc|> you don't have to write long, hairy hard-to-maintain c code that is elegant ruby
<banisterfiend> what's your C extension?
<|jemc|> so your general opinion is that it is good or at least passable design practice?
<|jemc|> toying with some modular audio DSP
mikepack has quit [Remote host closed the connection]
<banisterfiend> ah ok
<|jemc|> with all audio processing happening in C++
<banisterfiend> ruby core killed all fun C extensions with 1.9.3 :(
<|jemc|> but all patching/routing/instantiation of modules happening in Ruby
<|jemc|> heh. how so?
Jetchisel has joined #ruby
lsmola has quit [Ping timeout: 272 seconds]
<banisterfiend> |jemc| they hid all the fun internal C API
<|jemc|> figured it was something like that
<|jemc|> so if I were to cement this coupling of Ruby and C code,
<samfisher> i get #<BigDecimal:8f995f4,'0.20740952E0',9(45)>
<|jemc|> the best way to do it would be <do setup ruby code> require 'my-shared-object' <do-post-ruby-code>
leynos has joined #ruby
<|jemc|> with the alternative being
<samfisher> and why do you need rescue Exception?
<|jemc|> stash .rb files in the ext folder and have c open the file and read it and rb_eval
<samfisher> and raise e
<|jemc|> the former is better, right?
tomzx_mac has joined #ruby
mikepack has joined #ruby
platypine has joined #ruby
dkamioka has joined #ruby
lukec has quit [Quit: lukec]
Naoe-Kanno has quit [Quit: ネウロイを負かさなきゃならないね]
pkrnj has quit [Quit: Computer has gone to sleep.]
larissa has joined #ruby
WickedAtMelb has joined #ruby
ehc has quit [Ping timeout: 246 seconds]
ewnd9 has joined #ruby
ehc has joined #ruby
capicue has quit [Quit: Leaving...]
motto has quit [Quit: Sto andando via]
peterhellberg has quit [Ping timeout: 240 seconds]
brennanMKE has quit [Remote host closed the connection]
Xeago has quit [Remote host closed the connection]
mikepack_ has joined #ruby
MrZYX is now known as MrZYX|off
leynos has quit [Quit: Off to dreams of Laserdiscs and Neo-Geos]
dortizmontasteri has joined #ruby
mikepack has quit [Ping timeout: 272 seconds]
<samfisher> how can I take only the USD value from here? http://www.bnr.ro/nbrfxrates.xml
dortizmontasteri has quit [Client Quit]
<samfisher> oh jeez, i have to do something so i won't ask so much questions
popl has joined #ruby
popl has joined #ruby
popl has quit [Changing host]
astrobunny has quit [Ping timeout: 265 seconds]
mlpinit has joined #ruby
petey_ has quit [Remote host closed the connection]
<goleldar> anyone know how to disable local storage using capybara in a cucumber test?
shadoi has joined #ruby
<goleldar> or to delete it
petey_ has joined #ruby
failshell has joined #ruby
failshell has quit [Remote host closed the connection]
classix has joined #ruby
shadoi1 has quit [Ping timeout: 272 seconds]
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mikepack_ has quit [Remote host closed the connection]
claymore has quit [Quit: Leaving]
Tuxist has quit [Read error: Connection reset by peer]
peterhellberg has joined #ruby
petey_ has quit [Ping timeout: 246 seconds]
mlpinit has quit [Ping timeout: 272 seconds]
astrobunny has joined #ruby
Lewix has joined #ruby
Lewix has joined #ruby
Lewix has quit [Changing host]
Jetchisel has quit [Quit: Unfortunately time is always against us -- *Morpheus*]
iceden has quit [Ping timeout: 245 seconds]
endash has joined #ruby
b00stfr3ak has joined #ruby
timonv has joined #ruby
kirun has quit [Quit: Client exiting]
ewnd9 has quit [Ping timeout: 240 seconds]
Azulinho has quit [Ping timeout: 245 seconds]
einarj has quit [Remote host closed the connection]
nixterrimus has quit [Remote host closed the connection]
aspires has joined #ruby
vpretzel has joined #ruby
peterhellberg has quit [Remote host closed the connection]
<zipper> OH but constants and their scope and what not is really confusing.
mikepack has joined #ruby
timonv has quit [Ping timeout: 264 seconds]
<zipper> Also I saw people tweet a lot of angry stuff about ruby last night
<zipper> Someone assulted a lady or something.
<|jemc|> hm?
b00stfr3ak has quit [Remote host closed the connection]
Davey has quit [Quit: Computer has gone to sleep.]
peterhellberg has joined #ruby
barratt has quit [Quit: Leaving...]
julian-delphiki has quit [Changing host]
julian-delphiki has joined #ruby
volty has joined #ruby
mrpot4to__ has quit [Read error: Connection reset by peer]
MrPoT4tO has quit [Read error: Connection reset by peer]
cspray has joined #ruby
vpretzel has quit [Ping timeout: 246 seconds]
MrPoT4tO has joined #ruby
brisbin has quit [Ping timeout: 245 seconds]
Scient has quit [Ping timeout: 248 seconds]
gwb3 has quit [Ping timeout: 245 seconds]
mrpot4to_ has joined #ruby
slash_nick has quit [Ping timeout: 240 seconds]
<andrewvos> Again?
<andrewvos> Jesus
justsee has joined #ruby
justsee has joined #ruby
s_e has quit [Excess Flood]
s_e has joined #ruby
tonni has quit [Read error: Connection reset by peer]
lfox has quit [Quit: ZZZzzz…]
gwb3 has joined #ruby
<banisterfiend> andrewvos man we gotta get in on this
brisbin has joined #ruby
tonni has joined #ruby
Scient has joined #ruby
slash_nick has joined #ruby
apeiros has quit [Remote host closed the connection]
petey_ has joined #ruby
narcan has joined #ruby
<banisterfiend> zipper got a link ?
apeiros has joined #ruby
mikepack has quit [Remote host closed the connection]
mikepack has joined #ruby
lmickh has quit [Quit: lmickh]
iceden has joined #ruby
mary5030 has joined #ruby
<|jemc|> pics or it didn't happen
<popl> what?
<|jemc|> Matz went on a killing spree, I guess
<|jemc|> without any other information, that's all I can surmise
zastern has joined #ruby
mikepack has quit [Ping timeout: 246 seconds]
Davey has joined #ruby
frustrum has joined #ruby
<popl> That would be interesting considering that he's a religious man.
frustrum has quit [Client Quit]
<samfisher> how can I take only the USD value from here? http://www.bnr.ro/nbrfxrates.xml ?
frustrum has joined #ruby
<|jemc|> popl: the best serial killers always are
baroquebobcat has quit [Quit: baroquebobcat]
kitak has joined #ruby
c0rn_ has joined #ruby
<samfisher> require 'stop_ignoring_me_pls'
brennanMKE has joined #ruby
<andrewvos> LoadError
<banisterfiend> samfisher why don't you read the nokogiri documentation?
<|jemc|> andrewvos: eheheh
<samfisher> banisterfiend: won't exactly explain what i'm looking for
c0rn has quit [Read error: Operation timed out]
<popl> or is that the previous thing prompting the "again?" from andrewvos?
pdimitrov has quit [Ping timeout: 264 seconds]
<andrewvos> popl: Well that's why I said "again". But might be the same
pr0ggie has quit [Ping timeout: 272 seconds]
<|jemc|> popl: no idea
pr0ggie has joined #ruby
hiyosi has joined #ruby
pdimitrov has joined #ruby
<popl> this sort of thing is so gossipy
headius has quit [Quit: headius]
<zipper> Hey is there a "short" way of checking if several values are equal? Like a == b == c? Except that raises a SyntaxError
<|jemc|> that's the notion I was trying to evoke with my comment about Matz
headius has joined #ruby
<zipper> I want to check if 3 or more numbers are equal
<popl> Some Perl dev got accused of assaulting some lady and people were buzzing about that.
<popl> Then someone put his mugshot up on this website that lists the mugshot and charges, then asks you to pay a fee to remove it.
<volty> zipper: [a,b,c].uniq.length == 1
<popl> volty++
<Eiam> whats that got to do with rubby
Notte has quit [Remote host closed the connection]
brennanMKE has quit [Ping timeout: 265 seconds]
<zipper> volty: and that checks no matter what the variable holds?
<popl> My implication was that some developers are a gossipy bunch
<zipper> volty: that's new
Notte has joined #ruby
<volty> don't know what is new and what is old --- for me it would be enough to not classify it as a 'pattern' :)
pr0ggie has quit [Read error: Operation timed out]
hiyosi has quit [Ping timeout: 272 seconds]
julweber has joined #ruby
<volty> yap, i don't know much about the world of developers, but have the impression that there are many with verbal diarrea problems :)
mixel has quit [Quit: mixel]
<|jemc|> heh
pr0ggie has joined #ruby
<volty> (i was commenting on popl's comment)
ravster has quit [Quit: Leaving.]
<zipper> volty: uh do you have a place that I can read more on uniq.length?
<popl> I think that's a function of the base class that hasn't been overridden.
pdimitrov has quit [Ping timeout: 256 seconds]
<zipper> I didn't know .length was used for anything other than counting.
<zipper> It worked fine btw
<popl> it is used for counting
<volty> zipper: ([a,b,c].uniq).length
<Eiam> for a site that depends 100% on data from an external supplier, whats the best approach to unit testing my code?
<Eiam> since my code only operates on data from an external site
Notte has quit [Ping timeout: 246 seconds]
<Eiam> stub out some mock responses?
<popl> you are finding the unique elements of the array. if the elements are all the same, there will be one unique element zipper.
<popl> thus the length will be 1
efrainolivares_ has joined #ruby
<andrewvos> What about just `a == b && b == c`
<Eiam> Anarch: that doesn't scale well
<Eiam> what if you have 15 checks
snovak has quit [Remote host closed the connection]
<Eiam> shitty logic block to read
<andrewvos> Then you are not a very good developer
<Eiam> err andrewvos
<andrewvos> You have 15 variables?
<popl> and here we go with the 120 character lines again
polaco_zZz is now known as polaco
<Eiam> andrewvos: doing it in an array is much nicer, its easy to add in and you don't have to keep checking what logic operator is used for each statement, or worry about order
randomnick_ has quit [Quit: Leaving]
<zipper> andrewvos: man that has too much replication.
<banisterfiend> Eiam but it's not clear what's going on
efrainolivares has quit [Ping timeout: 272 seconds]
<banisterfiend> Eiam you have to put a comment explaining what your' doing
<banisterfiend> you're*
<banisterfiend> unless you wrap it in a method: all_equal?(a, b, c)
sepp2k has quit [Quit: Leaving.]
<banisterfiend> zipper DRY that impedes comprehensibility is bad
<zipper> It's best to prepare for the "largest" possible situation within logical limits of course.
<volty> i don't beleive so: 10 secs are enough to realize that it just reduces to 1 element if all equal
<Eiam> banisterfiend: I don't think it needed a comment
<popl> also it doesn't have to be all on one line. you can do like a && b &&\ b && c &&\ c && d &&\ …
<Eiam> its looking at the number of unique elements in an array
<andrewvos> If I have three variables I am not going to create an array and compare each one to each other one.
<zipper> does uniq.length really reduce comprehensibility?
<banisterfiend> zipper code that is not easily grokkable is bad code
pkrnj has joined #ruby
polaco is now known as polaco_zZz
<Eiam> seriously, whats not understandable about that code, saying .uniq and .length are confusing is.. pretty odd
vpretzel has joined #ruby
<popl> I'm not confused.
<zipper> Come on it made me learn about the uniq method
<zipper> It's a good thing
<Eiam> popl: andrewvos and banisterfiend seem to indicate its confusing
<popl> Where?
<popl> Oh
<popl> I see.
<zipper> Eiam: it isn't
mixel has joined #ruby
<zipper> I figured it out after asking
<popl> If it's a small number of variables then I would prefer andrewvos' method.
zz_jrhorn424 is now known as jrhorn424
<banisterfiend> right so, in order to just check whether three things are equal you introduce an array, and 2 methods
<popl> if it's a huge collection then that would be better.
<zipper> popl: what about scaling?
<Eiam> if its basically TWO, yeah
<zipper> debugging?
<banisterfiend> seems incidental complexity in the solution is significantly overriding the complexity of the actual problem
<andrewvos> I have node.js and the cloud for scaling
* Eiam banisterfiend: I personally would have just done ([] & [])
Fire-Dragon-DoL has joined #ruby
<|jemc|> !ary.find{|x| x!=ary[0]}
<popl> zipper: it scales
<Eiam> banisterfiend: if the set contains the same number of items, then it was the same data =)
<|jemc|> but I would probably use .uniq.size
<popl> why?
<Eiam> banisterfiend: are we trying to prematurely optimize here?
<volty> good point! [a,b,c].uniq == [a]
<|jemc|> there you go volty
<banisterfiend> Eiam yeah, but if you really did think you might need to compare more things in the future then at the lease wrap it in a method with a descriptive name, like def all_equal?(*args)
<andrewvos> If you require "rails" you can use uniq.one?
<zipper> popl: I am writing a method to check the number of sides a polygon has
rurban has joined #ruby
ctp has joined #ruby
<zipper> and I find that the one with length works best because all I change is the length == foo
<|jemc|> sounds like you should have a dedicated method then
jlast has quit [Remote host closed the connection]
vpretzel has quit [Ping timeout: 272 seconds]
<|jemc|> encapsulate it in your polygon object or wherever
jkline has quit [Quit: jkline]
<zipper> |jemc|: I do.
allaire has quit []
<|jemc|> then... everybody's happy, right?
<|jemc|> :P
mary5030 has quit [Remote host closed the connection]
Jeticus has quit []
spider-mario has quit [Remote host closed the connection]
mikepack has joined #ruby
fredjean has quit [Quit: Computer has gone to sleep.]
mary5030 has joined #ruby
pdimitrov has joined #ruby
mikeg has joined #ruby
Methylated1 has left #ruby [#ruby]
mikeg has quit [Remote host closed the connection]
<zipper> Too bad I missed the talk on the assault yet again
<zipper> Just as I logged on to twitter too late
<popl> Google it, man.
ephemerian has quit [Quit: Leaving.]
<zipper> I'll shut up about that
petey_ has quit [Remote host closed the connection]
<zipper> popl: mmmhh woman assulted at tech convention ruby
allaire has joined #ruby
petey_ has joined #ruby
<popl> not rocket science :P
Ox6abe has joined #ruby
SilverKey has quit [Quit: Sleep now]
mary5030 has quit [Ping timeout: 240 seconds]
CaptainJet has joined #ruby
jkline has joined #ruby
petey_ has quit [Ping timeout: 272 seconds]
<ShellFu> Hey all. I need some assistance simplifying this method. I have way to many if/then/else going on, and im not sure how to clean it up. >http://pastebin.com/QkaE7NRz<
Ox6abe has quit [Ping timeout: 264 seconds]
c0rn_ has quit [Quit: Computer has gone to sleep.]
dkamioka has quit [Remote host closed the connection]
dkamioka has joined #ruby
blackratdog has quit [Quit: Leaving]
Ox6abe has joined #ruby
<zipper> There really are sexists in this world. I just read this:
<zipper> A prominent man in the tech community was hired by a large computer manufacturer to be its master of ceremonies at a customer summit, where he said things like, “Men have invented everything worthwhile. All we can thank women for is the rolling pin.”
mikepack has quit [Remote host closed the connection]
<zipper> Ada Lovelace?
mikepack has joined #ruby
dkamioka_ has joined #ruby
<zipper> Marie Curie
dkamioka has quit [Read error: Connection reset by peer]
<|jemc|> yeah, men suck; so do white people; I'm both of those things, but I'm not being sarcastic here.
<volty> ShellFu: imo you should post your question starting with your input and the desired output -- because it would be much easier for those willing to help you write it from scratch
theoretick has quit [Quit: Textual IRC Client: www.textualapp.com]
a1ph4g33k has quit [Quit: Leaving]
jonr22 has joined #ruby
<ShellFu> point understood. Ill rephrase the question
<|jemc|> you can gripe about how much affirmative action hurts you as a talented young white man, but the truth is we need a little compensation in this world until we advance to the point where averyone actual has equal opportunity to advance their talent
<zipper> |jemc|: I am male and black and African. I bet there are much fewer africans in tech especially african females. So I guess I know what it half feels like.
jrhorn424 is now known as zz_jrhorn424
<zipper> For example I got a computer late last year
<zipper> My very first
<banisterfiend> zipper cool, which country are you from?
<zipper> I expect people in developed nations get them as kids.
mikepack_ has joined #ruby
<zipper> banisterfiend: Kenya
<|jemc|> yeah, we don't live in a post-racial or post-ethnic or post-gender world. not by a long shot. it irks me when people claim that we do
<shevy> zipper but when they were young it was like 1970 ... those computers kinda sucked
mikepack has quit [Read error: Connection reset by peer]
<banisterfiend> zipper cool :))
<shevy> though BASIC was fun
<zipper> Anyway I have learnt a load of stuff in just a year and I'm glad.
<terrellt> zipper: I've heard that lots of people in Africa are totally skipping desktop computers and going right to smart phones for internet access. True?
<zipper> I had/have to be super moticated though.
<shevy> terrellt are you describing people everywhere now :P
<zipper> terrellt: very true
<terrellt> shevy: No, there's a difference. -Literally- skipping.
<shevy> ah ok
<zipper> Same for the fixed line phones
sergicles has joined #ruby
<zipper> They barely exist
Shidash has joined #ruby
<terrellt> zipper: We were working on a mobile application to crowd-source translate children's books into local african dialects. It had to be a mobile website for just that reason.
<zipper> terrellt: are you african?
<volty> |jemc|: we need the humankind of Homo Sapiens's 2.0 for that to come // so just wait for the slow self-enhancement or hope that our Mighty will send a Service Pack
<terrellt> zipper: No, just work at a university library.
<zipper> true the best way to reach africans is mobile
zxq9 has quit [Quit: Konversation terminated!]
<zipper> I believe two factor auth would totally be the thing here
<zipper> :D
jonr22 has quit [Ping timeout: 256 seconds]
tylersmith has quit [Remote host closed the connection]
<volty> mobile: send photos of ice-cream with a mobile // Brave New World ! :)
<|jemc|> well, 1 year with a computer and already on IRC is a pretty good pace ;)