<zastern>
it was also a bit confusing because i dont often look at code lacking parens
<zastern>
so when i do i'm much slower
<zastern>
anyway, thanks!
<zastern>
havenwood: is this ruby 2.0.0 only? not 1.9.3?
<zastern>
:/
<havenwood>
zastern: yes, indeed
robustus has joined #ruby
DeProdigy has joined #ruby
<havenwood>
zastern: Ruby 1.9.3 will be retired next year though. Nice to be on 2.0, or soon 2.1. :) Should be a smooth to transition.
ewnd9 has joined #ruby
Bry8Star{T2 has joined #ruby
sevenseacat has joined #ruby
rhunter has quit [Ping timeout: 260 seconds]
mk_qi has joined #ruby
<zastern>
mm
ephemerian has quit [Quit: Leaving.]
<zastern>
thanks for your help
<havenwood>
zastern: np, but yeah, on 1.9 the hash style makeshift kwargs
<zastern>
My company will likely be on 1.9.3 for the forseeable future I'm afraid
lyanchih has joined #ruby
<havenwood>
zastern: aha, yeah sometimes policies get you stuck - anyways, 1.9.3 is nice
<havenwood>
zastern: hopefully Ruby core can convince them to bump
<havenwood>
zastern: pull a Firefox, release often
<havenwood>
a Chrome rather, I guess
emocakes has quit [Read error: Connection reset by peer]
<zastern>
Enterprise users don't like that :)
aspires has quit []
<havenwood>
zastern: sooo true
<zastern>
And the update from 1.8.7 to 1.9.3 was kinda painful for us
<zastern>
especially around the uh
<zastern>
string encoding stuff
<havenwood>
zastern: yeah, that is rough
<zastern>
(obviously I'm not one of our developers - that'd be a sad state of affairs)
<zastern>
I'm just trying to learn
<havenwood>
zastern: i think many folk ran into same thing, but pleasantly surprised that 1.9.3 is more of a release candidate for 2.0, not some breaking backwards thing.
pragmatism is now known as pragmatism|away
emocakes has joined #ruby
Kricir has quit [Remote host closed the connection]
<pragmatism|away>
back
iliketur_ has joined #ruby
pureluck has quit [Ping timeout: 248 seconds]
rjhunter has joined #ruby
lyanchih has quit [Quit: lyanchih]
pureluck has joined #ruby
lyanchih has joined #ruby
nhhagen has joined #ruby
Lewis has joined #ruby
iliketu__ has joined #ruby
kirun has quit [Quit: Client exiting]
iliketur_ has quit [Ping timeout: 250 seconds]
agent_white has joined #ruby
DeProdigy has quit [Read error: Connection reset by peer]
DeProdigy has joined #ruby
ambushsabre has joined #ruby
pureluck has quit [Read error: Operation timed out]
nhhagen has quit [Ping timeout: 252 seconds]
<pragmatism|away>
back
Lewis has quit [Ping timeout: 264 seconds]
rfx86 has quit [Ping timeout: 264 seconds]
colonolGron has joined #ruby
Parker0 has joined #ruby
aspires has joined #ruby
ewnd9 has quit [Ping timeout: 252 seconds]
phipes has quit [Remote host closed the connection]
tkuchiki has joined #ruby
marr has quit [Ping timeout: 265 seconds]
rjsamson has joined #ruby
Catie has quit [Ping timeout: 252 seconds]
benzrf has joined #ruby
<benzrf>
hi, im trying out Haml
nwertman has joined #ruby
tylersmith has quit [Remote host closed the connection]
<benzrf>
how would I do something like '<strong>{expr}</strong>: {expr}'?
<benzrf>
I don't really want newlines
michaeldeol has joined #ruby
wildroman2 has quit [Read error: Connection reset by peer]
<benzrf>
something like
<benzrf>
%strong= k
<benzrf>
= ": #{v}"
<benzrf>
?
kitak has quit [Read error: Connection reset by peer]
kizzx2 has joined #ruby
ehaliewicz has joined #ruby
kitak has joined #ruby
emocakes has quit [Read error: Connection reset by peer]
emocakes_ has joined #ruby
coca_rails has joined #ruby
kitak has quit [Read error: Connection reset by peer]
Emmanuel_Chanel has quit [Quit: Leaving]
kitak_ has joined #ruby
havenwood has quit [Remote host closed the connection]
kitak_ has quit [Remote host closed the connection]
michaeldeol has quit [Ping timeout: 246 seconds]
kitak has joined #ruby
Kricir has joined #ruby
amacgregor_ has joined #ruby
DeProdigy has quit [Read error: Connection reset by peer]
nwertman_ has joined #ruby
colonolGron has quit [Quit: Lost terminal]
DeProdigy has joined #ruby
imsaar has joined #ruby
<pontiki>
yup
<benzrf>
should i put a > on the strong to make it one line
<pontiki>
i tend to do that, but it's not necessary
<benzrf>
it changes whitespace
<pontiki>
yup i know
<benzrf>
*in the rendered doc
<pontiki>
%strong=> k
<benzrf>
not >=?
<pontiki>
well
davy has quit [Remote host closed the connection]
<pontiki>
hmm
stevenhaddox has joined #ruby
amacgregor has quit [Ping timeout: 246 seconds]
<pontiki>
so right off the top of my head, i don't remember
<pontiki>
read the docs
falood has joined #ruby
<benzrf>
ok, ttyl
<pontiki>
kk
<benzrf>
gonna watch a vid about monad transformers
<benzrf>
:D
benzrf has left #ruby [#ruby]
nwertman has quit [Ping timeout: 264 seconds]
Jake232 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mkevin has quit [Remote host closed the connection]
<havenwood>
CpuID: ruby-install with chruby is my fav :)
<CpuID>
the main annoying thing with shims, is you would expect it to just execute the binary under the ruby version it was installed, if it only exists under 1 version
<CpuID>
eg. lets say i install a gem under 1.9.3-pxxx
<CpuID>
and it installs a shim
<CpuID>
whenever it executes that shim, if theres =1 copy of it across all rbenv versions, just execute it under that ruby version
hakunin_ is now known as hakunin
<CpuID>
as opposed to going "The `xxx' command exists in these Ruby versions:"
<CpuID>
if i have a different global ruby version specified
rubyracer has joined #ruby
malcolmva has quit [Ping timeout: 272 seconds]
<CpuID>
meh, im just going to throw a hook to delete the shims i dont want for now, means i can move on
Rollabunna has joined #ruby
<CpuID>
i might come back to using chruby later
nhhagen has joined #ruby
tylersmith has joined #ruby
<havenwood>
CpuID: g'luck! yeah, do check out chruby if you decide you've had enough of shims - it just works, and can even use your rbenv installed Rubies if you want :)
peregrine81 has joined #ruby
stevenhaddox has quit [Ping timeout: 264 seconds]
<CpuID>
hehe :) yea cool thanks for the tip
nhhagen has quit [Ping timeout: 252 seconds]
tylersmith has quit [Read error: Connection reset by peer]
seoaqua has joined #ruby
tylersmith has joined #ruby
stevenhaddox has joined #ruby
seoaqua has left #ruby [#ruby]
amacgregor has joined #ruby
amacgregor__ has joined #ruby
amacgregor_ has quit [Ping timeout: 246 seconds]
hogeo has quit [Remote host closed the connection]
jonahR has quit [Quit: jonahR]
malcolmva has joined #ruby
iliketur_ has quit [Quit: zzzzz…..]
varfoo has joined #ruby
fijimunkii has joined #ruby
amacgregor has quit [Ping timeout: 246 seconds]
HawkTracker has joined #ruby
Sawbones has quit [Remote host closed the connection]
iliketur_ has joined #ruby
echevemaster has quit [Quit: Leaving]
phipes has quit []
<HawkTracker>
hello, I have a rake task called deploy, I would like to input>> rake deploy thing and have "thing" as a variable I can use.
phipes has joined #ruby
shedd has joined #ruby
psyl0n has quit [Remote host closed the connection]
gyre007 has quit [Remote host closed the connection]
gyre007 has joined #ruby
HawkTracker has quit [Quit: Leaving]
mkevin has joined #ruby
Rollabunna has quit [Ping timeout: 265 seconds]
stevenhaddox is now known as stevenhaddox|afk
stevenhaddox|afk has quit [Quit: Zzzz...]
jamesaanderson has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rootshift has quit [Quit: rootshift]
hogeo has joined #ruby
rootshift has joined #ruby
emocakes has quit [Ping timeout: 246 seconds]
dseitz has joined #ruby
gyre007 has quit [Ping timeout: 246 seconds]
hogeo_ has joined #ruby
hogeo has quit [Read error: Connection reset by peer]
mkevin has left #ruby [#ruby]
matthieua has joined #ruby
Sthebig has joined #ruby
seoNinjaWarrior has joined #ruby
coca_rails has quit [Remote host closed the connection]
<seoNinjaWarrior>
how would i fix "open_uri" not working correctly? I've tested the same script on my dev box and it works great, in the production box any open_uri request instantly gives me an error....
<seoNinjaWarrior>
reinstall all of ruby?
CaptainJet has quit []
<Lewix>
pontiki: the answer was yes
shedd has joined #ruby
hogeo_ has quit [Ping timeout: 264 seconds]
Sthebig has quit [Ping timeout: 240 seconds]
browndawg has joined #ruby
<rjhunter>
seoNinjaWarrior: What's the error?
<seoNinjaWarrior>
EOF End of file
LexicalScope has joined #ruby
<seoNinjaWarrior>
which makes no sense, every other gem / program on the server can get to the net just fine, i even checked the ports using telnet, lol. it's only open_uri on that box :/
sergicles has joined #ruby
shedd has quit [Ping timeout: 264 seconds]
mlpinit_ has joined #ruby
Hanmac1 has joined #ruby
lyanchih has quit [Quit: lyanchih]
<rjhunter>
seoNinjaWarrior: Can you access the URL from other parts of Ruby? (especially Net::HTTP)
<seoNinjaWarrior>
i believe so. i can use httparty
Hanmac has quit [Ping timeout: 245 seconds]
<seoNinjaWarrior>
err there's a little more to this, but i'm going to try to reinstall ruby and see if that doesn't fix it
<eval-in_>
Hanmac => #<Proc:0x41e8d118@/tmp/execpad-95e72b065585/source-95e72b065585:2 (lambda)> is not a symbol (TypeError) ... (https://eval.in/77531)
<jxf>
dopie: aren't you trying to set the value of the field on line 7 in your gist?
<sevenseacat>
looks like it
<Hanmac>
shevy arsome, you can also use something like that "\000" as method name ;P
dopie has quit [Read error: Connection reset by peer]
<jxf>
oh no I killed him :(
<sevenseacat>
crazy
Barrin6 has quit [Quit: Leaving]
xjiujiu_ has joined #ruby
<shevy>
there goes dopie
michaeldeol has quit [Ping timeout: 245 seconds]
<sevenseacat>
i wouldnt call him patient. i'd call him stubborn.
dopie has joined #ruby
<dopie>
gotta love VM
<dopie>
:
<dopie>
:)
batchitcray has quit [Ping timeout: 250 seconds]
xjiujiu has quit [Ping timeout: 264 seconds]
jbpros has joined #ruby
rootshift has joined #ruby
_Andres has joined #ruby
psyl0n has joined #ruby
jhaals has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
shedd has joined #ruby
h_kon has joined #ruby
ahbrendan has joined #ruby
<shevy>
and he is back again
fijimunkii has quit [Read error: Connection reset by peer]
<dopie>
woot woot
<shevy>
jxf is no longer known as "the dopie murderer"
<jxf>
exonerated
DropsOfSerenity has joined #ruby
dayepa has quit [Ping timeout: 246 seconds]
* dopie
kicks jxf in the right arm
<jxf>
dopie: aren't you trying to set the value of the field on line 7 in your gist?
<dopie>
jxf, yes
<jxf>
dopie: then what did you mean by this: <dopie> sevenseacat, it doesnt have a value
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<dopie>
file.html
psyprus has quit [Read error: Connection reset by peer]
<dopie>
the input box doesnt have a value
<dopie>
?
psyl0n has quit [Ping timeout: 250 seconds]
aasirc has joined #ruby
<tobiasvl>
but you're trying to give it one
<dopie>
correct
poguez has quit [Ping timeout: 245 seconds]
<jxf>
dopie: ok, but since you're trying to give it one, then you can do what I said before
<dopie>
but it cant find the input box because of $...
Lewis has quit [Remote host closed the connection]
shedd has quit [Ping timeout: 246 seconds]
<jxf>
f['...'] = value
<sevenseacat>
(15:56:37) sevenseacat: or title or something
poguez has joined #ruby
dayepa has joined #ruby
drumusician has joined #ruby
<sevenseacat>
the name/id is totally meaningless
<sevenseacat>
and probably will change
<shevy>
dopie I think even without a specific name, mechanize allows you to access all those html elements
PhilK has quit [Ping timeout: 245 seconds]
Norrin has quit [Ping timeout: 245 seconds]
jsaak has quit [Ping timeout: 272 seconds]
marr has joined #ruby
<jxf>
the reason Mechanize lets you do `f['...'] = ...` to access elements is because if it didn't, then you could only access HTML elements which were also valid Ruby identifiers
Lewis has joined #ruby
<jxf>
(barring metaprogramming trickery like using define_method + send)
sebastianb has quit [Ping timeout: 245 seconds]
bentonrr has joined #ruby
Mapley has quit [Ping timeout: 245 seconds]
sebastianb has joined #ruby
heftig has quit [Ping timeout: 245 seconds]
w4pm has quit [Ping timeout: 246 seconds]
Kricir has quit [Ping timeout: 265 seconds]
parshap has quit [Read error: Connection reset by peer]
parshap has joined #ruby
kaldrenon has joined #ruby
mengu has quit [Ping timeout: 246 seconds]
pyrac has quit [Quit: pyrac]
psyprus has joined #ruby
drumusician has quit [Read error: Operation timed out]
pyrac has joined #ruby
CpuID has quit [Ping timeout: 250 seconds]
nhhagen has joined #ruby
Mapley has joined #ruby
phansch has joined #ruby
buscon has joined #ruby
bentonrr has quit [Ping timeout: 265 seconds]
ahbrendan has quit [Ping timeout: 258 seconds]
kaldrenon has quit [Read error: Operation timed out]
jamesfung14 has quit [Read error: Operation timed out]
phansch has quit [Remote host closed the connection]
phansch has joined #ruby
nhhagen has quit [Ping timeout: 265 seconds]
amundj has joined #ruby
fella7s has quit [Remote host closed the connection]
DeProdigy has joined #ruby
ephemerian has joined #ruby
DropsOfSerenity has quit [Quit: Peace.]
alup has joined #ruby
xjiujiu_ has quit [Read error: Connection reset by peer]
camilasan has joined #ruby
heftig has joined #ruby
xjiujiu has joined #ruby
michaeldeol has joined #ruby
huttan has quit [Remote host closed the connection]
fella5s has joined #ruby
psyprus has quit [Read error: Connection reset by peer]
michaeldeol has quit [Read error: Connection reset by peer]
DeProdigy has quit [Ping timeout: 246 seconds]
michaeldeol has joined #ruby
Lewis has quit [Remote host closed the connection]
apeiros has joined #ruby
yfeldblum has quit [Ping timeout: 246 seconds]
oddalot has quit [Remote host closed the connection]
mengu has joined #ruby
mengu has quit [Changing host]
mengu has joined #ruby
michaeldeol has quit [Ping timeout: 264 seconds]
troessner has joined #ruby
tjad_ has joined #ruby
SHyx0rmZ has joined #ruby
nettoweb has joined #ruby
dev1x has joined #ruby
maoko has joined #ruby
shedd has joined #ruby
funburn has quit [Quit: funburn]
ahbrendan has joined #ruby
synergy_ is now known as sng|Zzz
vlad_starkov has quit [Read error: Connection reset by peer]
nettoweb has quit [Ping timeout: 250 seconds]
mikecmpbll has joined #ruby
shedd has quit [Ping timeout: 245 seconds]
vlad_starkov has joined #ruby
LexicalScope has quit [Ping timeout: 260 seconds]
kevinykchan has joined #ruby
xjiujiu has quit [Read error: Connection reset by peer]
<workmad3>
you'll want to sort out a better way of adding commands though... one giant case statement isn't exactly scalable ;)
mikecmpbll has joined #ruby
<maasha>
workmad3: I think so too (if the lazy loading behaves in an actual memory stress test)
Speed has joined #ruby
funburn has joined #ruby
sayan has quit [Ping timeout: 250 seconds]
<maasha>
workmad3: one thing missing is perhaps the possibility to split a pipe e.g. with grep so you have one subpipe with matching entries and one with non-matching?
<maasha>
workmad3: the giant case statement can be fixed with some metaprogramming (you showed some earlier - I did save that).
<maasha>
workmad3: and do you think the run.all could be made implicit to run?
joonty has joined #ruby
<maasha>
workmad3: I was trying that, but it ended up in a mess.
nisstyre has quit [Quit: Leaving]
shedd has joined #ruby
roolo has joined #ruby
<workmad3>
I don't see why you need the .all there
zipper has joined #ruby
iliketu__ has joined #ruby
iliketu__ has quit [Read error: Connection reset by peer]
kitak_ has quit [Remote host closed the connection]
chiel_ is now known as chiel
<maasha>
workmad3: the lazy enumerator requires the .each {} call as the last action to start the pipeline
kitak has joined #ruby
ghr has joined #ruby
Kricir has joined #ruby
iliketur_ has quit [Ping timeout: 260 seconds]
nvrch has joined #ruby
<workmad3>
ah, right yeah... you're returning chained together enumerators rather than the result of the evaluation in the run
<maasha>
workmad3: but it is nifty that it gives the very logical .first 6 option to run only 6 entries through the pipe.
<maasha>
workmad3: I could live with run.all if there is only messy alternatives.
<workmad3>
well, that's now your design ;)
<workmad3>
so it's yours to play with and figure out :P
<maasha>
workmad3: ok, but the split feature? doable? messy?
<workmad3>
ok, so you split... what do you get as an 'output'?
<workmad3>
I remember saying that rather than having splits, you would probably be better off having a lazy builder approach (that you now have) so you can simply have pre = cmds_up_to_grep; p1 = pre | cmd(:grep, select: "pattern"); p2 = pre | cmd(:grep, reject: "pattern")
psyprus has joined #ruby
<maasha>
workmad3: but that will require iterating over the same lines twice
<workmad3>
because being able to independently direct two streams at once in a pipeline into two different processing stages is really difficult if you want a sensible output
Astralum has joined #ruby
<workmad3>
but meh, this is now going back really quite far in my memory for something I knocked up for you in 10 mins :P
<workmad3>
have fun figuring out the design for it ;)
rdark has joined #ruby
* Hanmac
is rememberd at gstreamer and the source-sink-pad connections ;P
<maasha>
workmad3: I was impressed by your 10 mins results :o). I was thinking maybe an additional 2 min could save the world :o)
<maasha>
workmad3: I'll play some more.
timonv has quit [Ping timeout: 252 seconds]
michaeldeol has joined #ruby
funburn has quit [Quit: funburn]
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
klaut has quit [Remote host closed the connection]
dukz has quit [Remote host closed the connection]
dukz has joined #ruby
hogeo has quit [Remote host closed the connection]
flubba has quit [Remote host closed the connection]
lele has left #ruby ["Leaving"]
Es0teric has joined #ruby
d45h has joined #ruby
relix has joined #ruby
Es0teric has quit [Max SendQ exceeded]
michaeldeol has quit [Ping timeout: 265 seconds]
sevenseacat has quit [Remote host closed the connection]
kitak_ has joined #ruby
hogeo has joined #ruby
<shevy>
10 mins of doing what
petey has joined #ruby
<shevy>
workout? :-)
<shevy>
in that case, yeah, do 2 more minutes workmad3!
kitak has quit [Read error: Connection reset by peer]
<shevy>
hehe
funburn has joined #ruby
kitak_ has joined #ruby
<lagweezle>
spam spam cheese eggs bacon and spam
shedd has joined #ruby
platzhirsch has joined #ruby
<maasha>
shevy: ignoramus
kitak_ has quit [Read error: Connection reset by peer]
TMM has joined #ruby
kitak has joined #ruby
lurch_ has joined #ruby
rushed has joined #ruby
<shevy>
"joke-proof conditions"
carraroj has quit [Quit: Konversation terminated!]
kitak has quit [Read error: Connection reset by peer]
kitak_ has joined #ruby
Emmanuel_Chanel has quit [Quit: Leaving]
allsystemsarego has joined #ruby
Kricir has quit [Ping timeout: 252 seconds]
shedd has quit [Ping timeout: 245 seconds]
zipper has quit [Ping timeout: 260 seconds]
zipper has joined #ruby
dukz has quit [Remote host closed the connection]
threesome has joined #ruby
nari has quit [Ping timeout: 250 seconds]
dukz has joined #ruby
wallerdev has quit [Quit: wallerdev]
kitak has joined #ruby
hiyosi_ has joined #ruby
Emmanuel_Chanel has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
zipper has quit [Ping timeout: 252 seconds]
kitak has quit [Remote host closed the connection]
karupanerura is now known as zz_karupanerura
ahawkins has joined #ruby
kitak_ has quit [Read error: Connection reset by peer]
kitak has joined #ruby
Floydzy has joined #ruby
coca_rails has joined #ruby
ahawkins has quit [Client Quit]
emocakes_ has joined #ruby
ahawkins has joined #ruby
Floydzy has quit [Client Quit]
vlad_starkov has joined #ruby
hiyosi_ has quit [Ping timeout: 250 seconds]
rootshift has quit [Quit: rootshift]
peterhel1berg has quit [Ping timeout: 240 seconds]
timonv has quit [Remote host closed the connection]
jsaak has joined #ruby
psyl0n has joined #ruby
dukz has quit [Remote host closed the connection]
jxf has quit [Ping timeout: 240 seconds]
<olivier_bK1>
hy all
popl has joined #ruby
popl has joined #ruby
popl has quit [Changing host]
shaunbaker has joined #ruby
kitak_ has joined #ruby
dukz has joined #ruby
psyl0n has quit [Ping timeout: 252 seconds]
<kostine>
hi
<shevy>
hi olivier_c
avril14th has joined #ruby
dukz has quit [Remote host closed the connection]
dukz has joined #ruby
zipper has joined #ruby
peterhellberg has joined #ruby
kitak has quit [Ping timeout: 245 seconds]
browndawg has quit [Ping timeout: 265 seconds]
<shevy>
hey workmad3 what editor do you use again? vim?
lurch_ has quit [Quit: lurch_]
w4pm has joined #ruby
lurch_ has joined #ruby
klaut has joined #ruby
ariejan_ has joined #ruby
hogeo has quit [Remote host closed the connection]
Hanmac1 has joined #ruby
funburn has quit [Ping timeout: 245 seconds]
jbpros has quit [Quit: jbpros]
zmansiv has quit [Ping timeout: 260 seconds]
heftig has quit [Quit: Quitting]
x0nic has quit [Ping timeout: 260 seconds]
davidcelis has quit [Ping timeout: 245 seconds]
erichmenge has quit [Ping timeout: 252 seconds]
Tobarja has quit [Ping timeout: 250 seconds]
SirFunk has quit [Ping timeout: 250 seconds]
ayumin has joined #ruby
dukz_ has joined #ruby
TigerWolf has quit [Ping timeout: 240 seconds]
<ariejan_>
Hey. I've written a prototype eventmachine chat machine (kind of a mud). What would be the best way to test interaction? Like connect, say this, say that, expect these responses?
Hanmac has quit [Ping timeout: 265 seconds]
dukz has quit [Ping timeout: 264 seconds]
nick_h has quit [Ping timeout: 245 seconds]
w4pm has quit [Ping timeout: 264 seconds]
nick_h has joined #ruby
davidcelis has joined #ruby
lyanchih has quit [Ping timeout: 246 seconds]
micah`_ has quit [Ping timeout: 260 seconds]
shedd has joined #ruby
<apeiros>
ariejan_: write a client?
jbpros has joined #ruby
hellome has quit [Read error: Connection reset by peer]
<ariejan_>
apeiros: makes sense...
zacts has quit [Ping timeout: 250 seconds]
rootshift has joined #ruby
kitak_ has quit [Remote host closed the connection]
Tobarja has joined #ruby
kitak has joined #ruby
dukz has joined #ruby
crazysim has quit [Read error: Operation timed out]
zipper has quit [Read error: Connection reset by peer]
SirFunk has joined #ruby
kitak_ has joined #ruby
zastern has quit [Ping timeout: 245 seconds]
hogeo has joined #ruby
kitak_ has quit [Remote host closed the connection]
x0nic has joined #ruby
davidcelis has quit [Ping timeout: 250 seconds]
zmansiv has joined #ruby
kitak_ has joined #ruby
TorpedoSkyline has quit [Ping timeout: 272 seconds]
shedd has quit [Ping timeout: 250 seconds]
kitak has quit [Read error: Connection reset by peer]
zacts has joined #ruby
dukz_ has quit [Ping timeout: 250 seconds]
kitak_ has quit [Read error: Connection reset by peer]
<lurch_>
is there an easy way to get to the ulimits from a ruby process (readonly is fine) ? I now do: ruby -e 'puts %x[bash -lc "ulimit -n"]' but that seems a bit overkill
kitak has joined #ruby
ariejan_ has quit [Quit: Houdoe!]
<lurch_>
and it probably shows the ulimit of a child process, not the ruby process itself
shime has quit [Ping timeout: 250 seconds]
jbpros has quit [Ping timeout: 260 seconds]
<shevy>
without using system()? don't think so
<hoelzro>
lurch_: what OS are you on?
<lurch_>
centos 6.4
TorpedoSkyline has joined #ruby
kitak_ has joined #ruby
<hoelzro>
you can probably use /proc
<hoelzro>
or a binding to getrlimit
psyl0n has joined #ruby
<hoelzro>
hmm
<hoelzro>
there's apparently one on Process...
<lurch_>
ok, so probably File.read /proc/<pid>/limits or something
hogeo has quit [Remote host closed the connection]
<olivier_bK1>
tobiasvl, thanks i didn't know that
hogeo has joined #ruby
nbrosnahan has left #ruby [#ruby]
jbpros has joined #ruby
dukz has quit [Remote host closed the connection]
shime has joined #ruby
dukz has joined #ruby
akemrir has joined #ruby
dukz has quit [Remote host closed the connection]
nomenkun has quit [Remote host closed the connection]
shedd has joined #ruby
nomenkun has joined #ruby
h_kon has quit [Remote host closed the connection]
endash has quit [Read error: Connection reset by peer]
h_kon has joined #ruby
joumunji has joined #ruby
endash has joined #ruby
Kricir has quit [Ping timeout: 264 seconds]
dik_dak has quit [Quit: Leaving]
shime has quit [Read error: Operation timed out]
<joumunji>
Hi, I am doing some RSPEC testing with methods that extend the string class, how to I include the file to do the unit test
shedd has quit [Ping timeout: 250 seconds]
eka has joined #ruby
<joumunji>
i.e. I have a method "to_roman" that extends class Integer
shime has joined #ruby
nomenkun has quit [Ping timeout: 264 seconds]
<joumunji>
but when I do the rspec, how do I include the file "roman.rb" to "roman_spec.rb" given that I am not making a new class
dukz has joined #ruby
Deele has joined #ruby
ewnd9 has joined #ruby
michaeldeol has joined #ruby
blaxter_ has joined #ruby
hogeo has quit [Remote host closed the connection]
joumunji has quit []
PhilK has joined #ruby
blaxter_ is now known as blaxter
_Andres has joined #ruby
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
DeProdigy has joined #ruby
michaeldeol has quit [Ping timeout: 260 seconds]
N00D is now known as zz_N00D
Jake232 has joined #ruby
petey has joined #ruby
jlebrech has joined #ruby
mercwithamouth has joined #ruby
<KevinSjoberg>
I'm having this Casino wheel, and it consists of three wheels. An outer wheel, middle wheel and inner wheel. Each wheel have different fields with different logic in it. How would one structure this in Ruby?
<KevinSjoberg>
I'm thinking of creating a Wheel and then let OuterWheel, MiddleWheel and InnerWheel inherit from Wheel. But a "wheel" consists of all three classes. How would I go about having a class that uses all three?
<workmad3>
KevinSjoberg: why not call the inner bits 'rings' instead of wheels?
DeProdigy has quit [Ping timeout: 250 seconds]
hogeo has joined #ruby
<tobiasvl>
yes, it doesn't seem like you want the inner things to inherit from Wheel
<workmad3>
KevinSjoberg: so your Wheel is made up of an OuterRing, MiddleRing and InnerRing,
<KevinSjoberg>
workmad3: That's not a bad suggestion. Then I could have a Wheel which defines method outer_ring, middle_ring and outer_ring which just calls OuterRing.new respectivly.
shaunbaker has quit [Read error: Connection reset by peer]
<workmad3>
KevinSjoberg: I wouldn't start with any inheritance relationship between them though
shaunbaker has joined #ruby
petey has quit [Ping timeout: 245 seconds]
<KevinSjoberg>
workmad3: No that shouldn't be needed. The Wheel can just pass what's needed to the initializer, right?
_5kg has quit [Ping timeout: 246 seconds]
<workmad3>
KevinSjoberg: I'd only introduce a Ring superclass if I noticed substantial sharing between the 3 rings, and then push the duplication up :)
kraljev has joined #ruby
kirun has joined #ruby
<kraljev>
is it possible for heredoc to disregard tabs at the start of the line
tonni has quit [Quit: Leaving...]
<apeiros>
kraljev: no
<apeiros>
I usually use some gsub(/^INDENT/, '') magic
mengu has quit [Remote host closed the connection]
pyrac has joined #ruby
fgo has joined #ruby
fmendez has quit [Quit: fmendez]
goto is now known as anderson
amoli has quit [Ping timeout: 246 seconds]
decoponio has joined #ruby
lowski has joined #ruby
kobain has joined #ruby
mojjojo has quit [Quit: mojjojo]
emocakes_ has quit [Read error: Connection reset by peer]
emocakes has joined #ruby
Beoran_ has quit [Ping timeout: 256 seconds]
<shevy>
dumdedum
ayumin has quit [Remote host closed the connection]
<shevy>
I always go with 2 space indent in ruby code
schaerli has quit [Remote host closed the connection]
blaxter has quit [Quit: foo]
<shevy>
in LPC of a mud I sometimes contribute to, I was told that their convention was 4 spaces, so I followed that. oddly enough though, some others also used tab there, and I hated that they don't have a consistent indent rule really...
nettoweb has joined #ruby
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
p4d4w4n has quit [Quit: This computer has gone to sleep]
fafa has joined #ruby
lowski is now known as lowski_away
shedd has joined #ruby
hogeo has joined #ruby
havenwood has quit [Remote host closed the connection]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mengu has joined #ruby
mengu has joined #ruby
mengu has quit [Changing host]
ahbrendan has joined #ruby
nomenkun has joined #ruby
fmendez has joined #ruby
<maasha>
When calling a method with the magical hash options: mymethod(option: "foo") is there a smart way to reject typos like mymethod(optoins: "foo") from mymethods besides inspecting the options hash at that end?
xjiujiu_ has joined #ruby
shaunbaker has quit [Read error: Connection reset by peer]
shaunbaker has joined #ruby
lowski_away is now known as lowski
nomenkun_ has joined #ruby
shedd has quit [Ping timeout: 260 seconds]
charliesome has joined #ruby
hogeo has quit [Ping timeout: 264 seconds]
<pontiki>
maasha: i can only think of looking at the hash keys and comparing that to a list of acceptable keys
<maasha>
pontiki: ok
xjiujiu has quit [Ping timeout: 264 seconds]
<maasha>
pontiki: sometimes I waste a lot of time to figure out where something was nil ...
nomenkun has quit [Ping timeout: 265 seconds]
mojjojo has joined #ruby
fafa has quit []
lowski is now known as lowski_away
niklasb has quit [Ping timeout: 260 seconds]
ayumin has joined #ruby
Jake232 has joined #ruby
nomenkun_ has quit [Ping timeout: 260 seconds]
mojjojo has quit [Client Quit]
RaCx has quit [Ping timeout: 264 seconds]
shaunbaker has quit [Read error: Connection reset by peer]
shaunbaker has joined #ruby
sergicles has joined #ruby
mojjojo has joined #ruby
TripleDES has quit [Remote host closed the connection]
thesheff17 has quit [Remote host closed the connection]
rdark has quit [Client Quit]
rippa has joined #ruby
dkamioka_ has quit []
wildroman2 has joined #ruby
wildroman2 has quit [Remote host closed the connection]
d45h has quit []
wildroman2 has joined #ruby
jorge has quit [Quit: leaving]
thesheff17 has joined #ruby
rdark has joined #ruby
rjhunter has quit [Ping timeout: 260 seconds]
nettoweb has joined #ruby
pwestlund is now known as pwestlund_away
yfeldblum has quit [Remote host closed the connection]
preller has joined #ruby
Reach has quit [Remote host closed the connection]
dkamioka has joined #ruby
timonv has quit [Remote host closed the connection]
tjad has quit [Ping timeout: 265 seconds]
rjhunter has joined #ruby
CorySimmons has quit [Quit: Leaving.]
shime has quit [Ping timeout: 260 seconds]
cleverma_ has joined #ruby
yfeldblum has joined #ruby
nateberkopec has joined #ruby
xcv has joined #ruby
vlad_starkov has joined #ruby
clevermatt has quit [Ping timeout: 260 seconds]
nomenku__ has joined #ruby
gyre008 has joined #ruby
ayumin has quit [Remote host closed the connection]
ambushsabre has joined #ruby
burlyscudd has joined #ruby
CorySimmons has joined #ruby
peregrine81 has joined #ruby
g0bl1n has joined #ruby
nomenkun_ has quit [Ping timeout: 240 seconds]
Arzaga has joined #ruby
RaCx_ has quit [Quit: Computer has gone to sleep.]
andikr has quit [Remote host closed the connection]
Xeago_ has joined #ruby
vlad_starkov has quit [Read error: Connection reset by peer]
s2013 has joined #ruby
gyre007 has quit [Ping timeout: 245 seconds]
timonv has joined #ruby
xcv_ has joined #ruby
xcv has quit [Ping timeout: 272 seconds]
ua__ has quit [Ping timeout: 272 seconds]
ua has joined #ruby
nomenku__ has quit [Ping timeout: 240 seconds]
p4d4w4n has quit [Quit: This computer has gone to sleep]
m8 has joined #ruby
dangerousdave has joined #ruby
Xeago has quit [Ping timeout: 252 seconds]
coder_neo has joined #ruby
coder_neo has quit [Client Quit]
xcv_ has quit [Remote host closed the connection]
coca_rails has joined #ruby
Kricir has quit [Ping timeout: 265 seconds]
sonne has joined #ruby
sayan has quit [Ping timeout: 260 seconds]
rdark has quit [Quit: leaving]
Xeago_ has quit [Ping timeout: 252 seconds]
digital-ghost has joined #ruby
rdark has joined #ruby
sonne has left #ruby [#ruby]
dhruvasagar has joined #ruby
robbyoconnor has joined #ruby
fedesil__ has quit [Read error: Connection reset by peer]
RaCx has joined #ruby
wongon has joined #ruby
e-dard has left #ruby [#ruby]
fedesilva has joined #ruby
braoru has quit [Remote host closed the connection]
yfeldblum has quit [Remote host closed the connection]
mikecmpbll has joined #ruby
havenwood has joined #ruby
michaeldeol has joined #ruby
yourbestfriend is now known as FlashCode`
haukur has quit []
FlashCode` is now known as sam113101
sam113101 is now known as yourbestfriend
burlyscudd has quit [Quit: Leaving.]
ahbrendan has joined #ruby
shaunbaker has quit [Remote host closed the connection]
gyre008 has quit [Remote host closed the connection]
yourbestfriend is now known as yourbestfriend`
maletor has joined #ruby
phantummm has joined #ruby
havenwood has quit [Ping timeout: 250 seconds]
burlyscudd has joined #ruby
yfeldblum has joined #ruby
yfeldblum has quit [Remote host closed the connection]
yfeldblum has joined #ruby
nwertman_ has quit [Ping timeout: 265 seconds]
liamkeily has quit [Ping timeout: 245 seconds]
hogeo has joined #ruby
byprdct has joined #ruby
zipper has quit [Quit: Lost terminal]
shaunbaker has joined #ruby
michaeldeol has quit [Ping timeout: 272 seconds]
yourbestfriend` is now known as FlashCode`
DouweM has joined #ruby
maletor has quit [Ping timeout: 250 seconds]
FlashCode` is now known as yourbestfriend
flubba has joined #ruby
b00stfr3ak has joined #ruby
zz_tsykoduk is now known as tsykoduk
gyre007 has joined #ruby
hogeo has quit [Ping timeout: 245 seconds]
nifty has joined #ruby
d45h has joined #ruby
eldewall has quit [Ping timeout: 260 seconds]
mikesplain1 has joined #ruby
tylersmith has quit [Remote host closed the connection]
shadoi has joined #ruby
MrZYX is now known as MrZYX|off
mikesplain has quit [Ping timeout: 252 seconds]
burlyscudd has quit [Quit: Leaving.]
jonathanwallace has quit [Ping timeout: 264 seconds]
relix has joined #ruby
robbyoconnor has quit [Excess Flood]
shedd has joined #ruby
robbyoconnor has joined #ruby
sambao21 has joined #ruby
danshultz has quit [Remote host closed the connection]
danshultz has joined #ruby
maletor has joined #ruby
danshultz has quit [Read error: Connection reset by peer]
danshultz has joined #ruby
dangerousdave has quit [Quit: My Mac Pro has gone to sleep. ZZZzzz…]
mmitchel_ has joined #ruby
ehc has joined #ruby
RaCx has quit [Quit: Computer has gone to sleep.]
nwertman has joined #ruby
yekta has joined #ruby
heftig has joined #ruby
yekta has quit [Client Quit]
sambao21 has quit [Ping timeout: 260 seconds]
dangerousdave has joined #ruby
DeProdig1 has joined #ruby
bluenemo has joined #ruby
mmitchell has quit [Ping timeout: 260 seconds]
virtualize has quit [Quit: Leaving...]
s2013 has quit [Ping timeout: 246 seconds]
mmitchel_ has quit [Remote host closed the connection]
mikepack has joined #ruby
DeProdigy has quit [Ping timeout: 264 seconds]
mmitchell has joined #ruby
coca_rails has quit [Ping timeout: 245 seconds]
iliketur_ has joined #ruby
troyready has joined #ruby
camilasan has quit []
<yan_>
can anyone recommend a very simple rmi/rpc library? i just need a very simple "invoke a method on an object on a remote machine" library. i tried drb, but i found it breaking when passing blocks. plus, i felt the inclusion of DrbUndumped for marshalled objects to be a bit dirty. Before I implement something simple that sends hashes across simple sockets, is there anything very simple that implements this?
shadoi has quit [Quit: Leaving.]
pyrac has quit [Ping timeout: 250 seconds]
<apeiros>
yan_: you'll be hard pressed to find something which supports remote execution of blocks
<apeiros>
but do tell if you find something
<yan_>
apeiros: assuming i can work around that, any simple message queues i can use? i am fine with manually serializing everything to struct-like objects and without remote blocks (drb was still confusing in these seemingly straight forward invocations)
<apeiros>
yan_: well, transmitting data over a socket and invoking methods is trivial. See Object#send, Module#const_get and Marshal.
<apeiros>
that's all you really need.
virtualize has joined #ruby
<yan_>
apeiros: i was close to going that route, wondering if people recommend something like 0mq or a similar msg queue
stevenhaddox|afk is now known as stevenhaddox
vlad_starkov has quit [Read error: Connection reset by peer]
robbyoconnor has quit [Quit: Konversation terminated!]
aapzak has quit [Read error: Operation timed out]
<apeiros>
a message queue afaik doesn't do rpc
<apeiros>
it's only transport
bluenemo has quit [Remote host closed the connection]
<apeiros>
but I haven't used 0mq
<yan_>
apeiros: i'm fine with just using a transport, since the extra multiplexing of msgs should be straightforward
<apeiros>
o0
<apeiros>
then why did you ask for rmi/rpc?
wallerdev has joined #ruby
<yan_>
apeiros: because i'd ideally use an rmi/rpc library if it handled remote block invocations well, but if not, i'm fine with building on simple message passing.
<yan_>
i'm just trying not to reinvent the wheel
<apeiros>
well, using marshal to transport data is hardly reinventing the wheel.
<apeiros>
the existing wheel is Drb
<apeiros>
but you ruled that one out
v0n has joined #ruby
<apeiros>
anyway - 0mq certainly works as a transport layer.
virtualize has quit [Client Quit]
lurch_ has quit [Read error: Connection reset by peer]
lurch_ has joined #ruby
aapzak has joined #ruby
davedev24 has joined #ruby
iliketur_ has quit [Ping timeout: 265 seconds]
Spami has joined #ruby
froy has joined #ruby
mikesplain2 has joined #ruby
mikesplain1 has quit [Ping timeout: 245 seconds]
ayumin has joined #ruby
jlast_ has joined #ruby
Spami has quit [Remote host closed the connection]
jlast has quit [Ping timeout: 260 seconds]
jbpros has quit [Quit: jbpros]
yfeldblum has quit [Remote host closed the connection]
d45h has quit []
carlyle has quit [Remote host closed the connection]
yfeldblum has joined #ruby
dioms has joined #ruby
CorySimmons has quit [Quit: Leaving.]
jlast_ has quit [Remote host closed the connection]
xk_id has joined #ruby
nomenkun has joined #ruby
yfeldblu_ has joined #ruby
dennie has joined #ruby
adac has quit [Quit: Leaving]
<toretore>
yan_: 0mq will work fine, but don't pass marshalled ruby objects, pass something like json
olivier_bK1 has quit [Quit: Quitte]
olivier_bK has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
yfeldblum has quit [Ping timeout: 240 seconds]
tkuchiki has quit [Remote host closed the connection]
Kricir has joined #ruby
dhruvasagar has quit [Ping timeout: 260 seconds]
jkhwan has joined #ruby
tjad has joined #ruby
kevinykchan has joined #ruby
dagobah has quit [Remote host closed the connection]
flubba has quit [Remote host closed the connection]
kevind_ has joined #ruby
typicalbender has joined #ruby
nvrch has quit [Quit: nvrch]
brtdv has quit []
stringoO has joined #ruby
DrShoggoth has joined #ruby
tsykoduk is now known as zz_tsykoduk
hoyang_ has joined #ruby
shadoi has joined #ruby
kobain has quit [Ping timeout: 245 seconds]
Kricir has quit [Ping timeout: 264 seconds]
zeade has joined #ruby
kobain has joined #ruby
nhhagen has quit [Remote host closed the connection]
fdelacruz has joined #ruby
nomenkun_ has joined #ruby
nhhagen has joined #ruby
kevind__ has joined #ruby
davy_ has joined #ruby
jonathanwallace has joined #ruby
nomenkun has quit [Read error: Connection reset by peer]
d45h has joined #ruby
RaCx has joined #ruby
hoyang has quit [Ping timeout: 265 seconds]
falood has quit [Remote host closed the connection]
kindjal has joined #ruby
maletor has joined #ruby
dhruvasagar has joined #ruby
jlast has joined #ruby
pel_daniel has joined #ruby
nhhagen has quit [Ping timeout: 252 seconds]
ssvo has joined #ruby
kevind_ has quit [Ping timeout: 272 seconds]
OdNairy has joined #ruby
pragmatism is now known as pragmatism|away
jonathanwallace has quit [Ping timeout: 250 seconds]
nomenkun_ has quit [Read error: Connection reset by peer]
noop has joined #ruby
nomenkun has joined #ruby
davy__ has joined #ruby
nhhagen has joined #ruby
cleverma_ has quit [Ping timeout: 272 seconds]
vlad_starkov has joined #ruby
Jake232 has joined #ruby
davy_ has quit [Ping timeout: 245 seconds]
Bira has quit [Remote host closed the connection]
whysosad has quit [Ping timeout: 240 seconds]
<stringoO>
I'm noticing a weird anamoly when doing number math
vlad_starkov has quit [Read error: Connection reset by peer]
<stringoO>
why does 7.98 + 0.3 equal 8.280000000000001 ?
Bira has joined #ruby
sepp2k has quit [Quit: Konversation terminated!]
<stringoO>
6.98 + 0.3 gets computer rightly as 7.28
<Hanmac1>
stringoO: because its how float are made
stevenhaddox has quit [Quit: Sayonora]
Hanmac1 is now known as Hanmac
<workmad3>
stringoO: if I said 'unrepresentable number' would that mean anything to you? :)
<stringoO>
nope :(
timonv has quit [Remote host closed the connection]
gyre007 has quit [Remote host closed the connection]
d45h has quit []
gyre007 has joined #ruby
<workmad3>
stringoO: ok... it's a number that can't be represented in a (finite) string of digits in a particular base
<workmad3>
stringoO: e.g. 1/3 in decimal representation is unrepresentable
amoli has joined #ruby
<stringoO>
gotcha
roolo has quit [Remote host closed the connection]
<workmad3>
floats have a system of rounding when you try to store a number that is unrepresentable in its internal format
amedeiros has quit [Ping timeout: 261 seconds]
<stringoO>
okay
<stringoO>
but why does 7.98 + 0.3 suffer from this?
<stringoO>
is it because it's storing one of them differently?
buscon has joined #ruby
iamjarvo_ has quit [Remote host closed the connection]
<workmad3>
floats aren't a decimal representation, they're a binary representation
iamjarvo_ has joined #ruby
<workmad3>
what's unrepresentable in binary is completely different to what's unrepresentable in decimal... and even worse, floats have a (very) limited number of digits
<gchristensen>
hi, would it be inadvisable to create an array of many thousand blocks and then calling them in a row? I'm doing a compilation of an intended state, and then creating an array of sequential blocks to alter the state piece by piece. I know it may ot be the fastest way, but I'm hoping it would be at least be decent.
typicalbender has joined #ruby
<stringoO>
I have been trying to use these for monitory calculations ><
iamjarvo_ has quit [Ping timeout: 240 seconds]
<apeiros>
yeah, bad idea. and that's something every coder absolutely should know.
iliketur_ has joined #ruby
Voodoofish430 has joined #ruby
shaunbaker has quit [Remote host closed the connection]
<workmad3>
stringoO: heh :) it's almost the first thing anything I ever read about floats mentions - 'dont do money calculations with floats'
<stringoO>
what would you suggest for monitory calculations then? :P
freggles has joined #ruby
<workmad3>
integers work well
<stringoO>
should i be casting them to decimals?
<workmad3>
work in pennies or cents
<apeiros>
also BigDecimal
<Lewis>
what's the opposite of def initialize
<apeiros>
Lewis: there is none
p4d4w4n has joined #ruby
<apeiros>
there are finalizers, but they're only remotely "the opposite"
fdelacruz has quit [Quit: EPIC5-1.1.5[1683] - amnesiac : 1400 feet still looking good]
<Lewis>
apeiros: a method for when the instance die?
devdazed has quit [Ping timeout: 252 seconds]
<stringoO>
Thanks for the help @workmad3, @apeiros and @Hanmac1
<gchristensen>
ezilaitini fed
nwertman has quit [Ping timeout: 264 seconds]
<apeiros>
Lewis: yes. no opposite. the two concepts existing are destructors and finalizers.
<apeiros>
Lewis: a destructor is run before the object is destroyed, a finalizer is run after
gchristensen has left #ruby ["WeeChat 0.4.0"]
<apeiros>
ruby only has finalizers. they don't have any guarantee on when they're being run.
CorySimmons has quit [Ping timeout: 246 seconds]
<Lewis>
apeiros: ah so no equivalent of destructors?
ghr has quit [Quit: Computer has gone to sleep.]
zz_tsykoduk is now known as tsykoduk
<apeiros>
Lewis: even a destructor is not an opposite of initialize. but no, no destructors.
Fire-Dragon-DoL has joined #ruby
nwertman has joined #ruby
sambao21 has joined #ruby
<Lewis>
apeiros: opposite was a wrong choice of word
<apeiros>
Lewis: well, it brought across what you were looking for. so it wasn't a bad choice :)
ArchBeOS-work has joined #ruby
dkamioka has quit [Remote host closed the connection]
devdazed has joined #ruby
dkamioka has joined #ruby
pkrnj has joined #ruby
elux has quit [Quit: Leaving...]
RaCx has quit [Quit: Computer has gone to sleep.]
burlyscudd1 has joined #ruby
burlyscudd has quit [Read error: Connection reset by peer]
gyre007 has quit [Remote host closed the connection]
g0bl1n has joined #ruby
jhaals_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gyre007 has joined #ruby
dkamioka_ has joined #ruby
coca_rails has joined #ruby
petey has joined #ruby
batchitcray has quit [Ping timeout: 260 seconds]
carraroj has joined #ruby
danshultz has quit []
RaCx has joined #ruby
alup has quit [Quit: Leaving]
elux has joined #ruby
mmcdaris has quit [Quit: mmcdaris]
<stringoO>
@apeiros: so if I want to use BigDecimals, do I have to always do BigDecimal.new("0.025") etc. when initializing them?
nhhagen has quit [Remote host closed the connection]
dkamioka has quit [Ping timeout: 272 seconds]
vlad_starkov has joined #ruby
dkamioka_ has quit [Ping timeout: 260 seconds]
DeProdig1 has quit [Ping timeout: 250 seconds]
coca_rails has quit [Ping timeout: 245 seconds]
<apeiros>
stringoO: that's one way, yes
isec has quit [Remote host closed the connection]
flubba has joined #ruby
<Hanmac>
without new it works too: BigDecimal("0.025") ... or when you require "bigdecimal/util" too you can do 0.025.to_d
CorySimmons has joined #ruby
kevinykchan has quit [Quit: Computer has gone to sleep.]
Kilo`byte has joined #ruby
<apeiros>
Hanmac: the latter is not recommended
ahbrendan has quit [Ping timeout: 265 seconds]
<stringoO>
apeiros: is there an easier way?
<apeiros>
you shouldn't introduce floats when working with bigdecimals.
<apeiros>
oh, interesting… seems there are occasions floats get promoted to bigdecimals when doing operations with bigdecimals…
devdazed has quit [Ping timeout: 272 seconds]
typicalbender has quit [Ping timeout: 272 seconds]
xcv has joined #ruby
<stringoO>
:)
<apeiros>
doesn't change the problem, though
<stringoO>
yeah
iamjarvo_ has joined #ruby
<stringoO>
what I was thinking was that if the first element was a big d it might treat the second as a big decimal?
mikepack has joined #ruby
<workmad3>
stringoO: no
<apeiros>
stringoO: that's never the case
<stringoO>
okay
<workmad3>
stringoO: 0.3 is always a float literal
xorgnak__ has joined #ruby
<apeiros>
but rubys numeric classes do coercion
<stringoO>
so it just gets converted
jchristi has quit [Ping timeout: 272 seconds]
<apeiros>
that is, "0.025".to_d * # <-- this calls a method, BigDecimal#*
xorgnak__ has quit [Remote host closed the connection]
<kostine>
there is gem https://github.com/RubyMoney/money that handles most of these issues, you can use it or at least see how they handle some of these common calculation problems
iamjarvo_ has quit [Remote host closed the connection]
xorgnak__ has joined #ruby
TMM has quit [Quit: Ex-Chat]
iamjarvo_ has joined #ruby
elux has quit [Quit: Leaving...]
elux has joined #ruby
jbpros has joined #ruby
kaldrenon has joined #ruby
jchristi has joined #ruby
iliketur_ has quit [Quit: zzzzz…..]
klaut has quit [Remote host closed the connection]
thumpba has quit [Remote host closed the connection]
timonv has quit [Remote host closed the connection]
arietis has joined #ruby
mark_locklear has quit [Ping timeout: 245 seconds]
<stringoO>
sounds good, thanks for the help!
rootshift has quit [Quit: rootshift]
timonv has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
jlast has joined #ruby
Atrophius has quit [Ping timeout: 265 seconds]
schaerli has joined #ruby
huttan has joined #ruby
Bira has quit [Remote host closed the connection]
virtualize has joined #ruby
Bira has joined #ruby
wildroman2 has quit []
Atrophius has joined #ruby
elux has quit [Client Quit]
schaerli has quit [Remote host closed the connection]
clevermatt has quit [Ping timeout: 272 seconds]
petey has quit [Remote host closed the connection]
petey has joined #ruby
wallerdev has quit [Quit: wallerdev]
<avril14th>
apeiros: I think it's not "random promotion of floats to bigdecs
<avril14th>
it's operator operations
petey has quit [Read error: Connection reset by peer]
marr has quit [Ping timeout: 250 seconds]
<avril14th>
so any bigdecimal operator anything else
<avril14th>
yields a bigdecimal
shredding has quit [Quit: shredding]
<apeiros>
avril14th: I didn't say random ;-)
<avril14th>
true :)
petey has joined #ruby
<avril14th>
I just have one case here which is a bit bastard
<apeiros>
I expected BigDecimal to do coercion towards floats, though
<avril14th>
its bigdecimal ** rational
<apeiros>
but I guess bigdecimal just converts the floats with maximum precision
clevermatt has joined #ruby
<avril14th>
conversion yes
<avril14th>
operations are another story
nhhagen has joined #ruby
<apeiros>
coercion actually
<apeiros>
see #coerce on the various numeric classes
jlast has quit [Read error: Connection reset by peer]
<apeiros>
Float#to_d is BigDecimal(self, precision || Float::DIG+1)
typicalbender has joined #ruby
jlast has joined #ruby
RaCx has quit [Read error: Operation timed out]
<avril14th>
yes
devdazed has joined #ruby
<avril14th>
but then it can yield numbers with arbitrary precision
<avril14th>
I get 2K decimals precision here
<avril14th>
jsut float to bigdec is 16
mmcdaris has joined #ruby
lurch_ has quit [Quit: lurch_]
thumpba has joined #ruby
carraroj has quit [Ping timeout: 272 seconds]
zoee has joined #ruby
timonv has quit [Read error: Connection reset by peer]
petey has quit [Remote host closed the connection]
timonv has joined #ruby
rootshift has joined #ruby
typicalbender has quit [Read error: Connection reset by peer]
typicalbender has joined #ruby
Kricir has joined #ruby
blaskovicz1 has joined #ruby
blaskovicz has quit [Ping timeout: 264 seconds]
zoee has quit [Client Quit]
nomenkun has quit [Read error: Connection reset by peer]
carlyle has joined #ruby
synergy_ is now known as sng|afk
p4d4w4n has quit [Quit: This computer has gone to sleep]
heidi has joined #ruby
nomenkun has joined #ruby
Arzaga has quit [Quit: Computer has gone to sleep.]
havenwood has joined #ruby
jbpros has quit [Quit: jbpros]
saarinen has joined #ruby
mmcdaris has left #ruby [#ruby]
CorySimmons has quit [Quit: Leaving.]
flubba has quit [Remote host closed the connection]
shadoi has quit [Quit: Leaving.]
jonathanwallace has joined #ruby
baroquebobcat has joined #ruby
mostlybadfly has joined #ruby
p4d4w4n has joined #ruby
Guest25971 is now known as amedeiros
Sawbones has joined #ruby
davy_ has joined #ruby
carlyle has quit [Ping timeout: 245 seconds]
sepp2k has joined #ruby
CorySimmons has joined #ruby
nwertman has quit [Ping timeout: 246 seconds]
CorySimmons has quit [Client Quit]
carlyle has joined #ruby
ozgun has quit [Quit: Leaving]
troessner has quit [Quit: Leaving]
amedeiros has quit [Quit: leaving]
virtualize has quit [Quit: Leaving...]
amedeiros has joined #ruby
VTLob has joined #ruby
flubba has joined #ruby
davy__ has quit [Ping timeout: 260 seconds]
nwertman has joined #ruby
schaerli has joined #ruby
jonathanwallace has quit [Ping timeout: 248 seconds]
RaCx has joined #ruby
Arzaga has joined #ruby
jkhwan has quit [Remote host closed the connection]
jkhwan has joined #ruby
obs has quit [Remote host closed the connection]
blaskovicz1 has quit [Quit: Leaving.]
nanoyak has joined #ruby
CorySimmons has joined #ruby
lfox has quit [Quit: ZZZzzz…]
Atrophius has quit [Ping timeout: 272 seconds]
geggam has joined #ruby
virtualize has joined #ruby
xcfox has quit [Quit: Ухожу я от вас (xchat 2.4.5 или старше)]
nanoyak_ has joined #ruby
w4pm has joined #ruby
drag00n has joined #ruby
CorySimmons has left #ruby [#ruby]
phantummm has quit [Quit: phantummm]
jkhwan has quit [Ping timeout: 272 seconds]
fntzr has quit [Quit: Leaving]
nomenkun_ has joined #ruby
nanoyak has quit [Ping timeout: 260 seconds]
mark_locklear has joined #ruby
phantummm has joined #ruby
schaerli has quit [Remote host closed the connection]
jkhwan has joined #ruby
nomenkun has quit [Ping timeout: 240 seconds]
timonv has quit [Remote host closed the connection]
thyagobr has joined #ruby
Tearan has joined #ruby
s2013 has joined #ruby
ehaliewicz has joined #ruby
shedd has quit [Remote host closed the connection]
<tirengarfio>
Im using this version of ruby when I compile with compass: /home/tirengarfio/.rvm/rubies/ruby-2.0.0-p247/ how can I use the version in /usr/local/lib? My $PATH is /usr/local/lib:sr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
virtualize has quit [Read error: Connection reset by peer]
Virtualize|away has joined #ruby
wallerdev has joined #ruby
Floydzy has quit [Quit: Floydzy]
buscon has quit [Remote host closed the connection]
DouweM has joined #ruby
lfox has joined #ruby
nanoyak_ has quit [Read error: Operation timed out]
whysosad has joined #ruby
iliketur_ has joined #ruby
<Hanmac>
tirengarfio: hm no when using rvm you should install the gems/stuff specially with rvm ... otherwise it could made complications
divi_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mklappstuhl has quit [Remote host closed the connection]
zeeraw has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
divi_ has joined #ruby
rdark has quit [Quit: leaving]
RaCx has quit [Quit: Computer has gone to sleep.]
conor_ has quit [Quit: leaving]
jkhwan has quit [Remote host closed the connection]
jkhwan has joined #ruby
<ddd>
yeah if rvm didn't install it, it doesn't track it
Kricir has quit [Ping timeout: 272 seconds]
nanoyak has joined #ruby
<ddd>
and it doesn't mix unless you specifically modify GEM_HOME, MY_GEM_HOME, RUBY_HOME, or MY_RUBY_HOME
shadoi has joined #ruby
<Hanmac>
specially when the ABI changes it WILL break existing complied stuff, that why you should not DO that!
<ddd>
and you could hav epotential conflicts with gems. if you have same gem, diff versions outside of RVM control and in rvm control, rvm will use the one under its control unless you start mucking with messing with the path vars
Mon_Ouie has joined #ruby
<ddd>
Hanmac: exactly
davedev24 has left #ruby [#ruby]
<ddd>
injecting into RVM (or *any* ruby manager) is not a good idea
<Hanmac>
for sample there is a beaking point between 2.0 and 2.1 ... which break compiled gems/libs under 64bit
nomenkun_ has quit [Read error: Connection reset by peer]
<ddd>
wouldn't it still be an issue as well under chruby? you'd still have to inject into it's pathings
<Hanmac>
ddd: its about flonums (hm where they allready present in 2.0?) ... that changes the object ids from the important variables like true, false and nil ... because of that, complied gems does not work correctly and only need to be recompiled
jkhwan has quit [Ping timeout: 272 seconds]
<ddd>
ahh. thank you for the heads up
psyl0n has joined #ruby
<tirengarfio>
havenwood, for rvm list I get just: =* ruby-2.0.0-p247 [ x86_64 ]
<ddd>
means its the current ruby AND the default
Zai00 has quit [Quit: Zai00]
cleme1mp has quit [Ping timeout: 264 seconds]
s2013 has quit [Ping timeout: 240 seconds]
Megtastique has quit []
<havenwood>
tirengarfio: rvm knows only about rvm-installed rubies, and that is your one.
<tirengarfio>
but I dont have that version of ruby installed, I also have the one inside /usr/local/lib, is possible to choose that?
<havenwood>
tirengarfio: rvm use system
<havenwood>
tirengarfio: is that on your system ruby?
ytrewq has joined #ruby
<havenwood>
tirengarfio: or just a ruby you compiled to that location?
RaCx has joined #ruby
kaldreno_ has joined #ruby
kaldrenon has quit [Read error: Connection reset by peer]
elux has joined #ruby
momomomomo has quit [Quit: momomomomo]
<tirengarfio>
yes, I think it is installed in my system, when I run "sudo -iu www-data which compass" ruby it says /usr/local/lib
Megtastique has joined #ruby
<havenwood>
tirengarfio: oh, so Ruby isn't there, the compass binary is?
ayumin has quit [Remote host closed the connection]
<havenwood>
tirengarfio: i'm confused what you're doing
jkhwan has joined #ruby
<havenwood>
tirengarfio: Where is the Ruby you actually want to be using? Where did it come from? Is it system Ruby or did you compile it?
jkhwan has quit [Remote host closed the connection]
<tirengarfio>
havenwood, let see, for "sudo -iu www-data which compass" I get "/usr/local/bin/compass", and the same output now for "which compass"
jkhwan has joined #ruby
Virtualize|away has quit [Quit: Leaving...]
Floydzy has joined #ruby
jkhwan has quit [Read error: Connection reset by peer]
jkhwan has joined #ruby
<havenwood>
tirengarfio: so you don't want to change the current Ruby? you just want to get compass working with your current Ruby?
brianpWins has joined #ruby
araujo has quit [Read error: Connection reset by peer]
dangerousdave has quit [Quit: My Mac Pro has gone to sleep. ZZZzzz…]
redramires has joined #ruby
araujo has joined #ruby
<tirengarfio>
but when I try to compile with compass I get " /home/tirengarfio/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/dependency.rb:296:in `to_specs': Could not find 'compass' (>= 0) among 6 total gem(s) (Gem::LoadError)" WHY since Im using the system ruby now?
Floydzy has left #ruby [#ruby]
<tirengarfio>
on system I have rub 1.9.3
jlast_ has joined #ruby
Nilium has quit [Quit: <kristin> Cower is like... I dunno. sometimes he seems senile and other times he seems like a middle schooler.]
gianlucadv has joined #ruby
<tirengarfio>
havenwood, sorry because my bad explanation, do you understand me?
dp_ has joined #ruby
michaeldeol has quit [Remote host closed the connection]
jamesaxl has joined #ruby
michaeldeol has joined #ruby
jbpros has quit [Quit: jbpros]
<havenwood>
tirengarfio: I'd suggest updating rvm `rvm get latest` then updating your Ruby for latest security patch `rvm install ruby` and set p353 as your default. Then `bundle` or do whatever rvm gem magic you use.
amundj_ has joined #ruby
Atrophius has joined #ruby
kindjal has quit [Quit: Computer has gone to sleep.]
<dp_>
I try to import an CSV file and I get a respond that is imported and a row is added but no data was written . What can be wrong? https://gist.github.com/dpantic/7831672
divi_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
pragmatism is now known as pragmatism|away
jlast has quit [Ping timeout: 272 seconds]
deol has joined #ruby
jlast_ has quit [Ping timeout: 272 seconds]
michaeldeol has quit [Read error: Connection reset by peer]
pel_daniel has quit [Ping timeout: 246 seconds]
amundj has quit [Ping timeout: 252 seconds]
<havenwood>
tirengarfio: Do you know generally how to use RVM?
thyagobr has joined #ruby
dallasm_ has joined #ruby
avril14th has quit [Remote host closed the connection]
s2013 has joined #ruby
interactionjaxsn has quit [Remote host closed the connection]
avril14th has joined #ruby
shedd has joined #ruby
<tirengarfio>
havenwood, no, not to much, Im a HTML/CSS/LAMP programmer and I need compass. I have update ruby now.
<havenwood>
tirengarfio: Well, rvm or ruby-install/chruby are tools for installing and switching between Rubies. If you're on a system that has a package for Ruby 2.0, and you don't want to be switching Rubies, you can just use system Ruby.
Bira has quit [Remote host closed the connection]
dangerousdave has joined #ruby
<havenwood>
tirengarfio: What distro?
<tirengarfio>
Ubuntu
reset has joined #ruby
Bira has joined #ruby
<havenwood>
mm, debian package of Ruby isn't the best
interactionjaxsn has joined #ruby
<tirengarfio>
Im using system Ruby, but the ruby version that is trying to use compass is the rvm one..why?
RaCx has quit [Quit: Computer has gone to sleep.]
<tirengarfio>
Ubuntu 13.10
<havenwood>
tirengarfio: I *think* (but haven't confirmed) that if you update your Ubuntu to latest and update your packages, Ruby 2.0 should be available.
<havenwood>
is there an Ubuntu Ruby 2 package yet?
kindjal has joined #ruby
avril14th has quit [Remote host closed the connection]
Nilium has joined #ruby
<tirengarfio>
I have updated ruby to p353 right now
shedd has quit [Ping timeout: 248 seconds]
momomomomo has joined #ruby
petey has joined #ruby
xcv has quit [Remote host closed the connection]
<havenwood>
tirengarfio: So if you're working on an app that has a file in the root dir name `Gemfile`, go there and run `gem install bundler` then run the `bundle` command.
<tirengarfio>
I see I dont konw
dallasm_ has quit [Remote host closed the connection]
<havenwood>
tirengarfio: Did you set p353 as your --default?
xcv has joined #ruby
_Andres has joined #ruby
<havenwood>
tirengarfio: oh, by the way, there is an #rvm channel (and #chruby channel) as well
<snkcld>
my tests fail because i just added an additional call to a method which is not expected in the rspec... how can i allow for other calls, without having to add ot the rspec each time?
<snkcld>
i just want to log out to stdout the id of my object, but rspec is saying "Double received unexpected message :id with (no args)"
jlast has joined #ruby
dallasm_ has joined #ruby
<havenwood>
Hanmac: nice, thought i'd heard there was a 2.0 pkg
Kricir has joined #ruby
<Hanmac>
its maybe a bit outdated "ruby 2.0.0p299" but better than 1.8.7, neh? ;P
<havenwood>
for sure!
<havenwood>
Hanmac: are both ruby2.0 and ruby2.0-dev required? is ruby2.0 not a dep of the other?
<havenwood>
Hanmac: Do you need to update-alternatives "gem" too or just ruby these days?
<Hanmac>
havenwood: you need the -dev package when you want to install compile gems like nokoiri
dhruvasagar has quit [Ping timeout: 272 seconds]
nouitfvf has joined #ruby
<havenwood>
ah, gotcha
<tirengarfio>
havenwood, how can I install compass for the rvm version?
<havenwood>
either one, or the other which has both
<havenwood>
tirengarfio: gem install compass
<tirengarfio>
I found this: rvm wrapper 1.9.3@compass --no-prefix compass
Arzaga has quit [Quit: Computer has gone to sleep.]
redramires has left #ruby [#ruby]
<ddd>
you can compile like a normal gem (gem build), and then install in the gemset manually
<ddd>
it will be included when you add the gem 'compass' to your Gemfile like normal
xcv has quit [Ping timeout: 246 seconds]
bradhe has joined #ruby
<Hanmac>
havenwood: yeah you need to "update-alternatives --config gem" too (imo that should be fixed in the next ubuntu version or something like that ... its still part of a 1.8.7 relict)
timonv has joined #ruby
gianlucadv has quit [Ping timeout: 260 seconds]
<ddd>
just means you need to manually control the gem. make sure you set the version info in your Gemfile so it stays using the gem you installed manually (by using its'version info)
jonathanwallace has joined #ruby
pel_daniel has joined #ruby
<tirengarfio>
I still get " /home/tirengarfio/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/dependency.rb:296:in `to_specs': Could not find 'compass' " after "gem install compass"
Spami has joined #ruby
<havenwood>
Hanmac: So something like this (what should gem be set to?): sudo apt-get update && sudo apt-get ruby2.0-dev && update-alternatives --set ruby ruby2.0-dev && update-alternatives --set gem "?"
vlad_starkov has quit [Remote host closed the connection]
<ddd>
tirengarfio: dude. uninstall the usr/lib/ blah located gem you installed. build the gem manually. install *in* the rvm gemset. then, using either a require or via Gemfile, rvm will see that particular gem and use it
<havenwood>
tirengarfio: looks like you're not on p358, check `rvm list` or `rvm current`
<Hanmac>
havenwood: for some reason i dont know: ruby2.0-dev does not require ruby2.0 pkg ... :_(
<ddd>
you might have to delete your blown lock file as that might be pointing at the outside-of-rvm idk
whysomad has joined #ruby
<havenwood>
Hanmac: oh wow, i just presumed!
<ddd>
yes the -dev never requires the bin
jonathanwallace has quit [Ping timeout: 248 seconds]
makerops has joined #ruby
<ddd>
havenwood: the update-alternatives system is for binaries specifically
<makerops>
is there a basic ruby RPC client gem out there?
<tirengarfio>
havenwood, after rvm current it says p247
tannerburson has joined #ruby
A124 has quit [Remote host closed the connection]
A124 has joined #ruby
<Hanmac>
havenwood: did you know? libruby2.0 and ruby2.0-dev are multiarch ready ;P (bad that the main ruby2.0 package is not ;P )
<havenwood>
Hanmac: ooh, did not know!
Tearan has quit [Quit: Badger digs a burrow...]
whysosad has quit [Ping timeout: 248 seconds]
jkhwan has quit [Remote host closed the connection]
<tirengarfio>
when I run "gem uninstall", am I uninstalling from the rvm or from the system?
jkhwan has joined #ruby
<havenwood>
tirengarfio: from whatever `rvm current` is
<havenwood>
tirengarfio: gem comes with ruby
typicalbender has quit [Ping timeout: 240 seconds]
typicalbender has joined #ruby
typicalbender has quit [Read error: Connection reset by peer]
ahbrendan has quit [Ping timeout: 246 seconds]
Jdubs has joined #ruby
typicalbender has joined #ruby
<tirengarfio>
ok, now compass is uninstalled from the system ruby, now should I switch to p353,is that true?
typicalbender has quit [Read error: Connection reset by peer]
typicalbender has joined #ruby
shadoi has quit [Quit: Leaving.]
makerops has left #ruby ["Leaving"]
<pragmatism|away>
back
devdazed has quit [Ping timeout: 240 seconds]
nisstyre has joined #ruby
<ddd>
tirengarfio: yes
<ddd>
install the gem in THAT gemset and do what I said earlier
<ddd>
rmember, if you have a Gemfile, remove the lock and bundle install again. should fix all the references
jkhwan has quit [Ping timeout: 272 seconds]
<miah>
aos, make sure to specify --path with bundle so it doesnt install the gems to your system ruby =)
<tirengarfio>
Now I have switched to p353
<tirengarfio>
Now I should I install compass using "gem install compass", is that true?
<ddd>
tirengarfio: depends.
<ddd>
are you using a manually built gem or just grabbing the one off rubygems?
pragmatism|away is now known as pragmatism
<ddd>
thought you were modifying the existing and installing it
<tirengarfio>
I don't know, how to know it?
<ddd>
are you doing a 'gem build' of the compass gem? if not, then you're just getting the gem from upstream
tonni has quit [Quit: Leaving...]
<havenwood>
Hanmac: ah nice, looks like they did make update-alternatives gem automagical :)
shedd has joined #ruby
<ddd>
if doing it from upstream then yeah a gem install compass (once in the rvm gemset) will work
<havenwood>
Hanmac: So i think this should be enough :): sudo apt-get update && sudo apt-get install -y ruby2.0 ruby2.0-dev && sudo update-alternatives --set ruby /usr/bin/ruby2.0
typicalbender has quit [Read error: Connection reset by peer]
typicalbender has joined #ruby
<havenwood>
Hanmac: Nice to see Debian Ruby packaging perking up.
<havenwood>
was kinda wilting
<ddd>
tirengarfio: now, do you have a Gemfile for this project or are you just manually doing a require (as in you're working on a lib not a rails app or a bundler aware ruby app)
<Hanmac>
hmm havenwood i dont know, for me "update-alternatives --config gem" is not called when i call "update-alternatives --config ruby" ...
klaut has joined #ruby
<ddd>
IF your app is bundler aware and using a Gemfile, just remove the Gemfile.lock, modify your Gemfile to include compass, and run another 'bundle install'
<havenwood>
Hanmac: oh, hrm - maybe i misunderstood this: There is only one alternative in link group gem (providing /usr/bin/gem): /usr/bin/gem2.0
peregrine81 has quit []
<havenwood>
Nothing to configure.
<ddd>
any gems already in the rvm gemset will be used rather than being redownloaded, and bundler will now use the right/correct compass
<Hanmac>
hm yeah that should mean there is no other ruby installed as pkg
phantummm has quit [Quit: phantummm]
ircguest has joined #ruby
<havenwood>
Hanmac: oh >.>, yeah i need more coffee :)
virtualize has joined #ruby
<tirengarfio>
ddd, I don't know.. One thing: I still get the error about p247, since I have default and curret as p353, why does it use p247?
<ddd>
tirengarfio: after that, you're back to using 'bundle exec' or running bundle --binstubs etc
phantummm has joined #ruby
<ddd>
rvm use x.x.x-p353@gemset
io_syl has joined #ruby
blaskovicz has joined #ruby
aapzak has quit [Ping timeout: 264 seconds]
devdazed has joined #ruby
<ddd>
could be your rvm envs are messed. can also log out and back in to *completely* reinit your entire environment. then rvm use x.x.x@gs
aapzak has joined #ruby
<ddd>
usually when you have a crossup like that its due to a manual path setting change etc
alvaro_o has joined #ruby
araujo has quit [Read error: Connection reset by peer]
araujo has joined #ruby
blaskovicz has quit [Client Quit]
<tirengarfio>
ok, reinit my env means reboot Ubuntu?
<ddd>
no
<ddd>
log out of your current session, then log back in
<tirengarfio>
ok, 1 minute
schaerli has joined #ruby
ircguest has quit [Quit: ircII EPIC4-2.10.1 -- Are we there yet?]
<ddd>
you only need to reboot ubuntu when something like the kernel changes. usually logging out of the shell and then back in is sufficient for most 'goofed environment' issues
matheuscaceres has quit [Ping timeout: 265 seconds]
tirengarfio has quit [Remote host closed the connection]
<ddd>
sometimes when the libc is updated a reboot ensures everything goes right, but even thats rare
rootshift has quit [Quit: rootshift]
jerius has quit [Ping timeout: 265 seconds]
kcombs has quit [Remote host closed the connection]
enape_101 has joined #ruby
<enape_101>
if I remove someone from a Trello org, are they notified jw?
<Hanmac>
havenwood: yeah should work ... until the bin files are moved to something like /usr/bin/<arch>/ruby2.* ;P ... currently ruby2.0:amd64 and ruby2.0:i356 are not co-insallable because of that
jkhwan has joined #ruby
schaerli has quit [Ping timeout: 246 seconds]
tirengarfio has joined #ruby
kindjal has quit [Quit: Computer has gone to sleep.]
bbloom has quit [Ping timeout: 260 seconds]
<tirengarfio>
ddd, sorry I had to restart finally, so now I have as default p247
<ddd>
is that the one you weant?
<ddd>
err want
devdazed has quit [Ping timeout: 260 seconds]
<ddd>
if not then do rvm use x.x.x-pxxx@gs --default to change it to the one you do
<ddd>
like if you want 1.9.3-p353 for example. rvm use 1.9.3-p353@testing --default
<ddd>
rvm will see if its installed, if it isn't will install it, if it is will change to it and the gemset, and then mark that as the default ruby to load from now on
<tirengarfio>
Ok I have run that, now i have p353
<tirengarfio>
as current and default
psyl0n has quit [Remote host closed the connection]
<ddd>
ok. are you using a gemset or are you using the ruby without one?
<havenwood>
tirengarfio: i'd suggest removing the old ruby, and doing an rvm cleanup (the cruft can grow quite massive)
p4d4w4n has quit [Quit: This computer has gone to sleep]
horrorvacui has joined #ruby
<ddd>
oh yeah it can hehehe
mmitchel_ has joined #ruby
justinxreese has quit [Ping timeout: 246 seconds]
<tirengarfio>
Ok, I will remove p247 then
<ddd>
tirengarfio: if you want future gemsets to be able to use that particular gem of compass, rvm use @global && gem install compass && rvm use default # last one returns you to your default ruby
mikepack has quit [Remote host closed the connection]
justinxreese has joined #ruby
<havenwood>
tirengarfio: and `rvm cleanup all`
devdazed has joined #ruby
mbreedlove_ has joined #ruby
virtualize has quit [Quit: Leaving...]
mikepack has joined #ruby
<ddd>
also, to save on downloads and bandwidth, consider running rvm gemset globalcache enable
nouitfvf_ has joined #ruby
<tirengarfio>
ok, I did it, now I get instead "sh: 1: /home/tirengarfio/.rvm/rubies/ruby-2.0.0-p247/bin/ruby: not found"
mikepack has quit [Remote host closed the connection]
decoponio has quit [Quit: Leaving...]
<ddd>
enabling globalcache for gemsets will set it up so that if the gem pkg was already downloaded, it won't redownload it
<ddd>
then you are setting something somewhere in that project
mmitchell has quit [Ping timeout: 250 seconds]
<ddd>
possibly the .rvmrc for that project
burlyscudd has joined #ruby
lfox has quit [Ping timeout: 272 seconds]
yfeldblu_ has quit [Quit: Leaving...]
<ddd>
grep -i p247 -R .
<ddd>
also try grep 2.0.0 -R .
pixelgremlins has quit [Ping timeout: 245 seconds]
<ddd>
see what files have it defined. i'd wager its your .rvmrc
p4d4w4n has joined #ruby
heftig has quit [Quit: Quitting]
maletor has quit [Quit: Computer has gone to sleep.]
Thanatermesis has quit [Read error: Connection reset by peer]
nouitfvf has quit [Ping timeout: 248 seconds]
heftig has joined #ruby
<ddd>
well that explains it, you're manually setting
<ddd>
modify those.
yfeldblum has joined #ruby
<ddd>
your cache has it defined. clear your cache and rebuild
iamjarvo_ has quit [Remote host closed the connection]
iamjarvo_ has joined #ruby
iamjarvo_ has quit [Remote host closed the connection]
<ddd>
your cache has it defined. clear your cache and rebuild
<ddd>
umm, why are you sudoing?
iamjarvo_ has joined #ruby
shime has joined #ruby
alekst has joined #ruby
Ox6abe has joined #ruby
<ddd>
you're not even using sudo -l to make it a login so i'm suprised rvm is even loading. plus why are you running rvm as root as well against what our docs tell you?
bradhe has quit [Remote host closed the connection]
<tirengarfio>
Now I get " /usr/bin/ruby: No such file or directory -- /usr/bin/compass (LoadError)"
<ddd>
root should not be running *any* other ruby than the system ruby since its looking for the system ruby and its configuration for system management
ambushsabre has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
shedd has quit [Remote host closed the connection]
tonni has joined #ruby
<ddd>
nm, you're busted over there. you're not following the rvm docs, etc. this is another reason we tell people NOT to install rvm for root, you're not even doing a multi-tenant rvm install over there
ayumin has quit [Ping timeout: 272 seconds]
RaCx has joined #ruby
dkamioka has joined #ruby
tonni has quit [Client Quit]
zoee has joined #ruby
horrorvacui has quit [Quit: WeeChat 0.4.2]
p4d4w4n has quit [Quit: This computer has gone to sleep]
<ddd>
you're trying to mix in system ruby, system gem installs, along with rvm. so totally not trying to troubleshoot that
horrorvacui has joined #ruby
ambushsabre has joined #ruby
drebar has joined #ruby
vlad_starkov has joined #ruby
dkamioka_ has joined #ruby
dkamioka_ has quit [Remote host closed the connection]
jlast has quit [Remote host closed the connection]
tirengarfio has quit [Remote host closed the connection]
jlast has quit [Remote host closed the connection]
tirengarfio has joined #ruby
jchristi1 has joined #ruby
shadoi has joined #ruby
jlast has joined #ruby
dkamioka has quit [Ping timeout: 260 seconds]
sambao21 has joined #ruby
jchristi has quit [Ping timeout: 246 seconds]
<tirengarfio>
now it is working, Im finally using the system rvm. thanks for you help and your patience!!
<ddd>
ther eis no system rvm
<ddd>
you should NOT be using rvm under root
<ddd>
our docs specifically state this and why.
<tirengarfio>
well I run "rvm use system"
divi has joined #ruby
jlast has quit [Read error: Connection reset by peer]
<ddd>
thats not rvm controlled ruby
gyre007 has quit [Remote host closed the connection]
jlast has joined #ruby
shadoi has quit [Client Quit]
<tirengarfio>
ok, it is the same, my symfony2 config file call by default to system ruby I think
bradhe has joined #ruby
<ddd>
that is the SYSTEM's ruby. rvm use system tells rvm to unset ALL of its variables, and get out of the way completely. RVM knows nothing at all about the system ruby other than basically going to sleep so you can use it
<tirengarfio>
ok
<tirengarfio>
:)
<tirengarfio>
my english is not perfect
<tirengarfio>
I meant system's ruby
<ddd>
well people think when they install rvm that rvm controls the system ruby. it absolutely does not
<ddd>
ensuring you know this
xcv has joined #ruby
fmendez has quit [Quit: fmendez]
petey has quit [Remote host closed the connection]
petey has joined #ruby
peregrine81 has joined #ruby
fijimunk1i has joined #ruby
liamkeily has joined #ruby
brtdv has joined #ruby
obs has joined #ruby
Thanatermesis has joined #ruby
ferr has joined #ruby
tannerburson has joined #ruby
cleme1mp has joined #ruby
diegoviola has quit [Quit: WeeChat 0.4.2]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
_Andres has quit [Read error: Connection reset by peer]
fijimunkii has quit [Ping timeout: 264 seconds]
petey has quit [Ping timeout: 248 seconds]
nanoyak has quit [Quit: Computer has gone to sleep.]
obs has quit [Client Quit]
obs_ has joined #ruby
bklane has joined #ruby
<bklane>
So it seems as if 2 whens have the same value it chooses the first in a case/when loop. Is there anyway to have it go through all matching whens?
Bira has quit [Remote host closed the connection]
noop has quit [Ping timeout: 248 seconds]
petey has joined #ruby
gianlucadv has joined #ruby
blaskovicz has joined #ruby
<Hanmac>
bklane: yeah, use PHP
ldnunes has quit [Quit: Leaving]
Tentra has joined #ruby
<bklane>
Hanmac: how about staying with ruby? i can do a bunch of if statements but that seems sloppy?
niklasb has quit [Read error: Operation timed out]
schaerli has joined #ruby
jlast has quit [Remote host closed the connection]
<apeiros>
that's probably what you should do
<Hanmac>
there may not be any better way ... bklane make a pastie/gist from what you try
jlast has joined #ruby
schaerli has quit [Remote host closed the connection]
mbreedlove_ has quit [Ping timeout: 248 seconds]
hoyang_ has quit [Quit: Leave.]
havenwood has quit [Remote host closed the connection]
<apeiros>
could probably be done in a single query too, but I'm too lazy to think and it might not map nicely to AR.
<apeiros>
but I bet the above is already quite a bit faster than what you do.
<bklane>
apeiros: thank you. Didn't even think of that
<apeiros>
not to speak of the amounts of memory it consumes less.
marr has joined #ruby
virtualize has joined #ruby
horrorvacui has joined #ruby
Jake232 has joined #ruby
ScottNYC has joined #ruby
drumusician has joined #ruby
<apeiros>
[:filled_by, :shipped_by, :user_id].map { |attribute| Order.where(attribute => id).count }.sum # if you want it shorter and the attributes dynamical
joaoh82 has quit []
rudisimo has joined #ruby
jlast has joined #ruby
rudisimo has quit [Client Quit]
rudisimo has joined #ruby
burlyscudd has quit [Quit: Leaving.]
<Hanmac>
apeiros: hm i dont know if using "sum" is so a good idea ... its not a ruby(core|stdlib) function
ambushsabre has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<apeiros>
Hanmac: he's in rails
tsykoduk is now known as zz_tsykoduk
<Hanmac>
i am sorry for him
<apeiros>
AR::Base isn't in core/stdlib either ;-)
<apeiros>
it could be worse. he could have followed your first advice.
benzrf has joined #ruby
<benzrf>
hi, if I have a method def at the top level in a file, it will pollute my namespace globally right?
<benzrf>
even in other files
<apeiros>
benzrf: afaik no
<benzrf>
wait, really?
_bart has quit []
<benzrf>
i thought having it at the top level put it into Object/
<apeiros>
at least it was like that in 1.8 - methods in toplevel were local to the file
petey has quit [Remote host closed the connection]
Czupa has quit [Remote host closed the connection]
<benzrf>
hmm
<benzrf>
how does Kernel work?
dkamioka has joined #ruby
<apeiros>
if you want global pseudo-functions, put them in Kernel and mark them as module_function
<benzrf>
is it included into Object?
<apeiros>
yes
<benzrf>
ok
<apeiros>
see above. that's the proper approach.
petey has joined #ruby
<apeiros>
it's how things like puts/gets etc. are implemented
<benzrf>
and how can method definition be intercepted? like, how would you implement private in pure ruby?
<apeiros>
you wouldn't
redramires has joined #ruby
<benzrf>
ok
<benzrf>
so it's magic
havenwood has quit [Remote host closed the connection]
johnnyfuchs has quit [Quit: Leaving.]
<benzrf>
is being able to distinguish self.foo from foo inside of foo possible?
<benzrf>
or is that also magic?
<apeiros>
if "outside of ruby" == magic, then yes.
havenwood has joined #ruby
<apeiros>
not possible, no.
<benzrf>
ok
<apeiros>
what are you trying to achieve?
<benzrf>
jw
<benzrf>
so there is no semantic diff between self.foo and foo at all within ruby?
<benzrf>
only visible from C?
<apeiros>
because unless you're trying to replicate rubinius, you seem to be doing something you shouldn't…
<benzrf>
im not doing anything
nickmarx has joined #ruby
<benzrf>
i just like to understand that lang im using
<benzrf>
*the
<waxjar_>
there is a hook that gets called when a method is added, forgot the name tho
<apeiros>
there is a semantic difference. self.foo is prohibited for private methods.
<benzrf>
apeiros: I meant within ruby itself
<apeiros>
waxjar_: method_added
<benzrf>
only the C can see that diff
<waxjar_>
apt name :p
<apeiros>
waxjar_: but that doesn't help with implementing private
<benzrf>
apeiros: it would if you could see whether there was a self.
maletor has joined #ruby
<benzrf>
apeiros: you could override the method with a new version that checks how it was called
<apeiros>
yeah, but you can't :)
petey has quit [Ping timeout: 260 seconds]
<waxjar_>
i guess you could remove the method and re-add it with a guard clause that figures out the receiver somehow (#caller and Ripper?). but why bother? :p
ddd has quit [Quit: leaving]
ffranz has joined #ruby
<benzrf>
waxjar_: ripper?
deryl is now known as ddd
nickmarx has quit [Quit: Page closed]
<redramires>
Hello guys.I am new in ruby and have question about public,private methods.Doe's private forbid using method outside the class?
<waxjar_>
benzrf: it's a library in the stdlib that parses ruby code
havenwood has quit [Ping timeout: 248 seconds]
benlieb has joined #ruby
<toretore>
redramires: private means it can only be used with (possibly implied) self
<benzrf>
redramires: private means you can only call it without a dot
mikepack has joined #ruby
<benzrf>
redramires: like how if you do 'def foo' you can do either 'self.foo' or just 'foo'
virtualize has quit [Quit: Leaving...]
<benzrf>
redramires: with a private method the latter works but the former does not
davy_ has joined #ruby
kristiandelay has joined #ruby
<apeiros>
with one notable exception - methods ending in '=' can still be called with an explicit self
sambao21 has quit [Quit: Computer has gone to sleep.]
kindjal has joined #ruby
xk_id has quit [Ping timeout: 272 seconds]
<benzrf>
apeiros: wait, so ruby can tell if you're using self. from foo.?
banister has joined #ruby
phipes has joined #ruby
<benzrf>
apeiros: if that's true, why disallow it for private methods?
zz_tsykoduk is now known as tsykoduk
obs_ has quit [Remote host closed the connection]
mmitchel_ has quit [Remote host closed the connection]
SHyx0rmZ has joined #ruby
<apeiros>
benzrf: don't know, ask matz?
jerius has joined #ruby
rootshift has quit [Quit: rootshift]
sambao21 has joined #ruby
phipes has quit [Client Quit]
<benzrf>
dang it matz
<redramires>
thanks guys
mmitchell has joined #ruby
<benzrf>
p. much nothing in PYTHON is magic why does ruby have to be
phipes has joined #ruby
<apeiros>
never understood why it was implemented with regards to explicit receiver instead of just same object.
xk_id has joined #ruby
alekst has joined #ruby
phipes has quit [Client Quit]
krawchyk has quit []
<benzrf>
because matz is wack
phipes has joined #ruby
wlanboy has quit [Ping timeout: 245 seconds]
carlyle has quit [Remote host closed the connection]
<slash_quit>
lol... was just scrolled up a day or so.
<platzhirsch>
DouweM: k, was my first thought but my second was that you really meant something else :P
<platzhirsch>
"something else"...
tidu12 has joined #ruby
<MrPopinjay>
Hello all. I'm brand new to Ruby as of today. What's the best way to loop a block X number of times without assigning a variable to the index? Vim is moaning that I have an unused variable, and it's annoying
<DouweM>
platzhirsch: didn't, just was very impressed by the code in that pic :P
<MrPopinjay>
Thank you
<DouweM>
use _ instead of i
d45h has quit []
<MrPopinjay>
Thank you DouweM
<DouweM>
and vim shouldn't moan
<MrPopinjay>
I use a syntax checking plugin
<sec^nd>
DouweM: what is _ ?
ffranz has joined #ruby
bricker_ has quit [Quit: leaving]
<MrPopinjay>
DouweM: more accurately it's mri that's moaning
phipes has quit [Remote host closed the connection]
<MrPopinjay>
Thank you! :)
lkba has joined #ruby
<MrPopinjay>
You've been very helpful
<DouweM>
sec^nd: so it's a parameter you want to throw away to prevent warnings like the one MrPopinjay's seeing
tidu12 has quit [Max SendQ exceeded]
<DouweM>
sec^nd: did you get an answer to the Foo::Bar question?
<sec^nd>
ahh I remember seeing that
<sec^nd>
Its like when looping
<sec^nd>
DouweM: nope
Guedes0 has left #ruby ["Saindo"]
virtualize has joined #ruby
bentonrr has quit [Remote host closed the connection]
<DouweM>
sec^nd: :: is pretty much the namespacing seperator. when you have a class/module nested inside another class/module like so: `module Foo; class Bar; end; end`, you can access it using Foo::Bar
typicalbender has joined #ruby
d45h has joined #ruby
<apeiros>
sadly, :: can still be used as a substitute for . - that is for method invocation
<DouweM>
sec^nd: if you want to unambiguously refer to one of File's 2 size methods in a context like IRC or StackOverflow or the Ruby docs, you use :: and #
ffranz has quit [Quit: Leaving]
<apeiros>
sec^nd: for most parts it does not. there are edge cases, though.
<sec^nd>
kk
<apeiros>
i.e., newlines can't be placed all that freely.
DeProdigy has joined #ruby
<apeiros>
also don't put whitespace before method parens
<Hanmac>
apeiros: cant newlines be replaced with ; ?
<apeiros>
`foo (1)` and `foo(1)` are not the same
<apeiros>
(well, for this simple expression, they are)
<apeiros>
Hanmac: yes. but you can't put newlines wherever you have a space.
ayumin has joined #ruby
<Mon_Ouie>
Hanmac: Not always
<Mon_Ouie>
3 +\n 4 vs. 3 +; 4
<apeiros>
newlines ∈ whitespace
<apeiros>
Mon_Ouie: oh, that's interesting. didn't know. I assumed \n and ; were interchangeable.
<Mon_Ouie>
apeiros: You just forgot, that's the example I used the last time I saw you say that :p
<apeiros>
(except for obvious things like string literals)
w4pm has joined #ruby
<Hanmac>
apeiros: "3 +\\n 4" works too ;p
mercwithamouth has quit [Ping timeout: 272 seconds]
<apeiros>
Mon_Ouie: hmmm, tells me how high of an importance my brain assigns to that information then… :)
<apeiros>
Hanmac: yeah, escaping newlines is a nice thing
johnnyfuchs has left #ruby [#ruby]
thyagobr has quit [Quit: thyagobr has no reason]
<apeiros>
I most often use it in combination with concatenated string literals
<apeiros>
e.g. "foo" \\n"bar" \\n "baz" # => "foobarbaz"
<Hanmac>
hm no i mean typed in irb 3+\<newline>4
carlyle has joined #ruby
<apeiros>
yes
<Mon_Ouie>
Not in a string
<apeiros>
understood it that way
<Mon_Ouie>
Escaping a newline outside of a string
<apeiros>
yes
<Mon_Ouie>
Oh, nvm then
ArchBeOS-work has quit [Quit: Leaving]
* Hanmac
"likes" "strings" "like" "that" ";P"
iamjarvo_ has quit [Remote host closed the connection]
rootshift has quit [Read error: Connection reset by peer]
Bira has quit [Remote host closed the connection]
freerobby has quit [Read error: Connection reset by peer]
<platzhirsch>
I started caching, I profiled and didn't found the source what takes so long
gr33n7007h has quit [Remote host closed the connection]
<platzhirsch>
mindlessly pushed all my domain data to the page
nisstyre has joined #ruby
jibi has quit [Quit: .]
<apeiros>
load the data later
<apeiros>
and if you can - in pieces
<Xeago>
apeiros: why not stream the data, instead of in pieces?
<DouweM>
bootstrapping is fine too, but only for data you'll always need
<Xeago>
there was this great library that allowed sax-like pulling out of json
<DouweM>
but most of that data should probably be loaded lazily, as apeiros says
Megtastique has joined #ruby
psyl0n has joined #ruby
psyl0n has joined #ruby
psyl0n has quit [Changing host]
Lewix has joined #ruby
<platzhirsch>
apeiros: AJAX is pretty much the alternative approach, but I thought gon would be nice
jedimind has quit [Quit: home time]
<apeiros>
Xeago: browser support
<apeiros>
but depending on which browsers you intend to support - sure, streaming is nicer than in pieces.
<platzhirsch>
DouweM: so you think I should drop gon and use AJAX requests
<platzhirsch>
?
<DouweM>
platzhirsch: yup
<Xeago>
apeiros: it is fully backwards compatible to ie6 :)
<apeiros>
o0
momomomomo has joined #ruby
<apeiros>
you sure?
<platzhirsch>
most of the time I don't need the whole data anyway, I just put it in everywhere where I access my domain objects
<Xeago>
it falls back to just a standard blocking ajax in ie6
<DouweM>
platzhirsch: which is now coming back to bite you in the ass :)
<apeiros>
it's been a while when I last investigated, and back then that wouldn't work
<platzhirsch>
gon.entities = Entity.all -- haha done, all the data to me
<Xeago>
depending on the source of the XHR
<apeiros>
Xeago: ah, ok. blocking.
<DouweM>
platzhirsch: bootstrap what you'll always need, load lazily otherwise
<Xeago>
well, callback soup…
<platzhirsch>
DouweM: would be nice, this also opens the door to refactor the view sometimes to something like AngularJS
<platzhirsch>
man this calls for some die hard refactoring this night
<DouweM>
:D
zoo-zed has joined #ruby
<DouweM>
platzhirsch: are you using any mvc framework right now?
burlyscudd has joined #ruby
<DouweM>
client-side, obvs
rudisimo has quit [Quit: Leaving.]
Bira has joined #ruby
drumusician has joined #ruby
jchristi1 has quit [Ping timeout: 246 seconds]
allaire has joined #ruby
<platzhirsch>
DouweM: no
shedd has quit [Ping timeout: 248 seconds]
ElasticElephant has joined #ruby
vt102 has quit [Ping timeout: 264 seconds]
sepp2k1 has joined #ruby
<platzhirsch>
it's not much JavaScript I need to use anyway, just some additions. I thought about using AngularJS etc., but since it uses a whole other approach I would need to drop Rails view templates and I don't see why I should do that now
CpuID has joined #ruby
benlieb has quit [Quit: benlieb]
sepp2k has quit [Ping timeout: 260 seconds]
shedd has joined #ruby
clamstar has joined #ruby
jbpros has quit [Quit: jbpros]
wongon has joined #ruby
p4d4w4n has joined #ruby
iliketur_ has joined #ruby
zxq9 has quit [Quit: Konversation terminated!]
amoli has quit [Ping timeout: 248 seconds]
FL1SK is now known as _FL1SK
Bira has quit [Remote host closed the connection]
io_syl has joined #ruby
_FL1SK is now known as FL1SK
gr33n7007h has joined #ruby
gr33n7007h has quit [Changing host]
gr33n7007h has joined #ruby
iliketur_ has quit [Client Quit]
gr33n7007h has quit [Max SendQ exceeded]
FL1SK is now known as cseader
flubba has joined #ruby
gr33n7007h has joined #ruby
fijimunkii has joined #ruby
digital-ghost has quit [Read error: No route to host]
digital-ghost has joined #ruby
bogeyd6 has joined #ruby
fijimunk1i has quit [Ping timeout: 240 seconds]
MrPopinjay has joined #ruby
kirun has quit [Quit: Client exiting]
mikepack has joined #ruby
<MrPopinjay>
Hello all. Super new. If I want to raise a custom exception I need to create my own exception class that inherits from Exception, correct?
maletor has quit [Quit: Computer has gone to sleep.]
psyl0n has quit [Remote host closed the connection]
petey has quit [Remote host closed the connection]
<DouweM>
inherits from StandardError, rather
<MrPopinjay>
DouweM: But other than that I'm all good?
<DouweM>
MrPopinjay: yeah, you can subclass it just fine, and then you can `rescue YourError`
<MrPopinjay>
DouweM: Perfect. You're awesome, thank you dude.
<havenwood>
MrPopinjay: Never rescue Exception, just be as specific as possible, but `rescue` is the same as `rescue StandardError`.
<MrPopinjay>
That's the plan havenwood :)
fella5s has quit [Read error: Connection reset by peer]
<MrPopinjay>
That's why I wanted a custom exception, to avoid catching them all!
ssvo_ has joined #ruby
fella5s has joined #ruby
<apeiros>
on a sidenote: rescue, not catch. there's throw/catch in ruby too and it's different.
<MrPopinjay>
apeiros: Oh, I'll look into that as well then. Thanks
<DouweM>
apeiros: yes! it took me a while to figure that out
<MrPopinjay>
Is there a quick way of knowing which to use?
<apeiros>
if it's about exceptions, use raise/rescue
<apeiros>
throw/catch you'll rarely ever use
<DouweM>
there's completely different things
iliketur_ has joined #ruby
deryl has quit [Disconnected by services]
deryl1 has joined #ruby
<apeiros>
actually they're almost the same. just that one is about exception handling and the other about flow control.
<apeiros>
I think in MRI they even use the same mechanism. not sure, though.
<DouweM>
right. but the situations in which you'll use them are completely different
<MrPopinjay>
I think I'm after the flow control one
<DouweM>
in some other language, exceptions are used for both
<RubyPanther>
please don't use throw/catch, please,please,please,please,plaese
ssvo has quit [Ping timeout: 246 seconds]
drebar has quit [Quit: Leaving]
<MrPopinjay>
RubyPanther: Why is that?
DeProdigy has joined #ruby
<RubyPanther>
because nobody else uses it. I'd have to look it up.
Mon_Ouie has quit [Ping timeout: 248 seconds]
<MrPopinjay>
I want exceptiony style flow control. Should I go for try/catch then? Or should I just use exceptions as they are more widely used?
Monie has joined #ruby
<RubyPanther>
exceptions
Monie has quit [Max SendQ exceeded]
<apeiros>
if you really want flow control: throw/catch
Sawbones has quit []
<apeiros>
but usually you don't need that in ruby
<bnagy>
+1 throw/catch
<MrPopinjay>
apeiros: What's the arguement in favour of that approach?
<havenwood>
MrPopinjay: Exceptions are exceptional. Don't use them for flow control.
<apeiros>
if you show the code, we can probably show you a way without either
<bnagy>
using exceptions for flow control is awful
<DouweM>
apeiros: +1
<bnagy>
so it throw/catch, but at least that's what it's there for
fedesilva has quit [Remote host closed the connection]
Monie has joined #ruby
<RubyPanther>
it is stylistically controversial, but exceptions are used that way in the wild
<canton7>
essentially you're wrapping on goto. it may look pretty, but it's still goto. handy in exceptional cases, not so handy in normal program flow
<DouweM>
RubyPanther: not in Ruby they aren't
<MrPopinjay>
Ok, thanks guy. Good food for thought :)
<canton7>
s/wrapping up/wrapping up
<RubyPanther>
Yes, in Ruby.
<DouweM>
RubyPanther: exceptions are used for flow control in Ruby? that's not Ruby I want to work with
<RubyPanther>
That's why I said it is controversial.
<DouweM>
;)
<DouweM>
understood
Eiam has joined #ruby
<havenwood>
RubyPanther: Except there isn't a controversy so much as just people doing it wrong. :P
<RubyPanther>
The whole style of flow control is anti-ruby
Xeago has quit [Remote host closed the connection]
deryl1 has quit [Client Quit]
Lewis has quit [Remote host closed the connection]
deryl has joined #ruby
<bnagy>
it's only controversial if there are fgood programmers who argue in its favour
stringoO has quit [Quit: stringoO]
carlyle has quit [Remote host closed the connection]
<apeiros>
it's about as controversial as global warming. some people think there's still something to argue about.
<DouweM>
see also: creationism, flat-earth society
<RubyPanther>
what if their code runs, and they don't say anything they just write it?
Strato has joined #ruby
<apeiros>
then it runs. doesn't make it better.
<MrPopinjay>
OK, so this is probably pretty silly, but I have a class containing an array, and a method that sets the first element of the array to a value. I want a way to indicate when the first element already contained that value, and my first thought was something like a try/catch/exception/whatever type thing. What would you guys recommend?
Strato has quit [Max SendQ exceeded]
<RubyPanther>
maybe I've just been unlucky to see it
<havenwood>
i kinda like Weirich's idea of using `fail` for errors and only using `raise` when raising out of a fail. I don't do it, but kinda like it.
<apeiros>
MrPopinjay: as said, please paste code, input and desired output
<apeiros>
preferably on gist.github.com
<havenwood>
RubyPanther: I've seen it as well. People do the damnedest things. :P
nettoweb has quit [Quit: nettoweb]
<apeiros>
bad code style isn't exactly a rarity
<havenwood>
too true
Strato has joined #ruby
deryl is now known as ddd
<havenwood>
same as writing in general i'd imagine, the bulk of what is written may not be up to a publishing standard, but the standard nonetheless remains
Jdubs has quit [Remote host closed the connection]
<apeiros>
MrPopinjay: where's the part where you'd want to use an exception or throw/catch?
Kayzon has joined #ruby
<DouweM>
MrPopinjay: so you want load to fail if there's already a bullet there?
nari has joined #ruby
<MrPopinjay>
apeiros: Yes
<DouweM>
MrPopinjay: why not just return true/false ?
mansi_ has quit [Remote host closed the connection]
danman has quit [Quit: danman]
<MrPopinjay>
DouweM: I guess I could do that, it just didn't seem the most readable solution
<MrPopinjay>
Try load etc seems to make more sense to me than if load, etc
<havenwood>
MrPopinjay: Just declare your private methods below `private`, but I'd suggest just skipping `private` for a while until you get really used to the Ruby object model.
preller has quit [Ping timeout: 272 seconds]
<DouweM>
MrPopinjay: also: 2 spaces for indentation, just define private methods after the private keyword, do you really need numChambers?
<DouweM>
havenwood: ;)
<havenwood>
2-space soft-tabs ftw
Lewis has joined #ruby
<MrPopinjay>
2 space indentation is evil
<MrPopinjay>
D:
<DouweM>
MrPopinjay: it's the Ruby way(TM)
<MrPopinjay>
haha
<MrPopinjay>
Guess I'm not getting employed then
<havenwood>
MrPopinjay: Why not set your soft tabs to two spaces?
<DouweM>
haha. I know Ruby devs who have a pre-commit script that turns all of their tabs into 2 spaces and vice-versa on pull
<MrPopinjay>
RE numChambers, planning to call it later, and it seems clear than gun.chambers.length
<DouweM>
MrPopinjay: then just define it as a method on Revolver
<MrPopinjay>
havenwood: Sorry, what's a soft tab?
<DouweM>
def number_of_chambers; chambers.length; end
nettoweb has joined #ruby
<MrPopinjay>
DouweM: Hm. Unsure. I think I'll scrap it for now
<DouweM>
MrPopinjay: your code also won';t work because on line 8 you use numChambers instead of chambers/@numChambers
<havenwood>
MrPopinjay: When you `tab` it indents by x spaces instead of a hard tab.
mlpinit has quit [Read error: Connection reset by peer]
<havenwood>
MrPopinjay: But acts as a tab for all intents and purposes. Not like we're hitting space twice. >.>
mlpinit has joined #ruby
<havenwood>
MrPopinjay: Or backspace twice. But makes for lovely formatting and gets rid of everyone having to set tabs.
<bnagy>
it's best to avoid a separate variable that should actually be calculated primarily, because of the risk of things getting out of sync
<MrPopinjay>
Aye, set it up in vim to 4.
<havenwood>
MrPopinjay: A strong Ruby convention. And I think a more modern convention in general. It assumes a proper text editor or ide, which is a fair assumption.
<MrPopinjay>
bnagy: Good point, thank you
<bnagy>
if it's the size of chambers, then use that, not a variable that says what it should be
interactionjaxsn has quit [Remote host closed the connection]
<MrPopinjay>
DouweM: Explain that again please, the class/instance variables are going slightly over my head atm
mikesplain2 has quit [Ping timeout: 272 seconds]
<havenwood>
MrPopinjay: pretend class variables *do not exist*
<DouweM>
MrPopinjay: ah, it will work because numChambers is the attr_reader method. But still, in this case you should just use the passed chambers parameter directly
<apeiros>
+1 on "forget class variables"
<DouweM>
+2
<apeiros>
so sad how they work :(
<MrPopinjay>
DouweM: So if I want to store a value set at init, how do I do this, and how do I use it within methods of the same class?
<DouweM>
yeah, I still have to look that shit up every time
<MrPopinjay>
On a per instance basis
<bnagy>
@ivars do that
sailias has quit [Quit: Leaving.]
<DouweM>
MrPopinjay: ivars for private stuff, ivar + attr_accessor for public stuff
<DouweM>
MrPopinjay: but in this case you could/should just use the passed chambers var directly
niklasb has joined #ruby
<DouweM>
MrPopinjay: it's usually better to not use too many methods in initialize, because initialize is for setting up the object while those methods you may inadvertently call may assume the object has already been set up
<MrPopinjay>
DouweM: You're right, I realised that just as I looked at it now. Originally that bit was more verbose, and was like that after I removed all the other crappy functionality
<DouweM>
so. don't use the numChambers getter, just the var
<MrPopinjay>
DouweM: How do I use the var?
<MrPopinjay>
In another method
<DouweM>
MrPopinjay: store it in an ivar. like you're doing with @chambers
<MrPopinjay>
Say, in load, how do I access the Array at @chambers
<DouweM>
@chambers
<MrPopinjay>
with @chambers again?
<MrPopinjay>
Thanks
jerius has quit [Ping timeout: 248 seconds]
<shevy>
MrPopinjay all @ivars are available inside of your class
w4pm_ has joined #ruby
<ElasticElephant>
What does "wrong number of arguments 2 for 1" mean?
<bnagy>
also, I strongly suggest using nil instead of :empty
<MrPopinjay>
bnagy: OK
<bnagy>
it's going to make the rest of your code more expressive
flubba has quit [Remote host closed the connection]
<shevy>
def foo; @foo = 'hi; end; def bar; puts @foo; end <-- bar() can output @foo variable if foo() method was called before
<slash_quit>
ElasticElephant: it means the method doesn't expect more than 1 argument
<bnagy>
like if chambers.any? for example
<shevy>
ElasticElephant you passed one argument too many
<DouweM>
attr_accessor defines #chambers and #chambers= methods, so the ivar will be publicly available
<apeiros>
ElasticElephant: it means you passed 2 arguments, and the method accepts only 1
<ElasticElephant>
ok thanks
<shevy>
I like plastic elephants
psyl0n has joined #ruby
dkamioka has quit [Remote host closed the connection]
w4pm has quit [Ping timeout: 241 seconds]
<shevy>
it's those things like those swimming duckies for the bath right?
<MrPopinjay>
bnagy: That was while I was trying to work out some other stuff, it was nil before, but I wanted to see the contents of the chamber for testing the spin bit, and I had not removed it yet
Durstburger has joined #ruby
<ElasticElephant>
I do too :)
<MrPopinjay>
ty though! I forgot about it
fijimunkii has quit [Ping timeout: 248 seconds]
moted has joined #ruby
Durstburger has left #ruby [#ruby]
nettoweb has quit [Quit: nettoweb]
Jdubs has joined #ruby
parduse has quit [Ping timeout: 260 seconds]
parduse has joined #ruby
bradhe has quit [Remote host closed the connection]
Jdubs has quit [Remote host closed the connection]
preller has joined #ruby
mlpinit has quit [Remote host closed the connection]
sambao21 has quit [Quit: Computer has gone to sleep.]
<rjhunter>
MrPopinjay: Arrays also respond to `rotate`, so you don't need to implement that yourself
<MrPopinjay>
rjhunter: I did, check it
mlpinit has joined #ruby
<DouweM>
rjhunter: news to me, neat
<MrPopinjay>
Line 11
momomomomo has quit [Quit: momomomomo]
johnmilton has quit [Remote host closed the connection]
nowthatsamatt has quit [Quit: nowthatsamatt]
udoprog has quit [Read error: Operation timed out]
mlpinit has quit [Remote host closed the connection]
sambao21 has joined #ruby
<rjhunter>
MrPopinjay: i see you've implemented it yourself, that's why I let you know that you don't need to
<jhn>
ElasticElephant: what's the problem you're having?
nari has quit [Ping timeout: 260 seconds]
batchitcray has joined #ruby
<slash_quit>
shevy: both of them?
burlyscudd has quit [Quit: Leaving.]
<ElasticElephant>
I am getting a syntax error, unexpected end but I can't find a syntax error lol
<jhn>
ElasticElephant: Right off the bat: method names can't be separated by spaces.
<shevy>
slash_quit hehe
<shevy>
my brain is no longer working... but I think for today, I will hit the sack
<rjhunter>
shevy: hit the sack of brains?
* rjhunter
imagines a piñata
<DouweM>
ElasticElephant: I don't see an actual implementation of `add` anywhere
klaut has quit [Remote host closed the connection]
<DouweM>
rjhunter: lol
nanoyak has quit [Ping timeout: 272 seconds]
Lewis has quit [Remote host closed the connection]
timonv has quit [Ping timeout: 272 seconds]
jamesaanderson has joined #ruby
bean__ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<MrPopinjay>
Ok gents- thoughts on this? https://gist.github.com/lpil/e39b0125e3252e08ff7d Also, can I just say it's been a real pleasure talking to you. Very educational! It's lovely to be in a channel were people are friendly, rather than mocking
jamesaanderson has quit [Client Quit]
<DouweM>
MrPopinjay: lol ur code sux
<MrPopinjay>
DouweM: ;-;
elux has quit [Quit: Leaving...]
<DouweM>
MrPopinjay: drop the explicit returns!
<MrPopinjay>
DouweM: oh?
<jhn>
ElasticElephant: I would start by writing a single test and making that pass. once you have the first test working, add another one.
<bnagy>
MrPopinjay: just use an early return in load, if that's what you want for behaviour
<DouweM>
MrPopinjay: or, indeed, do an early return
<ElasticElephant>
I got the first test to pass
jamesaanderson has joined #ruby
nanoyak has joined #ruby
<ddd>
hmm, california is 3 hours behind eastern time correct?
nhhagen has quit [Ping timeout: 272 seconds]
<bnagy>
return false if chambers.first; chambers.first = :loaded; true
<jhn>
ElasticElephant: Ok. Now move on to it "adds 2 and 2"
<ddd>
i always get confused if its 3 or 4 hours behind me
<ElasticElephant>
Wouldn't the process for that one be the same though?
<MrPopinjay>
DouweM: Does that true get returned?
<bnagy>
ooh and first= doesn't exist, sorry
<DouweM>
MrPopinjay: yep, Ruby implicitly returns the last expression in a method
<ElasticElephant>
except obliviously with a different method name and such
<DouweM>
bnagy: ;)
<MrPopinjay>
Oooh
<jhn>
First of all, in your add method, you're always computing 0 + 0
bricker has joined #ruby
<jhn>
even if you call it like: add(3, 4), it's still doing 0 + 0
<ElasticElephant>
we'll thats why id create a different method to add a different set of numbers
havenwood has quit [Remote host closed the connection]
<MrPopinjay>
I'm not sure what I think of that. Isn't it clearer to use return?
peregrine81 has joined #ruby
<bnagy>
style says don't use return unless you have to syntactically
maletor has joined #ruby
<MrPopinjay>
bnagy: Gah
<bnagy>
otherwise it's confusing
<jhn>
Yeah about that... first of all method names can't have spaces.
maletor has quit [Client Quit]
<DouweM>
you'll get used to it fast enough
<jhn>
so "def adds 2 and 2(a, b)" would not work
<bnagy>
this way when you see the keyword you know it's an early return
<ElasticElephant>
no i know that i screwed up lol
<MrPopinjay>
I see, that would make sense.
maletor has joined #ruby
<MrPopinjay>
This if syntax is a little confusing for me, but I really like how it reads
<MrPopinjay>
'return false if @chambers[0]'
nari has joined #ruby
<MrPopinjay>
Makes sense, just had no idea I could do that
<bnagy>
MrPopinjay: in 'real' ruby I wouldn't even bother with returning true, because when you set chambers[0] to :loaded or whatever, that statement returns :loaded