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
mary5030 has joined #ruby
nathancahill has joined #ruby
sergicles has quit [Quit: sergicles]
dbeason has joined #ruby
blackmesa has quit [Ping timeout: 240 seconds]
sergicles has joined #ruby
codezomb has joined #ruby
codezomb has quit [Client Quit]
Guest66192 has quit [Ping timeout: 240 seconds]
sergicles has quit [Client Quit]
AndChat| has quit [Ping timeout: 240 seconds]
mary5030 has quit [Ping timeout: 264 seconds]
Banistergalaxy has joined #ruby
ehaliewicz has joined #ruby
fenicks has quit [Remote host closed the connection]
<roflmaus> banisterfiend, by eigenclass you mean that the module would not contain object's instance variables?
kofno has joined #ruby
<banisterfiend> roflmaus not sure what u mean by that fren :D
zenloop has quit [Quit: zenloop]
<volty> wouldn't (say that) turn an object into a module if it does not that
AzizLight has quit [Ping timeout: 245 seconds]
<volty> probably brings 'into life' that object when an object, that includes that module, gets instantiated
<volty> am i wrong?
alx- has joined #ruby
<volty> the multiple inheritance -- the way arround
vlad_starkov has quit [Remote host closed the connection]
alx- has quit [Client Quit]
<volty> s/(say that)/(banister say that)/
dbeason has quit [Quit: Leaving...]
<banisterfiend> volty you're wrong :)
<volty> ah
tatsuya_o has joined #ruby
<volty> what it is about, then?
burlyscudd has quit [Quit: Leaving.]
<banisterfiend> volty it's a C extension that actually inserts the singleton class into an ancestor chain
alx- has joined #ruby
<volty> ah that...
<banisterfiend> so it gets around ruby's limitations to classes/eigenclasses, and just forcibly sticks them in ancestor chains, like you can do with modules
<|jemc|> ohh nifty
kofno has quit [Ping timeout: 264 seconds]
alx- has quit [Client Quit]
<banisterfiend> |jemc| this one is even cooler: https://github.com/banister/free
<banisterfiend> :)
<|jemc|> haha "Note we go through the id as accessing the freed object directly may cause a segfault"
alx- has joined #ruby
chrishough has joined #ruby
vlad_starkov has joined #ruby
<|jemc|> ha. and "Not complete protection from freeing silly things, e.g core classes. Be sensible :)"
<|jemc|> Object.free
Apocalypse has joined #ruby
<banisterfiend> yeah you can cause havoc :)
<banisterfiend> iirc it only works on ruby 1.9.2 though
<banisterfiend> 1.9.3 killed all the fun by making a lot of the nifty low level C APIs invisible
mary5030 has joined #ruby
<|jemc|> ah
<volty> they did well that ! :)
xk_id has joined #ruby
polaco_zZz is now known as polaco
<volty> start writing another lang if under abstinence syndrom
<volty> take qt, implement ruby using qt libs, link with ruby widgets .... and our lord will reward you for that
<volty> s/ruby widgets/qt widgets/
fuhgeddaboudit has quit [Quit: Ex-Chat]
tatsuya_o has quit [Ping timeout: 245 seconds]
Xanderby has quit [Quit: Xanderby]
ferdev has quit [Read error: Connection reset by peer]
bsaboia_ has joined #ruby
GeissT has quit [Ping timeout: 252 seconds]
zenloop has joined #ruby
<volty> what's behind def x; def y; end; end; x.y ? why and how that mixing works?
<volty> pardon, i saw something of how, but have no idea about why
hakunin has quit [Remote host closed the connection]
vxxr has joined #ruby
havenn has quit [Remote host closed the connection]
havenwood has joined #ruby
razi has quit [Ping timeout: 264 seconds]
<|jemc|> volty: it works only because x and y are defined on the toplevel
<|jemc|> toplevel methods are present for all child objects of Object
<volty> yes, |jemc|, i saw that, but it is x that mixes y
<|jemc|> so x.y calls y instance method with the receiver being the object returned by x
<volty> yes, but why?
Mars` has quit [Read error: Connection reset by peer]
Mars has joined #ruby
<|jemc|> it is essentially calling "x".y in that example
<volty> it is an eigenclass, i saw it
Mars is now known as Guest6271
<|jemc|> you're asking why he was doing it?
<volty> my question is why main extends the result with the :y method?
nathancahill has quit [Quit: nathancahill]
mrnugget has joined #ruby
havenwood has quit [Ping timeout: 240 seconds]
<volty> what is the ratio behind?
Zeeraw has quit [Ping timeout: 240 seconds]
<|jemc|> meh, I don't know why ruby is designed to work that way
<volty> it doesn't that on classes (as you, too, said)
polaco is now known as polaco_zZz
vlad_starkov has quit [Remote host closed the connection]
<volty> collateral?
deens has joined #ruby
<|jemc|> I mean, toplevel main is an instance of Object, right?
<|jemc|> well, it's something weirder than that
<|jemc|> >> def foo; "foo!" end; nil.foo
<eval-in> |jemc| => private method `foo' called for nil:NilClass (NoMethodError) ... (https://eval.in/53000)
ce_afk is now known as cescalante
<|jemc|> innnteresting
Kabaka has joined #ruby
<|jemc|> this is different for me in ruby 2,1
<volty> yes, it is quite weird, i have nose for these thingies
<|jemc|> in ruby 2.1:
<|jemc|> [1] pry(main)> def foo; "foo!" end; nil.foo
hogeo has joined #ruby
<|jemc|> => "foo!"
dbjeepn has joined #ruby
<|jemc|> >> RUBY_VERSION
<eval-in> |jemc| => "2.0.0" (https://eval.in/53001)
<|jemc|> so why did _that_ change between 2.0 and 2.1?
<|jemc|> anyone?
<volty> my imho theory?
maletor has joined #ruby
nisstyre has joined #ruby
<|jemc|> go ahead
<volty> follow: ruby extends main with all the defs, the routine is designed in a way that mixes the defs with the object in question /// meant for main but forgot it and mix with the return object
<volty> of whatever x returns
mrnugget has quit [Ping timeout: 264 seconds]
<|jemc|> it mixes it into _everything_ that .is_a? Object
deens has quit [Ping timeout: 248 seconds]
<volty> we are inside main -- so mix all defs with self, at the end -- for top level defs self is main -- for inner ones it is the result of the enclosing def
<volty> i would say collateral
bsaboia_ has quit [Ping timeout: 240 seconds]
<|jemc|> no, it works the same if you define y method outside of x method
<volty> e.g. ?
dbjeepn has quit [Quit: Leaving...]
siwica has quit [Read error: Connection reset by peer]
heidi has joined #ruby
<|jemc|> well, it works the same in 2.1
<|jemc|> [1] pry(main)> def x; def y; "y" end; "x"; end; x.y
<|jemc|> => "y"
<|jemc|> [2] pry(main)> def x; "x" end; def y; "y" end; x.y
<|jemc|> => "y"
<|jemc|> but not in 2.0
<|jemc|> >> def x; def y; "y" end; "x"; end; x.y
<eval-in> |jemc| => "y" (https://eval.in/53002)
<|jemc|> >> def x; "x" end; def y; "y" end; x.y
<eval-in> |jemc| => private method `y' called for "x":String (NoMethodError) ... (https://eval.in/53003)
brennanMKE has quit [Remote host closed the connection]
<|jemc|> which is even stranger than before
<|jemc|> I didn't see this in the release notes for 2.1...
<volty> ok, i see
<|jemc|> ha, probably because it hasn
<|jemc|> 't been released yet
<|jemc|> but the changelog I mean
jp- has joined #ruby
<volty> probably they tried to hide it but that created probs for other things
cescalante is now known as ce_afk
burlyscudd has joined #ruby
taternuts has joined #ruby
<volty> (in 2.0)
Guest6271 has quit [Remote host closed the connection]
Jetchisel has joined #ruby
<volty> same code, but add private if the object is not 'main'
nfk has quit [Quit: yawn]
brennanMKE has joined #ruby
<volty> our lord too had many many problems with versions :)
<volty> and with the design, i would say
mac___ has quit [Remote host closed the connection]
mac___ has joined #ruby
mac___ has quit [Read error: Connection reset by peer]
mac___ has joined #ruby
conner has quit [Ping timeout: 240 seconds]
gazzik has quit [Remote host closed the connection]
burlyscudd has quit [Ping timeout: 245 seconds]
Aryasam has joined #ruby
mac___ has quit [Remote host closed the connection]
randomnick_ has quit [Read error: Operation timed out]
mac___ has joined #ruby
i_s has quit [Remote host closed the connection]
ce_afk is now known as cescalante
kofno has joined #ruby
IceDragon has quit [Quit: Space~~~]
heidi has quit [Quit: Leaving.]
Senjai has joined #ruby
Senjai has quit [Changing host]
Senjai has joined #ruby
mac____ has joined #ruby
nathancahill has joined #ruby
mac___ has quit [Read error: Connection reset by peer]
dbjeepn has joined #ruby
Ox6abe has joined #ruby
Davey has joined #ruby
mac____ has quit [Remote host closed the connection]
Ox6abe has quit [Remote host closed the connection]
gazzik has joined #ruby
Ox6abe has joined #ruby
araujo has quit [Ping timeout: 245 seconds]
deens has joined #ruby
mac___ has joined #ruby
xk_id has quit [Quit:
Ox6abe has quit [Remote host closed the connection]
soba has joined #ruby
Ox6abe has joined #ruby
deens has quit [Read error: Connection reset by peer]
maletor has quit [Quit: Computer has gone to sleep.]
kitak has quit [Read error: Connection reset by peer]
endash has quit [Quit: endash]
deens has joined #ruby
kitak has joined #ruby
adeponte has joined #ruby
araujo has joined #ruby
burlyscudd has joined #ruby
tkuchiki has joined #ruby
justsee has joined #ruby
justsee has quit [Changing host]
justsee has joined #ruby
vlad_starkov has joined #ruby
endash has joined #ruby
justsee has left #ruby [#ruby]
sevenseacat has joined #ruby
mva3212 has quit [Read error: Connection reset by peer]
agent_white has quit [Quit: Lost terminal]
funburn has quit [Quit: funburn]
ehc has quit [Quit: ehc]
heidi has joined #ruby
w3pm is now known as d4
d4 has quit [Quit: Leaving]
funburn has joined #ruby
mesutozil has joined #ruby
nari has joined #ruby
dhruvasagar has joined #ruby
<mesutozil> why is it that when i upgraded to ruby 2.0.0 all of my gems seem to be gone?
<xybre> Because you need to reinstall your gems
maletor has joined #ruby
<volty> without 'Because' :)
<mesutozil> really so they're just gone?
<xybre> Depends on how you installed Ruby
<mesutozil> with rvm
<xybre> Then they are not gone
Davey has quit [Quit: Computer has gone to sleep.]
<volty> gems need to be built & checked & installed against the ruby version that is going to use them --
<xybre> But you also cannot port them to different versions, they may have C extensions and other things that rely on knowing the Ruby version and having the source code when they're installed.
atSetKey has joined #ruby
<mesutozil> ah
vlad_starkov has quit [Ping timeout: 245 seconds]
<mesutozil> well then
<mesutozil> i'll have to reinstall them no?
AzizLight has joined #ruby
mac___ has quit [Remote host closed the connection]
<xybre> Yep. If you're using bundler like you should, you would only have to do "bundle install" to get them back.
<mesutozil> hmm
<mesutozil> from any directory?
<xybre> From the directory with the Gemfile
<volty> switch back, generate a list, save it somewhere, switch forth, iterate (bash) over them installing
mac___ has joined #ruby
mac___ has quit [Read error: Connection reset by peer]
<mesutozil> dopamean: ~ $ bundle install
mac___ has joined #ruby
<mesutozil> Bundler::GemfileNotFound
<xybre> And if you did not use bundler to create your project then volty's option is the only one left.
<mesutozil> ah ok
<xybre> mesutozil: Then you don't have a Gemfile in that directory.
<mesutozil> well its not for any particular project. i think i must have misunderstood the point of gems
<xybre> There's lots of "points" for gems, but I don't know what your use case is, so I don't know.
mac___ has quit [Remote host closed the connection]
<mesutozil> or at least how the whole thing works.
dhruvasagar has quit [Ping timeout: 240 seconds]
<mesutozil> i had (or apparently still do have) colorize installed
<mesutozil> and i used it in a few different projects
<xybre> gems are just packaged up libraries of ruby code (sometimes with C extensions and other tomfoolery)
diegoviola has joined #ruby
<mesutozil> alright. please forgive my next ignorant question then
maletor has quit [Quit: Computer has gone to sleep.]
<mesutozil> i was using 1.9.3. i started a rails project
<mesutozil> and when i use 2.0.0 and try rails -s it says rails is not installed
<mesutozil> so i assume ill have to reinstall that as well
heidi has quit [Quit: Leaving.]
agjacome has quit [Quit: leaving]
<mesutozil> but if i use rvm to switch back to 1.9.3 it works fine
<xybre> Do you have a Gemfile in your Rails project root?
<mesutozil> yes
<xybre> Yes because gems are version-specific, so RVM automatically handles which gems get loaded.
<mesutozil> in the interest of not having something installed twice how do i remove the "version" installed with 1.9.3
<xybre> What are the contents of your Gemfile?
<mesutozil> or should i not be concerned with that
AzizLight has quit [Ping timeout: 268 seconds]
<xybre> You don't need to worry about it right now, you should probably keep them until you get your project working on 2.0
adeponte has quit [Remote host closed the connection]
<mesutozil> its a really really small project created for the purpose of learning about it
adeponte has joined #ruby
<mesutozil> the gems in that gemfile are rails (3.2.13), pg, and mustache
<xybre> Update rvm `rvm get stable` and update gem `gem update --system` and then update bundler `gem update bundler`, then from your Rails root try reinstalling your bundle using `bundle install`.
deens has quit [Remote host closed the connection]
<xybre> (normally you don't have to do all that, but I have no idea what state your system is in)
dbjeepn has quit [Quit: Leaving...]
deens has joined #ruby
<mesutozil> ill give it a shot
Guest51853 has joined #ruby
tkuchiki has quit [Read error: Connection reset by peer]
hogeo has quit [Read error: Connection reset by peer]
tkuchiki has joined #ruby
hogeo has joined #ruby
diegoviola is now known as Guest99730
Guest51853 is now known as diegoviola
adeponte has quit [Ping timeout: 245 seconds]
Guest99730 has quit [Ping timeout: 268 seconds]
Davey has joined #ruby
pigggie has quit [Ping timeout: 264 seconds]
deens has quit [Ping timeout: 248 seconds]
Aryasam has quit [Ping timeout: 245 seconds]
pigggie has joined #ruby
aryaching has joined #ruby
mercwithamouth has quit [Ping timeout: 248 seconds]
sergicles has joined #ruby
mayorga has joined #ruby
Mars has joined #ruby
mrnugget has joined #ruby
Mars is now known as Guest97163
Es0teric has joined #ruby
Es0teric has quit [Max SendQ exceeded]
r0bgleeson has joined #ruby
sectionme has joined #ruby
deens has joined #ruby
mrnugget has quit [Ping timeout: 264 seconds]
Ox6abe has quit [Remote host closed the connection]
brennanMKE has quit [Remote host closed the connection]
vlad_starkov has joined #ruby
Ox6abe has joined #ruby
agent_white has joined #ruby
sectionme has quit [Ping timeout: 264 seconds]
aryaching has quit [Read error: Connection reset by peer]
aryaching has joined #ruby
DrCode has quit [Ping timeout: 240 seconds]
funburn has quit [Read error: Connection reset by peer]
vlad_starkov has quit [Ping timeout: 268 seconds]
Ox6abe has quit [Ping timeout: 264 seconds]
funburn has joined #ruby
i_s has joined #ruby
saarinen has joined #ruby
dhruvasagar has joined #ruby
i_s has quit [Remote host closed the connection]
vxxr has quit [Quit: leaving]
atSetKey has quit [Remote host closed the connection]
Domon has joined #ruby
kofno has quit [Ping timeout: 256 seconds]
deens has quit [Remote host closed the connection]
mary5030 has quit [Remote host closed the connection]
deens has joined #ruby
mary5030 has joined #ruby
DrCode has joined #ruby
atSetKey has joined #ruby
Domon has quit [Remote host closed the connection]
baroquebobcat has joined #ruby
baroquebobcat has quit [Client Quit]
Domon has joined #ruby
mikepack has joined #ruby
mary5030 has quit [Ping timeout: 245 seconds]
deens has quit [Ping timeout: 268 seconds]
endash has quit [Quit: endash]
vishal has joined #ruby
Domon has quit [Ping timeout: 246 seconds]
kil0byte has joined #ruby
Hanmac1 has joined #ruby
gazzik has quit [Remote host closed the connection]
sayan has joined #ruby
Hanmac has quit [Ping timeout: 260 seconds]
kofno has joined #ruby
Domon has joined #ruby
mesutozil has quit [Remote host closed the connection]
smashwilson has quit [Read error: Connection reset by peer]
sepp2k1 has quit [Read error: Connection reset by peer]
varfoo has joined #ruby
volty has quit [Quit: Konversation terminated!]
brennanMKE has joined #ruby
vlad_starkov has joined #ruby
saarinen has quit [Quit: saarinen]
fuhgeddaboudit has joined #ruby
vishal has quit [Ping timeout: 264 seconds]
AzizLight has joined #ruby
vlad_starkov has quit [Ping timeout: 240 seconds]
Davey has quit [Quit: Computer has gone to sleep.]
Zeeraw has joined #ruby
raphaelivan has joined #ruby
brennanMKE has quit [Ping timeout: 264 seconds]
AzizLight has quit [Ping timeout: 264 seconds]
sayan has quit [Ping timeout: 246 seconds]
radic has quit [Disconnected by services]
radic_ has joined #ruby
iliketurtles has quit [Quit: zzzzz…..]
alx- has quit [Read error: Connection reset by peer]
Alex- has joined #ruby
devoldmx has joined #ruby
johnnode has joined #ruby
Jetchisel has quit [Quit: Unfortunately time is always against us -- *Morpheus*]
NealJ has quit [Quit: :c]
TheMoonMaster has joined #ruby
mary5030 has joined #ruby
Alex- has quit [Quit: Linkinus - http://linkinus.com]
alx- has joined #ruby
greenrose has joined #ruby
fijimunkii has quit [Quit: Lost terminal]
PeNNyWiSe182__ has joined #ruby
fijimunkii has joined #ruby
mrnugget has joined #ruby
mlpinit has quit [Remote host closed the connection]
mrnugget has quit [Ping timeout: 264 seconds]
nutella has joined #ruby
PeNNyWiSe182__ has quit [Quit: Textual IRC Client: www.textualapp.com]
nutella is now known as Guest19947
iliketurtles has joined #ruby
emergion has quit [Ping timeout: 260 seconds]
Jetchisel has joined #ruby
eka has quit [Quit: Computer has gone to sleep.]
dhruvasagar has quit [Ping timeout: 264 seconds]
vxxr has joined #ruby
Jetchisel has quit [Quit: Unfortunately time is always against us -- *Morpheus*]
iliketur_ has joined #ruby
mary5030 has quit [Remote host closed the connection]
varfoo has quit [Read error: Connection reset by peer]
iliketurtles has quit [Ping timeout: 240 seconds]
mary5030 has joined #ruby
mayorga has quit [Read error: Connection reset by peer]
mayorga has joined #ruby
kobain has quit []
mary5030 has quit [Ping timeout: 240 seconds]
Jetchisel has joined #ruby
endash has joined #ruby
endash has quit [Client Quit]
sailias has joined #ruby
varfoo has joined #ruby
cephalopod has joined #ruby
eka has joined #ruby
i_s has joined #ruby
krz has joined #ruby
krz has quit [Changing host]
krz has joined #ruby
Guest83275 has quit [Remote host closed the connection]
araujo has quit [Read error: Connection reset by peer]
i_s has quit [Ping timeout: 245 seconds]
araujo has joined #ruby
Guest97163 has quit [Remote host closed the connection]
chrishough has quit [Quit: chrishough]
chrishough has joined #ruby
taternuts has quit []
Fuzai has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
ukd1 has joined #ruby
Fuzai has joined #ruby
cescalante is now known as ce_afk
sailias has quit [Ping timeout: 246 seconds]
Andrevan has joined #ruby
Xanderby has joined #ruby
Xanderby has quit [Client Quit]
pigggie has left #ruby [#ruby]
nullobject has joined #ruby
gazzik has joined #ruby
AzizLight has joined #ruby
Hganavak has joined #ruby
gazzik has quit [Ping timeout: 248 seconds]
lukec has quit [Quit: lukec]
AzizLight has quit [Ping timeout: 245 seconds]
mayorga has quit [Remote host closed the connection]
lukec has joined #ruby
Guest19947 has quit [Ping timeout: 246 seconds]
kvirani_ has quit [Remote host closed the connection]
kvirani has joined #ruby
nutella_ has joined #ruby
kofno has quit [Ping timeout: 240 seconds]
cads has joined #ruby
SHyx0rmZ has quit [Quit: ネウロイを負かさなきゃならないね]
lukec has quit [Client Quit]
nisstyre has quit [Ping timeout: 245 seconds]
sectionme has joined #ruby
brockf has quit [Ping timeout: 240 seconds]
mikepack has quit [Remote host closed the connection]
kvirani has quit [Ping timeout: 248 seconds]
mikepack has joined #ruby
Inside has quit [Read error: Connection reset by peer]
Inside has joined #ruby
Inside has quit [Changing host]
Inside has joined #ruby
brockf has joined #ruby
zenloop has quit [Quit: zenloop]
kil0byte has quit [Ping timeout: 256 seconds]
DrShoggoth has quit [Quit: Leaving]
raphaelivan has quit [Quit: Leaving.]
mikepack has quit [Ping timeout: 240 seconds]
sectionme has quit [Ping timeout: 256 seconds]
jefflyne has quit [Ping timeout: 264 seconds]
deens has joined #ruby
jefflyne_ has joined #ruby
zz_michael_mbp is now known as michael_mbp
havenwood has joined #ruby
Mars has joined #ruby
mrnugget has joined #ruby
Mars is now known as Guest30567
kil0byte has joined #ruby
ukd1_ has joined #ruby
michael_mbp is now known as zz_michael_mbp
kleesc has joined #ruby
kleesc has left #ruby [#ruby]
brockf has quit [Ping timeout: 245 seconds]
brockf has joined #ruby
kofno has joined #ruby
ukd1 has quit [Ping timeout: 248 seconds]
mrnugget has quit [Ping timeout: 264 seconds]
Xanderby has joined #ruby
deens has quit [Remote host closed the connection]
kleesc has joined #ruby
LaPetiteFromage has joined #ruby
kleesc has left #ruby [#ruby]
kleesc has joined #ruby
kleesc has quit [Client Quit]
kil0byte has quit [Remote host closed the connection]
kofno has quit [Ping timeout: 240 seconds]
kleesc has joined #ruby
kleesc has left #ruby [#ruby]
Hanmac1 has quit [Quit: Leaving.]
mlpinit has joined #ruby
burlyscudd has quit [Quit: Leaving.]
kvirani has joined #ruby
DonRichie has joined #ruby
mlpinit has quit [Ping timeout: 248 seconds]
deens has joined #ruby
kvirani has quit [Remote host closed the connection]
kvirani_ has joined #ruby
cephalopod has quit [Ping timeout: 240 seconds]
lukec has joined #ruby
atSetKey has quit [Remote host closed the connection]
atSetKey has joined #ruby
yacks has quit [Ping timeout: 264 seconds]
Deele has quit [Ping timeout: 260 seconds]
atSetKey has quit [Ping timeout: 245 seconds]
r0bgleeson has quit [Quit: WeeChat 0.4.1]
iliketur_ has quit [Quit: zzzzz…..]
zz_michael_mbp is now known as michael_mbp
vxxr has quit [Ping timeout: 245 seconds]
blackratdog has quit [Quit: Leaving]
kleesc has joined #ruby
r0bgleeson has joined #ruby
kleesc has left #ruby [#ruby]
gja has joined #ruby
yfeldblum has quit [Ping timeout: 256 seconds]
yacks has joined #ruby
kleesc has joined #ruby
gazzik has joined #ruby
kleesc has left #ruby [#ruby]
s2013 has joined #ruby
atSetKey has joined #ruby
funburn has quit [Quit: funburn]
Heero has joined #ruby
kofno has joined #ruby
<krz> How does one call something like Foo.foo.bar
<krz> so far i can get it to work up to foo
<sevenseacat> like so?
<krz> Foo is a class that includes module Foo. but where should bar be defined?
<s2013> anyone has opinion on the opencv wrapper for ruby?
<havenwood> krz: Foo::Foo.bar
<krz> havenwood: i need to be able to chain it via Foo
<krz> class Foo
deens has quit [Remote host closed the connection]
tejas has joined #ruby
<havenwood> krz: Well, can't have a class and module of the same name anyways. Guess I'm not getting what you wanna do. Gist some code?
<sam113101> what do you really want to do?
ce_afk is now known as cescalante
<sam113101> that foobar stuff isn't really helpful
<krz> let me gist
<sevenseacat> good idea
mikepack has joined #ruby
tejas has quit [Client Quit]
gja has quit [Ping timeout: 240 seconds]
yacks has quit [Ping timeout: 264 seconds]
<bnagy> if Foo includes module Bar then it's just a_foo_obj.method_from_bar
<Andrevan> .baz
<Andrevan> ftfy
heftig has quit [Ping timeout: 245 seconds]
kofno has quit [Ping timeout: 268 seconds]
TryX has joined #ruby
<krz> https://gist.github.com/6862452 Id like to do User.where().first
<krz> currently works with User.where atm
kay_ has joined #ruby
<krz> how can i chain first ?
<bnagy> isn't that just User.first?
<bnagy> and also, EW
<krz> well id like to execute where first, and then do a first after
<krz> erm
iliketurtles has joined #ruby
<krz> id like to execute "where". then "first" based on the results that" where" returns
<krz> what kind of structure is required for this?
alx- has quit [Quit: Leaving...]
<bnagy> well where returns a hash object
<jrobeson> wouldn't it be cheaper to do LIMIT 1
<bnagy> User.where( # I HATE THIS ). <-- all hash methods available
lukec has quit [Quit: lukec]
benweint has joined #ruby
<jrobeson> ah.. i guess i did where().take
<jrobeson> since i only had 1 result
<jrobeson> ah actually it was Foo.active.take! but active had the where() in it..
jrhorn424 has joined #ruby
cescalante is now known as ce_afk
<bnagy> if, shiva forbid, you want to add special methods from Bar to that hash then build it in where, then .extend the object itself with Bar, then return it
<bnagy> but honestly, my eyes are already bleeding
<jrobeson> it seems like time would be better spent on how to write nicer ruby..
<jrobeson> than builda mess like that.
<sevenseacat> jrobeson: dont use common sense, geez
<krz> i just need to know how to chain methods
<jrobeson> sevenseacat, i'll try to remember that
<krz> the gist was a simple example depciting what i was trying to achieve
dzhulk has joined #ruby
<bnagy> more like decapitating
<jrobeson> krz, chaining methods just works.. as long as the result returns something that has methods
<krz> i.e. through means of the AR concept
<jrobeson> the method you want to chain i mean
<bnagy> if you ask about AR here I am allowed to mock you AR and also your code
<bnagy> those are the rules.
<jrobeson> hah
<jrobeson> krz, chaining just works with AR.. as long as your result has the method in which you want to chain
<bnagy> because you know, a User shouldn't be a user object, it should be some bullshit shell class for finding users from a database
<havenwood> krz: If you want to chain a method, just check the return value of the method you're chaining to. If `Foo.bar.class` is a Hash for example, you can call any Hash# method or monkey patch your own.
<jrobeson> i don't like using something as both an entity and as a repository on the same class
<bnagy> jrobeson: that is because you are Right Thinking
<jrobeson> bnagy, so is there any ruby ORM you do like?
TryX has quit [Remote host closed the connection]
<bnagy> dunno?
<bnagy> what's ORM precious?
<bnagy> sounds like when a DB wrapper and retarded II have a baby
colonolGron has joined #ruby
<bnagy> OO
<jrobeson> II ?
<havenwood> rom-rb (datamapper successor) looks interesting
poisonarms has joined #ruby
<jrobeson> havenwood, that's what i was looking at.. but it's nowhere near complete last i checked
nisstyre has joined #ruby
<jrobeson> the one i'm using in php operates in the same manner tho
<jrobeson> very similiar to hibernate in java
<bnagy> I take back the Right Thinking bit
<bnagy> ;)
<havenwood> jrobeson: nope, prolly not ready, just interesting thing on the horizon
colonolGron has quit [Client Quit]
diegoviola has quit [Ping timeout: 268 seconds]
<jrobeson> havenwood, well .. here's something that seems to work now.. http://fredwu.me/post/54009567748/datamappify-a-new-take-on-decoupling-domain-form-and
kvirani_ has quit [Remote host closed the connection]
<jrobeson> works with existing ORMs.. including activerecord
<havenwood> There's always Sequel: http://sequel.rubyforge.org/index.html
kvirani has joined #ruby
<jrobeson> note that i haven't looked that closely at it, or even used it.. it just seemed like a pragmatic approach in the moment
<havenwood> jrobeson: I guess one very helpful thing would be what the DB is going to be. Lots of ORMs.
<jrobeson> it also works with Sequel
mrnugget has joined #ruby
kreeves has quit [Ping timeout: 245 seconds]
<jrobeson> bnagy, well we don't always get to use the best thing ever all the time.. :(
ukd1_ has quit [Ping timeout: 268 seconds]
kvirani has quit [Ping timeout: 248 seconds]
<bnagy> woop beer o clock
havenwood has quit [Remote host closed the connection]
<krz> this is what im really trying to do: https://gist.github.com/bff6dc85effe52663f91
benweint has quit [Quit: Textual IRC Client: www.textualapp.com]
diegoviola has joined #ruby
benweint has joined #ruby
ukd1 has joined #ruby
<krz> reload gist please. Foo.get(1, 'activity_campaign')
<krz> Foo.get(1, 'activity_campaign')[0].run returns the first mathching campaign
<krz> id really like to do Foo.get(1, 'activity_campaign').increment(....).run
<krz> thats why i was asking about chaining
vlad_starkov has joined #ruby
atSetKey has quit [Remote host closed the connection]
Xanderby has quit [Quit: Xanderby]
<jrobeson> i doubt incerement is ever gonna return something that you can use with run
<jrobeson> depending on what run does anyways..
<krz> run is trivial
<krz> i just need to chain lines 23-32 with the results of get()
<diegoviola> i have a capybara spec where i'm calling click_link("some text") and i'm getting back a Capybara::ElementNotFound, but when i call #save_and_open_page or i print page.html i notice the element is actually there, any ideas what could be wrong?
<krz> ideally i would like to run something like: Foo.get(1, 'activity_campaign').increment
ecksit has joined #ruby
vlad_starkov has quit [Ping timeout: 240 seconds]
<ecksit> hey, does anyone have any experience with the thor gem and customising it?
sarmiena_ has joined #ruby
<krz> im trying to figure out where "increment" should be defined
<krz> in another module that is extended from DailyStatQueries?
<sam113101> what does get return?
dhruvasagar has joined #ruby
atSetKey_ has joined #ruby
havenwood has joined #ruby
<sam113101> sorry man, I haven't followed your conversation
<sam113101> get should return an object that you can call increment on it
<krz> sam113101: a RethinkDB::RQL object
michael_mbp is now known as zz_michael_mbp
<krz> which can interact with the update method
<krz> interact/respond
<krz> if get and increment are in the same module. i cant do Foo.get.update
<sam113101> and what's that? RethinkDB::RQL
AlSquirrel has joined #ruby
<krz> I can only do Foo.get and Foo.increment
AlSquire has quit [Read error: Connection reset by peer]
<krz> *i cant do Foo.get.increment*
wesside has quit [Ping timeout: 245 seconds]
<krz> sam113101: thats trivial
nutella_ has quit [Ping timeout: 240 seconds]
Es0teric has joined #ruby
<krz> its an object
<sam113101> the increment thing should be defined on the object you return
<sam113101> from get
<havenwood> krz: What is `Foo.get.class`?
<krz> havenwood: a RethinkDB::RQL object
wesside has joined #ruby
<sam113101> define increment in RethinkDB::RQL
<havenwood> ^
<krz> hm
<havenwood> krz: but do check, very much matters if you intend on creating a method
<sam113101> or define a singleton (not sure if it's the correct term) on the object before returning it
<sam113101> singleton method*
<krz> RethinkDB::RQL is a library. i have no access modification rights to it
<sam113101> so do what I said
<krz> sam113101: yea increment would be the singleton method
<krz> icnrement is just a custom method
<sam113101> then do it
<havenwood> krz: This is Ruby. You can open whatever you want and define your method.
<havenwood> krz: A gem doesn't change that.
<krz> but thats where i am confused
<krz> how can my custom method "increment" respond to the reults from "get"?
<havenwood> krz: Double check `Foo.get.class`?
<krz> havenwood: a RethinkDB::RQL object
<havenwood> krz: and `RethinkDB::RQL.class`?
<havenwood> krz: class RethinkDB::RQL; def increment; :whatever end end
<krz> havenwood: RethinkdDB::RQL is a gem. i shouldnt modify that directly
<havenwood> krz: Why not?
<krz> why should i?
Senjai has quit [Ping timeout: 240 seconds]
<krz> im using it to create a mini orm
AlSquirrel has quit [Quit: This computer has gone to sleep]
<krz> why should i modify the source directly
<sam113101> do what I just said, if you don't want to edit the class directly
<sam113101> just edit the object instead
<sam113101> you don't
<havenwood> krz: yup, do as sam113101 suggests if for whatever reason you don't want to add a method to the class.
<sam113101> you just monkey patch to it
<krz> line 26 is just pseudo code
<krz> isnt increment already a singletone method?
<krz> *singleton*
<krz> its definitely not an instance method
<havenwood> krz: Sounds to me like you want to be inheriting from RethinkDB::RQL in your custom class, but really dunno.
<sam113101> I'm not even sure I used the right term
<krz> sam113101: if you have a simple example of what you are trying to say. that would be great
<sam113101> the way I did it, the function belongs to a single object and not to the class it inherits from
<havenwood> krz: Not sure what your aim is exactly. Currently, you have `increment` as a class instance method (oft called just instance method) and it isn't a singleton.
<sam113101> I-I just gave you one
<krz> havenwood: its a singleton method. the module is being extended
<krz> not included
girija has joined #ruby
<havenwood> krz: oh, was just looking at the class - didn't read module code, oops
timonv has joined #ruby
girija has left #ruby [#ruby]
schaerli has joined #ruby
sectionme has joined #ruby
agent_white has quit [Quit: Lost terminal]
schaerli has quit [Remote host closed the connection]
schaerli has joined #ruby
xkickflip_ has joined #ruby
Inside has quit [Ping timeout: 245 seconds]
codecop has joined #ruby
tobago has joined #ruby
thesheff17 has quit [Ping timeout: 245 seconds]
xkickflip has quit [Ping timeout: 264 seconds]
xkickflip_ is now known as xkickflip
sectionme has quit [Ping timeout: 245 seconds]
SilverKey has joined #ruby
schaerli has quit [Ping timeout: 245 seconds]
freerobby has quit [Quit: Leaving.]
zz_tsykoduk is now known as tsykoduk
butblack has quit [Quit: butblack]
<poisonarms> Anyone recommend a good MySQL gem for connecting remotely to databases?
notjohn has quit [Quit: notjohn]
fuhgeddaboudit has quit [Ping timeout: 240 seconds]
butblack has joined #ruby
s2013 has quit [Quit: Leaving]
mengu has joined #ruby
Al_ has joined #ruby
jonahR has quit [Quit: jonahR]
dzhulk has quit [Quit: Leaving.]
headius has quit [Quit: headius]
juxovec has joined #ruby
jonahR has joined #ruby
nullobject has quit [Remote host closed the connection]
ru has quit [Disconnected by services]
nathancahill has quit [Quit: nathancahill]
Xanderby has joined #ruby
<jrhorn424> poisonarms: i dunno about mysql specific, but i hear taps is good
<jrhorn424> i'm not sure if it's just for syncing or if it includes an interactive console… not sure what you're trying to accomplish
nathancahill has joined #ruby
Al_ has quit [Read error: Connection reset by peer]
Al_ has joined #ruby
nathancahill has quit [Client Quit]
haxrbyte has joined #ruby
Guest30567 has quit [Remote host closed the connection]
osvico has quit [Ping timeout: 245 seconds]
i_s has joined #ruby
Mars has joined #ruby
i_s has quit [Remote host closed the connection]
Mars is now known as Guest23342
<poisonarms> jrhorn424, I just need to insert text into a MySQL database remotely.
nathancahill has joined #ruby
mrnugget has quit [Quit: mrnugget]
ewnd9 has joined #ruby
ewnd9 has quit [Remote host closed the connection]
<jrhorn424> i've never had to do that without SSH access, sorry. i'd start here though: https://www.ruby-toolbox.com/categories/by_name
tagrudev has joined #ruby
<jrhorn424> poisonarms: ^
LaPetiteFromage has quit [Quit: LaPetiteFromage]
Guest23342 has quit [Ping timeout: 256 seconds]
ewnd9 has joined #ruby
<poisonarms> jrhorn424, so, I tried building the mysql gem and got this error: http://pastebin.com/LuXhytt3 -- Does this have to do with the configuration options when building Ruby from source?
<jrhorn424> poisonarms: i've gotten a similar message when installing the pg gem on ubuntu. usually, it's because i'm missing a library that's required. try googling for installing the gem on your server OS.
Al_ has quit [Quit: Al_]
haxrbyte has quit [Remote host closed the connection]
<jrhorn424> i think in ubuntu its libpq-dev for postgres, but i'm not sure what you're missing for mysql
ananthakumaran has joined #ruby
<sevenseacat> tis indeed libpq-dev for postgres on ubuntu
haxrbyte has joined #ruby
vlad_starkov has joined #ruby
amacgregor has joined #ruby
amacgregor_ has quit [Ping timeout: 240 seconds]
chairabanta has joined #ruby
aagdbl has joined #ruby
mrsolo has joined #ruby
apeiros has quit [Read error: Connection reset by peer]
swordsmanz has quit [Quit: swordsmanz]
apeiros has joined #ruby
timonv has quit [Remote host closed the connection]
gmas has quit [Read error: Connection reset by peer]
timonv has joined #ruby
zoee has joined #ruby
ericmathison has joined #ruby
timonv has quit [Read error: Connection reset by peer]
timonv has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
hukl has joined #ruby
butblack has quit [Quit: butblack]
hukl has quit [Client Quit]
kil0byte has joined #ruby
dzhulk has joined #ruby
chairabanta has quit [Quit: Leaving...]
apeiros has quit [Remote host closed the connection]
apeiros has joined #ruby
vlad_starkov has quit [Ping timeout: 245 seconds]
niklasb has quit [Ping timeout: 268 seconds]
kiri has joined #ruby
apeiros has quit [Ping timeout: 245 seconds]
bsaboia_ has joined #ruby
gcds has joined #ruby
hukl has joined #ruby
hukl has quit [Client Quit]
havenwood has quit [Remote host closed the connection]
havenwood has joined #ruby
Senjai has joined #ruby
Senjai has quit [Changing host]
Senjai has joined #ruby
Elhu has joined #ruby
yacks has joined #ruby
Elhu has quit [Client Quit]
gcds has quit [Ping timeout: 245 seconds]
scottstamp is now known as zz_scottstamp
aganov has joined #ruby
tomzx_mac has quit [Ping timeout: 248 seconds]
havenwood has quit [Ping timeout: 245 seconds]
ananthakumaran has joined #ruby
ukd1 has quit [Remote host closed the connection]
ukd1 has joined #ruby
funburn has joined #ruby
nemesit|znc has quit [Ping timeout: 256 seconds]
ukd1 has quit [Ping timeout: 268 seconds]
tonni has quit [Remote host closed the connection]
iliketurtles has quit [Quit: zzzzz…..]
|jemc| has quit [Ping timeout: 240 seconds]
Advocation has joined #ruby
ecksit has quit [Ping timeout: 240 seconds]
mrsolo has quit [Quit: This computer has gone to sleep]
lemonsparrow has joined #ruby
kitak_ has joined #ruby
kitak_ has quit [Remote host closed the connection]
kitak has quit [Read error: Connection reset by peer]
kitak_ has joined #ruby
marcgg has joined #ruby
jonahR has left #ruby [#ruby]
Elhu has joined #ruby
gstamp has quit [Read error: Connection reset by peer]
wallerdev has quit [Quit: wallerdev]
decoydrone has joined #ruby
St_Marx has joined #ruby
gstamp has joined #ruby
apeiros has joined #ruby
gazzik has quit [Remote host closed the connection]
mikepack has quit [Remote host closed the connection]
mikepack has joined #ruby
noop has joined #ruby
mikepack has quit [Ping timeout: 245 seconds]
nemesit|znc has joined #ruby
tatsuya_o has joined #ruby
|jemc| has joined #ruby
Xanderby has quit [Quit: Xanderby]
tonni has joined #ruby
jprovazn has joined #ruby
jefflyne_ has quit [Ping timeout: 245 seconds]
yacks has quit [Ping timeout: 246 seconds]
|jemc| has quit [Ping timeout: 246 seconds]
Mars has joined #ruby
i_s has joined #ruby
Mars is now known as Guest64141
tatsuya_o has quit [Remote host closed the connection]
tatsuya_o has joined #ruby
tonni has quit [Read error: Connection reset by peer]
ferdev has joined #ruby
ferdev has quit [Remote host closed the connection]
ferdev has joined #ruby
Guest64141 has quit [Ping timeout: 245 seconds]
i_s has quit [Ping timeout: 245 seconds]
sectionme has joined #ruby
tatsuya_o has quit [Ping timeout: 264 seconds]
Elhu has quit [Quit: Computer has gone to sleep.]
rdark has joined #ruby
marcgg has quit [Ping timeout: 246 seconds]
Nogbit has left #ruby [#ruby]
Guest____ has joined #ruby
Guest____ has quit [Max SendQ exceeded]
marcgg has joined #ruby
nathancahill has quit [Quit: nathancahill]
filipe has joined #ruby
filipe has quit [Client Quit]
decoydrone has quit [Remote host closed the connection]
vlad_starkov has joined #ruby
tonni has joined #ruby
haxrbyte has quit [Read error: Connection reset by peer]
decoydrone has joined #ruby
Sammael has quit [Ping timeout: 245 seconds]
atSetKey_ has quit [Remote host closed the connection]
St_Marx has quit [Quit: Ex-Chat]
mengu has quit [Remote host closed the connection]
mrsolo has joined #ruby
mengu has joined #ruby
tatsuya_o has joined #ruby
mrnugget has joined #ruby
marcgg_ has joined #ruby
tatsuya_o has quit [Remote host closed the connection]
blaxter_ has joined #ruby
tatsuya_o has joined #ruby
vishal has joined #ruby
aapzak has quit [Read error: Connection reset by peer]
user258467 has joined #ruby
tonni has quit [Read error: Connection reset by peer]
mengu has quit [Remote host closed the connection]
ahawkins has joined #ruby
mengu has joined #ruby
akemrir has joined #ruby
mengu has quit [Remote host closed the connection]
marcgg has quit [Ping timeout: 264 seconds]
leonidlm has joined #ruby
mengu has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
<akemrir> xybre: I have decoded it. Proper format is 'L_L_S_S_l'
tatsuya_o has quit [Ping timeout: 256 seconds]
skaflem has joined #ruby
i_s has joined #ruby
dangerousdave has joined #ruby
aapzak has joined #ruby
Xanderby has joined #ruby
Davey has joined #ruby
mengu has quit [Ping timeout: 248 seconds]
andikr has joined #ruby
Andrevan has quit [Quit: WeeChat 0.4.2-rc1]
braoru has joined #ruby
tonni has joined #ruby
zz_michael_mbp is now known as michael_mbp
Al_ has joined #ruby
okinomo has joined #ruby
<xybre> akemrir: Awesome. Where did you find the correct documentation?
mrsolo has quit [Quit: This computer has gone to sleep]
<akemrir> xybre: first of all in this struct there are other struct. This caused problems
<akemrir> xybre: thats why there was 5 elements to decode
<xybre> akemrir: the time struct, right?
<akemrir> yes
<xybre> Yeah I worried about that, but when I decoded the time it looked like a valid epoch time so I didn't explore it further :/
<akemrir> xybre: it have two long integers
<xybre> Ahh
<akemrir> seconds and microseconds
<xybre> But aren't the microseconds always empty?
arturas_ has joined #ruby
<akemrir> nope, not always
<xybre> akemrir: So what does valid output look like?
<akemrir> in fact, they almost always are not zeros
<xybre> Hmm, my memory of the output I was seeing must be faulty then
<akemrir> Ill paste it in gist, wait moment
i_s has quit [Remote host closed the connection]
<xybre> Much nicer!
<akemrir> 4 is key press, 0 is pause event, 1 is key release
<akemrir> now I can count it properly too
<xybre> Yeah I actually wrote some of that int->name mapping code, but gist was behaving poorly so I couldn't post it
obs has joined #ruby
<xybre> Thats awesome. What are you going to do with it?
<xybre> Make a keylogger?
okinomo has quit [Ping timeout: 245 seconds]
SleepingShuck has quit [Ping timeout: 246 seconds]
<akemrir> nope, I need it for statistics only
<akemrir> maybe it would count how many W i press :), but not now
buibex has joined #ruby
ndngvr` has joined #ruby
iliketurtles has joined #ruby
<xybre> Oh there was an app that I had years ago that did something to that effect
JohnBat26 has joined #ruby
leonidlm has quit [Ping timeout: 245 seconds]
ndngvr has quit [Read error: Connection reset by peer]
zarubin has joined #ruby
<xybre> Wow it still exists http://whatpulse.org
<xybre> I'm often impressed at what survives the ages and what ends up in the catacombs.
<jrobeson> that's pretty cool xybre
claymore has joined #ruby
kil0byte has quit [Remote host closed the connection]
<akemrir> yeah, I have simpler requirements
<akemrir> simple*
atSetKey has joined #ruby
Senjai has quit [Ping timeout: 268 seconds]
Sammael has joined #ruby
<xybre> Looks like they purged my data at some point in the last 10 years lol
<akemrir> and it need low resources
kil0byte has joined #ruby
tonni has quit [Read error: Connection reset by peer]
<akemrir> not used account?
<akemrir> its make sense
mrsolo has joined #ruby
mrsolo has quit [Remote host closed the connection]
Elhu has joined #ruby
<xybre> users that haven't pulsed for 18 months ... will be pruned from now on
mrsolo has joined #ruby
troessner has joined #ruby
bricker`LA has quit [Ping timeout: 260 seconds]
Davey has quit [Quit: Computer has gone to sleep.]
<jrobeson> unless they are paying i hope..
<xybre> I don't think back in 2006 they had paid subscriptions for heatmaps
atSetKey has quit [Ping timeout: 245 seconds]
relix has joined #ruby
alup has joined #ruby
coderhs has joined #ruby
noop has quit [Ping timeout: 245 seconds]
<flughafen> morning everybody
lsmola has joined #ruby
Matip has quit [Read error: Connection reset by peer]
leonidlm has joined #ruby
Coffers has joined #ruby
siwica has joined #ruby
siwica has quit [Client Quit]
jlebrech has joined #ruby
tonni has joined #ruby
dangerousdave has quit [Quit: Leaving...]
iliketurtles has quit [Quit: zzzzz…..]
tonni has quit [Remote host closed the connection]
leonidlm has quit [Ping timeout: 245 seconds]
workmad3 has joined #ruby
hogeo has quit [Remote host closed the connection]
hogeo has joined #ruby
fgo has joined #ruby
adambeynon has joined #ruby
Nss has joined #ruby
joonty has quit [Quit: WeeChat 0.4.1]
cha1tanya has joined #ruby
schaerli has joined #ruby
hogeo has quit [Read error: No route to host]
Matip has joined #ruby
hogeo has joined #ruby
okinomo has joined #ruby
joonty has joined #ruby
zerun0 has quit [Read error: Operation timed out]
funburn has quit [Quit: funburn]
marcgg has joined #ruby
habanany has joined #ruby
hogeo has quit [Remote host closed the connection]
hogeo has joined #ruby
haxrbyte has joined #ruby
haxrbyte has quit [Remote host closed the connection]
haxrbyte has joined #ruby
chrishough has quit [Quit: chrishough]
marcgg_ has quit [Ping timeout: 248 seconds]
hogeo_ has joined #ruby
hogeo has quit [Read error: No route to host]
dhruvasagar has quit [Read error: Connection reset by peer]
dhruvasagar has joined #ruby
leonidlm has joined #ruby
tonni has joined #ruby
haxrbyte has quit [Ping timeout: 264 seconds]
habanany has quit [Ping timeout: 246 seconds]
mengu has joined #ruby
habanany has joined #ruby
dhruvasagar has quit [Read error: Connection reset by peer]
dhruvasagar has joined #ruby
zerun0 has joined #ruby
apeiros has quit [Remote host closed the connection]
ghr has quit [Quit: Textual IRC Client: www.textualapp.com]
dhruvasagar has quit [Read error: Connection reset by peer]
funburn has joined #ruby
apeiros has joined #ruby
h_kon has joined #ruby
gyzmodo has joined #ruby
dhruvasagar has joined #ruby
decoydrone has quit [Ping timeout: 248 seconds]
noop has joined #ruby
dhruvasagar has quit [Read error: Connection reset by peer]
leonidlm has quit [Ping timeout: 264 seconds]
dhruvasagar has joined #ruby
kil0byte_ has joined #ruby
ghr has joined #ruby
dangerousdave has joined #ruby
shaunbaker has joined #ruby
dhruvasagar has quit [Read error: Connection reset by peer]
kil0byte has quit [Ping timeout: 264 seconds]
obs_ has joined #ruby
dhruvasagar has joined #ruby
<akemrir> xybre: FYI 1 is key press, 0 is key release.
<akemrir> xybre: little update
obs has quit [Read error: Connection reset by peer]
obs__ has joined #ruby
vlad_starkov has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
i_s has joined #ruby
vlad_starkov has joined #ruby
noname001 has joined #ruby
<xybre> akemrir: yes heres that line from my version of your code: value = [:key_release, :key_press, :key_autorepeat][value_raw] # if you expect relative/absolute values for joystick input, this won't cover it
obs_ has quit [Ping timeout: 240 seconds]
<akemrir> yeah, right, now will work almost properly in my case
<akemrir> I`am having sometimes value of value_raw -> 4
<akemrir> Most important are 0 and 1 anyway
atSetKey has joined #ruby
i_s has quit [Ping timeout: 248 seconds]
bluepojo has joined #ruby
funburn has quit [Quit: funburn]
lkba has quit [Ping timeout: 264 seconds]
<akemrir> I have deamonized this and attached custom signal USR1, and I can now see how much data is gathered at the moment.
bluepojo_ has quit [Ping timeout: 240 seconds]
leonidlm has joined #ruby
shvelo has joined #ruby
MrZYX|off is now known as MrZYX
dhruvasagar has quit [Read error: Connection reset by peer]
mengu has quit [Changing host]
mengu has joined #ruby
einarj has joined #ruby
Advocation has quit [Quit: Advocation]
dhruvasagar has joined #ruby
Zai00 has joined #ruby
crashx has joined #ruby
Kar- has joined #ruby
<akemrir> xybre: thanks for help
blackmesa has joined #ruby
<xybre> akemrir: Np :)
jefflyne_ has joined #ruby
gja has joined #ruby
dhruvasagar has quit [Read error: Connection reset by peer]
AzizLight has joined #ruby
aryaching has quit [Ping timeout: 264 seconds]
atSetKey has quit [Ping timeout: 268 seconds]
dhruvasagar has joined #ruby
narcan has joined #ruby
snearch has joined #ruby
workmad3 has quit [Quit: Lost terminal]
bsaboia_ has quit [Read error: Connection reset by peer]
dhruvasagar has quit [Read error: Connection reset by peer]
tatsuya_o has joined #ruby
mosca_ has joined #ruby
dhruvasagar has joined #ruby
workmad3 has joined #ruby
Nss has quit [Ping timeout: 240 seconds]
poisonarms has quit [Ping timeout: 245 seconds]
leonidlm has quit [Ping timeout: 264 seconds]
yacks has joined #ruby
sander^work has quit [Read error: Connection reset by peer]
dhruvasagar has quit [Read error: Connection reset by peer]
snearch has quit [Quit: Verlassend]
atSetKey has joined #ruby
Matriks has joined #ruby
dhruvasagar has joined #ruby
nari has quit [Ping timeout: 264 seconds]
mklappstuhl has joined #ruby
niklasb has joined #ruby
JPascal has joined #ruby
schaerli has quit [Remote host closed the connection]
schaerli has joined #ruby
dhruvasagar has quit [Read error: Connection reset by peer]
funburn has joined #ruby
chrishough has joined #ruby
dhruvasagar has joined #ruby
Xeago has joined #ruby
sr78ger has joined #ruby
admin0 has joined #ruby
habanany has quit [Quit: Bye]
schaerli has quit [Ping timeout: 240 seconds]
mklappstuhl has quit [Remote host closed the connection]
bsaboia_ has joined #ruby
mklappstuhl has joined #ruby
Xeago has quit [Ping timeout: 245 seconds]
gamer_ has joined #ruby
elaptics`away is now known as elaptics
leonidlm has joined #ruby
gamer_ is now known as gnul0ver
dhruvasagar has quit [Read error: Connection reset by peer]
gja has quit [Quit: This computer has gone to sleep]
dhruvasagar has joined #ruby
gnul0ver has quit [Read error: Connection reset by peer]
fixl has joined #ruby
nomenkun has joined #ruby
joonty has quit [Ping timeout: 246 seconds]
okinomo has quit [Ping timeout: 245 seconds]
maroloccio has joined #ruby
scarolan has quit [Ping timeout: 245 seconds]
supergeek has joined #ruby
diegoviola has quit [Ping timeout: 268 seconds]
xcv has joined #ruby
scarolan has joined #ruby
wudofyr has quit [Ping timeout: 245 seconds]
nhhagen has quit [Ping timeout: 246 seconds]
smlgsx has quit [Ping timeout: 256 seconds]
sevenseacat has left #ruby [#ruby]
tvw has joined #ruby
leonidlm has quit [Ping timeout: 264 seconds]
okinomo has joined #ruby
mengu has quit [Remote host closed the connection]
mengu has joined #ruby
pkondzior___ has joined #ruby
blackmesa has quit [Ping timeout: 240 seconds]
ewnd9 has quit [Read error: Operation timed out]
nhhagen has joined #ruby
allsystemsarego has joined #ruby
wudofyr has joined #ruby
joonty has joined #ruby
jrhorn424 has quit [Quit: Textual IRC Client: www.textualapp.com]
supergeek has quit [Quit: Leaving]
vince_prignano has joined #ruby
mengu has quit [Ping timeout: 256 seconds]
razi has joined #ruby
JPascal has quit [Quit: Textual IRC Client: www.textualapp.com]
dhruvasagar has quit [Read error: Connection reset by peer]
postmodern has quit [Quit: Leaving]
threesome has joined #ruby
postmodern has joined #ruby
ismlages has quit [Ping timeout: 248 seconds]
roadt has joined #ruby
mrsolo_ has joined #ruby
mrsolo has quit [Read error: Connection reset by peer]
fjalvarez has quit [Quit: Leaving]
dhruvasagar has joined #ruby
cha1tanya has quit [Ping timeout: 245 seconds]
mklappstuhl has quit [Remote host closed the connection]
leonidlm has joined #ruby
xk_id has joined #ruby
kirun has joined #ruby
xk_id has quit [Client Quit]
khushildep has joined #ruby
kil0byte_ has quit [Remote host closed the connection]
abrausch has joined #ruby
ericmathison has quit [Ping timeout: 268 seconds]
nikeita has joined #ruby
obs__ is now known as obs
ericmathison has joined #ruby
abrausch has quit [Client Quit]
axsuul has quit [Ping timeout: 256 seconds]
mklappstuhl has joined #ruby
leonidlm has quit [Ping timeout: 245 seconds]
<nikeita> hello, best way to rename a key in a hash? i want this { :model => "aa", :year => 2013 } -> { :description => "aa", :year => 2013 }
<xybre> nikeita: hash[new_key] = hash.delete(old_key)
lkba has joined #ruby
<nikeita> hash.delete return the value…also i need to run this in a block for each?
amacgregor has quit [Ping timeout: 245 seconds]
ewnd9 has joined #ruby
jefflyne_ has quit [Ping timeout: 264 seconds]
<xybre> Open irb and try it, replacing new_key and old_key with your values.
<xybre> /s/values/key names
akemrir has quit [Quit: WeeChat 0.4.1]
<nikeita> thanks xybre
gmdeux has quit [Read error: Connection reset by peer]
nhhagen has quit [Ping timeout: 264 seconds]
juxovec has quit [Remote host closed the connection]
nhhagen has joined #ruby
<nikeita> xybre, i have an array of hash
aapzak has quit [Read error: Connection reset by peer]
dagobah has joined #ruby
buibex has quit [Remote host closed the connection]
buibex has joined #ruby
<xybre> Then yes, I'd iterate over them.
dhruvasagar has quit [Read error: Connection reset by peer]
buibex has quit [Read error: Connection reset by peer]
dangerousdave has quit [Quit: Leaving...]
buibex has joined #ruby
vishal_ has joined #ruby
aapzak has joined #ruby
vishal has quit [Ping timeout: 256 seconds]
dhruvasagar has joined #ruby
akemrir has joined #ruby
fabrice31 has joined #ruby
akemrir has quit [Client Quit]
jrhorn424 has joined #ruby
akemrir has joined #ruby
leonidlm has joined #ruby
DrCode has quit [Remote host closed the connection]
mburns has quit [Quit: ZNC - http://znc.sourceforge.net]
mrnugget has quit [Quit: mrnugget]
nari has joined #ruby
DrCode has joined #ruby
mburns has joined #ruby
DrCode has quit [Remote host closed the connection]
mburns has quit [Client Quit]
chrishough has quit [Quit: chrishough]
mburns has joined #ruby
okinomo has quit [Ping timeout: 256 seconds]
DrCode has joined #ruby
Mekkis has joined #ruby
vince_prignano has quit [Remote host closed the connection]
roflmaus has quit [Ping timeout: 256 seconds]
dhruvasagar has quit [Quit: leaving]
dhruvasagar has joined #ruby
MrZYX is now known as MrZYX|off
h_kon has quit [Remote host closed the connection]
dhruvasagar has quit [Ping timeout: 264 seconds]
mengu has joined #ruby
Es0teric has quit [Quit: Computer has gone to sleep.]
dhruvasagar has joined #ruby
mengu has quit [Changing host]
mengu has joined #ruby
atSetKey has quit [Remote host closed the connection]
Rollabunna has joined #ruby
fgo has quit [Remote host closed the connection]
noop has quit [Ping timeout: 246 seconds]
popl has quit [Quit: We must make an idol of our fear, and call it God.]
chairabanta has joined #ruby
michael_mbp is now known as zz_michael_mbp
ehaliewicz has quit [Read error: No route to host]
xk_id has joined #ruby
rdark has quit [Ping timeout: 245 seconds]
mrnugget has joined #ruby
mklappst_ has joined #ruby
postmodern has quit [Quit: Leaving]
kitak_ has quit [Remote host closed the connection]
tesuji has joined #ruby
noop has joined #ruby
leonidlm has quit [Read error: Operation timed out]
mklappstuhl has quit [Ping timeout: 256 seconds]
zz_michael_mbp is now known as michael_mbp
dhruvasagar has quit [Read error: Connection reset by peer]
rdark has joined #ruby
dhruvasagar has joined #ruby
Matriks has quit [Remote host closed the connection]
Guest56651 has joined #ruby
_bart has joined #ruby
mercwithamouth has joined #ruby
yfeldblum has joined #ruby
fgo has joined #ruby
<michael_mbp> seems one cannot do `block_given? ? yield context : nil`
<michael_mbp> thoughts?
<michael_mbp> the alternative is a two-liner `yield context if block_given?; nil unless block_given?`
hside has quit [Remote host closed the connection]
<Bofu2U> Random shot in the dark - tried putting the block_given? in ()'s?
<Bofu2U> I know that solves a lot of my issues with multiple .include?'s in an if.
crashx has quit [Quit: crashx]
hside has joined #ruby
<michael_mbp> Bofu2U: you mean `(block_given?) ? .. : ... ?
<Bofu2U> yeah
hside has quit [Remote host closed the connection]
dhruvasagar has quit [Read error: Connection reset by peer]
Stygia has joined #ruby
dhruvasagar has joined #ruby
<michael_mbp> seems that's not the issue
<Bofu2U> Crap. Worth a shot. Sorry
<michael_mbp> the error is that yield foo^ at that point it doesn't expect any further identifiers.
<michael_mbp> ah maybe yield(foo)
dawkirst has quit [Ping timeout: 248 seconds]
<michael_mbp> hah yes!
<michael_mbp> geeze...
<michael_mbp> makes sense, it thought : ... were arguments.
<michael_mbp> damn I need coffee :p
dawkirst has joined #ruby
<Bofu2U> :P
dhruvasagar has quit [Read error: Connection reset by peer]
dhruvasagar has joined #ruby
chairabanta has quit [Quit: Leaving...]
leonidlm has joined #ruby
buibex has quit [Remote host closed the connection]
hogeo_ has quit [Remote host closed the connection]
buibex has joined #ruby
hogeo has joined #ruby
_bart has quit [Remote host closed the connection]
_bart has joined #ruby
ephemerian has joined #ruby
Deele has joined #ruby
Domon has quit [Remote host closed the connection]
Domon has joined #ruby
colonolGron has joined #ruby
JohnBat26 has quit [Remote host closed the connection]
buibex has quit [Ping timeout: 264 seconds]
hogeo has quit [Ping timeout: 245 seconds]
_bart has quit [Ping timeout: 240 seconds]
Hganavak has quit [Quit: Leaving]
gcds has joined #ruby
nikeita has quit [Quit: sleep]
mikecmpbll has joined #ruby
Domon has quit [Ping timeout: 245 seconds]
JohnBat26 has joined #ruby
leonidlm has quit [Ping timeout: 245 seconds]
rickmasta has quit [Quit: Leaving...]
jrhorn424 has quit [Ping timeout: 245 seconds]
gcds has quit [Ping timeout: 240 seconds]
michael_mbp is now known as zz_michael_mbp
crashx has joined #ruby
fijimunkii has quit [Ping timeout: 245 seconds]
Xeago has joined #ruby
gcds has joined #ruby
zz_michael_mbp is now known as michael_mbp
Hanmac has joined #ruby
obs has quit [Quit: Konversation terminated!]
schaerli has joined #ruby
dhruvasagar has quit [Read error: Connection reset by peer]
<Hanmac> shevy in ruby forum someone is looking for a gem for "basic code protection" ;P
dhruvasagar has joined #ruby
<workmad3> :)
tkuchiki has quit [Remote host closed the connection]
Xeago has quit [Remote host closed the connection]
tkuchiki has joined #ruby
Dreamer3 has quit [Quit: Leaving...]
obs has joined #ruby
<Hanmac> workmad3: or did you an way for it? the current only way i know are bytecode, but not all interpreter support it like that
Anarch has quit [Ping timeout: 268 seconds]
<workmad3> hanmac: I tend to think of that sort of protection as futile
<workmad3> hanmac: but there does seem to be some stuff coming out of functional encryption atm that may make it possible... but still a ways off being productionised in arbitrary languages
Xeago has joined #ruby
tkuchiki has quit [Ping timeout: 245 seconds]
<Hanmac> the only way i would think is to use ruby inside an C application that does the protection and encyription for you … but they can be broken too
soba has quit [Ping timeout: 264 seconds]
<workmad3> yeah, the stuff I've seen coming out of functional encryption seems to indicate there are methods of treating your code as circuits (not a great leap) and then transforming them in ways that makes it pretty much impossible to reverse engineer them or using them in different ways
<workmad3> but I don't really understand it all
sevenseacat has joined #ruby
leonidlm has joined #ruby
mklappst_ has quit [Remote host closed the connection]
vlad_starkov has quit [Remote host closed the connection]
nari has quit [Ping timeout: 245 seconds]
kofno has joined #ruby
kil0byte has joined #ruby
buibex has joined #ruby
johnnode has quit [Quit: johnnode]
boboc has joined #ruby
mlpinit has joined #ruby
michael_mbp is now known as zz_michael_mbp
robbyoconnor has quit [Ping timeout: 240 seconds]
Xeago has quit [Remote host closed the connection]
<shevy> I wanna treat my code as a circus too!
abstractj has joined #ruby
<lemonsparrow> hi all :)
abstractj has quit [Changing host]
abstractj has joined #ruby
<boboc> guys how can i find the count of the words in a string? i thought i could use a regex with the /[a-z]*/ pattern but it doesn't return the count of the matches of the pattern
<Hanmac> shevy didnt you already have the "clown" module included? ;D
zz_michael_mbp has quit [Excess Flood]
michael_mbp has joined #ruby
PeNNyWiSe182__ has joined #ruby
<shevy> hanmac always
<Hanmac> boboc you can try str.scan(/\w+/) or str.split(/\W/) both should return an array of words
<shevy> boboc do you want to get a number?
<boboc> shevy: yes, a number
<shevy> >> "abc def ghi".scan(/\w+/).count
<eval-in> shevy => 3 (https://eval.in/53044)
<boboc> i could count the array
<shevy> ^^^ boboc
gcds has quit [Ping timeout: 264 seconds]
<shevy> yeah
g0bl1n has joined #ruby
<boboc> but i thought if there is something on the MatchData object with this info
<boboc> i didn't find in the docs
atSetKey has joined #ruby
nfk has joined #ruby
nfk has quit [Changing host]
nfk has joined #ruby
<Hanmac> shevy use .size not .count
funburn has quit [Quit: funburn]
svector has joined #ruby
gcds has joined #ruby
leonidlm has quit [Ping timeout: 248 seconds]
<shevy> hanmac why
<boboc> ok,thanks guys
<shevy> hmm
<shevy> would be nice if .count would work with regexes
fixl has quit [Remote host closed the connection]
<shevy> "abc def ghi".count(/\w+/)
<shevy> TypeError: can't convert Regexp into String
PeNNyWiSe182__ has quit [Client Quit]
<Hanmac> shevy because for some Enum stuff, size is calculated and not really counted … [0].cycle.size works but [0].cycle.count works not
<apeiros> shevy: count without an argument (scan(/…/).count) is bad. use .size there.
buibex has quit [Ping timeout: 268 seconds]
atSetKey has quit [Ping timeout: 248 seconds]
<Hanmac> hm i think we should make some count that works similar to grep … grep supports everything that works with ===
pygospa has joined #ruby
kil0byte_ has joined #ruby
pedda has joined #ruby
<banisterfiend> hanmac The field of karhags and that bloasted tree. Forget not the felled! For the lomondations of Oghrem! Warful doon’s bothem. Here furry glunn. Nye? Their feery pass. Tak! With guerillaman aspear aspoor to prink the pranks of primkissies. And the buddies be-hide in the byre. Allahblah!
Ox6abe has joined #ruby
gcds has quit [Quit: gcds]
TheRealPygo has quit [Ping timeout: 240 seconds]
chairabanta has joined #ruby
kil0byte has quit [Ping timeout: 268 seconds]
JohnBat26 has quit [Remote host closed the connection]
MrZYX|off is now known as MrZYX
yacks has quit [Ping timeout: 240 seconds]
MrZYX is now known as MrZYX|off
razi has quit [Ping timeout: 240 seconds]
JohnBat26 has joined #ruby
ldnunes has joined #ruby
yacks has joined #ruby
mlpinit has quit [Remote host closed the connection]
jefflyne_ has joined #ruby
dhruvasagar has quit [Read error: Connection reset by peer]
dhruvasagar has joined #ruby
mlpinit has joined #ruby
okinomo has joined #ruby
leonidlm has joined #ruby
blackmesa has joined #ruby
dash_ has joined #ruby
snovak has joined #ruby
Elhu has quit [Quit: Computer has gone to sleep.]
Rollabunna has quit [Remote host closed the connection]
dash_ is now known as d45h
Aryasam has joined #ruby
chairabanta has quit [Quit: Leaving...]
Kar- has quit [Ping timeout: 268 seconds]
mobileblue has quit [Max SendQ exceeded]
dbjeepn has joined #ruby
mobileblue has joined #ruby
DrCode has quit [Remote host closed the connection]
ce_afk is now known as cescalante
buibex has joined #ruby
vishal_ has quit [Remote host closed the connection]
yalue has joined #ruby
senayar has joined #ruby
vishal has joined #ruby
kil0byte has joined #ruby
larissa has joined #ruby
varfoo has quit [Quit: WeeChat 0.4.0]
krz has quit [Quit: krz]
aagdbl1 has joined #ruby
kil0byte_ has quit [Ping timeout: 245 seconds]
xcv has quit [Remote host closed the connection]
vishal has quit [Ping timeout: 264 seconds]
Lewix has quit [Remote host closed the connection]
tkuchiki has joined #ruby
aagdbl has quit [Ping timeout: 240 seconds]
Lewix has joined #ruby
snovak_ has joined #ruby
tkuchiki has quit [Remote host closed the connection]
Xeago has joined #ruby
tkuchiki has joined #ruby
WillAmes has joined #ruby
snovak has quit [Ping timeout: 245 seconds]
braoru has quit [Remote host closed the connection]
xcv has joined #ruby
dhruvasagar has quit [Read error: Connection reset by peer]
Lewix has quit [Ping timeout: 240 seconds]
_bart has joined #ruby
tkuchiki has quit [Ping timeout: 248 seconds]
codelette has joined #ruby
vlad_starkov has joined #ruby
Ox6abe has quit [Remote host closed the connection]
Ox6abe has joined #ruby
ndngvr` has quit [Read error: Operation timed out]
Aryasam has quit [Ping timeout: 264 seconds]
ndngvr has joined #ruby
einarj has quit [Ping timeout: 268 seconds]
Ox6abe_ has joined #ruby
decoponio has joined #ruby
Ox6abe_ has quit [Remote host closed the connection]
AlSquire has joined #ruby
barratt has joined #ruby
Ox6abe_ has joined #ruby
michael_mbp is now known as zz_michael_mbp
Ox6abe has quit [Ping timeout: 245 seconds]
dbjeepn has quit [Quit: Linkinus - http://linkinus.com]
dbjeepn has joined #ruby
gcds has joined #ruby
kalesage has joined #ruby
zz_michael_mbp is now known as michael_mbp
Aryasam has joined #ruby
Elhu has joined #ruby
nextdropping has joined #ruby
Ox6abe_ has quit [Ping timeout: 264 seconds]
_bart has quit [Remote host closed the connection]
_bart has joined #ruby
cescalante is now known as ce_afk
_bart__ has joined #ruby
aleron has joined #ruby
_bart has quit [Read error: Connection reset by peer]
bsaboia_ has quit [Ping timeout: 256 seconds]
aryaching has joined #ruby
Aryasam has quit [Quit: Bye]
vasilakisFiL has joined #ruby
mark_locklear has joined #ruby
<vasilakisFiL> hey guys new to ruby and I need a little help: I develop an http server (very common I know) and I am puzzled on how to store some global variables such as the port the server listens to, the directory it points etc
ananthakumaran1 has joined #ruby
ananthakumaran1 has quit [Max SendQ exceeded]
sumark has quit [Remote host closed the connection]
ananthakumaran1 has joined #ruby
Mrk1869 has joined #ruby
ananthakumaran1 has quit [Max SendQ exceeded]
ananthakumaran1 has joined #ruby
ananthakumaran1 has quit [Max SendQ exceeded]
ananthakumaran1 has joined #ruby
<apeiros> vasilakisFiL: you'd create a server class and store those values as instance variables in the server instance.
Mrk1869 has left #ruby [#ruby]
<tobiasvl> vasilakisFiL: well, a global variable looks like this: $var
<tobiasvl> but it sounds like you're wondering how to structure your program
<xybre> Yeah I was going to say what apeiros did first.
sarmiena_ has quit [Quit: sarmiena_]
<apeiros> tobiasvl: yeah, but a global variable is about the worst thing you can do.
sumark has joined #ruby
xcv has quit [Remote host closed the connection]
<tobiasvl> agreed
<apeiros> if the answer is "a global variable", then you're asking the wrong question :-p
<vasilakisFiL> when you say instance variables you mean with one @ right ?
TMM has joined #ruby
<apeiros> yes, @ivars
<vasilakisFiL> not class variables
<vasilakisFiL> ok
<TMM> hi all!
ananthakumaran has quit [Ping timeout: 245 seconds]
<apeiros> no, not @@cvars
xcv has joined #ruby
<tobiasvl> never use $gvars and never user @@cvars ;)
<apeiros> +1
<vasilakisFiL> apeiros the think is that when I want to change something from another class I will always need to have an instance of the main server class
<apeiros> rather: never declare them yourself. (it's ok to use the existing ones)
<vasilakisFiL> that's why I was thinking about @@vars
<apeiros> vasilakisFiL: "main server class"?
nikeita has joined #ruby
<apeiros> are you talking now about running a cluster of servers?
<vasilakisFiL> anyway I mean the class that holds the global variables
kil0byte_ has joined #ruby
lfox has joined #ruby
<apeiros> because either you create *a server*, or you create something which is *many servers*
<vasilakisFiL> I need always to delegete this class to any other class that might need access to global variables
<TMM> Would you normally use factories in Ruby? Are there equivalent design patterns that are more duck-typy?
<apeiros> and the thing you said first was *a server*. being precise matters in programming…
claymore has quit [Ping timeout: 240 seconds]
<xybre> TMM: Classes are factories?
<apeiros> vasilakisFiL: why would anything other than the server need to know e.g. the port?
<vasilakisFiL> yeah I mean the server class
<apeiros> if you're having that kind of coupling in your code you're probably something wrong…
<Hanmac> xybre in ruby everything can be a factory ;P
<vasilakisFiL> yeah port maybe is not needed but changing from http1.0 to 1.1 or 2.0 might needed
<apeiros> in ruby, all classes are factories.
<TMM> I guess my question isn't very clear. Sorry. So, I have written a bunch of code that looks a bit like this: SomeModule.configure(parameters) SomeModule::SomeClass.by_name("lama")
yacks has quit [Quit: Leaving]
<vasilakisFiL> anyway I want to understand what is the best way to store global variables in ruby, that is, variables that may be accessed by many classes
kil0byte has quit [Ping timeout: 240 seconds]
<TMM> but I need to provide some per-session data that I can't store in a module that's shared everywhere so I'm looking for as design pattern that'll let me do something like it. I have some ideas but none of them seem very natural to ruby
lfox has quit [Client Quit]
<vasilakisFiL> in Java for instance I would create a new class and declare them static
xcv has quit [Ping timeout: 245 seconds]
<TMM> I was thinking something like ... SomeModule.configure(parameters). factory = SomeModules::Factory.new(per-session parameters) factory::SomeClass.by_name(...)
<TMM> but that appears to not be possible
rainbyte has quit [Read error: Connection reset by peer]
nikeita has quit [Ping timeout: 245 seconds]
mklappstuhl has joined #ruby
<TMM> the global parameters are things like database connection settings, the per-session parameters are username related things and can't be shared, but each object created by the factory methods need to know about them
<Hanmac> in rails you can do: class YourClass < Factory("YourClassType") … end
<xybre> Okay so yesterday it was binary data manipulation, and today its going to be "global state", I can see it already.
_bart__ has quit [Remote host closed the connection]
<vasilakisFiL> apeiros when I say global variables of course I mean variables that will be accessed for read/write by many classes. So if I declare them instance variables of a class (for instance server class that initiates the server) I will always have to delegate the instance of the server class to any other class that might need access to these variables
<vasilakisFiL> do you think that this is the right way ?
<workmad3> vasilakisFiL: no
lfox has joined #ruby
<vasilakisFiL> so which is the right way ?
<xybre> TMM: What about a session object that you reference?
<apeiros> vasilakisFiL: no. I think information is pass-down.
<tobiasvl> vasilakisFiL: have you ever programmed in an object-oriented language before?
<apeiros> I think the java "lets just make things static (which is just a thin veil for "global")" is broken.
<apeiros> +way/metaphor
<TMM> xybre, that sounds good, but I'd have to find a way of telling each object in a session what session object belongs to it
<vasilakisFiL> the other way is to delegate thinks
<vasilakisFiL> which is better for testing I agree
<vasilakisFiL> is there any other way ?
<apeiros> not sure you and I use the term "delegate" the same way.
<xybre> TMM: Well it seemed like you wanted to do that with dependency injection, rather than a factor
<TMM> xybre, I don't really want to have to tell each factory method like by_name what session object it has
<workmad3> vasilakisFiL: redoing your design so that stuff is better organised around the data it needs? :P
<vasilakisFiL> dependency injection how you call it
ananthakumaran1 has quit [Read error: Connection reset by peer]
<vasilakisFiL> workmad3 you mean maybe I shouldn't have global variables ?
<workmad3> vasilakisFiL: yes
<TMM> xybre, what would that look like? roughly? in your idea? I'm sorry I'm not experienced enough to fill in the blanks based on what you just said
<workmad3> vasilakisFiL: you really shouldn't have globally shared, mutable state
ananthakumaran has joined #ruby
robbyoconnor has joined #ruby
ananthakumaran has quit [Max SendQ exceeded]
ananthakumaran has joined #ruby
ananthakumaran has quit [Max SendQ exceeded]
Guest56651 has quit [Remote host closed the connection]
ananthakumaran has joined #ruby
razi has joined #ruby
<vasilakisFiL> workmad3 from what I understand the other way is to delegate the state to each new class (when I say delegate I mean to pass any info the new class might need)
<vasilakisFiL> is there a third way ?
<workmad3> vasilakisFiL: passing the data a class or method needs is generally a good idea
schaerli has quit [Remote host closed the connection]
* workmad3 wonders when he wandered into basic OO 101
schaerli has joined #ruby
dbjeepn has quit [Quit: Linkinus - http://linkinus.com]
<vasilakisFiL> so passing a whole class that holds many vital variables as an argument is it a good thing? or should I pass independently each variable that a class need ?
<Xeago> vasilakisFiL: depends on the context
<Xeago> sometimes a dictionary is sufficient
<Xeago> most times*
krawchyk has joined #ruby
<banisterfiend> waxjar u here?
<banisterfiend> Xeago or u? can u tell me what this says? i'm trying to ring my doctor: https://www.evernote.com/shard/s130/sh/47f06239-8f3e-40d7-a4cf-3553a46a7618/aa5aa795e9e1194fac05ba9c7030543a
robbyoconnor has quit [Ping timeout: 268 seconds]
r0bby_ has joined #ruby
kil0byte has joined #ruby
<vasilakisFiL> this pattern that you pass trhough arguments any instance/variable that you may need how is called ? I named it delegation but I am not sure if this is the correct name
lsmola has quit [Ping timeout: 245 seconds]
<workmad3> vasilakisFiL: it's called 'passing arguments'
aagdbl1 is now known as aagdbl
<vasilakisFiL> haha ook
zarubin has quit [Ping timeout: 245 seconds]
schaerli has quit [Ping timeout: 256 seconds]
nari has joined #ruby
akam-it has quit [Quit: Leaving]
TheBrainWork has joined #ruby
kaldrenon has joined #ruby
boboc has quit [Remote host closed the connection]
aganov has quit [Remote host closed the connection]
shaunbaker has quit [Remote host closed the connection]
kil0byte_ has quit [Ping timeout: 256 seconds]
shaunbaker has joined #ruby
bsaboia_ has joined #ruby
<xybre> TMM: Maybe something like https://gist.github.com/acook/6867359
jefflyne_ has quit [Ping timeout: 246 seconds]
dbjeepn has joined #ruby
<apeiros> vasilakisFiL: delegation is when your object "server" responds to a method "port" which it internally just delegates to another object within it, e.g. "configuration".
<apeiros> the mere act of passing the information to the server and the server being able to use it is not delegation.
shaunbaker has quit [Read error: Operation timed out]
<apeiros> the act of making that internal information (stored in an object which is not `self`, or `this` in java) available externally and "passing" the call through is delegation.
<TMM> xybre, hmm, but that way you're going to have to give it the context with every constructor call. I'd like to avoid that, but perhaps that's not possible
Kneferilis has joined #ruby
jp- has left #ruby [#ruby]
vpretzel has joined #ruby
<vasilakisFiL> apeiros maybe I mean dependency injection ?
<xybre> TMM: You can add sugar to it pretty easy
<workmad3> vasilakisFiL: no, you don't
claymore has joined #ruby
<workmad3> vasilakisFiL: please stop throwing terms you've read somewhere around unless you understand them
SeySayux has quit [Ping timeout: 240 seconds]
* Hanmac throws the word "baumkuchen" into the round
universa1 has joined #ruby
<vasilakisFiL> I had read though that this kind of having many parameters in your methods and passing instances through them is a well known pattern that helps a lot testing
<TMM> xybre, how would you do that? if you could just tell me roughly what I can just look it up myself but I currently don't really have an idea :)
<vasilakisFiL> I just can't remember the name
<apeiros> vasilakisFiL: no, dependency injection is something entirely different.
<apeiros> also IMO DI is rarely ever needed in ruby, due to the way ruby works.
<apeiros> (not all patterns make the same sense in different languages…)
<xybre> TMM: Basically just moving all the repetitive stuff into a method
<workmad3> apeiros: I see DI all the time in ruby... we just don't need a big, complicated DI framework to achieve something that can be handled with duck-typing ;)
<TMM> xybre, right so you'd create explicit factory methods per class
buibex has quit [Remote host closed the connection]
SeySayux has joined #ruby
buibex has joined #ruby
pedda has quit [Quit: Textual IRC Client: www.textualapp.com]
decoponyo has joined #ruby
tesuji has quit [Ping timeout: 240 seconds]
buibex has quit [Read error: Connection reset by peer]
cookcode has joined #ruby
<apeiros> workmad3: maybe I need an example. but those cases I can think of, which could be understood as DI are IMO not DI. or rather, DI is not the best term to describe it.
<xybre> TMM: Depends, as long as things remain simple I'd probably keep that format, but if not then I'd break it down into more objects.
buibex has joined #ruby
<TMM> xybre, well currently there are 3 types of factory methods for 5 types of objects by_name, by_id and find
<apeiros> and yes, I agree, if it is those cases, then it's similar as with the factory pattern - it's just natural to ruby and doesn't need a complex framework.
<TMM> xybre, and they all need a per-session runtime environment as it turns out :)
notjohn has joined #ruby
<TMM> currently the code looks pretty neat I think
<workmad3> apeiros: it's what I've heard called 'poor mans DI', where it really is as simple as you pass in objects to other objects, rather than creating them in-line
AndChat| has joined #ruby
butblack has joined #ruby
devoldmx3 has joined #ruby
decoponio has quit [Ping timeout: 246 seconds]
<TMM> xybre, let me write down a small example of what the code looks like currently
jaynewst_ has quit [Remote host closed the connection]
<TMM> xybre, thanks a million for helping me out btw
<TMM> I know how to get this 'to work' but I want it to work nicely :)
gcds has quit [Quit: gcds]
jaynewstrom has joined #ruby
devoldmx has quit [Ping timeout: 245 seconds]
PeNNyWiSe182__ has joined #ruby
PeNNyWiSe182__ has quit [Client Quit]
<xybre> TMM: Well, my only issue is using a module to store state, but once thats resolved.. If all your factory methods are tiny, then you can keep them in one place, but its probably not a great plan to keep several factories in with other functionality, so I'd probably create some sort of environment object thats seperate from it all.
<TMM> xybre, that's what it looks like now: https://gist.github.com/hpvb/6867584
fridim_ has quit [Ping timeout: 252 seconds]
Banistergalaxy has quit [Ping timeout: 245 seconds]
SkuliOskarsson has joined #ruby
kil0byte_ has joined #ruby
Banistergalaxy has joined #ruby
blaxter_ is now known as blaxter
devoldmx has joined #ruby
hamakn has quit [Remote host closed the connection]
mikecmpbll has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<xybre> TMM: Pretty clean, still storing state in a module though ;)
burlyscudd has joined #ruby
<TMM> xybre, yeah, this is what it looks like NOW :)
mikecmpbll has joined #ruby
tonni has quit [Remote host closed the connection]
hamakn has joined #ruby
<TMM> xybre, the state stored in the module like this is fine, this stuff is in fact 100% static and really doesn't need changing, but the problem is there is another backend. Let me paste that too
<vasilakisFiL> it seems very strange to me that passing instances trhough several layers is not a design pattern
<xybre> Its a good start. I usually end up creating all sorts of sugar methods, but I don't know if I'd recommend it to everyone.
fabrice31 has left #ruby ["Quitte"]
kil0byte has quit [Ping timeout: 245 seconds]
AndChat| has quit [Ping timeout: 240 seconds]
breakingthings has joined #ruby
devoldmx3 has quit [Ping timeout: 245 seconds]
<xybre> TMM: The problem with state in a constant namespace like a module is that it means you can never have multiple sets of state (only 1 sever), and it makes testing more annoying having to explicitly set up and tear down state, which is what instances are there to do for you.
burlyscudd has quit [Client Quit]
devoldmx3 has joined #ruby
<TMM> xybre, https://gist.github.com/hpvb/6867644 <-- that is the other backend. the :user being the problem here :)
jibi has joined #ruby
<TMM> xybre, I see your point
<xybre> TMM: Can you syntax highlight that?
<TMM> xybre, sure, sorry
burlyscudd has joined #ruby
devoldmx has quit [Ping timeout: 264 seconds]
hamakn has quit [Ping timeout: 245 seconds]
<xybre> TMM: you can edit gists and add files to them too
<TMM> xybre, the nice thing about this is that the client code can remain the same, and tests for the various backends are almost 100% shared.
mrsolo_ has quit [Quit: This computer has gone to sleep]
michael_mbp is now known as zz_michael_mbp
ananthakumaran has quit [Read error: Connection reset by peer]
<xybre> TMM: Hmm, how would that go away?
BizarreCake has joined #ruby
nextdropping has quit [Remote host closed the connection]
<TMM> xybre, maybe I'm misunderstanding your code
devdazed has joined #ruby
ananthakumaran has joined #ruby
zz_michael_mbp is now known as michael_mbp
freerobby has joined #ruby
mrsolo has joined #ruby
mayorga has joined #ruby
<TMM> xybre, I basically want to DRY up the setting of all the parameters. But I guess the only way would be to have a factory object with an instance that you can call methods on. Right now it's all a bit magical in that you're creating more-or-less 'normal' objects without having to care about any of that stuff once you've setup the module
rickmasta has joined #ruby
dangerousdave has joined #ruby
blackmesa has quit [Remote host closed the connection]
jbynum has joined #ruby
devoldmx3 has quit [Ping timeout: 240 seconds]
<TMM> xybre, how would you expand your code to handle multiple object types?
butblack has quit [Quit: butblack]
okinomo has quit [Ping timeout: 268 seconds]
jerius has joined #ruby
<xybre> TMM: How similar/different are the constructors?
<TMM> completely identical
<xybre> Are they all subclasses of the same class?
<TMM> by_name(args = {}), by_id(args = {}), find(args = {})
h_kon has joined #ruby
<TMM> no
<TMM> but they could be
<TMM> :)
freerobby has quit [Quit: Leaving.]
fijimunkii has joined #ruby
<xybre> TMM: What about the requirements to instantiate each class? Are they also the same?
tesuji has joined #ruby
<TMM> xybre, yes
<TMM> well...
<TMM> no
Elhu has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<TMM> the various objects' factories need to fetch different information from the backends, each model initializer has different required and optional parameters
<TMM> xybre, this is an example of an easy one : https://gist.github.com/hpvb/6867832
<TMM> but they are all essentially the same
tonni has joined #ruby
nemesit|znc has quit [Ping timeout: 240 seconds]
<xybre> TMM: I'd use some metaprogramming to make my life easier, even just a simple registry would be great, but you could also do something a little more nefarious..
aryaching_ has joined #ruby
<TMM> xybre, what would the client-side code look like for something you have in mind?
tjbarber has joined #ruby
moshef has joined #ruby
<TMM> xybre, also: plenty of nefarious stuff going on already
sr78ger has quit [Quit: Textual IRC Client: www.textualapp.com]
ArchBeOS has joined #ruby
someish has joined #ruby
ArchBeOS is now known as ArchSteamOS
<tjbarber> http://d.pr/n/9fn5 <-- quick question, isn't self supposed to reference the class that the method is part of? In this example self in the method refers to the object that the method is called on. Am I confused here?
<tjbarber> Or does it refer to an instance of the class?
T_T has joined #ruby
kalesage has quit [Quit: ThrashIRC v2.9 sic populo comunicated]
<tjbarber> *the instance of the class
aryaching has quit [Ping timeout: 240 seconds]
phantasm66 has joined #ruby
<TMM> xybre, I see
<TMM> xybre, I already actually have all the information to do this
Ox6abe has joined #ruby
<TMM> xybre, I think I have an idea now, thank you, let me mock something up :)
<xybre> tjbarber: The method is part of String.. and you call the method on String.. so... yes?
<xybre> TMM: Cool :D
<TMM> I'm a little annoyed that I can't use the 'normal' ruby syntax on my client-side code but I guess that's ok
<tjbarber> xybre I guess so… I guess I'm thinking that self refers to the instance of the class that the method is called upon.
vasilakisFiL has left #ruby ["Konversation terminated!"]
tomzx_mac has joined #ruby
<tjbarber> xybre thanks man, just getting my head around there not being any primitive types I guess
kalesage has joined #ruby
iamjarvo has joined #ruby
St_Marx has joined #ruby
ehc has joined #ruby
jlast has joined #ruby
polaco_zZz is now known as polaco
<xybre> TMM: Normal?
<xybre> tjbarber: Yep, self is the instance of the class, the class is String and self is some actual string.
marcgg_ has joined #ruby
<tjbarber> right, thanks
Ox6abe_ has joined #ruby
T_T has quit [Remote host closed the connection]
boxmein has joined #ruby
zz_scottstamp is now known as scottstamp
kil0byte has joined #ruby
phantasm66 has quit [Quit: *poof*]
marcgg has quit [Ping timeout: 240 seconds]
Ox6abe has quit [Ping timeout: 256 seconds]
admin0 has left #ruby ["Leaving"]
admin0 has joined #ruby
h_kon has quit [Remote host closed the connection]
phantasm66 has joined #ruby
phantasm66 has quit [Changing host]
phantasm66 has joined #ruby
kil0byte_ has quit [Ping timeout: 268 seconds]
kvirani has joined #ruby
ananthakumaran has quit [Read error: Connection reset by peer]
zoee has quit [Quit: zoee]
angusiguess has joined #ruby
kil0byte_ has joined #ruby
ananthakumaran has joined #ruby
kofno_ has joined #ruby
lele has quit [Ping timeout: 245 seconds]
iamjarvo has quit [Remote host closed the connection]
iamjarvo has joined #ruby
alx- has joined #ruby
sailias has joined #ruby
kil0byte has quit [Ping timeout: 240 seconds]
r0bby_ has quit [Ping timeout: 256 seconds]
bsaboia_ has quit [Ping timeout: 256 seconds]
moshef has quit [Quit: moshef]
<tjbarber> hey guys, I'm looking for a "query builder" of sorts for Ruby. Something like this: http://knexjs.org Would it be ActiveRecord?
Soda has quit [Read error: Connection reset by peer]
nemesit|znc has joined #ruby
<TMM> xybre, ObjectType::constructor to yield ObjectType. Now it'll be something like Factory.constructor()
Xeago has quit [Remote host closed the connection]
shvelo has quit [Ping timeout: 256 seconds]
scottstamp is now known as zz_scottstamp
<wmoxam> tjbarber: ActiveRecord is an ORM
<wmoxam> tjbarber: which is a bit more heavy than knexjs
<tjbarber> yeah, looks that way. Way more heavy.
<wmoxam> tjbarber: take a look at sequel
<wmoxam> tjbarber: and Datamapper
ravster has joined #ruby
dhruvasagar has joined #ruby
burlyscudd has quit [Quit: Leaving.]
AndChat|87561 has joined #ruby
failshell has joined #ruby
failshell has quit [Remote host closed the connection]
<tjbarber> wmoxam looking at them both.. is DataMapper still alive? It looks like it hasn't been updated in awhile.
mdst has quit [Quit: Leaving]
<Morrolan> They've been working on DataMapper 2 (and decided to rename it, while they're at it)
kalesage has quit [Quit: ThrashIRC v2.9 sic populo comunicated]
failshell has joined #ruby
okinomo has joined #ruby
tonni has quit [Read error: Connection reset by peer]
<Morrolan> ROM, "Ruby Object Mapper" - http://rom-rb.org/
<tjbarber> ah ok, and Sequel looks great
AndChat|87561 has quit [Client Quit]
wallerdev has joined #ruby
Ox6abe has joined #ruby
jonathanwallace has quit [Ping timeout: 260 seconds]
freerobby has joined #ruby
duggiefresh has joined #ruby
interactionjaxsn has joined #ruby
nharvey has quit [Ping timeout: 264 seconds]
Ox6abe_ has quit [Ping timeout: 240 seconds]
freezey has joined #ruby
duggiefr_ has joined #ruby
aagdbl has quit [Quit: Leaving.]
xcv has joined #ruby
devoldmx has joined #ruby
St_Marx has quit [Quit: Ex-Chat]
eka has quit [Quit: Computer has gone to sleep.]
duggiefresh has quit [Ping timeout: 268 seconds]
tobago has quit [Remote host closed the connection]
Ox6abe has quit [Remote host closed the connection]
lemonsparrow is now known as Guest71279
Ox6abe has joined #ruby
devoldmx has quit [Ping timeout: 240 seconds]
jb41 has joined #ruby
zz_scottstamp is now known as scottstamp
notjohn has quit [Quit: notjohn]
joast has quit [Quit: Leaving.]
<xybre> The old DM isn't really alive, but I still use it. Still awaiting ROM, but its been rewritten and reconcieved entirely.
tonni has joined #ruby
AzizLight has quit [Ping timeout: 248 seconds]
gcds has joined #ruby
Coolhand has joined #ruby
shvelo has joined #ruby
tsykoduk has quit [Ping timeout: 252 seconds]
universa1 has left #ruby ["Verlassend"]
Ox6abe has quit [Ping timeout: 248 seconds]
devoldmx has joined #ruby
<TMM> xybre, is there a way to know the name of the the class that's using you as a superclass?
atno has joined #ruby
shaunbak_ has joined #ruby
bsaboia_ has joined #ruby
<xybre> TMM: From where? The subclass?
nari has quit [Ping timeout: 248 seconds]
kpshek has joined #ruby
Kar- has joined #ruby
<TMM> xybre, no, from the superclass. Maybe this actually needs to be a mixin
kpshek has quit [Remote host closed the connection]
<xybre> O_o
<xybre> TMM: self.class ?
<michael_mbp> hello
vlad_starkov has quit [Remote host closed the connection]
AndChat|87561 has joined #ruby
<michael_mbp> guys, I just found that Amazon are sending out reports using an incorrect MIME format
<michael_mbp> any suggestions on how to proceed?
tomzx_mac has quit [Ping timeout: 256 seconds]
<TMM> xybre, nvm I think I found it
tkuchiki has joined #ruby
jlebrech has quit [Ping timeout: 264 seconds]
enebo has joined #ruby
tonni has quit [Ping timeout: 240 seconds]
Squarepy has joined #ruby
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
codecop has quit [Remote host closed the connection]
sambao21 has joined #ruby
bean has joined #ruby
scarolan has quit [Remote host closed the connection]
aedorn has joined #ruby
kevind has joined #ruby
cads has quit [Ping timeout: 264 seconds]
fuhgeddaboudit has joined #ruby
ce_afk is now known as cescalante
jefflyne_ has joined #ruby
AzizLight has joined #ruby
narcan has quit [Quit: -[AppDelegate installMalware]: unrecognized selector sent to instance 0x156109c0]
joast has joined #ruby
gcds has quit [Ping timeout: 256 seconds]
jonathanwallace has joined #ruby
wildroman has joined #ruby
lukasik has joined #ruby
crashx has quit [Quit: crashx]
cody-- has joined #ruby
hamakn has joined #ruby
v0n has joined #ruby
v0n has quit [Client Quit]
tonni has joined #ruby
v0n has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
havenwood has joined #ruby
burlyscudd has joined #ruby
crashx has joined #ruby
akemrir has quit [Quit: WeeChat 0.4.1]
hamakn has quit [Ping timeout: 256 seconds]
lessless has joined #ruby
r0bby_ has joined #ruby
<AndChat|87561> Help autojoin
ffranz has joined #ruby
echevemaster has joined #ruby
lukec has joined #ruby
AndChat|87561 has quit [Quit: Bye]
Ox6abe has joined #ruby
habanany has joined #ruby
theRoUS has quit [Ping timeout: 245 seconds]
<habanany> Help autojoin
lukasik has quit [Quit: Leaving]
<habanany> Help join
sr78ger has joined #ruby
sr78ger has quit [Max SendQ exceeded]
heath has quit [Remote host closed the connection]
habanany has quit [Client Quit]
kobain has joined #ruby
heath has joined #ruby
heath has quit [Changing host]
heath has joined #ruby
sr78ger has joined #ruby
PeNNyWiSe182__ has joined #ruby
baordog_ has joined #ruby
<Hanmac> is that an irc or a rails question ? oO
brennanM_ has joined #ruby
PeNNyWiSe182__ has quit [Max SendQ exceeded]
<TMM> xybre, https://gist.github.com/hpvb/6868823 <--- how does that look?
PeNNyWiSe182__ has joined #ruby
<lessless> lol, of all existing toml parsers none work
mosca_ has quit [Quit: Sto andando via]
<lessless> all four
brennanM_ has quit [Read error: Connection reset by peer]
lele has joined #ruby
brennanMKE has joined #ruby
svector has quit [Ping timeout: 264 seconds]
<lectrick> So I finally made a gem: https://github.com/pmarreck/pachinko
tagrudev has quit [Remote host closed the connection]
tonni has quit [Read error: Connection reset by peer]
<lectrick> It is: A way to write auto-expiring monkeypatches.
<TMM> if anyone else wants to take a look at that gist that would be great
<TMM> if this is the way you guys would implement such a thing
<lectrick> It's probably a little rough around the edges. Any feedback appreciated. There is a test suite of course.
<lectrick> TMM is that a singleton factory? I wasn't sure and just stepped in
Uranio has joined #ruby
deception has joined #ruby
<TMM> lectrick, no it's not, it's intended to NOT be a singleton factory :)
strandberg has joined #ruby
Uranio has quit [Client Quit]
<lectrick> michael_mbp: parse the incorrect MIME format and file an issue with them?
burlyscudd has quit [Ping timeout: 245 seconds]
fgo has quit [Remote host closed the connection]
<lectrick> TMM: for this question: "is there a way to know the name of the the class that's using you as a superclass?" There's a couple ways to do this. You can track inherited events by defining inherited and keep a list- I think that's actually what Test::Unit does. You could also scan the entire ObjectSpace at runtime which is slow.
Squarepy_ has joined #ruby
<TMM> lectrick, I'm now using the self.included hook
Uranio has joined #ruby
Ox6abe_ has joined #ruby
Ox6abe has quit [Ping timeout: 248 seconds]
jibi has quit [Ping timeout: 240 seconds]
atno has quit [Remote host closed the connection]
burlyscudd has joined #ruby
thesheff17 has joined #ruby
<lectrick> TMM you mean the inherited hook? you can use the included hook if your functionality is meant to be a module
bricker`LA has joined #ruby
terrellt has joined #ruby
<lectrick> The nice thing about inheritance via modules is that you remove an additional dependency and can test in isolation better
<TMM> lectrick, yeah it doesn't really matter for my purposes. I think the 'include' is a bit cleaner given what I'm actually doing
<lectrick> TMM yeah, I'm sure you can make it work either way
<waxjar> i am now banisterfiend
fgo_ has joined #ruby
mupkoo has joined #ruby
schaerli has joined #ruby
okinomo has quit [Ping timeout: 245 seconds]
shvelo has quit [Ping timeout: 256 seconds]
theRoUS has joined #ruby
theRoUS has joined #ruby
<lectrick> waxjar.is_a?(BanisterFiend) #=> true
<waxjar> lol
SkuliOskarsson has quit [Quit: SkuliOskarsson]
danshultz has joined #ruby
d45h has quit [Ping timeout: 240 seconds]
gilesw_ has quit [Ping timeout: 240 seconds]
lkba has quit [Ping timeout: 240 seconds]
sophomorical has quit [Ping timeout: 240 seconds]
Fuzai has joined #ruby
Fuzai has quit [Remote host closed the connection]
<banisterfiend> waxjar too late, i needed you to dedutchify my doctor's answer phone msg :)
<Hanmac> TMM what about "define_singleton_method" ?
<waxjar> aah, oh well
<lectrick> dedutchify? hell, i'd just Dutch All The Things™
<TMM> hanmac, I need to support 1.8
<Hanmac> TMM and to_sym on define method functions is not needed
atSetKey has joined #ruby
sophomorical has joined #ruby
dash_ has joined #ruby
jarm has quit [Ping timeout: 248 seconds]
ssickle has quit [Read error: Connection reset by peer]
coderhs has quit [Ping timeout: 240 seconds]
<Hanmac> TMM thats like supporting "punch cards"
<Rylee> Quick question - what would be the best way to graph https://gist.github.com/1275f3cfe09aea90051d
wildroman has quit [Remote host closed the connection]
<TMM> hanmac, I'm sorry
<TMM> :)
<TMM> 1.8.7
<Hanmac> if your system does not support newer ruby than your system is not worth to be called an actual system ...
<Rylee> over time, that is - it's "#{Time.now.to_i} #{event.absolute_name} #{File.size event.absolute_name}\n"
devoldmx has quit [Read error: Connection reset by peer]
wildroman has joined #ruby
Uranio has quit [Quit: while you reading this, a kitty dies]
wildroman has quit [Read error: Connection reset by peer]
devoldmx has joined #ruby
razi has quit [Ping timeout: 245 seconds]
wildroman has joined #ruby
rickmasta has quit [Quit: Leaving...]
Squarepy has quit [Quit: Leaving]
Squarepy_ is now known as Squarepy
<workmad3> TMM: 1.8.7 is EOL now
<Hanmac> Rylee i would use () for File.size but i think its what you can use
okinomo has joined #ruby
<TMM> it's not my choice
nari has joined #ruby
mklappstuhl has quit [Remote host closed the connection]
<workmad3> TMM: you can kick up a fuss
<Hanmac> Rylee or: "%d %s %d" % [Time.now.to_i, event.absoule_name, File.size(event.absoule_name)]
<workmad3> TMM: pointing out that 1.8.7 will get *nothing*, no new security updates, etc
tabolario has joined #ruby
<workmad3> TMM: and that more and more things will stop supporting it
strandberg has quit [Quit: leaving]
atSetKey_ has joined #ruby
<lectrick> TMM step 1 is to fight anyone or any requirement who requires 1.8 support with all your might
Ox6abe_ has quit [Remote host closed the connection]
<Rylee> hanmac, irrelevant to the question at hand though
<Hanmac> lectrick: i think we should begin to stop helping others when they ask 1.8 questions ;P
rrichardsr3 has joined #ruby
<TMM> it wasn't a 1.8 question
<TMM> my example code justh append to also support 1.8
<workmad3> Rylee: can't you use a decent log format? :(
<lectrick> hanmac: or just say "fix your 1.8 problem, then come back" :)
atSetKey has quit [Ping timeout: 245 seconds]
strandberg has joined #ruby
<lectrick> heck we're about to get on 2.0 here and we have a gigantic codebase
<Rylee> workmad3, the only thing i'd be interested in changing is \t separator instead of spaces
jlebrech has joined #ruby
<workmad3> Rylee: I'm just thinking that if you used something approaching a standard format, you could show the data at something like nagios, ganglia, logwatch, etc
<workmad3> Rylee: and get the graphing, alerting, etc. done for you
<workmad3> s/show/throw
<workmad3> Rylee: and your sysadmins would probably love you ;)
endash has joined #ruby
<Rylee> my sysadmins are a mess already, the reason i'm even writing this is because they haven't set something up using any of those for it
<waxjar> that's not a valid argument
<Rylee> i didn't come here to argue about my workflow, i came here to ask a question about the best way to graph a data set
rickmasta has joined #ruby
<workmad3> Rylee: the best way is to get the data into a form that something like ganglia can handle and let that graph it for you, IMO
banister has joined #ruby
banisterfiend has quit [Read error: Connection reset by peer]
iamjarvo has quit [Remote host closed the connection]
dhruvasagar has quit [Ping timeout: 246 seconds]
mary5030 has joined #ruby
Xeago has joined #ruby
iamjarvo has joined #ruby
mklappstuhl has joined #ruby
nemesit|znc has quit [Ping timeout: 245 seconds]
Xeago has quit [Ping timeout: 245 seconds]
alex__c2022 has joined #ruby
ukd1 has joined #ruby
iamjarvo has quit [Ping timeout: 268 seconds]
nemesit|znc has joined #ruby
dash_ has quit [Quit: dash_]
gja has joined #ruby
cescalante is now known as ce_afk
iamjarvo has joined #ruby
vpretzel_ has joined #ruby
shvelo has joined #ruby
taptapdan has joined #ruby
devoldmx has quit [Read error: Connection reset by peer]
devoldmx has joined #ruby
mikecmpbll has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
mercwithamouth has quit [Ping timeout: 245 seconds]
rrichardsr3 has quit [Quit: -- I'm getting very tired --]
burlyscudd has quit [Quit: Leaving.]
mikecmpbll has joined #ruby
buibex has quit [Remote host closed the connection]
colonolGron has quit [Quit: Lost terminal]
yfeldblum has quit [Quit: Leaving]
vpretzel has quit [Ping timeout: 248 seconds]
vpretzel_ is now known as vpretzel
joofsh has joined #ruby
okinomo has quit [Ping timeout: 245 seconds]
Guest20259 has joined #ruby
momomomomo has joined #ruby
burlyscudd has joined #ruby
noop has quit [Ping timeout: 264 seconds]
dzhulk has quit [Quit: Leaving.]
theRoUS has quit [Ping timeout: 256 seconds]
cody-- has quit [Quit: derp]
nwertman has joined #ruby
Soda has joined #ruby
zerun0_ has joined #ruby
riceandbeans has joined #ruby
jprovazn has quit [Quit: Leaving]
zerun0 has quit [Ping timeout: 268 seconds]
<riceandbeans> is this the correct form to do this?
tesuji has quit [Read error: Connection reset by peer]
araujo has quit [Read error: Connection reset by peer]
<riceandbeans> variable =~ /regex(matchgroup)/.match(datasource)[match#]
araujo has joined #ruby
<riceandbeans> I did that and then on the next line, puts variable, and it said undefined variable
jbynum has quit [Ping timeout: 245 seconds]
SkuliOskarsson has joined #ruby
NealJ has joined #ruby
AzizLight has quit [Ping timeout: 264 seconds]
nemesit|znc has quit [Ping timeout: 246 seconds]
nathancahill has joined #ruby
nwertman has quit [Ping timeout: 246 seconds]
pushpak has joined #ruby
nemesit|znc has joined #ruby
<TMM> Is it possible to include a module in a class from the outside?
<lectrick> TMM yes. Class.send(:include, Module)
nyuszika7h has joined #ruby
ananthakumaran has joined #ruby
<TMM> lectrick, thanks
ananthakumaran has quit [Max SendQ exceeded]
<lectrick> Class is of course the classname, not Class object itself
danshultz has quit [Remote host closed the connection]
<riceandbeans> lectrick: did you read my question?
<TMM> lectrick, noted
blackmesa has joined #ruby
ananthakumaran has joined #ruby
ananthakumaran has quit [Max SendQ exceeded]
<nyuszika7h> hi, is it possible to automaticaly save the last return value in a variable (e.g. "ans") in irb / pry?
<lectrick> riceandbeans: regex meister here. let me see
ananthakumaran has joined #ruby
ananthakumaran has quit [Max SendQ exceeded]
ananthakumaran has joined #ruby
ananthakumaran has quit [Max SendQ exceeded]
<lectrick> riceandbeans: =~ is already doing your match
ananthakumaran has joined #ruby
atSetKey_ has quit [Remote host closed the connection]
<riceandbeans> I'm not sure you understand what I want lectrick
nari has quit [Ping timeout: 268 seconds]
<lectrick> /regex(matchgroup)/.match(datasource)[match#] is your matched string, you can assign it to a variable the usual way
<riceandbeans> I want to assign a match group to a new variable name
<riceandbeans> yeah
<riceandbeans> so do I NOT do variable =~ then?
<lectrick> so variable = /regex/.match(string)[index]
<riceandbeans> ok
<riceandbeans> yeah
<riceandbeans> took out the tilda and it worked
<riceandbeans> I'm used to =~ //
<riceandbeans> thanks
<lectrick> riceandbeans: =~ is already "running" a regex. You just want assignment. =~ is like a simpler .match
ukd1 has quit [Remote host closed the connection]
scmaccal has joined #ruby
scmaccal has quit [Excess Flood]
<lectrick> yeah that's correct, you don't need the tilde.
cookcode has quit [Ping timeout: 245 seconds]
johnnyfuchs has joined #ruby
scmaccal has joined #ruby
scmaccal has quit [Excess Flood]
ukd1 has joined #ruby
<TMM> lectrick, is something similar possible with inheritance?
theRoUS has joined #ruby
<lectrick> nyuszika7h: The underscore in irb always contains the last return value. _
scmaccal has joined #ruby
scmaccal has quit [Excess Flood]
<nyuszika7h> ah, thanks
<lectrick> nyuszika7h: Note that "normal" Ruby does not provide that underscore functionality. That is only available in the irb REPL.
RichardBaker has joined #ruby
<nyuszika7h> yeah, I guessed so
benweint has quit [Quit: Computer has gone to sleep.]
<lectrick> I actually don't have a lot of experience with other REPL's, but I surmise it was an idea borrowed from others
<TMM> lectrick, is it possible to do the equivalent of Class Llama < Stuff ?
xk_id has quit [Quit:
<lectrick> TMM: Llama = Class.new(Stuff)
pushpak has quit [Quit: Linkinus - http://linkinus.com]
lyanchih has joined #ruby
<TMM> lectrick, what if the class Llama is already defined somewhere?
ahawkins has quit [Read error: Operation timed out]
<lectrick> TMM: Then you have to reopen it instead of redefining it
dhruvasagar has joined #ruby
xk_id has joined #ruby
<lectrick> TMM You mean it's already defined somewhere as not a subclass of Stuff?
alup has quit [Quit: Leaving]
<TMM> OK, so if you have a Class:Llama what do you do to make it inherit from "Stuff"? I'm a little lost :)
<TMM> lectrick, yes
<lectrick> TMM If that's the case I don't know what would happen if you redefined it. I would avoid it
mengu has quit [Remote host closed the connection]
<TMM> OK, fair enough
Altonymous has joined #ruby
raphaelivan has joined #ruby
<workmad3> TMM: if you try to redefine the hierarchy, you get errors
<lectrick> TMM, you can't make an already established class inherit from a new class. You can only mix a module into it
<TMM> yeah it's actually entirely unreasonable
ukd1 has quit [Ping timeout: 256 seconds]
<TMM> I see what I need to do now
<TMM> thanks
<workmad3> >> class Foo < Object; end; class Foo < BasicObject
<eval-in> workmad3 => /tmp/execpad-a2873c6222a8/source-a2873c6222a8:7: syntax error, unexpected end-of-input, expecting keyword_end (https://eval.in/53077)
<lectrick> And once you mix it in you can't unmix it either :O
<workmad3> >> class Foo < Object; end; class Foo < BasicObject; end
<eval-in> workmad3 => superclass mismatch for class Foo (TypeError) ... (https://eval.in/53078)
<Altonymous> I know I can overload the sql? and hash methods on a class to allow me to use intersect, union, and difference operators on it.. however, if I want to find the intersect of 2 array of objects based on an attribute.. is there a fast way to do this?
<lectrick> TMM Basically the idea is, once you establish an object hierarchy, it should be fairly static. The dynamic parts of your code should not
<Altonymous> sql? should have been eql?
<lectrick> be changing inheritance on the fly
<TMM> yeah what I was trying to do was wrong anyway
<TMM> thanks :)
admin0 has quit [Read error: Connection reset by peer]
<lectrick> You end up with a lot of strange bugs if you were allowed to do that
<lectrick> ok
devoldmx has quit [Read error: Connection reset by peer]
devoldmx has joined #ruby
johnnyfuchs has quit [Quit: Leaving.]
cody-- has joined #ruby
johnnyfuchs has joined #ruby
Squarepy_ has joined #ruby
apeiros has quit [Remote host closed the connection]
xk_id has quit [Quit:
raphaelivan has quit [Read error: No route to host]
freezey has quit [Remote host closed the connection]
dangerousdave has quit [Read error: Connection reset by peer]
raphaelivan has joined #ruby
dangerousdave has joined #ruby
cody-- has quit [Client Quit]
snovak_ has quit [Remote host closed the connection]
JohnBat26 has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
dash_ has joined #ruby
snovak has joined #ruby
joofsh has quit [Remote host closed the connection]
Squarepy has quit [Ping timeout: 264 seconds]
sr78ger has quit [Quit: Textual IRC Client: www.textualapp.com]
lyanchih has quit [Quit: lyanchih]
s2013 has joined #ruby
chrishough has joined #ruby
leonidlm has quit [Ping timeout: 240 seconds]
dawkirst has quit [Ping timeout: 240 seconds]
ukd1 has joined #ruby
dhruvasagar has quit [Ping timeout: 240 seconds]
dawkirst has joined #ruby
shvelo has quit [Ping timeout: 240 seconds]
benweint has joined #ruby
bricker`1A has joined #ruby
shvelo has joined #ruby
schaerli has quit [Remote host closed the connection]
pen has joined #ruby
bricker`LA has quit [Ping timeout: 248 seconds]
schaerli has joined #ruby
arturas_ has quit [Ping timeout: 245 seconds]
i_s has joined #ruby
zeade has joined #ruby
Fire-Dragon-DoL has joined #ruby
duggiefr_ has quit [Remote host closed the connection]
duggiefresh has joined #ruby
marcgg has joined #ruby
benweint has quit [Ping timeout: 245 seconds]
burlyscudd has quit [Quit: Leaving.]
cody-- has joined #ruby
schaerli has quit [Ping timeout: 240 seconds]
sevenseacat has quit [Quit: Leaving.]
cody-- has quit [Client Quit]
jonathanwallace has quit [Ping timeout: 264 seconds]
dawkirst has quit [Read error: Connection reset by peer]
marcgg_ has quit [Ping timeout: 268 seconds]
jocke_ has joined #ruby
fgo_ has quit [Remote host closed the connection]
dangerousdave has quit [Quit: Leaving...]
MrThePlague has joined #ruby
MrThePlague has joined #ruby
MrThePlague has quit [Changing host]
ravster has quit [Quit: Leaving.]
T_T has joined #ruby
tonni has joined #ruby
mrnugget has quit [Quit: mrnugget]
baroquebobcat has joined #ruby
<TMM> Does anyone have any strong opinions on the following code? https://gist.github.com/hpvb/6870084
ssvo has joined #ruby
atSetKey has joined #ruby
<Hanmac> TMM you need to be VERY careful with @@variables … they can bite you in your ass
michael_mbp is now known as zz_michael_mbp
<TMM> they should be more or less static once the classes are parsed I think
zeropx has joined #ruby
<TMM> but I guess they don't have to be @@ variables
sectionme has quit [Ping timeout: 246 seconds]
zz_michael_mbp is now known as michael_mbp
danshultz has joined #ruby
tonni has quit [Ping timeout: 246 seconds]
<riceandbeans> if I make a class, how can I make a class instance variable optional so I can define it after initialization?
devoldmx3 has joined #ruby
<riceandbeans> or should I just initialize it as nil and then reassign it when the time comes?
shaunbak_ has quit [Remote host closed the connection]
shaunbaker has joined #ruby
devoldmx3 has quit [Read error: Connection reset by peer]
joofsh has joined #ruby
danshultz has quit [Read error: Connection reset by peer]
devoldmx3 has joined #ruby
devoldmx has quit [Ping timeout: 248 seconds]
danshultz has joined #ruby
heftig has joined #ruby
rudisimo has joined #ruby
<TMM> hanmac, do you see anything fundamentally wrong with the approach I've taken otherwise?
nomenkun has quit [Ping timeout: 240 seconds]
<Hanmac> riceandbeans: class instance variables are like normal instance variables, so they dont need to be assigned as nil
iamjarvo has quit [Remote host closed the connection]
RichardBaker has quit [Quit: RichardBaker]
<riceandbeans> hanmac: if I do class Classname (variable1, variable2) it requires 2
Davey has joined #ruby
iamjarvo has joined #ruby
fgo has joined #ruby
shaunbaker has quit [Ping timeout: 245 seconds]
RichardBaker has joined #ruby
headius has joined #ruby
kindjal has joined #ruby
saarinen has joined #ruby
<TMM> OK, thanks all, I'm going to go home and rework my code :)
<TMM> thanks a lot for your help
TMM has quit [Quit: Ex-Chat]
timonv has quit [Remote host closed the connection]
timonv has joined #ruby
larissa has quit [Quit: Leaving]
Soda has quit [Remote host closed the connection]
<Hanmac> dam, i had one for TMM :/
pentameter has joined #ruby
<TheMoonMaster> I keep getting highlighted.
<TheMoonMaster> He should pick a new nick.
<Hanmac> or your highlighter is broken
<Hanmac> riceandbeans: thats an other problem and has nothing todo with the class instance variables
apeiros has joined #ruby
<TheMoonMaster> Nah
iliketurtles has joined #ruby
iamjarvo has quit [Ping timeout: 268 seconds]
codelette has quit [Remote host closed the connection]
okinomo has joined #ruby
shaunbaker has joined #ruby
dash_ has quit [Ping timeout: 264 seconds]
kil0byte has joined #ruby
timonv has quit [Ping timeout: 248 seconds]
chrishough has quit [Quit: chrishough]
Atrumx has joined #ruby
mrsolo has quit [Quit: This computer has gone to sleep]
cody-- has joined #ruby
burlyscudd has joined #ruby
Bira has joined #ruby
kil0byte_ has quit [Ping timeout: 245 seconds]
pellenation has joined #ruby
DonRichie has quit [Quit: Verlassend]
joofsh has quit [Remote host closed the connection]
deens has joined #ruby
cody-- has quit [Read error: Operation timed out]
Lewix has joined #ruby
devoldmx has joined #ruby
devoldmx3 has quit [Read error: Connection reset by peer]
ce_afk is now known as cescalante
devoldmx has quit [Read error: Connection reset by peer]
devoldmx has joined #ruby
mklappstuhl has quit [Remote host closed the connection]
mklappstuhl has joined #ruby
tylersmith has quit [Remote host closed the connection]
okinomo has quit [Ping timeout: 245 seconds]
tylersmith has joined #ruby
geggam_ has joined #ruby
Sheeplet has joined #ruby
<Sheeplet> lo
nutella has joined #ruby
nutella is now known as Guest41594
elux has joined #ruby
Fuzai has quit [Remote host closed the connection]
nemesit|znc has quit [Ping timeout: 240 seconds]
mklappstuhl has quit [Ping timeout: 264 seconds]
lkba has joined #ruby
dzhulk has joined #ruby
tylersmith has quit [Ping timeout: 264 seconds]
SilverKey has quit [Quit: Zzzzzz.]
Xeago has joined #ruby
endash_ has joined #ruby
dzhulk has quit [Client Quit]
burlyscudd has quit [Ping timeout: 264 seconds]
joofsh has joined #ruby
Aloysius1 has joined #ruby
predefiance06 has quit [Ping timeout: 256 seconds]
asuka has quit [Ping timeout: 256 seconds]
aleron has quit [Quit: leaving]
atSetKey has quit [Ping timeout: 256 seconds]
ewnd9 has quit [Ping timeout: 256 seconds]
arietis has joined #ruby
mikepack has joined #ruby
Squarepy_ is now known as Squarepy
brennanMKE has quit [Remote host closed the connection]
pel_daniel has joined #ruby
brennanMKE has joined #ruby
Xeago has quit [Ping timeout: 245 seconds]
snovak has quit [Read error: Operation timed out]
fgo has quit [Remote host closed the connection]
AzizLight has joined #ruby
maletor has joined #ruby
<riceandbeans> can I make a variable's value be a variable name?
DonRichie has joined #ruby
decoponio has joined #ruby
<canton7> example?
chrisja has joined #ruby
ghr has quit [Quit: Computer has gone to sleep.]
burlyscudd has joined #ruby
<ccooke> riceandbeans: do you mean: Can you access a named variable programmatically, by referring to it by a name?
<Hanmac> like that ? "@abc = :@abc"
<riceandbeans> say I iterate through a list and the unique part is what I want to identify it by, so I make a class to contain all the other parts, but I want te reference it by the ID, can I use the ID to make it
<riceandbeans> no no
<riceandbeans> ok look
<riceandbeans> so I'm taking a line and matching a regex on it
taion809 is now known as zzz_taion809
<riceandbeans> 6 or so match groups
<riceandbeans> one of the match groups is an ID for the line
<riceandbeans> I'm terming the variable msg_id
<riceandbeans> I'd like the content of that, a hex value, to be the name of the variable
<riceandbeans> but I won't know it
asuka has joined #ruby
<riceandbeans> it's going to be from a list pulled daily while iterating through thousands of lines
iamjarvo has joined #ruby
<ccooke> riceandbeans: that doesn't make sense
<riceandbeans> ccooke: sure it does
<ccooke> how would you access a variable if you don't know what its name is?
noname001 has quit [Ping timeout: 240 seconds]
<canton7> "I'd like the content of [the variable msg_id], a hex value, to be he name of that variable" which is msg_id, surely, and not hex
brennanMKE has quit [Ping timeout: 268 seconds]
nwertman has joined #ruby
decoponyo has quit [Ping timeout: 246 seconds]
mando has joined #ruby
olivier_bK has joined #ruby
<olivier_bK> theyre is something i dont understand i try to connect in ssh with 'net/ssh'
snovak has joined #ruby
AzizLight has quit [Ping timeout: 240 seconds]
<Hanmac> >> /(?<msg_id>\w+)/ =~ "msg_idnr124 abc"; msg_id
<eval-in> Hanmac => "msg_idnr124" (https://eval.in/53093)
<olivier_bK> why i get this error
<Hanmac> riceandbeans: like that?
<olivier_bK> i dont understand
<riceandbeans> hanmac: I don't know
<riceandbeans> do you get what I'm trying to do?
robert__ has joined #ruby
robert__ has quit [Changing host]
robert__ has joined #ruby
<ccooke> riceandbeans: so, what you're saying is that you have an object a. In that object, there is a variable, msg_id, which might contain (say) 0xaf86.
<riceandbeans> no
dash_ has joined #ruby
<riceandbeans> it will be straight hex
<riceandbeans> it's a postfix msg id
<ccooke> riceandbeans: "straight hex"?
<bean> olivier_bK: that means bad pass
<riceandbeans> no 0x
ukd1 has quit [Remote host closed the connection]
<riceandbeans> just the hex value
<riceandbeans> 0-9a-f
<ccooke> riceandbeans: okay. So you have something that might contain, say, af86 (and more, but ignore that for now)
ukd1 has joined #ruby
<riceandbeans> yes
<ccooke> riceandbeans: so, with this object o, what would you like to do with the value af86 ?
b00stfr3ak has joined #ruby
b00stfr3ak has joined #ruby
robert_ has quit [Ping timeout: 260 seconds]
<ccooke> riceandbeans: what is the syntax you'd like to make work?
<riceandbeans> I don't know
wildroman has quit [Remote host closed the connection]
<riceandbeans> let me drink my coffee and rethink this because the more I drink me coffee the less sense this makes
devoldmx has quit [Read error: Connection reset by peer]
devoldmx has joined #ruby
wildroman has joined #ruby
iamjarvo has quit [Remote host closed the connection]
deens has quit [Remote host closed the connection]
<ccooke> riceandbeans: did you want to find the object with that hex ID in a collection of objects? That would make sense.
<riceandbeans> yes, maybe
<ccooke> riceandbeans: but definitely work out the syntax you want to use, from outside the object
<riceandbeans> ok so here's AN issue
deens has joined #ruby
brennanMKE has joined #ruby
<riceandbeans> I need two lines from the log to get all the data I want
Bira has quit [Remote host closed the connection]
zenloop has joined #ruby
MrZYX|off is now known as MrZYX
devoldmx3 has joined #ruby
kofno_ has quit [Ping timeout: 245 seconds]
<riceandbeans> I'm basically writing a log scraper for postfix to gather data on malformed emails and misconfigured clients, generate data on it, and send emails to me and related people about it so we can fix those systems
<olivier_bK> bean, when i try manualy everything it's okai
kofno has quit [Ping timeout: 248 seconds]
Uranio has joined #ruby
<riceandbeans> so I want to get from who to who when, how big the email is, basic data
<riceandbeans> all that data I can get from one line of postfix logs, minus the to whom
<riceandbeans> that must be pulled from another line
<riceandbeans> but that line must be referenced by the msg_id
r0bby_ has quit [Max SendQ exceeded]
dhruvasagar has joined #ruby
<ccooke> riceandbeans: so, you get the msg_id from the first line and use it to look up the second line?
<riceandbeans> so I'd like to pull from the logs and scan for the msg_id's and update the newly created objects and then when the data is complete, send out the email
<riceandbeans> I think that's what I want
aspires has joined #ruby
rndstr has quit [Quit: Connection closed for inactivity]
<riceandbeans> I haven't slept in two days
devoldmx27 has joined #ruby
lfox has quit [Quit: ZZZzzz…]
<ccooke> riceandbeans: it seems that sleep might be a good idea before you did more?
<riceandbeans> can't afford to
Squarepy has quit [Read error: Connection reset by peer]
<riceandbeans> I'm already at work :)
dash_ has quit [Ping timeout: 240 seconds]
mikecmpbll has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<ccooke> *nod* that's fun
arietis has quit [Quit: Computer has gone to sleep.]
wildroman has quit [Ping timeout: 240 seconds]
Squarepy has joined #ruby
r0bby_ has joined #ruby
devoldmx has quit [Ping timeout: 256 seconds]
lfox has joined #ruby
deens has quit [Ping timeout: 240 seconds]
Husel has joined #ruby
<ccooke> okay, so you get the msg_id from a regex - hanmac's suggestion looks right, there - and then you can access the message ID of that regex in the regex's match object
saarinen has quit [Read error: Connection reset by peer]
carraroj has joined #ruby
saarinen has joined #ruby
devoldmx3 has quit [Ping timeout: 240 seconds]
<Hanmac> regex literals are guite powerful ;P (there are differences with regex objects)
<riceandbeans> ccooke: and then...somehow, I need to catalogue all the msg_id's and reference them later
Guest41594 has quit [Ping timeout: 264 seconds]
<riceandbeans> maybe I should make an array of the objects
<ccooke> riceandbeans: are you parsing the logfile as a stream, or all in one go?
xk_id has joined #ruby
tjbiddle has joined #ruby
<riceandbeans> ccooke: file.open
ephemerian has quit [Quit: Leaving.]
<ccooke> riceandbeans: so, you're parsing the whole file at one time, not expecting the file to grow while you read it?
Bira has joined #ruby
SkuliOskarsson has quit [Quit: SkuliOskarsson]
iamjarvo has joined #ruby
senayar has quit [Remote host closed the connection]
<Hanmac> use http://ruby-doc.org/core-2.0/IO.html#method-c-foreach that reads a file per each line
r0bby_ has quit [Remote host closed the connection]
r0bby_ has joined #ruby
senayar has joined #ruby
<riceandbeans> ccooke: I'm getting daily data
wildroman has joined #ruby
<riceandbeans> and no
<riceandbeans> and I'm opening it read only
<riceandbeans> I guess I could rotate it daily and take the rotated one
gilesw_ has joined #ruby
freezey has joined #ruby
Squarepy_ has joined #ruby
<riceandbeans> I can't use ruby 2.0
<riceandbeans> my hands are tied with 1.8.7
<Hanmac> why are your hands in the past?
Ziarkaen has joined #ruby
scottstamp is now known as zz_scottstamp
tkuchiki has quit [Remote host closed the connection]
<riceandbeans> hanmac: redhat
tkuchiki has joined #ruby
<riceandbeans> I use newer on my system, but the servers I have to ultimately depoly it to are redhat
<Hanmac> riceandbeans: and you should have looked before because IO#foreach exist in 1.8.7 too http://ruby-doc.org/core-1.8.7/IO.html#method-c-foreach
r0bby_ has quit [Client Quit]
deception has quit [Quit: Goodbye]
nathancahill has quit [Quit: nathancahill]
SkuliOskarsson has joined #ruby
Squarepy has quit [Ping timeout: 245 seconds]
senayar has quit [Ping timeout: 264 seconds]
nemesit|znc has joined #ruby
Squarepy_ has quit [Ping timeout: 268 seconds]
dzhulk has joined #ruby
Squarepy has joined #ruby
dagobah has quit [Remote host closed the connection]
Bira has quit [Remote host closed the connection]
x1337807x has joined #ruby
tkuchiki has quit [Ping timeout: 264 seconds]
b00stfr3ak has quit [Quit: Leaving]
sniffingcats has joined #ruby
timonv has joined #ruby
s2013 has quit [Quit: Leaving]
Voodoofish430 has joined #ruby
s2013 has joined #ruby
<havenwood> ooh, looky there, JRuby 1.7.5 released: http://jruby.org/2013/10/07/jruby-1-7-5.html
dangerousdave has joined #ruby
<Hanmac> and this persons care about that *points at an empty space*
SkuliOskarsson has quit [Quit: SkuliOskarsson]
zz_scottstamp is now known as scottstamp
barratt has quit [Ping timeout: 264 seconds]
arietis has joined #ruby
aleron has joined #ruby
<havenwood> Rubinus 2.0 was just released as well: http://rubini.us/2013/10/04/rubinius-2-0-released/
moted has quit [Quit: moted]
<Hanmac> yeah that is more important
<havenwood> hanmac: Empty space again? :P
<Hanmac> i will care about jruby from this moment on when jruby support all my gems
<riceandbeans> I hate jruby
<riceandbeans> I hate java and the jvm
<havenwood> i dig it
<riceandbeans> I don't allow either on any personal machines or servers of mine
T_T has quit [Remote host closed the connection]
<havenwood> riceandbeans: Careful, or when the JVM gets once more commit and becomes SkyNet you may be on a list you dun wanna be on.
T_T has joined #ruby
mayorga_ has joined #ruby
<Hanmac> i write C++ gems … so until jruby supports them, i do not care about jruby
<riceandbeans> havenwood: won't matter, SkyNet won't be able to run on any of my machines because they intentionally have 0 support for Java
saarinen has quit [Quit: saarinen]
Advocation has joined #ruby
<riceandbeans> Larry Ellison can buy all the Hawaiin islands he wants, I won't use his terrible products or perversions of already existing ones
iamjarvo has quit [Remote host closed the connection]
kofno has joined #ruby
crashx has quit [Quit: crashx]
mercwithamouth has joined #ruby
T_T has quit [Ping timeout: 245 seconds]
kofno_ has joined #ruby
T_T has joined #ruby
<riceandbeans> hanmac: why is foreach io better than file.open?
shaunbaker has quit [Remote host closed the connection]
shaunbaker has joined #ruby
gr33n7007h has joined #ruby
b00stfr3ak has joined #ruby
iamjarvo has joined #ruby
deens has joined #ruby
<workmad3> havenwood: rubinius 2 was released on friday ;)
<Hanmac> riceandbeans: hm i thought you want the file line per line … IO.foreach can handle everything for you
<havenwood> workmad3: yeah, but Hanmac wasn't impressed with my JRuby 1.7.5 and so that was my fallback. :P
saarinen has joined #ruby
<Hanmac> havenwood: i will be impressed if Jruby can make C++ gems ;D
<workmad3> havenwood: :) I've hacked my ruby-install setup to install rubinius 2 (it still needed a manual 'bundle install' step though)
<havenwood> workmad3: Just added JRuby's latest to ruby-install. Was hoping to look at RBX 2.0 today.
Stygia has quit [Remote host closed the connection]
vlad_starkov has joined #ruby
elaptics is now known as elaptics`away
<workmad3> havenwood: they changed all their package names and urls :(
iamjarvo has quit [Remote host closed the connection]
<havenwood> workmad3: and Ruby 2.0 as a build dep
<workmad3> havenwood: and also switched to bz2
<workmad3> havenwood: ruby 2.0 with bundler
iamjarvo has joined #ruby
<workmad3> havenwood: and it'll need to extract the source, then run 'bundle install' in the src directory
shaunbaker has quit [Ping timeout: 245 seconds]
<havenwood> workmad3: Yeah, afraid there'll have to be changes to rbx's functions.sh: https://github.com/postmodern/ruby-install/blob/master/share/ruby-install/rubinius/functions.sh
<workmad3> yup
<havenwood> workmad3: pretty certain rather than afraid, actually :P
<riceandbeans> hanmac: but I am reading line by line, how is it different?
aspires has quit [Quit: aspires]
chairabanta has joined #ruby
<havenwood> workmad3: actually, there are too many changes - postmodern will need to do it :P
Matip has quit [Ping timeout: 264 seconds]
<workmad3> havenwood: :)
aspires has joined #ruby
lukec has quit [Quit: lukec]
deens has quit [Remote host closed the connection]
<havenwood> i dun wanna put in a bunch of version checks, curious how best to deal - dunno!
deens has joined #ruby
<Hanmac> riceandbeans: what is easier? File.open(path) { |fd| fd.each {|line| … } } or IO.foreach(path) { |line| … } ?
nathancahill has joined #ruby
rdark has quit [Quit: leaving]
<riceandbeans> hanmac: ?? when I have to rewrite what I already did, what's easier?
gyre007 has joined #ruby
burlyscudd has quit [Ping timeout: 240 seconds]
<workmad3> havenwood: looks like rubinius < 2.0.0 will just be dropped
<havenwood> workmad3: that seems like the sane thing
<workmad3> havenwood: although I guess there could be support added for 'rubinius1'
<havenwood> workmad3: then much less horrible
<riceandbeans> what is rubinius?
sr78ger has joined #ruby
troessner has quit [Quit: Leaving]
<workmad3> so the current stuff becomes 'rubinius1' support and then 'rubinius' just does the new version... but how many people want to install rubinius 1.2.4 nowadays?
iamjarvo has quit [Ping timeout: 264 seconds]
<havenwood> workmad3: I think I'd be against 1.x support actually here, dunno need to read more. You think anyone cares about 1.x rbx??
<workmad3> riceandbeans: alternative ruby runtime
twoism has joined #ruby
<shvelo> Anyone using GitHub Pages? Jekyll is giving some warnings saying that "Maruku#to_s" is deprecated but I don't use it anywhere
<workmad3> havenwood: probably not :) I couldn't even run most of my rails projects in it
mayorga has quit [Ping timeout: 256 seconds]
<jb41> if method is changing a few instances values, how should I check it by rspec's change { } ?
mayorga has joined #ruby
colonolGron has joined #ruby
vlad_starkov has quit [Ping timeout: 264 seconds]
c0rn has joined #ruby
burlyscudd has joined #ruby
<workmad3> shvelo: are you using markdown for any pages?
<shvelo> yea
jibi has joined #ruby
tylersmith has joined #ruby
taptapdan has quit [Quit: taptapdan]
<workmad3> shvelo: most likely it's just that GH have updated maruku then, but the jekyll markdown plugin is yet to catch up
kaldrenon has quit [Remote host closed the connection]
<workmad3> shvelo: maruku is a markdown interpreter after all ;)
Advocation has quit [Quit: Advocation]
<olivier_bK> i dont understand
kaldrenon has joined #ruby
<olivier_bK> bean, when i try manualy to connect in ssh everything it's okai
<bean> olivier_bK: well, clearly its not okay if it says auth failed
<olivier_bK> but when i try with my ruby script i get an error
duggiefresh has quit [Remote host closed the connection]
devoldmx27 has quit [Read error: Connection reset by peer]
<bean> where is @PASS defined
devoldmx has joined #ruby
<olivier_bK> dev_Connect_post.rb:8:PASS= 'rtpl1$bk'
<olivier_bK> in my irb
<apeiros> PASS != @PASS
<bean> yep
ciziar has joined #ruby
<apeiros> also, uppercase ivars? srsly?
<bean> @PASS is likely nil
gazzik has joined #ruby
<bean> and yeah, why are they upcase4
<bean> upcase*
<olivier_bK> if i try like that
Al_ has quit [Quit: Al_]
<olivier_bK> Net::SSH.start('192.168.10.80', @USER, :password => @PASS)
razi has joined #ruby
<olivier_bK> i get the same error
<bean> you still didnt remove the @
<bean> fromt he pass.
petey has joined #ruby
<olivier_bK> Net::SSH.start('192.168.10.80', USER, :password => PASS)
<olivier_bK> Net::SSH::AuthenticationFailed: root
wildroman has quit [Remote host closed the connection]
<bean> sounds like you have a wrong root pasword.
<bean> if you go to the server and check /var/log/auth.log it'll tell you for sure.
wildroman has joined #ruby
einarj has joined #ruby
PeNNyWiS_ has joined #ruby
Bira has joined #ruby
atSetKey has joined #ruby
kaldrenon has quit [Ping timeout: 264 seconds]
zaltekk has left #ruby [#ruby]
codecop has joined #ruby
<olivier_bK> in my log there is nothing
<bean> welp, then you're doing it wrong.
devoldmx3 has joined #ruby
devoldmx has quit [Read error: Connection reset by peer]
PeNNyWiSe182__ has quit [Ping timeout: 246 seconds]
AzizLight has joined #ruby
beilabs has quit [Ping timeout: 248 seconds]
xcv has quit [Remote host closed the connection]
sepp2k has joined #ruby
xcv has joined #ruby
kaldrenon has joined #ruby
wildroman has quit [Ping timeout: 245 seconds]
senayar has joined #ruby
Guest20259 has quit [Remote host closed the connection]
iamjarvo has joined #ruby
atSetKey has quit [Ping timeout: 264 seconds]
wildroman has joined #ruby
duggiefresh has joined #ruby
wildroman has quit [Remote host closed the connection]
einarj has quit [Ping timeout: 268 seconds]
TMM has joined #ruby
devoldmx3 has quit [Read error: Connection reset by peer]
lukec has joined #ruby
wildroman has joined #ruby
tatsuya_o has quit [Remote host closed the connection]
devoldmx has joined #ruby
tatsuya_o has joined #ruby
peregrine81 has joined #ruby
jlebrech has quit [Remote host closed the connection]
xcv has quit [Ping timeout: 268 seconds]
cody-- has joined #ruby
blaxter has quit [Quit: foo]
Bira has quit [Ping timeout: 268 seconds]
Kar- has quit [Ping timeout: 264 seconds]
<shevy> I once used an ivar for configuration that had this name @CONFIG
heidi has joined #ruby
carraroj has quit [Quit: Konversation terminated!]
tatsuya_o has quit [Ping timeout: 245 seconds]
beilabs has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
schaerli has joined #ruby
olivier_bK has quit [Ping timeout: 240 seconds]
dhruvasagar has quit [Ping timeout: 264 seconds]
nemesit|znc has quit [Ping timeout: 248 seconds]
petey has quit [Remote host closed the connection]
Heero has quit [Ping timeout: 256 seconds]
petey has joined #ruby
ixti has joined #ruby
sr78ger has quit [Ping timeout: 264 seconds]
gazzik has quit [Ping timeout: 240 seconds]
carraroj has joined #ruby
zeade has quit [Quit: Leaving.]
noop has joined #ruby
gazzik has joined #ruby
schaerli has quit [Remote host closed the connection]
rickmasta has quit [Quit: Leaving...]
schaerli has joined #ruby
aspires has quit [Quit: aspires]
atSetKey has joined #ruby
aspires has joined #ruby
Valesk has joined #ruby
carraroj has quit [Client Quit]
chairabanta has quit [Quit: Leaving...]
petey has quit [Ping timeout: 245 seconds]
wildroman has quit [Remote host closed the connection]
beilabs has quit [Ping timeout: 264 seconds]
timonv has quit [Remote host closed the connection]
mayorga_ has quit [Quit: Leaving]
wildroman has joined #ruby
beilabs has joined #ruby
timonv has joined #ruby
timonv has quit [Read error: Connection reset by peer]
timonv has joined #ruby
schaerli has quit [Ping timeout: 264 seconds]
carraroj has joined #ruby
devoldmx3 has joined #ruby
volty has joined #ruby
fmcgeough has joined #ruby
dangerousdave has quit [Read error: Connection reset by peer]
dangerousdave has joined #ruby
Zai00 has quit [Quit: Zai00]
tonni has joined #ruby
ciziar has quit [Ping timeout: 246 seconds]
shevy has quit [Ping timeout: 246 seconds]
devoldmx has quit [Ping timeout: 264 seconds]
tonni has quit [Remote host closed the connection]
Zai00 has joined #ruby
Zai00 has quit [Client Quit]
wildroman has quit [Ping timeout: 248 seconds]
whunt has joined #ruby
VTLob has joined #ruby
allsystemsarego has quit [Quit: Leaving]
shvelo has quit [Ping timeout: 245 seconds]
TheNumb has quit [Ping timeout: 245 seconds]
khushildep has quit [Quit: getting the flock() outta here]
cody-- has quit [Quit: derp]
chairabanta has joined #ruby
io_syl has joined #ruby
shvelo has joined #ruby
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jonathanwallace has joined #ruby
xcv has joined #ruby
workmad3 has quit [Ping timeout: 245 seconds]
iamjarvo has quit [Ping timeout: 264 seconds]
ajka has joined #ruby
jefflyne_ has quit [Ping timeout: 240 seconds]
beilabs has quit [Ping timeout: 264 seconds]
ajka has left #ruby [#ruby]
nemesit|znc has joined #ruby
shevy has joined #ruby
freezey has quit [Remote host closed the connection]
leonidlm has joined #ruby
mercwithamouth has quit [Ping timeout: 245 seconds]
dangerousdave has quit [Quit: Leaving...]
tsykoduk has joined #ruby
someish has quit [Quit: someish]
SilverKey has joined #ruby
devoldmx has joined #ruby
danman has joined #ruby
jefflyne_ has joined #ruby
Husel has left #ruby [#ruby]
beilabs has joined #ruby
soheil has joined #ruby
devoldmx3 has quit [Ping timeout: 246 seconds]
tsykoduk has quit [Ping timeout: 264 seconds]
ahawkins has joined #ruby
mercwithamouth has joined #ruby
tsykoduk has joined #ruby
Bira has joined #ruby
x1337807x has joined #ruby
gazzik has quit [Remote host closed the connection]
kindjal has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
mayorga has quit [Ping timeout: 256 seconds]
T_T has quit [Remote host closed the connection]
bsaboia_ has quit [Ping timeout: 268 seconds]
teclado has joined #ruby
T_T has joined #ruby
dankest has joined #ruby
tonni has joined #ruby
freezey has joined #ruby
raphaelivan has quit [Read error: Connection reset by peer]
raphaelivan1 has joined #ruby
BizarreCake has quit [Quit: Leaving]
brennanMKE has quit [Remote host closed the connection]
a1ph4g33k has joined #ruby
petey has joined #ruby
pyr0commie has joined #ruby
<banister> nyuszika7h pry/irb do it already, the variable is called _
momomomomo has quit [Quit: momomomomo]
niklasb has quit [Quit: WeeChat 0.4.1]
hakunin has joined #ruby
Targen has quit [Ping timeout: 260 seconds]
rrichardsr3 has joined #ruby
<Hanmac> _ is also a bit magical when you use it as parameter for methods or blocks … because you can use it to hide them
<nyuszika7h> banister: I've already been told 2-3 hours ago, but thanks :P
petey has quit [Remote host closed the connection]
Ox6abe has joined #ruby
T_T has quit [Ping timeout: 240 seconds]
petey has joined #ruby
interactionjaxsn has quit [Remote host closed the connection]
zeade has joined #ruby
teclado has left #ruby ["Saliendo"]
sniffingcats has quit [Quit: Til rivido Idisti!]
interactionjaxsn has joined #ruby
volty has quit [Ping timeout: 240 seconds]
Mars has joined #ruby
postmodern has joined #ruby
Mars is now known as Guest12022
someish has joined #ruby
T_T has joined #ruby
zeade has quit [Client Quit]
sumark is now known as Guest5748
petey has quit [Ping timeout: 245 seconds]
nobuoka has joined #ruby
nobuoka has quit [Client Quit]
Ziarkaen has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
iliketurtles has quit [Quit: zzzzz…..]
iliketurtles has joined #ruby
scottstamp is now known as zz_scottstamp
interactionjaxsn has quit [Ping timeout: 240 seconds]
engel has quit [Quit: leaving]
<a1ph4g33k> g'morning all.
<apeiros> moin alphageek
nisstyre has quit [Disconnected by services]
nisstyre has joined #ruby
iliketurtles has quit [Client Quit]
rezzack has joined #ruby
keen_ has quit [Read error: Connection reset by peer]
yours_truly has joined #ruby
shadoi has joined #ruby
tjbarber has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
banister has quit [Quit: Computer has gone to sleep.]
TMM has quit [Read error: Connection reset by peer]
TMM has joined #ruby
gja has quit [Quit: This computer has gone to sleep]
jb41 has quit [Ping timeout: 260 seconds]
<waxjar> hanmac: is something magical going on? i thought it was just a convention
<waxjar> >> foo = proc { |_| puts _ }; foo.call "foo"
<eval-in> waxjar => foo ... (https://eval.in/53131)
vim_shim has joined #ruby
Fire-Dragon-DoL has left #ruby [#ruby]
BizarreCake has joined #ruby
hp_ has joined #ruby
rickmasta has joined #ruby
petey has joined #ruby
bean has quit [Quit: Computer has gone to sleep.]
hp_ has quit [Client Quit]
hp_ has joined #ruby
<Hanmac> waxjar: i mean this:
<Hanmac> >> {}.each {|k,k| }
<eval-in> Hanmac => /tmp/execpad-8c7b023319ae/source-8c7b023319ae:2: duplicated argument name ... (https://eval.in/53132)
Kar- has joined #ruby
<Hanmac> >> {}.each {|_,_| }
<eval-in> Hanmac => {} (https://eval.in/53133)
Advocation has joined #ruby
<waxjar> oo, that's neat.
hp_ has quit [Read error: Connection reset by peer]
carraroj has quit [Quit: Konversation terminated!]
hp_ has joined #ruby
<riceandbeans> hanmac: that is hideous
hp_ has quit [Client Quit]
zeade has joined #ruby
TMM has quit [Read error: Connection reset by peer]
cody-- has joined #ruby
<Hanmac> riceandbeans: did you know that you can hide named classes inside objects? ;P
deens has quit [Remote host closed the connection]
<^conner> I'm trying to create an rspec formatter (my first gem attempt) and I'm having some sort of class/module/namespace issues that I've been thrashing around on. I'm sure it's something simple and obvious I'm missing. There's the code https://github.com/jhoblitt/rspec-nagios-formatter and this is the class typeerror I'm getting https://gist.github.com/jhoblitt/6872526
<^conner> could someone hit me with a clue stick?
brianpWins has joined #ruby
devoldmx has quit [Read error: Connection reset by peer]
ahawkins has quit [Quit: leaving]
swordsmanz has joined #ruby
devoldmx has joined #ruby
senayar has quit [Remote host closed the connection]
mercwithamouth has quit [Ping timeout: 268 seconds]
mayorga has joined #ruby
nisstyre has quit [Quit: Leaving]
senayar has joined #ruby
razi has quit [Ping timeout: 240 seconds]
Es0teric has joined #ruby
dangerousdave has joined #ruby
bean has joined #ruby
<riceandbeans> hanmac: horrible
tjbarber has joined #ruby
tsykoduk is now known as zz_tsykoduk
<Hanmac> >> class << Object.new; class ABC; self; end; end
<eval-in> Hanmac => #<Class:0x422790d8>::ABC (https://eval.in/53143)
mercwithamouth has joined #ruby
<riceandbeans> hanmac: I just threw up in my mouth
cads has joined #ruby
devoldmx has quit [Read error: Connection reset by peer]
devoldmx has joined #ruby
senayar has quit [Ping timeout: 240 seconds]
* Hanmac 's "scared ruby user" counter has increased
xk_id has quit [Quit:
Es0teric has quit [Quit: Computer has gone to sleep.]
poisonarms has joined #ruby
kil0byte has quit [Remote host closed the connection]
someish has quit [Read error: Connection reset by peer]
someish has joined #ruby
freezey has quit [Remote host closed the connection]
valesk_ has joined #ruby
petey has quit [Remote host closed the connection]
dangerousdave has quit [Quit: Linkinus - http://linkinus.com]
andikr has quit [Remote host closed the connection]
petey has joined #ruby
<Hanmac> riceandbeans: did you also know that regex literals with named capture and =~ can create local variables but regex objects can not?
<apeiros> hanmac: there are more strings attached to it
<apeiros> regex must not contain interpolations and must be on the RHS
<Hanmac> RHS?
MrThePlague has quit [Remote host closed the connection]
dangerousdave has joined #ruby
<apeiros> d'oh, LHS
w3pm has joined #ruby
iliketurtles has joined #ruby
devoldmx has quit [Read error: No route to host]
soheil has quit [Remote host closed the connection]
devoldmx has joined #ruby
petey has quit [Ping timeout: 256 seconds]
aspires has quit [Quit: aspires]
banisterfiend has joined #ruby
soheil has joined #ruby
<Hanmac> hm what means LHS? … and there are some chases where interpolation works ;P … like / #{a} / works not, but / #{ " " } / works ;P
aspires has joined #ruby
yacks has joined #ruby
<apeiros> LHS = left hand side
<apeiros> interesting @ interpolation exceptions
<apeiros> I'd assume any interpolation which could be resolved at parse time will work
<Hanmac> yeah its a bonus for all left-handed ;P
<fflush> salut
<poisonarms> So I've got the following snippet here and I'm getting a "Fixnum comparison error" -- I'm not sure why or what that means. I've included the error: http://pastebin.com/V513sBX8
<Hanmac> i think i whould write a book "the 1001 wonders of ruby" ;P
<Hanmac> poisonarms: ARGV are an arry of Strings .. you need to convert it into the type you want
spider-mario has joined #ruby
interactionjaxsn has joined #ruby
rhaen has joined #ruby
keen_ has joined #ruby
<poisonarms> Nevermind. I'm just a retard.
<poisonarms> .to_i
barratt has joined #ruby
keen_ has quit [Client Quit]
jerius has quit [Ping timeout: 245 seconds]
<Hanmac> yeah or the Integer() function if you want to make it fail-safe
raphaelivan1 has quit [Quit: Leaving.]
Kneferilis has quit [Read error: Connection reset by peer]
Hobogrammer has quit [Read error: Connection reset by peer]
<riceandbeans> apeiros: I have interpolation in my regex
peregrine81 has quit []
Hobogrammer has joined #ruby
<apeiros> riceandbeans: hm?
jerius has joined #ruby
siezer has quit [Read error: Operation timed out]
arietis has quit [Quit: Computer has gone to sleep.]
<riceandbeans> apeiros: /#{CONSTANT1}#{CONSTANT2}/.match(input)[2]
rainbyte has joined #ruby
<apeiros> riceandbeans: and? I don't understand what you're getting at…
mayorga_ has joined #ruby
mayorga has quit [Ping timeout: 256 seconds]
<Hanmac> riceandbeans: the interpolation feature is only important when you want to use =~ compined with the feature to make local variables (both at the same time does not work)
tvw has quit []
dangerousdave has quit [Read error: Connection reset by peer]
geekbri has joined #ruby
dangerousdave has joined #ruby
xk_id has joined #ruby
Coffers has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
Ox6abe has quit [Remote host closed the connection]
nathancahill has quit [Quit: nathancahill]
Ox6abe has joined #ruby
nisstyre has joined #ruby
kevinykchan has joined #ruby
mark_locklear has quit [Ping timeout: 248 seconds]
Xanderby has quit [Quit: Xanderby]
mary5030 has quit [Read error: Connection reset by peer]
mary5030 has joined #ruby
Ox6abe has quit [Ping timeout: 248 seconds]
roflmaus has joined #ruby
xcv has quit [Read error: Connection reset by peer]
apeiros has quit [Read error: Connection reset by peer]
apeiros has joined #ruby
pellenation has quit [Read error: Connection reset by peer]
xcv has joined #ruby
devoldmx has quit [Read error: Connection reset by peer]
s0ber has quit [Remote host closed the connection]
jocke_ has quit [Read error: Connection reset by peer]
devoldmx has joined #ruby
s0ber has joined #ruby
joshu has quit [Ping timeout: 264 seconds]
alvaro_o has joined #ruby
Davey has quit [Quit: Computer has gone to sleep.]
Advocation has quit [Quit: Advocation]
kevinykchan has quit [Quit: Computer has gone to sleep.]
Aloysius1 has quit [Remote host closed the connection]
Aloysius1 has joined #ruby
lolmaus has quit [Ping timeout: 256 seconds]
gazzik has joined #ruby
intuxicated has joined #ruby
arietis has joined #ruby
Kedare has joined #ruby
framling has quit [Ping timeout: 264 seconds]
framling has joined #ruby
joshu has joined #ruby
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
DanKnox_away is now known as DanKnox
x1337807x has joined #ruby
BizarreCake has quit [Quit: Leaving]
joshu has quit [Ping timeout: 240 seconds]
gja has joined #ruby
petey has joined #ruby
rhaen is now known as moll
moll is now known as rhaen
petey has quit [Remote host closed the connection]
petey has joined #ruby
mayorga_ has quit [Ping timeout: 256 seconds]
siezer has joined #ruby
devoldmx has quit [Read error: Connection reset by peer]
xcv has quit [Remote host closed the connection]
devoldmx has joined #ruby
xcv has joined #ruby
gja has quit [Client Quit]
eka has joined #ruby
Davey has joined #ruby
Fire-Dragon-DoL has joined #ruby
ryanf has left #ruby [#ruby]
skaflem has quit [Quit: Leaving]
intuxicated has quit [Read error: No route to host]
dangerousdave has quit [Read error: Connection reset by peer]
Targen has joined #ruby
dangerousdave has joined #ruby
TMM has joined #ruby
TMM has quit [Changing host]
TMM has joined #ruby
petey has quit [Ping timeout: 248 seconds]
joshu has joined #ruby
keen_ has joined #ruby
Guest12022 has quit [Remote host closed the connection]
keen_ has quit [Client Quit]
keen_ has joined #ruby
xcv has quit [Ping timeout: 268 seconds]
dangerousdave has quit [Client Quit]
Davey has quit [Quit: Computer has gone to sleep.]
RichardBaker has quit [Quit: RichardBaker]
keen_ has quit [Quit: Tiarra 0.1+svn-39209: SIGINT received; exit]
aspires has quit [Quit: aspires]
adambeynon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
kindjal has joined #ruby
PragCypher has joined #ruby
rickmasta has quit [Quit: Leaving...]
joshu has quit [Ping timeout: 240 seconds]
dangerousdave has joined #ruby
<riceandbeans> can I do interpolation in the message?
rickmasta has joined #ruby
freezey has joined #ruby
xkickflip has quit [Quit: h..hi]
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
freezey has quit [Remote host closed the connection]
devoldmx3 has joined #ruby
xk_id has quit [Quit:
devoldmx has quit [Ping timeout: 245 seconds]
mrnugget has joined #ruby
nemesit|znc has quit [Ping timeout: 268 seconds]
aspires has joined #ruby
intuxicated has joined #ruby
arietis has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
xk_id has joined #ruby
nemesit|znc has joined #ruby
jbpros has joined #ruby
rhaen has quit [Ping timeout: 246 seconds]
heidi has quit [Quit: Leaving.]
mac___ has joined #ruby
Bira has quit [Remote host closed the connection]
randomnick_ has joined #ruby
freezey_ has joined #ruby
decoponio has quit [Quit: Leaving...]
TryX has joined #ruby
rhaen has joined #ruby
m8 has joined #ruby
nisstyre has quit [Quit: Leaving]
someish has quit [Quit: someish]
strandberg has quit [Quit: leaving]
michael_mbp is now known as zz_michael_mbp
burlyscudd has quit [Quit: Leaving.]
someish has joined #ruby
keen_ has joined #ruby
mac___ has quit [Remote host closed the connection]
bline79 has quit [Remote host closed the connection]
RichardBaker has joined #ruby
axsuul has joined #ruby
jerius has quit [Ping timeout: 264 seconds]
Xiti has quit [Quit: Leaving]
MrHacks has joined #ruby
TryX has quit [Ping timeout: 241 seconds]
senayar has joined #ruby
robert__ is now known as robert_
<MrHacks> Quick question, what if I wanted to store a set of functions in an array but did not want to execute them until the array was processed with an each block?
<MrHacks> [refrain, verse, refrain].each { |f| f week }
<apeiros> MrHacks: you can store a) Symbols (method names), b) Strings (method names again), c) Method instances or d) Procs
ndngvr` has joined #ruby
ndngvr has quit [Read error: Connection reset by peer]
<apeiros> for a) & b) see Object#send
rhaen has quit [Remote host closed the connection]
c0rn has quit [Quit: Computer has gone to sleep.]
yourmysin has joined #ruby
<apeiros> for c) see Object#method
<apeiros> and Method
jerius has joined #ruby
razi has joined #ruby
schaerli has joined #ruby
<MrHacks> In my example, refrain and verse are methods. week is an argument
senayar has quit [Ping timeout: 264 seconds]
<MrHacks> week is used in both methods
forced_request has quit [Ping timeout: 245 seconds]
razi has quit [Client Quit]
jlast has quit [Remote host closed the connection]
peregrine81 has joined #ruby
RichardBaker has quit [Quit: RichardBaker]
iliketurtles has quit [Quit: zzzzz…..]
tabolario has quit [Quit: Textual IRC Client: www.textualapp.com]
r0bby_ has joined #ruby
r0bby_ has quit [Changing host]
r0bby_ has joined #ruby
deens has joined #ruby
petey has joined #ruby
brennanMKE has joined #ruby
fgh2 has joined #ruby
fmcgeough has quit [Quit: fmcgeough]
bline79 has joined #ruby
poolpog has joined #ruby
aleron has quit [Quit: Lost terminal]
freezey_ has quit [Ping timeout: 246 seconds]
bline79 has quit [Client Quit]
tabolario has joined #ruby
bline79 has joined #ruby
<poolpog> hello... quick question about the singleton operator wrt the Date class
moshee has quit [Ping timeout: 248 seconds]
zzz_taion809 has quit [Ping timeout: 245 seconds]
headius has quit [Quit: headius]
rubyracer has joined #ruby
momomomomo has joined #ruby
<poolpog> I found an example online that did this: now = Date.today; (now<<1).to_s
<poolpog> that would print out "one month ago"
freezey has joined #ruby
yzzz has joined #ruby
<poolpog> what is << doing in this case? Where can I find documentation about that?
<apeiros> now << 1 # invokes the method <<
<apeiros> ri 'Date#<<'
<apeiros> in your shell (assuming you installed ruby docs)
<poolpog> k
<poolpog> i haven't
fgh has quit [Ping timeout: 245 seconds]
<apeiros> it's not the same thing as `class << some_obj`
<poolpog> oh
<poolpog> actually, I have...
<poolpog> hm
moshee has joined #ruby
sheerun has joined #ruby
<poolpog> "Nothing known about Date#<<"
momomomomo has quit [Client Quit]
<lectrick> I have a sorted array of numbers. I have to find the index of the first number greater than the one I have. What's the fastest way to do this?
<poolpog> hmph... How do I get the Ri doc installed for Date?
Evixion has quit []
TMM has quit [Quit: Ex-Chat]
<poolpog> found it... "rvm docs generate"
popl has joined #ruby
popl has quit [Changing host]
popl has joined #ruby
taion809 has joined #ruby
<Hanmac> lectrick: Enumerable#find ?
<MrZYX> lectrick: Array#index takes a block
ghr has joined #ruby
RichardBaker has joined #ruby
fgh2 has quit [Ping timeout: 248 seconds]
<Hanmac> or each_with_index.find
adambeynon has joined #ruby
robustus has quit [Ping timeout: 264 seconds]
petey_ has joined #ruby
gmdeux has joined #ruby
<poolpog> ok, let's try again...
<poolpog> ri docs are installing, in the meantime, is there a web page anywhere that describes "<<" for Date?
<MrZYX> many, google ruby docs
<poolpog> ugh, no, Ri docs are now broken
<MrZYX> I like rubydoc.info
<poolpog> MrZYX: It is pretty hard to google for "<<"
petey has quit [Ping timeout: 245 seconds]
<MrHacks> Fixed it!
<waxjar> i added a keyword to chrome that searches rubydoc
boxmein has quit [Quit: [02:26.00] <Ristovski> mozzarella filofax fadget]
robustus has joined #ruby
<MrZYX> and if you need to search for special characters there's http://symbolhound.com/
<poolpog> MrZYX: thanks, I know how to use google
freezey_ has joined #ruby
<MrZYX> apparently not
<poolpog> using IRC is a last resort
<poolpog> instead of being a dick, send me a link
<poolpog> that answers my question
<MrZYX> I've send you 3 links by now
noop has quit [Ping timeout: 246 seconds]
<poolpog> that answers my qeustion?
<MrHacks> ref = Proc.new { |a| refrain a }; ver = Proc.new { |a| verse a }; [ref, ver, ref].each { |f| f.call week }
<poolpog> my question is: what does "<<" do wrt Date class?
bline79 has quit [Remote host closed the connection]
zarubin has joined #ruby
freezey__ has joined #ruby
<poolpog> thanks
<wuest> Rubydocs are a great resource when dealing with the stdlib.
<wuest> That's what MrZYX was telling you.
<poolpog> I know what I did wrong
<poolpog> I was looking at DateTime for something that is only really in Date
schaerli has quit [Remote host closed the connection]
<poolpog> it isn't like I didn't search for this
PeNNyWiS_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<poolpog> but I don't need smartasses not answering my actual question
<poolpog> also, thanks for the help
schaerli has joined #ruby
obs has quit [Quit: Konversation terminated!]
nutella has joined #ruby
freezey has quit [Ping timeout: 245 seconds]
Mars has joined #ruby
snovak has quit [Remote host closed the connection]
nutella is now known as Guest40543
Mars is now known as Guest64204
snovak has joined #ruby
zz_tsykoduk is now known as tsykoduk
Kedare has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
freezey_ has quit [Ping timeout: 248 seconds]
gazzik has quit [Remote host closed the connection]
fgo has joined #ruby
momomomomo has joined #ruby
<MrZYX> MrHacks: that's a very verbose way, try (public_)send: %i{refrain verse refrain}.each do |method|; public_send method, week; end
pellenation has joined #ruby
TryX has joined #ruby
<lectrick> hanmac: MrZYX: I guess I was looking for a binary search type method instead of a linear search. I note that Ruby 2 has Array#bsearch
<MrZYX> which doesn't yield an index though
<MrHacks> MrZYX: I'm kinda liking what I got. Besides, I like that I can do function calls with Procs and it has expanded my understanding of Proc usage
schaerli has quit [Ping timeout: 264 seconds]
aspires has quit [Quit: aspires]
someish has quit [Read error: Connection reset by peer]
<MrZYX> bsearch isn't too hard to implement though, you could probably roll your own
lolmaus has joined #ruby
snovak has quit [Ping timeout: 245 seconds]
kevind_ has joined #ruby
zz_scottstamp is now known as scottstamp
<lectrick> yeah but it would be slow unless native. There's already a bsearch gem which I could use if I was OK with an extra dependency on 1.9
<apeiros> lectrick: it's fast even in pure ruby
<lectrick> apeiros: for array sizes greater than N, yes :)
<MrZYX> all the ruby implementations I've seen so far take a block anyway
<apeiros> with an array of 100 elements it's already an average of 7 vs. 50 comparisons
<lectrick> but .index is native
aspires has joined #ruby
<lectrick> which also takes a block
sayan has joined #ruby
xargoon has quit [Ping timeout: 268 seconds]
kevind has quit [Ping timeout: 248 seconds]
kevind_ is now known as kevind
<MrZYX> -> calls the block for each comparison -> not 100% native
mercwithamouth has quit [Ping timeout: 248 seconds]
<apeiros> especially with a block, the native part will not make up for the increased complexity
mlpinit has quit [Remote host closed the connection]
aspires has quit [Client Quit]
vlad_starkov has joined #ruby
mercwithamouth has joined #ruby
petey_ has quit [Remote host closed the connection]
andyjeffries has joined #ruby
<havenwood> JRuby 1.7.5 now on head of RVM, ruby-build and ruby-install. :)
xcv has joined #ruby
joshu has joined #ruby
petey has joined #ruby
TryX has quit [Ping timeout: 268 seconds]
danshultz has quit [Remote host closed the connection]
zylad has joined #ruby
yalue has quit [Quit: Leaving]
xargoon has joined #ruby
araujo has quit [Read error: Connection reset by peer]
JohnBat26 has joined #ruby
mercwithamouth has quit [Client Quit]
araujo has joined #ruby
x1337807x has joined #ruby
yekta has joined #ruby
RubNoob has joined #ruby
jibi has quit [Ping timeout: 245 seconds]
<RubNoob> can anyone recommend a gem for calculating overall GHz, MHz, etc. given a set of mixed MHz, GHz, THz, etc.?
vlad_starkov has quit [Ping timeout: 240 seconds]
andyjeffries has left #ruby [#ruby]
obeid has joined #ruby
platzhirsch has joined #ruby
cong has joined #ruby
<platzhirsch> Any thoughts on I can transform such a list: [1, 1, 0, 1, 0, 1] into such a list [1, 2, 2, 3, 3, 4] in a functional fashion?
locriani has joined #ruby
<havenwood> RubNoob: I dun get it, just divide by a thousand?
<platzhirsch> So starting with 1, add 1 if there is a 1, don't otherwise
sayan has quit [Ping timeout: 256 seconds]
dangerousdave has quit [Quit: Leaving...]
<RubNoob> no, I mean I'd like to not have to parse the output of a command - so, for instance, I know the result will always be "XXXX YY" where XXXX is a number and YY is the speed in MHz, THz, GHz, etc
<apeiros> platzhirsch: inject with an empty array as starting value?
<platzhirsch> okay, let's see..
<a1ph4g33k> RubNoob: You could always define your own units within ruby-units
<apeiros> hm, no, actually that won't work nicely :-/
<Hanmac> platzhirsch:
<Hanmac> >> [1, 1, 0, 1, 0, 1].each_with_object([]) {|i,o| o << (o.last.to_i + i)}
<eval-in> Hanmac => [1, 2, 2, 3, 3, 4] (https://eval.in/53156)
<apeiros> hanmac: that's not really functional, though
c0rn has joined #ruby
<Hanmac> och meno ;P
<apeiros> but the .to_i cheating to get around the first nil is an idea
freezey has joined #ruby
iliketurtles has joined #ruby
<platzhirsch> maybe I should ask in #haskell and convert the solution then :P
* Hanmac gains 5% more exp though cheating
Speed has joined #ruby
yaymukund has joined #ruby
heidi has joined #ruby
<yaymukund> how can I check if an array contains all elements from another array? I'm on rails, if that helps, but I suspect it doesn't..
<lectrick> platzhirsch: something with inject
<yaymukund> .all? { |i| a.include?(i) }?
<platzhirsch> hanmac: works for me, haven't thought about it, that it's not purely functional
freezey__ has quit [Ping timeout: 268 seconds]
<apeiros> yaymukund: (other-array).empty?
<lectrick> yaymukund: yeah i'd do apeiros' method although you have to be careful about which array you refer to there
Valesk has quit [Read error: Connection reset by peer]
MrHacks has quit [Quit: leaving]
jbpros has quit [Quit: jbpros]
<yaymukund> apeiros, lectrick: thanks, that works. would be neat if I could do a1.include?(*a2) or something... :p
joshu has quit [Ping timeout: 240 seconds]
<Hanmac> platzhirsch: arg2.push(arg2.last.to_i + arg1.shift) until arg1.empty?
tspike has joined #ruby
<cong> i can't use search or install gems. i have the latest version 2.1.2. error http://codepad.org/yfc3hcct
<cong> it's like everytime it gose right it eventually gose bad
<platzhirsch> hanmac: I think the .each_with_object is great and convenient to understand
<riceandbeans> hanmac: I swear to god you could start the obfuscated ruby code league and win it every time
joshu has joined #ruby
timonv has quit [Remote host closed the connection]
someish has joined #ruby
timonv has joined #ruby
funburn has joined #ruby
<tjbarber> hey guys, what should I use in Ruby in place of something like this? http://nodejs.org/api/crypto.html#crypto_crypto_pseudorandombytes_size_callback
edwardly has quit [Ping timeout: 245 seconds]
<tjbarber> yeah, so I'm moving an entire Node based API over to Ruby ;P
peregrine81 has quit []
<platzhirsch> tjbarber: How come?
<tjbarber> platzhirsch because the guy who wrote our node API was not that great, and I like Ruby a lot more
hugohagogo has joined #ruby
krawchyk has quit [Remote host closed the connection]
<platzhirsch> That's a proper non-functional requirement
<tjbarber> platzhirsch node is good, but somehow this guy figured out a way to make this api as weird as possible
burlyscudd has joined #ruby
<cong> node is asyncronous all the way
Zai00 has joined #ruby
volty has joined #ruby
staafl has joined #ruby
<tjbarber> cong true, and that is one of the weaker points of Ruby compared to node I guess
eka has quit [Quit: Textual IRC Client: www.textualapp.com]
timonv has quit [Ping timeout: 256 seconds]
radic_ has quit [Ping timeout: 240 seconds]
mrnugget has quit [Quit: mrnugget]
<apeiros> tjbarber: SecureRandom::random_bytes
<tjbarber> ah thanks apeiros
pellenation has quit [Quit: Leaving.]
<platzhirsch> hanmac apeiros: okay, so I implement scanl1 in Ruby and then I can simply call: scanl1 (+) [1, 0, 0, 1, 1, 0, 1]
aspires has joined #ruby
<apeiros> hah
mengu has joined #ruby
aspires has quit [Client Quit]
mrwn has joined #ruby
<mrwn> Hi, i need an advice
JohnBat26 has quit [Ping timeout: 256 seconds]
<platzhirsch> won't work if the first is a 0 though
thedonvaughn has joined #ruby
<mrwn> i have been programming for several years, but even after that i can't write solid code, i feel my code is fragile, i feel i stuck to some level i can't pass
RubNoob has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
Bira has joined #ruby
freezey_ has joined #ruby
yacks has quit [Ping timeout: 246 seconds]
joshu has quit [Ping timeout: 248 seconds]
<platzhirsch> mrwn: mh, do you know about testing?
<bean> and Test Driven Development
<bean> :D
<havenwood> mrwn: been doing Ruby this whole time?
<mrwn> not too much
xcv has quit [Remote host closed the connection]
aspires has joined #ruby
<mrwn> no not ruby
kurttt has joined #ruby
<havenwood> mrwn: spent a lot of time with any one lang, or mostly bounce around?
<tjbarber> apeiros SecureRandom isn't implemented in Ruby 2.0...
joshu has joined #ruby
xcv has joined #ruby
<tjbarber> at least it looks that way
<apeiros> tjbarber: it helps requiring it :-p
<tjbarber> not in the docs, can't use it in IRB
<apeiros> it's part of stdlib. require 'securerandom'
Zai00 has quit [Quit: Zai00]
<tjbarber> oh ok thanks
<havenwood> tjbarber: For sure it is in 2.0 :P
zarubin has quit [Ping timeout: 264 seconds]
<tjbarber> havenwood std-lib =P
freezey has quit [Ping timeout: 246 seconds]
<mrwn> havenwood: is there anything specific i need to foucs on, or just give it more time?
vikhyat has joined #ruby
<volty> the gateways to programming are, for the most part, imprinted
<havenwood> mrwn: I think focus on a single language, and learn it to a high level of proficiency.
<havenwood> mrwn: dunno
alekst has joined #ruby
scmaccal has joined #ruby
<havenwood> mrwn: What lang have you spent the most time with?
<mrwn> havenwood: java
<volty> speaking only french you don't speak it better,
<volty> on contrary
xcv has quit [Ping timeout: 246 seconds]
bookmage has joined #ruby
<volty> programming is programming, and language is a language - in computer
<havenwood> mrwn: I'd say learn the heck out of JRuby. Seems to me so far that Ruby prepares you well for Clojure as well. Use your Java knowledge and have access to its libs but work with really, really nice tools.
<volty> thinking is thinking, and lang is lang - in life
tspike has quit [Ping timeout: 240 seconds]
benweint has joined #ruby
<havenwood> volty: We can agree that `x is x` but if you want to think clearly you need to master at least one human language. Language is vital to thought. You can't just learn two or three words in a hundred languagesw.
<a1ph4g33k> mrwn do you practice kata ?
<mrwn> thanks for this advice, but i was specking in general, what makes the programmer really good, and write high level code?
r0bby_ has quit [Ping timeout: 245 seconds]
<waxjar> platzhirsch: my take after my first FP "class" https://gist.github.com/britishtea/6874505 :P
<a1ph4g33k> mrwn: practice & reading other peoples code.
<cong> everything is useful in programming, most of what you already know is used in programming. cooking, planning, ordering, keeping track...
<mrwn> a1ph4g33k: no what is kata
<platzhirsch> waxjar: lol
<havenwood> mrwn: I think be able to solve problems. (Preferably with elegant maintainable code.)
<mrwn> havenwood: i can solve problems
<platzhirsch> waxjar: I am confused, is that a joke ^^
<mrwn> havenwood: in a fragle way :D
<waxjar> no :/
<platzhirsch> O_o
shvelo has quit [Read error: Operation timed out]
<a1ph4g33k> mrwn: kata ( in this context ) are things like: http://codekata.pragprog.com ...
<platzhirsch> ah well I see what you did there
<platzhirsch> pattern matching
<volty> yes havenwood, but abstract thinking, talent of generalization, etc etc, comes above the language
<havenwood> mrwn: koans are nice as well as katas :P http://rubykoans.com/ http://clojurekoans.com/
someish has quit [Quit: someish]
mary5030 has quit [Ping timeout: 268 seconds]
<a1ph4g33k> koans & kata ... basically the same thing.
Es0teric has joined #ruby
<mrwn> oh, i got it, i know rubykoans, but i didn't practice it, i will give it some practice
<volty> mrwn: has just to insist and take some rest, from time to time, to let the ideas consolidate
mary5030 has joined #ruby
<havenwood> a1ph4g33k: i think there is a distinction though
Es0teric has quit [Client Quit]
<havenwood> a1ph4g33k: katas are practice throwaway code while koans are a meditation
<havenwood> guess same in reality? :P
<havenwood> mrwn: Thinking of delving into Ruby?
kurttt has quit [Quit: Colloquy for iPad - http://colloquy.mobi]
<a1ph4g33k> you are right, they are not exactly the same thing ... katas usually fall in to the "write some code to do 'x'" ... the koans tend to be what do you think needs to happen in this snippet...
joshu has quit [Ping timeout: 256 seconds]
jsaak has quit [Ping timeout: 264 seconds]
xibalba has joined #ruby
xibalba has left #ruby ["Textual IRC Client: www.textualapp.com"]
<mrwn> havenwood: yeah, i really like ruby, i want to know more about it
<a1ph4g33k> Kata is more useful to me ... I like coming up with a chunk of code, not a part of one line.
<a1ph4g33k> not that the koans are not useful.
xcv has joined #ruby
<a1ph4g33k> they are ... good for consolidating your knowledge over the subject of the koan, but ... like I said ... practice & reading other peoples code is what I feel helps me the most.
<volty> mrwn: if you want to learn to program you have to do it, often, yourself // you learn when you read else's programs, but you learn much much more when you do it yourself
xkickflip has joined #ruby
joshu has joined #ruby
<volty> it is learn notions vs learn to think
radic has joined #ruby
iliketurtles has quit [Quit: zzzzz…..]
<havenwood> a1ph4g33k: i totally agree that reading others' code is super helpful
<havenwood> yay for Github \o/
<havenwood> slash BitBucket
<cong> the repl program (irb) in ruby helps a lot too.
codecop has quit [Remote host closed the connection]
poolpog has quit [Quit: Leaving]
<mrwn> volty: isn't learning notions will make me think better ?
geekbri has quit [Remote host closed the connection]
<havenwood> or better yet, Pry: http://pryrepl.org/
<platzhirsch> They always have so much fun in #haskell
<volty> mrwn: not necessarily -- you have to develop your own creative capabilities
<volty> it is not a cut & paste thingy
gyzmodo has quit []
<volty> only through creation
jfelchner has joined #ruby
<havenwood> mrwn: I have fun going through challenges in Ruby like Project Euler or HackerRank.
<volty> though reading else's code can help in productivity
<bean> project euler is great.
<volty> havenwood's last is a good example
<bean> I've done the first like 15 in a few different styles.
<bean> OO, functional, as a framework, etc.
<havenwood> bean: nice, i like that idea
<volty> what is the language with least number of commands ? :)
<havenwood> volty: brainfuck
<bean> functional, ofc, was the most fun.
<platzhirsch> Assembly?
mayorga has joined #ruby
<bean> lots of procs, etc.
phantasm66 has quit [Quit: *sleeeep….]
<havenwood> volty: whitespace, dunno - one of the eosoteric langs
freerobby has quit [Ping timeout: 264 seconds]
<cout> volty: there are plenty of languages with 0 commands
<cout> perhaps you meant something else
<volty> thanks, i wanted a minimalistic but not esoteric one
olivier_bK has joined #ruby
TwinkleHood has quit [Quit: leaving]
freezey_ has quit [Remote host closed the connection]
<a1ph4g33k> what is the point of hackerrank ?
<a1ph4g33k> are they just a competition? or are they trying to do something similar to hackermeter ?
iliketurtles has joined #ruby
<platzhirsch> Euler is one of the best learning grounds to get your FP skills started, I would just get a bit unmotivated to work on those solved problems, though. Not that it would be any better to crank out a web app that nobody really needs
<havenwood> a1ph4g33k: just one of the many i guess in that genre
<mrwn> what if there is a really hard problem , and i could solve, is that mean i'm a good programmer, or there is ideal solution for it, and knowing it make me good programmer? you know what i mean?
<havenwood> a1ph4g33k: i'm not sure how they hope to make money :P
gmdeux has quit [Remote host closed the connection]
sergicles has quit [Quit: sergicles]
<a1ph4g33k> havenwood: rodger rodger.
<havenwood> mrwn: If you can write elegant code to accomplish the task, you can code. Being able to communicate with others is of course important.
ehaliewicz has joined #ruby
<bean> There are plenty of project euler problems that I don't know how to solve
<bean> i'm pretty awful at maths though
<volty> mrwn: no I don't know. Though I would like to know - your ideas about what programming is about
mklappstuhl has joined #ruby
<MrZYX> mrwn: I don't think there's the single good solution for any somewhat complex problem
<havenwood> bean: i've apparently only done 27 of em, i keep having to look up all the mathy terms
chairabanta has quit [Quit: Leaving...]
<bean> me too.
* bean is a sysadmin (devops) really, so my interest in ruby is mostly for personal projects
<havenwood> kinda a fun way to learn math and write fun algorithms at same time
<volty> there's the analyze, there's design, there's coding, there's knowledge of domain ....
<RubyPanther> programming is mostly about getting computers to output predictable data based on variable inputs
<a1ph4g33k> mrwn: when you can write minimal code to provide a robust implementation of whatever algorithm you implement and have ensured that it works within the restrictions & requirements surrounding it's use.
mrsolo has joined #ruby
<mrwn> i was thinking about that, and i didn't have an answer, but i think it more that writing algorithm that works, and that what i want to know
<breakingthings> I disagree; programming is mostly about cat gifs
revans has joined #ruby
headius has joined #ruby
iliketurtles has quit [Client Quit]
<a1ph4g33k> It's more than just works ... it's works & fits.
<platzhirsch> Well problem solving and software engineering in terms of software design can be two very different things
freezey has joined #ruby
unpriv has joined #ruby
<volty> ops, algorithm is the logic, writing is coding that logic
unpriv is now known as TwinkleHood
tsykoduk is now known as zz_tsykoduk
kevinykchan has joined #ruby
<a1ph4g33k> scalable when necessary, efficient when possible.
<RubyPanther> even if a lot of math needs to happen, very little of the programming is, or should be, informed by knowledge of math. Instead, it is informed by knowledge of APIs that include implementations of various formulas.
iliketurtles has joined #ruby
<volty> if find this one too much reductive
<mrwn> platzhirsch: how fare should i learn about software design?
<RubyPanther> You do not need to understand the math of matrix multiplication to apply appropriate filters to the cat gifs
<platzhirsch> mrwn: fare?
kofno has quit [Ping timeout: 246 seconds]
colonolGron has quit [Ping timeout: 240 seconds]
kofno_ has quit [Ping timeout: 248 seconds]
<mrwn> much sorry?
<platzhirsch> traveling
freerobby has joined #ruby
<mrwn> sorry
<mrwn> :D
<platzhirsch> mrwn: At least a good hand full of design patterns, that will get you started
<platzhirsch> the GoF book is famous, I don't like it much though.. C++ reference implementation, what's going on?
<platzhirsch> but Head's First Design Pattern was great, made me realize what OOP is about
<volty> let him find his own patterns, at least for now :)
<RubyPanther> mrwn: architecture is everything. Start with Uncle Bob. http://confreaks.com/videos/759-rubymidwest2011-keynote-architecture-the-lost-years
bline79 has joined #ruby
revans has quit [Client Quit]
colonolGron has joined #ruby
<platzhirsch> Rooooooobert Martin..
<colonolGron> Hallo?
<volty> ppl we talk talk talk, let's ask mrwn what he has done and what he wasn't able to do
Al_ has joined #ruby
<mrwn> RubyPanther: that's really good for watching today , thanks
<volty> just to have a better idea :)
xcv has quit [Remote host closed the connection]
<havenwood> mrwn: Watch and listen to everything you can find on Ruby: RubyRogues, Ruby5, Confreaks
xcv has joined #ruby
joshu has quit [Ping timeout: 240 seconds]
<havenwood> mrwn: RubyTapas, reddit.com/r/ruby
angusiguess has quit [Ping timeout: 245 seconds]
zz_tsykoduk has quit [Ping timeout: 240 seconds]
<mrwn> volty: i can implement something like facebook in rails
<havenwood> mrwn: Heck, hang out here and try to solve the probs people pose. I've learned a lot from that. :P
<platzhirsch> RubyPanther: what do I learn in his talk?
<MrZYX> havenwood +1
tspike has joined #ruby
v0n has quit [Read error: Operation timed out]
<MrZYX> platzhirsch: mainly that mvc isn't an architecture pattern, so we should stop using it as one
<RubyPanther> platzhirsch: how can I know what you will learn? There is a lot of content.
<mrwn> havenwood: how long did you program? your experience?
<volty> it is just about connecting various pieces (though i don't know much about rails)
<platzhirsch> RubyPanther: okay, what MrZYX said. The question was: What is he talking about
rjurney has joined #ruby
<rjurney> How do I access the date in this simple data structure? https://gist.github.com/rjurney/6874907
Advocation has joined #ruby
<havenwood> mrwn: Two years of Ruby.
<platzhirsch> MrZYX: sounds reasonable, I hope there is some more constructiveness in his talk and not only kicking MVC while it lies on the ground dieing
<RubyPanther> The importance of architecture, and how to design a modern architecture (using Ruby, but it doesn't have to be) based on principles that were basically forgotten because of... implementation details of "the web."
<MrZYX> rjurney: that doesn't look like valid ruby to me
<mrwn> oh man, i think the language what makes you good quickly
<mrwn> havenwood: your native language is english, right?
<RubyPanther> You might even learn where to draw lines on a diagram, but that is expecting a lot
<havenwood> mrwn: yup
<rjurney> MrZYX: It is generated in Ruby 2.0 running… a database client.
<rjurney> Makes no sense to me.
<mrwn> havenwood: how much books did you read? about ruby?
<MrZYX> rjurney: yeah, doesn't parse for me in 2.0. What does result[0].class say?
<havenwood> mrwn: I read _why's Poignant Guide and The Ruby Programming Language.
<rjurney> Hash
cads has quit [Ping timeout: 264 seconds]
<volty> rjurney: map { |item| item.grep /(\d\d\d\d-\d\d\-\d\d)/; $1 }
gazzik has joined #ruby
duggiefresh has quit [Remote host closed the connection]
<havenwood> mrwn: Actually, I'm still re-reading The Ruby Programming Language!
<platzhirsch> RubyPanther: sounds a great talk to procrastinate on, thanks for the link :)
<havenwood> mrwn: great book..
spider-mario has quit [Read error: Connection reset by peer]
<volty> like that
<mrwn> yeah , i read the first chaper only
<rjurney> volty: Its a hash, that won't work will it?
<RubyPanther> platzhirsch: there are also laser pointers. And laser pointers = cats.
<volty> (or keys grep - like that)
tatsuya_o has joined #ruby
<volty> rjurney: adjust it to your structure
<platzhirsch> RubyPanther: Say what?
<mrwn> ok, i really glad to have this conversation, thanks guys
gstamp has quit [Ping timeout: 256 seconds]
<rjurney> I can't access the data part whatsoever
<rjurney> err date
<RubyPanther> platzhirsch: sorry, typo. laser pointers === cats
<havenwood> mrwn: I like parousing Ruby code on Github mostly more than books.
<MrZYX> rjurney: hm, is result actually an Array? try result.class
<rjurney> result is an array
<rjurney> result[0] is a hash
tsykoduk has joined #ruby
TheBrainWork has quit [Quit: Leaving.]
mando has quit [Remote host closed the connection]
<mrwn> havenwood: what is the most project you learned from? or all of them?
<rjurney> Can't access date
<rjurney> Makes no sense to me
<MrZYX> so what concrete lib is giving you that thing?
<MrZYX> in response to what call
tylersmith has quit [Remote host closed the connection]
<rjurney> Filing a ticket now
mando has joined #ruby
gstamp has joined #ruby
<havenwood> mrwn: I'd say pick some awesome Rubyists and go through their projects. Might find some real gems (gah, the pun).
scottstamp is now known as zz_scottstamp
tylersmith has joined #ruby
<volty> arr.map { |h| h[h.keys[0]] =~ ... $1 }
sheerun has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Eiam> I'm trying to do something like x = {}; x["key"] == [] || push(val)
Zesty has joined #ruby
<mrwn> good idea, i will try that, thanks man
<Eiam> err not a double ==
<Eiam> basically i need to set the value to an array, or push into it if its already an array
<havenwood> mrwn: Just an arbitrary list of a few to start with (look at who they follow to find more): https://github.com/banister https://github.com/tarcieri https://github.com/postmodern etc etc
Es0teric has joined #ruby
gazzik has quit [Ping timeout: 245 seconds]
<Eiam> I can't set it to an array before hand since its inside an inject
<prophile> Eiam: set the value to an empty array?
<MrZYX> rjurney: does result[0].timestamp work?
<prophile> or an array with one element?
<rjurney> genius
<havenwood> mrwn: Or just latest and greatest from the githubs: https://github.com/trending?l=ruby
<Eiam> prophile: set the value to either an empty array, or if its already an array, push a value into it
<rjurney> result[0].timestamp works
<rjurney> Did they overload Hash?
<MrZYX> rjurney: reading the code helps: https://github.com/madvertise/ruby-druid/blob/master/lib/druid/response_row.rb#L27 not sure why class reports Hash though
<BraddPitt> =~ is the same as /regex/.match() right?
Zesty has quit [Client Quit]
<rjurney> MrZYX: I thought Ruby was broke or something, so I didn't bother.
<rjurney> Thanks
<MrZYX> rjurney: looks like .class is delegated to @row
mary5030_ has joined #ruby
ldnunes has quit [Quit: Leaving]
<Eiam> maybe blah.inject(Hash.new(|h,k| h[k] = [])
<mrwn> ok, i will try to implement on project idea, then see how they did it
<rjurney> Well, thanks!
<mrwn> sorry, typo , one project
joofsh has quit [Remote host closed the connection]
tylersmith has quit [Ping timeout: 256 seconds]
mando has quit [Ping timeout: 248 seconds]
sheerun has joined #ruby
joofsh has joined #ruby
joofsh has quit [Read error: Connection reset by peer]
gazzik has joined #ruby
joofsh has joined #ruby
v0n has joined #ruby
rudisimo has quit [Quit: Leaving.]
rjurney has quit [Quit: rjurney]
claymore has quit [Quit: Leaving]
zz_scottstamp is now known as scottstamp
mary5030 has quit [Ping timeout: 240 seconds]
<MrZYX> BraddPitt: no, different methods: http://rubydoc.info/stdlib/core/Regexp#%3D%7E-instance_method and http://rubydoc.info/stdlib/core/Regexp#match-instance_method
Uranio has quit [Quit: while you reading this, a kitty dies]
zarubin has joined #ruby
kindjal has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
mlpinit has joined #ruby
Xiti has joined #ruby
freezey has quit [Read error: Connection reset by peer]
olivier_bK has quit [Ping timeout: 245 seconds]
freezey has joined #ruby
<BraddPitt> Array#keep_if is new in Ruby 2.0 right?
xcv_ has joined #ruby
kirun has quit [Quit: Client exiting]
<MrZYX> no
<bnagy> 18>> [].keep_if {}
<eval-in> bnagy => undefined method `keep_if' for []:Array (NoMethodError) ... (https://eval.in/53157)
<bnagy> 1.9
<bricker> `logger = Logger.new(StringIO.new); logger.info("Some Info")` Is it possible to then read the logger's output, without directly referencing that StringIO object?
atmosx has quit [Quit: WeeChat 0.4.2-dev]
boboc has joined #ruby
wting_ has joined #ruby
tspike has quit [Ping timeout: 268 seconds]
wting_ has quit [Client Quit]
jerrad has joined #ruby
<bricker> I can do logger.instance_variable_get(:@logdev).dev.string ... but... well you know...
leonidlm has quit [Ping timeout: 264 seconds]
<bnagy> why don't you just keep a ref to it?
xcv has quit [Ping timeout: 256 seconds]
pentameter has quit [Remote host closed the connection]
<bricker> bnagy: eh, because the StringIO is only for test environment, and I don't want to add more "test-specific" code than necessary
<havenwood> bnagy: TIL 18>> and I presume 19>> too?
<havenwood> sweet
<bnagy> havenwood: yeah, it's awesomes
mklappstuhl has quit [Remote host closed the connection]
<bnagy> 16>> 'hello 1.6'
<havenwood> brilliant
<bnagy> aww, that used to work :(
<havenwood> hehe
<havenwood> almost evil to have a 1.6
funburn has quit [Quit: funburn]
<havenwood> but fun
<MrZYX> didn't it have a 1.0?
<MrZYX> 10>> 'hey'
<eval-in> MrZYX => /tmp/execpad-bd5ca99c1337/source-bd5ca99c1337:3: syntax error ... (https://eval.in/53158)
shadoi1 has joined #ruby
<havenwood> :O
boboc has quit [Remote host closed the connection]
<havenwood> 9000>> Thread.new ....
yaymukun1 has joined #ruby
maletor_ has joined #ruby
saarinen_ has joined #ruby
colonolGron has quit [Quit: Lost terminal]
<platzhirsch> It seems to me, if you want high performance in Ruby, you code C extensions, when you are on JRuby you do it in Java
T__T has joined #ruby
freezey has quit [Read error: Connection reset by peer]
rrichardsr3 has quit [Quit: -- I'm out --]
<bean> 17>> 'helo 1.7'
<bean> nope
<bean> :p
freezey has joined #ruby
sambao21_ has joined #ruby
LiquidIn1ect has joined #ruby
nwertman_ has joined #ruby
<MrZYX> 186>> 'this one?'
relix_ has joined #ruby
<Hanmac> platzhirsch: imo c++ extensions are more cool then java ones
io_syl_ has joined #ruby
<platzhirsch> hanmac: No, but .. why?
<platzhirsch> ^^
<MrZYX> because they aren't java I guess
<MrZYX> anything is more cool than... lets not get into this
nat2610 has joined #ruby
<Hanmac> platzhirsch: my extensions are build are mostly c++ bindings of c++ libs like wxWidgets or sfml
Advocation has quit [Quit: Advocation]
joofsh has quit [Remote host closed the connection]
<popl> MrZYX: Some people just want to watch the world burn.
joofsh has joined #ruby
nfk has quit [Quit: yawn]
saarinen has quit [Ping timeout: 245 seconds]
sambao21 has quit [Ping timeout: 245 seconds]
io_syl has quit [Ping timeout: 245 seconds]
sailias has quit [Ping timeout: 245 seconds]
foobArrr has quit [Ping timeout: 245 seconds]
Paradox has quit [Ping timeout: 245 seconds]
jinie has quit [Ping timeout: 245 seconds]
TDJACR has quit [Ping timeout: 245 seconds]
geggam_ has quit [Ping timeout: 245 seconds]
shadoi has quit [Ping timeout: 245 seconds]
maletor has quit [Ping timeout: 245 seconds]
sambao21_ is now known as sambao21
flagg0204 has quit [Ping timeout: 245 seconds]
Akuma has quit [Ping timeout: 245 seconds]
LiquidInsect has quit [Ping timeout: 245 seconds]
udoprog has quit [Ping timeout: 245 seconds]
alvaro_o has quit [Ping timeout: 245 seconds]
yaymukund has quit [Ping timeout: 245 seconds]
T_T has quit [Ping timeout: 245 seconds]
nwertman has quit [Ping timeout: 245 seconds]
ffranz has quit [Ping timeout: 245 seconds]
joonty has quit [Ping timeout: 245 seconds]
relix has quit [Ping timeout: 245 seconds]
Ace__ has quit [Ping timeout: 245 seconds]
andrewstewart has quit [Ping timeout: 245 seconds]
Trynemjoel2 has quit [Ping timeout: 245 seconds]
Nanuq has quit [Ping timeout: 245 seconds]
saarinen_ is now known as saarinen
geggam_ has joined #ruby
Paradox has joined #ruby
Trynemjoel has joined #ruby
yekta has quit [Quit: yekta]
udoprog has joined #ruby
foobArrr has joined #ruby
<platzhirsch> hanmac: Java is faster
<Hanmac> popl: do you mean the java guys? ;P
jinie has joined #ruby
jamescarr has joined #ruby
joonty has joined #ruby
<Hanmac> platzhirsch: compared to ruby or compared to my c++ gems?
Ace__ has joined #ruby
Akuma has joined #ruby
<jamescarr> is there a way to specify a ruby version loosely in a .ruby-version file? like 1.9.x?
TDJACR has joined #ruby
rainbyte has quit [Quit: Leaving]
<jamescarr> my project works on all 1.9 versions
flagg0204 has joined #ruby
<platzhirsch> hanmac: no idea
<jamescarr> I don't want to restrict collaborators to 1.9.3 or 1.9.2
Nanuq has joined #ruby
alvaro_o has joined #ruby
<MrZYX> most tools should accept a 1.9
<bnagy> does '1.9' not work?
ffranz has joined #ruby
alekst has quit [Quit: Leaving...]
leonidlm has joined #ruby
<havenwood> jamescarr: '1.9' works on chruby, anyone confirm on rvm/rbenv?
<havenwood> *selects most recent 1.9 build
petey has quit [Remote host closed the connection]
* Hanmac only used rvm to select the trunk ;P
petey has joined #ruby
Bira has quit [Remote host closed the connection]
breakingthings has quit []
joofsh has quit [Ping timeout: 248 seconds]
scottstamp is now known as zz_scottstamp
xcv_ has quit [Remote host closed the connection]
<RubyPanther> rbenv expects exact version numbers like 1.9.3-p194-perf
joofsh has joined #ruby
xcv has joined #ruby
xcv has quit [Read error: Connection reset by peer]
<Hanmac> volty: thats not my lib … look for rwx
petey_ has joined #ruby
<MrZYX> volty: looks like wiki spam
xcv has joined #ruby
petey has quit [Read error: Connection reset by peer]
failshell has quit [Remote host closed the connection]
petey_ has quit [Remote host closed the connection]
<havenwood> jamescarr: some version managers support fuzzy matching and some don't, so I'm afraid they'll have to modify the .ruby-version file.
<volty> thx // hanmac are you exporting the wx classes manually? one by one?
<volty> (exporting / exposing to ruby)
jerrad has quit [Quit: Linkinus - http://linkinus.com]
a1ph4g33k has quit [Quit: Leaving]
petey has joined #ruby
devoldmx has joined #ruby
joofsh has quit [Remote host closed the connection]
emmanuelux has joined #ruby
Bira has joined #ruby
xcv has quit [Remote host closed the connection]
xcv has joined #ruby
devoldmx3 has quit [Ping timeout: 240 seconds]
jerrad has joined #ruby
gr33n7007h has quit [Read error: Connection reset by peer]
<Hanmac> volty: yes i did and its better then using swig ...
cody-- has quit [Quit: derp]
jerrad has quit [Client Quit]
yours_truly has quit [Quit: Leaving]
relix_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
nisstyre has joined #ruby
dangerousdave has joined #ruby
fgo has quit [Remote host closed the connection]
petey has quit [Ping timeout: 264 seconds]
dangerousdave has quit [Client Quit]
<volty> hanmac: thanks, i beleive you -- i was convinced about that, but the work is big and one has to choose very stable widget system, that does not change often
freezey has quit [Remote host closed the connection]
xcv has quit [Ping timeout: 264 seconds]
petey has joined #ruby
zz_scottstamp is now known as scottstamp
chrisbolton has joined #ruby
<Hanmac> the problem is that i didt has much time in the last to add more classes :/
petey has quit [Remote host closed the connection]
<volty> were you thinking about parsing the original wxwidgets sources ?
MrZYX is now known as MrZYX|off
fgo has joined #ruby
petey has joined #ruby
<volty> i'm asking for the sake of having better idea if I go for something like this
kaldrenon has quit [Remote host closed the connection]
cescalante is now known as ce_afk
sheerun has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
interactionjaxsn has quit [Remote host closed the connection]
freezey has joined #ruby
kaldrenon has joined #ruby
platzhirsch has left #ruby [#ruby]
RichardBaker has quit [Quit: RichardBaker]
interactionjaxsn has joined #ruby
<Hanmac> volty: my entire wrapping system is totally different
petey has quit [Ping timeout: 248 seconds]
jefflyne_ has quit [Ping timeout: 264 seconds]
interactionjaxsn has quit [Read error: No route to host]
devoldmx has quit [Read error: Connection reset by peer]
devoldmx has joined #ruby
saarinen has quit [Quit: saarinen]
s0ber_ has joined #ruby
aspires has quit [Quit: aspires]
Altonymous has quit [Quit: Altonymous]
kaldrenon has quit [Ping timeout: 264 seconds]
aspires has joined #ruby
ayonix has left #ruby ["cya"]
bean has quit [Quit: Computer has gone to sleep.]
jerius has quit []
s0ber has quit [Ping timeout: 264 seconds]
s0ber_ is now known as s0ber
devoldmx has quit [Read error: Connection reset by peer]
devoldmx has joined #ruby
jerius has joined #ruby
m8 has quit [Quit: Sto andando via]
cong has quit []
someish has joined #ruby
jaynewstrom has quit [Remote host closed the connection]
Jetchisel has quit [Quit: Unfortunately time is always against us -- *Morpheus*]
RichardBaker has joined #ruby
Es0teric has quit [Quit: Computer has gone to sleep.]
T__T has quit [Remote host closed the connection]
tyfighter has joined #ruby
enebo has quit [Quit: enebo]
T_T has joined #ruby
c0rn has quit [Quit: Computer has gone to sleep.]
alex__c2022 has quit [Quit: alex__c2022]
headius has quit [Quit: headius]
<chrisbolton> I've got two variables money and cost. I'd like to subtract cost from money without allowing money to go negative? Is there an intuitive way to do this in ruby or is it negative checking?
jerius has quit [Ping timeout: 240 seconds]
baordog_ has quit [Remote host closed the connection]
<terrellt> chrisbolton: Do you just give them money for the difference?
<volty> [0, money - cost].max
ColKurtz has joined #ruby
fgo has quit [Remote host closed the connection]
<chrisbolton> volty: nice
marwan_ has joined #ruby
T_T has quit [Ping timeout: 245 seconds]
vim_shim has quit [Read error: Operation timed out]
<chrisbolton> terrellt: I would prevent them from purchasing the item if they didn't have enough money
scottstamp is now known as zz_scottstamp
petey has joined #ruby
zz_scottstamp is now known as scottstamp
devoldmx has quit [Read error: Connection reset by peer]
devoldmx has joined #ruby
aspires has quit [Quit: aspires]
sergicles has joined #ruby
verto has joined #ruby
<havenwood> chrisbolton: just in case this isn't glaringly obvious, don't use floats to represent money :P
mayorga has quit [Quit: Leaving]
aspires has joined #ruby
<chrisbolton> Yeah I got that. Thanks though havenwood
<terrellt> havenwood: Shh, how am I gonna become a millionare if you keep telling him things?
<havenwood> chrisbolton: I'd prolly just use the money gem. Can `(Money.new(100) - Money.new(200)).positive?
<havenwood> `
<chrisbolton> So I'm working on tiered reducing. Something like this https://gist.github.com/Iknewthisguy/6875557. Anyone have any ideas on how to do this better?
clov3r has joined #ruby
scottstamp is now known as zz_scottstamp
zz_scottstamp is now known as scottstamp
<havenwood> chrisbolton: `tier3 - cost1` doesn't change `tier3` but `tier3 -= cost1` would
joshwines has joined #ruby
deens has quit [Remote host closed the connection]
<chrisbolton> havenwood: Good catch. I'll fix that.
<havenwood> chrisbolton: i dun get what you're wanting to do from the code though
scottstamp is now known as zz_scottstamp
workmad3 has joined #ruby
adambeynon has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<havenwood> chrisbolton: you want to subtract cost from each tier if the cost is lower than the tier?
<chrisbolton> havenwood: A user has three tiers of resources to use to purchase something. I want to reduce the different tiers in a certain order to purchase the object
henn1nk has joined #ruby
<chrisbolton> As long as they have the resources to purchase the object.
jefflyne_ has joined #ruby
<volty> tiers = [20, 25, 30]; tiers.unshift(tiers.reduce(&:+)); cost = 50; result = tiers.map { |o| o - cost }; tiers.find { |o| o > 0 } || puts 'no money'
<volty> like that - not checked
<volty> ops
<volty> result.find
amacgregor has joined #ruby
Bira has quit [Remote host closed the connection]
devoldmx has quit [Read error: Connection reset by peer]
devoldmx has joined #ruby
elux has quit [Quit: Bye!]
tbrock has quit [Quit: Textual IRC Client: www.textualapp.com]
lfox has quit [Quit: ZZZzzz…]
FiRi has joined #ruby
narcan has joined #ruby
dzhulk has quit [Quit: Leaving.]
<FiRi> #rubyonrails
c0rn has joined #ruby
FiRi has left #ruby [#ruby]
ryanRT has joined #ruby
Tricon has quit [Quit: Bye!]
henn1nk has quit [Quit: henn1nk!]
<volty> but you should sort tiers before, i guess
<volty> in reverse order
tbrock has joined #ruby
theRoUS has quit [Ping timeout: 264 seconds]
henn1nk has joined #ruby
<volty> did you get the idea?
<chrisbolton> What's the intention of the unshift? Is it to compare the total of all tiers instead of handling them as single items in an array thus reducing the complexity?
jamescarr has quit [Quit: jamescarr]
<chrisbolton> volty: Yeah, that's some snazzy business.
mlpinit has quit [Remote host closed the connection]
Al_ has quit [Quit: Al_]
<volty> chrisbolton: you iterate your values by writing code (sum, tier1, 2, 3)
marwan__ has joined #ruby
<volty> this way you do it iterating an array you create, out of values, sorted in reverse order (if necessay - i'm not about your exact logic) and add the sum (unshift) in front
valesk_ has quit [Read error: Operation timed out]
c0rn has quit [Ping timeout: 240 seconds]
<chrisbolton> Got it. Thank you for your help volty
Speed has quit [Quit: When two people dream the same dream, it ceases to be an illusion.]
<volty> yw
marwa646 has joined #ruby
petey has quit [Remote host closed the connection]
chrisbolton has quit [Quit: chrisbolton]
<volty> got headache ? :)
petey has joined #ruby
freerobby has quit [Quit: Leaving.]
Squarepy has quit [Quit: Leaving]
c0rn has joined #ruby
jb41 has joined #ruby
Nogbit has joined #ruby
petey has quit [Ping timeout: 248 seconds]
xcv has joined #ruby
yaymukun1 has quit [Quit: leaving]
mary5030_ has quit [Remote host closed the connection]
pyr0commie has quit [Remote host closed the connection]
devoldmx has quit [Read error: Connection reset by peer]
johnnyfuchs has quit [Quit: Leaving.]
devoldmx has joined #ruby
leonidlm has quit [Ping timeout: 246 seconds]
brennanMKE has quit [Remote host closed the connection]
yekta has joined #ruby
vikhyat has quit [Remote host closed the connection]
apeiros has quit [Remote host closed the connection]
yekta has quit [Client Quit]
apeiros has joined #ruby
marwan1 has joined #ruby
fgo has joined #ruby
jkline has joined #ruby
<Eiam> is there a cleaner way to make a deep copy of an item besides new_copy = Marshal.load(Marshal.dump(obj))
ericmathison has quit [Quit: leaving]
<Eiam> (or pulling in a gem to do a deep copy)
jaimef has quit [Remote host closed the connection]
<Eiam> I've also done a json parse/load to do the same thing, both ways feel kinda meh.
<terrellt> Eiam: Not unless the object has defined .clone to be deep.
<Eiam> these are arrays & hashes
<Eiam> so, nope
<terrellt> Eiam: Then nope. I always have to marshal too. =(
binw_ has joined #ruby
<Eiam> okay well now I don't feel as bad/dumb
<Eiam> its a fairly common paradigm in this particular code base
<Eiam> feels not very rubylike
<bnagy> it's the 'standard' deep_clone
workmad3 has quit [Ping timeout: 264 seconds]
zo_ has joined #ruby
<Eiam> its janky.
geggam_ has quit [Remote host closed the connection]
<bnagy> I don't neccessarily disagree
<Eiam> =p
zarubin has quit [Ping timeout: 240 seconds]
Valesk has joined #ruby
nadirvardar has joined #ruby
jaimef has joined #ruby
v0n has quit [Ping timeout: 264 seconds]
ewnd9 has joined #ruby
T_T has joined #ruby
fgo has quit [Ping timeout: 240 seconds]
<banisterfiend> Eiam you can trivially write a recursive deep_copy for array/hashes
mrwn has quit [Quit: Page closed]
<Eiam> I could; I've already solved the problem
binw has quit [Ping timeout: 264 seconds]
<Eiam> I don't get why Ruby hasn't solved the problem for me.
<banisterfiend> Eiam write a recursive function for practice anyway :)
<banisterfiend> the array solution is kind of cute (using map)
v0n has joined #ruby
tabolario has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Eiam> I've got plenty of real ruby to write for practice
<Eiam> before I've got time to spend solving problems the language should solve =)
marwan1 has left #ruby ["WeeChat 0.3.7"]
<Hanmac> Eiam deep copy this: a=[]; a << a
<banisterfiend> hanmac do you take a little LSD with your breakfast every morning
<Eiam> ..
<Hanmac> banisterfiend: nope .. thats my "normal" state ;P
<Eiam> is that what [[ ... ]] means
Xanderby has joined #ruby
zz_scottstamp is now known as scottstamp
devoldmx has quit [Read error: Connection reset by peer]
devoldmx has joined #ruby
brennanMKE has joined #ruby
sepp2k1 has joined #ruby
threesome has quit [Ping timeout: 246 seconds]
sepp2k has quit [Ping timeout: 240 seconds]
dkamioka has joined #ruby
<Hanmac> Eiam yeah it means : "turtles all the way down"
Valesk has quit [Quit: Leaving]
pkrnj has joined #ruby
bookmage has quit [Quit: Leaving...]
<Eiam> kind of odd it lets you shoot yourself that easily
<Eiam> (I actually just saw [[...]] for the first time earlier today on some code I wrote)
saarinen has joined #ruby
deens has joined #ruby
<Eiam> I knew it wasn't the expected output so I didn't bother figuring out what was up with the symbol, I just knew it shouldn't be that =)
iliketurtles has quit [Quit: zzzzz…..]
VTLob has quit [Quit: VTLob]
xk_id has quit [Quit:
mengu has quit [Remote host closed the connection]
freezey has quit [Remote host closed the connection]
mengu has joined #ruby
jkline has quit [Quit: jkline]
marwan__ has quit [Quit: Lost terminal]
zz_michael_mbp has quit [Excess Flood]
devoldmx has quit [Read error: Connection reset by peer]
devoldmx has joined #ruby
freezey has joined #ruby
RORgasm_ has quit [Remote host closed the connection]
michael_mbp has joined #ruby
hside has joined #ruby
jkline has joined #ruby
banisterfiend has quit [Quit: Computer has gone to sleep.]
gmdeux has joined #ruby
mengu has quit [Ping timeout: 245 seconds]
coaster has quit [Ping timeout: 248 seconds]
RORgasm has joined #ruby
ehaliewicz has quit [Remote host closed the connection]
michael_mbp is now known as zz_michael_mbp
funburn has joined #ruby
devoldmx3 has joined #ruby
burlyscudd has quit [Quit: Leaving.]
ewnd9 has quit [Ping timeout: 248 seconds]
bean has joined #ruby
ciziar has joined #ruby
pel_daniel has left #ruby [#ruby]
jb41 has quit [Ping timeout: 260 seconds]
julian-delphiki has quit [Ping timeout: 246 seconds]
banisterfiend has joined #ruby
ehaliewicz has joined #ruby
devoldmx has quit [Ping timeout: 246 seconds]
kevind has quit [Quit: kevind]
joshu has joined #ruby
kofno has joined #ruby
kofno_ has joined #ruby
jamescarr has joined #ruby
ehaliewi` has joined #ruby
Kar- has quit [Ping timeout: 256 seconds]
tomzx_mac has joined #ruby
nari has joined #ruby
fuhgeddaboudit has quit [Ping timeout: 264 seconds]
ukd1 has quit [Remote host closed the connection]
jamescarr has quit [Client Quit]
ehaliewicz has quit [Read error: Connection reset by peer]
ukd1 has joined #ruby
freezey has quit [Remote host closed the connection]
narcan has quit [Quit: -[AppDelegate installMalware]: unrecognized selector sent to instance 0x156109c0]
fgo has joined #ruby
kitak has joined #ruby
Anarch has joined #ruby
freezey has joined #ruby
snovak has joined #ruby
iamjarvo has joined #ruby
tatsuya_o has quit [Remote host closed the connection]
iamjarvo has quit [Remote host closed the connection]
mrsolo has quit [Remote host closed the connection]
felixjet_ has joined #ruby
tatsuya_o has joined #ruby
xk_id has joined #ruby
ehaliewi` has quit [Read error: Connection reset by peer]
iamjarvo has joined #ruby
ixti has quit [Ping timeout: 245 seconds]
marcdel has joined #ruby
felixjet has quit [Read error: Connection reset by peer]
fgo has quit [Ping timeout: 248 seconds]
Jetchisel has joined #ruby
gr33n7007h has joined #ruby
senayar has joined #ruby
senayar has quit [Remote host closed the connection]
mercwithamouth has joined #ruby
senayar has joined #ruby
tatsuya_o has quit [Ping timeout: 245 seconds]
scottstamp is now known as zz_scottstamp
mercwithamouth has quit [Remote host closed the connection]
ehaliewicz has joined #ruby
lukec has quit [Quit: lukec]
predator117 has joined #ruby
iliketurtles has joined #ruby
Hanmac has quit [Quit: Leaving.]
zz_scottstamp is now known as scottstamp
snovak has quit [Ping timeout: 240 seconds]
tsykoduk is now known as zz_tsykoduk
kay_ has quit [Remote host closed the connection]
lfox has joined #ruby
g0bl1n has quit [Quit: g0bl1n]
kay has joined #ruby
kay is now known as Guest69717
andrewstewart has joined #ruby
senayar has quit [Ping timeout: 264 seconds]
predator217 has quit [Ping timeout: 268 seconds]
Es0teric has joined #ruby
Es0teric has quit [Client Quit]
rubyracer has quit [Quit: Konversation terminated!]
scottstamp is now known as zz_scottstamp
Guest69717 has quit [Ping timeout: 248 seconds]
kevinykchan has quit [Quit: Computer has gone to sleep.]
havenwood has quit [Remote host closed the connection]
zz_scottstamp is now known as scottstamp
Inside has joined #ruby
burlyscudd has joined #ruby
havenwood has joined #ruby
havenwood has quit [Read error: Connection reset by peer]
havenwood has joined #ruby
peregrine81 has joined #ruby
mikepack has quit [Remote host closed the connection]
mikepack has joined #ruby
Newbcake has joined #ruby
NealJ has quit [Ping timeout: 245 seconds]
Newbcake is now known as NealJ
<BraddPitt> i know in Java you put each class in its own file, but is it common in ruby to have (separate, non-subclass) classes in 1 file?
<volty> the common in ruby is: as you please
<BraddPitt> ;/
gyre007 has quit [Ping timeout: 248 seconds]
<BraddPitt> when do you guys break up classes into separate files?
barratt has quit [Quit: Leaving...]
mlpinit has joined #ruby
AzizLight has quit [Ping timeout: 264 seconds]
iamjarvo_ has joined #ruby
dkamioka has quit [Read error: Connection reset by peer]
<bnagy> 150 lines or 1650 bytes
<xybre> I never break classes into seperate files. I often break classes into multiple classes though.
baroquebobcat has quit [Quit: baroquebobcat]
dash_ has joined #ruby
mikepack has quit [Ping timeout: 268 seconds]
marwan_ has quit [Ping timeout: 240 seconds]
<volty> classes are already separated one from the another // relative classes (from the point of what they do) stay together // so you should think more about require -- i require a file (or files) that is going to satisfy the calls make from this file
marwa646 has quit [Ping timeout: 268 seconds]
<volty> classes are already separated one from the -other- // relative classes (from the point of what they do) stay together // so you should think more about require -- i require a fil (or files) that is going to satisfy the calls -made- from this file
iamjarvo has quit [Ping timeout: 248 seconds]
endash_ has quit [Ping timeout: 264 seconds]
havenwood has quit [Read error: Connection reset by peer]
havenwood has joined #ruby
ldnunes has joined #ruby
nadirvardar has quit [Ping timeout: 248 seconds]
bonhoeffer has joined #ruby
Xiti has quit [Read error: Connection reset by peer]
<bonhoeffer> i want to run Uglify on all js files in a directory to produce one file, is glob the best way?
mlpinit has quit [Ping timeout: 256 seconds]
dash_ has quit [Ping timeout: 240 seconds]
<bonhoeffer> i hate to use system
lukec has joined #ruby
<bonhoeffer> system("cat *.txt >bigfile")
iamjarvo_ has quit [Remote host closed the connection]
iamjarvo has joined #ruby
<volty> how do you call uglify ? what it expects ?
freezey has quit [Remote host closed the connection]
<bonhoeffer> it is a gem that takes a File
<bonhoeffer> Uglifier.compile(File.read("source.js"))
marcdel has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<bonhoeffer> i am running the ruby in a directory and want to give it a file object that represents cat "*.js"
tjbarber has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<bonhoeffer> file = `cat *.js`
v0n has quit [Ping timeout: 264 seconds]
Atrumx has quit [Quit: Quitting]
butblack has joined #ruby
iamjarvo has quit [Ping timeout: 248 seconds]
kevinykchan has joined #ruby
<bnagy> I would glob over all the files, run Uglifer on each and keep writing the outputs to a single handle
<volty> you could set an iostring with the contents of File.read iterating over Dir['*.js']
beilabs has quit [Ping timeout: 240 seconds]
freezey has joined #ruby
[gnubie] has joined #ruby
gmdeux has quit [Read error: Connection reset by peer]
* [gnubie] waves
Bira has joined #ruby
marwan_ has joined #ruby
Atrumx has joined #ruby
marwa504 has joined #ruby
Bry8Star{T2 has quit [Remote host closed the connection]
<volty> or an iterator if uglify can read line by line
<volty> or an *enumerator* if uglify can read line by line
beilabs has joined #ruby
popl has quit [Ping timeout: 240 seconds]
marcdel has joined #ruby
fgo has joined #ruby
pkrnj has quit [Quit: Computer has gone to sleep.]
Xiti has joined #ruby
reugen has joined #ruby
baroquebobcat has joined #ruby
bklane has joined #ruby
lukec has quit [Quit: lukec]
<volty> can you give uglify an enum/array of strings?
zz_tsykoduk is now known as tsykoduk
snovak has joined #ruby
<[gnubie]> what is the best way to get the cpu load on a linux system in ruby? in bash, i normally get the output of: $ uptime | cut -d"," -f4 | cut -d":" -f2 | cut -d" " -f2
lukec has joined #ruby
burlyscudd has quit [Quit: Leaving.]
clov3r has quit [Remote host closed the connection]
clov3r has joined #ruby
danman has quit [Quit: danman]
sectionme has joined #ruby
emmanuelux has quit [Remote host closed the connection]
<heftig> >> File.read("/proc/loadavg"].split[0,3]
<eval-in> heftig => /tmp/execpad-e48fe13868e2/source-e48fe13868e2:2: syntax error, unexpected ']', expecting ')' ... (https://eval.in/53159)
<heftig> oops
<heftig> >> File.read("/proc/loadavg").split[0,3]
<eval-in> heftig => (https://eval.in/53160)
<heftig> hah, guess i can't on that bot