apeiros changed the topic of #ruby to: Ruby 1.9.3-p374: http://ruby-lang.org (ruby-2.0.0-rc1) || Paste >3 lines of text on http://gist.github.com
crackfu has quit [Ping timeout: 256 seconds]
<RubyPanther> thansen: it is mostly a question of which ruby you use, not telling ruby which gems to use. "which ruby" will tell you which ruby the shell finds.
Xeago has quit [Remote host closed the connection]
xsarin has joined #ruby
<thansen> RubyPanther: I only have 1 installed...1.9
<RubyPanther> you obviously didn't run the command if you think the answer might be "1.9"
oponder has joined #ruby
<RubyPanther> try "man which"
<thansen> I know how to use which
<thansen> I have /usr/bin/ruby which is a symlink to /usr/bin/ruby19
CalebMingle has quit [Quit: CalebMingle]
fyolnish has joined #ruby
llaskin has joined #ruby
<llaskin> how would one strip the leading zero off of a float? for example I have a value of 0.05 and I want to get the .05 out?
<RubyPanther> There are 2 likely possibilities, 1 is that you're not using the system ruby and so it doesn't find those gems. The other is that your gemfile actually asks for certain versions, which are not the system gems. All of these problems would be solved by two steps, 1) use rvm or rbenv 2) don't care where your gems are coming from, care that you're asking for the versions you want in the Gemfile
<llaskin> is the best way to put it to a string and strip out the "0." part?
<havenn> thansen: env | grep GEM
<mosesaro> I was wondering anybody know a good rails book for a nooby
<mosesaro> sorry ruby book
<thansen> havenn: nada
danneu1 has joined #ruby
<havenn> thansen: I'd recommend just using chruby, to get your env vars setup for painless gems: https://github.com/postmodern/chruby
<thansen> RubyPanther: the versions of the gem are equal and I don't have non-system ruby installed
<thansen> I'd be happy to use the downloaded version but the damn thing won't build without hacking system rbconfig.rb
<thansen> havenn: I'd be happy to hack some env vars to make it work...I'll be in the context of the gentoo build system
Spooner has quit [Remote host closed the connection]
TheFuzzball has quit [Quit: Computer has gone to sleep.]
dr_neek has quit [Ping timeout: 245 seconds]
danneu1 has quit [Client Quit]
<havenn> thansen: GEM_HOME & GEM_PATH are the big two
<havenn> thansen: GEM_HOME is the default repository location for gem installation.
<havenn> thansen: whilst GEM_PATH is a colon-separated list of all the gem repository directories.
<thansen> havenn: and that would affect where bundler is trying to store crap while running?
<thansen> *wouldn't
<RubyPanther> to my it sounds like: I don't want what everybody actually uses I want a Ruby Goldberg
danneu has joined #ruby
ryanjh has quit [Quit: Computer has gone to sleep.]
havenn has quit [Remote host closed the connection]
jblack has joined #ruby
<RubyPanther> if bundler thinks you don't have the version you asked for and downloads one, it is usually right.
<RubyPanther> the first thing I would do is ask for exact versions and have those versions
<thansen> how 'deep' into the directory stucture should GEM_HOME go
mercwithamouth has joined #ruby
<danneu> What's the community favorite/standard for ruby documentation these days? I've never written a line of doc markup before and want to start right now. seems to be YARD?
<thansen> /usr/lib64/ruby/gems/ .. or /usr/lib64/ruby/gems/1.9.1
hotovson_ has joined #ruby
rakl has quit [Quit: sleeping]
jblack has quit [Client Quit]
fyolnish has quit [Remote host closed the connection]
x82_nicole has joined #ruby
syamajala has quit [Ping timeout: 246 seconds]
katherinem13 has quit [Quit: leaving]
nari has quit [Ping timeout: 245 seconds]
<mosesaro> guys/girls?
<mosesaro> any good ruby book for a noob?
katherinem13 has joined #ruby
<danneu> mosesaro: bastard book of ruby is nice because it gets you doing practical things asap
<mosesaro> danneu thanks I will check it out
jacktrick has joined #ruby
mikepack has joined #ruby
yshh has joined #ruby
xsarin has quit [Quit: xsarin]
b1rkh0ff has quit [Ping timeout: 252 seconds]
dr_neek has joined #ruby
yshh has quit [Remote host closed the connection]
punkrawkR^Home has quit [Read error: Connection reset by peer]
luckyruby has joined #ruby
<joshcheek> llaskin: 0.05.to_s.sub(/^0/, '') # => ".05"
chrismhough has joined #ruby
chrismhough has quit [Client Quit]
jackyalcine has joined #ruby
JosephFritzll has joined #ruby
<JosephFritzll> how to make a gay fuck a woman?
<JosephFritzll> shit her into cunt
haxrbyte_ has joined #ruby
HAKEON has joined #ruby
<emocakes> :|
marienz has quit [Ping timeout: 630 seconds]
<emocakes> or just get him to perform anal sex on her?
<JosephFritzll> nah they wont
daniel_-_ has joined #ruby
haxrbyte has quit [Ping timeout: 252 seconds]
<JosephFritzll> womans anal is clean out of shit
<JosephFritzll> unline mans
<emocakes> lol
<emocakes> you are polish
<JosephFritzll> yes
<emocakes> we dont need to make any jokes about that at all
<emocakes> its enough of a joke being polish
<JosephFritzll> yes
<emocakes> good luck there buddy!
<JosephFritzll> cool
<JosephFritzll> how to repeat holocaust?
dwn has joined #ruby
dwn has quit [Changing host]
dwn has joined #ruby
rakl has joined #ruby
<emocakes> repeat what?
<JosephFritzll> the holocaust
<JosephFritzll> you know, kill some jews
<emocakes> huh?
joshcheek has quit [Quit: joshcheek]
<JosephFritzll> would be cool thing to do
daniel_- has quit [Ping timeout: 252 seconds]
<JosephFritzll> dosent it?
ChampS666 has quit [Ping timeout: 252 seconds]
<emocakes> you guys will have to rebuild a cavalry, wouldnt be the same unless you rushed some german tanks with horses.. silly poland
CalebMingle has joined #ruby
aaronmacy has quit [Quit: Leaving.]
xsarin has joined #ruby
xsarin has quit [Client Quit]
<JosephFritzll> emocakes you are hitlers, u killed jews
<JosephFritzll> u are murderers
b1rkh0ff has joined #ruby
b1lly has joined #ruby
daniel_- has joined #ruby
slainer68 has quit [Remote host closed the connection]
keanehsiao has joined #ruby
daniel_-_ has quit [Ping timeout: 256 seconds]
<JosephFritzll> emocakes lol'd
<JosephFritzll> poland is shittest because hitlers ruined this country
<JosephFritzll> and they killed jews
<JosephFritzll> germany is responsible for holocaust
<emocakes> poland was shittiest before hitler
<emocakes> poland will continue to be shittiest as long as polish people continue to blame their problems on other countries
<emocakes> it isn't too difficult to understand
<JosephFritzll> no it wasnt
<emocakes> you even got let into the EU on a symptahy card and havent been able to make much out of it
<JosephFritzll> you ruined world
<emocakes> lol
<emocakes> :)
jblack has joined #ruby
<JosephFritzll> GERMANY = HITLERS = kill random people without reason
<jblack> Hi. I have two models, Filing and Principalforfiling. Filing has a "has n" relationship to principalforfiling, and principalforfiling has a belongs_to to filing. I want all Filings that have a principalforfiling that has a principal_email address of emailvar.
<JosephFritzll> you are cancer of world
<jblack> I tried this: Filing.all(Principalforfiling.principal_email => emailvar) { |x|
<jblack> but I get: /var/lib/gems/1.9.1/gems/dm-core-1.2.0/lib/dm-core/query.rb:866:in `block in assert_valid_conditions': condition :principal_email does not map to a property in Filing, but belongs to Principalforfiling (ArgumentError). Any suggestions on how to do this?
k610 has quit [Quit: Leaving]
solitude88 has quit [Quit: Linkinus - http://linkinus.com]
jacktrick has quit [Quit: Leaving]
<emocakes> JosephFritzll, they had reasons, just like poles killed germans before the war, they probably didnt teach you that in propaganda school though
keanehsiao has quit [Ping timeout: 248 seconds]
<emocakes> anyway
<JosephFritzll> no
<JosephFritzll> emocakes oh really
<emocakes> trying to compile hping
<JosephFritzll> what was the reason to kill all jews?
<JosephFritzll> to perform holocaust
llaskin has quit [Ping timeout: 260 seconds]
<emocakes> some crazy guy thought it was a good idea?
<emocakes> nonetheless, a reason
jimmyy has quit [Read error: Connection reset by peer]
<emocakes> i.e: what was reason to drop a-bomb on japan?
TomyLobo has quit [Quit: Standby mode...]
<emocakes> what is your reason for attempting to troll on IRC
<JosephFritzll> ALL GERMAN WAS SUPPORTING HITLER ON THIS
<JosephFritzll> YOUR PARENTS WERE SUPPORTING HOLOCAUST
<JosephFritzll> YOU ARE RESPONSIBLE FOR IT
<JosephFritzll> YOU KILLED JEWS
<emocakes> i'm not german
<emocakes> now just wait up
<emocakes> im compiling something
aaronmacy has joined #ruby
<emocakes> theres that to keep you busy
<JosephFritzll> you compiling weapon to kill jews
<emocakes> only you
<jblack> Trolling is fun and all, but I'm kinda stuck. Can you throw some hate bomb later? =)
forced_request has joined #ruby
<JosephFritzll> jblack ur mother wwas trolling when she made you with a truck driver
MattRB has joined #ruby
<emocakes> jblack, ummm, lemme check
luckyruby has quit [Remote host closed the connection]
<emocakes> hold on, is this rails?
<emocakes> check out #rubyonrails
<emocakes> or #rails
<emocakes> :p
<jblack> Thankw much emo.
kokainepizza has joined #ruby
<emocakes> more help, and mr fritzl is not there
kokainepizza has quit [Client Quit]
<jblack> Hey, Joseph... Jews AND Germans rock. =)
<JosephFritzll> jblack lol then why germans killed jews..
<emocakes> because poland couldn't stop tanks with little horses and swords
<jblack> It was all a big misunderstanding.
<emocakes> jaja
<emocakes> jblack, everyone else seems to have gotten over it, except poland
<emocakes> they hate germany so much that they all leave poland to get jobs here
<emocakes> haha
<JosephFritzll> emocakes u have great exonomy
<emocakes> so how do i contact a network oper
<JosephFritzll> because you used jews to make your roads and railroads
digitalcakestudi has quit [Quit: Leaving.]
<emocakes> as there is no one here, and id kinda like this asshat to get banned
<emocakes> jews are much harder workers, and far more intelligent than your average polish person, so why not JosephFritzll?
<emocakes> germany actually used a lot of turks
bricker has joined #ruby
adeponte has joined #ruby
<JosephFritzll> but you used jews and only paid them with little food
<JosephFritzll> they were at working camps
AsgardBSD has joined #ruby
<pskosinski> the hell happens on Ruby >.>
<JosephFritzll> pskosinski the germans killed jews
a3rdcoast has left #ruby [#ruby]
<emocakes> JosephFritzll, fritzl is spelled with one l
<emocakes> no idea pskosinski
freakazoid0223 has joined #ruby
<JosephFritzll> emocakes i know
<pskosinski> <emocakes> its enough of a joke being polish
<pskosinski> ty :|
<emocakes> haha
<emocakes> but you are a good polish person
<emocakes> so you mustn't have polish ancestors :p
<emocakes> haha
<emocakes> im kidding im kidding
<emocakes> he seems to think im german?!
yshh has joined #ruby
<JosephFritzll> emocakes then who you are
toekutr has joined #ruby
<emocakes> keine ahnung
Guest37257 is now known as fred
fred has quit [Changing host]
fred has joined #ruby
<pskosinski> you are both fucking idiots
<pskosinski> please leave
<pskosinski> It's Ruby channel
<JosephFritzll> pskosinski you think Ruby is not responsible for holocaust?
<pskosinski> I think that it's wrong channel for that
Giorgio has quit [Read error: Connection reset by peer]
<pskosinski> więć spierdalaj i znajdź sobie lepszy kanał
<pskosinski> więc *
<emocakes> :( im not an idiot pskosinski
<pskosinski> I don't know anybody from Poland working in Germany, sorry
<JosephFritzll> pskosinski you fucking polish cunt
<pskosinski> And all my ancestors are polish
havenn has joined #ruby
<pskosinski> And… really. Fucking kids
<JosephFritzll> pskosinski your country is controlled by european union which is controlled by israel
<emocakes> which is controlled by the new world order
<emocakes> which is controlled by that bad guy from scientology
<emocakes> come on now
<pskosinski> Who was op here…
daniel_- has quit [Quit: WeeChat 0.3.9.2]
<emocakes> im leaving the chan till you fuck off JosephFritzll
<emocakes> no idea pskosinski
<emocakes> i cant find out how to get irc ops
<pskosinski> apeiros iirc but I don't see him :(
<JosephFritzll> emocakes no, no scientology, just israel
<emocakes> i think banisterfiend as well
<emocakes> anyway
<emocakes> /part
emocakes has left #ruby [#ruby]
<pskosinski> he should kick you both cunts, and maybe me for swearing
<JosephFritzll> pskosinski you are man who would be sucking german man dick's for 5 euros
jimeh has quit [Quit: Computer has gone to sleep.]
<havenn> JosephFritzll: Topic is Ruby. Try...
vetsin has joined #ruby
<pskosinski> I am man to who in real life you wouldn't ever tell anything like this
<vetsin> If ideclare a class, then extend a module within it, how do i declare a method which i can call without instancing the class
<unstable> Can I do a, b, c == x, y z, the same way I can do a, b, c = x, y, z?
<JosephFritzll> pskosinski i train mma i would kill you
<X-Jester> vetsin: def self.method ()?
<JosephFritzll> WAS HAVING GREAT FUN
<banisterfiend> lol
JumpMast3r has quit [Quit: JumpMast3r]
<vetsin> X-Jester: doesn't seem to work
AsgardBSD_ has joined #ruby
<X-Jester> vetsin: the method, or accessing the members?
AsgardBSD has quit [Ping timeout: 246 seconds]
AsgardBSD_ is now known as asgardBSD
<vetsin> accessing the method, get NoMethodError
pyx has quit [Quit: WeeChat 0.3.9.2]
<X-Jester> are you using the right namespace?
<X-Jester> like, if you did self.bar on class Foo, are you doing Foo::bar ?
cyong has joined #ruby
<banisterfiend> JosephFritzll: ok, i got the syntax right, be good or i'll have to quiet you
taoru has joined #ruby
<X-Jester> vetsin: try Color::escape_to_html
oponder has quit [Remote host closed the connection]
cobragoa_ has joined #ruby
<X-Jester> If you want to use a static method, you have to refer to it via a static namespace
<JosephFritzll> banisterfiend im all good, just like a jew when he got the holzgas
<vetsin> X-Jester: alright, but all my other methods i can call using Color.method (those from the gem)
<X-Jester> vetsin: then my suspicion is those are on instanciated classes
cobragoa_ has quit [Read error: Connection reset by peer]
<vetsin> X-Jester: the method gets called, at least, but still errors due to now not knowing the ATTRIBUTES var
<vetsin> Sorry, new to ruby and i haven't wrapped my head around its OO stuff
marr has quit [Ping timeout: 252 seconds]
<X-Jester> class attributes (i.e. static attributes) have to be prefixed with @@
slainer68 has joined #ruby
<vetsin> lets assume i just want to extend the modules functionality, is this how i should go about it
crackfu has joined #ruby
<unstable> What do people do when there are 4 or 5 boolean values needed before executing a method?
JosephFritzll has left #ruby [#ruby]
<unstable> It's getting too long. Is there parallel boolean comparisons?
HAKEON has left #ruby [#ruby]
<X-Jester> vetsin: it's cool to extend a class, but if you are extending a static class, that's how you have to do it
<banisterfiend> X-Jester: no, @@var is something a bit different
<mdel> unstable: create a check_XXX method to break things up
<X-Jester> banisterfiend: er, i thought @@var was the equivalent of a static variable
MattRB has quit [Quit: This computer has gone to sleep]
<X-Jester> only called a class variable instead of a static one
<banisterfiend> X-Jester: a bit different, and generally discouraged in ruby
havenn has quit [Remote host closed the connection]
<X-Jester> doh, my bad
<banisterfiend> X-Jester: class instance variables (instance variables on the class) are often recommended instead
<X-Jester> banisterfiend: he doesn't want to instanciate his class
<banisterfiend> X-Jester: your code would work, it's just a bit weird in ruby
havenn has joined #ruby
jaequery has joined #ruby
Boohbah_ has quit [Changing host]
Boohbah_ has joined #ruby
Boohbah_ has joined #ruby
<banisterfiend> X-Jester: yeah, that's *class* instance variables (only accessible on the class) not instance variables that will available to an instance
Boohbah_ is now known as Boohbah
<X-Jester> alright, can you direct him on how to do this ruby style then :)
jaequery has quit [Client Quit]
<X-Jester> he wanted self.methods that could access variables, and if it were me, i'd make a class accessor as self.getSomething to return @@something
crackfu has quit [Ping timeout: 246 seconds]
<vetsin> :<
<banisterfiend> vetsin: 'extend the module's functionality' --> you coudl always just add a method to the module :)
jimmyy has joined #ruby
<vetsin> banisterfiend: thats what i want to do, but i didn't want to like grab the source and include it
joshcheek has joined #ruby
<banisterfiend> vetsin: you can re-open a module at any time
<vetsin> So, OO isn't the way to go here
b1rkh0ff has quit [Ping timeout: 246 seconds]
<banisterfiend> btw this is a pretty weird thing to do :) Basically all taht you want is a class method on your class, right?
jfl0wers has joined #ruby
<vetsin> yes
havenn has quit [Ping timeout: 240 seconds]
<X-Jester> vetsin: i've had good success just extending via <<, like "class MyThread << Thread"
<X-Jester> but i am not sure if that behavior is functionally any different than the 'extend' keyword you're using
<banisterfiend> vetsin: this code should work: http://pastie.org/private/9cevrfrdkh2uorodeflhbq
<banisterfiend> vetsin: Color.escape_to_html() should be a valid method you can invoke
slainer68 has quit [Ping timeout: 256 seconds]
<vetsin> Then why in the...
<banisterfiend> vetsin: because you're probably not doing what you say you're doing, something else is going on
<X-Jester> hey, uh, wait a sec
<X-Jester> vetsin: where does ATTRIBUTES come from?
<joshcheek> banisterfiend: What about 0m? Should probably be close tag.
<vetsin> i honestly dont know what i could be leaving out that would matter, but i'd suppose so also
horofox has quit [Quit: horofox]
<X-Jester> does Term::ANSIColor::ATTRIBUTES.each do anything different?
orcris has joined #ruby
<banisterfiend> joshcheek: he shouldn't get a NoMethodError for Color.escape_to_html afaict
<vetsin> X-Jester: yeah, it makes it work
fyolnish has joined #ruby
jaequery has joined #ruby
cyong has quit [Quit: Leaving.]
adeponte has quit [Remote host closed the connection]
niklasb has quit [Ping timeout: 244 seconds]
QaDeS has quit [Quit: Ex-Chat]
MattRB has joined #ruby
<X-Jester> vetsin: then it must have just been a namespacing thing
horofox has joined #ruby
<banisterfiend> vetsin: are you sure the exception you were getting was a NoMethodError on Color.escape_to_html, and not another kind of exception?
fschuindt has joined #ruby
<X-Jester> banisterfiend: i think we found the problem
<X-Jester> banisterfiend: he needed to provide a fully qualified namespace to his ATTRIBUTES.each block
<X-Jester> i.e. Term::ANSIColor::ATTRIBUTES.each
<vetsin> banisterfiend: The error in the paste was what was returned, though i didn't look at the full trace
adeponte has joined #ruby
<banisterfiend> X-Jester: i still dont get why a constant lookup error resulted in a NoMethodError for escape_to_html
<X-Jester> vetsin: i don't blame you for being confused about ruby's OO, i still wrestle with it
<X-Jester> vetsin: can you paste the full stacktrace?
<vetsin> yeah sure, let me re-create the error
<X-Jester> banisterfiend: maybe the interpreter assumed that he was attempting to invoke a method instead of access a member?
<banisterfiend> nah..
<vetsin> ah crud, it turns out i must have had another error as banister said
<vetsin> because without the extra namespace stuff the error is: uninitialized constant Color::ATTRIBUTES
<X-Jester> aha
<X-Jester> well, there ya go
<X-Jester> ;)
<X-Jester> i am psychic and knew that was the error you were really getting :P
<X-Jester> *strut*
<vetsin> lol
<X-Jester> anyway, once you get the hang of it, ruby is immensely powerful
Paradox has joined #ruby
<vetsin> testing it out now, started a few days ago, i'm liking a lot of the idioms it seems to use
x0F has quit [Read error: Connection reset by peer]
<CalebMingle> it gets better as you go.
dmiller has quit [Ping timeout: 248 seconds]
tomzx_ has joined #ruby
CalebMingle has quit [Quit: CalebMingle]
<X-Jester> my biggest frustration is how antequated my OO thinking is
<X-Jester> so many things want to be done in blocks and i get frustrated with that
jaequery has quit [Quit: Computer has gone to sleep.]
x0F has joined #ruby
<X-Jester> (but i also got really frustrated with function pointers in C and C++, so there you go)
phrame has quit [Ping timeout: 248 seconds]
vlad_starkov has quit [Remote host closed the connection]
Kingy has quit [Quit: Leaving]
phrame has joined #ruby
emocakes has joined #ruby
<banisterfiend> vetsin: this should work in place of Term::ANSIColor::ATTRIBUTES.each too, singleton_class::ATTRIBUTES.each
<vetsin> My OO is from java, so...
<vetsin> oh that looks much better
threecreepio has joined #ruby
caleb_io has joined #ruby
<banisterfiend> wait
<vetsin> it works
horofox has quit [Quit: horofox]
b1lly has quit [Quit: b1lly]
tomzx_ is now known as tomzx_mac
<banisterfiend> yeah
RagingDave has quit [Quit: Ex-Chat]
coaster is now known as coastRAVEN
benlieb has joined #ruby
taoru has quit [Remote host closed the connection]
keanehsiao has joined #ruby
toekutr has quit [Remote host closed the connection]
main has joined #ruby
keanehsiao has quit [Ping timeout: 246 seconds]
Dreamer3 has joined #ruby
crackfu has joined #ruby
dwn has quit [Ping timeout: 256 seconds]
jfl0wers has quit [Ping timeout: 245 seconds]
orcris has quit [Ping timeout: 245 seconds]
jackyalcine_ has joined #ruby
benlieb has quit [Quit: benlieb]
digitalcakestudi has joined #ruby
pac1 has joined #ruby
angusiguess has quit [Quit: leaving]
Takehiro has quit [Remote host closed the connection]
jackyalcine has quit [Ping timeout: 248 seconds]
ttt has joined #ruby
krz has joined #ruby
baroquebobcat has joined #ruby
SigmaVirus24 has joined #ruby
pray_4_matt_ryan has quit [Remote host closed the connection]
caleb_io has quit [Quit: caleb_io]
benlieb has joined #ruby
<asgardBSD> I was wondering if it was clojure or groovy that people said that was bad, because it brought the same bad thing java had...
skaczor has joined #ruby
nfk has quit [Quit: yawn]
<vetsin> could somone tell me what to look up for why '[\e[0m]' and "[\e[0m]" give me different results?
benlieb has quit [Client Quit]
<asgardBSD> Im sure it was either on this channel or on Scala that someone said every language that run on JVM language is good except Java, then I asked for clojure and groovy
caleb_io has joined #ruby
vlad_starkov has joined #ruby
arya has joined #ruby
xsarin has joined #ruby
MattRB has quit [Quit: This computer has gone to sleep]
xsarin has quit [Client Quit]
baroquebobcat has quit [Quit: baroquebobcat]
<fschuindt> How can I generate all possibilities combinations of an determined array in a range of combination length. Eg: ('a'..'f').to_a.all_possibilities(3, 5) Should reproduce another array like this: "abc, abd, abe, abf, ..., abcde, abcdf, abcda, ...". From "abc" (3 characters) up to the last possible combination of ('a'..'f').to_a with 5 characters length. Any help? (Isn't my homework)
io_syl has joined #ruby
autibyte has quit [Remote host closed the connection]
planplotexe is now known as plotplanexe
plotplanexe has quit [Changing host]
plotplanexe has joined #ruby
jenrzzz has joined #ruby
EzeQL_ has joined #ruby
vlad_starkov has quit [Ping timeout: 256 seconds]
EzeQL has quit [Ping timeout: 240 seconds]
samphippen has quit [Quit: Computer has gone to sleep.]
cobragoat has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
diegoviola has quit [Quit: WeeChat 0.3.9.2]
slainer68 has joined #ruby
nari has joined #ruby
pskosinski has quit [Quit: Learn Life's Little Lessons]
toekutr has joined #ruby
sepp2k has quit [Remote host closed the connection]
dmiller has joined #ruby
Cooler_ has joined #ruby
pskosinski has joined #ruby
slainer68 has quit [Ping timeout: 246 seconds]
Axsuul has quit [Ping timeout: 252 seconds]
keanehsiao has joined #ruby
keanehsiao has quit [Client Quit]
CrawfordComeaux has joined #ruby
cjs226 has quit [Ping timeout: 248 seconds]
havenn has joined #ruby
miskander has joined #ruby
mikepack has quit [Remote host closed the connection]
asgardBSD has quit [Ping timeout: 256 seconds]
havenn has quit [Ping timeout: 256 seconds]
JumpMast3r has joined #ruby
<raz> define_method :foo { self } .. <- self points to the scope surrounding define_method here. how do i, from inside the defined method, get a reference to the instance on which the method is invoked?
pskosinski has quit [Quit: Learn Life's Little Lessons]
Virunga_ has quit [Remote host closed the connection]
digitalcakestudi has quit [Quit: Leaving.]
miskander has quit [Quit: miskander]
jaequery has joined #ruby
<banisterfiend> raz: self
generalissimo has joined #ruby
<raz> hm you are right, i seem to have a different issue here
guns has joined #ruby
sailias has joined #ruby
gyre007 has quit [Remote host closed the connection]
hackerdude has joined #ruby
S1kx has joined #ruby
S1kx has quit [Changing host]
S1kx has joined #ruby
banisterfiend has quit [Remote host closed the connection]
banisterfiend has joined #ruby
kpshek has joined #ruby
adkron has quit [Ping timeout: 256 seconds]
S2kx has quit [Ping timeout: 246 seconds]
FlyingFoXy has left #ruby ["http://quassel-irc.org - Chat comfortably. Anywhere."]
adkron has joined #ruby
_alejandro has quit [Remote host closed the connection]
miskander has joined #ruby
mahmoudimus has joined #ruby
jaequery has quit [Quit: Computer has gone to sleep.]
kpshek has quit [Ping timeout: 256 seconds]
jaequery has joined #ruby
jinzhu has joined #ruby
wallerdev has joined #ruby
cobragoat has quit [Remote host closed the connection]
wargasm has quit [Ping timeout: 248 seconds]
jenrzzz has quit [Ping timeout: 252 seconds]
cobragoat has joined #ruby
aaronmacy has quit [Quit: Leaving.]
jbw has quit [Ping timeout: 245 seconds]
emmanuelux has quit [Remote host closed the connection]
freakazoid0223 has quit [Quit: Leaving]
x82_nicole has quit [Ping timeout: 248 seconds]
vsh_ has joined #ruby
x82_nicole has joined #ruby
yugui_zzz is now known as yugui
cobragoat has quit [Remote host closed the connection]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
coastRAVEN is now known as RAVENSRAVENS
tbrock has joined #ruby
RAVENSRAVENS is now known as coaster
emocakes has quit [Quit: emocakes]
tbrock has quit [Client Quit]
tbrock has joined #ruby
tbrock has quit [Max SendQ exceeded]
gyre008 has quit [Remote host closed the connection]
tbrock has joined #ruby
Hanmac1 has joined #ruby
tbrock has quit [Client Quit]
hackerdude has quit [Remote host closed the connection]
joshcheek has quit [Quit: joshcheek]
joshcheek has joined #ruby
Hanmac has quit [Ping timeout: 252 seconds]
SigmaVirus24 has quit [Quit: leaving]
thomasfedb has joined #ruby
rismoney has joined #ruby
sailias has quit [Quit: Leaving.]
jbw has joined #ruby
orcris has joined #ruby
gyre007 has joined #ruby
Takehiro has joined #ruby
robbyoconnor has quit [Ping timeout: 256 seconds]
pac1 has quit [Quit: I got it one line of code at a time]
santosh has joined #ruby
filemon_CZ has quit [Read error: Connection reset by peer]
robbyoconnor has joined #ruby
santosh has quit [Client Quit]
mahmoudimus has joined #ruby
gyre007 has quit [Ping timeout: 256 seconds]
slainer68 has joined #ruby
dnyy has joined #ruby
slainer68 has quit [Ping timeout: 252 seconds]
arya has quit [Ping timeout: 248 seconds]
GeekSir has joined #ruby
arya has joined #ruby
<joshcheek> vetsin: There are any number of books that would be good. The Pickaxe (Programming Ruby 1.9) is probably the best, but it's big and that can be overwhelming. Buuuut, it covers a ton of stuff, and you don't need all of that (I consider it the best Ruby book there is, but you don't need all of it). I also cover it a little bit in Ruby Kickstart (in the first video http://ruby-kickstart.com/ at 34 minutes)
bigmac has quit [Quit: Leaving]
caleb_io has quit [Quit: caleb_io]
xemu has quit [Quit: Nettalk6 - www.ntalk.de]
EzeQL_ has left #ruby [#ruby]
postmodern has joined #ruby
danneu has quit [Quit: WeeChat 0.3.8]
orcris has quit [Ping timeout: 245 seconds]
miskander has quit [Quit: miskander]
skcin7 has joined #ruby
aaronmacy has joined #ruby
karasawa has joined #ruby
Takehiro has quit [Remote host closed the connection]
MattRB has joined #ruby
joofsh has joined #ruby
pootietang has quit [Quit: leaving]
agarie has quit [Remote host closed the connection]
paolooo has joined #ruby
sailias has joined #ruby
jonathanwallace has joined #ruby
jblack has quit [Ping timeout: 244 seconds]
miskander has joined #ruby
guns has quit [Quit: guns]
zehrizzatti has joined #ruby
JumpMast3r has quit [Quit: JumpMast3r]
hotovson_ has quit [Remote host closed the connection]
GeekSir has left #ruby [#ruby]
hotovson has joined #ruby
jimmyy has quit [Read error: Connection reset by peer]
cjs226 has joined #ruby
miskander has quit [Quit: miskander]
Nisstyre-laptop has quit [Quit: Leaving]
hotovson has quit [Ping timeout: 245 seconds]
hemanth has joined #ruby
paolooo has quit [Quit: Page closed]
miskander has joined #ruby
adeponte has quit [Remote host closed the connection]
skaczor has quit [Remote host closed the connection]
skaczor has joined #ruby
elkclone has joined #ruby
sayan has joined #ruby
jduan1981 has quit [Ping timeout: 256 seconds]
skaczor has quit [Remote host closed the connection]
jblack has joined #ruby
skaczor has joined #ruby
miskander has quit [Client Quit]
<shevy> vetsin well, "" in strings may be different than '', at least when you use #{} within ""
rakl has quit [Quit: sleeping]
<shevy> I myself tend to prefer '' when there are no interpolations to be done, and "" when they may be done
<shevy> others prefer "" all the time
jenrzzz has joined #ruby
jackyalcine_ has quit [Ping timeout: 252 seconds]
genjuro has joined #ruby
aaronm_ is now known as aaronm
genjuro has quit [Remote host closed the connection]
vsh_ has quit [Quit: Leaving]
elkclone has quit [Remote host closed the connection]
az7ar has joined #ruby
robbyoconnor has quit [Max SendQ exceeded]
elkclone has joined #ruby
elkclone has quit [Client Quit]
robbyoconnor has joined #ruby
jackyalcine_ has joined #ruby
jackyalcine_ has quit [Changing host]
jackyalcine_ has joined #ruby
skaczor has quit [Remote host closed the connection]
elkclone has joined #ruby
friskd has joined #ruby
skaczor has joined #ruby
skaczor has quit [Remote host closed the connection]
skaczor has joined #ruby
skaczor has quit [Remote host closed the connection]
fschuindt has quit [Remote host closed the connection]
skaczor has joined #ruby
skaczor has quit [Remote host closed the connection]
skaczor has joined #ruby
gyre007 has joined #ruby
miskander has joined #ruby
adeponte has joined #ruby
adeponte has quit [Remote host closed the connection]
sayan has quit [Read error: Connection reset by peer]
karasawa has quit [Ping timeout: 260 seconds]
jenrzzz has quit [Ping timeout: 248 seconds]
jenrzzz has joined #ruby
thufir_ has joined #ruby
thufir_1 has joined #ruby
az7ar has quit [Ping timeout: 252 seconds]
thufir_1 has quit [Client Quit]
friskd has quit [Quit: friskd]
Umren has joined #ruby
gyre007 has quit [Ping timeout: 246 seconds]
blazes816 has quit [Quit: blazes816]
x82_nicole has quit [Quit: Computer has gone to sleep.]
<unstable> I am writing a simple chess game in CLI (I'm learning ruby as my first language).
<unstable> It's coming along, and most of the pieces can move around the board, etc.
<shevy> unstable good
<unstable> For the ComputerPlayer class.. I don't want to set it up to randomly move against he HumanPlayer class. Is there a good chess engine in ruby or something else that isn't difficult to use?
<unstable> I basically want to feed it moves, and get moves back from the ComputerPlayer
browndawg has joined #ruby
<davidcelis> it's more complicated than that
<davidcelis> the computer should take the entire board into account, not just the last move
<shevy> there is a "chess" gem but I dunno if it is finished
<shevy> chess/gnuchess.rb:53: warning: regexp has invalid interval
<shevy> looks buggy
serhart has quit [Quit: Leaving.]
Playground has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
<unstable> So gnuchess is written in c++, does that mean the gem is just a wrapper the executes the linux elf binaries?
miskander has quit [Quit: miskander]
<X-Jester> unstable: i guess thta depends on how ruby native extensions work
<shevy> no real idea, usually you have to compile the bindings on your own system
yacks has joined #ruby
az7ar has joined #ruby
<X-Jester> unstable: i haven't looked closely enough to see if native extensions are just shellouts, or if the ruby interpreter acutally pulls in the shared object
noxgirl has joined #ruby
gokul has joined #ruby
atno has quit [Remote host closed the connection]
arya has quit [Ping timeout: 248 seconds]
noxgirl is now known as autumn
jekotia has quit [Quit: ChatZilla 0.9.89-rdmsoft [XULRunner 1.9.0.17/2009122204]]
JumpMast3r has joined #ruby
radic has joined #ruby
arya has joined #ruby
joeycarmello has quit [Remote host closed the connection]
stnly has joined #ruby
fschuindt has joined #ruby
radic_ has quit [Ping timeout: 260 seconds]
<fschuindt> I was running a very long code when the terminal outputs: "Killed" and the program has turned off. What may be the cause?
<heftig> fschuindt: out of memory
<heftig> check dmesg
caleb_io has joined #ruby
etcetera has joined #ruby
huoxito has quit [Ping timeout: 244 seconds]
hackerdude has joined #ruby
Eol has joined #ruby
etcetera has quit [Client Quit]
browndawg has quit [Ping timeout: 245 seconds]
adeponte has joined #ruby
ananthakumaran has joined #ruby
adeponte has quit [Read error: Connection reset by peer]
hackerdude has quit [Remote host closed the connection]
karasawa has joined #ruby
Quadlex is now known as AwayLex
alexwh has quit [Ping timeout: 252 seconds]
skaczor has quit [Remote host closed the connection]
Playground has joined #ruby
rippa has joined #ruby
Guest42233 has quit [Ping timeout: 252 seconds]
quest88 has joined #ruby
freeayu has quit [Read error: Connection reset by peer]
alexwh has joined #ruby
alexwh_ has joined #ruby
alexwh_ is now known as Guest49725
sayan has joined #ruby
browndawg has joined #ruby
mneorr has joined #ruby
freeayu has joined #ruby
Umren has quit [Read error: Connection reset by peer]
noyb has joined #ruby
katherinem13 has quit [Quit: leaving]
Mon_Ouie has quit [Ping timeout: 248 seconds]
katherinem13 has joined #ruby
Mon_Ouie has joined #ruby
bel3atar has quit [Ping timeout: 276 seconds]
Eol has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
browndawg has left #ruby [#ruby]
zehrizzatti has quit [Quit: Linkinus - http://linkinus.com]
zph has joined #ruby
thufir_ has quit [Remote host closed the connection]
cableray has quit [Ping timeout: 244 seconds]
IrishGringo has joined #ruby
skcin7 has quit []
love_color_text has joined #ruby
crackfu has quit [Remote host closed the connection]
crackfu has joined #ruby
slainer68 has joined #ruby
tomzx_mac_ has joined #ruby
tomzx_mac has quit [Ping timeout: 248 seconds]
crackfu has quit [Ping timeout: 252 seconds]
slainer68 has quit [Ping timeout: 260 seconds]
adeponte has joined #ruby
serhart has joined #ruby
b1lly has joined #ruby
yakko has quit [Remote host closed the connection]
syamajala has joined #ruby
arya has quit [Ping timeout: 248 seconds]
maletor has quit [Quit: Computer has gone to sleep.]
caleb_io has quit [Quit: caleb_io]
arya has joined #ruby
joofsh has quit [Remote host closed the connection]
love_color_text has quit [Remote host closed the connection]
jackyalcine_ has quit [Ping timeout: 246 seconds]
syamajala has quit [Quit: leaving]
zph has quit [Quit: Computer has gone to sleep.]
<hemanth> cat.send("got_homes", "nice_home") => cat.got_home("nice_home")
<hemanth> ? => cat.got_home(:home,"nice_home")
thufir_1 has joined #ruby
thufir_ has joined #ruby
thufir_ has quit [Client Quit]
sailias has quit [Quit: Leaving.]
fschuindt has quit [Remote host closed the connection]
<unstable> Is there any free blog platform or anything that lets me run my own ruby code?
mercwithamouth has quit [Ping timeout: 240 seconds]
<epochwolf> unstable: heroku?
jduan1981 has joined #ruby
statarb3 has quit [Ping timeout: 256 seconds]
nomenkun has quit [Remote host closed the connection]
IrishGringo has quit [Remote host closed the connection]
subbyyy has quit [Quit: none 0.3.9.2]
iml has joined #ruby
hackerdude has joined #ruby
joeycarmello has joined #ruby
a_a_g has joined #ruby
<epochwolf> okay, how would I make a dsl for this? https://gist.github.com/9e59896924e3247eec9c
joeycarmello has quit [Remote host closed the connection]
katherin1m13 has joined #ruby
love_color_text has joined #ruby
katherin1m13 has quit [Client Quit]
arya has quit [Ping timeout: 248 seconds]
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
mercwithamouth has joined #ruby
robbyoconnor has quit [Ping timeout: 256 seconds]
arkiver has joined #ruby
Dwarf has quit [Ping timeout: 246 seconds]
arya has joined #ruby
hackerdude has quit [Remote host closed the connection]
baroquebobcat has joined #ruby
eyeR8 has joined #ruby
cantonic has quit [Quit: cantonic]
robbyoconnor has joined #ruby
cha1tanya has joined #ruby
guns has joined #ruby
aedornm has quit [Quit: Leaving]
jonahR has quit [Quit: jonahR]
arya has quit [Ping timeout: 248 seconds]
baroquebobcat has quit [Quit: baroquebobcat]
dnyy has quit [Remote host closed the connection]
dnyy has joined #ruby
nocturne7 has joined #ruby
CrawfordComeaux has quit [Read error: Connection reset by peer]
nocturne7 has left #ruby ["Leaving"]
<shevy> epochwolf that is already a DSL, is it not?
b1rkh0ff has joined #ruby
<shevy> on() help() once() and command() methods in use there
alex__c2022 has quit [Read error: Connection reset by peer]
arya has joined #ruby
alex__c2022 has joined #ruby
cableray has joined #ruby
<epochwolf> shevy: I was actually asking for details on implementing but I'm too tired to think straight.
karasawa has quit [Ping timeout: 248 seconds]
karasawa has joined #ruby
<shevy> these are just methods. DSL is nothing than a fancy name for specific methods in use. to access the do/end blocks, you can do: yield if block_given?
xnm has joined #ruby
<epochwolf> shevy: did I mention I'm too tired to think?
nomenkun has joined #ruby
<epochwolf> shevy: https://github.com/epochwolf/godgamepurple I wrote this in a few hours today. I'm not a noob, just tired. :)
recycle has quit [Remote host closed the connection]
dmiller has quit [Ping timeout: 256 seconds]
osaut has joined #ruby
caleb_io has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
<mdel> epochwolf: nice code
<epochwolf> mdel: I know. I'm pretty proud of it
<epochwolf> mdel: Radar's Summer gem didn't do what I wanted so I ported sabot from lua to ruby,.
<mdel> epochwolf: i mean, I'm barely qualified to say that, but I can tell it's well thought out
<shevy> it is good code if it works
<mdel> ehhhh
<mdel> dunno about that :)
nomenkun has quit [Ping timeout: 252 seconds]
<mdel> i deal with a ton of "working" php code on a daily basis that would challenge that notion
<mdel> good code is organized and maintainable, in addition to working properly
uris has quit [Quit: Leaving]
aaronmacy has quit [Quit: Leaving.]
<epochwolf> shevy: in that case, it's marginal :D, the first test lasting more than 5 minutes revealed a bug in the ping handler.
<shevy> mdel I like those criterias
robbyoconnor has quit [Ping timeout: 245 seconds]
r0bby has joined #ruby
<mdel> shevy: wish they wore more prevalent ;)
<shevy> hehe
tagrudev has joined #ruby
krainboltgreene has joined #ruby
eyeR8 has quit [Remote host closed the connection]
thufir_1 has quit [Quit: Leaving.]
gokul has quit [Quit: Leaving]
jduan1981 has quit [Read error: Connection reset by peer]
jduan1981 has joined #ruby
jduan1981 has quit [Remote host closed the connection]
<krainboltgreene> Does anyone know why Rake drops this huge load on me every time I run it? https://gist.github.com/4583998
jduan1981 has joined #ruby
r0bby has quit [Ping timeout: 245 seconds]
<nazty> yo sheerun
<nazty> shevy
jonahR has joined #ruby
mercwithamouth has quit [Ping timeout: 240 seconds]
rippa has quit [Ping timeout: 252 seconds]
stayarrr has joined #ruby
<xybre> krainboltgreene: rake is being loaded twice
cakehero has joined #ruby
<krainboltgreene> xybre: That's what I guessed, but is it internal to rake or did I do that accidentally?
mercwithamouth has joined #ruby
osaut has quit [Quit: osaut]
Veejay has joined #ruby
<xybre> krainboltgreene: you, or one of your gems. Rake doesn't do that on its own.
<krainboltgreene> When I use bundle exec it's fine. Hmm.
cibs has quit [*.net *.split]
ananthakumaran1 has joined #ruby
Inoperable has quit [Ping timeout: 248 seconds]
ddd has joined #ruby
b1lly has left #ruby [#ruby]
ananthakumaran has quit [Ping timeout: 248 seconds]
<xybre> Then you might have a plugin in your gems you should uninstall (which isn't part of your bundle)
<xybre> Also
Inoperable has joined #ruby
Inoperable has quit [Max SendQ exceeded]
<krainboltgreene> I don't.
<xybre> If you use rubygems-bundle you shouldn't need exec.
Inoperable has joined #ruby
Inoperable has quit [Max SendQ exceeded]
<xybre> gem list --loca is identical to bundle exec gem list --local?
<xybre> s/loca /local /g
Inoperable has joined #ruby
Inoperable has quit [Max SendQ exceeded]
<krainboltgreene> The rvm gem is the only difference.
Inoperable has joined #ruby
Inoperable has quit [Max SendQ exceeded]
kiyoura has quit [Quit: Leaving]
Inoperable has joined #ruby
Inoperable has quit [Max SendQ exceeded]
<xybre> Do you have a gemset for your project and a .rvmrc file?
Inoperable has joined #ruby
Inoperable has quit [Max SendQ exceeded]
tommyvyo has joined #ruby
<mdel> ugh rvm... caused me so much grief
Inoperable has joined #ruby
sayan has quit [Read error: Connection reset by peer]
<mdel> when I realized it was overriding `cd` I dropped it so fast
<krainboltgreene> xybre: Yes and yes.
Axsuul has joined #ruby
guns has quit [Quit: guns]
osaut has joined #ruby
jenrzzz has joined #ruby
<xybre> Huh. Might not be rvm's fault, but pretty weird. I'd check the global gemset, and if all else fails delete all the gems in global, default, and your current gemset and reinstall only in the current gemset and see what happens.
<krainboltgreene> Fair enough, thanks.
<xybre> mdel: I've looked at the alternatives, but the functionality is sound, and most of the alternatives don't really offer the same level of features.
<xybre> Hopefully, version 2 will make mixups like this less likely.
brianpWins has joined #ruby
<mdel> xybre: rbenv works well
<mdel> i think it's a better option personally
<mdel> especially on a server, where you want users to have a shared installation, separate gems, with the ability to override the active ruby if necessary
<xybre> I understand wanting to avoid overwritting cd, but its nice to automatically switch gemsets for you. How do you do it with rbenv?
<mdel> xybre: i dont
<mdel> because bundler
<postmodern> mdel, RVM is moving away from overriding cd, it uses PROMPT_COMMAND just like chruby
r0bby has joined #ruby
<mdel> postmodern: good to know, I haven't followed dev at all
<mdel> but still, unless im missing something, bundler solves the "gemset" problem
* mdel may very well be missing something
<xybre> I guess the problems is rubygems itself, without gemsets you end up with crazy conflicts and a load of gems you aren't sure if you need or not. I guess if you only have one or two projects its not a big deal though.
joeycarmello has joined #ruby
<mdel> well when using bundler, your Gemfile defines the exact gems/versions your project needs
charliesome has joined #ruby
timonv has joined #ruby
<davidcelis> xybre: bundler
<davidcelis> gemsets are no longer necessary
<xybre> Otherise you have to specify the individual versions of each gem in bundler, plus all their dependencies. Which is a serious downer.
<mdel> and as long as you `bundle exec <something>` you will be fine
cobragoat has joined #ruby
<mdel> xybre: i mean, isn't this more of a downer than maintaining a simple file of requirements?
<postmodern> mdel, sort of, except bundler installs gems into your global gem home
etcetera has joined #ruby
<mdel> i've never had a prblem with bundler at all
<postmodern> mdel, sometimes i want to isolate gems to a directory (for one off contributions to big projects)
yacks has quit [Read error: Connection reset by peer]
<postmodern> mdel, so i use chgems + bundler
<mdel> postmodern: override GEM_HOME in that directory only?
toekutr has quit [Remote host closed the connection]
<mdel> maybe that's what chgems does, haven't looked at that
<postmodern> mdel, yep, also sets GEM_PATH and PATH
<mdel> assuming you only have to use chgems when you want it, that sounds like a good option
<xybre> I haven't had too many issues, when things look funny I jsut clean out my gems. If I had to specify all the gems we use and pin each version by hand.. I'd like something else to handle that for me. The Gemfile.lock is nice, but bundler will chock if two gems use different versions of a third gem, and then you get to resolve the conflict manaully anyway.
<postmodern> mdel, yeah, i hate it when projects want to install a bunch of development dependencies that i never use
<postmodern> mdel, keeps my gem home small
<mdel> so chgems really isn't an alternative to rvm, but a different thing all togetehr
* mdel still hasn't looked it up
<mdel> but it seems like rbenv + chgems = best of all worlds
etcetera has quit [Client Quit]
<mdel> anyway, bed for me... night folks
nomenkun has joined #ruby
quest88 has quit [Quit: quest88]
<xybre> Nite mdel
jackyalcine_ has joined #ruby
mercwithamouth has quit [Ping timeout: 248 seconds]
tomzx_mac_ has quit [Ping timeout: 245 seconds]
<postmodern> mdel, it uses the same PATH/GEM_HOME techniques from chruby, so it should work with rvm/rbenv
<postmodern> mdel, chruby is an ultra-minimal alternative to rbenv
nomenkun has quit [Ping timeout: 245 seconds]
<postmodern> mdel, if you just want to switch between Rubies, nothing else
arya has quit [Ping timeout: 248 seconds]
joeycarmello has quit [Remote host closed the connection]
Xeago has joined #ruby
r0bby has quit [Ping timeout: 248 seconds]
sayan has joined #ruby
arya has joined #ruby
Jacky has joined #ruby
Jacky has joined #ruby
Jacky has quit [Changing host]
lolmaus has joined #ruby
Xeago has quit [Remote host closed the connection]
jackyalcine_ has quit [Read error: Operation timed out]
slainer68 has joined #ruby
r0bby has joined #ruby
caleb_io has quit [Quit: caleb_io]
krainboltgreene has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
CrawfordComeaux has joined #ruby
<xybre> postmodern: what does chgems do? Basically gemsets?
JumpMast3r has quit [Quit: JumpMast3r]
<postmodern> xybre, basically, but uses $PWD/.gem/$ruby/$version
<postmodern> xybre, so when your done with the project, just rm -rf it
<postmodern> xybre, i often forgot about my rvm gemsets
<xybre> Ahh, nice
<xybre> Yeah same
robustus has quit [Ping timeout: 276 seconds]
<xybre> It's sort of hacky but I end up imploding rvm once in a while to clean everything up :/
robustus has joined #ruby
slainer68 has quit [Ping timeout: 260 seconds]
timonv has quit [Remote host closed the connection]
<postmodern> xybre, i have a very OCD setup
osaut has quit [Quit: osaut]
caleb_io has joined #ruby
timonv has joined #ruby
_adeponte has joined #ruby
<postmodern> xybre, rubies are installed into /opt/rubies, source is kept in /usr/local/src, and i run gem clean
adeponte has quit [Read error: Connection reset by peer]
dmiller has joined #ruby
<postmodern> xybre, an rm -rf the old Rubies
MattRB has quit [Quit: This computer has gone to sleep]
<xybre> I'd rather have to implode rvm or uninstall all gems with a script once in a while than deal with running extra commands every time I want to do something.
<xybre> chgem sounds kind of nice though. rbenv doesn't.
vlad_starkov has joined #ruby
bel3atar has joined #ruby
zommi has joined #ruby
dmiller has quit [Ping timeout: 252 seconds]
timonv has quit [Ping timeout: 252 seconds]
EPIK has quit [Ping timeout: 252 seconds]
pyro111 has joined #ruby
whowantstolivefo has joined #ruby
<shevy> hmm I have methods like this:
<shevy> def foo_do_this()
<shevy> now I have a string, called "do_this"
<shevy> what would be an elegant way to call the method "foo" + "do_this" ?
<shevy> my current solution uses self.send
dnyy has quit [Remote host closed the connection]
<shevy> but I dont feel too confident with that
bel3atar has quit [Ping timeout: 245 seconds]
Veejay has left #ruby ["WeeChat 0.3.0"]
<cirwin> where does that string come from?
dnyy has joined #ruby
ChampS666 has joined #ruby
mdel has quit [Remote host closed the connection]
blaxter has joined #ruby
<shevy> cirwin hmm. I read in those strings from .rb files from a directory, for instance: if I have files like lala.rb and lolo.rb, the strings are collected in array ["lala","lolo"]
jonahR has quit [Quit: jonahR]
<shevy> those files each have one method only
<cirwin> I see
<cirwin> send seems fine to me
<shevy> so lala.rb has a method called: action_read_file() (the lala.rb file is actually called read_file.rb :)
<shevy> ok cirwin
dnyy has quit [Read error: No route to host]
<cirwin> that's very similar to how ruby loads dynamic C libraries
TomyLobo has joined #ruby
jrhorn424 has quit [Quit: jrhorn424]
dnyy has joined #ruby
blacktulip has joined #ruby
mercwithamouth has joined #ruby
zigomir has joined #ruby
jrhorn424 has joined #ruby
jrhorn424 has quit [Client Quit]
cha1tanya has quit [Quit: Leaving]
cobragoat has quit [Remote host closed the connection]
mpfundstein has quit [Quit: Lost terminal]
yugui is now known as yugui_zzz
emergion has joined #ruby
Jacky has quit [Remote host closed the connection]
Jacky has joined #ruby
r0bby has quit [Ping timeout: 248 seconds]
mercwithamouth has quit [Ping timeout: 256 seconds]
mockra has quit [Remote host closed the connection]
r0bby has joined #ruby
mercwithamouth has joined #ruby
MattRB has joined #ruby
az7ar has quit [Quit: Leaving]
bigkevmcd has joined #ruby
Jacky has quit [Read error: Connection reset by peer]
cableray has quit [Ping timeout: 260 seconds]
aganov has joined #ruby
MattRB has quit [Client Quit]
tonini has joined #ruby
Jacky_ has joined #ruby
emergion has quit [Quit: Computer has gone to sleep.]
mercwithamouth has quit [Ping timeout: 256 seconds]
jds has joined #ruby
chussenot has joined #ruby
dnyy has quit [Remote host closed the connection]
Jacky_ has quit [Ping timeout: 245 seconds]
Hanmac has joined #ruby
caleb_io has quit [Quit: caleb_io]
TheFuzzball has joined #ruby
guns has joined #ruby
clocKwize has joined #ruby
zph has joined #ruby
emergion has joined #ruby
filipe has joined #ruby
razibog has joined #ruby
gregorg has quit [Quit: Quitte]
emergion has quit [Client Quit]
mafolz has joined #ruby
emergion has joined #ruby
andrewhl has quit [Remote host closed the connection]
eldariof has joined #ruby
noyb has quit [Ping timeout: 248 seconds]
joschi has joined #ruby
cibs has joined #ruby
r0bby has quit [Ping timeout: 255 seconds]
osaut has joined #ruby
wallerdev has quit [Quit: wallerdev]
nomenkun has joined #ruby
karasawa has quit [Ping timeout: 240 seconds]
karasawa has joined #ruby
threecreepio has quit [Quit: threecreepio]
slainer68 has joined #ruby
arkiver has quit [Ping timeout: 245 seconds]
mockra has joined #ruby
sayan has quit [Ping timeout: 245 seconds]
hamed_r has joined #ruby
joeycarmello has joined #ruby
lkba has quit [Ping timeout: 255 seconds]
generalissimo has quit [Remote host closed the connection]
Axsuul has quit [Ping timeout: 240 seconds]
slainer68 has quit [Ping timeout: 252 seconds]
fteem has joined #ruby
nari has quit [Ping timeout: 260 seconds]
_adeponte has quit [Remote host closed the connection]
xpen has joined #ruby
timonv has joined #ruby
joeycarmello has quit [Ping timeout: 245 seconds]
agarie has joined #ruby
TomyLobo has quit [Quit: Standby mode...]
jgrevich has quit [Quit: jgrevich]
aloshkarev has joined #ruby
_br_ has quit [Excess Flood]
rakl has joined #ruby
jblack has quit [Ping timeout: 240 seconds]
io_syl has quit [Quit: Computer has gone to sleep.]
aloshkarev has quit [Client Quit]
_br_ has joined #ruby
mahmoudimus has quit [Remote host closed the connection]
main has quit [Ping timeout: 248 seconds]
_br_ has quit [Excess Flood]
mahmoudimus has joined #ruby
banisterfiend has quit [Remote host closed the connection]
banisterfiend has joined #ruby
agarie has quit [Remote host closed the connection]
mockra has quit [Ping timeout: 245 seconds]
banisterfiend has quit [Read error: Connection reset by peer]
_br_ has joined #ruby
banisterfiend has joined #ruby
zph has quit [Quit: Computer has gone to sleep.]
_br_ has quit [Excess Flood]
r0bby has joined #ruby
jduan1981 has quit [Quit: jduan1981]
_br_ has joined #ruby
AwayLex is now known as Quadlex
piotr_ has joined #ruby
dwn has joined #ruby
dwn has quit [Write error: Broken pipe]
_br_ has quit [Excess Flood]
r0bby has quit [Ping timeout: 256 seconds]
sayan has joined #ruby
nomenkun_ has joined #ruby
emergion has quit [Quit: Computer has gone to sleep.]
dwn has joined #ruby
elaptics`away is now known as elaptics
bel3atar has joined #ruby
_br_ has joined #ruby
cirwin has quit [Quit: Leaving.]
nomenkun has quit [Ping timeout: 252 seconds]
_br_ has quit [Excess Flood]
maxmanders has joined #ruby
cobragoat has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
_br_ has joined #ruby
maxmanders has quit [Client Quit]
hoelzro|away is now known as hoelzro
f03lipe has quit [Quit: Leaving]
_br_ has quit [Excess Flood]
cakehero has quit [Ping timeout: 248 seconds]
cobragoat has quit [Ping timeout: 260 seconds]
aaronmacy has joined #ruby
hoelzro is now known as hoelzro|away
guns has quit [Quit: guns]
_br_ has joined #ruby
a_a_g has quit [Read error: Connection reset by peer]
marr has joined #ruby
a_a_g has joined #ruby
dhruvasagar has joined #ruby
maxmanders has joined #ruby
ChampS666 has quit [Ping timeout: 252 seconds]
_br_ has quit [Excess Flood]
BizarreCake has joined #ruby
_br_ has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
Xeago has joined #ruby
dwu1 has quit [Quit: Leaving.]
RagingDave has joined #ruby
arya has quit [Ping timeout: 248 seconds]
gyre008 has joined #ruby
_br_ has quit [Excess Flood]
sporkbomb has quit [Read error: Connection reset by peer]
sporkbomb has joined #ruby
malte__ has joined #ruby
noyb has joined #ruby
arya has joined #ruby
jimeh has joined #ruby
serhart has quit [Quit: Leaving.]
malte_ has quit [Read error: Operation timed out]
malte__ is now known as malte_
_br_ has joined #ruby
_br_ has quit [Excess Flood]
arya_ has joined #ruby
timonv has quit [Read error: Connection reset by peer]
mikecmpbll has joined #ruby
timonv_ has joined #ruby
arya has quit [Ping timeout: 248 seconds]
love_color_text has quit [Remote host closed the connection]
haxrbyte has joined #ruby
reinaldob has joined #ruby
havenn has joined #ruby
_br_ has joined #ruby
pjb-d has joined #ruby
pjb-d is now known as ogamita
haxrbyte_ has quit [Ping timeout: 252 seconds]
jds has quit [Remote host closed the connection]
cdt has joined #ruby
lemonsparrow has joined #ruby
<lemonsparrow> any better way of doing this ? https://gist.github.com/4584796
nfk has joined #ruby
adambeynon has joined #ruby
arkiver has joined #ruby
main has joined #ruby
<pyro111> map + join
Kakera has joined #ruby
<havenn> ["apple", "mango"].map(&:pluralize).join(', ')
mahmoudimus has joined #ruby
taoru has joined #ruby
arya_ has quit [Ping timeout: 248 seconds]
ephemerian has joined #ruby
pyro111 has quit [Quit: Leaving]
drfreeze has joined #ruby
mockra has joined #ruby
<Hanmac> what happend when you compare apples with pears? does it result in a segfault or in a copyright violation? :D
slainer68 has joined #ruby
Vainoharhainen has joined #ruby
arya has joined #ruby
drfreeze_ has quit [Ping timeout: 252 seconds]
slainer68 has quit [Remote host closed the connection]
malte_ has quit [Quit: malte_]
mockra has quit [Ping timeout: 244 seconds]
slainer68 has joined #ruby
horofox has joined #ruby
Virunga has joined #ruby
emergion has joined #ruby
<tobiasvl> comparing apples and oranges should raise an exception, at least
jinzhu has quit [Quit: leaving]
gyre008 has quit [Remote host closed the connection]
jinzhu has joined #ruby
mneorr has quit [Remote host closed the connection]
cha1tanya has joined #ruby
cha1tanya has quit [Changing host]
cha1tanya has joined #ruby
<heftig> tobiasvl: except a test for equality, which would be false
timonv has joined #ruby
<heftig> but you can't order them by quality (which i guess is what's meant by "Comparing apples and oranges")
timonv_ has quit [Ping timeout: 260 seconds]
rdark has joined #ruby
Dakuan has joined #ruby
caleb_io has joined #ruby
<tobiasvl> hehehe
Criztian has joined #ruby
JonnieCache has quit [Quit: Reconnecting]
JonnieCache has joined #ruby
arietis has joined #ruby
timonv has quit [Read error: Connection reset by peer]
timonv_ has joined #ruby
arturaz has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
mneorr has joined #ruby
timonv_ has quit [Read error: Connection reset by peer]
timonv has joined #ruby
arya has quit [Ping timeout: 248 seconds]
caleb_io has quit [Quit: caleb_io]
samuel02 has joined #ruby
arietis has quit [Quit: Computer has gone to sleep.]
Xeago has quit [Remote host closed the connection]
havenn has quit [Remote host closed the connection]
<workmad3> heftig: so the <=> operator would throw an exception ;)
havenn has joined #ruby
Rydefalk has quit [Read error: Connection reset by peer]
clj_newb has quit [Ping timeout: 256 seconds]
Xeago has joined #ruby
Rydefalk has joined #ruby
Xeago has quit [Remote host closed the connection]
havenn has quit [Ping timeout: 248 seconds]
Xeago has joined #ruby
bcx has quit [Quit: Leaving.]
r0bby has joined #ruby
horofox has quit [Quit: horofox]
yshh has quit [Remote host closed the connection]
karasawa has quit [Ping timeout: 252 seconds]
Dakuan has quit [Remote host closed the connection]
karasawa has joined #ruby
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
hoelzro|away is now known as hoelzro
beiter has joined #ruby
adkron has quit [Ping timeout: 244 seconds]
tcurdt has joined #ruby
tatsuya_o has joined #ruby
tcurdt has quit [Client Quit]
Dakuan has joined #ruby
adkron has joined #ruby
r0bby has quit [Ping timeout: 245 seconds]
berserkr has joined #ruby
f0ster has quit [Ping timeout: 240 seconds]
Dakuan has quit [Remote host closed the connection]
gyre007 has joined #ruby
kinmor06 has joined #ruby
nkr has joined #ruby
timmow has joined #ruby
arya has joined #ruby
emocakes has joined #ruby
jds_ has joined #ruby
kinmor06 has quit [Quit: Leaving]
kinmor06 has joined #ruby
arya has quit [Ping timeout: 256 seconds]
arietis has joined #ruby
jinzhu has quit [Ping timeout: 248 seconds]
CrawfordComeaux has quit [Ping timeout: 256 seconds]
arya has joined #ruby
jds_ has quit [Ping timeout: 240 seconds]
mockra has joined #ruby
fyolnish has quit [Ping timeout: 244 seconds]
plantseeker has joined #ruby
niklasb has joined #ruby
jwang has quit [Quit: Leaving]
Raboo has joined #ruby
nkr has quit [Ping timeout: 248 seconds]
aaronmacy has quit [Quit: Leaving.]
lkba has joined #ruby
Raboo_ has quit [Ping timeout: 256 seconds]
mockra has quit [Ping timeout: 260 seconds]
hotovson_ has joined #ruby
patrikf has joined #ruby
eykosioux_ has joined #ruby
haxrbyte_ has joined #ruby
arietis has quit [Quit: Computer has gone to sleep.]
Raboo has quit [Ping timeout: 252 seconds]
<jokke> hi! Does Hash have a function to find the biggest/smallest value?
Raboo has joined #ruby
<jokke> heftig: oh, you're here too? :)
haxrbyt__ has joined #ruby
<patrikf> I'd like to catch signals in my program and act on them, synchronously. now as far as I can see, I have three options: 1) use trap and throw/catch; 2) use trap and raise/rescue with custom exception classes; 3) use raise/rescue on SignalException and check for the signal name/number. this all seems pretty clumsy, isn't there a more elegant way to do this?
RagingDave has quit [Quit: Ex-Chat]
<heftig> jokke: min/max by value
noxoc has joined #ruby
<patrikf> jokke: you can use h.values.max, but that will iterate all the values => O(n), but it would be easy to sublass Hash to do that in O(1)
<heftig> jokke: ah, no, hang on, it just converts the hash into an array of arrays and gets you the min/max of that
haxrbyte has quit [Ping timeout: 252 seconds]
<JonnieCache> with a binary search or something?
<patrikf> binary search somehow contradicts the structure of a hashtable
<heftig> patrikf: subclass and do what?
haxrbyte_ has quit [Ping timeout: 248 seconds]
<JonnieCache> patrikf: i meant binary search the list of values
<workmad3> JonnieCache: you'd need to sort that list first
<patrikf> JonnieCache: how would binary search work on unsorted lists?
<patrikf> (besides, once it is sorted, you don't need binary search...)
<workmad3> heh :)
<patrikf> heftig: keep track of the current min/max in a variable... but that will only work if you don't ever remove items
<patrikf> on every insert = assignment, i mean
<jokke> patrikf: how on earth would it be able to sort anything in O(1)?
<heftig> jokke: hash.max_by(&:last), hash.min_by(&:last), and hash.minmax_by(&:last)
matthias_ has joined #ruby
stigmux is now known as oles
<workmad3> jokke: he means an amortised O(1) because the calculation of min/max is done on hash assignment
Azure has quit [Ping timeout: 272 seconds]
<JonnieCache> youre right of course
<JonnieCache> its too early on monday for me to be thinking about data structures
haxrbyte has joined #ruby
<jokke> okay you lost me :)
tonini has quit [Remote host closed the connection]
<jokke> heftig: so your suggestion works faster than hash.values.max/min?
nkts has joined #ruby
<workmad3> jokke: on assignment, you track if the new value is > current max or < current min, and keep track of the max/min of the hash
<jokke> oh okay
<heftig> jokke: basically the same, but gets you a key-value pair
<jokke> makes sens
<jokke> e
<workmad3> jokke: so hsh.max and hsh.min become O(1) lookups, because the cost of calculating the actual value was amortised into the assignment
<jokke> i get it now thanks
<workmad3> :)
<jokke> hm
karasawa has quit [Ping timeout: 257 seconds]
<jokke> might be worth it
<workmad3> it is problematic wrt to deletions, if they occur though
<heftig> it does a schwartzian transform, which is probably more expensive. it's not a bigger O, though
nomenkun has joined #ruby
nomenkun_ has quit [Read error: Connection reset by peer]
<jokke> workmad3: no deletions
haxrbyt__ has quit [Ping timeout: 252 seconds]
<workmad3> it's also only going to give you a min/max within a single (or preset range of) comparators
<workmad3> if you need to be able to specify an arbitrary comparator, you're going to need to do more work
<jokke> nah
<jokke> just integers
Elhu has joined #ruby
<workmad3> right, nice and easy then :)
<jokke> i'm starting to love ruby
<workmad3> hmmm
<patrikf> the question really is, do you fill the hash map, then need min/max once, or do you need min/max multiple times, possibly with insertions in-between
<jokke> it's my first "project". I'm writing a cache simulator
* workmad3 wonders if a sort of an array of integers in ruby does a bucket sort, or if you'd need to do that manually
karasawa has joined #ruby
<jokke> patrikf: i'm filling the hash map gradually and use max multiple times
<jokke> s/map//
<patrikf> right. well if you're the one inserting into the hash, then you might just keep track of the max there, without subclassing
<jokke> mh true
<jokke> it looks cleaner though if i subclass it
<jokke> won't have as many variables
<workmad3> I usually don't suggest subclassing hash or array... I've seen oddities from doing so
<patrikf> (or just use .values.max if the hash isn't huge and you don't need every millisecond :))
<jokke> i just realized i just need the max once
<workmad3> hehe
<jokke> so i'll stick with hash.values.max
<workmad3> sounds good :)
pcarrier has quit []
<jokke> stupid question i know... but how do i add a key value pair to an existing hash?
<kinmor06> hash.merge!({:k=> v})
<workmad3> kinmor06: haha
<hoelzro> or hash[:k] = v
<workmad3> ^^
<jokke> nice
<jokke> thaks
<jokke> *thanks
cha1tanya has quit [Quit: Leaving]
<kinmor06> @workmad3 : yup haha
iml has quit [Remote host closed the connection]
<kinmor06> quick question, any good books for advanced ruby topics?
<tobiasvl> hmm, why doesn't Hash have << ?
<hoelzro> tobiasvl: because it's not appending?
<hoelzro> what would h << something mean?
* hoelzro is biased and hates the << syntax
haxrbyte has quit [Ping timeout: 244 seconds]
<workmad3> :)
matthias_ has quit [Remote host closed the connection]
Morkel has joined #ruby
<tobiasvl> it would mean "shovel this into h", like everywhere else ;)
eykosioux_ has quit [Read error: Connection reset by peer]
<tobiasvl> (it's not really an append operator any longer, is it)
<hoelzro> tobiasvl: so if I do h << something, does something become a key? a value? both?
<kinmor06> hoelzro: even for a string?
eykosioux_ has joined #ruby
eykosioux_ has quit [Client Quit]
<hoelzro> >> puts 'foo' << 'bar'
<eval-in> hoelzro: Output: "foobar\n" (http://eval.in/7117)
<tobiasvl> hoelzro: h << {:a => 2} would obviously be the syntax
<hoelzro> sure enough.
<tobiasvl> a hash << a hash
<hoelzro> tobiasvl: ok, that makes some sense
<kinmor06> but that won't work right?
elkclone has quit [Remote host closed the connection]
Dakuan has joined #ruby
elkclone has joined #ruby
<kinmor06> nvm me i just woke up and don't read sentences properly :(
<hoelzro> kinmor06: not currently
<hoelzro> we're just talking about it =)
<kinmor06> yeah haha
arkiver has quit [Remote host closed the connection]
<kinmor06> my mind and fingers aren't synced yet
<hoelzro> =)
<jokke> the order in which each iterates an array is fixed, right?
<jokke> from index 0 to length -1, right?
<jokke> :P
radosch has joined #ruby
<jokke> just checking :)
mikecmpbll has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<Hanmac> >> class Hash; alias << update;end; p({:a => 1} << {:b => 2} << {:c => 3})
<eval-in> Hanmac: Output: "{:a=>1, :b=>2, :c=>3}\n" (http://eval.in/7119)
<tobiasvl> :)
Su-Shee has quit [Ping timeout: 246 seconds]
<whowantstolivefo> what can be wrong in my code ? https://gist.github.com/4585337
<tobiasvl> jokke: yes.
<tobiasvl> jokke: what you mean to ask is "are arrays sorted?" and yes, yes they are
<jokke> well, yes i guess that's what i meant
<jokke> wow... i'm amazed.. i can do variable.nil?
<gyre007> what is the best gem for passing command line switches to simple ruby scripts ?
<jokke> how does that even work??
Su-Shee has joined #ruby
<Hanmac> whowantstolivefo: its the capitalize! methods ... they return nil if nothing is changed ... use the method without the !
<gyre007> trollop ?
<whowantstolivefo> Hanmac: i follow this http://www.codecademy.com/courses/ruby-beginner-en-MxXx5/0#!/exercises/5 tutorial and it says so ?
<tobiasvl> jokke: what do you mean?
timonv has quit [Read error: Connection reset by peer]
<tobiasvl> how does .nil? work?
<jokke> if something is nil, how can you call a function on it..? http://i.imgur.com/UmpOi.gif
timonv has joined #ruby
<tobiasvl> nil is an object ;)
larissa has joined #ruby
<jokke> awesome
<tobiasvl> in ruby, everything is an object
<tobiasvl> absolutely everything
<jokke> i want to marry ruby
<tobiasvl> :)
<Hanmac> jokke & tobiasvl even the space BETWEEN objects is an object :D
<tobiasvl> hehe
<Hanmac> look at ObjectSpace :P
<tobiasvl> ALL OF TIME AND SPACE AND THE SPACE OUTSIDE OF SPACE WHERE DOES IT END
<workmad3> whowantstolivefo: try reading the description fully ;)
<whowantstolivefo> workmad3: i didnt figure out this part >>> Here's another handy trick. When you call something like .capitalize on a string, you're not capitalizing that exact string; Ruby makes a copy of the string, capitalizes that, and that's what it returns. If you want to capitalize the string you've already got, though, you can make one small change: add a ! to the end of the method name. .capitalize! capitalizes the string in-place instead of making a copy. The
<whowantstolivefo> original non-capitalized string is gone forever, but now you have your shiny new capitalized one in its place. <<<<
<jokke> tobiasvl: it ends with the first gif i pasted.. :)
<workmad3> whowantstolivefo: well, that pretty much explains what happens
<workmad3> whowantstolivefo: and I was meaning that you should go back and re-read what you're being asked to do
xpen has quit [Remote host closed the connection]
ExxKA has joined #ruby
arya has quit [Ping timeout: 252 seconds]
rakl has quit [Quit: sleeping]
<whowantstolivefo> workmad3: ok i will read more and try to understand, if i cant fix, i'll keep disturbing you
<jokke> um.. array.max gives me the highest value in an array, but how can i determine the index of the highest value?
<jokke> as in the first index
samuel02 has quit [Remote host closed the connection]
<jokke> for example: [3, 2, 5, 1].somemaxindexfunction would return 2
<jokke> and [3, 2, 5, 5, 1] also
<kinmor06> arr.index(arr.max)
<jokke> ah ok
<jokke> thanks
mneorr has quit [Remote host closed the connection]
<jokke> bear with me, i'm a complete ruby noob. :/
samphippen has joined #ruby
<kinmor06> bear with me also. i don't read sentences properly now haha
<heftig> jokke: that does a linear search for the max value
<jokke> heftig: yeah. but i only do it once
arya has joined #ruby
nkr has joined #ruby
Su-Shee has left #ruby [#ruby]
jinzhu has joined #ruby
mockra has joined #ruby
<kinmor06> question, suppose i have a paragraph and I want to get the list of words and number times it existed in that paragraph. what's the best way to do it?
`brendan has quit [Quit: - nbs-irc 2.39 - www.nbs-irc.net -]
<kinmor06> don't want to do multiple loops
<jokke> hmm.. i get "possibly useless use of + in void context..
<jokke> s/../"../
<kinmor06> i got string.split.each{|h| hash[h] = string.split.count(h) }
<jokke> in this line: hash["age"] = 0
<kinmor06> but i think there's a cleaner way
mockra has quit [Ping timeout: 260 seconds]
<jokke> and void value expression in another line
<jokke> there's only end
<tobiasvl> jokke: why are you using a string as a key? better to use a symbol
beiter has quit [Quit: beiter]
atno has joined #ruby
<jokke> tobiasvl: oh, you're right
<jokke> :age, right?
BulleTime has joined #ruby
<heftig> kinmor06: "foo bar baz qux bar baz foo".split.group_by { |x| x }.map { |k,v| [k,v.count] }
<Muz> There's something to be said about readability at this point.
<tobiasvl> jokke: yeah, that's preferred
<jokke> hm maybe i should paste the whole thing..
dhruvasagar has quit [Ping timeout: 248 seconds]
<jokke> maybe ruby doesn't like ++?
arkiver has joined #ruby
<tobiasvl> and the exception?
<jokke> um, that's just vim
slainer68 has quit [Remote host closed the connection]
<jokke> with syntastic
samphippen has quit [Quit: Computer has gone to sleep.]
<tobiasvl> yeah, but i'd like to see the exception
<tobiasvl> in order to help you
<jokke> how?
<jokke> i just execute it
<jokke> ?
<heftig> jokke: there's no ++
<jokke> ./cache-sim.rb:63: void value expression
<jokke> ./cache-sim.rb:75: syntax error, unexpected keyword_end
<jokke> heftig: there's not?
<heftig> nope
<jokke> ...
<jokke> why?
tk_ has joined #ruby
<heftig> use += 1
<jokke> thanks tobiasvl
carloslopes has joined #ruby
eykosioux_ has joined #ruby
<jokke> alright
slainer68 has joined #ruby
krz has quit [Quit: krz]
<whowantstolivefo> workmad3: it worked. but i didnt understand well this part of my tutorial
eka has joined #ruby
eka is now known as Guest10992
sea_wolf has joined #ruby
p2w has joined #ruby
can0n has joined #ruby
fyolnish has joined #ruby
samphippen has joined #ruby
noyb has quit [Ping timeout: 245 seconds]
<JonnieCache> github is banned in china
<kinmor06> heftig: thanks. i also did string.split.sort.each {|l| hash[l] ||=0; hash[l] += 1 } and wondered what the hell am i doing
<JonnieCache> fail
fyolnish has quit [Remote host closed the connection]
fyolnish has joined #ruby
apeiros_ has joined #ruby
tPl0ch has joined #ruby
[Neurotic] has quit [Remote host closed the connection]
eykosioux_ has quit [Quit: eykosioux_]
chussenot has quit [Quit: chussenot]
lemonsparrow has quit [Quit: Page closed]
jenrzzz has joined #ruby
arya has quit [Ping timeout: 246 seconds]
Takehiro has joined #ruby
<kinmor06> i don't even know i put .sort on that >.<
Guest10992 has quit [Remote host closed the connection]
tPl0ch has quit [Quit: Verlassend]
bel3atar has quit [Quit: ZNC - http://znc.sourceforge.net]
slainer68 has quit [Remote host closed the connection]
slainer68 has joined #ruby
nkts has quit [Remote host closed the connection]
arya has joined #ruby
horofox has joined #ruby
sh00p has joined #ruby
Virunga has quit [Remote host closed the connection]
tPl0ch has joined #ruby
<sh00p> how would I go about executing a system("..cmd..") that contains double and single quotes?
hotovson_ has quit [Ping timeout: 245 seconds]
<sh00p> such as this:
<sh00p> def run_tests
<sh00p> system(ssh -n -f fredriki@jenkins "sh -c 'cd /home/fredriki/synched/tests/integration; nohup mvn install -Pprivate-synch > /dev/null 2>&1 &'")
<sh00p> end
<sh00p> there omitting the first two double quoets
<tobiasvl> sh00p: you should use %x( ... )
<tobiasvl> instead of `system`, that is
<tobiasvl> that way you don't have to think about the quotes at all
hotovson has joined #ruby
<apeiros_> sh00p: if you can, use multiple arguments anyway
<sh00p> i need the return code though
<apeiros_> system('ssh', '-n', '-f', …)
<tobiasvl> %x returns the return code
<sh00p> k sweet
<apeiros_> tobiasvl: no, %x returns the output
<apeiros_> you can get the return code through $?
<yfeldblum> sh00p, might think about using net/ssh for this
<tobiasvl> apeiros_: oh really
<apeiros_> also ^
<tobiasvl> okay, sorry
<sh00p> thanks everybody, gonna run through the ideas
<kinmor06> what about using backticks?
<apeiros_> backticks & %x are the same
<patrikf> sh00p: you can also use %q#abc# instead of 'abc' (replace # with a character of your choice)
<apeiros_> %{"hello cruel world", it's what she said}
<kinmor06> ah yup. just a shorthsand for %x
Spooner has joined #ruby
ikonia has left #ruby [#ruby]
karasawa has quit [Ping timeout: 248 seconds]
<kinmor06> late reply is late
karasawa has joined #ruby
marsam has joined #ruby
horofox has quit [Remote host closed the connection]
mengu has joined #ruby
marsam has quit [Client Quit]
jenrzzz has quit [Ping timeout: 248 seconds]
solitude88 has joined #ruby
horofox has joined #ruby
stayarrr has quit [Ping timeout: 260 seconds]
<jokke> hm.. why do i get ./cache-sim.rb:31:in `<main>': undefined method `exist?' for #<File:Traces/gcc.trc> (NoMethodError)
<jokke> do i have to require something?
Dakuan has quit [Remote host closed the connection]
<jokke> here's the code:
Dakuan has joined #ruby
can0n has quit [Quit: Leaving]
arya has quit [Ping timeout: 255 seconds]
<Spooner> jokke, It is File.exist? you are trying to check if an IO stream, not the file itself exists.
bel3atar has joined #ruby
<jokke> oh
<jokke> okay
<jokke> how do i check the file?
<tobiasvl> File.exists?(file_name)
<jokke> ah
<jokke> alright
<jokke> thanks
<Spooner> jokke, Should be unless File.exists? filename; usage; exit; end then open the file.
tonini has joined #ruby
<tobiasvl> yeah, if followed by a ! is pretty unreadable :)
<Hanmac> PS: File.new is often not nice ...
<jokke> ..?
<jokke> i'm confused?
<jokke> s/?//
<Spooner> jokke, Should use File.open(...) do |file| sim.process(file); end
<Spooner> You never close the file, you see.
<Spooner> Block open closes it automagically for you.
jenrzzz has joined #ruby
Dakuan has quit [Ping timeout: 245 seconds]
nkts has joined #ruby
<jokke> Spooner: ah okay nice
eka108 has joined #ruby
yacks has joined #ruby
arya has joined #ruby
ExxKA has quit [Quit: This computer has gone to sleep]
yshh has joined #ruby
<Spooner> I'd also recommend using a options parser (e.g. Slop) rather than messing with your own parsing.
<Spooner> Although you aren't using options, admittedly, but they might make more sense for you. I dunno.
az7ar has joined #ruby
BulleTime has quit [Ping timeout: 256 seconds]
<az7ar> hi
bel3atar has quit [Quit: ZNC - http://znc.sourceforge.net]
slainer68 has quit [Remote host closed the connection]
<az7ar> can anyone please suggest how I can do things like this -> 20! and the result would be 40
<tobiasvl> ?
<Spooner> az7ar, Why would the result be 40?
<az7ar> no reason just for experiment
<az7ar> like get factorial 5 using 5!
<tobiasvl> az7ar: how on earth can we tell you how to make that without you describing what it is
bel3atar has joined #ruby
<tobiasvl> well the factorial of 20 isn't 40
warb0 has joined #ruby
uris has joined #ruby
mockra has joined #ruby
<Spooner> az7ar, Simple answer is that you can't in Ruby. You can do 5.factorial, since numbers are objects, but you can't just add syntax willy nilly!
jenrzzz has quit [Ping timeout: 245 seconds]
eka108 has quit [Remote host closed the connection]
<az7ar> Spooner, thnx, I did 5.factorial and was searching if that could be done
matthias_ has joined #ruby
<az7ar> or !5 #=> 120 .. no luck with 5!
<az7ar> I could do !5
pcarrier has joined #ruby
pcarrier has quit [Client Quit]
<Spooner> Yes, but then you are fundamentally changing expected behaviour, not adding new.
pcarrier has joined #ruby
mockra has quit [Ping timeout: 248 seconds]
<az7ar> Spooner, yeah I know, just playing around
jeffreybaird has joined #ruby
Azure has joined #ruby
haxrbyte has joined #ruby
<Hanmac> az7ar do you know the difference between "-5" and "- 5" ?
<az7ar> yes
<az7ar> I think I do
<clocKwize> guys, anyone know how to print messages to the console after my gem has been bundled
pcarrier has quit [Ping timeout: 246 seconds]
<az7ar> or I guess I dont, because I can change the -5 behavior but I dont know how to change "- 5"
<Hanmac> otherwise, you can change - 5 but you cant change -5
elkclone has quit [Quit: It's never too late to unplug and run.]
Azure has quit [Ping timeout: 248 seconds]
pcarrier has joined #ruby
<az7ar> Hanmac, whats the difference ?
matthias_ has quit []
<Hanmac> >> p defined?(-5), defined?(- 5)
<eval-in> Hanmac: Output: "\"expression\"\n\"method\"\n" (http://eval.in/7127)
tonini has quit [Remote host closed the connection]
<banisterfiend> az7ar: you can probably use a unicode char taht looks like !
<banisterfiend> az7ar: and do something like: 5.!
<Hanmac> first is an expression, last one is a method named -@
coder_neo has joined #ruby
<hoelzro> or just stick with 5.factorial ;)
<az7ar> thnx
sepp2k has joined #ruby
a_a_g has quit [Quit: Leaving.]
<az7ar> thnx everyone
az7ar has quit [Quit: Leaving]
arya has quit [Ping timeout: 256 seconds]
mikecmpbll has joined #ruby
jeffreybaird has quit [Quit: jeffreybaird]
Dakuan has joined #ruby
arya has joined #ruby
Azure has joined #ruby
grzywacz has joined #ruby
grzywacz has quit [Changing host]
grzywacz has joined #ruby
charliesome has quit [Quit: Textual IRC Client: www.textualapp.com]
xemu has joined #ruby
Spooner has quit [Remote host closed the connection]
slainer68 has joined #ruby
jeffsmykil has joined #ruby
kpshek has joined #ruby
<jeffsmykil> I have this ternary operator which isn't working and I'm not sure why.
<jeffsmykil> still learning sorry if it's obvious
Virunga has joined #ruby
Azure has quit [Ping timeout: 260 seconds]
dhruvasagar has joined #ruby
<banisterfiend> jeffsmykil: IMO you shouldn't use ?: (ternary) for destructive operations
<hoelzro> jeffsmykil: you probably want file.puts(patient_location != "null" ? "\"PatientLocation\" : #{patient_location}," : \"PatientLocation\" : null,")
<banisterfiend> you should just use it for what it evaluates to
<hoelzro> and if you're using JSON, you should probably just use a JSON serializer
<JonnieCache> yaaaaaawn
Dakuan has quit [Remote host closed the connection]
Dakuan has joined #ruby
Dakuan has quit [Read error: Connection reset by peer]
atno has quit [Remote host closed the connection]
<jeffsmykil> I'm creating json
Dakuan has joined #ruby
Criztian has quit [Ping timeout: 240 seconds]
BulleTime has joined #ruby
spacemud has joined #ruby
<jeffsmykil> hoelzro: if there is a better way to do this I'm all ears, basically I use ruby to create dummy json objects so i can code the front end before the back end is done
Takehiro has quit [Remote host closed the connection]
<hoelzro> jeffsmykil: well, I would just use the json library
<jeffsmykil> i didn't know there was one
Criztian has joined #ruby
arya has quit [Ping timeout: 260 seconds]
<jeffsmykil> do i have to install this or is this in 1.9,3?
<Hanmac> jeffsmykil depending on your ruby version you may need the json gem
<Hanmac> it is in 1.9 but it is not in 1.8
<hoelzro> jeffsmykil: it's included in 1.9.3
elico has joined #ruby
<jeffsmykil> also hoelzro it wants an end in that statement you gave me
<hoelzro> serious?
<hoelzro> >> patient_location = 'here' ; puts(patient_location != "null" ? "\"PatientLocation\" : #{patient_location}," : \"PatientLocation\" : null,")
<eval-in> hoelzro: Output: "/tmp/execpad-b9c0e9708678/source-b9c0e9708678:1: syntax error, unexpected $undefined\n...\\\" : \#{patient_location},\" : \\\"PatientLocation\\\" : null,\")\n... ^\n/tmp/execpad-b9c0 ..." (http://eval.in/7128)
emergion has quit [Ping timeout: 264 seconds]
taoru has quit [Remote host closed the connection]
<jeffsmykil> i can
ABK has joined #ruby
<hoelzro> >> patient_location = 'here' ; puts (patient_location != "null" ? "\"PatientLocation\" : #{patient_location}," : \"PatientLocation\" : null,")
<eval-in> hoelzro: Output: "/tmp/execpad-f9b2426b3aba/source-f9b2426b3aba:1: syntax error, unexpected $undefined\n...\\\" : \#{patient_location},\" : \\\"PatientLocation\\\" : null,\")\n... ^\n/tmp/execpad-f9b2 ..." (http://eval.in/7129)
* hoelzro shrugs
<jeffsmykil> I can't tell if you are belittling me :/
<hoelzro> no, I'm trying to figure it out =)
<jeffsmykil> oh ok :)
<shevy> jeffsmykil he loves you
<jeffsmykil> I'm used to other channels
<hoelzro> you can come here and feel fairly confident that you won't be belittled =)
<shevy> the sexy channels?
<jeffsmykil> ruby is one of the nicer ones i have been too but i wasn't sure
<jeffsmykil> shevy: CSS is fucking awful
<shevy> hehe
<shevy> XML is worse!
<jeffsmykil> I can't even imagine how bad XML would be
<hoelzro> ah!
<hoelzro> >> patient_location = 'here' ; puts (patient_location != "null" ? "\"PatientLocation\" : #{patient_location}," : "\"PatientLocation\" : null,")
<eval-in> hoelzro: Output: "\"PatientLocation\" : here,\n" (http://eval.in/7130)
<hoelzro> \o/
Spooner has joined #ruby
arya has joined #ruby
<hoelzro> jeffsmykil: if you stick with generating JSON by hand, you can use %Q{...}
emergion has joined #ruby
<hoelzro> >> patient_location = 'here' ; puts %Q{I said, "I am #{patient_location}"}
<eval-in> hoelzro: Output: "I said, \"I am here\"\n" (http://eval.in/7131)
haxrbyte_ has joined #ruby
yogendra has joined #ruby
<jeffsmykil> i couldn't figure out how to return null so i had to return the string null
<jeffsmykil> lol
<jeffsmykil> and then check against it
<shevy> well, nil in ruby
<shevy> :(
<shevy> are you mixing javascript with ruby!
<jeffsmykil> oh, I'm sure I am
<jeffsmykil> i still slip up on elsif
<shevy> hehe
Virunga has quit [Remote host closed the connection]
thisirs has joined #ruby
<jeffsmykil> like I said I use ruby for creating dummy data, I was using apple script for a while
<jeffsmykil> lol
* JonnieCache considers the existance of a css irc channel
<JonnieCache> oh dear
haxrbyte has quit [Ping timeout: 256 seconds]
<Xeago> JonnieCache: what is it you need help with
<jeffsmykil> JonnieCache: I think they are insecure because no one can agree on standards
<Xeago> I am no designer, but I frequently read and study css spec :)
<JonnieCache> i dont actually need help with css fortunately
tPl0ch_ has joined #ruby
<jeffsmykil> so you are a massochist
<JonnieCache> i was just thinking what the channel might be like, based on my experience of the javascript channe;
<Xeago> yuck :3
samphippen has quit [Quit: Computer has gone to sleep.]
<jeffsmykil> luckily the jquery channel is nicer than the javascript one
emergion has quit [Ping timeout: 264 seconds]
r0bby has joined #ruby
BulleTime has quit [Ping timeout: 240 seconds]
Virunga has joined #ruby
kinmor06 has quit [Quit: Leaving]
tPl0ch has quit [Ping timeout: 245 seconds]
<shevy> oh man
<shevy> why cant they use ruby instead
Cooler_ has quit [Read error: Operation timed out]
<jeffsmykil> just wait until typescript gets popular
<jeffsmykil> theres going to be a war
<shevy> typescript?
pyreal has joined #ruby
emergion has joined #ruby
yogendra has quit [Quit: Leaving.]
tPl0ch_ is now known as tPl0ch
<jeffsmykil> microsofts bright idea
<jeffsmykil> write javascript in C#
Dakuan has quit [Remote host closed the connection]
tPl0ch has quit [Client Quit]
tPl0ch has joined #ruby
p2w has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
abionic has joined #ruby
Dakuan has joined #ruby
ABK has quit [Read error: Operation timed out]
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
x0F_ is now known as x0F
elico has quit [Quit: elico]
<Hanmac> its more of an blight idea
joofsh has joined #ruby
<JonnieCache> whats the syntax to build a proc that passes the input to a method?
<JonnieCache> map(&method(:name))
<JonnieCache> ?
<banisterfiend> JonnieCache: exactly
<JonnieCache> hooray
statarb3 has joined #ruby
<JonnieCache> confusing the rest of the team ftw
<jeffsmykil> i thought I was running 1.9.3 hrm
pyro111 has joined #ruby
ABK_ has joined #ruby
arya has quit [Ping timeout: 256 seconds]
horofox has quit [Remote host closed the connection]
mockra has joined #ruby
ABK has joined #ruby
<jeffsmykil> I am running 1.9.3 but I'm getting undefined method to_json
enroxorz-work has joined #ruby
enroxorz-work has quit [Changing host]
enroxorz-work has joined #ruby
hamed_r has quit [Quit: Leaving]
horofox has joined #ruby
jblack has joined #ruby
JohnRedcorn has joined #ruby
JohnRedcorn has quit [Client Quit]
abionic has quit [Ping timeout: 252 seconds]
<hoelzro> jeffsmykil: did you require 'json'?
ABK_ has quit [Ping timeout: 248 seconds]
<jeffsmykil> i thought it was included so i wouldn't have to?
<hoelzro> it's in the standard library, but it's not loaded by default
telli has joined #ruby
<apeiros_> only core is loaded without require
<hoelzro> also, I don't know if the standard JSON library includes to_json?
<jeffsmykil> undefined local variable or method 'json'
<apeiros_> stdlib ships with ruby, but is only loaded with an explicit require
<apeiros_> jeffsmykil: let me guess, you did `require json`
<hoelzro> jeffsmykil: are you doing require json or require 'json'
<apeiros_> instead of `require 'json'`…
mockra has quit [Ping timeout: 256 seconds]
<apeiros_> it's a normal method. if you write `require json`, then json is either a method or local variable…
postmodern has quit [Quit: Leaving]
serhart has joined #ruby
<jeffsmykil> so i wasn't using straight quotes?
Cooler_ has joined #ruby
<hoelzro> >> require 'json'
<eval-in> hoelzro: Output: "" (http://eval.in/7132)
serhart has quit [Client Quit]
<jeffsmykil> yeah that worked apeiros_
<jeffsmykil> ty
banisterfiend has quit [Remote host closed the connection]
ffranz has joined #ruby
<jeffsmykil> man this will be so much easier than doing it the way I was
<hoelzro> that's the idea ;)
nomenkun_ has joined #ruby
dustint has joined #ruby
nomenkun has quit [Read error: Connection reset by peer]
<jeffsmykil> ruby is awesome
<jeffsmykil> on friday i learned you convert a date time to a string and you get ms since the epoch
<jeffsmykil> so handy
<hoelzro> wait, when Ruby converts DateTime -> integer, it does it in ms, like JS?
yfeldblum has quit [Ping timeout: 245 seconds]
JumpMast3r has joined #ruby
freeayu has quit [Read error: Connection reset by peer]
<jeffsmykil> to_s
horofox has quit [Read error: Connection reset by peer]
horofox has joined #ruby
<apeiros_> hoelzro: Time#to_i = seconds
<jeffsmykil> >> Time.now.to_s
<eval-in> jeffsmykil: Output: "" (http://eval.in/7133)
<apeiros_> DateTime#to_i = nonexistent
<hoelzro> are you sure it's in milliseconds?
<apeiros_> jeffsmykil: you mean Time.now.to_i or Time.now.to_f
arya has joined #ruby
<jeffsmykil> string did it for me
<apeiros_> both return epochtime in *seconds*, not milliseconds
<jeffsmykil> _s
<apeiros_> definitively not :)
abionic has joined #ruby
<apeiros_> >> puts Time.now
<eval-in> apeiros_: Output: "2013-01-21 14:44:24 +0100\n" (http://eval.in/7134)
<apeiros_> that's to_s
<apeiros_> >> puts Time.now.to_i
<eval-in> apeiros_: Output: "1358775871\n" (http://eval.in/7135)
<jeffsmykil> yeah thats ms since the epoch
<apeiros_> nope
<apeiros_> that's *seconds*
<jeffsmykil> I'm getting 1358778900
<jeffsmykil> thats seconds?
<apeiros_> >> p 1358775871 / 3600 / 24 / 365
<eval-in> apeiros_: Output: "43\n" (http://eval.in/7136)
<tobiasvl> the epoch was in 1970, dude
<hoelzro> >> Time.now.to_i
<eval-in> hoelzro: Output: "" (http://eval.in/7137)
<hoelzro> ...
<apeiros_> tobiasvl: yes
<hoelzro> >> puts Time.now.to_i
<eval-in> hoelzro: Output: "1358775932\n" (http://eval.in/7138)
<apeiros_> dudes, do some math
<apeiros_> 1970 is how many ms away?
<tobiasvl> i don't need to do math to know that it's a hell of a lot more than that :)
<Hanmac> if you want ms you need to call .to_f
freeayu has joined #ruby
tommyvyo has joined #ruby
<jeffsmykil> what is f?
<jeffsmykil> float?
<tobiasvl> yes
<jeffsmykil> i learned what i learned on friday is wrong :)
chussenot has joined #ruby
<jeffsmykil> I can go home now
ABK has quit [Ping timeout: 255 seconds]
Jackneill has joined #ruby
jfl0wers has joined #ruby
appamatto has quit [Ping timeout: 256 seconds]
jerius has joined #ruby
adkron has quit [Ping timeout: 244 seconds]
<Hanmac> friday is never an good day to learn things :P
haxrbyte_ has quit [Read error: Connection reset by peer]
reinaldob has quit [Remote host closed the connection]
<jeffsmykil> in my defense I am a complete moron
maxmanders has quit [Quit: Computer has gone to sleep.]
<jokke> hi! how do i debug a ruby script with command line arguments?
<tobiasvl> jokke: debug how?
<jokke> line by line
maxmanders has joined #ruby
<apeiros_> jeffsmykil: not sure that's a defense :-p
samuel02 has joined #ruby
horofox has quit [Quit: horofox]
<jokke> tobiasvl: i tried already ruby -rdebug script.rb arg1 arg2 arg3, but it doesn't work
invisime has joined #ruby
appamatto has joined #ruby
<jokke> some day i just wanna write code and hire someone else to debug it :)
<apeiros_> jeffsmykil: to get time since epoch in ms, use (Time.now.to_f*1000).round
maxmanders has quit [Client Quit]
<apeiros_> >> p (Time.now.to_f*1000).round
<eval-in> apeiros_: Output: "1358776499261\n" (http://eval.in/7139)
Azure has joined #ruby
<apeiros_> in js, you can then do `new Date(1358776499261)` // => Mon Jan 21 2013 14:54:59 GMT+0100 (CET)
<apeiros_> eval-in is off by ~3min… :D
jblack has quit [Ping timeout: 246 seconds]
<hoelzro> good 'ol JS...using milliseconds for time since epoch
<jeffsmykil> apeiros_: I don't fuck with times in javascript anymore, I only use momentjs
<hoelzro> er, ol'
singuraticu has joined #ruby
nkr has quit [Ping timeout: 246 seconds]
<apeiros_> hoelzro: good old js not having integers…
<hoelzro> heh
singuraticu has left #ruby [#ruby]
haxrbyte has joined #ruby
chussenot has quit [Read error: No route to host]
<jeffsmykil> i don't know any better
r0bby_ has joined #ruby
<Hanmac> >> p Time.at 1358776499261.0 / 1000
<eval-in> Hanmac: Output: "2013-01-21 14:54:59 +0100\n" (http://eval.in/7140)
chussenot has joined #ruby
<heftig> apeiros_: it's just Date(3), not new Date(3), i think
<shevy> eeks
<shevy> javascript invasion!!!
r0bby has quit [Read error: No route to host]
<shevy> stand firm my fellow rubyista, we will patiently battle it down
sambio has joined #ruby
* jeffsmykil changes the subject to Dart
griffindy has joined #ruby
haxrbyte_ has joined #ruby
v0n has joined #ruby
billy_ran_away has quit [Ping timeout: 246 seconds]
clocKwize has quit [Quit: clocKwize]
jblack has joined #ruby
jblack has quit [Client Quit]
pskosinski has joined #ruby
billy_ran_away has joined #ruby
haxrbyt__ has joined #ruby
yfeldblum has joined #ruby
haxrbyte has quit [Ping timeout: 252 seconds]
cantonic has joined #ruby
<jeffsmykil> I have these methods that return date times if a criteria is matched or 'null' if they dont
<jeffsmykil> I want to return the actual word null as thats what comes through the service call
<jeffsmykil> right now I'm doing the if else thing to make 'null' into null
janjos has joined #ruby
<tobiasvl> do you mean 'null' into nil?
<tobiasvl> i'm confused
<jokke> hjeelp! :)
allanm has joined #ruby
<jeffsmykil> tobiasvl: I think I figured it out
<jeffsmykil> sorry
haxrbyte_ has quit [Ping timeout: 260 seconds]
<tobiasvl> okay!
miskander has joined #ruby
jrist-out is now known as jrist
gregorg has joined #ruby
gregorg has quit [Changing host]
gregorg has joined #ruby
browndawg has joined #ruby
miskander has quit [Client Quit]
r0bby_ has quit [Ping timeout: 256 seconds]
miskander has joined #ruby
<jeffsmykil> thank you everyone who helped me
jtharris has joined #ruby
cjs226 has quit []
ananthakumaran1 has quit [Quit: Leaving.]
r0bby_ has joined #ruby
hybris has joined #ruby
banisterfiend has joined #ruby
tvw has joined #ruby
TheNumb has quit [Ping timeout: 252 seconds]
grn_ has quit [Ping timeout: 272 seconds]
xkx has quit [Ping timeout: 276 seconds]
darkc0met has quit [Ping timeout: 248 seconds]
segv- has joined #ruby
karasawa has quit [Ping timeout: 246 seconds]
nga4 has joined #ruby
banister_ has joined #ruby
karasawa has joined #ruby
abionic has quit [Ping timeout: 245 seconds]
baniste__ has joined #ruby
banisterfiend has quit [Read error: Connection reset by peer]
<jeffsmykil> .to_json just saved me like 200 lines of code
_br_ has quit [Excess Flood]
breakingthings has joined #ruby
filemon_CZ has joined #ruby
asobrasil has joined #ruby
Criztian has quit [Remote host closed the connection]
banister_ has quit [Ping timeout: 245 seconds]
niklasb has quit [Read error: Operation timed out]
jgarvey has joined #ruby
<tobiasvl> :)
devdazed has quit [Quit: Bye]
_br_ has joined #ruby
devdazed has joined #ruby
mockra has joined #ruby
haxrbyt__ has quit [Remote host closed the connection]
browndawg has quit [Quit: Leaving.]
haxrbyte has joined #ruby
r0bby_ has quit [Ping timeout: 256 seconds]
<pyro111> hi, is there any sane way to find regular expression that matches two given strings
<tobiasvl> pyro111: what exactly do you want to do?
haxrbyte has quit [Remote host closed the connection]
<tobiasvl> match two given strings and nothing else?
haxrbyte has joined #ruby
_br_ has quit [Excess Flood]
robbyoconnor has joined #ruby
<Hanmac> look if the strings both match a regex : [stringa,stringb].all?{|s| s =~ /regex/}
<JonnieCache> hmm
mockra has quit [Ping timeout: 248 seconds]
<JonnieCache> when you run a db query with 20,000 results you realise just how slow and stupid ruby is
<hoelzro> Regexp.new('^' + string_a + '|' + string_b + '$') # =P
atno has joined #ruby
<pyro111> in general i want to get two pages of site and delete all trash sto extract informative part
<Hanmac> hoelzro: there is an app i mean a function for that :P Regexp.union(stringa,stringb)
<hoelzro> Hanmac: ah, neat!
<hoelzro> Hanmac++
_br_ has joined #ruby
<jokke> okay.. i'm really having some serious trouble with my script, and i have no idea what the problem might be.. I'd be really happy if someone could help me out:
spider-mario has joined #ruby
<jokke> I'm trying to write a cache simulator in ruby
<jokke> here's my code
tk_ has quit [Quit: ばいばい]
<jokke> and here's one of the file's i'm reading with it
cantonic_ has joined #ruby
_br_ has quit [Excess Flood]
maxmanders has joined #ruby
<jokke> it has like a million lines..
<jokke> and i'm to determine the hit ratio for different cache types
<hoelzro> jokke: first thing I noticed
<jokke> and sizes
arya has quit [Ping timeout: 248 seconds]
<jokke> hoelzro: yes?
maxmanders has quit [Client Quit]
<hoelzro> you define @num_el in initialize
<jokke> yes
<hoelzro> but you never use it outside of initialize
<jokke> i don't?
<hoelzro> why not just create a local variable?
<jokke> right
<hoelzro> also
<jokke> you're right
<hoelzro> if you *did* use it outside of initialize
<hoelzro> and num_el is always @size / 4
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
<hoelzro> why not just def num_el @size / 4 end
<hoelzro> ?
cantonic has quit [Ping timeout: 240 seconds]
cantonic_ is now known as cantonic
emergion has quit [Quit: Computer has gone to sleep.]
<hoelzro> imo, using methods for these kinds of things is much cleaner
<baniste__> hoelzro: do u have a github account?
<baniste__> yep :)
<hoelzro> hoelzro
<hoelzro> baniste__: ^^
<hoelzro> baniste__: why do you ask?
<baniste__> hoelzro: i was curious what kind of software you were writing
<hoelzro> ah ha
x82_nicole has joined #ruby
<jokke> hoelzro: okay i changed it to local variable, but as expected the output remains the same.
<baniste__> hoelzro: nicw https://github.com/hoelzro/rose-kernel
miskander has quit [Quit: miskander]
<hoelzro> thanks =)
<jokke> i have some reference values
<baniste__> hoelzro: what are you using as reference for that?
<hoelzro> jokke: I was just commenting on style for a start =)
<jokke> and i don't get the same results
_br_- has joined #ruby
<baniste__> hoelzro: do you have a book or a guide or..?
<hoelzro> baniste__: the Intel manuals
<jokke> hoelzro: yes i know, thank you
<baniste__> ah
<baniste__> hoelzro: does it boot yet?
<hoelzro> baniste__: http://wiki.osdev.org/Main_Page is also nice
<hoelzro> baniste__: yes
<hoelzro> it doesn't do much more, though =)
_br_- has quit [Excess Flood]
<hoelzro> I have kernel land multitasking working, though
<hoelzro> I'm working on the memory manager now so I get get userland working
_br_ has joined #ruby
<baniste__> awesome
<hoelzro> it's a really great learning experience
<baniste__> did you know asm before oyu started?
<hoelzro> baniste__: if you're interested, I stumbled upon this last night: http://littleosbook.github.com
<hoelzro> baniste__: a little bit
<hoelzro> the basics
<tobiasvl> jokke: some general ruby tips: use unless foo instead of if !foo
<hoelzro> ADD EAX, 5 and such
<tobiasvl> jokke: and all those usage ifs could probably just be one long if?
<jokke> tobiasvl: oh nice
<baniste__> hoelzro: what a cool book, thanks, i might try something like that.
<baniste__> gotta go
<baniste__> bbl
baniste__ has quit [Remote host closed the connection]
<jokke> tobiasvl: you're right
arya has joined #ruby
<tobiasvl> jokke: and ruby has a heredoc that you can use for that long multiline usage string: http://blog.jayfields.com/2006/12/ruby-multiline-strings-here-doc-or.html
blaxter has quit [Quit: foo]
<hoelzro> heredocs are great
<tobiasvl> 'if hash.nil?' could probably be 'unless hash'? maybe a bit cleaner
<tobiasvl> this is just nitpicking, but seeing as you're learning ruby ... :)
joshcheek has quit [Quit: joshcheek]
<tobiasvl> i'd also maybe name 'hash' something else, hehe
Takehiro has joined #ruby
<lupine> sometimes the difference between false and nil matters
<lupine> in those instances, you should always shoot yourself
<tobiasvl> true
<lupine> ;)
_br_ has quit [Excess Flood]
<tobiasvl> M)
<shevy> I like self.shooting
<tobiasvl> s/M/;
<shevy> M) smiley is a guy whose face got smashed in, no?
davidcel- has joined #ruby
<Hanmac> lupine in some cases i do !!obj
arya has quit [Ping timeout: 248 seconds]
__BigO__ has joined #ruby
<lupine> it's a handy idiom for foo? readers
<lupine> where nil should-be false and object should-be true
mikecmpbll has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<Hanmac> lupine yeah but it is usefull when you want to asign it to a variable
drago757 has joined #ruby
_br_ has joined #ruby
coder_neo has quit [Quit: Leaving]
ttt has quit [Remote host closed the connection]
ExxKA has joined #ruby
_br_ has quit [Excess Flood]
pkrnj has joined #ruby
ejnahc has quit [Quit: leaving]
_br_ has joined #ruby
ejnahc has joined #ruby
davidcel- has quit [Ping timeout: 276 seconds]
breakingthings has quit []
Playground has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
arya has joined #ruby
miskander has joined #ruby
huoxito has joined #ruby
_br_ has quit [Excess Flood]
rippa has joined #ruby
cjs226 has joined #ruby
philcrissman has joined #ruby
maxmanders has joined #ruby
ViPi has joined #ruby
arkiver has quit [Ping timeout: 256 seconds]
maxmanders has quit [Client Quit]
_br_ has joined #ruby
daniel_- has joined #ruby
daniel_- has quit [Changing host]
daniel_- has joined #ruby
<ohdae> hey all. I am creating a bigger Ruby project and need some help with the whole Modules vs Classes
Goles has joined #ruby
<ohdae> my main script is a pseudo-console app, which will be calling all the functions from various scripts inside of project/lib
<ohdae> like project/lib/core.rb, project/lib/database.rb, etc
MissionCritical has quit [Ping timeout: 276 seconds]
atno has quit [Remote host closed the connection]
<ohdae> What is the best way to handle that really? for each lib/script. Should I make each file in lib a big class with the functions inside. then require 'core'; Core.do_stuff(blah), etc
<ohdae> or does that need to be done with Module name; Class namehere
mmitchell has joined #ruby
_br_ has quit [Excess Flood]
_br_ has joined #ruby
<Spooner> ohdae, Just use a module if you want a namespace for your methods. Class when you want to instantiate something.
<ohdae> I'm trying to look at some other projects to get an idea of the general layout
<ohdae> Spooner: okay, that's kind of what I figured
spider-mario has quit [Remote host closed the connection]
freeayu has quit [Remote host closed the connection]
banisterfiend has joined #ruby
jinzhu has quit [Ping timeout: 255 seconds]
wallerdev has joined #ruby
<ohdae> If I create lib/core.rb and make say Class Core; def status_msg(msg). from my main script in the base dir, I can just do require 'core' then Core.status_msg('output') for example?
<ohdae> assuming I add something like this require File.expand_path("#{File.dirname __FILE__}/lib/core")
<Spooner> No, you would need to do Core.new.status_msg since you are adding the method on the instance, not the class.
<ohdae> ohh okay
joshcheek has joined #ruby
<Spooner> ohdae, You can use require_relative if you are on Ruby 1.9 (which you should be) to make that easier. Alternatively you would add the root dir to $LOAD_PATH so it could be found with require.
failshell has joined #ruby
<ohdae> is there a way to import a library like that, where I could just run functions from the lib/script's like Script.function?
<ohdae> i'm not familair with require_relative, I'll have to check it out
reinaldob has joined #ruby
maxmanders has joined #ruby
<ohdae> yeah I'm on 1.9 heh I'm more of a Python guy really but started getting into Ruby lately and I just force myself to write bigger projects so I learn :x
Hanmac has quit [Ping timeout: 245 seconds]
spider-mario has joined #ruby
_br_ has quit [Excess Flood]
<Spooner> ohdae, But as I said, if you just want a namespace for some "functions" then use a module, not a class and do module Foo; def self.status_msg; end; end and then you can just Foo.status_msg
Dakuan has quit []
generalissimo has joined #ruby
<ohdae> Ahh okay, I get it now I think
Dakuan has joined #ruby
<Spooner> Not sure what you mean by importing like that. Does that map directly to a Python use of import?
joshcheek has quit [Client Quit]
<ohdae> I see alot of projects, like the cmd line runner gem 'Cocaine', where the Module name for each script is called 'Cocaine' but it's the class name that differs
<ohdae> Spooner: yeah that's what i meant. not sure if it's the right term w/ Ruby
maxmanders has quit [Client Quit]
<ohdae> I consider 'import' in Python and 'require' in Ruby to be the same idea really
<pyro111> partially solved my problem (find regexp for strings) https://gist.github.com/4586713
<hoelzro> although they provide similar functionality, they're quite different
baroquebobcat has joined #ruby
<Spooner> Not really, since require just "pastes the code in", without doign anything with namespacing, unlike Python import. You have to maually add a module around your code in the file to give it a namespace like that.
<ohdae> hoelzro: really? I wasn't aware. I know that Ruby has 'require' and then 'include' for example but I'm not really sure the big diference
<ohdae> difference*
interactionjaxsn has joined #ruby
<ohdae> Spooner: ahhh okay, that makes more sense
<Spooner> ohdae, Ruby include Core is like Python import Core.* - it adds everything in Core into the global namespace.
<Spooner> (actually, into the current namespace, such as a class, but in this case it is the global one).
Mission-Critical has joined #ruby
<ohdae> so say I have console.rb in my apps main path, then lib/database.rb. inside database.rb, I'd make a module called 'Database' with various functions inside. then require that into console.rb and I could call any function from database.rb using Database.function()
_br_ has joined #ruby
<Spooner> Or rather, require 'core'; include Core is like Python import core.*
<hoelzro> ohdae: require brings things into the global namespace, import brings things into the module's namespace under a given name
<ohdae> hrm ruby is confusing heh :p
<ohdae> okay that makes sense
malcolmva has quit [Read error: Connection reset by peer]
malcolmva has joined #ruby
_br_ has quit [Excess Flood]
<ohdae> You guys are all alot nicer than the people in #python too, btw heh
Kuifje has joined #ruby
jrist has quit [Ping timeout: 244 seconds]
<Spooner> ohdae, You don't have a separate namespace for every file like you would in Python. You would generally have a single namespace (module) for the whole application or gem library.
<Spooner> Where every file would be wrapped in "module MyApp; ...; end".
_br_ has joined #ruby
jaequery has quit [Quit: Computer has gone to sleep.]
<ohdae> gotcha. and then the various classes inside of the single module within each file
<Spooner> Yes, usually one class per file, each in the common namespace module.
<ohdae> database.rb could be say module MyApp; class Database; def functions; end; end; end
<ohdae> okay cool
<Spooner> Yep.
<ohdae> all right awesome. I've been trying to wrap my head around that for a good 24 hours now
<ohdae> i appreciate the help
bean has joined #ruby
_br_ has quit [Excess Flood]
sailias has joined #ruby
<Spooner> ohdae, Shame about #python though. I need to learn it myself :D
miskander has quit [Quit: miskander]
<Spooner> Which is why I semi-understand your confusion about namespace differences because I have had it the other way around!
CrawfordComeaux has joined #ruby
<hoelzro> python's a pretty nice language
<ohdae> and one last thing heh calling the functions from within the module MyApp and a class of 'Database' inside of that (in database.rb), i'd require the lib and call 'MyApp.Database.function()' ?
arya has quit [Ping timeout: 245 seconds]
<ohdae> i hate the whitespace but i do like python alot
<hoelzro> I definitely like its module system
Goles has quit [Quit: Out.]
fyolnish has quit [Remote host closed the connection]
<Spooner> No, db = MyApp::Database; db.function
<ohdae> ruby is nice though,there are so many ways to do the same thing and it's almost like 'guess what you want to do and type it' heh each_do, each_key, blah blah
fyolnish has joined #ruby
<ohdae> ahhh all right. perfect
eykosioux has joined #ruby
clocKwize has joined #ruby
iamjarvo has quit [Quit: Leaving.]
<Spooner> Sorry, I mean: db = MyApp::Database.new; db.function
<ohdae> okay great. now I got it
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
<ohdae> what would you use, include MyApp::Database for? is that the same kind of idea?
<Spooner> MyApp::Database.new() is like myapp.database()
Mission-Critical is now known as MissionCritical
<Spooner> You might include MyApp, so you could just do db = Database.new without needing MyApp::
jaequery has joined #ruby
<ohdae> cool
<Spooner> You can't include a class. Only a module.
TIBS02 has quit [Ping timeout: 248 seconds]
<ohdae> ah hrmm
_br_ has joined #ruby
blaxter has joined #ruby
RagingDave has joined #ruby
mdelcx has joined #ruby
_br_ has quit [Excess Flood]
pu22l3r has joined #ruby
<ohdae> I wrote a decent bit of this article of Ruby http://www.blackhatlibrary.net/Ruby, mostly so I could learn as I went. Writing to explain to other people helps me to learn
mdelcx has quit [Client Quit]
_br_- has joined #ruby
_br_- is now known as _br_
<ohdae> but some stuff like the whole class vs module, include vs require, I kind of just skipped right over heh
Bry8Star has quit [Ping timeout: 276 seconds]
<ohdae> article on*
horofox has joined #ruby
jrist has joined #ruby
fyolnish has quit [Ping timeout: 256 seconds]
<Spooner> ohdae, #puts "Hello world\n" - puts includes a newline+flush. #print doesn't.
a_a_g has joined #ruby
daniel_- has quit [Ping timeout: 260 seconds]
dnyy has joined #ruby
arya has joined #ruby
<Spooner> ohdae, Class variables are pretty much not used any more, so shouldn't be encouraged.
<tobiasvl> Spooner: huh, i didn't know that. why aren't they used?
zommi has quit [Quit: Leaving.]
mgrayson has joined #ruby
gyre007 has quit [Ping timeout: 245 seconds]
dnyy has quit [Remote host closed the connection]
mockra has joined #ruby
<Spooner> tobiasvl, We generally use "class instance variables" now. @@vars are filled with unpleasant magic behaviour ;)
Criztian has joined #ruby
<tobiasvl> interesting
dnyy has joined #ruby
gyre007 has joined #ruby
_br_ has quit [Excess Flood]
<tobiasvl> thanks
<ohdae> Spooner: okay thanks. I'll fix that
TIBS02 has joined #ruby
miskander has joined #ruby
dnyy has quit [Remote host closed the connection]
_br_ has joined #ruby
<Spooner> ohdae, They still exist and probably always will though :D
<ohdae> heh
tagrudev has quit [Read error: Connection reset by peer]
jaequery has quit [Quit: Computer has gone to sleep.]
<ohdae> So say you have @foo = 'bar' outside of your class or module, it would be shared through all classes and functions inside that script
<ohdae> or where does @@foo = 'bar' come in to play? how would that differ really?
<ericwood> @@foo is shared between all instances of its containing class
<ohdae> I mean even if you do @foo = 'bar' inside a function, inside a class, it's still available through-out the entire class, right?
<shevy> awww class vars :(
<ericwood> similar to "static" if you come from a C/C++ background
<shevy> ohdae @foo is not @@foo
<Spooner> @@foo exists on the class, @foo exists on the instance. A class instance variable exists on the class, being treated as an instance of Class ;)
<ohdae> ericwood: that's a language i can speak heh
mockra has quit [Ping timeout: 256 seconds]
timonv_ has joined #ruby
<shevy> @@foo is awful, @foo is cool
Criztian has quit [Ping timeout: 252 seconds]
timonv has quit [Read error: Connection reset by peer]
<ericwood> @@foo is fine when used correctly
<shevy> @@foo can never be used correctly
<banisterfiend> ericwood: can u tell me a legitmate use, just curious
<banisterfiend> legitimate*
<ohdae> hmm
<ohdae> so take this for example http://pastie.org/5773507
<ericwood> like when you want to pretend you're writing JS and messing with prototypes :D
<banisterfiend> ohdae: can you gist instead? :)
<banisterfiend> ohdae: gist.github.com
<Spooner> There are times when @@ is fine, but using it just encourages other people to use it and get into a mess :D
<ohdae> sure heh
_br_ has quit [Excess Flood]
Xeago has left #ruby [#ruby]
Xeago has joined #ruby
<ericwood> the only real legit use is if you wanted to update a parameter for all instances of an object...I could see that being useful, although I've never needed it
<ohdae> ah github is so slow for me today
maxmanders has joined #ruby
<ohdae> maybe it's my internet, i'm at a starbucks atm heh
<raz> man
<raz> google image search gets more horrible every time i use irt
<ohdae> in that case^, I don't see a difference between @@ and @
<ericwood> ohdae: the @foo won't be accessible from within the class
<ohdae> really?
<ohdae> hrm
<ericwood> @@bar is only in the context of the class
gyre007 has quit [Ping timeout: 245 seconds]
<ericwood> scoping
<ohdae> i was not aware of that. i assumed that @foo would be accessible since it was outside of everything, used @ and acted as a sort of global (not really) just for that script
<ericwood> no, @ is just an instance variable
<ohdae> okay hrm. i was way off there heh
<shevy> ohdae within the class
maxmanders has quit [Client Quit]
Criztian has joined #ruby
<ericwood> so @ is accessible anywhere within the class
daniel_- has joined #ruby
_br_ has joined #ruby
<shevy> ohdae if you want to make an @ivar accessible to the outside world, you can write a method that returns it, or use attr_reader :foo which is even shorter
<ohdae> in this script, https://github.com/ohdae/maz-mini/blob/master/yoshi.rb, i have @base at the top and am using it through-out the script. is that the correct usage?
<ohdae> okay. i always wondered about the attr_*'s
<shevy> ohdae you should want to put it into a method usually
<shevy> ah
<shevy> you don't have a class in your script
<ohdae> or in that same script, the first function I create @info and use it through-out the functions..
filipe has quit [Ping timeout: 248 seconds]
<ohdae> shevy: so am i kind of defeating the purpose by *not* using a class when I use @'s?
_br_ has quit [Excess Flood]
<shevy> you can use them
<Spooner> ohdae, You are placing the @ivar on an object, but one which is available everywhere. You really should use $global in this case since it is more what you are actually doing.
<shevy> in a module too, outside class and modules too
<shevy> ohdae but usually it is better to put it into a class
<banisterfiend> Spooner: @base is nto available everywhere, it's just available on main ;)
Neomex has joined #ruby
<Spooner> banisterfiend, Everywhere in that script :D
<banisterfiend> sure
<ohdae> heh
<Spooner> ohdae, And USAGE/DESC should be constants, since they are.
<ohdae> yeah it's probably very poor code so i apologize in advance :p
<shevy> ohdae ruby classes have an initializer method, called initialize(), which gets called when one does call .new (indirectly I think... it first calls allocate, or something, then initialize. no idea)
EPIK has joined #ruby
fyolnish has joined #ruby
maxmanders has joined #ruby
<ohdae> shevy: i noticed that. i see alot of people's code that has def initialize within a given class. i assumed it was just some common naming convention
<shevy> it is often much easier to follow the logic in a class, as opposed to free-form no-classes-anywhere-code
_nitti has joined #ruby
luisalima has joined #ruby
<shevy> I am not even sure where your code starts :P
jaequery has joined #ruby
gyre007 has joined #ruby
<ohdae> hehe
<Spooner> shevy, MyClass.new(*args) allocates the object then calls initialize(*args) on it
_br_ has joined #ruby
<spider-mario> regarding style: are brackets in method definitions generally used when there are parameters?
<ohdae> shevy: if ARGV[0] == nil is really the start of the flow
<spider-mario> i.e. which is more common between: def initialize(a, b, c) and def initialize a, b, c
<ohdae> i need to learn proper command line option parsing too :x
<Spooner> spider-mario, In method defs yes, in calls, generally not.
<spider-mario> ok, thanks
Zolo has joined #ruby
<shevy> ohdae that should be easy
<Spooner> ohdae, look at slop or trollop gems.
_br_ has quit [Excess Flood]
<shevy> or require 'optparse'
_br_ has joined #ruby
<shevy> but i hate optparse
<shevy> opts = Slop.parse do
<shevy> on :n, :name=, 'Your name'
<shevy> terseness is beautiful!
dnyy has joined #ruby
roflmaus has joined #ruby
ddv has quit [Changing host]
ddv has joined #ruby
BulleTime has joined #ruby
jimeh has quit [Quit: Computer has gone to sleep.]
baroquebobcat has quit [Quit: baroquebobcat]
a_a_g has quit [Read error: Connection reset by peer]
_br_ has quit [Excess Flood]
skaczor has joined #ruby
timonv has joined #ruby
a_a_g has joined #ruby
timonv_ has quit [Read error: Connection reset by peer]
nkr has joined #ruby
sea_wolf has quit [Quit: leaving]
_br_ has joined #ruby
filipe has joined #ruby
<ohdae> yeah i was looking at trollop. optparse looks like of messy
filemon_CZ has quit [Remote host closed the connection]
<ohdae> bah i was trying to get an irb session inside my SublimeText console, tried to use the python interpreter inside ST to spawn a bash pty, then spawn irb
<ohdae> it didnt like that lol
<Spooner> ohdae, Try pry instead of irb. Much better.
bdnelson has joined #ruby
recycle has joined #ruby
_br_ has quit [Excess Flood]
eka has joined #ruby
interactionjaxsn has quit [Remote host closed the connection]
osaut has quit [Ping timeout: 240 seconds]
benlieb has joined #ruby
_br_ has joined #ruby
recycle has quit [Read error: Connection reset by peer]
mgrayson has quit [Quit: Textual IRC Client: www.textualapp.com]
mgrayson has joined #ruby
<shevy> ohdae reminds me of the moebius strip
maxmanders has quit [Quit: Computer has gone to sleep.]
cantonic has quit [Quit: cantonic]
miskander has quit [Quit: miskander]
karasawa has quit [Ping timeout: 245 seconds]
daniel_- has quit [Ping timeout: 248 seconds]
enebo has joined #ruby
andrewhl has joined #ruby
rh1n0 has joined #ruby
karasawa has joined #ruby
_br_ has quit [Excess Flood]
ananthakumaran has joined #ruby
_br_ has joined #ruby
bdnelson has quit [Quit: Textual IRC Client: www.textualapp.com]
filipe has quit [Ping timeout: 248 seconds]
iamjarvo has joined #ruby
iamjarvo1 has joined #ruby
Criztian has quit [Ping timeout: 248 seconds]
ddv has quit [Ping timeout: 240 seconds]
ttt has joined #ruby
dr_neek has quit [Read error: Connection reset by peer]
<ohdae> yeah i like pry. i've used it a bit before
<ohdae> it's pretty neat how you can dig down into the gems like that
<ohdae> I want something like bpython but for ruby
<ohdae> that would be awesome
dr_neek has joined #ruby
<ohdae> something like this => http://i.imgur.com/5tagh2B.png
<ohdae> it auto-suggests almost everything for you as you type. variables, functions, libraries, etc. even documentation for some of the libraries and functions.
<ohdae> that for ruby would be <33
iamjarvo has quit [Ping timeout: 260 seconds]
_br_ has quit [Excess Flood]
bcx has joined #ruby
Zolo has quit [Remote host closed the connection]
<hoelzro> pry does support tab completion
ttt has quit [Ping timeout: 276 seconds]
<matti> Quick question: what would be the best way to interrupt DialTimeout waiting for goroutie to expire its timeout?
<matti> Ops.
<matti> Wrong channel.
recycle has joined #ruby
apeiros_ has quit [Remote host closed the connection]
dmiller has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
ddv has joined #ruby
<Spooner> ohdae, Pry also gives docs with show-doc
Virunga has quit [Remote host closed the connection]
_br_ has joined #ruby
inokenty has joined #ruby
inokenty has quit [Max SendQ exceeded]
mikepack has joined #ruby
inokenty has joined #ruby
<Spooner> ohdae, It doesn't auto-complete quite like that, but feel free to bug banisterfiend to add that.
dr_neek has quit [Quit: dr_neek]
Zolo_ has joined #ruby
cobragoat has joined #ruby
kiyoura has joined #ruby
_br_ has quit [Excess Flood]
<banisterfiend> ohdae: that's just front-end stuff
<banisterfiend> ohdae: it's possible to write a front-end for pry that does that
angusiguess has joined #ruby
<banisterfiend> ohdae: i liked bpython's front-end, but i was unimpressed by its functionality, it doesn't do a lot ;)
<Spooner> banisterfiend, Possible and "already done" are two different things.
failshell has quit [Ping timeout: 245 seconds]
<Xeago> banisterfiend: I also vote for auto complete show-doc
drago757 has quit [Quit: drago757]
<Spooner> banisterfiend, I vote for free pie for all!
mercwithamouth has joined #ruby
Monie has joined #ruby
main has quit [Ping timeout: 256 seconds]
sclarson_ has joined #ruby
interactionjaxsn has joined #ruby
miskander has joined #ruby
filipe has joined #ruby
_br_ has joined #ruby
jaequery has quit [Quit: Computer has gone to sleep.]
mark_locklear has joined #ruby
DaltonUS has joined #ruby
<banisterfiend> Xeago: what is "auto complete show-doc" ?
horofox has quit [Remote host closed the connection]
failshell has joined #ruby
interactionjaxsn has quit [Remote host closed the connection]
_br_ has quit [Excess Flood]
<Xeago> nvm
Umren has joined #ruby
r4um has joined #ruby
<banisterfiend> Xeago: you mean it shows docs for a method as soon as you type its name?
_br_- has joined #ruby
invisime has left #ruby [#ruby]
horofox has joined #ruby
ananthakumaran has joined #ruby
mercwithamouth has quit [Ping timeout: 256 seconds]
Virunga has joined #ruby
interactionjaxsn has joined #ruby
_br_- has quit [Excess Flood]
_br_ has joined #ruby
Kakera has quit [Ping timeout: 248 seconds]
wchun has quit [Read error: Connection reset by peer]
miskander has quit [Quit: miskander]
beiter has joined #ruby
filedotwrite has joined #ruby
<filedotwrite> ok, I cannot seem to find the docs for File.write method. It's not on this page: http://www.ruby-doc.org/core-1.9.3/File.html
zigomir has quit [Quit: zigomir]
miskander has joined #ruby
daniel_- has joined #ruby
cantonic has joined #ruby
maxmanders has joined #ruby
<filedotwrite> am I missing something?
miskander has quit [Client Quit]
radosch has quit [Quit: - - - says bye bye - - -]
dhruvasagar has quit [Ping timeout: 244 seconds]
<hoelzro> filedotwrite: did you try looking for IO.write?
jimeh has joined #ruby
baroquebobcat has joined #ruby
elico has joined #ruby
<filedotwrite> oh.. File.write is aliased to that or something?
spike|spiegel has joined #ruby
_br_ has quit [Excess Flood]
<hoelzro> File < IO
maxmanders has quit [Client Quit]
sayan has quit [Read error: Connection reset by peer]
<filedotwrite> hoelzro: ah, thanks!
<hoelzro> np
_br_ has joined #ruby
jpun has joined #ruby
mockra has joined #ruby
jaequery has joined #ruby
<banisterfiend> hoelzro: what's the temp in amsterdam?
larissa has quit [Quit: Leaving]
<hoelzro> banisterfiend: about 0 =/
Uranio has joined #ruby
<hoelzro> it's pretty chilly
miskander has joined #ruby
jaequery has quit [Client Quit]
<tobiasvl> the forecast for wednesday here in oslo: -15
<hoelzro> oh joy =/
<banisterfiend> hoelzro: not too bad, leiden was -5 before i left (in brussels now)
Xeago has quit [Ping timeout: 248 seconds]
<hoelzro> oh, nice
<hoelzro> the brussels, not the temperature ;)
generalissimo has quit [Remote host closed the connection]
chrismhough has joined #ruby
<banisterfiend> hoelzro: hmm not that nice, it's kind of grimey actually
spike|spiegel has quit [Ping timeout: 256 seconds]
<banisterfiend> maybe im just in the wrong part :)
<banisterfiend> hoelzro: also i dont speak french so im kind of screwed
_br_ has quit [Excess Flood]
mockra has quit [Ping timeout: 255 seconds]
a_a_g has quit [Read error: Connection reset by peer]
a_a_g has joined #ruby
horofox has quit [Read error: Connection reset by peer]
aganov has quit [Remote host closed the connection]
filedotwrite has quit [Quit: Page closed]
<hoelzro> heh
horofox has joined #ruby
<hoelzro> I noticed that when I went to brussels a few months back
<GeekOnCoffee> it's 0F here
<GeekOnCoffee> which is -17
<hoelzro> the English isn't nearly as prevalent as Amsterdam
<GeekOnCoffee> -28 if you factor in the wind
_br_ has joined #ruby
<hoelzro> heh
<hoelzro> GeekOnCoffee: where's here for you?
<banisterfiend> hoelzro: can u get by speaking dutch though?
<hoelzro> banisterfiend: hell no =
<GeekOnCoffee> Green Bay, WI USA
<hoelzro> =P
<hoelzro> GeekOnCoffee: oh hey, I'm from Milwaukee =)
<GeekOnCoffee> nice!
<tobiasvl> lol fahrenheit
<hoelzro> I was going to say, that temperature sounds like home =P
maxmanders has joined #ruby
<GeekOnCoffee> hoelzro: so I'm from Kewaunee then :)
<hoelzro> banisterfiend: my Dutch is good enough to say "I speak terrible Dutch" ;)
telli has quit [Read error: Operation timed out]
<GeekOnCoffee> Je parle français comme un vasche espanol
<banisterfiend> hoelzro: your dutch improves when u have a bad cough
fteem has quit [Ping timeout: 246 seconds]
<hoelzro> haha
gyre007 has quit [Ping timeout: 245 seconds]
<GeekOnCoffee> (I speak french like a spanish cow)
_br_ has quit [Excess Flood]
rh1n0 has quit [Quit: Linkinus - http://linkinus.com]
proj has joined #ruby
BizarreCake has quit [Remote host closed the connection]
ner0x has joined #ruby
_br_ has joined #ruby
Kakera has joined #ruby
katherinem13 has quit [Quit: leaving]
blaxter has quit [Ping timeout: 246 seconds]
katherinem13 has joined #ruby
tPl0ch has quit [Quit: Verlassend]
yoshie902a has joined #ruby
telli has joined #ruby
drago757 has joined #ruby
_br_ has quit [Excess Flood]
slainer6_ has joined #ruby
breakingthings has joined #ruby
io_syl has joined #ruby
cr3 has joined #ruby
_br_ has joined #ruby
proj has left #ruby ["ERC Version 5.3 (IRC client for Emacs)"]
gyre007 has joined #ruby
<GeekOnCoffee> hoelzro: you doing ruby full time in Milwaukee?
<hoelzro> GeekOnCoffee: no, I actually live in Amsterdam
dmiller has quit [Ping timeout: 248 seconds]
slainer68 has quit [Ping timeout: 260 seconds]
<hoelzro> I moved here for work almost a year ago
beneggett has joined #ruby
<GeekOnCoffee> oh okay :)
<hoelzro> doing Ruby when I move back would be nice, though!
<GeekOnCoffee> it's on my list to visit, we have a friend just moved to Utrecht to work for 2 years
maxmanders has quit [Quit: Computer has gone to sleep.]
pyro111 has quit [Quit: Leaving]
_br_ has quit [Excess Flood]
jeffreybaird has joined #ruby
osaut has joined #ruby
horofox has quit [Read error: Connection reset by peer]
dormiens has joined #ruby
darkc0met has joined #ruby
BulleTime has quit [Ping timeout: 252 seconds]
jxf has quit [Ping timeout: 245 seconds]
adeponte has joined #ruby
slainer68 has joined #ruby
horofox has joined #ruby
<hoelzro> oh man, Utrecht is great
<banisterfiend> hoelzro: have you been to leiden?
_br_ has joined #ruby
<hoelzro> banisterfiend: not yet
blazes816 has joined #ruby
slainer6_ has quit [Ping timeout: 245 seconds]
<banisterfiend> hoelzro: ah, cute little town, really nice
quest88 has joined #ruby
alvaro_o has joined #ruby
<hoelzro> banisterfiend: there seem to be a lot of those in the Netherlands =)
<banisterfiend> true
_br_ has quit [Excess Flood]
_br_ has joined #ruby
etcetera has joined #ruby
wchun has joined #ruby
banisterfiend has quit [Read error: Connection reset by peer]
<JonnieCache> concurrency what a pain in the arse
banisterfiend has joined #ruby
<JonnieCache> i should have used eventmachine from the word go. or maybe i should just give up on concurrency
<JonnieCache> its not like its going to make it actually go any fater
<JonnieCache> faster
carloslopes has quit [Remote host closed the connection]
horofox has quit [Read error: Connection reset by peer]
horofox has joined #ruby
kenneth has quit [Quit: kenneth]
sayan has joined #ruby
<hoelzro> concurrency *is* a pain
<hoelzro> most of the time, you don't even need it
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
clocKwize has quit [Quit: clocKwize]
_br_ has quit [Excess Flood]
sayan has quit [Read error: Connection reset by peer]
<JonnieCache> yeah ill just do everything in order
matthias_ has joined #ruby
rippa has joined #ruby
pu22l3r has quit [Remote host closed the connection]
nwertman_ has joined #ruby
jonahR has joined #ruby
roflmaus has quit []
Neomex has quit [Quit: Neomex]
generalissimo has joined #ruby
<JonnieCache> is there a good way to call each on a pair of arrays and yield the element witht the same index of each?
<JonnieCache> or should i just handroll that
_br_ has joined #ruby
horofox has quit [Read error: Connection reset by peer]
nwertman has quit [Ping timeout: 252 seconds]
<spider-mario> I might use zip
horofox has joined #ruby
filipe has quit [Remote host closed the connection]
<JonnieCache> yeah was thinking that
<hoelzro> JonnieCache: so you want to find an i for a[i] == b[i]?
<JonnieCache> no
<JonnieCache> i just want to iterate over two arrays at once
_br_ has quit [Excess Flood]
<banisterfiend> that's what zip is for
<hoelzro> ah, then zip sounds good
<JonnieCache> double_each(a1, a2) do |e1, e2|
<spider-mario> zip seems perfect then
<spider-mario> a1.zip(a2) do |e1, e2|
<banisterfiend> a.zip(b) { |ele1, ele2| }
<JonnieCache> the only other thing is, one of the arrays isnt an array, its a DB-backed object with 20,000 rows which blocks for 2 minutes+ when you call .all on it :)
etcetera has quit []
yoshie902a has left #ruby [#ruby]
<JonnieCache> zip goes row by row, right?
zommi has joined #ruby
[AD] has joined #ruby
_br_ has joined #ruby
Goles has joined #ruby
jxf has joined #ruby
[AD] has quit [Client Quit]
<spider-mario> JonnieCache: call zip on that object so that it’s not converted to an array
<JonnieCache> good idea
recycle has quit [Read error: Connection reset by peer]
Zolo_ has quit [Remote host closed the connection]
etcetera has joined #ruby
rakl has joined #ruby
mark_locklear has quit [Remote host closed the connection]
matthias_ has quit []
blaxter has joined #ruby
jxf has quit [Client Quit]
horofox has quit [Read error: Connection reset by peer]
_br_ has quit [Excess Flood]
horofox has joined #ruby
<JonnieCache> then i can use the |(foo, bar)| block argument syntax as well
<JonnieCache> winning
_nitti has quit [Remote host closed the connection]
_br_ has joined #ruby
<banisterfiend> JonnieCache: dont need parentheses :)
<JonnieCache> even to expand an array like that?
<ericwood> blocks don't work that way :P
<ericwood> just comma separated
<JonnieCache> no but if i have just one two element array as an arg I can expand it with the parens cant I?
<JonnieCache> im sure ive done that before
<banisterfiend> JonnieCache: yeah, you can destructure it without parentheses
<JonnieCache> >> [[1,2],[3,4]].each {|(a,b)| puts a; puts b}
<eval-in> JonnieCache: Output: "1\n2\n3\n4\n" (http://eval.in/7158)
_br_ has quit [Excess Flood]
<JonnieCache> >> [[1,2],[3,4]].each {|a,b| puts a; puts b}
<eval-in> JonnieCache: Output: "1\n2\n3\n4\n" (http://eval.in/7159)
niklasb has joined #ruby
<JonnieCache> sweet
arkiver has joined #ruby
mafolz has quit [Remote host closed the connection]
Astral_ has joined #ruby
<JonnieCache> tbh i dont approve of that much guesswork from the parser
frem has joined #ruby
<ericwood> I wouldn't call it guesswork...it's part of the grammar
<banisterfiend> JonnieCache: it's just normal destructuring stuff
<banisterfiend> JonnieCache: a, b = [1,2]
<JonnieCache> oh yeah
<ericwood> there's also splat for stuff
_nitti has joined #ruby
<JonnieCache> what if i had a second block param though
<JonnieCache> wouldnt i need the () to disambiguate
Zolo has joined #ruby
<banisterfiend> JonnieCache: yes then u would need ()
<JonnieCache> ah thats what im thinking of then
<ericwood> >> def foo(a,b); puts [a,b]; end; foo(*[1,2])
<eval-in> ericwood: Output: "1\n2\n" (http://eval.in/7160)
horofox has quit [Read error: Connection reset by peer]
<ericwood> >> def foo(a,b); puts [a,b]; end; foo([1,2])
<banisterfiend> (a, b), c = [ [1, 2], 3]
<eval-in> ericwood: Output: "/tmp/execpad-31fdfa61f662/source-31fdfa61f662:1:in `foo': wrong number of arguments (1 for 2) (ArgumentError)\n\tfrom /tmp/execpad-31fdfa61f662/source-31fdfa61f662:1:in `<main>'\n" (http://eval.in/7161)
<ericwood> :D
cobragoat has quit [Remote host closed the connection]
a_a_g has quit [Quit: Leaving.]
horofox has joined #ruby
headius has joined #ruby
cobragoat has joined #ruby
dr_neek has joined #ruby
n1x has joined #ruby
Astralum has quit [Ping timeout: 252 seconds]
horofox has quit [Read error: Connection reset by peer]
_br_ has joined #ruby
<banisterfiend> ericwood: def foo((a,b))
horofox has joined #ruby
moshee has quit [Ping timeout: 246 seconds]
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
recycle has joined #ruby
_br_ has quit [Excess Flood]
arietis has joined #ruby
nomenkun_ has quit [Remote host closed the connection]
razibog has quit [Read error: Operation timed out]
friskd has joined #ruby
friskd has quit [Remote host closed the connection]
angusiguess has quit [Ping timeout: 260 seconds]
benlieb has quit [Quit: benlieb]
recycle has quit [Read error: Connection reset by peer]
slainer68 has quit [Remote host closed the connection]
sayan has joined #ruby
ephemerian has quit [Quit: Leaving.]
cobragoat has quit [Ping timeout: 255 seconds]
_br_ has joined #ruby
Goles has quit [Quit: Out.]
jonathanwallace has quit [Ping timeout: 256 seconds]
_br_ has quit [Excess Flood]
miskander has quit [Quit: miskander]
friskd has joined #ruby
eldariof has quit [Ping timeout: 252 seconds]
slainer68 has joined #ruby
benlieb has joined #ruby
carloslopes has joined #ruby
mockra has joined #ruby
_br_ has joined #ruby
NsOmNiAc has joined #ruby
clocKwize has joined #ruby
fyolnish has quit [Remote host closed the connection]
kenneth has joined #ruby
IrishGringo has joined #ruby
cirwin has joined #ruby
_br_ has quit [Excess Flood]
adeponte has quit [Remote host closed the connection]
clocKwize has quit [Client Quit]
<ericwood> banisterfiend: splat is cooler
<banisterfiend> ericwood: cooler than what
bcx has quit [Quit: Leaving.]
<ericwood> foo((a,b))
<ericwood> too many parens, this ain't lisp yo ;)
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
mockra has quit [Ping timeout: 245 seconds]
_br_ has joined #ruby
telli has quit [Ping timeout: 246 seconds]
<banisterfiend> ericwood: splat also isn't really relevant to what i was demonstrating :)
<spider-mario> funny, I was just reading paul graham’s Beating the Averages again. :p
jgrevich has joined #ruby
carloslopes has quit [Ping timeout: 245 seconds]
<ericwood> funny, I was just beating paul graham
mercwithamouth has joined #ruby
jblack has joined #ruby
hoelzro has quit [Ping timeout: 264 seconds]
_br_ has quit [Excess Flood]
horofox has quit [Read error: Connection reset by peer]
vng is now known as vng|afk
<ericwood> banisterfiend: (a,b) reminds me too much of python tuples
horofox has joined #ruby
telli has joined #ruby
maxmanders has joined #ruby
codezombie has joined #ruby
<codezombie> was just doing a simple ruby excersize with a buddy. I was wondering, can anyone simplify this further? Maybe to one loop? https://gist.github.com/f34b4fae5b3b40bc723b#comment-740901
<codezombie> the last comment.
carloslopes has joined #ruby
_br_ has joined #ruby
jduan1981 has joined #ruby
awarner has joined #ruby
luckyruby has joined #ruby
<ericwood> codezombie: if you're doing a block and calling .join on the result, use {} instead...it's better form
<ericwood> but I like that last solution the best
<codezombie> ericwood: THe reason I didn't use {} was because it cluttered up the line. I tend to use {} for single lines, and do/end for multi line.
bcx has joined #ruby
<ericwood> "end.join" is kinda ugly...
_br_ has quit [Excess Flood]
ananthakumaran has quit [Quit: Leaving.]
<ericwood> just replace do with { and end with } and it's wonderful
<ericwood> I will argue this all day if I have to ;)
<codezombie> true, but based on how it looked with both blocks/loops on a single line, I chose the lesser of two evils :P
<ericwood> okay, you're actually setting str to be the result of the block...
<ericwood> why not just do "puts str.join("\n")" instead??!?!?!?!
<ericwood> that's like 100x more beautiful
<codezombie> I suppose that could work :P
_br_ has joined #ruby
zph has joined #ruby
<codezombie> updated the gist.
<ericwood> I posted my own comment
<X-Jester> Does anyone know how to differentiate between Net::SSH::AuthenticationFailed returning for a locked out account vs an incorrect password?
<codezombie> ha, got mine in first. Now you look like you just copied mine. lol ;)
<ericwood> yep
alvaro_o has quit [Quit: Ex-Chat]
<X-Jester> right now, both just throw an AuthenticationFailed with message containing only the username
<codezombie> It's been a competitive morning... sorry.
<ericwood> lol
<workmad3> X-Jester: I doubt you can tell from the client side
<spider-mario> puts (1 .. 12).map {|n| (1 .. 12 * n).step(n).entries.join "\t"}.join "\n"
<workmad3> X-Jester: I also doubt it would differentiate if the user account doesn't exist from them either
rdark has quit [Ping timeout: 252 seconds]
<workmad3> x
gansam has joined #ruby
<spider-mario> codezombie: how about that one?
<workmad3> X-Jester: doing otherwise allows more focussed brute-force attacks
<ericwood> he's right
Dakuan has quit [Remote host closed the connection]
<codezombie> ericwood: the join on the end of the block originally came from me trying to do a puts on the block, instead of actually assigning it to a variable. Though, that didn't work at all.
alvaro_o has joined #ruby
maletor has joined #ruby
<ericwood> ah okau
Neomex has joined #ruby
<codezombie> spider-mario: the output is wrong.
<codezombie> needs to be a multiplacation table.
haxrbyte has quit [Read error: Connection reset by peer]
bluenemo has quit [Ping timeout: 246 seconds]
<jblack> I don't think the ssh protocol provides for anything other than u+p failure.
<ericwood> spider-mario: are you zenspider?
_br_ has quit [Excess Flood]
<spider-mario> oops, that’s true, sorry
<X-Jester> okay, I understand what you're saying.
<spider-mario> no, I’m not
<ericwood> hmmmph
<ericwood> on he's only in #ruby-lang
<X-Jester> It looks like even with executing ssh <user>@host, if the user is locked out, that information is not returned to the client
<gansam> Am unable to override the read method in URI::HTTP(OpenURI::OpenRead) to make it read a test file. I keep getting a NoMethodError: undefined method `read' for #<URI::HTTP:0x10ac59918> because the read method is located in OpenURI::OpenRead and not in URI::HTTP. Even though I specify my modules as OpenURI::OpenRead it doesn't work. Any pointers?
<X-Jester> You only see the account being locked if something prompts for your password *after* you're in a login shell
<X-Jester> (i.e. you authenticated with a cert)
<spider-mario> puts (1 .. 12).map {|n| (n .. 12 * n).step(n).entries.join "\t"}.join "\n" works, but I didn’t realize what it was supposed to do, and map is indeed better.
Jamone has joined #ruby
joeycarmello has joined #ruby
<codezombie> thanks for giving it a shot mario :)
<spider-mario> so, puts (1 .. 12).map {|n| (1 .. 12).map {|i| n * i}.join "\t"}.join "\n"
<ericwood> >> puts (1 .. 12).map {|n| (1 .. 12).map {|i| n * i}.join "\t"}.join "\n"
<eval-in> ericwood: Output: "1\t2\t3\t4\t5\t6\t7\t8\t9\t10\t11\t12\n2\t4\t6\t8\t10\t12\t14\t16\t18\t20\t22\t24\n3\t6\t9\t12\t15\t18\t21\t24\t27\t30\t33\t36\n4\t8\t12\t16\t20\t24\t28\t32\t36\t40\t44\t48\n5\t10\t15\t20\t25\t30\t35\t40\t45\t50\t55\t60\n6\t12\t18\t24\t30\t36\t42\t48\t54\t60\t66\t72\n7\t14\t ..." (http://eval.in/7172)
tommyvyo has joined #ruby
<ericwood> :D
<davidcelis> ...
<ericwood> looks correct
<codezombie> still two loops :)
<davidcelis> Range whitespace... weird
Zolo has quit [Remote host closed the connection]
_br_ has joined #ruby
<ericwood> unless you get really creative it's going to be O(N^2)
a_a_g has joined #ruby
<spider-mario> well, there are n² numbers anyway
jjbohn has joined #ruby
bean has quit [Quit: Computer has gone to sleep.]
<ericwood> lets concentrate more on using as few characters as possible instead
<codezombie> the goal was basically, speed and readability. Trying to get this guy out of his .Net habits.
<workmad3> >> p (1..12).to_a.combination(2).map{(a,b) a*b}.join("\n")
<eval-in> workmad3: Output: "/tmp/execpad-f207fc2a7111/source-f207fc2a7111:1: syntax error, unexpected tIDENTIFIER, expecting '='\np (1..12).to_a.combination(2).map{(a,b) a*b}.join(\"\\n\")\n ^\n" (http://eval.in/7173)
<workmad3> d'oh
Monie has quit [Ping timeout: 245 seconds]
<workmad3> >> p((1..12).to_a.combination(2).map{(a,b) a*b}.join("\n"))
<eval-in> workmad3: Output: "/tmp/execpad-06c7f2b7132e/source-06c7f2b7132e:1: syntax error, unexpected tIDENTIFIER, expecting '='\np((1..12).to_a.combination(2).map{(a,b) a*b}.join(\"\\n\"))\n ^\n" (http://eval.in/7174)
<workmad3> >> puts((1..12).to_a.combination(2).map{(a,b) a*b}.join("\n"))
<eval-in> workmad3: Output: "/tmp/execpad-1eb8e309fa3e/source-1eb8e309fa3e:1: syntax error, unexpected tIDENTIFIER, expecting '='\nputs((1..12).to_a.combination(2).map{(a,b) a*b}.join(\"\\n\"))\n ^\n" (http://eval.in/7175)
_br_ has quit [Excess Flood]
<workmad3> ah, oops
<workmad3> >> puts((1..12).to_a.combination(2).map{|(a,b)| a*b}.join("\n"))
<eval-in> workmad3: Output: "2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n6\n8\n10\n12\n14\n16\n18\n20\n22\n24\n12\n15\n18\n21\n24\n27\n30\n33\n36\n20\n24\n28\n32\n36\n40\n44\n48\n30\n35\n40\n45\n50\n55\n60\n42\n48\n54\n60\n66\n72\n56\n63\n70\n77\n84\n72\n80\n88\n96\n90\n99\n108\n110\n120\n132\n" (http://eval.in/7176)
<workmad3> hmm, doesn't do 1,1...
<spider-mario> from “combination”:
<spider-mario> The implementation makes no guarantees about the order in which the combinations are yielded.
<workmad3> or 2,2, etc
<ericwood> it's a beautiful day for codegolfing
JumpMast3r has quit [Quit: JumpMast3r]
eykosioux_ has joined #ruby
karasawa has quit [Ping timeout: 256 seconds]
<spider-mario> >> (1 .. 12).entries.product((1 .. 12).entries).map {|l| l.reduce :*}.each_slice(12) {|l| puts l.join "\t"}
<eval-in> spider-mario: Output: "1\t2\t3\t4\t5\t6\t7\t8\t9\t10\t11\t12\n2\t4\t6\t8\t10\t12\t14\t16\t18\t20\t22\t24\n3\t6\t9\t12\t15\t18\t21\t24\t27\t30\t33\t36\n4\t8\t12\t16\t20\t24\t28\t32\t36\t40\t44\t48\n5\t10\t15\t20\t25\t30\t35\t40\t45\t50\t55\t60\n6\t12\t18\t24\t30\t36\t42\t48\t54\t60\t66\t72\n7\t14\t ..." (http://eval.in/7177)
<spider-mario> there is room for improvement, I guess
<spider-mario> I’m only a beginner in Ruby
hoelzro has joined #ruby
_br_ has joined #ruby
browndawg has joined #ruby
mvangala has quit [Remote host closed the connection]
Vainoharhainen has quit [Quit: Leaving...]
browndawg has quit [Client Quit]
breakingthings has quit []
sclarson_ has quit [Quit: sclarson_]
bondar has joined #ruby
_br_ has quit [Excess Flood]
hoelzro has quit [*.net *.split]
iamjarvo1 has quit [*.net *.split]
fryguy has quit [*.net *.split]
arusso has quit [*.net *.split]
urrk has quit [*.net *.split]
Hien has quit [*.net *.split]
rynkan has quit [*.net *.split]
DefV has quit [*.net *.split]
seich has quit [*.net *.split]
notbrent has quit [*.net *.split]
lectrick has quit [*.net *.split]
pkondzior__ has quit [*.net *.split]
davidboy has quit [*.net *.split]
dekz__ has quit [*.net *.split]
whitequark has quit [*.net *.split]
drPoggs has quit [*.net *.split]
whitequark has joined #ruby
iamjarvo has joined #ruby
arusso has joined #ruby
sclarson_ has joined #ruby
Vert has quit [Ping timeout: 252 seconds]
pkondzior__ has joined #ruby
dekz__ has joined #ruby
notbrent has joined #ruby
lectrick has joined #ruby
drPoggs has joined #ruby
seich- has joined #ruby
rippa has quit [Ping timeout: 276 seconds]
davidboy has joined #ruby
mahmoudimus has joined #ruby
cdt has quit [Quit: Ex-Chat]
_br_ has joined #ruby
<codezombie> well, kids awake. I guess that means i have to stop. Thanks for the attempts guys. It was fun. :)
maxmanders has quit [Quit: Computer has gone to sleep.]
alvaro_o has quit [Read error: Connection reset by peer]
<davidcelis> Spooner: (1..12) not (1 .. 12)
<davidcelis> spider-mario: *^
<spider-mario> why is that?
noxoc has quit [Quit: noxoc]
mvangala has joined #ruby
alvaro_o has joined #ruby
<davidcelis> treat .. and ... like any other method call
<davidcelis> it's the syntactic idiom
<spider-mario> I’m used to thinking about .. as an operator, and I usually put spaces around them
jeffreybaird has quit [Quit: jeffreybaird]
<spider-mario> oh.
<spider-mario> well, thanks, then
<davidcelis> np
caleb_io has joined #ruby
fermion has quit [Ping timeout: 244 seconds]
MissionCritical has quit [Ping timeout: 260 seconds]
adeponte has joined #ruby
yacks has quit [Ping timeout: 248 seconds]
eykosioux_ has quit [Quit: eykosioux_]
cantonic has quit [Quit: cantonic]
_br_ has quit [Excess Flood]
adambeynon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
Vert has joined #ruby
Vert has quit [Read error: Connection reset by peer]
<banisterfiend> davidcelis: what's that twitter scandal u r all up in
<davidcelis> is that still going on?
megha has joined #ruby
eykosioux has quit [Quit: eykosioux]
<banisterfiend> davidcelis: no idea, just saw it on my feed this morning
<davidcelis> from who? i saw ryan bigg tweeting about it and some people responding to him
<banisterfiend> davidcelis: klabnik and u
<davidcelis> ah
bean has joined #ruby
<davidcelis> yeah this guy chris whitman went crazy
<davidcelis> and flipped out at ryan and myself
<davidcelis> well he was flipping out at me a few times already and then ryan got involved
<banisterfiend> davidcelis: why did he flip out
<davidcelis> basically he runs some no-name startup, i did some contract work for him a while ago, and decided i didn't want to leave portland to go to L.A. and work for him full time
<davidcelis> so he's been pissy ever since, which was over half a year ago
Elhu has quit [Quit: Computer has gone to sleep.]
mockra has joined #ruby
_br_ has joined #ruby
brianpWins has quit [Quit: brianpWins]
<banisterfiend> davidcelis: ah ok
jgrevich_ has joined #ruby
urrk has joined #ruby
Hien has joined #ruby
MattRB has joined #ruby
danneu has joined #ruby
squidBits has joined #ruby
miskander has joined #ruby
arya has quit [Ping timeout: 245 seconds]
jgrevich has quit [Ping timeout: 256 seconds]
jgrevich_ is now known as jgrevich
<failshell> anyone knows why rubgems always reinstall gems even if its installed and has the latest version?
<failshell> any way to prevent that
wchun has quit [Quit: Leaving]
telli has quit [Ping timeout: 244 seconds]
hoelzro has joined #ruby
adeponte has quit [Remote host closed the connection]
Mission-Critical has joined #ruby
DefV has joined #ruby
kpshek has quit []
karasawa has joined #ruby
awarner has quit [Remote host closed the connection]
slainer68 has quit [Remote host closed the connection]
pettsson has joined #ruby
jrist has quit [Ping timeout: 252 seconds]
<CrawfordComeaux> Quick poll: Is this something you'd fund to get to play with and if so, how much would you put in? If not, what could be offered to change your mind - I want to setup a crowdfunding campaign for setting up a system that lets devs play with all social media data related to the super bowl or geotagged as coming from New Orleans from 1/26-2/4. Devs would be able to submit their own data processing components (for www.storm-project.org) or dashboard widgets
<CrawfordComeaux> w/custom queries attached to them.
codezombie is now known as codezombie|away
Mission-Critical is now known as MissionCritical
<bel3atar> CrawfordComeaux: tl;dr
Hanmac has joined #ruby
<CrawfordComeaux> bel3atar: So I should repeat one sentence per line?
benlieb has quit [Quit: benlieb]
nik_-_ has joined #ruby
zph has quit [Quit: Computer has gone to sleep.]
pcarrier has quit []
LL_ has joined #ruby
MattRB has quit [Quit: This computer has gone to sleep]
shevy has quit [Ping timeout: 246 seconds]
skaczor has quit [Quit: Leaving]
cirwin has quit [Quit: Leaving.]
adeponte has joined #ruby
angusiguess has joined #ruby
leonardli has joined #ruby
leonardli has left #ruby [#ruby]
Jacky_ has joined #ruby
sepp2k1 has joined #ruby
jaequery has joined #ruby
rezzack has joined #ruby
lenli has joined #ruby
sepp2k has quit [Ping timeout: 248 seconds]
aantix has joined #ruby
LL_ has quit [Quit: Page closed]
generalissimo has quit [Remote host closed the connection]
chussenot has quit [Quit: chussenot]
Kuifje has quit [Read error: Connection reset by peer]
Axsuul has joined #ruby
ExxKA has quit [Quit: This computer has gone to sleep]
<Gate> CrawfordComeaux: no, but that's because I'm completely disinterested in social networking and the data thereof.
miskander has quit [Quit: miskander]
<CrawfordComeaux> Gate: are the any kinds of data that do interest you?
eldariof has joined #ruby
* Hanmac thinks that he makes an asocial network ... where you baned when you add someone as friend :D
<Gate> CrawfordComeaux: yes. Many. Want examples?
chrismhough has quit [Quit: chrismhough]
<Gate> Hanmac1: Not too far off :)
jaequery has quit [Quit: Computer has gone to sleep.]
<CrawfordComeaux> Gate: yes, please :)
Jamone has quit [Quit: Quit]
Kuifje has joined #ruby
marr has quit [Ping timeout: 260 seconds]
<Gate> CrawfordComeaux: Astronomical Data comes to mind
<Gate> Chemistry and Physics data, or other hard science information
<CrawfordComeaux> we're not so much interested in the social media aspect of the data...that's just a means to an end, which is play with things we normally don't get to
dr_neek has left #ruby [#ruby]
shevy has joined #ruby
<Gate> CrawfordComeaux: I'd probably kill to get to play with the data from the Large Hadron Collider
arturaz has quit [Ping timeout: 244 seconds]
<Gate> I'd do nothing productive without it without another 5 years of education, but It would be fun to put about with
banisterfiend has quit [Remote host closed the connection]
<Gate> Or the data runs from the Italian group that claimed FTL neutrinos
banisterfiend has joined #ruby
kennyvb has quit [Read error: Operation timed out]
n1x has quit [Ping timeout: 245 seconds]
<CrawfordComeaux> lol
etcetera has quit []
<Gate> My eyes are bigger than my stomach, I know :)
Jacky_ has quit [Ping timeout: 245 seconds]
<CrawfordComeaux> Gate: what about this - the datasift package is good for a month
<CrawfordComeaux> so maybe the project runs for a month, with week 1 = super bowl data & weeks 2-4 to be determined
adeponte has quit [Remote host closed the connection]
miskander has joined #ruby
zph has joined #ruby
awarner has joined #ruby
<CrawfordComeaux> could be week 2 = astro, week 3 = health, week 4 = finance (those are just examples)
albakry has joined #ruby
albakry has quit [Changing host]
albakry has joined #ruby
ebraminio has joined #ruby
ffranz has quit [Ping timeout: 246 seconds]
<CrawfordComeaux> do you know of any sources of astro data like LHC that we could potentially tap into?
maz-dev has joined #ruby
<Gate> Unfortunately even if the LHC was data was open and available, its ungodly huge
<Hanmac> i am still disappointed about the LHC ... i wanted something more collosal :P
brianpWins has joined #ruby
jrist has joined #ruby
<CrawfordComeaux> What about astro projects that use LambdaRail or Internet2?
etcetera has joined #ruby
<CrawfordComeaux> Because I've got contacts that can potentially help get access to things on there
adeponte has joined #ruby
<Quadlex> Hanmac: It was a little too small?
Norrin has joined #ruby
* Quadlex wonders what Hanmac is compensating for
<Quadlex> ;P
chrismhough has joined #ruby
noyb has joined #ruby
Norrin has left #ruby [#ruby]
etcetera has quit [Client Quit]
yoshie902a has joined #ruby
kennyvb has joined #ruby
timmow has quit [Ping timeout: 252 seconds]
thomasfedb has quit [Ping timeout: 244 seconds]
<Gate> Hanmac: hoping for some "earth shattering" discoveries, were you?
<Hanmac> like a gash where we could see the other side of the mirror :P
autumn has quit [Ping timeout: 276 seconds]
stnly has quit [Ping timeout: 248 seconds]
rdark has joined #ruby
codezombie|away is now known as codezombie
Neomex has quit [Quit: Neomex]
adeponte has quit [Ping timeout: 260 seconds]
warb0 has quit [Ping timeout: 244 seconds]
<Hanmac> i hope the data of the HLC helps us to get Fussion better working and maybe some day some kind of zero-point energy :D
cirwin has joined #ruby
pu22l3r has joined #ruby
bondar has quit [Quit: Leaving]
samphippen has joined #ruby
n1x has joined #ruby
icole has joined #ruby
cableray has joined #ruby
pkrnj has quit [Quit: Computer has gone to sleep.]
jrist is now known as jrist-gym
epylinkn has joined #ruby
timonv has quit [Ping timeout: 260 seconds]
ffranz has joined #ruby
otters has quit [Ping timeout: 252 seconds]
ffranz has quit [Client Quit]
llaskin1 has joined #ruby
ossareh has joined #ruby
<llaskin1> is there a concept of retry-once in a begin/rescue/end block?
ffranz has joined #ruby
ffranz has quit [Client Quit]
<llaskin1> or do I just have to put it in a counter or some such?
hybris has quit [Read error: Connection reset by peer]
epylinkn has left #ruby [#ruby]
ffranz has joined #ruby
nomenkun has joined #ruby
r4um has quit [Quit: leaving]
j^2 has joined #ruby
breakingthings has joined #ruby
eykosioux has joined #ruby
Guest____ has joined #ruby
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
timonv has joined #ruby
sayan has quit [Ping timeout: 245 seconds]
megha has quit [Quit: WeeChat 0.3.9.2]
epylinkn has joined #ruby
tommyvyo has joined #ruby
eykosioux has quit [Client Quit]
pkrnj has joined #ruby
j^2 has quit [Client Quit]
kold_ has joined #ruby
j^2 has joined #ruby
rynkan has joined #ruby
tmi_ has joined #ruby
codezombie is now known as codezombie|away
aaronmacy has joined #ruby
willatwood has joined #ruby
willatwood has left #ruby [#ruby]
kaen has quit [Remote host closed the connection]
kpshek has joined #ruby
benlieb has joined #ruby
grzywacz has quit [Ping timeout: 256 seconds]
generalissimo has joined #ruby
etcetera has joined #ruby
mercwithamouth has quit [Ping timeout: 246 seconds]
gansam has quit [Quit: Page closed]
mdw has quit [Quit: [self sleep]]
mneorr has joined #ruby
MattRB has joined #ruby
ebraminio has left #ruby ["Leaving"]
mneorr has quit [Read error: Connection reset by peer]
BulleTime has joined #ruby
yoshie902a has left #ruby [#ruby]
mneorr has joined #ruby
tatsuya_o has quit [Remote host closed the connection]
timonv has quit [Ping timeout: 252 seconds]
wchun has joined #ruby
awarner has quit [Remote host closed the connection]
wchun has quit [Read error: Connection reset by peer]
Kuifje has quit [Ping timeout: 246 seconds]
timonv has joined #ruby
<banisterfiend> davidcelis: one thing was a bit lame though, excluding his own messages from that gist
<banisterfiend> davidcelis: this one https://gist.github.com/4583929
<banisterfiend> it's clearly a conversation, yet you only see one guy's side, so it looks (perhaps) a lot more hysterical/crazy than it actually may have been
maxmanders has joined #ruby
maxmanders has quit [Max SendQ exceeded]
fteem has joined #ruby
maxmanders has joined #ruby
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
otters has joined #ruby
tommyvyo has joined #ruby
cascalheira has joined #ruby
ChampS666 has joined #ruby
clj_newb has joined #ruby
kold_ has quit [Remote host closed the connection]
sayan has joined #ruby
DaltonUS has quit [Quit: DaltonUS]
Axsuul has quit [Ping timeout: 240 seconds]
adeponte has joined #ruby
angusiguess has quit [Ping timeout: 240 seconds]
tenmilestereo has joined #ruby
kpshek has quit []
Zolo has joined #ruby
sayan has quit [Excess Flood]
noyb has quit [Ping timeout: 248 seconds]
sayan has joined #ruby
karasawa has quit [Ping timeout: 260 seconds]
fryguy has joined #ruby
aaronmacy has quit [Quit: Leaving.]
havenn has joined #ruby
reset has joined #ruby
reinaldob has quit [Remote host closed the connection]
kpshek has joined #ruby
nwertman_ has quit [Ping timeout: 245 seconds]
noxoc has joined #ruby
codezombie|away is now known as codezombie
inokenty has quit [Remote host closed the connection]
Morkel_ has joined #ruby
DaltonUS has joined #ruby
sclarson_ has quit [Quit: sclarson_]
<Eiam> banisterfiend: kind of weird to think a person that runs a business would act like that =0
wchun has joined #ruby
Morkel has quit [Ping timeout: 252 seconds]
Morkel_ is now known as Morkel
_fliXR- has joined #ruby
ephemerian has joined #ruby
chussenot has joined #ruby
a_a_g has quit [Quit: Leaving.]
MattRB has quit [Quit: This computer has gone to sleep]
advorak has quit [Remote host closed the connection]
<gyre007> is there an easy way how to generate JSON from an array of hashes ?
bricker has quit [Ping timeout: 252 seconds]
<Eiam> to_json ?
<gyre007> does array define to_json method ?
samphippen has quit [Quit: Computer has gone to sleep.]
<Spooner> gyre007, It does if you require 'json' first.
<Eiam> require 'json'
frem has quit [Ping timeout: 248 seconds]
bricker has joined #ruby
sclarson_ has joined #ruby
samphippen has joined #ruby
piotr__ has joined #ruby
<gyre007> Eiam: awesome! thats exactly what im looking for!
benlieb has quit [Quit: benlieb]
piotr_ has quit [Ping timeout: 248 seconds]
<Eiam> I can take softballs like this one all day
<Eiam> next? =)
jonathanwallace has joined #ruby
llaskin has joined #ruby
danneu has quit [Quit: WeeChat 0.3.8]
benlieb has joined #ruby
llaskin has quit [Changing host]
llaskin has joined #ruby
tvw has quit [Remote host closed the connection]
<llaskin> /j #fittit
<llaskin> woops
llaskin has left #ruby [#ruby]
llaskin1 has quit [Ping timeout: 245 seconds]
kirun has joined #ruby
TomyLobo has joined #ruby
codezombie is now known as codezombie|away
jfl0wers has quit [Ping timeout: 245 seconds]
robert_ has joined #ruby
<robert_> what is the hotness for deploying sinatra applications on jruby?
timonv_ has joined #ruby
robert_ is now known as Guest83897
timonv has quit [Read error: Connection reset by peer]
mercwithamouth has joined #ruby
reset has quit [Quit: Leaving...]
Uranio has quit [Quit: while you reading this, a kitty dies]
chussenot has quit [Quit: chussenot]
apeiros_ has joined #ruby
marr has joined #ruby
Vert has joined #ruby
Guest____ is now known as RubNoob
philcrissman_ has joined #ruby
philcrissman has quit [Read error: Connection reset by peer]
Nowaker has joined #ruby
kold_ has joined #ruby
apeiros has joined #ruby
<havenn> Puma
apeiros_ has quit [Read error: Connection reset by peer]
cascalheira has quit [Quit: Linkinus - http://linkinus.com]
_fliXR- has quit [Ping timeout: 256 seconds]
kpshek has quit []
<Nowaker> Hi guys, is there a way to run ruby script directly from shell script? I am trying with ruby < <<EOF (multiline heredoc here) EOF and similar variations without any success. The problem is: I have got a bash script, this has to be a script, and I can't create any other file nowhere. So I have to put Ruby script somehow into this shell script. Any ideas?
sayan has quit [Quit: Leaving]
<havenn> Nowaker: From inside your bash script call out to ruby: ruby -e "puts hi"
MattRB has joined #ruby
<havenn> **"puts 'hi'"
sambio has quit [Ping timeout: 245 seconds]
<Nowaker> okay, -e may be better than passing via stdin... let's see if I can do heredoc easily
Iszak_ has joined #ruby
n1x has quit [Ping timeout: 252 seconds]
<Nowaker> havenn: doesn't look like working. http://wklej.org/hash/11b9359fb54/
banisterfiend has quit [Remote host closed the connection]
w|t has quit [Quit: No Ping reply in 150 seconds.]
<apeiros> Nowaker: just pipe to stdin
<apeiros> echo "puts 'hi'" | ruby
iamjarvo has quit [Remote host closed the connection]
<Nowaker> apeiros: my code will be multiline
<apeiros> and?
<Nowaker> and I don't want to escape ' or " everytime, hence the heredoc needed
<apeiros> is your issue bash or ruby?
<Nowaker> bash and ruby, both actually
<apeiros> multilineinputhere | ruby
<apeiros> how you generate multilineinputhere is up to you
maxmanders has quit [Quit: Textual IRC Client: www.textualapp.com]
chrismhough has quit [Quit: chrismhough]
<Hanmac> you can use <<EOF when you remove -e
havenn has quit [Remote host closed the connection]
<Nowaker> havenn: great, it works. I tried with |, <, echo heredoc | ruby, etc.
<Nowaker> and the simplest solution is just ruby <<EOF ... EOF lol :)
<Nowaker> thanks again
<Nowaker> meant to thank you Hanmac
havenn has joined #ruby
patrikf has left #ruby [#ruby]
heftig has quit [Ping timeout: 245 seconds]
Bidness has joined #ruby
yfeldblum has quit [Ping timeout: 245 seconds]
tatsuya_o has joined #ruby
cool has joined #ruby
havenn has quit [Ping timeout: 260 seconds]
angusiguess has joined #ruby
chrismhough has joined #ruby
<cool> Hello Everyone
chussenot has joined #ruby
berkes has joined #ruby
berkes_ has joined #ruby
<cool> Is anyone here using ruby to build Graphical applications on Linux/Mac/Windows? If yes, what toolkit you are using?
pavilionXP has joined #ruby
drago757 has quit [Quit: drago757]
Jackneill has quit [Ping timeout: 246 seconds]
thufir_ has joined #ruby
heftig has joined #ruby
n1x has joined #ruby
<Hanmac> cool: look for wxRuby and its spawn rwx ... both use wxWidgets wich shows the app in native style on all three platforms
kold_ has quit [Remote host closed the connection]
clocKwize has joined #ruby
main has joined #ruby
clocKwize has quit [Client Quit]
<Iszak_> cool is Java out of the question?
drfreeze has quit [Read error: Operation timed out]
<Hanmac> java is never an option :D
<Iszak_> You could use JRuby with SWT/Swing
<Iszak_> Don't bash Java! For a long time JRuby was faster than MRuby
<cool> Iszak_: swing via Jruby? that's the last option. Hate the ugly GUI & slow startup time
<Iszak_> cool then use SWT
<Iszak_> cool and what do you expect, you're loading a VM, I bet on solaris it's fast.
wf2f has quit []
s0ber_ has joined #ruby
<Iszak_> cool how complex of the GUI? shoes might be an option
Bidness has left #ruby [#ruby]
<Hanmac> iszak_ and read news anbout new security leaks in java each a week?
drfreeze has joined #ruby
<cool> Iszak_: well, lets say we ignore slow startup time. still it looks ugly! any way to fix that?
<Iszak_> cool SWT
<nmeum> what exist status is returned by kernel#abort? http://www.ruby-doc.org/core-1.9.3/Kernel.html#method-i-abort
<Hanmac> cool did you look at wxWidgets? it looks native on all platforms
s0ber has quit [Ping timeout: 248 seconds]
<Iszak_> cool yeah wxWidgets is a good option too.
s0ber_ is now known as s0ber
<cool> Hanmac: That's happens when you force a full-felded programming language into browser
dougireton has joined #ruby
<cool> Hanmac: Yes, Development Status =>The current wxRuby version is [2.0.1], released on 9 Sep 2009
<cool> so last release 3-4years back. doesn't seem active
<Hanmac> cool that why i said that rwx is its spawn
Will_Pierce has joined #ruby
<Iszak_> Hanmac link?
<cool> Hanmac: oh wait! your are the developer?
arkiver has quit [Quit: Leaving]
hadees has joined #ruby
jfl0wers has joined #ruby
Beoran has joined #ruby
<Iszak_> no readme...
etcetera has quit []
<cool> if yes, then you should add a README ASAP. projects specially open source are dead without it
<Hanmac> Iszak_ yeah i am currently to less time ... you can look at the other repositories what i have done :P
<Gate> Anyone suggest a way to do JS enabled request specs on a site which uses capybara as part of its primary functionality?
<Iszak_> I really wish there were more mature, maintained GUI libraries for Ruby.
<Hanmac> besides some minimal changes my rwx is similar to wxRuby ... (there should be some test folder ?)
orcris has joined #ruby
<cool> Iszak_: +1
<Iszak_> cool the reason I suggested JRuby is because it's maintained, you have access to Java's extensive API so no need to hunt for 3rd party libraries and it's cross platform.
solitude88 has quit [Quit: Leaving...]
Will_Pierce has left #ruby [#ruby]
mneorr has quit [Remote host closed the connection]
<Hanmac> Isazak_ my would be more maintrained when i have more developers ... just image what i alone have done, in less the time entire wxRuby takes ...
moshee has quit [Ping timeout: 256 seconds]
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
<cool> Iszak_: its sad to use java but you are right. the JAVA is pretty extensive. so makes sense to use it
<Iszak_> Hanmac oh I applaud you for what you're doing and I would like to see a maintained version of wxWidgets for Ruby as a strong alternative to JRuby/Swing/SWT
<Iszak_> cool if you can, maybe a web app that can be bundled up and distributed?
berkes_ has quit [Quit: Ex-Chat]
fermion has joined #ruby
aantix has quit [Quit: aantix]
tndrbt has joined #ruby
MattRB has quit [Quit: This computer has gone to sleep]
<cool> Iszak_: good point
yfeldblum has joined #ruby
jblack has quit [Read error: Operation timed out]
statarb3 has quit [Read error: Connection reset by peer]
etcetera has joined #ruby
jrist-gym is now known as jrist
statarb3 has joined #ruby
statarb3 has quit [Changing host]
statarb3 has joined #ruby
* Hanmac try to capure more developers in this channel for his evil projects :P
zph has quit [Quit: Computer has gone to sleep.]
karasawa has joined #ruby
slainer68 has joined #ruby
Takehiro has quit [Read error: Connection reset by peer]
angusiguess has quit [Ping timeout: 255 seconds]
Monie has joined #ruby
jaequery has joined #ruby
eka has quit [Ping timeout: 252 seconds]
<Spooner> Hanmac, Ah, I was looking at wxruby recently. Yours is magically better, eh?
Takehiro has joined #ruby
<Amnesia> hm question
n1x has quit [Ping timeout: 240 seconds]
<Amnesia> what's the difference between being undefined and being nil?
eka has joined #ruby
karasawa has quit [Ping timeout: 252 seconds]
mneorr has joined #ruby
grzywacz has joined #ruby
kpshek has joined #ruby
danneu has joined #ruby
nomenkun has quit [Remote host closed the connection]
pu22l3r has quit [Remote host closed the connection]
<Hanmac> Spooner: yes, in my gem you dont need this ugly ID_NEW constants, just use :new or any other symbol and my gem matchs them to the currect value ...
<Hanmac> Amnesia they are a bit different in the deep of ruby .. (i also have seen an zombie type :D )
<Amnesia> o0
<Spooner> Hanmac, I was quite happy using @button - no idea why GUI toolkits dislike using Ruby variables :D
<Spooner> But then, I suppose in your example you are reading from XML nonsense, so names make more sense there.
mockra has quit [Remote host closed the connection]
mercwithamouth has quit [Ping timeout: 248 seconds]
<Amnesia> Hanmac: zombie type, wtf?
codezombie|away is now known as codezombie
jaequery has quit [Quit: Computer has gone to sleep.]
headius has quit [Quit: headius]
<Spooner> Amnesia, An undefined variable/constant has never been defined. nil is a value like any other, but represents the lack of a value.
<Amnesia> hm ok
<Amnesia> ty
<Hanmac> yeah i need more samples ... (the xml is one of the formats, so you could make your guis with an editor and then load the maked layout with my gem)
<Spooner> frog = nil # is defining frog
timonv has joined #ruby
caleb_io has quit [Quit: caleb_io]
<Spooner> Hanmac, I prefer to dynamically generate GUI. However, although I had a momentary need for a Ruby GUI the other week, I might not need one again, so ignore me.
dr_neek has joined #ruby
mantas322 has joined #ruby
<mantas322> hey guys I know this is super easy to do, probably like one line of code
<Amnesia> Spooner: that clears stuff up
<Amnesia> ty
<mantas322> I have an array ofnumbers and i want to iterate through it subtracting 1 from each number
timonv_ has quit [Read error: Connection reset by peer]
<codezombie> davidcelis: So, you obviously like portland? I'm actually moving to the area this year.
<Spooner> Hanmac, Having less segfaults when you don't give the right params would be a boon over wxruby :D
<Hanmac> Amnesia & others: https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L478 << there is the zombie type ... a few lines above you can see the undef type
Xeago has joined #ruby
<mantas322> and reassign my new values to the original array
<Amnesia> dafuq
Rym has quit [Ping timeout: 260 seconds]
<Spooner> mantas322, [2, 3, 4].map {|i| i - 1 } #=> [1, 2, 3]
* Xeago hates the moments when your laptop is too cold to use..
<mantas322> Thanks spooner
<nazty> anyone use netbeans and ruby
<Spooner> mantas322, To change the original array, just use map! instead.
<Hanmac> Spooner, i need to investigate more, but my gem should be more segfaultsafe ... (your windows get not undefined when you forgot to asign them to an variable)
cobragoa_ has joined #ruby
<mantas322> wierd.
gutsiest60 has quit [Ping timeout: 248 seconds]
<Spooner> Hanmac, Yeah, hand-made bindings should be more solid than presumably auto-generated ones.
MattRB has joined #ruby
phinfonet has joined #ruby
MattRB has quit [Client Quit]
<Hanmac> Spooner with a bit black magic, i tamed the GC and the C++ objects keep the Ruby Objects alive ... so as long the C++ lives the ruby object lives too
<Spooner> Goodo!
toekutr has joined #ruby
<Hanmac> it may not 100% safe yet, but better then using swig
haxrbyte has joined #ruby
sclarson_ has quit [Quit: sclarson_]
<mantas322> follow up question, it works by the way spooner, I have ARRAY = ARRAY.map {|i| (i - 4.00).round(2) } <--- can i put in a round 2 decimal places?
haxrbyte_ has joined #ruby
<Spooner> Hanmac, Aye.
elico has quit [Quit: elico]
snearch has joined #ruby
n1x has joined #ruby
<Spooner> mantas322, ARRAY.map! not ARRAY = ARRAY.map
<mantas322> I did that and it didnt work
<canton7> and you're changing constants, which is a bit ick
aarkerio has joined #ruby
<danneu> why is a constant-looking variable being mutated
solitude88 has joined #ruby
<mantas322> ARRAY.map {|i| (i - 4.00).round(2) } doesnt change my ARRAY's values
<danneu> mantas322: map! vs map
<Spooner> ARRAY.map! Look at the !!!!!!!
<mantas322> oh
<Hanmac> danneu, because it can :D
reset has joined #ruby
<mantas322> oh that works
<mantas322> thanks
<Hanmac> you can forbit it with increasing the $SAFE variable
haxrbyte has quit [Ping timeout: 248 seconds]
* mantas322 wants an appropriate IDE for this...
<danneu> for what
<mantas322> typing ruby
<danneu> evaluating ruby and seeing output?
jaequery has joined #ruby
<blazes816> where you're going, you don't need IDEs
<Spooner> danneu, No, fixing logical errors and cut-and-paste failures :D
NsOmNiAc has quit [Quit: leaving]
ryanf has joined #ruby
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
<danneu> ruby has some of the most scannable docs of any language i work with. for instance: http://ruby-doc.org/core-1.9.3/Enumerable.html
kpshek has quit []
dougireton has quit [Quit: Leaving.]
Takehiro has quit [Read error: Connection reset by peer]
etcetera has quit []
<Amnesia> anyone using vim over here by any chance?
<aarkerio> hi! in: foo_var ||= some_method(param)
<mantas322> my coworker is, he raves about it
<aarkerio> what "||=" means?
<mantas322> "you hit ctrl this to do this, and ctrl this to do this!"
osaut has quit [Quit: osaut]
miskander has quit [Quit: miskander]
kpshek has joined #ruby
samphippen has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
ChampS666 has quit [Ping timeout: 252 seconds]
<workmad3> aarkerio: it's 'or-equals'
etcetera has joined #ruby
<blazes816> aarkerio: set foo_var equal to some_method(param) if and only if foo_var is nil
<workmad3> aarkerio: similar to what you'd expect from '+/'
<workmad3> err, += even
<canton7> blazes816, or false :P
<aarkerio> thx!!
Takehiro has joined #ruby
<blazes816> or false
miskander has joined #ruby
<workmad3> blazes816: it's where I like to employ the term 'falsy' :)
<blazes816> yeah, falsy is a good word, that's truthy
<workmad3> :D
nwertman has joined #ruby
Zolo has quit [Remote host closed the connection]
havenn has joined #ruby
n1x has quit [Ping timeout: 245 seconds]
Iszak_ has quit []
clocKwize has joined #ruby
zph has joined #ruby
albakry has quit [Quit: Leaving]
dougireton has joined #ruby
moshee has quit [Ping timeout: 256 seconds]
whowantstolivef1 has joined #ruby
ChampS666 has joined #ruby
moshee has joined #ruby
S1kx has quit [Read error: Connection reset by peer]
banisterfiend has joined #ruby
pkrnj has quit [Ping timeout: 256 seconds]
mach1ne has joined #ruby
<mach1ne> how do you iterate through a 2d array in ruby?
havenn has quit [Ping timeout: 240 seconds]
<Quadlex> mach1ne: There's lots of ways... What are you trying to do with the array?
sclarson_ has joined #ruby
<mach1ne> trying to step through it in a double loop
adeponte has quit [Ping timeout: 252 seconds]
<mach1ne> i need to be able to access each element by x and y coords
<mantas322> are you trying to solve a euler problem!?
<mach1ne> no its for a game
adeponte has joined #ruby
clocKwize has quit [Quit: clocKwize]
techhelp has joined #ruby
BulleTime_ has joined #ruby
<mach1ne> im using it with ncurses to draw the map
<mantas322> dont you want a ruby equivelent of a jagged array?
bluenemo has quit [Ping timeout: 252 seconds]
<mantas322> or multidimentional, I donno im new to ruby :)
pkrnj has joined #ruby
BulleTime has quit [Ping timeout: 256 seconds]
<mach1ne> mantas322: shut up
<ericwood> ruby equivalent of a Jagger array
BulleTime_ is now known as BulleTime
<mantas322> u shut up!
<mach1ne> im used to doing it the c way
<workmad3> mantas322: a jagged array is an array of arrays where the sub-arrays aren't the same length
<workmad3> ruby doesn't have a built-in concept of multi-dimensional arrays btw
<mantas322> yeah, i know , thats why i suggested the other one
cableray has quit [Quit: cableray]
<workmad3> chances are he wants a square array though ;)
hotovson has quit [Remote host closed the connection]
<mantas322> chances are he just wants attention.
<RubyPanther> mach1ne: each_with_index
<ericwood> each_with_windex
mantas322 has quit [Quit: Page closed]
<workmad3> mach1ne: if you want it just initialised to 0 though, just do map_grid = Array.new(MAP_WIDTH) { Array.new(MAP_HEIGHT, 0) }
<mach1ne> :in `[]': can't convert Array into Integer (TypeError)
<RubyPanther> does that call #clean! on each object or something?
<RubyPanther> mach1ne: sounds like a problem, don't do that
<ericwood> yes
<mach1ne> i think the syntax works differently than how i think it does
<mach1ne> how do you access an individual element of a 2d array
<RubyPanther> Maybe I'm doing it wrong, but I know when I do anything C-style I expect to have to read a whole book first.
_adeponte has joined #ruby
heftig has quit [Ping timeout: 245 seconds]
<mach1ne> ruby is tricky because its so much simpler than it ought to be
adeponte has quit [Ping timeout: 256 seconds]
<Amnesia> anyone using vim over here..?
<mach1ne> so it throws you off and makes you do everything in complicated ways needlessly
gyre007 has quit [Remote host closed the connection]
<mach1ne> i am
<Spooner> mach1ne, grid.each {|row| row.each {|cell| puts cell } }
<berkes> Amnesia, yup
<RubyPanther> No, Matz shows us that it ought to just do what you would expect.
<Amnesia> I somehow need to know what if/when etc is linked to a specific "end" keyword...
<Spooner> Well, print or whatever you are suing.
pkrnj has quit [Client Quit]
<Amnesia> cause this is driving me nuts :/
<workmad3> mach1ne: map_grid[x][y]
Nowaker has left #ruby [#ruby]
<Spooner> mach1ne, grid.each {|row| row.each {|cell| print cell } puts }
love_color_text has joined #ruby
<Amnesia> berkes: does that sound familiar or did you find a way to achieve that?
hide_ has joined #ruby
<Amnesia> perhaps some highlighting or something..
<Amnesia> or vertical lines
<berkes> Amnesia, gimme a sec. It was a plugin that made vim recognise them as blocks.
n1x has joined #ruby
hide_ has quit [Client Quit]
tndrbt has quit [Quit: tndrbt]
<mach1ne> map[x][y] doesnt seem to work
mneorr has quit [Remote host closed the connection]
<workmad3> mach1ne: obviously you need to replace x and y with numbers
hotovson has joined #ruby
tvw has joined #ruby
<Amnesia> berkes: ty
<RubyPanther> puts [[:one,:two],[:buckle,:my,:shoe]][0][1] # works for me
<berkes> Amnesia, textobj-rubyblock (https://github.com/berkes/dotvim/tree/develop/bundle) It needs textobj-user too.
<mach1ne> map_grid = Array.new(MAP_WIDTH) { Array.new(MAP_HEIGHT, 0) }
<mach1ne> print map_grid[3][4]
<mach1ne> doesnt work
eldariof has quit []
<RubyPanther> mach1ne: if you're saying Array.new then I already know you didn't even read a basic beginners book
jaequery has quit [Quit: Computer has gone to sleep.]
benlieb has quit [Quit: benlieb]
heftig has joined #ruby
<Amnesia> berkes: may I pm you with some questions?
<mach1ne> ah
<mach1ne> theres that wonderful ruby community
<mach1ne> ive heard so much about
<RubyPanther> start from saved files, ask for live tutoring after you have some real questions
<berkes> Amnesia, allows % to move between do/end and `var`, `vir` to select outer/inner blocks and all the verbs (like dar, dir, yar, yir etc)
mach1ne has quit [Quit: leaving]
<canton7> RubyPanther, he's using the block initialisers... Is there a way to do that without Array.new ?
<Spooner> mach1ne, Saying "doesn't work" is terribly unhelpful.
havenn has joined #ruby
mneorr has joined #ruby
gyre007 has joined #ruby
<Amnesia> berkes: pm ?
ryanf has quit [Ping timeout: 240 seconds]
horofox has quit [Quit: horofox]
pkrnj has joined #ruby
<ericwood> am
hotovson has quit [Read error: No route to host]
<RubyPanther> canton7: { [MAP_HEIGHT,0] } at least but the whole construct isn't even used normally.
RagingDave has quit [Quit: Ex-Chat]
benlieb has joined #ruby
timonv has quit [Remote host closed the connection]
JumpMast3r has joined #ruby
<codezombie> Does anyone have any interesting links on best practices for subclassing? I've got a friend here who's subclasses array just to make his object "prettier", and I'm completely oppsed to this, but he keeps throwing up reasoning like "Rails does it".
timonv has joined #ruby
<workmad3> codezombie: rails doesn't subclass array, afaik
Criztian has joined #ruby
mockra has joined #ruby
<workmad3> codezombie: what it *does* do is create thin proxies around arrays in various places to add functionality
<codezombie> one example
<havenn> Just subclassed array the other day: https://gist.github.com/4571128
miskander has quit [Quit: miskander]
<workmad3> codezombie: ok, good counter-point :)
<RubyPanther> codezombie: subclassing is normally only done when it is a base class that isn't used directly, for example Numeric where you need to implement the Numeric interface
<workmad3> codezombie: flip-side, not everything in rails is a good coding principle
<RubyPanther> for arrays and other end-user types that is not normally done, you would want mixins
<codezombie> RubyPanther: so something more like include Enumerable
<RubyPanther> yeah, exactly
<workmad3> arrays are a particularly bad idea for subclassing, because it's *really* easy to suddenly end up with a normal array again
mengu has quit [Quit: Konversation terminated!]
<codezombie> glad to know I wasn't just blowing hot air :)
bluenemo has joined #ruby
<RubyPanther> we don't do multiple inheritance so subclassing often can't do what you need, but mixins always work. So that is usually right.
miskander has joined #ruby
nkr has quit [Quit: Linkinus - http://linkinus.com]
dougireton has quit [Quit: Leaving.]
<RubyPanther> something like ActiveRecord subclassing is done as a convenience and... you're intentionally being subservient to AR. You're saying, okay, AR is the important thing, I'm just adding my methods. On your own class Array is not likely to be a valid master to bow to.
timonv has quit [Ping timeout: 245 seconds]
mockra has quit [Ping timeout: 240 seconds]
<workmad3> codezombie: if proxy objects and delegators weren't so easy to do in ruby, it would be a bit of hot air :)
<codezombie> Much thanks for the info. This is pretty much what I was telling him. He just got done reading the ruby metaprogramming and object oriented design book I linked him, and he's doing a lot of experimenting.
<workmad3> oh dear
zph has quit [Quit: Computer has gone to sleep.]
chussenot has quit [Quit: chussenot]
<RubyPanther> I'd hide from him for 3 months, let some meta-chickens come home
grzywacz has quit [Ping timeout: 245 seconds]
* workmad3 forsees many classes crammed full of metaprogramming in codezombie's future
w|t has joined #ruby
w|t has quit [Changing host]
w|t has joined #ruby
<codezombie> nah, I try to be more direct, but still keep metaprogramming as an option.
arietis has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<codezombie> clear code is pretty important in my book.
<workmad3> codezombie: if you really want to make it complete, give him a design patterns book, and wait to see how many patterns he tries to meta-program into a single object ;)
rdg has joined #ruby
whowantstolivef1 has quit [Quit: quit]
miskander has quit [Client Quit]
<codezombie> haha
zommi has quit [Quit: Leaving.]
<workmad3> codezombie: I've heard of someone managing to get about 16 patterns from the original GoF book into a class before someone noticed and took away his keyboard privileges
<codezombie> He didn't think that was funny.
<codezombie> haha
<codezombie> ah yeah, I've seen that one.
dougireton has joined #ruby
<workmad3> codezombie: just let him know that he can subclass Array... but he opens himself up to this sort of mocking ;)
jaequery has joined #ruby
<ericwood> class Nil; def method_missing(&foo); return true; end; end
Takehiro has quit [Remote host closed the connection]
<ericwood> now things will fail in new and more interesting ways
<workmad3> ericwood: *foo surely?
banisterfiend has quit [Remote host closed the connection]
banisterfiend has joined #ruby
<ericwood> it doesn't really matter
benlieb has quit [Quit: benlieb]
<workmad3> ericwood: well, &foo and no other params will cause argument list errors
<ericwood> >> class Nil; def method_missing(&foo); return true; end; end; nil.asdfasdf
<eval-in> ericwood: Output: "/tmp/execpad-56db36cdc1f6/source-56db36cdc1f6:1:in `<main>': undefined method `asdfasdf' for nil:NilClass (NoMethodError)\n" (http://eval.in/7338)
<ericwood> huh
<codezombie> now, I just need a book/video on how not to overthink my projects.
Umren has quit [Read error: Connection reset by peer]
<workmad3> >> class NilClass; def method_missing(&foo); return true; end; end; nil.asd
<eval-in> workmad3: Output: "/tmp/execpad-94046addc7f1/source-94046addc7f1:1:in `method_missing': wrong number of arguments (1 for 0) (ArgumentError)\n\tfrom /tmp/execpad-94046addc7f1/source-94046addc7f1:1:in `<main>'\n" (http://eval.in/7339)
FifthWall has joined #ruby
<workmad3> >> class NilClass; def method_missing(*foo); return true; end; end; nil.asd
<eval-in> workmad3: Output: "" (http://eval.in/7340)
<ericwood> asdfasdf
icole has quit [Remote host closed the connection]
<ericwood> codezombie: this may be what you're looking for: http://programming-motherfucker.com/
<workmad3> >> def method_missing(*foo); foo.map(&:to_s).join(" "); end; p what do you want?
<eval-in> workmad3: Output: "/tmp/execpad-df7194b6b180/source-df7194b6b180:1: syntax error, unexpected $end, expecting keyword_end\n...(\" \"); end; p what do you want?\n... ^\n" (http://eval.in/7341)
<ericwood> workmad3: heh
<codezombie> RubyPanther: brilliant.
<workmad3> bah
<codezombie> whoops
<codezombie> ericwood
jds_ has joined #ruby
jpfuentes2 has joined #ruby
ryanf has joined #ruby
<ericwood> workmad3: I remember seeing something like that in a ruby conference presentation...the guy was like, BAM! Literate programming!
generalissimo has quit [Remote host closed the connection]
<workmad3> >> def method_missing(*foo); foo.map(&:to_s).join(" "); end; p do stuff;
<eval-in> workmad3: Output: "/tmp/execpad-0504d59d2679/source-0504d59d2679:1: syntax error, unexpected $end, expecting keyword_end\ndef method_missing(*foo); foo.map(&:to_s).join(\" \"); end; p do stuff;\n ^\n" (http://eval.in/7342)
jaequery has quit [Client Quit]
<workmad3> nope, can't figure it atm
<RubyPanther> I love programming-mf it is awesome like Zed especially the learn code the hard way stuff. If that is the right way, we were doing it right in the 80s lololol
<codezombie> I have to say I love ruby... However, I've never seen so much drama in a community, like I do in ruby. (mostly rails, but still quite a bit of ruby based drama.)
samphippen has joined #ruby
bcx has left #ruby [#ruby]
<codezombie> I like to think that this is due to ruby being such an easy language to really enjoy.
generalissimo has joined #ruby
<ericwood> if you ignore a handful of people there's no drama
<ericwood> just keep up with what tenderlove does, he's mostly just happy
<RubyPanther> Zed is drama in the sense of, drama class
<ericwood> RubyPanther: Zed enjoys getting angry for the sake of getting angry
<ericwood> it's like a hobby
<codezombie> ericwood: yeah, I've seen a few videos from confrences he's spoken at, and I enjoyed them.
<RubyPanther> I value programming-mf and Rails is a Ghetto more than I value mongrel, so I'm glad he has that hobby :)
<blazes816> tenderlove the will smith of rails core; rapping happy
Guest83897 has quit [Quit: Leaving]
jaygen has joined #ruby
<RubyPanther> I've watched his presentation on Journey like 50 times since there is no documentation
cableray has joined #ruby
<RubyPanther> That is Ruby, they make a movie and forget to write the book
timonv has joined #ruby
<ericwood> idk, the situation is much better than it is with many open-source communities
<ericwood> like JS :(
RubNoob has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<RubyPanther> JS we can always use code samples from the 90s if there is nothing new, everything has been written in JS 3 times by now
rdg has quit [Quit: ttfn]
cableray has quit [Read error: Connection reset by peer]
main has quit [Ping timeout: 240 seconds]
aarkerio has left #ruby ["Leaving"]
cableray has joined #ruby
tmi_ has quit [Quit: tmi_]
thone_ has joined #ruby
mneorr has quit [Remote host closed the connection]
dougireton has quit [Quit: Leaving.]
sclarson_ has quit [Quit: sclarson_]
mneorr has joined #ruby
thone has quit [Ping timeout: 252 seconds]
jeffsmykil has quit [Quit: jeffsmykil]
postmodern has joined #ruby
jds_ has quit [Remote host closed the connection]
ckrailo has joined #ruby
sailias has quit [Quit: Leaving.]
Astral_ has quit [Read error: Connection reset by peer]
lenli has quit [Read error: Connection reset by peer]
Astral_ has joined #ruby
emmanuelux has joined #ruby
dougireton has joined #ruby
appamatto has quit [Changing host]
appamatto has joined #ruby
greenarrow has quit [Quit: IRC is just multiplayer notepad]
greenarrow has joined #ruby
Criztian_ has joined #ruby
sclarson_ has joined #ruby
tokyo has left #ruby [#ruby]
clj_newb has quit [Ping timeout: 248 seconds]
timonv has quit [Remote host closed the connection]
<Eiam> yeah code samples from the 90s what could possibly be wrong with those
timonv has joined #ruby
Criztian has quit [Read error: Connection reset by peer]
clj_newb has joined #ruby
noyb has joined #ruby
peteyg has joined #ruby
rdark has quit [Ping timeout: 246 seconds]
miskander has joined #ruby
phinfonet_ has joined #ruby
phinfonet has quit [Ping timeout: 252 seconds]
banisterfiend has quit [Remote host closed the connection]
ryanf has quit [Ping timeout: 256 seconds]
apeiros has quit [Remote host closed the connection]
nkts has quit [Remote host closed the connection]
timonv has quit [Ping timeout: 248 seconds]
codezombie is now known as codezombie|away
Jacky_ has joined #ruby
[Neurotic] has joined #ruby
benlieb has joined #ruby
sambio has joined #ruby
clj_newb has quit [Ping timeout: 256 seconds]
Takehiro has joined #ruby
phinfonet_ has quit [Client Quit]
ryanf has joined #ruby
phinfonet has joined #ruby
katherinem13 has quit [Quit: leaving]
katherinem13 has joined #ruby
Morkel has quit [Quit: Morkel]
cableray_ has joined #ruby
codezombie|away is now known as codezombie
JarJar has joined #ruby
ner0x has quit [Quit: Leaving]
cableray has quit [Ping timeout: 248 seconds]
cableray_ is now known as cableray
dougireton has quit [Quit: Leaving.]
rdark has joined #ruby
apeiros_ has joined #ruby
dmiller has joined #ruby
fteem has quit [Ping timeout: 252 seconds]
Criztian_ has quit [Ping timeout: 260 seconds]
beneggett has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<graft> can someone explain to me what the lexical scope of a proc is?
benlieb has quit [Quit: benlieb]
<graft> if I call a proc from some method, why doesn't it have the scope of the method?
Kakera has quit [Ping timeout: 252 seconds]
cjs226 has quit []
sclarson_ has quit [Quit: sclarson_]
icole has joined #ruby
<graft> it seems to have the scope of wherever it was first written
banisterfiend has joined #ruby
<Spooner> graft, Look up closures.
Criztian has joined #ruby
griffindy has quit [Quit: Computer has gone to sleep.]
berkes has quit [Quit: Ex-Chat]
xAndy is now known as xandy
cableray has quit [Ping timeout: 240 seconds]
cableray has joined #ruby
dougireton has joined #ruby
horofox has joined #ruby
haxrbyte_ has quit [Remote host closed the connection]
philcrissman_ has quit [Remote host closed the connection]
cobragoa_ has quit [Remote host closed the connection]
<Spooner> graft, Or, to put it another way, that is exactly how they are supposed to work and it is very useful in many circumstances.
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
<graft> yeah, i'm just ignorant
RagingDave has joined #ruby
matled- has joined #ruby
ViPi has quit [Quit: Computer has gone to sleep.]
workmad3 has quit [Ping timeout: 248 seconds]
<apeiros_> the scope of procs depends on how they're invoked
<apeiros_> with regards to local variables, they close over the scope within which they're defined
mockra has joined #ruby
cableray has quit [Client Quit]
Rym has joined #ruby
<apeiros_> with regards to instance variables, it is the same, except if they are instance_ or class_eval'ed (module_eval == class_eval btw.)
emergion has joined #ruby
_nitti has quit [Remote host closed the connection]
<apeiros_> with regards to constants I'm actually not sure
phinfonet_ has joined #ruby
cableray has joined #ruby
<graft> well, for example, can i define a proc in the class and invoke it in an instance with instance-level scope?
<apeiros_> yes, using instance_eval
matled has quit [Ping timeout: 264 seconds]
matled- is now known as matled
<apeiros_> or instance_exec
<Spooner> graft, But you could just as well just have another instance method in that case.
rdark has quit [Ping timeout: 256 seconds]
ForSpareParts has joined #ruby
noxoc has quit [Quit: noxoc]
<graft> Spooner: possibly, for various reasons i'm experimenting with using procs right now, just trying to see if it's possible
_nitti has joined #ruby
<ForSpareParts> Is there a way to tell exactly what the request that RestClient sends looks like?
<ForSpareParts> I'm trying to add querystring parameters to my request, but the results I'm getting suggest that they aren't actually being added.
phinfonet has quit [Ping timeout: 245 seconds]
daslicious has quit [Ping timeout: 248 seconds]
mockra has quit [Ping timeout: 244 seconds]
aaronm has quit [Quit: Bye!]
kpshek has quit []
<apeiros_> ForSpareParts: use some tool like tcpflow or tcpdump
noxoc has joined #ruby
<apeiros_> alternatively: send the request against your own server
<ForSpareParts> apeiros_, thanks
beiter has quit [Quit: beiter]
embs has joined #ruby
<Eiam> http://www.codinghorror.com/blog/2013/01/the-end-of-ragequitting.html ha, calling out _why for taking his ball & going home
ngoldman has joined #ruby
grizwako has joined #ruby
<graft> Spooner, apeiros_, very helpful, thanks
<grizwako> hello
<grizwako> ruby's ipython is pry?
tommyvyo has joined #ruby
codezombie is now known as codezombie|away
DaltonUS has quit [Quit: DaltonUS]
<banisterfiend> grizwako: more or less, i guess. What features are you looking for in particular?
<grizwako> general shell for examining language
<banisterfiend> grizwako: then pry is your girl
<grizwako> thanks :)
<banisterfiend> grizwako: check out the screencasts
<banisterfiend> though they're slightly out of date now, but mostly ok
<grizwako> surely will
Nisstyre has joined #ruby
<grizwako> well, for now i need basics, i will figure rest as i go :)
miskander has quit [Quit: miskander]
xandy is now known as xAndy
<apeiros_> grizwako: the one that comes with ruby is irb. pry is definitively a step up from that, though, and a simple `gem install pry` away.
<grizwako> yeah, i come from python and using ipython a lot, so irb kind of does not cut it :)
Monie has quit [Ping timeout: 244 seconds]
failshell has quit [Remote host closed the connection]
<Amnesia> apeiros_: are you using vim by any chance?
mercwithamouth has joined #ruby
<grizwako> anyway, ruby surely has some nice syntax tricks
<apeiros_> Amnesia: I don't do that to me, no.
<Amnesia> ah ok
<Spooner> grizwako, It is all smoke and mirrors :D
dougireton has quit [Quit: Leaving.]
<grizwako> well dunno, i am kind of enjoying what i see
<banisterfiend> grizwako: what features do you use most often in ipython?
dustint has quit [Remote host closed the connection]
<grizwako> uh
<grizwako> that one is hard
<apeiros_> d'oh, I somehow thought ipython was just a repl
<grizwako> oh no, its much more
<grizwako> you can use it as drop in debugger from running app
eroc has joined #ruby
<grizwako> a bit harder to setup but possible
<Spooner> apeiros_, "python -i" is the irb-equivalent, I think.
<grizwako> anyway, i recently started using ipython notebook
<apeiros_> grizwako: well, you can use both irb and pry for that too ;-)
snearch has quit [Quit: Verlassend]
<grizwako> it allows stuff like running some code (class definition)
<banisterfiend> grizwako: we dont have anything like ipython notebook yet
<grizwako> trying some method calls
Bosma has joined #ruby
<grizwako> see that you need change, jsut go to frame back and change def, and reexecute
emergion has quit [Quit: Computer has gone to sleep.]
fteem has joined #ruby
<banisterfiend> grizwako: that's pretty trivial in both pry and irb
<grizwako> yeah, i will try pry surely
yoshie902a has joined #ruby
<banisterfiend> (assuming i get what u mean)
<grizwako> yeah, i assume you do, but its more than that
noyb has quit [Ping timeout: 240 seconds]
<grizwako> sometimes i have running app, and do method changes on live objects (dont do this, i am said its not good practice)
<banisterfiend> grizwako: maybe you could record a showterm if you doing something cool in ipython? im genuinely interested
<banisterfiend> of*
<banisterfiend> grizwako: http://showterm.io
cableray has quit [Quit: cableray]
<grizwako> ok, i will try to cook up something fancy
CrawfordComeaux has left #ruby ["http://quassel-irc.org - Chat comfortably. Anywhere."]
<yoshie902a> How do I get an index position of an array for example. ary = [ [1,2], [2,2], [3,2], [4,2], [5,2], [6,2] ], and I use ary.first.index, I would expect the number 0, but I get #<Enumerator: [1, 2]:index>, what am I doing wrong?
gutsiest60 has joined #ruby
pcarrier has joined #ruby
<Spooner> yoshie902a, You want: ary.index [1, 2]
theRoUS has quit [Ping timeout: 248 seconds]
codezombie|away is now known as codezombie
carloslopes has quit [Remote host closed the connection]
elkclone has joined #ruby
<yoshie902a> Spooner: you misunderstand. for example, I want the index number not value. ary.first, gives me the first position, I want to do something like ary.whatposition and have it tell me position 0
emergion has joined #ruby
<havenn> yoshie902a: ary[0] #=> [1, 2]
<yoshie902a> ary.first.whatposition
<Spooner> ary.index [1, 2] #=> 0
jaequery has joined #ruby
<havenn> yoshie902a: ary[ary.index(ary.first)]
interactionjaxsn has quit [Remote host closed the connection]
thufir_ has quit [Ping timeout: 256 seconds]
<Spooner> yoshie902a, Once you take it out of the array, it doesn't have a position. ary.first isn't in the array!
<havenn> yoshie902a: ary.index(ary.first) #=> 0
<yoshie902a> I'm looping through an array and want to get the index number, what is the best way to do that?
<havenn> yoshie902a: each_with_index
gyre007 has quit [Remote host closed the connection]
Monie has joined #ruby
<Spooner> yoshie902a, That isnt' what you asked. Yeah, #each_with_index (or #with_index on another iterator method)
<yoshie902a> I'm reviewing it now.. thanks!
jgarvey has quit [Quit: Leaving]
Hanmac has quit [Ping timeout: 245 seconds]
mmitchell has quit [Read error: Operation timed out]
cirwin has left #ruby [#ruby]
breakingthings has quit [Read error: Operation timed out]
emergion has quit [Ping timeout: 264 seconds]
thisirs has quit [Read error: Connection reset by peer]
alanp_ has joined #ruby
<yoshie902a> Is there a collect or map with index?
alanp_ has joined #ruby
<codezombie> hmm, coming up with useful inflections for states isn't as easy as I thought.
<apeiros_> yoshie902a: .map.with_index
alanp has quit [Disconnected by services]
alanp_ is now known as alanp
tenmilestereo has quit [Quit: Leaving]
_nitti has quit [Remote host closed the connection]
Raboo_ has joined #ruby
<yoshie902a> perfect, thanks!
thomasfedb has joined #ruby
Monie has quit [Ping timeout: 245 seconds]
grzywacz has joined #ruby
Raboo has quit [Ping timeout: 252 seconds]
jjbohn has quit [Quit: Leaving...]
berserkr has quit [Read error: Connection reset by peer]
mgrayson has quit [Quit: Textual IRC Client: www.textualapp.com]
wargasm has joined #ruby
serhart has joined #ruby
dougireton has joined #ruby
__BigO__ has quit [Remote host closed the connection]
dougireton has quit [Client Quit]
jonahR has quit [Quit: jonahR]
kpshek has joined #ruby
jds_ has joined #ruby
thufir_ has joined #ruby
dougireton has joined #ruby
nik_-_ has quit [Quit: nik_-_]
mengu has joined #ruby
billy_ran_away has quit [Ping timeout: 246 seconds]
jerius has quit [Ping timeout: 255 seconds]
jlast has joined #ruby
Goles has joined #ruby
cr3 has quit [Ping timeout: 256 seconds]
DrCode has quit [Ping timeout: 276 seconds]
tatsuya_o has quit [Remote host closed the connection]
<Eiam> note thats not map_with_index
Goles has quit [Max SendQ exceeded]
Goles has joined #ruby
tekacs has quit [Quit: Disappearing... *poof*]
kpshek has quit []
jds_ has quit [Ping timeout: 246 seconds]
ner0x has joined #ruby
<yoshie902a> Eiam: what is the difference?
elico has joined #ruby
Virunga has quit [Ping timeout: 245 seconds]
jpfuentes2 has quit [Ping timeout: 256 seconds]
sclarson_ has joined #ruby
cjs226 has joined #ruby
elico has quit [Client Quit]
DrCode has joined #ruby
<Eiam> oh oh let me try
<Eiam> yoshie902a: with_index is an enumerator so its taking hte output of map and enumerating it for you yielding the content + an index
<Eiam> which means you could potentially find all sorts of other methods that could call with_index
<Eiam> (beyond map)
spider-mario has quit [Remote host closed the connection]
techhelp has quit [Quit: This computer has gone to sleep]
jpfuentes2 has joined #ruby
chussenot has joined #ruby
<yoshie902a> and map_with_index is just mapping with an index number, without the other methods?
<Eiam> no, its .map.with_index
<Eiam> each_with_index is its own thing
<yoshie902a> got, it you confused me for a second. I thought map_with_index was something else. but it does not exist, right?
<Eiam> righto
<yoshie902a> ok, thanks!
<Eiam> my point was that when you see with_index works on enumerators you can 'enumerate' a lot of things to get the index if it wasn't readily available
<yoshie902a> I understand, thank you!
love_color_text has quit [Remote host closed the connection]
<Eiam> holay shit I just explained something to someone.
* Eiam removes 1 from vampire score
Innocentus has joined #ruby
<banisterfiend> hehe
<Innocentus> what is a rake script?
jaequery has quit [Quit: Computer has gone to sleep.]
<Innocentus> I mean rake is for cgi abstraction / simplification - so why is it also a build tool?
<Eiam> no, its for managing tasks =0
<yoshie902a> if I have a .rb file, called myfile.rb and it contains require files. Can I require myfile.rb in another file, maybe called, mysecondfile.rb?
keyvan has joined #ruby
keyvan has quit [Changing host]
keyvan has joined #ruby
Jacky_ has quit [Ping timeout: 245 seconds]
jfl0wers has quit [Ping timeout: 245 seconds]
<yoshie902a> NVM, I got it working,
jlast has quit [Remote host closed the connection]
cakehero has joined #ruby
tommyvyo_ has joined #ruby
<Innocentus> ah
elaptics is now known as elaptics`away
ViPi has joined #ruby
<Innocentus> and how is that framework called which unifies cgi calls?
ViPi has quit [Max SendQ exceeded]
dougireton has quit [Quit: Leaving.]
tekacs has joined #ruby
ViPi has joined #ruby
cakehero has quit [Client Quit]
havenn has quit [Remote host closed the connection]
jackyalcine has joined #ruby
clj_newb has joined #ruby
havenn has joined #ruby
dougireton has joined #ruby
emergion has joined #ruby
<apeiros_> Innocentus: you mean rack? it's not really cgi calls, though
blacktulip has quit [Remote host closed the connection]
<yoshie902a> if I require a file twice in code, does it load it twice, or see that it's already loaded and skip the load?
<Eiam> yoshie902a: try it out? make two files with the same name, define a method differently in each with the same name & see what happens? =0
<danneu> yoshie902a: the difference between require and load is that require won't load more than once
<danneu> in it's most basic case, at least
<apeiros_> yoshie902a: ri Kernel#require
<apeiros_> it's a normal method and documented.
mockra has joined #ruby
havenn has quit [Ping timeout: 256 seconds]
MissionCritical has quit [Ping timeout: 248 seconds]
dougireton has quit [Client Quit]
<yoshie902a> thanks! I just has two different .rb files that both require nokogiri and I was worried that if I require both files, it would load/require nokogiri twice, which I thought was less efficient. I'll read more on the documents, thanks!
jenrzzz has joined #ruby
tatsuya_o has joined #ruby
gyre008 has joined #ruby
mockra has quit [Ping timeout: 252 seconds]
noxoc has quit [Quit: noxoc]
kold_ has joined #ruby
<graft> if i include module B in class A, module B can't call A's class methods, can it?
v0n has quit [Ping timeout: 245 seconds]
<banisterfiend> graft: yes it can
blaxter has quit [Quit: foo]
Rym has quit [Quit: Rym]
emergion has quit [Ping timeout: 264 seconds]
<graft> like I could do: module B; hello; end; class A; include B; def self.hello; puts :hello; end; end;
nari has joined #ruby
Rym has joined #ruby
<banisterfiend> graft: no, not like that
jimeh has quit [Quit: Computer has gone to sleep.]
<banisterfiend> graft: you can call A's methods inside (instance) methods of B though
pettsson has quit [Quit: Lämnar]
cobragoat has joined #ruby
<graft> yeah... so what's the way to share a bunch of class methods across a bunch of modules, then?
<Eiam> can't you just say B::method to call it?
emmanuelux has quit [Remote host closed the connection]
kirun has quit [Quit: Client exiting]
Monie has joined #ruby
<Innocentus> so ruby runs only on one process? I mean, it is single threaded and not thread safe?
<graft> well i want to be able to have a bunch of modules A, B, C, all of which have the same class methods defined, and then do class D; include A; include B; include C; end
<graft> Innocentus: there is a Thread object
<Eiam> graft: and from D you'd say A::method to call those methods..
dougireton has joined #ruby
<Eiam> although you may as well just include the files outside the class at that point hmm
epylinkn has quit [Quit: Leaving.]
<graft> Eiam: well, let's say I wanted a class method that I called in module A, and the same method that I called in B, etc., where would i define it?
dougireton has quit [Client Quit]
<apeiros_> Innocentus: that's a property of the runtime, not the language
<blazes816> if you want multiple real thread try jruby or rubinious
<apeiros_> the standard ruby uses (iirc) 2 threads, and ruby code is indeed only green-threaded
epylinkn has joined #ruby
<Eiam> I'm not sure I understand the use case, but wouldn't you just have ModuleA::Method1 and ModuleB::Method1 ?
<apeiros_> jruby uses real (jvm-)threads
<apeiros_> rubinius was on its way to remove the GIL last I checked. that's been a while, maybe they're GIL-free
chussenot has quit [Quit: chussenot]
autumn has joined #ruby
<Innocentus> so I can have ruby (with ruby on rails) running multithreaded?
orcris has quit [Ping timeout: 248 seconds]
<Innocentus> and can I spawn threads in ruby?
ashp has left #ruby [#ruby]
<apeiros_> you can spawn green threads in about every ruby implementation
DrShoggoth has quit [Ping timeout: 245 seconds]
freakazoid0223 has joined #ruby
danneu has quit [Quit: WeeChat 0.3.8]
<apeiros_> seems rubinius still considers the 1.x branch the stable one, and that one has a GIL (same approach as "standard" ruby)
gyre007 has joined #ruby
swarley| has joined #ruby
aeontech has joined #ruby
ForSpareParts has quit [Quit: Leaving]
aaronmacy has joined #ruby
noyb has joined #ruby
b1rkh0ff has quit [Ping timeout: 256 seconds]
apeiros_ has quit [Remote host closed the connection]
dagnachew has joined #ruby
MissionCritical has joined #ruby
grizwako has left #ruby [#ruby]
aeontech has left #ruby [#ruby]
dougireton has joined #ruby
elico has joined #ruby
dougireton has quit [Client Quit]
swarley- has joined #ruby
FifthWall has quit [Quit: Computer has gone to sleep.]
Criztian has quit [Remote host closed the connection]
n1x has quit [Ping timeout: 252 seconds]
ChampS666 has quit [Ping timeout: 257 seconds]
swarley| has quit [Ping timeout: 245 seconds]
jlast has joined #ruby