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
<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?
<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
<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?
<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]"
<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.
<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.
<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
<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?
<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
<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...
<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
<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 ;)
<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
<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.
<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?
<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
<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)