apeiros_ changed the topic of #ruby to: programming language || ruby-lang.org || Paste >3 lines of text in http://pastie.org || Rails is in #rubyonrails
briankbuckley has joined #ruby
dhruvasagar has joined #ruby
brngardner has joined #ruby
__main__ has joined #ruby
LBRapid has joined #ruby
Guest45047 has joined #ruby
luckyruby has joined #ruby
Sailias has joined #ruby
dhruvasagar_ has joined #ruby
adamkitt_ has joined #ruby
dwon has joined #ruby
Guest71832 has joined #ruby
kvirani has joined #ruby
ed_hz_ has joined #ruby
fyolnish has joined #ruby
digdin has joined #ruby
<lectrick> Are backticks (which shell out) blocking operations?
freeayu has joined #ruby
io_syl has joined #ruby
EzeQL has joined #ruby
kinderman has joined #ruby
EvanR has joined #ruby
v4n_ has joined #ruby
kinderman has quit [#ruby]
mdw has joined #ruby
delinquentme has joined #ruby
looopy has joined #ruby
SuperNewb1 has joined #ruby
macabre has quit [#ruby]
dbe has joined #ruby
fayimora has joined #ruby
frishi has joined #ruby
shevy has joined #ruby
mikeg has joined #ruby
fbernier has joined #ruby
<digdin> is better run ruby using root?
<_ack> No.
<digdin> I'm beginner in ruby and I'm trying install ruby rails
iocor has joined #ruby
<_ack> did you install anything?
nim_ has joined #ruby
snip_it has joined #ruby
<digdin> but when I try run "rails server" this happens: http://pastebin.com/PAXdLNzR
<Veejay> digdin: May I suggest you also try your luck in #rubyonrails
<digdin> ok
patrick99e99 has joined #ruby
<patrick99e99> is there any difference between Proc.new {} and proc {}
<patrick99e99> other than the char length?
Beoran has joined #ruby
<Veejay> patrick99e99: AFAIK proc is an alias for Proc.new in Ruby 1.9
<patrick99e99> ok
<patrick99e99> thanks
<Veejay> They used to have slightly different behavior in earlier versions or something
<fowl> ruuuuby
<fowl> tall and powerful
adeponte has joined #ruby
_adeponte has joined #ruby
LiquidInsect has joined #ruby
nari has joined #ruby
yoklov has joined #ruby
hadees has joined #ruby
dbwest has joined #ruby
phantasm66 has joined #ruby
M- has joined #ruby
dbgster has joined #ruby
eisenhower has joined #ruby
dbe has joined #ruby
luxurymode has joined #ruby
Phrogz has joined #ruby
h4mz1d has joined #ruby
dbe has joined #ruby
netrealm has joined #ruby
liluo has joined #ruby
kenichi has joined #ruby
netrealm has joined #ruby
marknyc has joined #ruby
CheeToS has joined #ruby
ooldirty has quit ["Ex-Chat"]
keymone has joined #ruby
xpot-mobile has joined #ruby
luckyruby has joined #ruby
sacarlson has joined #ruby
chimkan_ has joined #ruby
brngardner has joined #ruby
cloke has joined #ruby
manizzle has joined #ruby
raincole__ has joined #ruby
niftylettuce has joined #ruby
<niftylettuce> does anyone know how to properly escape a <div> in markdown? I've tried backslash, converting to entities like &lt;div&gt; etc. ??
wilmoore has joined #ruby
cooper has joined #ruby
keymone has joined #ruby
<patrick99e99> \exit
<patrick99e99> exit
jitesh_shetty has joined #ruby
apok_ has joined #ruby
dbe has joined #ruby
MasterIdler_ has joined #ruby
stringoO has joined #ruby
andrewhl has joined #ruby
AndChat| has joined #ruby
adeponte has joined #ruby
looopy has joined #ruby
td123 has joined #ruby
shtirlic_ has joined #ruby
savage-_ has joined #ruby
mz_ has joined #ruby
nonotza has joined #ruby
fr0gprince_ has joined #ruby
sspiff has joined #ruby
hSATAC has joined #ruby
linoj has joined #ruby
jcromartie has joined #ruby
radic_ has joined #ruby
mxweas_ has joined #ruby
fmendez has joined #ruby
nonotza has joined #ruby
sarpanch has joined #ruby
mbriggs has joined #ruby
jankly_ has joined #ruby
shaggy2dope has joined #ruby
adamkittelson has joined #ruby
delinquentme has joined #ruby
blueadept has joined #ruby
blueadept has joined #ruby
Chryson has joined #ruby
blueadept` has joined #ruby
sarpanch1 has joined #ruby
noyb has joined #ruby
savage- has joined #ruby
jmfcool has joined #ruby
cool has joined #ruby
sarpanch1 has quit [#ruby]
fbernier has joined #ruby
<lectrick> For long_string.match /regex/, how do I get ALL MatchData instead of just the first one?
ed_hz_ has joined #ruby
macmartine has joined #ruby
CannedCorn has joined #ruby
DarthGandalf has joined #ruby
paradisaeidae has joined #ruby
<shadoi> matches[0..-1], or matches.to_a
seanstickle has joined #ruby
<shadoi> I don't know why it doesn't include Enumerable actually… hrmm...
crodas has joined #ruby
adeponte has joined #ruby
chinz has joined #ruby
indeterminate has joined #ruby
danielvdotcom has joined #ruby
hrs has joined #ruby
senthil has joined #ruby
chinz has joined #ruby
Sailias has joined #ruby
ringotwo has joined #ruby
AnswerGuy has joined #ruby
ed_hz_ has joined #ruby
pu22l3r has joined #ruby
philips has joined #ruby
Clordio has joined #ruby
artOfWar has joined #ruby
SegFaultAX has joined #ruby
ben225 has joined #ruby
wroathe has joined #ruby
<wroathe> Is there someplace that has complete documentation of the % notation? Like %w and %Q
redgetan has joined #ruby
_ack has quit ["Leaving"]
shadoi1 has joined #ruby
maletor has joined #ruby
ringotwo has joined #ruby
maletor has joined #ruby
Clordio has joined #ruby
yoklov has joined #ruby
kah_ has joined #ruby
adeponte has joined #ruby
j3r0m3 has joined #ruby
cobragoat_ has joined #ruby
cmarques has joined #ruby
voodoofish has joined #ruby
chimkan_ has joined #ruby
gokul has joined #ruby
straind has joined #ruby
Clordio has joined #ruby
startling has joined #ruby
shadoi has joined #ruby
mxweas_ has joined #ruby
Brandon1 has joined #ruby
manizzle has joined #ruby
prometheus has joined #ruby
voodoofish430 has joined #ruby
adamkittelson has joined #ruby
rippa has joined #ruby
<paradisaeidae> Ruby ISO/IEC FDIS 30170 :: http://t.co/HnoSxil :: Congrats!!
Blaster has joined #ruby
voodoofish430 has joined #ruby
rohit has joined #ruby
manizzle has joined #ruby
Houdini has joined #ruby
io_syl has joined #ruby
Arvind has joined #ruby
davidcelis has joined #ruby
wroathe has joined #ruby
wiickeed has joined #ruby
<wroathe> In practice is there any difference between Module::my_method and Module.my_method?
<banisterfiend_> wroathe: no
<banisterfiend_> wroathe: but ppl dont use Module::my_method :)
<wroathe> WEBrick does :P
<banisterfiend_> wroathe: well you occasionally find pockets of non-idiomatic ruby code, but they're definitely the exception not the rule :)
<banisterfiend_> wroathe: also i think the webrick code base is quite old
<davidcelis> WEBrick moer liek LOLBrick
KL-7 has joined #ruby
BruceZu has joined #ruby
whatnicknololder has joined #ruby
whatnicknololder has quit ["Leaving"]
<Arvind> Hey friends............i am new to Ruby....please tell me if you guys have some media from where i can learn Ruby asap
<wiickeed> I want to make an app that will transform a structure of a xml in to another one but this app has to be web based now i have two concerns here:
<wiickeed> xmls will be from web shops and will be in size from 10-500mb
<wiickeed> 1. execution time and resource consumption
<wiickeed> 2. Limitations when reading files so large
<wiickeed> any suggestions i am conflicted between PHP, Ruby, Java and Python
SeySayux has joined #ruby
<any-key> if you want to translate XML to XML there's always XSLT
<any-key> ruby has some awesome XML parsing libraries and should do what you want without being a resource pig
<any-key> it's worth considering the methods you use for parsing, I feel like that will have the greatest impact
<any-key> for example, if you're using large documents DOM parsers will eat through memory
<any-key> for translating from one structure to another on the fly a SAX parser should do the trick
sarpanch1 has joined #ruby
banjara has joined #ruby
mbriggs has joined #ruby
mbriggs has joined #ruby
ed_hz_ has joined #ruby
sarpanch1 has joined #ruby
<bounce> huh, seems like a luxury problem
<bounce> all those languages are resource pigs, and so is xml
<any-key> ?
<any-key> ah
<any-key> they're all scripting languages
<bounce> the setting also requires at least a web server, possibly an app server
<any-key> he's very vague about it, but Ruby is just as good as any of the other languages listed
<any-key> for this task, that is
<bounce> they will all work given enough hardware to run the problem
<any-key> what would you approach the problem with?
<rippa> well, Java isn't scripting language
<bounce> there's also whether the 500MB of xml can be filtered or needs to be sucked in whole before it can be output
<rippa> it's kind of horrid though
<any-key> I'd approach it with Nokogiri's SAX parser
<any-key> hell, XSLT was invented to solve that kind of thing
looopy has joined #ruby
<any-key> but I hate XSLT on principal
<bounce> awk is a scripting language, and much less of a resource pig. wouldn't want to do xml with it though
<any-key> "Like XML? Wish you could XML with XML? Oh boy do we have a solution for you..."
<any-key> bounce: awk isn't in the same league, this is far from being a good use of it
<any-key> it is not a parser
shruggar has joined #ruby
<bounce> hey, if you're going to do xml, might as well go whole hog like a good little fanboi
<any-key> lets not go down the "parsing XML with regex" path
<bounce> ITYM "principle", not "principal"
<any-key> bounce: yeah sounds like he'll like Java
<any-key> thanks...
<any-key> unfortunately he disappeared immediately after asking his question so nothing said will be of any use
<bounce> oh well
<any-key> lets take this opportunity to hate on XML
<any-key> YAML 4 life
<bounce> it's a bit like... well, it all started with sgml. then html happened. then those whackos at the w3c tried to "improve" upon it
<bounce> I saw a couple blogposts not too long ago about people building impressive apparatuses to distill coffee
<any-key> I switched a project to HAML recently, it looks much better now
<bounce> and boy did it produce potent hi-caf stuff. heart-bursting potent.
<any-key> sounds healthy
<bounce> yeah I don't drink coffee
<any-key> I enjoy it, but nothing that crazy
<any-key> I just like a good cup of dark roast
<bounce> xml is a bit like that. moreso like in that other quote: like violence. if it doesn't solve your problem, you're not using enough of it.
<bounce> you secretly love xml, admit it already. </troll>
<any-key> heh the Nokogiri motto
yxhuvud has joined #ruby
jconnolly has joined #ruby
wilmoore has joined #ruby
<bounce> the thing that gets me, apart from the rampant bloat, fanboiisms, gratuitous adding, and so on, is how one-sided and uselessly imprecise the w3c specs are
savage- has joined #ruby
braap_ has joined #ruby
SeySayux has joined #ruby
<bounce> if you're reading them as a "writer", well, it's vaguely doable. if you're reading them because you're trying to implement a browser or a parser or something, it's suddenly much less useful.
<bounce> something as simple as "what size entity name is legal?" isn't documented anywhere near the part that talks about what they look like. you have to infer it from some other chapter.
a_a_g has joined #ruby
straind has joined #ruby
two- has joined #ruby
blueadept has joined #ruby
blueadept has joined #ruby
artm has joined #ruby
h4mz1d has joined #ruby
Lncn has joined #ruby
<Lncn> Hello
<Lncn> I have two versions of rake installed with rubygems... how do I switch between using the two?
artm has joined #ruby
Cache_Money has joined #ruby
durrhurrmeepderp has joined #ruby
a_a_g has joined #ruby
JohnBat26 has joined #ruby
luckyruby has joined #ruby
juarlex has joined #ruby
Cache_Money has joined #ruby
juarlex has joined #ruby
bluOxigen has joined #ruby
voodoofish430 has joined #ruby
raincole__ has joined #ruby
a_a_g has joined #ruby
dumptruckface has joined #ruby
dumptruckface has quit ["Leaving"]
ghvandoorn has joined #ruby
maletor has joined #ruby
omry has joined #ruby
d3c has joined #ruby
motarded has joined #ruby
Houdini has joined #ruby
ben225 has joined #ruby
x0F__ has joined #ruby
scientes has joined #ruby
<scientes> STR2CSTR(RARRAY_PTR(orig_arg)[i]) --> StringValuePtr(RARRAY_PTR(orig_arg)[i]) ?
CheeToS has joined #ruby
rking has joined #ruby
KL-7 has joined #ruby
djdb has joined #ruby
stephenjudkins has joined #ruby
visof has joined #ruby
visof has joined #ruby
startling has joined #ruby
a_a_g has joined #ruby
sohocoke has joined #ruby
trivol has joined #ruby
Morkel has joined #ruby
moshee has joined #ruby
moshee has joined #ruby
trivol_ has joined #ruby
grafthez has joined #ruby
grafthez has joined #ruby
artm has joined #ruby
grafthez has joined #ruby
* shevy presses any-key
bgupta has joined #ruby
becom33 has joined #ruby
<becom33> how can I work with 3 people on the same project , one of my friend said I can use svn . but Im not sure how that works
<becom33> help ?
<banisterfiend> becom33: your friend is 4 years behind the times
<banisterfiend> becom33: use git ;)
<banisterfiend> becom33: and github, https://github.com
<becom33> banisterfiend, what does git do ?
<banisterfiend> becom33: it allows people to work together on a project :) it's able to incorporate changes from different authors
<banisterfiend> becom33: read up about it
<banisterfiend> it's very cool
nyrb has joined #ruby
<becom33> banisterfiend, on it :) btw if its upload files to the git account while we are develeoping the software , doesnt it alow other users to see our code
<becom33> ?
d3c has joined #ruby
<banisterfiend> becom33: yes it does
<startling> becom33: github lets other see your code unless you pay for private space. you could use bitbucket instead, though
<banisterfiend> becom33: if you dont want that, you can create a private repo on github (but that costs money) or you could use another service, or host it yourself
<startling> (which allows free private repositories)
workmad3 has joined #ruby
trivol_ has joined #ruby
nyrb has joined #ruby
Eartz has joined #ruby
<becom33> I see so I have to install gits locally and use it I guess :/
ephemerian has joined #ruby
<banisterfiend> becom33: no? he just gave you a bunch of possibilities
<banisterfiend> becom33: use bitbucket, or pay like $5 a month to github
setient has joined #ruby
<startling> becom33: or you could use a web server or an ssh server or a shared drive or a thumb drive you pass around or a dropbox account or anything
<becom33> banisterfiend, is does bitbuket alows private space ? I want to have a private space until the application is completely developed \
<startling> becom33: yes, it does.
<becom33> startling, I kinda need to have a clear idea about this . version controlling is it the same thing as file syncing . like in dropbox , ubuntuone ?
<startling> becom33: it's similar
<startling> becom33: it also allows you to undo things, or make branches or forks of a code, and it helps you keep track of versions of code
heftig has joined #ruby
<becom33> startling, so for a example . if I complete with a file , it will be sycned to the server and then other delevelopers boxes if they have connected to the same acocunt ?
<becom33> Staffgiraffe, I see :)
<startling> becom33: not quite. it will sync when they ask for it.
<becom33> startling, aghh ok
zommi has joined #ruby
<startling> becom33: but it also makes it easy to keep differences seperated and to resolve conflicts easily
schovi_ has joined #ruby
<becom33> Im sorry what do mean by resolve conflicts easily ?
<startling> becom33: what do you when two people edit the same line of code?
<workmad3> becom33: http://pragprog.com/book/tsgit/pragmatic-version-control-using-git <-- that's a pretty good intro to version control principles, with examples aimed at git
<becom33> startling, I see . workmad3 thanks
Brandon1 has joined #ruby
Brandon1 has quit [#ruby]
LMolr has joined #ruby
nyrb has joined #ruby
apeiros_ has joined #ruby
greenarrow has joined #ruby
<bounce>
fabrice31 has joined #ruby
nim_ has joined #ruby
sacarlson has joined #ruby
Banistergalaxy has joined #ruby
InBar has joined #ruby
Indian has joined #ruby
stephenjudkins has joined #ruby
pi3r has joined #ruby
nim__ has joined #ruby
johndbritton has joined #ruby
manizzle has joined #ruby
Ammar01 has joined #ruby
tomku has joined #ruby
falena has joined #ruby
blacktulip has joined #ruby
beepbeep_ has joined #ruby
beepbeep_ has quit [#ruby]
Imapickle has joined #ruby
friskd has joined #ruby
Helius has joined #ruby
d3c has joined #ruby
tomku has joined #ruby
a_a_g has joined #ruby
trivol has joined #ruby
BiHi has joined #ruby
ukwiz has joined #ruby
probst has joined #ruby
companion_ has joined #ruby
advorak has joined #ruby
probst has joined #ruby
simao has joined #ruby
jlebrech has joined #ruby
rohit has joined #ruby
DuoSRX has joined #ruby
heftig has joined #ruby
<jlebrech> why do I get this when bundle installing? https://gist.github.com/2290389
twelvechairs has joined #ruby
companion_ has joined #ruby
shruggar has joined #ruby
batmanian has joined #ruby
bluenemo has joined #ruby
jonteru has joined #ruby
stefanp has joined #ruby
stefanp has joined #ruby
scientes has joined #ruby
sente has quit [#ruby]
a_meba has joined #ruby
roolo has joined #ruby
tatsuya_o has joined #ruby
mohits has joined #ruby
digdin has joined #ruby
bawer has joined #ruby
<Tasser> jlebrech, probably there is no yail for java?
<jlebrech> that's obvious
workmad3 has joined #ruby
tatsuya_o has joined #ruby
<jlebrech> but i didn't get why "gem 'yajl'" would even attempt to install the java one
<jlebrech> i have to "gem 'yajl-ruby'" in the end
rohit has joined #ruby
<Tasser> just read something like java
<Tasser> as you didn't give any further information
<banisterfiend> Tasser: what do you think of the german language, compared to english
<Tasser> it's obviously better
<banisterfiend> Tasser: is it like python vs ruby?
tommyvyo has joined #ruby
<Tasser> we got some times less, but some cases more
<Tasser> and apparently the 3 cases are a PITA to learn because they're just irregular
bluenemo has joined #ruby
bier has joined #ruby
<ukwiz> I have recently upgraded from 11.3 to 12.1, and printing to a windows7 shared printer has ceased to work. It looks as though the authentication dialog is not being presented. Does anyone know how to fix this?
jakebaek has joined #ruby
<banisterfiend> ukwiz: what is 11.3 ?
M- has joined #ruby
<ukwiz> oops - sorry! wrong chat. should have been #suse
<banisterfiend> ukwiz: hehe
<Tasser> banisterfiend, or what did you want to hear?
braap has joined #ruby
dubios has joined #ruby
twinturbo has joined #ruby
francisfish has joined #ruby
ixti has joined #ruby
berserkr has joined #ruby
mengu has joined #ruby
kenichi has joined #ruby
gyre007 has joined #ruby
kenichi has joined #ruby
kenichi has joined #ruby
mcwise has joined #ruby
M- has joined #ruby
etehtsea has joined #ruby
niku4i has joined #ruby
ecolitan has joined #ruby
heftig has joined #ruby
mdw has joined #ruby
B|aster has joined #ruby
arturaz has joined #ruby
looopy has joined #ruby
heftig has joined #ruby
SJr has joined #ruby
tvw has joined #ruby
tilde` has joined #ruby
davidpk has joined #ruby
axl_ has joined #ruby
Arvind has quit [#ruby]
axl_ has joined #ruby
Helius has joined #ruby
buschhardt has joined #ruby
JoeSa has joined #ruby
<JoeSa> If code is a string of code, what would "chunk = code[i..-1]" do in Ruby? (I know .. specifies a range, but I don't understand the -1)
<arturaz> -1 means "end"
<JoeSa> So 'chunk' is everything from position 'i' to the end of 'code'?
Bonkers has joined #ruby
<JoeSa> Is that right?
rohit has joined #ruby
<arturaz> yes
<arturaz> <arturaz> % "foo bar"[4..-1]
<arturaz> <multibot_> bar
vectorshelve has joined #ruby
<JoeSa> Ok, thanks! That kind of confuses me more though with a part later in the code XD What happens if you specify two things in a string square brackets, like in "if identifier = chunk[/\A([a-z]\w*)/, 1]"
Squarepy has joined #ruby
a_a_g has joined #ruby
<jlebrech> i'm trying to add an authtoken to header with net::http::post https://gist.github.com/52ad9edf96ffabf7ee6d
<jlebrech> I can't send params as well as headers. how do you do that?
<heftig> JoeSa: start, length
<heftig> ah, sorry
<heftig> with a regexp, selects the returned group
<vectorshelve> I am recording actions using selenium IDE for (firefox plugin) but I am not able to record the type action into tinymce Rich Text Editor.. how can I make that work ?
elliot98 has joined #ruby
elliot98 has joined #ruby
spcshpopr8r has joined #ruby
bluOxigen has joined #ruby
Guedes has joined #ruby
blueOxigen has joined #ruby
Neon has joined #ruby
philcrissman has joined #ruby
manizzle has joined #ruby
Neon has quit ["I has left the channel. Probably still connected to the network though."]
cool has joined #ruby
klip has joined #ruby
theishi has joined #ruby
fixl has joined #ruby
<theishi> I noticed what appears to be a bug with array.delete_if. If I try to compare two strings, it doesn't compare to see if they are exact, but rather whether or not one is a substring of the other
<theishi> Is that expected behavior?
<arturaz> how do you compare?
cool has joined #ruby
ikaros has joined #ruby
<theishi> arturaz: Actually I am using rails c to do the test, and I just realized one of my gems might be causing the problem.... array { |item| item == 'hh' } is how i do it though
cool has joined #ruby
nu7hatch has joined #ruby
<theishi> arturaz: Nevermind. I was having the problem last night actually, and I didn't yet test it again. Now it is working as expected. I suppose I was tired and making some errors
nu7hatch has quit [#ruby]
<theishi> arturaz: thanks
<JoeSa> heftig: Oh right, so does the one mean one word or something? I don't quite understand it
fayimora has joined #ruby
Banistergalaxy has joined #ruby
jcromartie has joined #ruby
buschhardt has quit [#ruby]
buschhardt has joined #ruby
Squee-D has joined #ruby
emmanuelux has joined #ruby
a_a_g1 has joined #ruby
fr0gprince_mac has joined #ruby
kenichi_ has joined #ruby
araujo has joined #ruby
araujo has joined #ruby
Indian has joined #ruby
kenichi has joined #ruby
eka has joined #ruby
bgupta has joined #ruby
davidpk has joined #ruby
kenichi has joined #ruby
kenichi_ has joined #ruby
SphericalCow has joined #ruby
schovi has joined #ruby
frishi has joined #ruby
wataken44 has joined #ruby
aibo has joined #ruby
lockweel has joined #ruby
sacarlson has joined #ruby
My_Hearing has joined #ruby
LMolr has joined #ruby
progzer has joined #ruby
<progzer> Excuse me, what does "p358" part mean in the installer versions?
<progzer> patch level
waxjar has joined #ruby
<apeiros_> yes, patch-level
<apeiros_> contains only bug-fixes (some security relevant)
nanderoo has joined #ruby
Paoc_ has joined #ruby
rking has joined #ruby
jitesh_shetty has joined #ruby
<LMolr> is there a way to specify exclude patterns for Fileutils.cp_r ? For example, i need to copy a source directory tree to a target directory, skipping every .gitignore in every subfolder
s33k has joined #ruby
sectionme has joined #ruby
`brendan has joined #ruby
sacarlson has joined #ruby
spcshpop` has joined #ruby
mz_ has joined #ruby
IPGlider has joined #ruby
Nathandim has joined #ruby
mz_ has joined #ruby
BiHi has joined #ruby
Sailias has joined #ruby
apeiros_ has joined #ruby
Squarepy_ has joined #ruby
d3c has joined #ruby
wefawa has quit [#ruby]
<Tasser> LMolr, nope, that stuff is dumb. Try Find.find, and select and File.copy
Dreamer3 has joined #ruby
<apeiros_> dumb stuff is great!
bananastalktome has joined #ruby
Dreamer3 has joined #ruby
akhkharu has joined #ruby
raincole__ has joined #ruby
<shevy> yeah!
<shevy> after all we all use rails!
* shevy ducks.
nonotza has joined #ruby
schovi has joined #ruby
<buschhardt> or sinatra :-)
shruggar has joined #ruby
pyreal has joined #ruby
<shevy> ENV.append 'CFLAGS', '-ObjC'
<shevy> does this work???
<shevy> I never saw that before
sei has joined #ruby
becom33 has joined #ruby
<rking> Is there something like cscope but for Ruby? That is, an index where you can say, "Show me every place where this is called."
<becom33> can anyone help me with git ? I know wrong channel . but Im getting some errors
<rking> Since Ruby is dynamic it would probably be implemented as a simple tokenized index.
<rking> becom33: I'm curious -- #git unhelpful?
<becom33> aww
a_a_g has joined #ruby
<shevy> rking hmm nothing like this extent
<shevy> but you can try to player with "caller"
<rking> shevy: Hrm.. caller? I'm not sure if I understand.
<rking> shevy: Oh, you mean like collect the list at run-time? That's kind of a great idea.
kvirani has joined #ruby
<rking> Heh. That would be quite the vim macro -- insert caller instrumentation code, run the test suite, then turn the list of calls into a tag stack that you can jump through.
francisfish has joined #ruby
KL-7 has joined #ruby
<shevy> it is a bit complicated because I wanted to play with blocks at that point
<shevy> hence the call is:
<shevy> foo
<shevy> foo {}
<shevy> I like blocks :)
<shevy> rking well, what you described via index sounds more sophisticated than caller
linoj has joined #ruby
<rking> shevy: The challenge, though, is integrating the process. Do you use tags?
jcromartie has joined #ruby
<shevy> I think in ruby 1.9.x there is some other way, aside from caller, but I forgot
<shevy> hehehe I use caller only VERY very rarely
<shevy> perhaps banister would know, he wrote pry and knows quite some tricks
<rking> Actually -- haha.. you could instrument /every/ method, run the test suite, then build the index from that. It would be like ctags but for invocations instead of definitions.
<shevy> I think the only other way I did use caller was to somehow create dynamically new methods ... or call the last defined method (in a file, and that .rb file can change at runtime, i.e. grow or shrink)
<shevy> yah well
<shevy> I was once young and wild
<shevy> but these days, I try to write only code that does not confuse me
fbernier has joined #ruby
<rking> Sometimes you have to descend to those depths to achieve an effect, though. In this case it might take something like that to get it to come out right.
<shevy> sounds interestnig what you try though
<shevy> yeah
mdw has joined #ruby
<shevy> some really clever ideas require some prior brain work before they are really cool
Helius has joined #ruby
<rking> BTW you could make it sort by frequency, so the #1 use of the method is the first in the stack, and so on.
<shevy> hehe
<shevy> I think I just played around with it... dont think I use it for anything seriously
Bl1tt__ has joined #ruby
<rking> Before I try implementing a solution I'll learn how cscope works for C (and how it integrates into vim).
<rking> It bugs me though because it's a broken link in the navigation process.. you can go from caller to called with tags, but you can't go back.
tilde` has joined #ruby
netrealm has joined #ruby
<shevy> hmm
<shevy> I still dont really know what tags are in this regard
<rking> shevy: What text editor do you use?
<shevy> bluefish 1.0.7 !
<shevy> it has better syntax highlighting than 2.x :-)
<rking> Ahh, hrm.. never heards.
<shevy> and i was too lazy for vim and emacs, I gave up on both years ago
fmcgeough has joined #ruby
<shevy> geany could be a replacement one day, but right now the default mode just looks ugly
<shevy> and I am too lazy to carry around my own colour definitions for ruby .rb files
<shevy> you actually mean tags as in ctags?
<rking> Hrm. Well, the idea behind tags is you run like "ctags -R ."...yes.
<rking> In vim you hit Ctrl+] to jump to the definition of the token under the cursor.
<rking> :ts if there's more than one.
<shevy> wait
<shevy> what is Ctrl+] doing in vim?
<shevy> if you are under the word "cat"
<shevy> in a .rb file
zunnyohn1 has joined #ruby
cousine has joined #ruby
<shevy> a string, in this example... hehe
<rking> It looks for the ./tags file then uses it as an index to look up "^cat\b" or something in it.
<rking> I should have said /^cat\b/ to be clearer.
bglusman has joined #ruby
CannedCorn has joined #ruby
CannedCorn has joined #ruby
td123 has joined #ruby
Jimchaos has joined #ruby
n1x has joined #ruby
<becom33> https://gist.github.com/74da77c87b767d35ac5a I know what Im doing here is wrong . but I want the output as I said In the paste :( help please
geekbri has joined #ruby
dql has joined #ruby
simao_ has joined #ruby
<shevy> becom33, it is not entirely wrong
<shevy> you have your array name
<shevy> and you append to this array via <<
<shevy> the problem is the way how you add to it
<canton7> becom33, NAME.zip(GENDER, DATE)
<shevy> while count < Name.length FIRST, this is ugly
<shevy> second, what is "Name" Where do you see it?
<shevy> you have NAME but not Name.
ThatDudeGuy_ has joined #ruby
<canton7> or, if you want to do it that way, you could replace the whole while/count thing with "NAME.length.times do |count|", or something similar
iocor has joined #ruby
<becom33> shevy, yes I have changed it to NAME
<shevy> does it work now?
<becom33> canton7, yes I see :)
<becom33> shevy, no
<canton7> also, beginning of line 15, s/name/names/
<shevy> heeh
<shevy> oh right
<shevy> you had another name error there
<becom33> undefine method name
<shevy> becom33, you must pay attention to the names you give to things
<canton7> yeah, that's the one
<shevy> you do:
<shevy> names = []
<shevy> but then you do:
<shevy> name <<
nari has joined #ruby
<shevy> ruby parser gets confused!
<canton7> you might benifit from an IDE which starts screaming at you when you have undefined variables and the like
<becom33> shevy, I see
<Mon_Ouie> Except it won't because it will just assume it's a method call
<canton7> s/undefined/unused
<becom33> Im getting this as error test.rb:15: undefined local variable or method `name' for main:Object (NameError)
<shevy> an IDE or better glasses ;-)
synk has joined #ruby
<shevy> what is "name"
<shevy> ...
mstratman has joined #ruby
<shevy> we send you to eye doctor!
<Mon_Ouie> Ah, yes. Just showing the warnings from ruby -wc would work for that :)
<becom33> oh for crying out loud ><
<shevy> yes, always run with -w it is better in the long run
robotmay has joined #ruby
<shevy> you adopt a better style in the long run if you care about warnings
<becom33> shevy, I see now I dont get any error . but can I see if I get the result as I mentioned in the commented section ?
nikhgupta has joined #ruby
<canton7> Mon_Ouie, yeah, that's all my IDE does :P
<banisterfiend> shevy: an ophthalmologist
<banisterfiend> shevy: say that in german
<shevy> becom33 can you reload your CURRENT version
<shevy> so that I can see it
<shevy> banisterfiend I dont even know what that words means
<banisterfiend> shevy: eye surgeon
<shevy> but "pht" would be like "f" in german, the one in "foe" or "fire" ... offfftalmologist
<shevy> really ffff, not just f
<shevy> but its a difficult word
<shevy> the coolest word is phenolphthalein
Zac_o_O has joined #ruby
<shevy> becom33 only possible to know what to change if you show the most recent version
<becom33> shevy, its working thanks :)
<canton7> becom33, as I said earlier, at the end of the day, there's no excuse for not using a suitable built-in function to do your task. In this case, it's Array#zip
jensn has joined #ruby
<apeiros_> canton7: there's always an excuse! usually NIH is the best one :D
<becom33> canton7, he he
beilabs has joined #ruby
<canton7> apeiros_, haha! true, very true...
jgarvey has joined #ruby
jitesh_shetty has joined #ruby
Sailias has joined #ruby
<shevy> long live becom33!
<shevy> wonder why he quits so quickly
<shevy> :P
nikhgupta has joined #ruby
uris has joined #ruby
<bounce> ~>
tatsuya_o has joined #ruby
<bounce> blah
<lordzero> blah blah
dv310p3r has joined #ruby
<canton7> apeiros_, it turned out to be fairly easy to solve that desperate-for-a-job guy's problem from a few days ago btw
LBRapid has joined #ruby
asobrasil has joined #ruby
pu22l3r has joined #ruby
mcwise has joined #ruby
nacengineer has joined #ruby
baroquebobcat has joined #ruby
lockweel has joined #ruby
Scorchin has joined #ruby
<shevy> why
<Scorchin> What's an easy way to test a multi-domain sinatra app? Currently, it produces different output depending on the value of request.host but I'm not sure how to set the value of request.host in my tests. Any ideas?
<shevy> does he work as a model for underwear now?
Helius has joined #ruby
phantasm66 has joined #ruby
Scorchin has quit [#ruby]
DarkFoxDK has joined #ruby
carlyle has joined #ruby
kpshek has joined #ruby
Aristata has joined #ruby
EvanR has joined #ruby
rohit has joined #ruby
francisfish has joined #ruby
<apeiros_> canton7: you mean scalebyte? which one? (he had like 20…)
<apeiros_> I had solutions for all of his problems, except for the "minimum integer that can't be the result of any possible calculation with N digits"
<vectorshelve> apeiros_: shevy banisterfiend : Hai :)
theRoUS has joined #ruby
theRoUS has joined #ruby
<banisterfiend> vectorshelve: who dat
<apeiros_> he's a git commit that came alive…
bluOxigen has joined #ruby
nikhgupta has joined #ruby
<Tasser> apeiros_, kill it with svn?
<vectorshelve> I am a ruby lover :)
nikhgupta has joined #ruby
dfamorato has joined #ruby
<any-key> git-svn is your friend
<any-key> unless branches are involved, I never got the hang of that
<arturaz> svn...
<any-key> essssveeeeeiiiinnn
<vectorshelve> i Love git too :)
<arturaz> it has been so long since I've seen the wretched beast
<shevy> man
Companion_ has joined #ruby
<shevy> vectorshelve loves too much
<shevy> folks with so much love are suspicious to me
<vectorshelve> the ruby room is so calm and composed... I like this room.. its as beautiful as ruby closures :)
crankycoder has joined #ruby
brngardner has joined #ruby
<Tasser> vectorshelve, start playing wtih class << self
* any-key slaps vectorshelve with a combinator
<any-key> haha
looopy has joined #ruby
<vectorshelve> [Tasser,shevy,klip,aperios_,any-key,banisterfiend ].rebuild_index :)
<shevy> i dont want to belong to any-key
<shevy> I STILL CAN NOT FIND THE ANY-KEY
<banisterfiend> vectorshelve: stop pinging me homie
<shevy> I think vectorshelve smoked something
fayimora has joined #ruby
<any-key> bro, settle down bro
<Tasser> vectorshelve, NoMethodError: undefined method `rebuild_index' for []:Array # ;-)
<any-key> he must be using sunspot
fearoffish has joined #ruby
<apeiros_> shevy: you've got the wrong keyboard
<vectorshelve> apeiros_: Here's the answer to minimum integer that can't be the result of any possible calculation with N digits" question asked by the desperate for a job guy scalebyte :) -> https://gist.github.com/2292319 I lvoe C++ too
<vectorshelve> Tasser: smart guy... l like that :)
DrShoggoth has joined #ruby
<shevy> good old scalebyte
<shevy> may he rest in peace
<Tasser> vectorshelve, just straightforward
<vectorshelve> shevy: who is this scalebyte by the way ?
<shevy> he was a young hopeful who tried to learn ruby
<shevy> and wanted to work at amazon or some such
<shevy> which I wonder how people can work at huge boring companies anyway
<apeiros_> vectorshelve: did all the indents get stripped by copy & paste or does your love not encompass indents? :)
bluOxigen has joined #ruby
<Tasser> now he's hopeless?
<any-key> I'd work for Amazon...I almost took an internship there
<shevy> I think he is hopeless, he said he has to learn algorithms and datastructures
<shevy> that will kill his creativity :(
<any-key> there's obnoxious large companies, but there's some that are large but don't feel large
<Tasser> just because he's different doesn't mean his creativity is useful
<any-key> then again I mostly work at startups :P
<vectorshelve> apeiros_: gist some time doesnt understand indents.. its obviously copy pasted.. from my mac to gist :)
<shevy> that is not nice to say about him Tasser ;-)
simao has joined #ruby
<apeiros_> and C++ has set? or does that code require boost?
<shevy> boost!
<shevy> we need more BOOOOOST!
* apeiros_ boosts shevy
<any-key> apeiros_: iirc STL has sets
<any-key> it's been over a year since I touched anything but scripting languages...and prolog D:
<any-key> with all of these hip new languages coming out, I'd like to see some hipsters revive prolog
<any-key> "anything that can't be expressed in first-order logic isn't worth expressing at all!" - any-key
<shevy> hmm
<shevy> prolog has a too weird syntax
<apeiros_> any-key: you're not a friend of love then, I guess?
<any-key> not really, the syntax is PURE first-order logic
<any-key> apeiros_: does not compute
<shevy> any-key, but what can you *do* with it!
<shevy> it seems really kinda useless
<any-key> you can write things
<any-key> and build a knowledge base
<any-key> then use that for logical inference!
<Tasser> shevy, <3 prolog
<shevy> hmm
mrwalker has joined #ruby
<any-key> jk, prolog is useless in practice
<Tasser> ♥ <- muahaha, X even has a multikey for that
<shevy> prolog should be assimilated
<any-key> completely useless
<shevy> into a language that combines it with being useful at the same time
<Tasser> prolog is a database query language
<any-key> it took me 600+ lines to write this simple logical inference thing
<shevy> The PrologOS
<any-key> Tasser: basically
<Tasser> and there is some NLP software out there that uses prolog
<shevy> The SQL-OS
<any-key> Tasser: but is it any good?
<Tasser> I think so
<shevy> will it blend?
<Tasser> depends on your blender
<any-key> hmmmmmm now that I think about it, Prolog is basically NoSQL
<shevy> hehe
<any-key> just think about it
<Tasser> indeed :D
<any-key> it's like a key value store of sorts
<Tasser> I'll build my own DB with prolog as query lang! :D
Azure has joined #ruby
Azure has joined #ruby
<any-key> haha
<Tasser> but it's just sloooooow
aibo_ has joined #ruby
kuzushi has joined #ruby
Vert has joined #ruby
simao has joined #ruby
nev3rkill has joined #ruby
<any-key> unification or whatever is no easy feat!
<canton7> apeiros_, the "I have 4 numbers but no operators. What's the smallest integer that can't be made using these numbers and any operators"
aibo__ has joined #ruby
<apeiros_> canton7: my problem was, that you've got up to 10 numbers
<apeiros_> which means ruby will be relatively slow if you just iterate over all permutations :-/
<apeiros_> (it's 4**9 * 9! after all)
<canton7> apeiros_, yeah that's a fair point
SeySayux has joined #ruby
Husel has joined #ruby
anesthetic has joined #ruby
aibo has joined #ruby
cousine has joined #ruby
<Tasser> apeiros_, a functional language would prove better suited
<any-key> apparently this uses prolog for queryinging
<apeiros_> Tasser: if it's the same slow as ruby, then not
<anesthetic> Hello everyone
<any-key> it depends on the language
<any-key> haskerr is fast
<any-key> lazy evaluation ftw :)
<banisterfiend> any-key: "haskerr" ?
<any-key> rearn you a haskerr
<apeiros_> I don't think you can lazily solve that :-p
<banisterfiend> hehe
<apeiros_> arrrrr! haskerrrr!
<apeiros_> it's the pirrrates language
<Tasser> apeiros_, it can cache...
<shevy> and it can blend
<apeiros_> maybe it's japanese… ruby is actually luby…
<shevy> but its too lazy a language
<Tasser> and it will blend
<apeiros_> Tasser: um…
<apeiros_> I don't see how that applies
<Tasser> hmmm, partially, but I'm not sure
<apeiros_> unless you mean caching stuff like the result of 5*6 etc., which seems more costly than just calculating it…
<any-key> eeeh not exactly
<any-key> things aren't calculated until they're needed
<any-key> but I cannot speak for how good that is for performance
denysonique has joined #ruby
<apeiros_> any-key: I know. but you need *all* results
<Tasser> any-key, that's memory but not speed-efficient
<any-key> C would work well
<any-key> Tasser: no, it's speed efficient because you only do the calculations you need
<Tasser> C isn't meant for anything else than communicating with hardware :-P
<apeiros_> lazy only helps you in 2 situations: a) when you can futurize the result and thread execution, b) when some of the results can be dropped
<apeiros_> (feel free to educate me on other uses)
<any-key> fair enough
SeySayux has joined #ruby
<apeiros_> futurize applies here. but you can thread the problem easily enough without.
<any-key> speaking of education...I'm late for class
* apeiros_ gets lessons on keynote by a cute coworker today :)
moshee has joined #ruby
<Tasser> apeiros_, jruby and threach ;-)
<apeiros_> Tasser: yupp, that should work here quite nicely.
bbttxu has joined #ruby
<Tasser> apeiros_, cute male?
<apeiros_> no, girl. I'm not into males ;-)
<Tasser> doesn't mean cute doesn't apply ;-)
bbttxu has joined #ruby
<apeiros_> sure, but I'm not excited by cute male coworkers :-p
virunga has joined #ruby
tommyvyo has joined #ruby
alx- has joined #ruby
LowKey has joined #ruby
<vectorshelve> any cute males around ? :)
<Tasser> you're on IRC.
<apeiros_> fat slobs
<any-key> the trick to keynote is wearing a black turtleneck during your presentation. Jeans also help.
axl_ has joined #ruby
dfamorato has joined #ruby
<any-key> Keynote was optimized by Jobs
kevinbond has joined #ruby
jenglish has joined #ruby
simao has joined #ruby
cachoimechi has joined #ruby
StevenR12 has joined #ruby
<apeiros_> any-key: also the use of lots and lots of words like "awesome", "great", "incredible" etc.
andrewhl has joined #ruby
Husel has quit [#ruby]
banjara has joined #ruby
simao_ has joined #ruby
jenglish has joined #ruby
SeySayux has joined #ruby
dfibre has joined #ruby
headius has joined #ruby
<shevy> jobs used to do that?
<shevy> apeiros_, you are great awesome and incredible!
simao has joined #ruby
d2dchat has joined #ruby
<any-key> my stupid select loop is bork :(
safasfgsadasdaa has joined #ruby
<any-key> it blocks even though the socket FD is seeing action!
<any-key> I bet a git diff will tell me what I broke :\
rippa has joined #ruby
nlc has joined #ruby
luxurymode has joined #ruby
ckrailo has joined #ruby
zec has joined #ruby
LiranV has joined #ruby
LiranV has quit [#ruby]
Dreamer3 has joined #ruby
enroxorz has joined #ruby
<jlebrech> I have a method which does a http query passing x-auth-token in the headers. but this token may sometimes expire and I'd like to run a "login" method then rerun the method from the start. how do I do this?
cpruitt has joined #ruby
advorak has joined #ruby
CheeToS has joined #ruby
cpruitt has joined #ruby
mbriggs has joined #ruby
Banistergalaxy has joined #ruby
hkl has joined #ruby
kvirani has joined #ruby
jgrevich has joined #ruby
Evixion has joined #ruby
nonotza has joined #ruby
davidpk has joined #ruby
baroquebobcat has joined #ruby
appineer has joined #ruby
EvanR has joined #ruby
<any-key> jlebrech: people are probably going to point you at Mechanize, it does a good job of keeping cookies and sesion data like a browser would
paulmooring has joined #ruby
<jlebrech> any-key i'm already using a library, i just to run another method then retry the method if a request has come up with an access denied message
tewecske has joined #ruby
paulmooring has quit [#ruby]
<any-key> sounds like simple application logic then
<any-key> in your current library just handle the status code the site returns when you need to be authenticated with another method that sends the right data
nikhgupta has joined #ruby
havenn has joined #ruby
tommyvyo has joined #ruby
kuzushi has joined #ruby
paulmooring has joined #ruby
mxweas_ has joined #ruby
lkba has joined #ruby
Sonny__ has joined #ruby
<any-key> hah it works when I unplug the roomba >.>
dql has joined #ruby
_ack has joined #ruby
seivan has joined #ruby
<CannedCorn> how would you make a hash from an array with values just set to true
<CannedCorn> i essentially just want a set
<any-key> you should use a set then :P
<any-key> you can give it a default value and load the elements of the array into it, but I don't think you can do both
<CannedCorn> yeah
<CannedCorn> ok
<rippa> CannedCorn: just use a set
<any-key> my advice would be to avoid setting a default hash value if at all possible...it just seems like it would make things hard to read
<any-key> it could be convenient but people will have trouble understanding your code since it changes the default behavior
<CannedCorn> yeah
<CannedCorn> it feels like people really don't use sets in ruby
<CannedCorn> maybe they do
<any-key> I do, they're great
<any-key> it's just one of those things you don't tend to use on a daily basis
philcrissman has joined #ruby
Blaster has joined #ruby
eywu has joined #ruby
lkba has joined #ruby
cobragoat_ has joined #ruby
j3r0m3 has joined #ruby
<any-key> Question: why would IO::select EVER return nil?
<any-key> it should block until there's a file descriptor that's available
<CannedCorn> if it times out any-key
<any-key> ahhh
<CannedCorn> if you specify a timeout in secs as the third param
<any-key> thanks, that was silly of me :P
<CannedCorn> err fourth
<CannedCorn> then it returns nil
<any-key> yeah, that explains why it only happened when I disconnected the roomba
<any-key> thanks
<CannedCorn> nah, good question, i wouldn't have known except i just implented something that used it
<CannedCorn> btw documentation on ssl sockets
<CannedCorn> is near horrific
<any-key> haha yes it is
<CannedCorn> err blank in most cases
<any-key> ruby SSL is annoying, I remember trying to get net/http to do HTTPS and it was a bitch
<any-key> but messing with raw SSL sockets sounds even more fun
triptec has joined #ruby
triptec has joined #ruby
apeiros has joined #ruby
blueadept has joined #ruby
blueadept has joined #ruby
PaciFisT has joined #ruby
<theRoUS> ruby 1.8.7. i'm having a brain-block here. how do i handle nested interpolations? i have an array of strings which are raw regex patterns. some of them include interpolations of constants.
dcolebatch2 has joined #ruby
LiquidInsect has joined #ruby
<theRoUS> e.g., s1 = '^blob1/(#{Patt1})/blob2$'
ed_hz_ has joined #ruby
<theRoUS> how do interpolate the string value of Patt1 into that? if Patt1 = '[-[:xdigit]]{36}' how do i get the equivalent of: s1 = '^blob1/([-[:xdigit]]{36})/blob2$'
davidcelis has joined #ruby
qos has joined #ruby
<apeiros> theRoUS: you're aware, that you can interpolate a regex into a regex?
<apeiros> theRoUS: as for your brain-block: 'single quoted strings' do not interpolate at all, you need "double quoted"
<theRoUS> apeiros: yeah, but this is from a data file that has strings like '^blob1/(#{Patt1})/blob2$'
<theRoUS> apeiros: the constants are in the program, not the data.
<theRoUS> apeiros: and yes, je comprends the difference between " and '
dbgster has joined #ruby
<rippa> theRoUS: with eval
<theRoUS> apeiros: to be more specific, the string patterns are keys in a hash defined in yaml.
Sonny__ has quit ["Verlassend"]
<theRoUS> rippa: i figured, but haven't gotten it yet.
<apeiros> o0
mdw has joined #ruby
<apeiros> gotta run for the train, but either I misunderstood the question or eval is not the answer…
<theRoUS> apeiros: and after the hash is read in, the constants need to be interpolated into the keys
<rippa> theRoUS: eval '"#{s1}"'
Araxia has joined #ruby
<rippa> oh wait
<rippa> wrong
<rippa> theRoUS: eval %["#{s1}"]
<msch> is there a way to reopen a Module and change a method without using alias_method(_chain) ? e.g. some built in way so that i can call super to get the overwritten module
<rippa> no
<rippa> if you overwrite method, it is lost
<msch> rippa: k thanks.
cloke_ has joined #ruby
eywu has joined #ruby
<theRoUS> rippa: unless you capture it via <modulename>.method(:methodname) and store that in a closure.. heh heh
<theRoUS> rippa: not familiar with %[] .. ?
<rippa> string literal
<rippa> equivalent to double-quoted
heftig has joined #ruby
<theRoUS> so eval a 'double-quoted' double-quoted interpolation?
<theRoUS> bizarre.. but it works. :-)
bluOxigen has joined #ruby
<theRoUS> rippa: thanks!
<mstratman> Is there any reason '@messages.select { |item| item == method_name }.length' couldn't simply be '@messages.count(method_name)' ?
brngardner has joined #ruby
<rippa> mstratman: whoever wrote this didn't know about that method?
<rippa> or it didn't exist at the time
<mstratman> Thanks. I'm just trying to make sure I'm not missing out on a subtle problem with simply using count(...)
<theRoUS> was the count(...) syntax in pre-1.9 ?
<mstratman> at least 1.8.7, which is what i'm using
Chryson has joined #ruby
waxjar has joined #ruby
emmanuelux has joined #ruby
superjoe has joined #ruby
<superjoe> what's the << operator called, with in relation to metaprogramming?
<Aristata> << Appends things
waxjar has joined #ruby
<Aristata> in or out of meta programming
<shevy> girl << rope
<superjoe> so if I do "class << SomeThing"
<Aristata> no
<shevy> rope is now append to a girl
<Aristata> thats class < thing
bbttxu has quit [#ruby]
<Aristata> there is a difference
<superjoe> right I'm looking at code that is doing <<
bbttxu has joined #ruby
<Aristata> hm
<superjoe> and I dunno wtf it's doing
<shevy> you modify self?
Eiam has joined #ruby
<Aristata> If you are modifying self it's <
<rippa> superjoe: it's singleton class
SegFaultAX|work has joined #ruby
<Aristata> but you should knock it off if thats the case and just say self.blah
<shevy> class Foo; class << self
<rippa> class << String opens singleton class of String
<Aristata> All these people who found out you could make a program confusing with Thing < self piss me off
<superjoe> actually, here's the example I want to give:
<shevy> Thing < self? that works?
<superjoe> (class << self; self; end).instance_eval do .... end
<shevy> ewwww eval
<superjoe> yeah.
<rippa> instance_exec
beeneto has joined #ruby
yeggeps has joined #ruby
<shevy> all code with eval must die
<superjoe> so wtf does this do? creates a sub-instance of self, and then adds class methods to it?
fayimora has joined #ruby
<shevy> no idea
<lectrick> How do I read piped in text in a ruby script?
<rippa> superjoe: self is a singleton class of whatever it's inside of
<Aristata> shevy: There are some instances where eval is appropriate, but it's rare
<Aristata> I prefer .send
<Aristata> If I need to do anything like that
<shevy> .send is almost in the same league as eval
<shevy> and method_missing
jgreene has joined #ruby
<shevy> you can make things so complicated that noone understands what is going on anymore
jgreene has quit [#ruby]
<rippa> shevy: just code in C if you don't like dynamic languages
jgreene has joined #ruby
<shevy> rippa how does this even compare
snip_it has joined #ruby
<shevy> you write like 4x the amount of code in C and you must compile it on top of that
<lectrick> Does piped in input show up on the STDIN object?
<shevy> granted it would be faster
philips has joined #ruby
adeponte has joined #ruby
williamcotton has joined #ruby
<shevy> lectrick not sure, how do you mean? in something like "cat foo | ruby bla.rb" ?
<lectrick> yes
<lectrick> how do I read that input in the ruby script?
<shevy> hmm I thought it was in ARGF or something, lemme look at some files...
frontendloader has joined #ruby
<shevy> ARGF.read
<shevy> that should work lectrick, I test it via:
<shevy> "cat tty_test.rb | ruby argf.rb"
<shevy> and argf.rb basically just does a:
<shevy> puts ARGF.read
akemrir has joined #ruby
<shevy> "ARGF is a stream designed for use in scripts that process files given as command-line arguments or passed in via STDIN."
<shevy> hmm I think you can also use ... < some_file.txt
<shevy> ah there are examples on that page lectrick :D
<shevy> echo "glark" | ruby -e 'p ARGF.read'
<lectrick> Still not clear on the interaction between ARGV and ARGF but I will smack my brain against it shevy :)
<lectrick> it looks like ARGF.readlines will read either piped in input or a filename given as a parameter? That would be very convenient
<shevy> ARGV should contain the commandline options
<shevy> ruby foo.rb one two three
paulmooring has quit [#ruby]
<shevy> ARGV should contain ["one","two","three"]
<lectrick> Yeah I know ARGV. I just don't know ARGF
<shevy> and it seems ARGF contains the file contents
<shevy> yeah lectrick
<shevy> I think it works in both situations
alfism has joined #ruby
<lectrick> nice
<lectrick> i think i get it now. very clever
maletor has joined #ruby
kaneda has joined #ruby
beeneto has joined #ruby
<shevy> lectrick you used another programming language before ruby?
<lectrick> shevy: Many, just not a lot of shell programming :)
<lectrick> I do like that ruby borrows from all the conventions already out there
ghvandoorn has joined #ruby
<shevy> yeah, matz made it a bit like a melting pot, mixing in ideas
atmosx has joined #ruby
tatsuya_o has joined #ruby
KL-7 has joined #ruby
mrsolo has joined #ruby
apeiros_ has joined #ruby
schaerli has joined #ruby
Morkel has joined #ruby
Jay_Levitt has joined #ruby
bjhaid has joined #ruby
<bjhaid> please does anyone know how to use PBEWithMD5AndDES hashing mechanism in ruby
nikhgupta has joined #ruby
hadees has joined #ruby
geekbri has joined #ruby
LMolr has joined #ruby
<CrazyPickles> fucking hell I have no idea
SeanLazer has joined #ruby
<SeanLazer> is there a way to tell rake to use a specific rakefile?
twinturbo has joined #ruby
nect has joined #ruby
jwang has joined #ruby
<shevy> -f, --rakefile [FILE] Use FILE as the rakefile.
nect_ has joined #ruby
<jlebrech> how do I pass a reference the the name of the current method to another method for that method to run it once it's finished doing it's thing?
shruggar1 has joined #ruby
bbryan has joined #ruby
<jlebrech> should I pass block?
Guest12841 has joined #ruby
nfluxx has joined #ruby
<LiquidInsect> __method__ will get you the method name, but what are you actually trying to do? tail recursion with a callback or something?
<apeiros_> jlebrech: symbols are the way to pass method names, see Object#method for a callable method object, and yes, a block is probably better.
apok has joined #ruby
zakwilson has joined #ruby
<jlebrech> i want to do something like; login(@game) { name_of_this_method(params_that_i_had) }
<arturaz> anybody used git bisect with rvm?
adamkittelson has joined #ruby
_adeponte has joined #ruby
kaneda__ has joined #ruby
kozik has joined #ruby
zommi has joined #ruby
<Synthead> is there a neater way to do this? if cover_sheet_id != 'none' then args.push(tempcover) end
dbwest has joined #ruby
io_syl has joined #ruby
kozik has quit [#ruby]
<any-key> args.push(tempcover) unless cover_sheet_id == 'none'
<any-key> unless executes the preceding code if the condition is false
<any-key> args.push(tempcover) if cover_sheet_id != 'none'
<any-key> that's basically the same thing
<any-key> Synthead: that work for ya?
<Synthead> ah yeah! doi
<Synthead> any-key: thanks :D
<any-key> no problem!
<any-key> it's one of my favorite little ruby things, code becomes way more readable when you use it
<any-key> my 1st favorite trick is using &:foo instead of passing a block to things like map or inject
<Synthead> any-key: when I learn languages, I don't like learning 'what works', but more of what's right, you know?
thecreators_ has joined #ruby
<any-key> [1,2,3].inject(&:+) sums an array :D
<any-key> Synthead: I agree completely
manizzle has joined #ruby
<mstratman> not really a ruby thing, per se. And some might argue it makes the code less readable since it makes it easier to miss the condition on a glancing reading. </being argumentative>
<any-key> if it's a long condition it's not a good idea
<any-key> it can definitely be abused
<Synthead> any-key: so how about this: instead of defining a section of an array, then using .push over and over, can I do an "inline" if statement in an array? like a = [ 'this', 'that', ('and the other' if 1 == 1) ] ?
PragCypher has joined #ruby
<any-key> heh give it a shot, I'm not sure
<Synthead> it works!
<any-key> looks kinda like a list comprehension
<Synthead> brilliant
<any-key> actually I think I used that once
pu22l3r has joined #ruby
<Synthead> oh, but the index is declared as nil if it's false
<Synthead> I think I can work with that though
<any-key> try the ternary operator
<any-key> but using that in a list is kinda ugly
eldariof has joined #ruby
<any-key> unless you were defining a list across multiple lines
<any-key> but the ternary operator is a better choice if you want a value when it's false
<any-key> but ONLY use it when the condition is short and the return values are short
IrishGringo has joined #ruby
stkowski has joined #ruby
Notimik has joined #ruby
thecreators has joined #ruby
cousine has joined #ruby
lateau has joined #ruby
ringotwo has joined #ruby
c0rn has joined #ruby
ozymandius has joined #ruby
MasterIdler_ has joined #ruby
<shevy> hmm
<shevy> if x.is 'foo'
<shevy> if x == 'foo'
<shevy> what is nicer to read?
lateau has quit [#ruby]
<shevy> or perhaps...
<shevy> if x.is? 'foo'
<shevy> but that one has one more char
<any-key> heh .is?
<any-key> that's kinda odd
<shevy> (and == never requires parens)
<shevy> yeah
<shevy> I just wondered a bit
<shevy> == is a method call too right?
Blaster has quit [#ruby]
<Mon_Ouie> It is
<any-key> you can overload/define it
<shevy> kinda cool
<shevy> though I have no idea if it is useful for anything hehe
<Mon_Ouie> Well it *is*, many objects need custom equality logic
<Mon_Ouie> e.g. in Ruby-core, arrays, strings, and hashes
<any-key> yep, Date is a good example
buschhardt has joined #ruby
<SeanLazer> shevy: thanks
a_a_g has joined #ruby
mxweas_ has joined #ruby
<shevy> hmm ... equality ...
francisfish has joined #ruby
artOfWar has joined #ruby
PragCypher has joined #ruby
nvez has joined #ruby
nvez has joined #ruby
pu22l3r has joined #ruby
brngardner has joined #ruby
imsplitbit has joined #ruby
audy has joined #ruby
<audy> What's all the hoopla about bundle exec? I've never typed bundle exec. Am I doing it wrong?
<audy> I'm using rvm and gemsets though
<a_a_g> audy: sometimes things dont work. then I type bundle exec and they work
<a_a_g> thats all I know :P
blischalk has joined #ruby
<audy> hahaha
lindenle has joined #ruby
<lindenle> hi all i have [:NAME, {:line=>1, :value=>"include"}]:Array how do I access the data in the hash (inside the array?)
artOfWar has joined #ruby
<Synthead> can I define two variables to the same value at once? like a, b = 5 ?
shruggar has joined #ruby
<Synthead> ooh, a = b = 5
<Mon_Ouie> a, b = 5 just does something else
<Mon_Ouie> (set a to 5 and b to nil)
shadoi has joined #ruby
<Synthead> I'd need to use a, b = 5, 5 then, right?
<Mon_Ouie> Yeah
<shevy> lindenle your_array[1]
<lindenle> is the second entry in the tuple called last? i.w my_array[1].last[:value]
<lindenle> i.e.*
<shevy> why do you try .last
<lindenle> because second did not work
<shevy> wait what where how :)
<shevy> .second ?
<shevy> this is a method invocation by the way
<shevy> my_array[1][:line]
<lindenle> shevy: what about nside my_array.each |entry| do
<lindenle> inside*
kvirani has joined #ruby
Guest___ has joined #ruby
<lindenle> shevy, oh man
<shevy> not sure what you mean
<lindenle> I think I am misunderstanding the code...my bad
shruggar has joined #ruby
<shevy> I thought you wanted to access your hash
<shevy> now you suddenly want to call .each ?
Nathandim has joined #ruby
<shevy> but you can use .each if you really want to, though it is more cumbersome then accessing the hash inside the array directly :D
<shevy> *than
<shevy> hmmmm
LBRapid has joined #ruby
<shevy> am I the only one who thinks that RVM really attracts specifically newbies?
<lindenle> shevy: I want to loiop over the array and access the hash inside
<shevy> ok, so you have a constraint
<shevy> I thought you just want to access it directly
<lindenle> shevy: sorry, total newb to ruby here ;)
audy has quit ["["Textual IRC Client: www.textualapp.com"]"]
<shevy> that is fine, you just need to get a clear picture of what you need or want
<shevy> whether you are noob or not
<shevy> if you use .each, the first iteration will go to :NAME
<shevy> [:NAME, {:line=>1, :value=>"include"}]
<shevy> the second one will have your hash
<shevy> if your array is really that short, and if you really must use .each you can do
<shevy> if item.is_a? Hash
<shevy> do_something_with_it
dross has joined #ruby
<shevy> by the way you can test all this in IRB
<shevy> array = [:NAME, {:line=>1, :value=>"include"}]
<shevy> array.each {|item| puts item[:value] if item.is_a? Hash } # => "include"
<matled> shevy: I think rvm attracts anyone who just wants to get ruby to work on a unix-like system. it gets quite much promotion... it's even on ruby-lang.org
<shevy> ah
<shevy> didnt know it was promoted by ruby-lang itself
<matled> though I find the approach of rubyenv much more compelling
zommi has joined #ruby
<matled> *rbenv
<ekaleido> linewords = x[z].split(',')
<ekaleido> :cf = linewords[4]
<ekaleido> is that valid?
<shevy> matled well, I dont use either. but from my limited experience... it seems the ratio of RMV to rbenv coverage is about
<shevy> 3 : 1
<shevy> RVM
<shevy> :P
Yu\2 has joined #ruby
<shevy> ekaleido that wont work
<lindenle> shevy: now I am totally confused I thought the array was an array of a tuple (string, hash).
<shevy> lindenle I am not sure what a tuple is. however, your array there has two elements:
Guest71832 has joined #ruby
<lindenle> shevy: I see what you mean
<shevy> (1) A symbol
<shevy> which you called :NAME
<shevy> which is unusual by the way
<shevy> most people would use :name
<shevy> and
<shevy> (2) A hash
<shevy> which is at the second position of your array... since array counting starts at 0, your hash is at position 1
aantix has joined #ruby
<matled> shevy: my guess this that the ratio is worse for rbenv
<shevy> matled yeah... but I think RVM is also much larger, so it's a bit unfair to compare
<rippa> in python tuple is like array, but immutable
<matti> shevy: ;-)
<shevy> one day I have to find out why people are so attracted to RVM
<shevy> you know
<matled> shevy: or what did you mean by coverage?
<shevy> like the moth to the candle :)))
<shevy> matled, yeah, mostly usage. It's just a feeling... people here ask about RVM more than rbenv in my opinion. And I just went to the ruby forum... two people asked about RVM (with typical install problems)
<shevy> one was funny, lemme find it...
<matled> 7.19 : 0.17 google search results :/
<ekaleido> the gem im using wants a symbol, but i need the symbol to change every time through
williamcotton has joined #ruby
<shevy> Steve's reply was kinda hilarious
<shevy> "You don't copy the $."
<shevy> hehehe :)
nfluxx has joined #ruby
lorandi has joined #ruby
<shevy> that's like someone who goes STRAIGHT to the RVM webpage... and copy pastes what he sees
<matled> shevy: that are the kind of people using rvm :D
* shevy presses any-key again
shruggar has joined #ruby
<lindenle> shevy: ah ha
<shevy> ekaleido but your symbol... why should it change?
<lindenle> chevy: not an array at all a class called Puppet::Parser::Lexer... hence my idiocy
<shevy> ekaleido you dont use a symbol like a variable
<shevy> foo = "hi"
<shevy> works
<shevy> :foo = "hi"
<shevy> does not work
<shevy> you can use a symbol as key in a hash
mengu has joined #ruby
<shevy> hash = {}; hash[:foo] = 'hi'; hash # => {:foo=>"hi"}
<shevy> and you can lateron do ... hash[foo] = 'bye'
cameron_ has joined #ruby
EzeQL has joined #ruby
mxweas_ has joined #ruby
<lindenle> shevy it is an array of arrays
adeponte has joined #ruby
luckyruby has joined #ruby
<shevy> what is :D
<shevy> [ [ "a","b","c"], [ "a","b","c"] ]
<lindenle> shevy: the data structure I was trying to figure out,
<lindenle> shevy: yeah
<shevy> your_data = [ [ "a","b","c"], [ "a","b","c"] ]
<shevy> ah now I confused myself
<shevy> ok this is better:
<shevy> your_data = [ [ "a","b","c"], [ "d","e","f"] ]
<shevy> your_data[1][2] # => "f"
cameron_ has quit ["["Textual IRC Client: www.textualapp.com"]"]
rushanuk has joined #ruby
grafthez_ has joined #ruby
k04n has joined #ruby
havenn has joined #ruby
shruggar has joined #ruby
daed has joined #ruby
rushanuk has joined #ruby
nfluxx has joined #ruby
techhelp has joined #ruby
I-Sell-Propane has quit ["Leaving"]
nikhgupta has joined #ruby
savage- has joined #ruby
ephemerian has joined #ruby
artm has joined #ruby
nim__ has joined #ruby
Jake232 has joined #ruby
netrealm has joined #ruby
davidcelis has joined #ruby
kirun has joined #ruby
joaoh82 has joined #ruby
jenglish has joined #ruby
mxweas_ has joined #ruby
francisfish has joined #ruby
indeterminate has joined #ruby
wyhaines has joined #ruby
nfluxx has joined #ruby
crankycoder has joined #ruby
<ekaleido> so im doin the following client.insert(:symbol, "whatever", {"hello" => "goodbye"})
<ekaleido> and it seems to only want that first to be a symbol
<Aristata> ekaleido: That made zero sense.
<ekaleido> but i will have maybe 1000 hashes per symbol, then i need the symbol to change for another 1000 or so hashes
<Aristata> ah
kpshek has joined #ruby
williamcotton_ has joined #ruby
<Aristata> [:symbol1, :symbol2].each {|symbol| do stuff}
<Aristata> ?
<luckyruby> is there a formal name for an array of hashes?
<Aristata> An array of hashes I believe.
<Aristata> Or even more formal, a bunch of hashes in an array
<luckyruby> :)
<Aristata> But some people will think youre pretentious
<Aristata> If you say it the latter
<Aristata> ;)
startling has joined #ruby
kenichi has joined #ruby
<davidcelis> Aristata: hahahha
francisfish has joined #ruby
Houdini has joined #ruby
fr0gprince_mac has joined #ruby
<Aristata> davidcelis: :)
manizzle has joined #ruby
shruggar has joined #ruby
jarred has joined #ruby
Nss has joined #ruby
mcwise has joined #ruby
shtirlic has joined #ruby
KL-7 has joined #ruby
lorandi has joined #ruby
<anesthetic> Hi, what text editors or IDEs are used to develop ruby these days?
<canton7> anesthetic, nothing standard I believe. Personally I've used netbeans, notepad++ and sublime text 2
<anesthetic> I see, do you know if eclipse plugin for ruby is any good?
<canton7> never tried it personally
<startling> anesthetic: I use vim
<davidcelis> anesthetic: RubyMine is the most commonly used Ruby IDE
<davidcelis> anesthetic: Most Rubyists I know avoid IDEs though, and just use a good text editor such as vim or Sublime Text 2
codezombie has joined #ruby
robbyoconnor has joined #ruby
<canton7> you can make sublime text 2 do ide-ish things, like syntax checking and some basic completion
robbyoconnor has joined #ruby
brngardner has joined #ruby
radic has joined #ruby
<anesthetic> Just wondering, does anyone use vim or a simple editor to work on large projects, hundreds of files etc?
<Aristata> I do
strife25 has joined #ruby
<anesthetic> I just can't imagine doing this with java, I guess it's a bit different with Ruby.. just starting to learn actually
<anesthetic> thx for replies
savage- has joined #ruby
<a_a_g> anesthetic: are you doing just ruby or rails?
<anesthetic> rails
<a_a_g> anesthetic: for vim, check out vim rails plugin
<anesthetic> ok thanks
srnty has joined #ruby
moshee has joined #ruby
artOfWar has joined #ruby
schovi has joined #ruby
a_a_g has quit [#ruby]
jbw has joined #ruby
andrewhl has joined #ruby
adam443 has joined #ruby
<adam443> looking for shortest method to do [a,b,c,d,e,f]=>[ab,cd,ef]
<adam443> anyone there?
adam272 has joined #ruby
<LiquidInsect> adam272: are those strings you're working with?
<LiquidInsect> adam272: a = []; %w[a b c d e f].each_slice(2){|n| a << n.join}
rking has joined #ruby
SuperNewb1 has joined #ruby
<adam272> thank you
jhowarth has quit [#ruby]
cjlicata has joined #ruby
nikhgupta has joined #ruby
kenperkins has joined #ruby
<shevy> ok folks
<shevy> it's time to remove the clothes
waxjar has joined #ruby
manizzle has joined #ruby
flagg0204 has joined #ruby
Jragon has joined #ruby
tobym has joined #ruby
eregon has joined #ruby
Brainix has joined #ruby
wilmoore has joined #ruby
hooper has joined #ruby
mbriggs has joined #ruby
superjoe has joined #ruby
ozymandius has joined #ruby
Chryson has joined #ruby
bawer has joined #ruby
Deele has joined #ruby
alex__c2022 has joined #ruby
deucepont has joined #ruby
tvw has joined #ruby
jlogsdon has joined #ruby
dardevelin has joined #ruby
<denysonique> Hello folks
<denysonique> Is there a way to pass session without using a global variable $session?
<denysonique> Behind the scenes?
strife25 has joined #ruby
<denysonique> Test.new('test2') do
<denysonique> User.find(1).say_hey
<denysonique> end
<denysonique> I would like a variable defined in Test#initialize to be available in User.find(1)
r0bby has joined #ruby
justinmcp has joined #ruby
satrionics has joined #ruby
<denysonique> User.find(1).say_hey*
visof has joined #ruby
visof has joined #ruby
nikhgupta has joined #ruby
rking has joined #ruby
CodeFriar has joined #ruby
netrealm has joined #ruby
bbttxu has joined #ruby
theRoUS has joined #ruby
workmad3 has joined #ruby
tatsuya_o has joined #ruby
yxhuvud has joined #ruby
<Mon_Ouie> I think that's too much magic for me to want that. I'd prefer to make some explicit call that would explain why the user object is using a variable from the test object.
<CodeFriar> I am trying to return a value calculated inside a block. I've tried foo = myMethod { return 15 } but foo is nil after execution. how can I return my value ?
<LiquidInsect> what does myMethod do?
<LiquidInsect> sounds like it's not returning what was returned from the block
<Mon_Ouie> CodeFriar: Depending on the answer to the above question there may be a better way, but you can do break instead of return
<CodeFriar> LiquidInsect: i've tried next
Synthead has joined #ruby
mdw has joined #ruby
<Mon_Ouie> next would make the block return 15, not the method that called the block
<CodeFriar> LiquidInsect: the block runs a soap method and returns a string
<CodeFriar> Mon_Ouie: so a break would ?
<Mon_Ouie> Yes
<LiquidInsect> CodeFriar: right but what does the method that yields to the block return?
<LiquidInsect> because that's what you're storing in foo above
<CodeFriar> LiquidInsect: implicity the output of t.join
<LiquidInsect> what is t?
arturaz has joined #ruby
<CodeFriar> gisting...
<denysonique> Mon_Ouie: the Test class instantiates a Mechanize object (browsing agent). I would like that Object to be unique among both instances User which are called withing the Test.new blocks. I want to do it this way in order to hide that variable from API/users as it won't be needed at all.
<denysonique> to be modified by the users
ben225 has joined #ruby
iboB has joined #ruby
bawer has joined #ruby
<Mon_Ouie> Read-only access still involves access. If you don't explicitly pass it, there's no way around having a global variable — whether it be an "actual" global variable or an ivar on a class doesn't really matter
<Tasser> Mon_Ouie, except a global variable pollutes namespaces :-)
<Mon_Ouie> Right, but they both share most of the other issues
chimkan has joined #ruby
<Mon_Ouie> (like what happens if your code is used on more than a single thread)
<denysonique> hmm
<denysonique> I have an idea
<Mon_Ouie> CodeFriar: So, in your example, what was myMethod? spinner?
<denysonique> I can create an array of hashes
<iboB> hey is there a build functionality that will allow me to do something like this (say the syntax is %1 and .arg): "Hello, %1! How are you, %1? It's %2 to see you.".arg(1, "Joe").arg(2, "nice")
<Mon_Ouie> t.join returns nil, you may want to use t.value
<iboB> err... *a built-in
<CodeFriar> Mon_Ouie yes
<Mon_Ouie> spinner { 15 } with t.value instead of t.join should work then
<denysonique> I will actually try some code
<Mon_Ouie> iboB: There's something similar you can do with String#%
ghanima has joined #ruby
nerdy_ has joined #ruby
<iboB> thanks, Mon_Ouie
artm has joined #ruby
techhelp has joined #ruby
<LiquidInsect> CodeFriar: OK, so threads aren't really my thing, but let me make sure I understand what you need. You need the spinner method to return the value of the thread that joined, right?
Indian has joined #ruby
<CodeFriar> Mon_Ouie: trying t.value
<LiquidInsect> ah. beaten to it
philcrissman has joined #ruby
<CodeFriar> got a localjumpError
<arturaz> Not sure whats happening, but try http://celluloid.io
Drewch has joined #ruby
<arturaz> Threads hurt.
NightMonkey has joined #ruby
<LiquidInsect> 1.9.2p290 :018 > spinner{5} => 5
<LiquidInsect> works for me at least...
<CodeFriar> my test is running. sadly it just takes a long time
<Mon_Ouie> CodeFriar: You may want to check Array#cycle btw ;)
<CodeFriar> Mon_Ouie: ??
<LiquidInsect> Oh also, I do get LocalJumpError with explicit returns in the block, CodeFriar, but not with implicit ones
<gogiel> how to change ascii value to char?
<LiquidInsect> You might need to change what your blocks are doing
wyhaines_ has joined #ruby
<Mon_Ouie> Instead of removing the first element and pushing it, you could use Array#cycle to iterate over your array
<workmad3> LiquidInsect: explicit returns from a proc or a block don't do what most people would expect
<LiquidInsect> workmad3: right
wyhaine__ has joined #ruby
<LiquidInsect> you're returning from the context of where you yielded to the block
<CodeFriar> workmad3: yeah, thats why I tried a next first
<LiquidInsect> which isn't what you generally want
Lord-Harlot has joined #ruby
kenichi has joined #ruby
<denysonique> Here is my variable workaround: https://gist.github.com/2295111
stephenjudkins has joined #ruby
<Mon_Ouie> denysonique: why not just @session = $last_session?
<davidcelis> ew globals
<denysonique> heh
<denysonique> yes, thats right
<denysonique> I might have overcomplicated the problem
<denysonique> or maybe I thought about some other scenarios
<denysonique> Mon_Ouie: Thank you
Foxandxss has joined #ruby
musl has joined #ruby
daniel_hinojosa has joined #ruby
rushanuk has quit [#ruby]
<Synthead> #/usr/bin/env ruby should be a good shebang, right?
<workmad3> Synthead: possibly
<shadoi> yes.
<Synthead> shadoi, workmad3: it seems to be trying to run as a bash script
<shadoi> the bang is required
<workmad3> Synthead: oh, #!, not #
<Synthead> plonk
<Synthead> D:
<Synthead> it works now, thanks.....
* Synthead sheepishly walks away hoping nobody's looking
mcwise has joined #ruby
s0ber has joined #ruby
y3llow_ has joined #ruby
* shevy looks at Synthead
* Synthead gasps
<Synthead> I KNOW WHAT A COMPUTER IS I SWEAR
<any-key> hahaha
MasterIdler_ has joined #ruby
<workmad3> Synthead: I can believe that... but how about a shell? :)
<LiquidInsect> oh come on that's too easy, it's what snails live in
CharlieSu has joined #ruby
<Synthead> I got a a+ in shellometry
<Synthead> a++ even
neglesaks has joined #ruby
<CharlieSu> Can someone explain this syntax to me? set = [*(0..255)]
<CharlieSu> I'm having a hard time finding it onlinne
<denysonique> What is your favourite thing in Ruby (could be class, method, construct, anything)
<denysonique> Mine is probably blocks
<denysonique> for now
<any-key> Blocks fo sho
<Synthead> denysonique: your mom
<any-key> Brocks and Rambdas
<LiquidInsect> CharlieSu: I assume the sticking point ther eis the * right?
<CharlieSu> LiquidInsect: correct
y3llow has joined #ruby
<LiquidInsect> that's called a splat in that context, it turns whatever follows it basically into a comma-separated list of tokens
<LiquidInsect> for instance you can use it to accept an arbitrary number of arguments in a method:
<LiquidInsect> def some_method(*args)
<LiquidInsect> then access all the args with args[0] args[1] etc
<any-key> bonus points for def some_method(*args,&brock)
<any-key> brocks and rambdas
Lord-Harlot has quit [#ruby]
* shevy presses any-key
davidpk has joined #ruby
<CharlieSu> LiquidInsect: ok yeah i knew about using splat it methods.. not in arrays though
y3llow has joined #ruby
philips has joined #ruby
<CharlieSu> LiquidInsect: I would have just done this.. (1..255).to_a
<LiquidInsect> same
<any-key> same here
<LiquidInsect> it's more explicit about what it's doing
johanhsfy has joined #ruby
<CharlieSu> cool.. thanks all
<denysonique> Synthead: fuck off
ozymandius has joined #ruby
<any-key> whoawhoawhoa
brngardner has joined #ruby
<Synthead> denysonique: just fooling
justinmcp has joined #ruby
<denysonique> me too
<shevy> I hate you both
<Synthead> lmao
<CodeFriar> Anyone know how to switch thor into color mode ?
<shevy> I only like any-key
<shevy> but I cant find the any-key :(
<shevy> thor.lightning_mode!
<LiquidInsect> I'll just have a tab instead.
<LiquidInsect> Oh, no time to talk, the computer's starting
Pel- has joined #ruby
<shevy> like a car?
Pel- has quit [#ruby]
scientes has joined #ruby
Pel- has joined #ruby
Pel- has quit [#ruby]
conor_ireland has joined #ruby
gourneau has joined #ruby
gourneau has quit [#ruby]
andrewhl has joined #ruby
fayimora has joined #ruby
antonishen has joined #ruby
twinturbo has joined #ruby
bluenemo has joined #ruby
bluenemo has joined #ruby
dbwest has quit [#ruby]
hooper has joined #ruby
visof has joined #ruby
visof has joined #ruby
manizzle has joined #ruby
Guest71832 has joined #ruby
havenn has joined #ruby
shruggar has joined #ruby
burzum_ has joined #ruby
satrionics has quit ["Konversation terminated!"]
<burzum_> mmm
vjacob has joined #ruby
burzum_ has quit [#ruby]
alex__c2022 has joined #ruby
Squarepy has joined #ruby
Squarepy has joined #ruby
looopy has joined #ruby
beeneto has joined #ruby
rking has joined #ruby
baroquebobcat has joined #ruby
Divinite has joined #ruby
robbyoconnor has joined #ruby
masteraka has joined #ruby
FreezingCold has joined #ruby
thone has joined #ruby
<FreezingCold> Getting this werid error. http://pastebin.com/raw.php?i=knnhrk5q
schovi has joined #ruby
robbyoconnor has joined #ruby
trivol has joined #ruby
PragCypher has joined #ruby
mxweas has joined #ruby
SpitfireWP has joined #ruby
<denysonique> FreezingCold: is this after installing RVM?
<FreezingCold> denysonique: didn't know I needed it
<FreezingCold> Is it a package?
<denysonique> nope you don't
<denysonique> You don't have /home/user/.gem/ruby/1.9.1/bin in your PATH,
<denysonique> you can add it to your PATH
<denysonique> in bashrc for example
<denysonique> PATH="$PATH:/home/user/.gem/ruby/1.9.1/bin:"
<denysonique> PATH="$PATH:/home/user/.gem/ruby/1.9.1/bin"
<denysonique> add the last line to your ~/.bashrc
atnight has joined #ruby
<denysonique> if executing some commands provided by some gems don't work
cousine has joined #ruby
<FreezingCold> denysonique: Do I need to add it to my root's .rcbash too?
<FreezingCold> *.bashrc
My_Hearing has joined #ruby
zaiste_ has joined #ruby
<linduxed> hey guys, i just created some nice functioning code, but i think i need to clean it up. i've tried to keep the variable names as clear as possible so the code should be readable
<linduxed> it's very imperative at the moment, which from what i've learned is a bad thing in Ruby
<linduxed> if you want i can attach the rspec tests for that code, but i don't think it should be necessary
icy` has joined #ruby
<Aristata> linduxed: Have an ore class
<Aristata> Ore.new(amount).worth
<Aristata> Ore.new(type, quantity).worth
<Aristata> one million bucks
zaiste_ has joined #ruby
<linduxed> i've got an ore class, but it's not very populated
<linduxed> acutally, i'll add some files to that gist
<linduxed> just wait a sec
tommyvyo has joined #ruby
vjacob has quit ["Leaving"]
waxjar has joined #ruby
<linduxed> there we go
<linduxed> should be updated with more relevant files
yoklov has joined #ruby
<td123> huh, what's the diff between #ruby and #ruby-lang?
johnmilton_ has joined #ruby
<denysonique> u = self.new
<denysonique> u.instance_eval(&blk)
<denysonique> Is it possible to do this without &blk in the def of a method containing this?
<denysonique> e.g. u.instance_eval(yield.to_proc)
<denysonique> u.instance_eval(yield) or {yield} unfortunately does not work
<denysonique> and probably shouln't
johnmilton_ has quit [#ruby]
otters has joined #ruby
bglusman has joined #ruby
nfluxx has joined #ruby
looopy has joined #ruby
arvidkahl has joined #ruby
twelvechairs has joined #ruby
ed_hz_ has joined #ruby
td123 has joined #ruby
dzhulk has joined #ruby
Nss has joined #ruby
koudaddy1981 has joined #ruby
<Aristata> td123: One more person wanting moderator privileges?
_root_ has joined #ruby
<jlogsdon> look at linduxed workin' on eve things~
<linduxed> jlogsdon: haha, true
<jlogsdon> i used to have a full-featured production management app
<jlogsdon> used it for our capital production line, mineral import and product export business. good times
<linduxed> jlogsdon: well, i wanted to make a mining app to learn ruby and rails
<jlogsdon> cool
zaiste has joined #ruby
niku4i has joined #ruby
<linduxed> jlogsdon: but as you see with that code, it don't really know how to make it pretty
<jlogsdon> useful and involved enough to learn a bit
<jlogsdon> yeah, rails conventions take some time t get used to. ill check that code out in a minute
<linduxed> and i'm also the kinda guy who wants to do it right the first time, otherwise i don't go forward
<linduxed> kinda hampers progress, but that's just how i roll
<jlogsdon> sam
<jlogsdon> same*
<any-key> I write shit, then read over it later and slap myself
<any-key> works fairly well so far
<any-key> except sometimes when I'm tired I write stupid code and hide silly things in silly places
zaiste has joined #ruby
<td123> Aristata: I'm just curious on what the difference is that's all
strife25 has joined #ruby
daed has quit [#ruby]
bglusman has joined #ruby
io_syl has joined #ruby
schovi has joined #ruby
<Aristata> td123: I am pretty sure that is the only difference.
Guedes has joined #ruby
<td123> oh ok
<td123> ty
ed_hz_ has joined #ruby
mattp_ has joined #ruby
Targen has joined #ruby
nif has joined #ruby
niku4i has joined #ruby
icy` has joined #ruby
icy` has joined #ruby
Boohbah has joined #ruby
icy` has joined #ruby
icy` has joined #ruby
stephenjudkins has joined #ruby
fayimora_ has joined #ruby
<jlogsdon> linduxed: so this calculates the total value of whatever ores you give it?
mattp_ has joined #ruby
nik_-_ has joined #ruby
keymone_ has joined #ruby
nik_-_ has joined #ruby
mattp_ has joined #ruby
snip_it has joined #ruby
wyhaines has joined #ruby
brandon_ has joined #ruby
shaggy2dope has joined #ruby
d2dchat has joined #ruby
juarlex has joined #ruby
cousine has joined #ruby
lkba has joined #ruby
johnmilton has joined #ruby
Squarepy has joined #ruby
Squarepy has joined #ruby
nif has joined #ruby
alanp has joined #ruby
booginga has joined #ruby
zakwilson has joined #ruby
Synthead has joined #ruby
jgrevich_ has joined #ruby
jgrevich_ has joined #ruby
liluo has joined #ruby
jgrevich__ has joined #ruby
cousine has joined #ruby
ed_hz__ has joined #ruby
helichopter has joined #ruby
jarubyh has joined #ruby
dwon has joined #ruby
Ontolog has joined #ruby
<jlogsdon> linduxed: finally got around to looking at it. here's how i would do it: https://gist.github.com/2296219
<jlogsdon> lets you easily get the value of a single batch of a single ore, then the calculator just reduces it all
<jlogsdon> i gotta go, but if you'd like to discuss at some point just shoot me a msg
twinturbo has joined #ruby
gen0cide_ has joined #ruby
nova2wl has joined #ruby
charlenopires has joined #ruby
nari has joined #ruby
brngardner has joined #ruby
ozymandius has joined #ruby
zunnyohn1 has joined #ruby
nobitanobi has joined #ruby
liluo has joined #ruby
nect_ has joined #ruby
<nobitanobi> I want to use this: https://github.com/dcparker/ruby-gmail -- But I fail to see how would I install it so I am able to do require 'gem'. I am under RVM, anyone can point me how I would let Ruby know about this library?
<any-key> rvm all do gem install <gemname>
<any-key> then in the script do:
<any-key> require 'rubygems'
<any-key> require '<gemname>'
__main__ has joined #ruby
<luckyruby> what's the opposite of array1 & array2?
<nobitanobi> any-key: The gem (http://rubygems.org/gems/ruby-gmail) version is 0.2.1, and in the Github there is 0.2.2 - So I would like to install the one in Github.
<any-key> I'm afraid I don't know the best way to do that
<luckyruby> nm, i guess there isn't one.
evilgeenius has joined #ruby
Axsuul has joined #ruby
<shadoi> luckyruby: ary1 - ary2
<shadoi> luckyruby: though it's not exactly opposite, & is an intersection
<evilgeenius> How can I mock a class with MiniTest::Mock?
<evilgeenius> I want to replace the Area activerecord class.
SolarisBoy has joined #ruby
nect has joined #ruby
<nobitanobi> I have created a project with a Gemfile with this content: source "http://rubygems.org" gem "ruby-gmail", "~> 0.2.1" -- In the same project I have created a file that does require 'gmail' as specified in https://github.com/dcparker/ruby-gmail -- After doing bundle install, if I try to execute that file, I get `require': cannot load such file -- mime/message (LoadError)
<nobitanobi> Am I missing something?
nfluxx_ has joined #ruby
ed_hz__ has joined #ruby
mengu has joined #ruby
mengu has joined #ruby
<shadoi> google is your friend
<Axsuul> What do you guys recommend for doing GUI?
<shadoi> Axsuul: what are the requirements?
<Axsuul> shadoi: native UI look, cross platform, menu bars, dialog boxes
<nobitanobi> shadoi: thanks.
<shadoi> Axsuul: your choices are pretty much Gtk, QT, QT being the most native looking.
<shadoi> Axsuul: there was someone in here creating a nice DSL for qt-ruby called QtR
<luckyruby> is there a verb to describe creating a hash? hashify?
<Axsuul> shadoi: cool thanks
freeayu has joined #ruby
ringotwo has joined #ruby
<shadoi> luckyruby: not a real one :)
<nobitanobi> shadoi: Is it normal that in this page: http://rubygems.org/gems/ruby-gmail -- the version is 0.2.1, but in the https://github.com/dcparker/ruby-gmail/blob/master/VERSION -- I see 0.2.2 ? However, if I try to install 0.2.2 I can't.
brngardner has joined #ruby
<Axsuul> nobitanobi: yea, rubygems versions dont always correspond to github repos
<nobitanobi> Axsuul: then, I should make my Gemfile to point to the git right?
<Axsuul> nobitanobi: yep
<nobitanobi> I see.. Ok thanks
<Axsuul> nobitanobi: if you want to target a certain version, use ref:
<shadoi> nobitanobi: it means it's unreleased...
<nobitanobi> shadoi: Axsuul: Thanks a lot.
<shadoi> nobitanobi: sometimes you can use '—pre' in your gem install command to get betas and release candidates.
<nobitanobi> oh, that's a good tip
gurugeek_ has joined #ruby
zunnyohn1 has joined #ruby
<Axsuul> yep, or also use.. bundle outdated to see any outdated ones (bundler 1.1)
<Axsuul> shadoi: when you said QtR, did you mean this? http://en.wikipedia.org/wiki/QtRuby
<gurugeek_> hi can someone pretty please help me to translate this bash line into ruby? thanks !!! http://pastebin.com/CH9spbvw
<shadoi> Axsuul: the new one uses that but makes it simpler
kish has joined #ruby
<kish> this is *very* cool: ruby1.9.1 -e "puts(Time.now + 259200)"
<shadoi> Axsuul: his name was denysonique
senthil has joined #ruby
Eiam has joined #ruby
<Axsuul> shadoi: hmm yea I found his repo, https://github.com/denysonique/QtR
<senthil> if i've to send info from object to another, should i just send the info or the entire object?
<Axsuul> seems like an aliased DSL
<gurugeek_> anyone please ? :) http://pastebin.com/CH9spbvw
charlenopires has joined #ruby
p-daxx has joined #ruby
<bounce> hey, you're the guru AND the geek here
<Axsuul> gurugeek_: max_id = `dscl . -list /Users UniqueID | awk '{print $2}' | sort -ug | tail -1`
dv310p3r has joined #ruby
<shadoi> actually $() is the better syntax.
<denysonique> QtR is a baby, I am going to push more code soon.
<shadoi> USERID needs to be a let for arithmetic though.
<shadoi> nevermind $(()) is the same as a let
fayimora has joined #ruby
<kish> oooh ruby looks sexy
<shadoi> gurugeek_: you just need: USERID=$(($MAXID + 1))
<Axsuul> denysonique: just wondering, why create a DSL on top of that, is qt-ruby hard to work with?
<gurugeek_> Axsuul: thanks a lot but that gives me the highest id can I get just the one after the last ?
pencilcheck has joined #ruby
<Axsuul> gurugeek_: after the last? like +1?
<gurugeek_> Axsuul: yes
<Axsuul> gurugeek_: user_id = max_id.to_i + 1