apeiros_ changed the topic of #ruby to: programming language || ruby-lang.org || Paste >3 lines of text in http://pastie.org || Rails is in #rubyonrails
simao has quit [Ping timeout: 245 seconds]
looopy has quit [Remote host closed the connection]
jimeh2 has quit [Ping timeout: 245 seconds]
nik_-_ has quit [Quit: nik_-_]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
matti has joined #ruby
minijupe has quit [Quit: minijupe]
akem has joined #ruby
ephesius has left #ruby [#ruby]
adeponte has quit [Remote host closed the connection]
luxurymode has joined #ruby
andrewhl has quit [Quit: andrewhl]
billiamii has joined #ruby
dnyy has joined #ruby
eywu has quit [Quit: Leaving.]
eywu has joined #ruby
liluo has joined #ruby
luxurymode has quit [Client Quit]
nari has quit [Ping timeout: 248 seconds]
iocor has quit [Quit: Computer has gone to sleep.]
minijupe has joined #ruby
mrsolo has quit [Quit: Leaving]
ivar has quit [Ping timeout: 260 seconds]
liluo has quit [Remote host closed the connection]
ezn-01 has quit [Remote host closed the connection]
yoklov has joined #ruby
austinbv has joined #ruby
kenperkins has quit [Read error: Operation timed out]
minijupe has quit [Quit: minijupe]
locriani_ has quit [Ping timeout: 250 seconds]
netogallo has quit [Ping timeout: 256 seconds]
macmartine has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
libertyprime has quit [Quit: Lost terminal]
`brendan has joined #ruby
cbuxton1 has quit [Ping timeout: 245 seconds]
luckman212 has joined #ruby
kenichi has quit [Remote host closed the connection]
sam113101 has quit [Remote host closed the connection]
khakimov has quit [Quit: Computer has gone to sleep.]
mahmoudimus has quit [Read error: Connection reset by peer]
kevinbond has left #ruby [#ruby]
wookiehangover_ has joined #ruby
harukomoto has quit [*.net *.split]
friskd has quit [*.net *.split]
mneorr has quit [*.net *.split]
jrgifford has quit [*.net *.split]
davidpk has quit [*.net *.split]
closedbracket has quit [*.net *.split]
fr0gprince_ has quit [*.net *.split]
c0rn has quit [*.net *.split]
davidboy has quit [*.net *.split]
randym has quit [*.net *.split]
lectrick has quit [*.net *.split]
Spaceghostc2c has quit [*.net *.split]
Shrink has quit [*.net *.split]
WalterN has quit [*.net *.split]
s0ber has quit [*.net *.split]
kinesis has quit [*.net *.split]
flagg0204 has quit [*.net *.split]
straind has quit [*.net *.split]
nimred has quit [*.net *.split]
wookiehangover has quit [*.net *.split]
busybox42 has quit [*.net *.split]
Poapfel has quit [*.net *.split]
Kartagis has quit [*.net *.split]
joukokar has quit [*.net *.split]
crodas has quit [*.net *.split]
aetaric has quit [*.net *.split]
gregorg has quit [*.net *.split]
rtl has quit [*.net *.split]
huismon has quit [*.net *.split]
flori has quit [*.net *.split]
zaiste has quit [*.net *.split]
ByteCrunch has quit [*.net *.split]
irk3z has quit [*.net *.split]
marienz has quit [*.net *.split]
wereHamster has quit [*.net *.split]
s0ber_ is now known as s0ber
itnomad has joined #ruby
looopy has quit [Remote host closed the connection]
sam113101 has quit [Remote host closed the connection]
ConstantineXVI has quit [Remote host closed the connection]
straind` has joined #ruby
harukomoto has joined #ruby
friskd has joined #ruby
mneorr has joined #ruby
closedbracket has joined #ruby
jrgifford has joined #ruby
WalterN has joined #ruby
c0rn has joined #ruby
davidpk has joined #ruby
davidboy has joined #ruby
fr0gprince_ has joined #ruby
randym has joined #ruby
lectrick has joined #ruby
Spaceghostc2c has joined #ruby
Shrink has joined #ruby
kinesis has joined #ruby
flagg0204 has joined #ruby
nimred has joined #ruby
Poapfel has joined #ruby
busybox42 has joined #ruby
crodas has joined #ruby
Kartagis has joined #ruby
aetaric has joined #ruby
zaiste has joined #ruby
ByteCrunch has joined #ruby
irk3z has joined #ruby
marienz has joined #ruby
wereHamster has joined #ruby
nimred has quit [Max SendQ exceeded]
nimred has joined #ruby
Facefox has quit [Ping timeout: 260 seconds]
arkx has quit [Ping timeout: 248 seconds]
straind` has quit [*.net *.split]
harukomoto has quit [*.net *.split]
friskd has quit [*.net *.split]
mneorr has quit [*.net *.split]
davidpk has quit [*.net *.split]
jrgifford has quit [*.net *.split]
closedbracket has quit [*.net *.split]
fr0gprince_ has quit [*.net *.split]
c0rn has quit [*.net *.split]
davidboy has quit [*.net *.split]
randym has quit [*.net *.split]
lectrick has quit [*.net *.split]
Spaceghostc2c has quit [*.net *.split]
Shrink has quit [*.net *.split]
WalterN has quit [*.net *.split]
kinesis has quit [*.net *.split]
flagg0204 has quit [*.net *.split]
busybox42 has quit [*.net *.split]
Poapfel has quit [*.net *.split]
Kartagis has quit [*.net *.split]
crodas has quit [*.net *.split]
aetaric has quit [*.net *.split]
marienz has quit [*.net *.split]
irk3z has quit [*.net *.split]
zaiste has quit [*.net *.split]
ByteCrunch has quit [*.net *.split]
wereHamster has quit [*.net *.split]
eywu has quit [Quit: Leaving.]
Hanmac has joined #ruby
friskd has joined #ruby
StoSun has quit []
Facefox has joined #ruby
JStoker has quit [Quit: JStoker is gone :(]
<razer123>
It would be so cool if iphone supported MacRuby.
mengu_ has quit [Remote host closed the connection]
fr0gprince_mac has quit [Ping timeout: 276 seconds]
razer123 has left #ruby ["Whoop Whoop, zoidberg"]
straind` has joined #ruby
harukomoto has joined #ruby
mneorr has joined #ruby
jrgifford has joined #ruby
WalterN has joined #ruby
closedbracket has joined #ruby
fr0gprince_ has joined #ruby
c0rn has joined #ruby
davidboy has joined #ruby
randym has joined #ruby
lectrick has joined #ruby
Spaceghostc2c has joined #ruby
kinesis has joined #ruby
flagg0204 has joined #ruby
Poapfel has joined #ruby
aetaric has joined #ruby
busybox42 has joined #ruby
Kartagis has joined #ruby
zaiste has joined #ruby
ByteCrunch has joined #ruby
crodas has joined #ruby
irk3z has joined #ruby
marienz has joined #ruby
wereHamster has joined #ruby
L-----D has joined #ruby
arkx has joined #ruby
artOfWar has quit [Remote host closed the connection]
Haydos has joined #ruby
<graspee>
ruby could be made for the iphone
<graspee>
there is a python for iphone and a scheme
marienz has quit [Ping timeout: 606 seconds]
Shrink has joined #ruby
sam113101 has joined #ruby
Facefox has quit [Ping timeout: 260 seconds]
<stewart_>
RubyMotion?
arkx has quit [Ping timeout: 244 seconds]
ciopte7 has joined #ruby
arkx has joined #ruby
marienz has joined #ruby
Facefox has joined #ruby
PragCypher has joined #ruby
fearoffish has quit [Quit: Computer has gone to sleep.]
yankov has joined #ruby
<graspee>
it's not real
looopy has joined #ruby
<stewart_>
what RubyMotion?
<graspee>
well. what i mean is it's not ruby on the iphone
<graspee>
it's a development environment for the mac i believe which uses ruby and targets the ihpone
<graspee>
but it's not a repl for ruby on iphone that you can play with
ank has quit [Quit: ank]
<stewart_>
you want to develop ruby on your iphone?
<graspee>
of course
<stewart_>
haha… why?
<graspee>
if you have to ask you wouldn't understand
<graspee>
but anyway, because it's cool
<graspee>
and because it's fun
<stewart_>
well yea… thats why i asked
arkx has quit [Ping timeout: 244 seconds]
<stewart_>
i would not ask if did undrstand
<graspee>
sorry
JStoker has joined #ruby
<stewart_>
hey if its cool then its cool
<graspee>
it just surprises me that not everyone thinks the way i do
niklasb has quit [Ping timeout: 248 seconds]
<stewart_>
hahah
<stewart_>
yep me too :)
arkx has joined #ruby
<stewart_>
personally I could not think of anything worse. I can barely tolerate browsing on my phone little only coding
<graspee>
i write stuff in scheme on my ipod touch
<graspee>
it's a good way to pass the time if you are stuck somewhere
<stewart_>
keyboard?
<graspee>
just the on screen keyboard
<stewart_>
do you have an external keyboard
<graspee>
no
<stewart_>
ha… well ipad is different i suppose....
<graspee>
ipOd
<stewart_>
ah right
<stewart_>
well i still think your crazy then ;)
cordoval has joined #ruby
<graspee>
it's easy
<stewart_>
its bliding
kylemcgill has quit [Remote host closed the connection]
<stewart_>
plus i am too used to vim now
<stewart_>
cant live with out it
<stewart_>
i keep putting random v's in my code :)
<stewart_>
with out it
<graspee>
i use dvorak kbd layout so vim is a little bit annoying
mikepack has joined #ruby
simao has joined #ruby
<stewart_>
ahhh right
<stewart_>
what do you use when your not coding on mobile ?
<graspee>
how do you mean?
<graspee>
i use my laptop
<stewart_>
what editor?
<graspee>
or did you mean editor?
<stewart_>
yea editor
<graspee>
i use vim
<graspee>
it just annoys me
<stewart_>
ha…. you need a new editor then
<stewart_>
sublime maybe
<graspee>
i tend to use gvim so i can select stuff with the mouse
arkx has quit [Ping timeout: 276 seconds]
<graspee>
i might be more inclined to keep my hands on the keyboard if i used qwerty
JStoker has quit [Excess Flood]
arkx has joined #ruby
<graspee>
i'll google sublime
<stewart_>
just another text editor but it's quite extendable
<stewart_>
if vim did not exist i would use that
<stewart_>
good ruby support too from memory
<graspee>
the minimap at the side reminds me of another ide that came out recently or was announced. the one that looks like a game interface
<stewart_>
I dont like it
<graspee>
hmm sublime is payware though
itnomad has quit [Quit: Leaving]
CheeToS has joined #ruby
simao has quit [Ping timeout: 245 seconds]
<stewart_>
yea i know… sucks because its just a nice skin for vim really but not as powerful
<graspee>
is it using vim ?
<stewart_>
that said if software is good i have no issue paying for it
<stewart_>
i dont think so but they have taken some design ideas from vim/unix world such as configuration via text files
<graspee>
$59!
<stewart_>
also they offically developed some vim handles to simulate vim key strokes
kpshek has joined #ruby
<graspee>
also "an upgrade fee will be required for sublime text 3"
<graspee>
it's not even lifetime upgrades
<stewart_>
well again if the software is good and is going to help me then I dont mind paying
<graspee>
there's so much free software though
<stewart_>
but I can understand why you would not like that
<stewart_>
yep
JStoker has joined #ruby
<graspee>
it just annoys me a bit when people use free software to build software that they then charge for
<Icehawk78>
Is there a good starting point for creating custom classes that can implement something akin to a before_filter/after_filter like Rails has support for?
Solnse has quit [Quit: Leaving.]
kpshek has quit []
crankyco_ has joined #ruby
libertyprime has joined #ruby
fulmato has quit [Remote host closed the connection]
chson has quit [Remote host closed the connection]
crankycoder has quit [Ping timeout: 248 seconds]
ZachBeta has joined #ruby
davidpk has joined #ruby
krusty_ar has quit [Ping timeout: 252 seconds]
TheHunter_1039 has joined #ruby
austinbv has quit [Quit: austinbv]
yoklov has quit [Quit: computer sleeping]
stkowski has quit [Quit: stkowski]
stkowski has joined #ruby
yoklov has joined #ruby
TorpedoSkyline has quit [Quit: Leaving]
dnyy_ has joined #ruby
dbgster has joined #ruby
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
x0F_ is now known as x0F
replore has quit [Remote host closed the connection]
nfluxx_ has joined #ruby
Kiirani has joined #ruby
nfluxx has quit [Ping timeout: 240 seconds]
dnyy has quit [Ping timeout: 244 seconds]
CheeToS has quit [Ping timeout: 245 seconds]
voodoofish430 has quit [Quit: Leaving.]
pu22l3r has joined #ruby
nfluxx_ has quit [Ping timeout: 244 seconds]
digitalcakestudi has quit [Remote host closed the connection]
Dreamer3 has quit [Quit: Leaving...]
araujo has quit [Quit: Leaving]
khakimov has joined #ruby
uris has joined #ruby
seanstickle has joined #ruby
pu22l3r has quit [Ping timeout: 250 seconds]
araujo has joined #ruby
araujo has quit [Changing host]
araujo has joined #ruby
looopy has quit [Remote host closed the connection]
c0rn has quit [Quit: Computer has gone to sleep.]
noodletraveler has joined #ruby
noodletraveler has quit [Client Quit]
nu7hatch has quit [Ping timeout: 250 seconds]
Araxia_ has quit [Quit: Araxia_]
Tref has joined #ruby
mrwalker has joined #ruby
brianpWins has quit [Quit: brianpWins]
noodletraveler has joined #ruby
looopy has joined #ruby
rodent` has joined #ruby
closedbracket has quit [Remote host closed the connection]
ZachBeta has quit [Quit: Computer has gone to sleep.]
prtksxna has joined #ruby
closedbracket has joined #ruby
khakimov has quit [Quit: Computer has gone to sleep.]
zinjacoder has quit [Read error: Connection reset by peer]
keanehsiao has joined #ruby
fbernier has joined #ruby
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
x0F_ is now known as x0F
Bartholomeae has joined #ruby
randym_ has joined #ruby
nlc has quit [Quit: Leaving]
zaiste_ has joined #ruby
jrgifford_ has joined #ruby
stkowski has quit [*.net *.split]
straind` has quit [*.net *.split]
jrgifford has quit [*.net *.split]
mneorr has quit [*.net *.split]
harukomoto has quit [*.net *.split]
fr0gprince_ has quit [*.net *.split]
davidboy has quit [*.net *.split]
lectrick has quit [*.net *.split]
Spaceghostc2c has quit [*.net *.split]
randym has quit [*.net *.split]
WalterN has quit [*.net *.split]
kinesis has quit [*.net *.split]
flagg0204 has quit [*.net *.split]
busybox42 has quit [*.net *.split]
Poapfel has quit [*.net *.split]
Kartagis has quit [*.net *.split]
crodas has quit [*.net *.split]
aetaric has quit [*.net *.split]
zaiste has quit [*.net *.split]
ByteCrunch has quit [*.net *.split]
irk3z has quit [*.net *.split]
wereHamster has quit [*.net *.split]
jrgifford_ is now known as jrgifford
randym_ is now known as randym
cordoval has left #ruby [#ruby]
friskd has quit [Quit: friskd]
Spaceghostc2c has joined #ruby
L-----D has quit [Quit: Leaving]
wargasm is now known as bnm
Facefox has quit [Ping timeout: 260 seconds]
lindenle_ has quit [Remote host closed the connection]
looopy has quit [Remote host closed the connection]
radic has quit [Disconnected by services]
radic_ has joined #ruby
radic_ is now known as radic
Poapfel has joined #ruby
stkowski has joined #ruby
straind` has joined #ruby
mneorr has joined #ruby
harukomoto has joined #ruby
busybox42 has joined #ruby
WalterN has joined #ruby
Kartagis has joined #ruby
flagg0204 has joined #ruby
kinesis has joined #ruby
aetaric has joined #ruby
crodas has joined #ruby
ByteCrunch has joined #ruby
irk3z has joined #ruby
wereHamster has joined #ruby
Kiirani has left #ruby [#ruby]
Facefox has joined #ruby
stephenjudkins has quit [Quit: stephenjudkins]
berserkr has quit [Quit: Leaving.]
lectrick has joined #ruby
crankycoder has joined #ruby
LBRapid has joined #ruby
davidboy has joined #ruby
albemuth has joined #ruby
mikepack has quit [Remote host closed the connection]
stefanp has joined #ruby
stefanp has quit [Changing host]
stefanp has joined #ruby
crankyco_ has quit [Ping timeout: 265 seconds]
stefanp_ has quit [Ping timeout: 265 seconds]
mvangala has quit [Remote host closed the connection]
sbanwart has quit [Ping timeout: 248 seconds]
queequeg1 has joined #ruby
<queequeg1>
[1, 2, 3, 4, 5].grep(/./)
<queequeg1>
I'm having trouble with the fact that that returns an empty array.
`brendan has quit [Quit: - nbs-irc 2.39 - www.nbs-irc.net -]
<queequeg1>
Can anyone explain to me why that happens?
fbernier has quit [Ping timeout: 276 seconds]
mrwalker has quit [Remote host closed the connection]
khakimov has joined #ruby
Tref has quit [Quit: Tref]
looopy has joined #ruby
savage- has joined #ruby
pkondzior has quit [Excess Flood]
pkondzior has joined #ruby
mikepack has joined #ruby
khakimov has quit [Quit: Computer has gone to sleep.]
<graspee>
because they are numbers?
mikepack has quit [Remote host closed the connection]
<queequeg1>
but shouldn't be caught by a dot? I thought . matches everything.
<graspee>
i'm a noob at these things, but looking at the documentation what you are doing there is trying to apply a regexp to numbers
<graspee>
if you surround the numbers with quotes it will return all of them
<graspee>
you can grep numbers but not with regexps i don't think
<graspee>
e.g. [1,2,3,40,100].grep(1..10)
<queequeg1>
I guess I hadn't really thought about regexes only being useful against strings.
albemuth has quit [Quit: Computer has gone to sleep.]
digitalcakestudi has joined #ruby
azm has joined #ruby
albemuth has joined #ruby
emmanuelux has quit [Ping timeout: 264 seconds]
simao has joined #ruby
AlbireoX is now known as AlbireoX`Away
imami|afk is now known as banseljaj
CheeToS has joined #ruby
simao has quit [Ping timeout: 245 seconds]
<graspee>
what are you writing anyway, queequeg1 ? or are you just experimenting?
c0rn has joined #ruby
harukomoto has quit [Ping timeout: 256 seconds]
kil0byte has quit [Read error: Connection reset by peer]
jonathanwallace has quit [Remote host closed the connection]
<graspee>
how are you finding them, difficulty wise?
<graspee>
i'm a bit of a noob so maybe i'll struggle
<queequeg1>
Mostly fairly easy, but they are really showing me where I'm weak.
<graspee>
hehe
<graspee>
you need an old chinese man who will force you to balance jugs of water and stand for a long time
<graspee>
then tap you with a stick and insult you
<queequeg1>
exactly.
<queequeg1>
Maybe Japanese.
<queequeg1>
either way.
<graspee>
"Your regular expressions are weak! How will we ever fight the dragon clan!?"
<graspee>
with my skill however, i'd be washing the dishes
<queequeg1>
"You code like a baboon with two club feet!"
looopy has quit [Remote host closed the connection]
Solnse has joined #ruby
<queequeg1>
So since you helped me a moment ago here is another: [1, 2, 3, 4, 5].grep(___, &:succ)
<queequeg1>
If grep only takes one argument, why are they putting two in there?
<graspee>
hmm.
<graspee>
let me consult the wisdom of the ether
<queequeg1>
heh
looopy has joined #ruby
<graspee>
what version of ruby are you using, and do you know what they are basing theirs on?
<queequeg1>
1.9.3
harukomoto has joined #ruby
<wmoxam>
queequeg1: grep can take a block
<graspee>
the pickaxe is not much help on the grep
oestrich has joined #ruby
phantasm66 has joined #ruby
phantasm66 has quit [Client Quit]
<graspee>
well it is
<graspee>
but it's not a long description
<wmoxam>
&:succ is shorthand for {|i| i.succ }
<graspee>
ah!
<graspee>
i'm making a note here
<queequeg1>
ah
<queequeg1>
I'm still getting used to that shorthand.
nfluxx has joined #ruby
<queequeg1>
I'm not sure why I'm having such a hard time with it.
<graspee>
i could see that it could take a block but it didn't explain to me why in queequeg1 snippet it had 2 params
azm has quit [Ping timeout: 250 seconds]
dbgster has quit [Quit: dbgster]
<graspee>
i'm a noob really. i shouldn't be let out of my cage
oestrich has quit [Client Quit]
<wmoxam>
a block is really just an argument
albemuth has quit [Quit: Computer has gone to sleep.]
<wmoxam>
ruby just supports syntax that makes it not seem that way
<queequeg1>
I see.
<queequeg1>
My kungfu is still weak.
<graspee>
you know how you see people who are so stupid you wonder how they can talk? and yet they do? that's like me and ruby. HOW am I managing it while knowing so little?!
<queequeg1>
I will have to setup some practice time to work on &:magic.
<graspee>
I think my trouble is I use some feature of ruby and then i forget it. I need to practice more so things become second nature
<queequeg1>
graspee, don't say that. If you are stupid and you just helped me, what does that make me? :-(
<graspee>
and this site could help me practice
<graspee>
well i just googled it and then ran it through my knowledge of languages generally
<wmoxam>
everyone starts out as a noob
<wmoxam>
I've been learning Ruby for a decade :p
<graspee>
wow
<wmoxam>
I should probably learn a new language
<graspee>
i started learning it with the 1e of the pickaxe then i wandered away into C and common lisp and also a bad bad desert time when i didn't program for ten years
<wmoxam>
but Ruby is just so darn fun
<queequeg1>
I'm working on it.
<graspee>
i'm determined to grow in knowledge!
<graspee>
i love you, ruby! we will succeed!
<graspee>
<dramatic music swells>
ipoval has joined #ruby
<wmoxam>
Get knowledgable or have a brain hemmorage trying!
kenneth has quit [Quit: kenneth]
wookiehangover_ is now known as wookiehangover
<queequeg1>
Hey wmoxam, can you help me with a hint? http://rubeque.com/problems/select-map The problem I'm having is that I need a pattern that will match both against digits /\d/ and against integers. Im perplexed.
<queequeg1>
I just need a pointer, I'm spinning my wheels. I'm happy to work for the answer, but I'm just not getting anywhere.
ciopte7 has quit [Quit: ciopte7]
rodent` has quit [Ping timeout: 245 seconds]
looopy has quit [Remote host closed the connection]
igotnolegs has joined #ruby
<wmoxam>
queequeg1: so the same pattern goes in both?
<queequeg1>
yeah
<wmoxam>
both blank spots
<wmoxam>
ok
<wmoxam>
so you need the odd numbers
<wmoxam>
hrmm
looopy has joined #ruby
t0mmyvyo has joined #ruby
PragCypher has quit [Ping timeout: 245 seconds]
rodent` has joined #ruby
PragCypher has joined #ruby
Tref has joined #ruby
mk03 has quit [Remote host closed the connection]
<queequeg1>
graspee: do you know about ruby koans?
<graspee>
but I got a syntax error. is the page broken?
<bnagy>
it's broken for me
<graspee>
and is the difference between "and" and "&&" something that was changed in 1.9?
<bnagy>
I can't even get the first problem to work
<bnagy>
no, not afaik, they've always been different
<graspee>
"blue" && "red" gives the same result as "blue" and "red" for me
<bnagy>
yeah it's a bit more subtle than that :)
digitalcakestudi has quit [Quit: Leaving.]
<graspee>
and the only difference mentioned by pickaxe is precedence
<graspee>
which has no effect in the example on the puzzle page
<looopy>
does ruby have anything on par with pythons twisted?
<looopy>
eventmachine??
<banisterfiend>
looopy: eventmachine is cool, we also have celluloid, but that's newer
<banisterfiend>
and more ambitious, afaict
<bnagy>
graspee: did you actually check?
<graspee>
check in what sense?
<graspee>
i ran it in pry
<bnagy>
in irb
<bnagy>
did you look at violets after you had assigned it?
<graspee>
hmm. no
<graspee>
wait. yes
chico has quit [Ping timeout: 276 seconds]
<graspee>
no
<graspee>
YOU MADE ME CONFUZZLED. i get it now though
deryl has joined #ruby
<graspee>
i was just looking at the return value
<graspee>
thanks
<looopy>
banisterfiend: ok, i'll admit my knowledge is rather limited when it comes to dealing with asynchronous issues..i've read a bit about eventmachine...some people say it's awesome..others say it's not...i'll take a look at celluloid as well
<banisterfiend>
looopy: what do the people who say it's not awesome say
<wmoxam>
gah, that rubeque site doesn't even accept the correct answers
<bnagy>
celluloid and EM are different patterns
<looopy>
banisterfiend: good question =P it was in rubyonrails and i unfortunately had to leave while they were discussing it.
amolpujari has quit [Read error: Connection reset by peer]
<bnagy>
although I'm not sure what 'on par with twisted' means, I don't think we have anything that confusing :)
amolpujari has joined #ruby
<looopy>
ahh! now that i'm looking at celluloid..was this inspired by akka by chance? I see they're using the actor model
<looopy>
i do toy with scala so this may be 'right at home' for me
WalterN has joined #ruby
c0rn has quit []
<bnagy>
what are you thinking of writing?
<bnagy>
only real issue with EM for me is that callback driven stuff rapidly becomes hard to maintain once the overall 'system' gets complex
mikepack has joined #ruby
<bnagy>
cascading callbacks
lkba has quit [Ping timeout: 260 seconds]
yxhuvud has joined #ruby
<banisterfiend>
bnagy: have you seen em-synchrony?
yxhuvud has quit [Read error: Connection reset by peer]
<bnagy>
banisterfiend: I think you've asked me this before :) No, I haven't worked with EM for 2 years+
<banisterfiend>
bnagy: also there's some nice libs that that wrap the deferrable api if that's what you're referring to
vitor-br has joined #ruby
yxhuvud has joined #ruby
<bnagy>
ahh is this what they built goliath on?
<bnagy>
that looks pretty sweet
<looopy>
bnagy: lol. at some point i was to to guarantee real time notifications and possibly...*this may be dumb* connect users similarities on the fly
<looopy>
really i just decided to play with python for amonth and worked through the tornado book...now i'm back to playing with ruby...i don't have any real solid ideas at the moment but i'm looking to toy around and familiarize myself with real time development
kil0byte has joined #ruby
<banisterfiend>
looopy: why didnt you stick with python out of interest?
<bnagy>
realtime and reactors make me nervous
pzol has quit [Ping timeout: 252 seconds]
lkba has joined #ruby
<looopy>
banisterfiend: to be honest i'm not sure I won't =) i didn't enjoy it when i tried it a few years ago though this past period of playing around i liked it a lot. i do like gems more than fighting with pip...
deryl has quit [Quit: weird that running /redraw makes text update right but irssi STILL is overwriting the last line]
jarjar_prime has joined #ruby
<looopy>
to be honest i can go either way but I'm more familiar with ruby.
xkx has quit [Ping timeout: 252 seconds]
pzol has joined #ruby
xkx has joined #ruby
Choobie has quit [Ping timeout: 252 seconds]
tomzx has quit [Ping timeout: 245 seconds]
ryanf has joined #ruby
<davidcelis>
looopy: eventmachine + ruby on rails == stack level too deep
<looopy>
davidcelis: ahh so it's more so that mixing those two *within the same project* is just a no no
davidcelis has quit [Quit: K-Lined]
wargasm has quit [Read error: Connection reset by peer]
tomzx has joined #ruby
lkba has quit [Ping timeout: 265 seconds]
Tref has quit [Quit: Tref]
c0rn has joined #ruby
andrewhl has quit [Quit: andrewhl]
thecreators has joined #ruby
Andrevan has quit []
avandenhoven has joined #ruby
wmoxam has quit [Ping timeout: 245 seconds]
deryl has joined #ruby
deryl has quit [Client Quit]
akem has quit [Ping timeout: 245 seconds]
uris has quit [Quit: leaving]
philcrissman_ has quit [Remote host closed the connection]
harukomoto has quit [Ping timeout: 245 seconds]
gtuckerkellogg has joined #ruby
<shevy>
looopy stick with python. once you can do all the bad things that ruby allows you to do (alias, omit (), avoid passing of implicit self), you'd feel constrained by python as a language
<shevy>
oh and mandatory whitespace indent
<looopy>
shevy: lol, that's what ran me away before though i can see the good in it as well nowadays.
defendguin has joined #ruby
<looopy>
shevy: very true...i worked partially through metaprogramming ruby and...eesh, "cool" but..it just seems like a lot of what they teach would make large projects confusing.
xnm has joined #ruby
<looopy>
i feel ruby has better testing tools..though i may be completely wrong?
ryanf has quit [Quit: broken pipes |||]
<banisterfiend>
looopy: probalby right, rubyists are obsessed with testing
noganex has quit [Ping timeout: 252 seconds]
<bnagy>
*some rubyists
<bnagy>
the sissy ones :P
Asher has quit [Remote host closed the connection]
<graspee>
my idea of testing is run it. does it work once? good enough for me! \o/
Asher has joined #ruby
<looopy>
bnagy: thank you for saying that...i actually went for a job interview as a junior dev and while at the time i'd written a few rspec and cucumber tests they ultimately wanted someone well versed and obsessed with testing. i figured it was something i simply missed out on being self taught.
deryl has joined #ruby
noganex has joined #ruby
mikeycgto has quit [Remote host closed the connection]
<bnagy>
I test stuff all the time, I just don't use these testy frameworks, cause afaict you can't say assert 'must run for 24 hours in a tight loop without leaking memory'
<shevy>
looopy hey I did not say anything about metaprogramming :) there are a few who think this is cool, so they praise it again and again in the ruby community. I usually end up telling the metaprogrammists that they are idiots
<bnagy>
metaprogramming is for nerds, or for when you need it :)
<Gavilan>
bnagy: actually, you kinda can....
<Gavilan>
shevy: I'm a metaprogrammist!
<Hanmac>
bnagy : attr_accessor is metaprogramming too
<shevy>
Gavilan can I see your code
<shevy>
nah
<shevy>
attr_accessor is not metaprogramming at all
<Gavilan>
shevy: what for?
<bnagy>
Hanmac: no it's not, the _implementation" is ;)
Targen has quit [Ping timeout: 245 seconds]
<shevy>
Gavilan I will only believe it if your project includes metaprogramming
simao has joined #ruby
<Gavilan>
shevy: it does... But I don't do Ruby...
emdub has quit [Read error: Operation timed out]
<shevy>
lol :)
ZifreCL has quit [Remote host closed the connection]
<shevy>
the first sign of metaprogramming is the use of *eval*
ping-pong has quit [Ping timeout: 252 seconds]
emdub has joined #ruby
timonv has joined #ruby
<bnagy>
not sure I can agree with that
<shevy>
Gavilan you really don't use ruby? :(
<Hanmac>
shevy you can do metaprograming with send too
* Hanmac
does meta programming with C
<shevy>
Hanmac, exactly! but .send and .method_missing is on the lower level... eval is very high on my list of signs of metaprogramming
<Hanmac>
eval is on MY list of no-go's
<shevy>
hehe
yonggu has joined #ruby
<shevy>
I need to find a project that combines eval send and method_missing
<bnagy>
\o/ I got one!
<Hanmac>
in 99% of the cases where eval is used an send would be better
<Gavilan>
shevy: I really don't use ruby, and I don't know anyone who likes metaprogramming as much as I do...
<bnagy>
shevy: I have a debugger wrapper which uses mm and send to wrap huge COM vtables, and I need to configure the debugger with analysis modules that it will run, but they have to be sent across the network
timonv has quit [Read error: Connection reset by peer]
avandenhoven has quit [Quit: avandenhoven]
timonv has joined #ruby
simao has quit [Ping timeout: 256 seconds]
<bnagy>
shevy: method_missing, send AND eval. wooo
<shevy>
waaaaaah
<Gavilan>
Hanmac: what about that?
<shevy>
Gavilan does not even program :(
<Hanmac>
its one of my c++ bindings for ruby ... look at the main.hpp
Prometheu5 has joined #ruby
<Gavilan>
Hanmac: what about that?
senny has joined #ruby
<shevy>
Gavilan do something useful, go learn ruby man
<Hanmac>
like my macros "macro_attr" it generates functions
<Gavilan>
Hanmac: so?
khakimov has quit [Quit: Computer has gone to sleep.]
<Gavilan>
shevy: why should I?
TheHunter_1039 has quit [Quit: TheHunter_1039]
ph^ has joined #ruby
<shevy>
Gavilan so that you can do something else other than ... do nothing
<Gavilan>
shevy: I do things other than ... do nothing...
Prometheu5 is now known as Prometheus
<Gavilan>
shevy: Just not in ruby :)
Prometheus has quit [Client Quit]
Prometheus has joined #ruby
<graspee>
why are you in #ruby then? speed dating?!
ananthakumaran has joined #ruby
<shevy>
and you never mentioned it so what language are you using
tonini has joined #ruby
<graspee>
my name is graspee i like spciy foods and recursion
<shevy>
Dream-Language 2.0?
<Hanmac>
let me guess ... Gavilan you are an PHP guy right?
<shevy>
\o/
<shevy>
long live PHP!
<shevy>
I used it 6 years ago too
<Hanmac>
shevy yeah chained in prision
mneorr has quit [Remote host closed the connection]
mneorr has joined #ruby
<shevy>
like rails :)))
<shevy>
though the other web frameworks in ruby feel a bit too lightweight
<shevy>
it would be nice to write one codebase, for example in ruby, a game
wvms has quit [Read error: Connection reset by peer]
<shevy>
and then "translate" this both into something like (a) use gosu for it (locally for the user) and (b) use a webframework (for a browsergame)
wvms has joined #ruby
<Gavilan>
Hanmac: http://pastebin.com/spqWPH7F this is more like it (I actually had a version that didn't repeated the types, but it as impossible to update/debug, so i simplified it a little)
<Hanmac>
shevy one of my teams we develop an GameEditor ... as client-server engine :P
ping-pong has joined #ruby
<Gavilan>
graspee: Just for the kicks....
<Gavilan>
shevy: I currently do C# and C++... I used to do Smalltalk...
<graspee>
a fine language
<Hanmac>
C++ is cool, but C# looks too much after an java with an C cloak
<Gavilan>
Hanmac: C++ sux...
<Hanmac>
not allways ... i think i tamed my bindings well ...
<Gavilan>
Hanmac: Can you create a full functional window without creating a single class?
<deryl>
like thats the definition of whether a language sucks or not
<Gavilan>
deryl: That's the definition of wheter it's a black box or white box framework... and white box frameworks usually sux :)
<deryl>
uh huh
<Hanmac>
Gavilan what class did you mean? in ruby i can, yeah because of my binding
<Gavilan>
hackeron: I mean that most GUI frameworks need you to subclass something to define events, or customize some things...
<Gavilan>
hackeron: and a good framework shouldn't need to do that, given that the GUI domain is pretty well defined/known, etc...
<Hanmac>
my wx ruby binding you need not, you can subClass it, but its only optional
<Gavilan>
Hanmac: good for you then :). Subclassing is evil... (Mixing even more evil)
davidcelis_ has quit [Quit: Leaving]
<Hanmac>
what i hate about C# is #region ... something that is only usefull in a edior shouldnt go into a language
<Gavilan>
Hanmac: I strongly disagre...
robacarp_ has joined #ruby
mdhopkins has joined #ruby
<Hanmac>
i dont disagre an option to group your code, but not as an "#" compiler directive
<Gavilan>
Hanmac: Who says # is always a compiler directive?
yoklov has quit [Quit: computer sleeping]
<Gavilan>
Hanmac: Have you ever used smalltalk by any chance?
td123 has quit [Read error: Connection reset by peer]
<Hanmac>
nope
cdepue has joined #ruby
td123 has joined #ruby
ryanf has joined #ruby
<Hanmac>
>> al.cpp:3:2: error: invalid preprocessing directive #xyz << it says somthing about directives
seanstickle has quit [Quit: Nihil sub sole novum]
dhaskew has quit [Read error: Connection reset by peer]
dhaskew has joined #ruby
greyEAX has joined #ruby
Haydos has quit [Quit: Leaving]
<Hanmac>
Gavilan: PS: nothing against mixins !! Enumerable is cool
robacarp_ has quit [Ping timeout: 244 seconds]
ananthakumaran has quit [Ping timeout: 244 seconds]
<Gavilan>
Hanmac: One of the few good things about C++, is that the stl separates algorithms & data structures...
<Gavilan>
Hanmac: Yes, if we don't count the #includes....
shevy has quit [Ping timeout: 244 seconds]
stewart_ has quit [Quit: Leaving.]
LBRapid has quit [Quit: Farewell...]
<Hanmac>
in ruby i only need one line and <50 chars ... show me what its takes less in c++
brianpWins has joined #ruby
youdontmeanmuch has joined #ruby
<WalterN>
heh
<WalterN>
can you manipulate pointers directly in ruby?
<WalterN>
:P
robacarp_ has joined #ruby
ananthakumaran has joined #ruby
robacarp_ is now known as Guest90717
<Gavilan>
Hanmac: in boost + stl you have all those functions
<Hanmac>
WalterN why should i do this? i can manipulate all objects directly in ruby, how cares about pointers? (ruby does not have pointers)
linus95014 has joined #ruby
<Gavilan>
Hanmac: Can you make a game with graphics as good as the witcher 2, that runs as fast as the witcher 2, in ruby? (in the same hardware that the witcher 2 runs now?)? Can you even get half of the FPS?
<Gavilan>
(in ruby)
<bnagy>
actually ruby does have pointers
<bnagy>
you get get a string pointer out of pack, for example, if you really want to
<bnagy>
although FFI is probably a better choice
Guest90717 has quit [Client Quit]
schovi has joined #ruby
Progster has quit [Ping timeout: 260 seconds]
<Hanmac>
ruby is not designed to be fast, but you get dynamic (you can use c++ parts to accelerate ruby)
<Gavilan>
Hanmac: C++ is designed to be fast...
<bnagy>
C++ was designed? I thought it grew under a rotten log
<WalterN>
HA
jhunter has quit [Ping timeout: 252 seconds]
timonv has quit [Remote host closed the connection]
<Hanmac>
ruby has method_missing and other cool stuff like send i dont think this works on C++
<Hanmac>
and in ruby classes and interegers are objects too
<test34->
in 10 years Ruby will be fast enough for most tasks (because hardware will be faster)
linus95014 has left #ruby [#ruby]
<Gavilan>
test34-: no, it won't....
<graspee>
with games though it's different
<bnagy>
if the jvm guys have their way it won't take that long
kil0byte_ has joined #ruby
<WalterN>
duck typing... C++ does not support
<graspee>
because what's acceptable in games is always what you can do closer to the hardware with c or c++
jhunter has joined #ruby
<graspee>
you can make games in ruby now that are as good as games you used to be able to make in c++ on older hardware
<bnagy>
yeah except that's crap
<Gavilan>
Objective-C has all the things you are mentioning, and it's also a lot faster than ruby...
<WalterN>
ObjC is a nice language too
<bnagy>
you don't need to write in C to get speed
<Gavilan>
bnagy: no, but you need manual memory management...
cdepue has quit [Ping timeout: 265 seconds]
phipes has joined #ruby
<bnagy>
yeah that's crap as well
shevy has joined #ruby
stkowski has quit [Quit: stkowski]
<Gavilan>
bnagy: no GCed language can compete with C++...
<Gavilan>
g2g, bye!
<Hanmac>
module MyModule; def xyz; p 'haha';end;end; true.extend(MyModule); true.xyz .... do something like this in ObjC
kil0byte has quit [Ping timeout: 260 seconds]
<banisterfiend>
Hanmac: you can do that in objc
<Gavilan>
Hanmac: 0wned!!! bye
Gavilan has left #ruby [#ruby]
<banisterfiend>
Hanmac: objc has 'class categories' that are exactly equivalent to monkeypatches
<banisterfiend>
bnagy: can u paste my comment, cos Hanmac is blocking me i think but he needs to know he's wrong
<banisterfiend>
:P
* Hanmac
wins ... and gets exp from that
akem has joined #ruby
akem has joined #ruby
<bnagy>
banisterfiend: sorry, I lost interest when it got stupid
sallybaby has joined #ruby
<sallybaby>
Hanmac: "module MyModule; def xyz; p 'haha';end;end; true.extend(MyModule); true.xyz .... do something like this in ObjC" < ---- you can do this in objc
cdepue has joined #ruby
<sallybaby>
Hanmac: objc has class categories that are more or less the same as monkeypatches
schovi has quit [Remote host closed the connection]
<graspee>
i think if someone blocks someone you should respect their decision rather than relaying messages
linus95014 has joined #ruby
djdb has joined #ruby
<sallybaby>
graspee: when the comment is relevant to teh conversation, and clearly not related to the subject of the block, then relaying messages only adds and does not detract from the discussion
pting has quit [Quit: Ex-Chat]
trung has quit [Excess Flood]
<Hanmac>
sallybaby does this works on ObjC too ? Object.instance_method(:to_s).bind([]).call
trung has joined #ruby
<graspee>
all this language rivalry stuff was just stirred up by Gavilan
macmartine has quit [Quit: macmartine]
<sallybaby>
Hanmac: can i call a superclass method on a subclass (which has that method overridden) ? Yeah.
<sallybaby>
savage-: that's the only use of the instance_method(blah).bind(instance).call pattern
<sallybaby>
Hanmac: *
maesbn has joined #ruby
cdepue_ has joined #ruby
cdepue has quit [Read error: Connection reset by peer]
<Hanmac>
maybe if i have a an inherit chain C < B < A .... can i call the method in A directy from C without going over B?
<Hanmac>
in ObjC
maesbn has quit [Remote host closed the connection]
<kenneth>
except i want to ensure that it's a subclass of Kenji::Controller, and return false otherwise
avandenhoven has joined #ruby
kaneda has joined #ruby
Eldariof-ru has joined #ruby
Seabass has quit [Read error: Connection reset by peer]
kaneda is now known as Guest98480
kil0byte_ has quit [Ping timeout: 252 seconds]
Seabass has joined #ruby
<bnagy>
kenneth: in general, Don't Do That
<bnagy>
as in test based on behaviour via respond_to? etc
<bnagy>
however, you might be looking for kind_of?
<kenneth>
hmm, i can't that's a fair point
<kenneth>
i guess that's*
Seabass has quit [Read error: Connection reset by peer]
c0rn has quit []
emmanuelux has joined #ruby
Guest98480 has quit [Read error: Connection reset by peer]
Seabass has joined #ruby
<bnagy>
like if someone extended your thing and made a different controller architecture etc etc (might never happen, but it's the philosophy that counts)
keanehsiao has joined #ruby
davidpk has quit [Quit: Computer has gone to sleep.]
<bnagy>
avandenhoven: ok... now can you paste the start methods around those linenumbers? I don't know if we're running the exact same net/http
<avandenhoven>
ah sure.
<bnagy>
although I think I do have a 1.9.3-head somewhere
igotnolegs has quit [Quit: Computer has gone to sleep.]
nfluxx has quit [Quit: nfluxx]
emmanuelux has quit [Read error: Connection reset by peer]
<avandenhoven>
I just updated the gist.
davidpk has quit [Quit: Computer has gone to sleep.]
petercs has joined #ruby
emmanuelux has joined #ruby
<avandenhoven>
Also its happening on a server that's _not_ using RVM so I think its not just a RVM thing
<avandenhoven>
it also happened with -p0
<bnagy>
well that's definitely potentially buggy
<bnagy>
like if there is no method that hits that grouping then $1 will be unset
<deryl>
its not an rvm issue. its a ruby issue, if there is one at all. rvm does nothing but automate the compile+install, and then set the env vars needed for that particular ruby
test34 has joined #ruby
<deryl>
and throw in some dirs for/if you use gemsets
tomzx has quit [Ping timeout: 276 seconds]
<bnagy>
avandenhoven: quick fix is to do key = $1.to_sym rescue next
simao has joined #ruby
<bnagy>
but I have no idea what is causing the bug...you could inspect http.methods before the call to grep
<avandenhoven>
bnagy: sure but its standard lib.. and it no different than 1.9.2
<avandenhoven>
it feels… creepy… to monkey patch it.
test34- has joined #ruby
test34- has quit [Changing host]
test34- has joined #ruby
<bnagy>
well I dunno what changed from .2 -> .3 that would affect that code, but it would be nice to understand the bug :)
<avandenhoven>
bnagy: whats stranger is that the loop should never be entered, if grep doesn't find anything.
ph^ has joined #ruby
davidpk has joined #ruby
test34 has quit [Ping timeout: 272 seconds]
simao has quit [Ping timeout: 245 seconds]
davidpk has quit [Client Quit]
aakashvd has joined #ruby
aakashvd has left #ruby [#ruby]
<bnagy>
avandenhoven: yeah but it can match without matching the grouping
davidpk has joined #ruby
<bnagy>
oh shit wait...no it's + not *
<avandenhoven>
I think its something else.
<avandenhoven>
I did this in IRB:
<avandenhoven>
1.9.3p226 :001 > x = "test"
<avandenhoven>
=> "test"
<bnagy>
I think the behaviour of $1 changed
<avandenhoven>
1.9.3p226 :004 > pp $1
<avandenhoven>
1.9.3p226 :005?> pp meth
<avandenhoven>
1.9.3p226 :006?> end
<avandenhoven>
=> []
InBar has joined #ruby
InBar is now known as Prz_^
<avandenhoven>
no brain fart. I should have seen something.
looopy has quit [Remote host closed the connection]
<kenneth>
oh, hmm. how would i do this, then?
<Hanmac>
because respond_to need be called on the instance, not the class
<kenneth>
ah
<Hanmac>
controller_class.method_defined?(:call)
<bnagy>
wth is to_camelcase?
<kenneth>
aha
<kenneth>
bnagy: something i mixed into string
CheeToS has quit [Ping timeout: 256 seconds]
Guest54524 has joined #ruby
<kenneth>
to convert between between CamelCase and underscore_separation
emmanuelux has quit [Ping timeout: 264 seconds]
<Hanmac>
bnagy its maybe rails thing :P
<bnagy>
method_defined? doesn't distinguish between class and instance methods?
<kenneth>
i don't use rails, luckily for my sanity
wilmoore has quit [Remote host closed the connection]
<bnagy>
kenneth: if I were maintaining that coe I would be mad at you
<kenneth>
i probably should refactor it
<bnagy>
for to_camelcase :P
gregorg_taf has quit [Changing host]
gregorg_taf has joined #ruby
<bnagy>
it's just split('_').map(&:capitalize).join, right?
gregorg_taf is now known as gregorg
<bnagy>
I mean how often are you typing it? :)
wilmoore has joined #ruby
<kenneth>
bnagy: actually that's exactly what it is
apeiros_ has joined #ruby
looopy has joined #ruby
<kenneth>
except i've never seen this syntax before (&:capitalize)
<kenneth>
oh, other question, does attr_accessor not work on children? my superclass has attr_accessor :kenji, but on the subclass i'm getting undefined local variable or method `kenji' for KudosController:Class
<bnagy>
succint format for stuff where you're running a simple method on blockvars
<apeiros_>
kenneth: you're calling it on the class, not an instance of it
<apeiros_>
attr_accessor defines instance methods
<avandenhoven>
bnagy. this is f'd up. On a whim, I recreated the behaviour of HTTP.Start in rib… and $1 is what you'd expect
<avandenhoven>
Net::HTTP.new('http://www.google.com', 80).methods.grep(/\A(\w+)=\z/){ |w| p $1 }
jcromartie has quit [Read error: Connection reset by peer]
<bnagy>
avandenhoven: patch the existing code, already! :)
jcromartie has joined #ruby
<Hanmac>
kenneth: then do this: controller_class.instance_methods.include?(:call)
<apeiros_>
there's no need to do a linear lookup when you can do a direct one
schovi has joined #ruby
odinswand has joined #ruby
<lolmaus>
If arithmetic opeartors are method calls, does Ruby have some sort of special case for deciding on the order of arithmetic operations?
<apeiros_>
lolmaus: yes. if you use the syntax sugared way of calling the methods, ruby uses precedence rules
<apeiros_>
i.e., * before + etc.
brianpWins has joined #ruby
<Hanmac>
bnagy: File.new('foo').method(:join).owner #=> NameError: undefined method `join' for class `File'
asdfqwer has joined #ruby
<lolmaus>
apeiros_, but if i use the bulky syntax, it would use normal method call order?
<asdfqwer>
working through koans atm
<apeiros_>
lolmaus: yes
<bnagy>
3.+(4)./(2) => 3
<asdfqwer>
why does this array array = [:peanut, :butter, :and, :jelly]
<apeiros_>
3 + 5 * 4 != 3.+(5).*(4)
kil0byte has quit [Ping timeout: 260 seconds]
<asdfqwer>
evaluate as [:and, :jelly] for array[2,2]
<bnagy>
Hanmac: yeah we already established all this :) It's jruby something
codespectator has quit [Quit: Computer has gone to sleep.]
<apeiros_>
asdfqwer: why should it not? what did you expect?
<lolmaus>
apeiros_, bnagy: thx
<bnagy>
asdfqwer: what did you expect?
<asdfqwer>
:and
<bnagy>
that [2..2]
<asdfqwer>
oh wait
<bnagy>
*that's
<asdfqwer>
i expected nil
<apeiros_>
asdfqwer: reading the docs would have helped… it's array[offset, length]
<asdfqwer>
oh
<asdfqwer>
thanks
<bnagy>
ok if you expected nil then I really can't help you at all :)
<apeiros_>
you ask for 2 elements starting from the 3rd. 3rd element is :and.
<asdfqwer>
didn't know there were parameters
<apeiros_>
o0
mdw has joined #ruby
<rippa>
maybe he expected array[2][2]
<rippa>
as in, multidimensional array
<bnagy>
yeah but that should be nomethoderror
tobym has quit [Remote host closed the connection]
<apeiros_>
I'll never get why people don't read the docs when a method doesn't do what they expect
<avandenhoven>
bnagy I found something… interesting
<apeiros_>
seems like the logical next step
<asdfqwer>
i was treating it like ranges
<bnagy>
asdfqwer: why did you expect nil?
<asdfqwer>
because i tought they were like index ranges
<bnagy>
asdfqwer: ok but [2..2] should still be :and, right?
<asdfqwer>
which derp happens to be the next koan
<asdfqwer>
yes
<kenneth>
okay, so i'm pretty much done rewriting my mvc framework from scratch
<avandenhoven>
bnagy: I added http.methods.grep(/\A(\w+)=\z/){ |m|
<avandenhoven>
puts "*"*80
<avandenhoven>
puts m
<kenneth>
halved the lines of code :)
<avandenhoven>
p $1
<avandenhoven>
p $1.to_sym
<avandenhoven>
}
<avandenhoven>
to my monkey patch and its choking on open_timeout=
<bnagy>
asdfqwer: by the way, when you discover that a[4,1]==[] and a[5,1]==nil, IT IS NORMAL
<bnagy>
avandenhoven: ok weird
<avandenhoven>
yes
<cjk101010>
hm… I'm running a slow query with Rails 3.2 on postgresql. this results in a query EXPLAIN SHOW max_identifier_length which leads to a syntax error
<cjk101010>
how can I prevent AR on running this query?
<cjk101010>
*from
<bnagy>
cjk101010: you might want #rubyonrails
<cjk101010>
ok, thanks :)
JohnBat26 has quit [Remote host closed the connection]
chienpo has left #ruby [#ruby]
<bnagy>
avandenhoven: so when you inspect meth it's open_timeout= and $1 is nil, or what?
<avandenhoven>
yeah
krz has quit [Quit: krz]
<bnagy>
wtf
<bnagy>
can you inspect http.methods before the block as well, and add the output to that gist?
odinswand has quit [Quit: Computer has gone to sleep]
Vainoharhainen has joined #ruby
thecreators has quit [Quit: thecreators]
<Seabass>
anyone here like me learning Ruby so they can try to begin to start to think about trying to make Final Fantasy Tactics type game with RPG Maker?
<fowl>
all those tools will do is hold you back, you will gain a lot from writing the game yourself
<Seabass>
fowl, it is true I would like to have full use of my own engine
<apeiros_>
iirc rpg maker has some serious limitations on how you can use ruby. which is sad.
<robert_>
http://codepad.org/mkx3P4tx <-- why is GenericAddin still having it's methods called from FooAddin?
mneorr has quit [Remote host closed the connection]
yonggu has quit [Remote host closed the connection]
emmanuelux has joined #ruby
yonggu has joined #ruby
<robert_>
banisterfiend: hai
<robert_>
shevy: still here? :p
<banisterfiend>
robert_: sup
<robert_>
nada. wondering why my code doesn't appear to call the derived methods.
<Seabass>
shevy was on earlier
<robert_>
yeah
mucker has quit [Ping timeout: 276 seconds]
mucker has joined #ruby
chson has joined #ruby
bluenemo has quit [Read error: Operation timed out]
<kenneth>
apeiros_: yeah, one of the things that drove me to write this. i wish more people emphasized that approach
<apeiros_>
kenneth: working on something similar. not very seriously, though
<apeiros_>
currently mostly on the client side and the issue of decentralized data generation
pdelgallego has joined #ruby
hoelzro|away is now known as hoelzro
<apeiros_>
(offline mode)
macer1 has joined #ruby
<avandenhoven>
bnagy: I'm going to have to call it a night soon (its 0130 over here) I'll update the gist as I find interesting things (and very little seems interesting, at this point).
<robert_>
anybody?
<bnagy>
avandenhoven: cool
macer1 has quit [Changing host]
macer1 has joined #ruby
brianpWins has quit [Quit: brianpWins]
<kenneth>
yeah. i'm more focused on the back-end side, since i'm more of an architect. the idea is making good architecture one kenji-init away
MissionCritical has quit [Ping timeout: 272 seconds]
<robert_>
I'm not at all sure why my class hierarchy doesn't appear to work.
<apeiros_>
kenneth: so how do you deal with the offline-mode aspect?
<kenneth>
it takes surprisingly little code to make kenji work actually. something like 200 lines or so
<kenneth>
right now, i don't. i leave it up to the user to find a client-side architecture that will deal with the problem, written by people smarter than i am
<apeiros_>
hm, ok. I think it'd be crucial for such a framework, to offer that kind of functionality
<kenneth>
yeah probably
<apeiros_>
kenneth: btw., why inheritance?
<apeiros_>
why not use a module based approach with extend/include?
<kenneth>
not sure, didn't really occur to me. i guess it would have worked practically the same way?
<apeiros_>
yes, but opening up more possibilities :)
Edijus has joined #ruby
Luisa has joined #ruby
nkbuff has joined #ruby
<avandenhoven>
bnagy: I've updated the gist with the results (btw, adding rescue next just moves the error some place else)
<avandenhoven>
I'm off.
nkbuff has quit [Client Quit]
avandenhoven has left #ruby [#ruby]
<Edijus>
Hello. I am writing program for building construction company (they mainly do decoration/small work) for my school project. I need my program to have database, because it is requirement. Any ideas what to store in the DB? Don't offer book-keeping stuff, since I did it last time. Thanks
<kenneth>
apeiros_: like what? (i'm curious, not that intimately familiar with ruby. i wrote mostly php and objective-c for work)
tatsuya_o has joined #ruby
<apeiros_>
arbitrary base-classes
<kenneth>
ah yes
<kenneth>
that makes sense
<kenneth>
well, should be easy enough to refactor, i think
<bnagy>
Edijus: was that a ruby question, or a 'what kind of things can I put in a DB' question?
<Hanmac>
apeiros_ with rubys module based system its possible that one ruby objects is multible c++ objects at the same time :P
<Edijus>
bnagy: Second one. I do not know where to search for help.
<phipes>
i have a modular sinatra app, which has a config.ru and a separate file that contains: puts …, i want to see the output in the terminal but i don't know how
<bnagy>
Edijus: ok do an inventory system or something, then, they're pretty easy
Mission-Critical has joined #ruby
workmad3 has joined #ruby
greyEAX has quit [Read error: Connection reset by peer]
bluenemo has joined #ruby
ryanf has quit [Quit: leaving]
mucker has quit [Read error: Connection reset by peer]
greyEAX has joined #ruby
Mission-Critical is now known as MissionCritical
bluOxigen has quit [Read error: Connection reset by peer]
bluOxigen has joined #ruby
vjt has quit [Ping timeout: 272 seconds]
zv has joined #ruby
nilg has quit [Remote host closed the connection]
ciopte7 has quit [Quit: ciopte7]
netogallo has quit [Ping timeout: 245 seconds]
dzhulk has quit [Quit: Leaving.]
<shevy>
robert_ heya, was at university, just got back
Luisa has left #ruby ["Sto andando via"]
<robert_>
aha. :D
<robert_>
shevy: http://codepad.org/mkx3P4tx <-- any idea why GenericAddin is still having it's methods called instead of FooAddin's re-definitions? :/
<shevy>
hmm
<shevy>
I am surprised you define @ivars in a module!
<robert_>
yeah I borrowed some of it
<robert_>
and now I'm making it my own, heh
<shevy>
lemme first try to understand what's going on...
<robert_>
shevy: if you've got a better pattern, then I'll use it. How would you implement dynamically-registerable add-ins that can choose register as a part of one (or more) categories?
etehtsea has quit [Ping timeout: 240 seconds]
<shevy>
robert_ dunno. I dont even understand the question :) I would probably keep one @ivar in my class to deal with these add-ins. I think it would be easier to see how such a plugin would look like
piotr__ has joined #ruby
<shevy>
and what it wants to add or modify where
piotr_ has quit [Ping timeout: 276 seconds]
<robert_>
okay, but isn't that what the module (again, I lifted his idea.. not sure if I like it yet) is supposed to work?
<robert_>
the issue is that when I .new my object instance, I get basically a copy of the base plug-in interface
bglusman_ has joined #ruby
bglusman has quit [Read error: Connection reset by peer]
<kalleth>
C-a C-z C-p S-a C-xCA-a *goes to A&E to fix broken claw hands*
<Tasser>
kalleth, let's say, ruby-mode on emacs sucks compared to ruby in vim :-/
pdelgallego has quit [Client Quit]
<kalleth>
Tasser: i've never used it, i'm being facetious
jackiechan0 has joined #ruby
<Seabass>
shevy well I hope the color will help me figure out how to make my program run like it did after making that while loop a method
<shevy>
gvim is semi-ok, my biggest problem with vim is that a new user has to learn so much
<kalleth>
yeah, shevy, i hate that
<shevy>
Seabass 100% it will!
<kalleth>
it means I can't seriously suggest people use vim :(
gilead has joined #ruby
<kalleth>
Seabass: when your code is all green, that means you missed a "
<kalleth>
just sayin'
<Tasser>
kalleth, evil is fine, org-mode is awesome :-)
<kalleth>
Tasser: *shrug* VimOutliner
<Seabass>
i want more colour contrast on notepad++ to show more
<shevy>
Seabass btw another editor is geany. while they still are not really top-quality, they are quite active, also on IRC #geany and they always help. it has a few "missing features" though, but it is for sure better than simple notepad alone - here is how it looks on windows http://www.geany.org/uploads/Gallery/geany_win32.png
<Seabass>
more syntax or elements
<shevy>
it looks better on linux, one of the few that does ... :P
<Tasser>
kalleth, are the export options as fancy as for emacs?
<shevy>
another editor that looks nice visually is sublime
<robert_>
I actually do need it. I remembered I'm working on a project that I need to deploy add-ins for and I don't want to mess up the design, lol. (sorry, I'm out of it right now)
<shevy>
and redcar is an editor written in ruby (but requires java)
<kalleth>
Tasser: *shrug*
<kalleth>
i use it for checklists
<kalleth>
thats pretty much it
<Tasser>
I use it for presentations, that's why
<kalleth>
wait, what
<shevy>
cool
<shevy>
presentations in vim?
<Tasser>
shevy, nah, emacs -> beamer -> okular
<shevy>
ah
fermion has joined #ruby
<shevy>
I see I see
<Seabass>
lol, newcomer asks for advice, IDE flamewars begin
<Tasser>
Seabass, I wouldn't say vim/emacs is an ide
<kalleth>
i properly don't give a flying
<kalleth>
yeah
<shevy>
Seabass, the thing to remember about vim vs. emacs is that in the end both suck
<Tasser>
kalleth, but I have to fully agree with anyone who says the editor in emacs sucks :-)
<Seabass>
rofl, you guys crack me up
noodletraveler has quit [Ping timeout: 260 seconds]
<shevy>
emacs is a good OS
<kalleth>
if i desperately wanted an IDE with step-through debugging i'd look at rubymine or netbeans (possibly)
<Tasser>
it's an application framework
<kalleth>
if i wanted to edit text files, i'd use vim
<kalleth>
and if i didn't use vim, i'd use sublime
kawa_xxx has joined #ruby
<Seabass>
i got notepad++, used to use it for HTML, and now i remembered it, so it was the first thing I grabbed
<shevy>
not emacs kalleth ?
<kalleth>
shevy: :p
<graspee>
sublime is $59
<kalleth>
we had 1 dev on our 5 person team
<kalleth>
who used emacs
<kalleth>
everyone else was vim
<kalleth>
removing the 'apt-get install emacs' from the dev mode build scripts was awesome when he left
<shevy>
Seabass, well... I think the most important feature about an editor is to not be annoying... and the second most important feature is proper syntax highlighting
<kalleth>
interestingly, it freed up about 170 meg on the built image ;)
<shevy>
then some more features I want to have are... - tabs ... - ability to search (and replace) easily
<Tasser>
kalleth, dev mode build scripts? TRAMP?
<shevy>
- ideally being able to redefine keybindings in any way I see fit
<Seabass>
shevy, i feel the same way, and notepad under windows accessories wasn't cutting it
<kalleth>
Tasser: i'm going to have to look that up, sec
<shevy>
sublime looks nice visually
Solnse has quit [Read error: No route to host]
<kalleth>
TRAMP: "Transparent Remote (file) Access, Multiple Protocol", a software package allowing remote file-editing in an Emacs-style environment
<kalleth>
that what you mean, Tasser ?
<shevy>
it confused me a little though when I tried it, dont know why. my workflow in ruby is really strange... even vim confuses me
berserkr has joined #ruby
<kalleth>
my workflow in ruby is ggVG=wq
<Seabass>
i wish pastie had a editor to download
<Seabass>
I really like the highlighting there
<shevy>
yeah kalleth ... vim is in your brain
<Tasser>
kalleth, gg=G ?
noodletraveler has joined #ruby
<kalleth>
Tasser: that works too
<shevy>
for me, vim is not yet in the brain, it is somewhere else
<Seabass>
I get the feeling gg=G is a local meme/inside joke here
jbw has joined #ruby
<kalleth>
no, vim commands, Seabass
<shevy>
Seabass, vim kinda uses keys as instructions... I dont know what this does but I think it selects-all or something like that
<kalleth>
gg is 'top of file'
<shevy>
Seabass, dd10 for instance deletes 10 rows in vim
<Tasser>
Seabass, move to the beginning of the file, reindent the next move, move to end of file
<kalleth>
=G is autoindent to the end of the file
<graspee>
is there a way of getting sublime to match parens in a different way than just underlining them?
<shevy>
yeah, I can never remember all those keybindings
SPYGAME has joined #ruby
<Tasser>
shevy, mussle memory
<kalleth>
ggVG is go to top of file, shift-V is visual select, G is to end of file, then = is highlight selected
<kalleth>
muscle memory being why i use ggVG= rather than gg=G
<shevy>
Tasser hehe I think I am too old now :( it was easier when I switched to linux
<Tasser>
shevy, you're never too old ;-)
<kalleth>
i wouldn't say that
<shevy>
:)
<shevy>
I've become much more conservative
<Seabass>
=( shevy Fight.battlecalc(player1, player2) won't work either. I'm just trail and erroring different combinations of class.method or method.new.class lol
<Tasser>
needs less energy?
<shevy>
I try to learn only a little bit, and rather spend more time improving the little things I already know
PragCypher has quit [Read error: Connection reset by peer]
<kalleth>
i was coding round my father the other day and he was all like
<shevy>
yeah Tasser that too, but also because often enough things can be frustrating
trivol has joined #ruby
<kalleth>
'what are you doing, hacking the planet?'
<Seabass>
I didn't that like that one "You stand at the precipice of a great cliff, what do you do next?"
<shevy>
most written in C or C variant, none really in ruby
<shevy>
:(
<graspee>
the answer is of course "toss myself off"
<shevy>
Seabass, "I scratch my ass and wonder about the world."
<workmad3>
shevy: mostly because they were written before ruby was released :P
<Seabass>
shevy maybe I'll help fix that shevy
<bnagy>
shevy: woo LPC, like C but fucked-er
<shevy>
yeah bnagy
<workmad3>
at least, all the famous ones were
<Seabass>
seems like I've started on a basic text-based adventure already shevy
<workmad3>
(it's hard to get a famous text adventure nowadays)
<graspee>
vim is a text adventure
<Mon_Ouie>
Hanmac: Here's an example of transliterating: Iconv.iconv("ASCII//TRANSLIT", "UTF-8", "été") # => ["ete"]
<shevy>
though LPC was kinda nice in that you could call methods on objects in some way... clone("/std/humanoid/orc")->move("/village/pub")->command("kill human");
<Seabass>
i remember that word from french class
petercs has quit [Ping timeout: 276 seconds]
mlevin_ has joined #ruby
<shevy>
Seabass, ged (from #ruby-lang) wanted to start faerie-mud years ago, they had a really cool concept and wanted to use ruby
<shevy>
but it kinda died more or less too
<shevy>
oops
<bnagy>
shevy: write a mu* in celluloid :)
<shevy>
he is here too!
nfk has joined #ruby
<shevy>
on #ruby
<shevy>
:)
gtuckerkellogg has quit [Quit: Computer has gone to sleep.]
<graspee>
it was the olympics but which one? i think 2000
gilead has quit [Quit: Leaving]
<Seabass>
ROFL
<shevy>
really that long ago??
<graspee>
yes
<graspee>
see i'm an op in that quote
<graspee>
back when i had POWER and INFLUENCE
<shevy>
man
<shevy>
around that time, 2000... i was on windows, mIRC and galaxynet with Singaporeans
<shevy>
and we played classic browsergames!
wataken44 has quit [Remote host closed the connection]
<graspee>
that quote is from #honobono the anime channel on aniverse, although we might have been on a different server at that time
<shevy>
hehe
wataken44 has joined #ruby
<kalleth>
no results for me
<kalleth>
=[
<shevy>
not everyone makes it to immortality kalleth
<shevy>
digital immortality that is
<kalleth>
i did
<kalleth>
i went to a lan like
<kalleth>
ten years ago
<shevy>
hehe
jackiechan0 has joined #ruby
<kalleth>
i was 16, and then my clanmates started feeding me mucho alcohol
<shevy>
why is it that all the legendary tales happened +10 years ago!
<Seabass>
shevy my program doesn't work anymore :(
<kalleth>
long story short, there are pictures of me lying facedown in mid-projectile on the internet
<kalleth>
which are still cockblocking me today
<graspee>
it was a time of awesome pc games
<shevy>
Seabass can you put the full, current program on pastie.org
<shevy>
graspee yeah
<kalleth>
Tribes ascend is pretty damn good
<shevy>
graspee I failed to transition to the new games of today :(
<kalleth>
and NS2 looks good
<kalleth>
BF3 is ok for a laugh
<kalleth>
but new games nowadays are all about LETS MAKE THE MOST MONEY AND OFFER PROGRESSION AND LEVELUP AND ETC
<shevy>
I played up until around 2004-2006 ... Warcraft 3, Diablo II ... but I never went into the world of warcraft hype, around that time I played less and less and less
<Seabass>
shevy I think it's really a matter of me not understanding the change you asked me to make
<kalleth>
rather than "lets make something that's got insane replay value and is properly fun to play"
<graspee>
i think games are great now too
<shevy>
Seabass, that is ok, can you put the code online
<bnagy>
kalleth: I dunno, nintendo games are still fun
rushed has joined #ruby
<shevy>
graspee, I dunno... they all seem to be more and more 3D graphics... and that's it
<bnagy>
just that you don't get to kill stuff all that much
<graspee>
minecraft, terraria, MW3 (despite what ppl say)
<Seabass>
shevy I moved it to battlecalc round = 1 that is
<shevy>
Seabass yeah. that is another solution that works too. you have to decide what is better. I think putting round into the same logic part where the while-loop is, is the better solution, so I agree with you
<shevy>
ged yeah! more!
* ged
falls back asleep in his rocking-chair.
<shevy>
hehehe
<kalleth>
ged: when you were a young warthog?
* kalleth
moviequotes.sh
<Seabass>
shevy simple mistake, simple fix, rofl, had me stumped
<kalleth>
Seabass: happens to us all more frequently than any of us would admit
<shevy>
Seabass yeah. dont worry, those are simple errors that can be discovered in a few seconds and fixed
<kalleth>
or maybe that's just me ¬_¬
<bnagy>
Seabass, shevy, imho Fight shouldn't exist as a class, attack( other ) should be a method on Player
<shevy>
it gets harder to fix something when looking at it years later
<kalleth>
s/harder/impossible
<kalleth>
at least with my old PHP code
<bnagy>
and roles should probably be modules, I'd say
BiHi has quit [Ping timeout: 245 seconds]
<kalleth>
'i wrote this? fuck that, rewrite entire app in rails in 2nights'
<Seabass>
bnagy I don't know what modules are yet
<kalleth>
Seabass: like classes but can't be instantiated
<kalleth>
so actually they're nothing like classes
<kalleth>
namespaces, basically
<Seabass>
instantiwhatit?
<shevy>
modules are like a bag with a name on them
<kalleth>
...never mind
<shevy>
like the bag "I have candy"
<Seabass>
I like candy
<shevy>
and the bag "I have a cat here"
<Seabass>
I like cats
<shevy>
although... they dont really contain much
<Seabass>
oh...
<shevy>
perhaps they are more like "ticket for one candy"
<bnagy>
well, in this case you would have a Player class with basic methods, but then have like a Wizard module which you could mix in that would add mana as a stat and let you cast spells
<shevy>
so you can find a candy and use that, when you find it
<shevy>
(i.e. you can include a module into your class Seabass)
<bnagy>
so you could multiclass by just mixing in more class modules
<shevy>
class Foo; include Candy; end
<kalleth>
shevy: the only example calls i can think of to a module are factory-pattern-esque, and that's a terrible, terrible example ;(
<kalleth>
but inclusion is actually awesome
<shevy>
yah well... I like classes more than modules. I can do awesome things with classes!
<Seabass>
what shevy said
sspiff has joined #ruby
tresk has left #ruby [#ruby]
<shevy>
Seabass, what projects often use is a common module for namespace
<bnagy>
Seabass: shevy has at least written enough ruby to have an opinion, even if he's wrong :)
<Seabass>
namespace?
<shevy>
like, you have a project called "foo", so usually the lowest namespace would be Foo
<shevy>
btw bnagy do you know of a way to regroup a class, into a specific module/namespace?
clockwize has joined #ruby
wvdschel has quit [Ping timeout: 240 seconds]
<bnagy>
at runtime?
<shevy>
like I have class Foo, but not residing in a module. I want to have it live under module Bar at run time
<shevy>
yeah
<Seabass>
So Module > Class > method > var
<bnagy>
ew
<shevy>
if not, no problem. I will bug the mailing list
<bnagy>
can you just add it as a constant?
<bnagy>
banisterfiend knows all this crap
<shevy>
hmm I think so
<Seabass>
shevy my program works just fine :)
<Krikke>
hey, I'm going to implement a debrief chat feature to our game's web service, can you point me to some chat gems or similar tech (I looked into jschat gem but it was 2 years old and used prototype)
<bnagy>
const_set should work?
<ged>
Bar.const_set :Foo, klass
<shevy>
Seabass, it can be a bit more complicated than that though
<shevy>
Seabass, you could also do this here: class Foo; class Bar
<Krikke>
13:46:24 < shevy> yeah
<Krikke>
13:46:28 < Seabass> So Module > Class > method > var
<Krikke>
13:46:34 < bnagy> ew
<Krikke>
13:46:59 < shevy> if not, no problem. I will bug the mailing list
<Krikke>
13:47:01 < bnagy> can you just add it as a constant?
<Krikke>
13:47:12 < bnagy> banisterfiend knows all this crap
<Krikke>
oops
<shevy>
thank you Krikke ;)
<Krikke>
misclicked
<shevy>
not sure I know of a chat gem, sorry. perhaps someone else does
<Seabass>
bnagy I think it will be a good to try and rearrange the logic of my program to fit what you are saying to help understand the syntax better
<Krikke>
ok, thanks
<shevy>
anyway Seabass dont let that confuse you for now, just keep it in mind. much simpler to think of modules as a way to namespace, to group things together
<Seabass>
bnagy attack ( other ) as method of Player
<shevy>
Seabass, for instance, without namespace. if you write "def foo", and someone else writes "def foo" too, then there would be a problem
<Seabass>
shevy like a directory foulder?
<shevy>
in a way yeah
<shevy>
but if you write in module A, and the other guy writes in module B, then these would be two different foo
<bnagy>
shevy: my modules idea for this isn't really about namespacing
<shevy>
(same with a class)
<bnagy>
it's about adding a skillset and possibly unique stats to a base Person class
tresk has joined #ruby
<Seabass>
shevy they could all same names for everything but it wouldn't get confused because they are seperated
jonathanwallace has quit [Remote host closed the connection]
<shevy>
yeah
<bnagy>
so harry=Person.new; harry.extend( Wizard ) # YER A WIZARD, HARRY!
<shevy>
<JonJonB> He bent down and pulled his wang out of the troll's nose. It was covered in what looked like lumpy gray glue.
<ged>
Include is, but not extend.
Helius has joined #ruby
<kalleth>
yeah, but then you just do harry.send(:include, Wizard)
<kalleth>
;)
<kalleth>
and, after the ruby gods stop screaming at you
<shevy>
hmm
<kalleth>
he's still a wizard
<shevy>
does this work in 1.9.x too? the .send one
<shevy>
why are we talking about harry :(
ddv has quit [Client Quit]
<hemanth>
vectorshelve, gem install cadbury; cadbury #eat all the gems :D :P
mischief has joined #ruby
<kalleth>
hmm, i guess it doesn't, shevy
<kalleth>
i thought you could override with 'yes, really do this'
<kalleth>
with an extra arg
<Seabass>
I barely know anything about ruby, but I was planning on having a global var that is a hash of hashes that are an index of stats and equipment and the equipment would be hashes also with indexes of stats
KL-7 has quit [Quit: This computer has gone to sleep]
<bnagy>
Seabass: stats and equipment are 'attributes' of a Person, right? (loaded term)
<Seabass>
and code would tabulate all the stat bonuses form actor or person or character stats and equipment
<bnagy>
so they should go in instance variables, because they are specific to that instance of Person
<Seabass>
I just figured I'd make a new global var for each person :|
<bnagy>
No! Bad Seabass!
<ged>
Hehe.
punkrawkR has joined #ruby
<Seabass>
lol, well maybe as I learn more ruby I'll have in mind a more efficient and just and right and good and sensible way of doing it
elliot98 has quit [Quit: Konversation terminated!]
<bnagy>
Seabass: it's all about objects. Objects objects objects.
<Seabass>
bnagy teach me
<ged>
Yeah, don't fear the object graph.
<kalleth>
hmm, shevy
<shevy>
kalleth yeah I think they changed that from 1.8 to 1.9
<kalleth>
it was removed, yeah
<shevy>
or at least something there
<bnagy>
what should this object be able to DO (methods) and what attributes does this object HAVE (@instance vars)
<shevy>
and they added .public_send or that
<kalleth>
but there's some debate about it being replaced by matz with #funcall, then being replaced with #send!
ZachBeta has joined #ruby
<kalleth>
neither of which exist in 1.9.2
<shevy>
hehe
* kalleth
installs 1.9.3
<shevy>
Seabass within a class, you wont need global variables usually
<shevy>
Seabass just assign to @ivars
<bnagy>
global variables are a bad code smell. They're not _always_ wrong, but they usually are
<kalleth>
wget 1.9.3.tar; tar zxvf 1.9.3.tar; ./configure && make && make install will replace my current installation, right?
<kalleth>
(this is what i want)
tresk has left #ruby [#ruby]
<kalleth>
(i dont use rvm, cba)
<shevy>
Seabass the hash of hashes you described can be @hash_of_hashes = { }
<bnagy>
kalleth: you probably want a cd in there
<kalleth>
obv
<kalleth>
;p
<shevy>
kalleth depends. by default, this would use --prefix /usr/local
<kalleth>
good time to look at rbenv i think
<shevy>
if your ruby is in /usr prefix then that command you showed here wont overwrite it
<bnagy>
I like rbenv
nilg has joined #ruby
<Seabass>
shevy, I figured like my first hash.hash.new{ charstats => (statsarray),ect}
<Seabass>
i know hash.hash.new is too many args prolly
<shevy>
Seabass {} is a way to make a new hash. Hash.new is another one
<bnagy>
Seabass: so, this is cool - if you have a defense method that calculates your def score based on armor
<shevy>
hash = {}
<shevy>
hash = Hash.new
<bnagy>
you can overload it in the Wizard module to actually decrease defense for heavy armor types
ph^_ has joined #ruby
test34 has joined #ruby
test34 has quit [Changing host]
test34 has joined #ruby
<bnagy>
cause wizards can't wear plate :P
<Seabass>
bnagy or increase atk vs metal armor types
b4ud has joined #ruby
<bnagy>
overloading. It's magic.
SPYGAME has quit [Ping timeout: 256 seconds]
<Seabass>
bnagy IT'S SUPEREFFECTIVE!
<bnagy>
anyway, the point of all these kinds of exercises is to learn good design, not to hack the first thing that works
<Seabass>
no pokemon players?
<shevy>
I dont know pokemon
test34- has quit [Ping timeout: 272 seconds]
<shevy>
but we used to play pen and paper RPGs!
<Seabass>
my step dad made me play dnd 2.0 also
<shevy>
the DnD system is among the simplest one can use... :P
noodletraveler has quit [Quit: leaving]
<bnagy>
shevy: that sounds really boring, man. Ours had orcs and dragons and stuff
ph^ has quit [Ping timeout: 252 seconds]
<bnagy>
"OK...I WRITE ON THE PAPER. <ROLL FOR INK>"
<Seabass>
bnagy so I should try not to use global vars
<Seabass>
then I played World of Warcraft
<bnagy>
Seabass: right. No $globals, no @@classvars
<Seabass>
bnagy I see, beginners don't have the authorization to use $globals or @@classvars
<shevy>
bnagy, yeah but our group was like ... "(1) why is that dragon in that dungeon and (2) how did it come here anyway?"
<bnagy>
Seabass: well actually if I had my way, nobody would have authorization to use @@classvars
<shevy>
Seabass you always should ask first whether you need this or not
<kalleth>
Seabass: in 2 years of professional ruby dev, i've only had to use @@classvars once, in a gem I wrote (and it was probably the wrong approach), and i've NEVER had to use $globals
<shevy>
in the case when you have a class, you really rarely need $globals, and for 99,9% all cases of @@classvars I saw, were not needed either
<shevy>
you can use @instance_variables!
<shevy>
and local throwaway variables
Guedes has quit [Quit: Saindo]
<shevy>
which you actually already had :)
<bnagy>
ok I need to go and be Mario now and get stars, screw refactoring
<Seabass>
SO BE IT! Hence forth, $globals and @@classvars shall be stricken from mine endevors.
<banisterfiend>
bnagy: which mario are you playing?
<banisterfiend>
galaxy?
<kalleth>
Super Mario Bros
<kalleth>
hopefully
<Seabass>
I'm gettin tired. But I want to learn to code...
<kalleth>
Seabass: the best way to learn a code is to think of a project, then do it
<kalleth>
also, ruby koans i found quite useful
<shevy>
yeah
tatsuya_o has quit [Remote host closed the connection]
<kalleth>
so you can create a Client and many of its Addresses in the same POST without having spaghetti based transaction code in the controller
dnyy_ has quit [Remote host closed the connection]
jonathanwallace has joined #ruby
luckman212 has quit [Remote host closed the connection]
maasha has joined #ruby
perryh is now known as perryh_away
<Seabass>
well if you clicked the link I provided, that's the long term goal for me, with more nintendo esque graphics
ben_m has joined #ruby
SPYGAME has joined #ruby
<bnagy>
well so much for that - power is out again, and the inverter seems to be unable to run the TV :<
<banisterfiend>
bnagy: galaxy?
<bnagy>
galaxy 2 yeah
<Seabass>
so far today I learned how to make a hash, how to puts, how to use @ivars, and how to pass hash/array info to a method for arithmatics
<maasha>
on organizing ruby files. I have my code in maasha/lib and and unit tests in maasha/test. Now I was thinking about putting some code in maasha/lib/somedir. Is that kosher? Should I have equivalient maasha/test/somedir?
<maasha>
(some things simple aren't in the books)
<maasha>
*simply
<Seabass>
oh, and I lerned conditional and while loops
<banisterfiend>
bnagy: cool! did you ever play sunshine?
<shevy>
vectorshelve I was at miramare! It's nice there, especially the big park behind the castle (hard to see on that picture).
<bnagy>
one of my friends in geneva was the 'ambassador'
<bnagy>
which involved only getting duty free wine, as far as I could tell
<shevy>
trieste is not that great though, the harbour looks damaged, there are industrial buildings which seem to have been abandoned many years ago, so it looks as if everything is rotting near the harbour...
<vectorshelve>
shevy: ok.. I am planning a holiday to Europe this year.. confused as to which country to chose
<JonnieCache>
OMG just seen the google doodle
<JonnieCache>
ITS A MINIMOOG!
<bnagy>
it is
<shevy>
vectorshelve, I dunno... there are individual cool places... but nothing really where you think "fucking awesome" all the time
<bnagy>
and you can play notes with the keyboard
<JonnieCache>
no tooltips for the knobs though :(
<shevy>
vectorshelve, definitely include some harbours though, my dad travelled to amsterdam and rotterdam only because of the harbours there
<JonnieCache>
anyone know which knob is the filter resonance?
KL-7 has joined #ruby
<JonnieCache>
maybe you cant model a resonating filter in javascript yet...
<shevy>
bnagy, this is so unfair... that they can shop in duty free zones and we common guys can not. same with UNO buildings, they can buy at special places, and also get like free housing (we had some from the UN live around here, the UN paid the rent for like 95% of it or something like that)
<JonnieCache>
lame
tresk has joined #ruby
<bnagy>
shevy: it's not unfair :) That's the deal we get here! (duty free shop, free housing...)
kpshek has joined #ruby
<bnagy>
support your local IO expat :>
<maasha>
what does this FileList do: Rake::TestTask.new do |t|; t.test_files = FileList["test/{unit,functional}/**/test_*.rb"]; end?
<bnagy>
maasha: it's not a standard class
tresk has left #ruby [#ruby]
<maasha>
bnagy: and?
<bnagy>
and.. I have no idea unless you have the code for it. :) It's not a standard class, so who knows what it does?
akem has quit [Ping timeout: 256 seconds]
<vectorshelve>
shevy: how about sweden ?
<maasha>
right. so the /**/ is non-standard as well?
<bnagy>
well if it's like Dir.glob then it's recursive directory matches
<shevy>
vectorshelve I've been in sweden only once, in goeteborg. It was very foggy. I dunno... perhaps other places in sweden are cool, but if I'd have to go to scandinavia again, I'd pick either norway or finland
<bnagy>
basically it should get all files called test_whatever.rb in any subdir or test/unit and test/functional
<maasha>
bnagy: and a little test shows that you are correct - its a Dir.glob
<maasha>
just what I need. neat
<vectorshelve>
shevy: yeah even my friends told me scandinavian countries are the best norway and the other
<bnagy>
except in winter, they suck in winter
<shevy>
yeah that's what I dont like... cold, wet and snow
PragCypher has quit [Read error: Connection reset by peer]
mucker has quit [Quit: leaving]
b4ud has quit [Ping timeout: 276 seconds]
pawdro has joined #ruby
kil0byte_ has joined #ruby
codebeaker has joined #ruby
`brendan has joined #ruby
kil0byte has quit [Ping timeout: 260 seconds]
kaspernj has joined #ruby
lxsameer has joined #ruby
Alantas has joined #ruby
odinswand has quit [Quit:]
Morkel has quit [Quit: Morkel]
iocor has joined #ruby
b4ud has joined #ruby
tatsuya_o has joined #ruby
PragCypher has joined #ruby
krusty_ar has joined #ruby
pawdro has quit [Quit: Wychodzi]
asuka_ has quit [Read error: Connection reset by peer]
asuka_ has joined #ruby
t0mmyvyo has joined #ruby
t0mmyvyo has quit [Client Quit]
petercs has joined #ruby
adambeynon has quit [Quit: adambeynon]
vitoravelino is now known as vitoravelino`afk
Foxandxss has joined #ruby
Shahor has joined #ruby
celm has quit [Ping timeout: 276 seconds]
liluo has quit [Remote host closed the connection]
Vendethiel has joined #ruby
thecreators has joined #ruby
geekbri has joined #ruby
twock has joined #ruby
closedbracket has quit [Remote host closed the connection]
bglusman_ has quit [Remote host closed the connection]
bglusman has joined #ruby
RoUS has quit [Ping timeout: 260 seconds]
odinswand has joined #ruby
sbanwart has joined #ruby
bglusman has quit [Ping timeout: 245 seconds]
Guedes has joined #ruby
Guedes has quit [Changing host]
Guedes has joined #ruby
Prz has joined #ruby
ZachBeta has quit [Quit: Computer has gone to sleep.]
kil0byte has joined #ruby
Poapfel has quit [Quit: Need a new quit message? Why not Zoidberg?"]
alek_b has quit [Remote host closed the connection]
fbernier has joined #ruby
RoUS has joined #ruby
celm has joined #ruby
v0n has quit [Ping timeout: 272 seconds]
kil0byte_ has quit [Ping timeout: 276 seconds]
zinjacoder has joined #ruby
fbernier has quit [Remote host closed the connection]
fbernier has joined #ruby
tobym has joined #ruby
wangr has joined #ruby
Progster has joined #ruby
kawa_xxx has quit [Remote host closed the connection]
Guest54524 is now known as davidw
mdw has quit [Remote host closed the connection]
davidw has quit [Changing host]
davidw has joined #ruby
thecreators has quit [Quit: thecreators]
thecreators has joined #ruby
tomzx has joined #ruby
mvangala has joined #ruby
cha1tanya has joined #ruby
alex88 has joined #ruby
Vendethiel has quit [Quit: je ne suis plus là, tqvu]
<alex88>
hello guys, i'm totally new to ruby, i want to download and edit one line in the knife-openstack package and then install on local repository.. how could i do that?
<shevy>
alex88 can you show me that knife openstack package
<shevy>
one way that probably works is ... download it, extract it, edit the file, repackage it again
ananthakumaran has quit [Ping timeout: 244 seconds]
<alex88>
now, the instance is booting, it should wait for ssh to came up, but exits with "Waiting for sshdERROR: Errno::ENETUNREACH: Network is unreachable - connect(2)"
<shevy>
alex88, I dont know who wrote that code but it looks odd. as if a python guy wrote it
<shevy>
puts("\n")
<alex88>
is there a way to make it don't exits?
<fowl>
OH what!
<fowl>
to be continued...
<shevy>
lol fowl
<fowl>
now i wont know what happens for a whole week :(
<shevy>
alex88, you could capture it into a begin/rescue/end
kzar has joined #ruby
<shevy>
alex88, I dont know much about sshd however
<kzar>
I need to collect the results from a for loop into an array, what's an idiomatic way to do that?
<shevy>
btw alex88
<shevy>
it already has some rescue clauses
<shevy>
rescue Errno::ECONNREFUSED; sleep 2
<bnagy>
kzar: for loops are not idiomatic
<shevy>
perhaps you can add ENETUNREACH somewhere there
<kzar>
bnagy: Right but I need one
<alex88>
shevy, oh, so i just have to add "rescue Errno::ENETUNREACH" sleep etc
<bnagy>
kzar: no you don't :)
<bnagy>
kzar: pastie the code
<shevy>
kzar you can append to an array. array << "we append a string to our array here"
cordoval has left #ruby [#ruby]
<fowl>
kzar, generally use array#map
<alex88>
shevy, thank you very much!!
<kzar>
bnagy: yes I do, firstly I can't paste the code because it's commercial
<fowl>
in place of for
<kzar>
bnagy: I'm not working with an array, but a FFI pointer to a C array
<shevy>
alex88, I hope so, I really dont know what that code really does, but it seems as if that rescue block looks for network-specific errors, so it would make sense to add ECONNREFUSED somewhere there
mdhopkins has quit [Quit: mdhopkins]
linus95014 has joined #ruby
<alex88>
shevy, yup, thank you again!
<bnagy>
kzar: still sounds pretty mappable to me
thone has joined #ruby
<shevy>
kzar, you could always abstract the code and show that ;) if you can modify the code, however, if you are in control, then you indeed won't need a for loop. ruby provides .each for collection which achieves the same really, without having to keep track for throwaway variables
<bnagy>
but you seem to know best, so
<shevy>
oh yes or .map!
<shevy>
without the "!"
<shevy>
:P
thone_ has quit [Read error: Operation timed out]
spleeze has joined #ruby
dhaskew has joined #ruby
<fowl>
bnagy, I need to collect the results from a for loop into an array, what's an idiomatic way to do that? also don't throw any of that idiomatic BS at me
liluo has joined #ruby
<kzar>
bnagy shevy: The each method doesn't work on a FFI pointer
scav has joined #ruby
<kzar>
I would have done it like that if I could
Hanmac has quit [Ping timeout: 250 seconds]
<bnagy>
kzar: look, there's no for loop that can't be converted. It's not possible.
<shevy>
I am going to skip the boring shit and jump to "Military surplus Nd:YAG laser rangefinder firing." at once, as it is the only interesting thing :P
<shevy>
sounds like cthulhu, that ndyag thing
<fowl>
kzar, instead of for consider: 0.upto(SizeOfDatArray)
<bnagy>
Hanmac: you're right, that's MUCH better than seanstickle's
<bnagy>
at least if you're going to use inject then call it inject, when you use the reduce alias people might be in danger of thinking you're reducing something :D
<chrisbdaemon>
if i'm going to contribute to a gem, and my addition needs another gem installed.. how do i go about finding the lowest version of the other gem to be required?
<kalleth>
lectrick: i read up on RPN and it broke my head
<Tasser>
lectrick, friend of mine mentioned that if you get a forth-processor, they're often spaceproof
liluo has quit [Remote host closed the connection]
<kalleth>
i do not have a mathematical brain ;(
<seanstickle>
Everyone has a mathematical brain. The word "mathematics" itself means "that which can be learned"
<kalleth>
psh
<seanstickle>
But most math is taught like a bag of rocks being slammed against your skull.
<seanstickle>
So people learn to hate it
<kalleth>
i like that
* kalleth
tweets
<kalleth>
do you have a twitter, sean
<seanstickle>
kalleth: @seanstickle
<seanstickle>
kalleth: :)
<Tasser>
seanstickle, nice :-)
codebeaker has quit [Quit: codebeaker]
DrShoggoth has joined #ruby
mengu has quit [Read error: No route to host]
<lectrick>
Tasser: Define "spaceproof"?
<lectrick>
Tasser: You mean they were used on spacecraft?
<Tasser>
seanstickle, I suppose mathematics is of arabic origin?
<Tasser>
lectrick, exactly
<lectrick>
seanstickle: Never knew that definition of mathematics. Very cool
yannis has joined #ruby
<seanstickle>
Tasser: the word? No, it is Greek
<Tasser>
right, the were first
<lectrick>
Tasser: Did you know there's a Forth interpreter embedded in the Apple computer firmware?
<seanstickle>
lectrick: OpenFirmware, sure
<lectrick>
yep
<seanstickle>
lectrick: delightful!
<seanstickle>
The best language for creating a system to work without an OS, IMO
<Tasser>
lectrick, the whole EFI stuff?
<lectrick>
Tasser: Yep
<lectrick>
holy fuck there is a Minecraft mod that will let you build computers that are programmable using Forth, *inside the game*?
<JonnieCache>
people have been building microprocessors inside minecraft for a while
<banisterfiend>
Tasser: you mean mathematics per se? or just the word? if you mean mathematics per se, then: LOL (smacks u on the head)
<JonnieCache>
thats just a mod to make it easier
<lectrick>
JonnieCache: Ah, I didn't realize. I think I saw an AND gate once or something. Anyway http://www.eloraam.com/
<sh1ps>
Does anyone have any experience using Net HTTP proxy?
<Tasser>
banisterfiend, just the word *smacks back*
<banisterfiend>
:*
<sh1ps>
I'm trying to build a really simple sinatra app that just forwards requests through a proxy and returns the body
jackiechan0 has quit [Quit: Sto andando via]
<kalleth>
aaah, middleware.
<sh1ps>
which is working, but the problem is none of the external http requests are coming through
<sh1ps>
and I don't really even know where to ask since I know it's not a Ruby specific problem
<sh1ps>
nor is it a Sinatra problem
<sh1ps>
>.<
<kalleth>
well
<kalleth>
you say 'external http requests'
<lectrick>
middleware baby
<kalleth>
do you mean sinatra is not recieving requests you make to it
<lectrick>
rack
<kalleth>
or do you mean sinatra is not sending a request to your proxy
<lectrick>
actually i have to write a test for some new rack middleware today and am currently scratching my head
<kalleth>
lectrick: i've never written a basic 'rack' app
<sh1ps>
Ok so it all works, meaning I make the request and it comes back with the body of the page
<sh1ps>
but no images, css, js, etc
looopy has joined #ruby
<kalleth>
everything i've done has been either a ruby daemon, or a rails app atm
<sh1ps>
any http request on the page doesn't work.
eurek has joined #ruby
<kalleth>
sh1ps: so you're trying to use sinatra... as a passthrough proxy?
jprovazn is now known as jprovazn_away
<kalleth>
that's probably because some weird shit is happening in the nginx/apache config to remap the requests
<sh1ps>
I know it sounds really dumb but they asked me to do this at work as a proof of concept
<kalleth>
which you're not letting it do
<lectrick>
kalleth: it's pretty easy. it's a class that has to implement the "call" method which takes an env, and returns an array of [response_code, request, response] I think. It's in the Rack docs. Trust me it's pretty simple.
exchgr has joined #ruby
ABK_ has joined #ruby
<kalleth>
lectrick: awesome
yeggeps_ has joined #ruby
<kalleth>
lectrick: my next task is to figure out something to make with sinatra
<banisterfiend>
JonnieCache: did u know brownoski died only a year after finishing the ascent of man?
<lectrick>
kalleth: It is as simple as it can be to do what it does, which is ideal
phantasm66 has joined #ruby
<JonnieCache>
banisterfiend: no i didnt. he wasnt that old either
<kalleth>
lectrick: i'm thinking of making a single-client API
<lectrick>
kalleth: if you want to maybe work with me on writing a test for it we can figure it out together
mnaser has quit [Quit: Computer has gone to sleep.]
<lectrick>
that way you have your whole test-first done
<shevy>
yay, a team!
<shevy>
code, hugs and kisses!
bbttxu has joined #ruby
king313 has joined #ruby
<kalleth>
lectrick: i.e. a rack app that takes an image as uploaded, then does some awesome stuff to interpret that image, and returns a json array of the data found from that image
<sh1ps>
kalleth: but yes, that's the basic gist. I'm essentially just trying to take a URL parameter and pass it to the proxy and then return the result
<JonnieCache>
all the greats man, feynman, carl sagan, john peel
<sh1ps>
seemed like a simple task initially :|
<lectrick>
kalleth: sounds like a plan
<JonnieCache>
just one ones i can think of right now
ABK_ has quit [Read error: Connection reset by peer]
apeiros_ has quit [Remote host closed the connection]
ABK_ has joined #ruby
heftig has joined #ruby
kil0byte_ has joined #ruby
ckrailo has joined #ruby
pygospa has quit [Ping timeout: 240 seconds]
cdepue has quit [Remote host closed the connection]
ABK_ has quit [Read error: Connection reset by peer]
ABK_ has joined #ruby
<JonnieCache>
kalleth: if you only have one endpoint sinatra is pointless
pygospa has joined #ruby
<JonnieCache>
sinatra is basically just a router, and a way to avoid typing `require 'tilt'`
ABK_ has quit [Read error: Connection reset by peer]
<JonnieCache>
just use rack
kil0byte has quit [Ping timeout: 248 seconds]
ABK_ has joined #ruby
exchgr has quit [Quit: exchgr]
MasterIdler has joined #ruby
liluo has quit [Remote host closed the connection]
kil0byte has joined #ruby
ABK_ has quit [Read error: No route to host]
wilmoore has joined #ruby
sbanwart has quit [Ping timeout: 248 seconds]
savage- has quit [Remote host closed the connection]
awarner has quit [Remote host closed the connection]
kil0byte_ has quit [Ping timeout: 265 seconds]
fjfish has quit [Ping timeout: 260 seconds]
niklasb has joined #ruby
gyre007 has joined #ruby
awarner has joined #ruby
<lectrick>
I think JonnieCache might be right. But I also think you will start to require more and more functionality as you build out this idea and then you will suddenly need a sinatra or a rails.
<lectrick>
In other news I am having trouble looking up the docs for the (?(DEFINE) type keyword in regex, using google.
looopy has joined #ruby
<lectrick>
when I use it in Ruby I get "undefined group option" so I suppose I can google "ruby regexp group options"
trivol has quit [Quit: trivol]
trivol has joined #ruby
<JonnieCache>
lectrick: making a rack app into a sinatra one is a copy and paste job though, being as the whole rack api is still exposed in sinatra
khakimov has quit [Quit: Computer has gone to sleep.]
asobrasil has joined #ruby
schovi has quit [Remote host closed the connection]
khakimov has joined #ruby
francisfish has joined #ruby
wvms has quit [Quit: wvms]
<JonnieCache>
sinatra is so elegant its amazing. look at the code some time its a work of art
<JonnieCache>
theres a reason its so often imitated :)
mnaser has joined #ruby
mnaser has quit [Changing host]
mnaser has joined #ruby
awarner has quit [Remote host closed the connection]
exchgr has joined #ruby
trivol has quit [Ping timeout: 250 seconds]
kevinbond has quit [Quit: kevinbond]
<td123>
JonnieCache: for simple sites, I agree :)
jackiechan0 has joined #ruby
dekroning has joined #ruby
<dekroning>
hi
ananthakumaran has joined #ruby
<banisterfiend>
JonnieCache: some of the code is just plain weird though
<JonnieCache>
which bit are you thinking of
<banisterfiend>
JonnieCache: like using define_method to create a method, then removing the method straight after but keeping a reference to the metho dobject around
<banisterfiend>
JonnieCache: that's how get() etc work
walbert has joined #ruby
Eldariof-ru has quit [Ping timeout: 276 seconds]
<banisterfiend>
JonnieCache: im sure there's a reason for it tho
<dekroning>
I'm trying my best to do things TDD wise, and I got confused when to test... for example I need a Address class, but since it's actually nothing more then a data structure, do I still need to test it ?
<banisterfiend>
just at first blush it appears weird
robdodson has joined #ruby
maletor has joined #ruby
tar_ has joined #ruby
<shevy>
whoa
<shevy>
that is some trick... define the method... remove the method... but a reference is kept
<shevy>
what could this be used for?
yoklov has joined #ruby
<banisterfiend>
shevy: well it's like instance_exec
<banisterfiend>
but with some differences: 1. you get metohd rather than block semantics, 2. you get names in the backtrace
khakimov has quit [Quit: Computer has gone to sleep.]
td123 has quit [Read error: Connection reset by peer]
<seanstickle>
Even better than Python?
<hoelzro>
I haven't worked with Python's much
<banisterfiend>
hoelzro: the ruby C API is too nice :P
_2easy_ has quit [Quit: Lost terminal]
<banisterfiend>
it lets you do too much, hehe
looopy has joined #ruby
<hoelzro>
as far as I've seen (regarding C APIs):
<banisterfiend>
but that's fun
td123 has joined #ruby
<hoelzro>
Perl < Ruby < Lua
netogallo has joined #ruby
deception1 has left #ruby [#ruby]
jrist-mtg is now known as jrist-afk
heftig has joined #ruby
<shevy>
hoelzro wait for mRuby
<shevy>
hoelzro its ambition is to replace lua
<shevy>
it's like the ruby of today has become fat
<shevy>
with mRuby, it is on diet!
<apeiros_>
hi banisterfiend
<hoelzro>
heh
<hoelzro>
I once thought of implementing Ruby on top of Lua
linoj has quit [Read error: Operation timed out]
<Hanmac>
hoelzro: call it lRuby
<seanstickle>
Some folks thought about implementing Ruby on top of Parrot, and called it Cardinal.
<hoelzro>
I was going to call it either Luby, or Roomba.
<seanstickle>
But that project seems to have died. :(
Helius has joined #ruby
linoj has joined #ruby
savage- has joined #ruby
JohnBat26 has quit [Ping timeout: 245 seconds]
gilead has quit [Quit: Leaving]
irrationalfab has joined #ruby
cbuxton has joined #ruby
yoklov has quit [Quit: bye!]
heftig has quit [Ping timeout: 245 seconds]
stephenjudkins has joined #ruby
joshman_ has joined #ruby
locriani has quit [Read error: Connection timed out]
bluOxigen has quit [Ping timeout: 250 seconds]
andrewhl has joined #ruby
locriani has joined #ruby
<lectrick>
holy fuck I think I may be on to something: https://gist.github.com/2775709 It will validate a simple json but it's currently failing on deeper JSON's
robdodson has quit [Quit: robdodson]
bashdy has joined #ruby
bier has quit [Ping timeout: 244 seconds]
minijupe has quit [Quit: minijupe]
kaspernj has quit [Ping timeout: 244 seconds]
cj3kim has joined #ruby
cj3kim has quit [Changing host]
cj3kim has joined #ruby
prtksxna has quit [Remote host closed the connection]
<lectrick>
well it actually works on deeper JSON's but… there may be corner cases, but those could be fixable by fixing the individual regexen defining the atoms… still, really cool
artOfWar has joined #ruby
<lectrick>
for anyone curious i've been re-editing that gist
BrokenCo1 has joined #ruby
eywu has joined #ruby
BrokenCo1 has quit [Client Quit]
<shevy>
seanstickle Parrot... dont you require perl 5 to build that?
<seanstickle>
shevy: yes
tar_ has quit [Quit: tar_]
zommi has quit [Read error: Connection reset by peer]
hukl has joined #ruby
davidcelis has joined #ruby
jackiechan0 has quit [Ping timeout: 248 seconds]
CheeToS has quit [Ping timeout: 244 seconds]
<workmad3>
lectrick: JSON BNF fun? :)
Foxandxss has joined #ruby
<workmad3>
oh wait, SGML
<workmad3>
why on earth would you do SGML? :P
mohits has quit [Ping timeout: 276 seconds]
<seanstickle>
Military contracting maybe
<seanstickle>
The Navy LOVES sgml
clockwize has quit [Quit: clockwize]
mohits has joined #ruby
imami|afk is now known as banseljaj
<lectrick>
workmad3: yes, it is essentially a BNF isn't it
stephenjudkins has quit [Quit: stephenjudkins]
stkowski has joined #ruby
<workmad3>
lectrick: yeah, but more fubared :P
ciopte7 has joined #ruby
<lectrick>
workmad3: well, in the sense that regex is a nasty hack haha
<workmad3>
:)
francisfish has quit [Remote host closed the connection]
BiHi has quit [Quit: Computer has gone to sleep]
cha1tanya has quit [Quit: Leaving]
heftig has joined #ruby
bier has joined #ruby
seanstickle has quit [Quit: Nihil sub sole novum]
Araxia_ has joined #ruby
irrationalfab has quit [Remote host closed the connection]
awarner has joined #ruby
yankov has quit [Quit: yankov]
stephenjudkins has joined #ruby
theRoUS has quit [Remote host closed the connection]
mattonrails has joined #ruby
mengu has joined #ruby
<shevy>
ok
<shevy>
it is time for the RubyOS
<shevy>
who is with me?
xnm has joined #ruby
<apeiros_>
*crickets*
<chrisbdaemon>
how do you write an os out of an interpreted language?
jarjar_prime has quit [Quit: Ready? Set? Go!]
<shevy>
chrisbdaemon by writing everything in the language
<chrisbdaemon>
i wish you the best of luck with that
sick_protoman has joined #ruby
maesbn has joined #ruby
fridim_ has joined #ruby
mando has joined #ruby
irrationalfab has joined #ruby
jrist-afk is now known as jrist
theRoUS has joined #ruby
mdw has quit [Remote host closed the connection]
jimeh3 has joined #ruby
stephenjudkins has quit [Quit: stephenjudkins]
jimeh2 has quit [Ping timeout: 265 seconds]
<shevy>
I can sense a certain general lack of enthusiasm here
hoelzro is now known as hoelzro|away
tatsuya_o has quit [Remote host closed the connection]
exchgr has quit [Quit: exchgr]
<Alantas>
I'm greatly enthusiastic about seeing someone else do that work!
<shevy>
now that is better
Synthead has joined #ruby
<geekbri>
there is no each_pair_with_index for hashes is there :)
ghanima has joined #ruby
sbooch has joined #ruby
<shevy>
that would be quite long
sbooch has quit [Client Quit]
<geekbri>
hehe sure would
<shevy>
ruby core prefers short names
<shevy>
one word or two words usually
<shevy>
I cant give you an example for a 3 word method name right now in standard ruby
<apeiros_>
shevy: while rubys performance is good enough for most computing tasks, and its capability to be extended with native gems makes up for many of the other cases - it won't be good enough for OS level tasks.
<geekbri>
well there is a each_with_index, i was hoping for one that would give me the key value pair and an index
<Alantas>
And Ruby on Lua might be called "RedMoon" or "Rubi". ("Lua" is the Portuguese word for "moon"; "rubi" for "ruby".)
<apeiros_>
geekbri: each_pair.with_index
<Alantas>
geekbri: mah_hash.each_pair.with_index{ |(key,value),index| ← I think }
<geekbri>
apeiros_: ahh thanks. silly me
<geekbri>
i will experiment and see if that works
timonv has quit [Remote host closed the connection]
<Alantas>
Worked for me in irb.
exchgr has joined #ruby
bashdy has quit [Ping timeout: 265 seconds]
<apeiros_>
well, it requires 1.9, but other than that… ^
ramblex_ has joined #ruby
ramblex_ has quit [Client Quit]
<Alantas>
Worked for me in irb in 1.8.7.
<geekbri>
yup worked for me too, and im on 1.9.2 so if it doesn't work in lower thats fine
<geekbri>
oh even better
<apeiros_>
they backported enum returning of the methods? nice… I'm off from 1.8 for too long I guess.
<workmad3>
Alantas: really? wow... I thought the () syntax in proc parameters was 1.9+
jackiechan0 has joined #ruby
<geekbri>
so im guessing the () syntax is just a grouping so it knows which block variables go with which proc
heftig has quit [Quit: leaving]
nlc has joined #ruby
irrationalfab has quit [Remote host closed the connection]
alexim has joined #ruby
kenichi has joined #ruby
dax has quit [Quit: brb]
<Alantas>
Yeah, it's sorta like *these in method argument lists, I think.
<shevy>
Hanmac, how would you switch between ruby 1.8 and 1.9 on debian?
heftig has joined #ruby
tatsuya_o has joined #ruby
<workmad3>
() is for deconstructing an array
<workmad3>
in that situation
<Hanmac>
update-alternatives --config ruby
ByteCrunch has quit [Remote host closed the connection]
<shevy>
Hanmac, but ... does that toggle between the versions? or select a specific one
<workmad3>
but it does work in 1.8.7 for me, awesome :)
heftig has quit [Client Quit]
<workmad3>
hmm, maybe it was just block params to blocks that was added
fangwen has quit [Quit: Page closed]
ramblex has quit [Ping timeout: 265 seconds]
KL7 has joined #ruby
<apeiros_>
workmad3: also default values
KL-7 has quit [Ping timeout: 248 seconds]
tatsuya_o has quit [Remote host closed the connection]
<shevy>
aha
<workmad3>
apeiros_: :)
<apeiros_>
at least I'm pretty sure proc { |x=nil| is invalid in 1.8
jimeh3 has quit [Read error: Operation timed out]
aantix has joined #ruby
<workmad3>
invalid for me
<Hanmac>
shevy: There are 2 choices for the alternative ruby (providing /usr/bin/ruby).
<Hanmac>
0 /usr/bin/ruby1.8 50 auto mode
<Hanmac>
1 /usr/bin/ruby1.8 50 manual mode
<Hanmac>
* 2 /usr/bin/ruby1.9.1 10 manual mode
<Hanmac>
Press enter to keep the current choice[*], or type selection number:
KL7 has quit [Read error: Operation timed out]
<shevy>
aha
<shevy>
I see
<shevy>
a menu
<shevy>
:)
dax has joined #ruby
maesbn has quit [Remote host closed the connection]
<Alantas>
apeiros_: Yeah, syntax error here.
<shevy>
my 1.8 brother, Atlantis!
<shevy>
we'll defend it till the end of time itself
linoj has quit [Ping timeout: 245 seconds]
<Hanmac>
shevy: this works too: update-alternatives --set ruby /usr/bin/ruby1.9.1
linoj has joined #ruby
S3kx is now known as S1kx
S1kx has quit [Changing host]
S1kx has joined #ruby
<Hanmac>
apeiros_ proc{|*args| }
<apeiros_>
Hanmac: I know. that was the work-around
<apeiros_>
but manually defaultizing is fugly
maesbn has joined #ruby
<Alantas>
Probably very Perl-y to pick arguments out of that, let alone default them.
yankov has joined #ruby
<Alantas>
a,b,c = *args
<Alantas>
my $a,$b,$c = @_; # or whatever it was in Perl
<apeiros_>
a = default if args.size < 1; b = default if args.size < 2; …
maesbn has quit [Remote host closed the connection]
Vainoharhainen has quit [Quit: Leaving...]
<Alantas>
a,b,c = *args; a ||= "herp"; b ||= "derp"; c ||= 5
c0rn has joined #ruby
<apeiros_>
that's incorrect
<apeiros_>
prc.call(nil, false) # broken
adamkittelson has joined #ruby
awarner has quit [Remote host closed the connection]
<Alantas>
For only one or two args, kinda overkill, but more are easy to add.
<apeiros_>
yes. as I said: defaultizing manually = PITA.
heftig has joined #ruby
apeiros_ has quit [Remote host closed the connection]
itnomad has joined #ruby
n1x has joined #ruby
rtl_ is now known as rtl
sbanwart has joined #ruby
td123 has quit [Read error: Connection reset by peer]
PragCypher has quit [Read error: Connection reset by peer]
mando has quit [Remote host closed the connection]
PragCypher has joined #ruby
td123 has joined #ruby
lopin has quit [Ping timeout: 240 seconds]
andrewhl has quit [Quit: andrewhl]
jackiechan0 has quit [Quit: Sto andando via]
yosinof has joined #ruby
kaspernj has quit [Ping timeout: 276 seconds]
heftig has quit [Ping timeout: 245 seconds]
minijupe has joined #ruby
d3vic3 has quit [Quit: leaving]
n1x has quit [Quit: "X-zam :/"]
heftig has joined #ruby
jayrulez has joined #ruby
narshlob has joined #ruby
fermion has quit [Quit: Computer has gone to sleep.]
cbuxton has quit [Ping timeout: 244 seconds]
nfluxx has joined #ruby
v0n has joined #ruby
statix has quit [Remote host closed the connection]
statix has joined #ruby
kenneth has quit [Quit: kenneth]
erikstraub has joined #ruby
<erikstraub>
does anyone know what would cause rspec output like this >> http://d.pr/i/YOG5
KL-7 has joined #ruby
wiwillia has joined #ruby
cbuxton has joined #ruby
lxsameer has joined #ruby
<wiwillia>
if anyone is looking for a weekend project, I just designed http://i.imgur.com/uxMT2.jpg (monthly micro-distillery whiskey subscriptions) - advertising it as a father's day gift concept.
td123 has quit [Quit: WeeChat 0.3.7]
linus95014 has joined #ruby
ibash has joined #ruby
<ibash>
what does --no-ri do when doing a gem install?
<ibash>
-> not in documentation
narshlob has left #ruby [#ruby]
<Alantas>
"Another sale line for this whiskey." Well, I'm convinced!
<shevy>
it should skip the installing-docu part
timonv has joined #ruby
<wiwillia>
Alantas just lorem ipsum (fake text) for now until I work on the actual sales text :P
<wiwillia>
BUT
<ibash>
holy shit!
<wiwillia>
I'm sure the "third selling point" had you
<ibash>
I didn't know ri existed...
<ibash>
where can I find ruby tool basics and things like that, instead of blindly following videos / tutorials
<shevy>
ibash, also work through "learn to program" by chris pine at least once. then start reading official docu about the powerhorses of ruby - class Array, Hash and String
<shevy>
aszurom what error you get
ukwiz has quit [Quit: Leaving]
<shevy>
it is not idiomatic though
<shevy>
if (val < minz) then { minz = val }
<shevy>
change it to
<shevy>
minz = val if val < minz
<shevy>
also you should indent when making a newline after {
<aszurom>
yeah, it's complaining about unexpected }
<shevy>
array.each {
<Alantas>
orealis: if val < minz then minz = val end
<shevy>
continue_here
<shevy>
}
<Alantas>
* or:
<ibash>
thanks!
<shevy>
and you should use pastie.org, it has syntax highlighting :)
voodoofish430 has joined #ruby
<Alantas>
(For some reason I tab-completed "or"?)
Eldariof-ru has joined #ruby
<Alantas>
Or really, just: inputarray.min
<aszurom>
I'm having to write my own method to find min of an array for some reason
<Alantas>
inputarray.reduce{|minz,val| val < minz ? val : minz}
<aszurom>
I'm reading a csv into csv[x][y] type array
<shevy>
well should not be a problem
erikstraub has left #ruby [#ruby]
<aszurom>
when I say csv[5].max it's returning something that is NOT the max value in the array
<shevy>
and how does csv look like
<shevy>
with [5] you fetch the sixth entry there
<Alantas>
csv[5].max_by(&:to_i)
DRCALKIN has joined #ruby
<Alantas>
(If they're arrays of strings, it does string/lexical comparison. The to_i thing makes real numbers out of them and compares them as such.)
<rking>
deryl: I have a rvm-on-zsh doc bug for you.
<deryl>
rking, yeah that would be killer. I'd love a 22" LCD touchscreen monitor that worked with Linux and OSX :)
<TTilus>
deryl: i do that a lot, have been doing for quite number of years, and blame psion 5mx for that
<deryl>
rking, file it but cc @mpapis. I frigign HATE zsh and i don't use it at ALL.
<wmoxam>
carloslopes: I actually don't see the 'scaling argument' used much anymore. I guess it's because twitter is stable now
mohits has quit [Quit: Leaving]
<rking>
deryl: h8r.
tobago has quit [Ping timeout: 244 seconds]
<wmoxam>
carloslopes: because, you know, if your web framework can't handle #ROFLTWITTERSCALE then is SUCKS!
<deryl>
rking, if its a website bug then submit and i'll fix (or edit through GH's web interface for a pull req and I'll merge)
<wmoxam>
*it
<deryl>
rking, damn straight :)
<rking>
deryl: Oh, good point. I'll pull req.
tobago has joined #ruby
Guest18349 is now known as zii
digitalcakestudi has joined #ruby
zii has quit [Changing host]
zii has joined #ruby
<deryl>
rking, cool. if you're doing it now, let me know when you complete it so i don't hav eto wait for the email :)
DRCALKIN has joined #ruby
<rking>
deryl: Nah, I'm working now. But I have my ~/.zshrc saying 'echo "Tell deryl about the following…"' so there's 0% chance I'll permantly forget.
<Alantas>
subr00t: No idea how to interface with the other things, but, that last line will build up the hash then discard it because you never assign it to anything.
<rking>
Well, 0.0x%
<deryl>
rking, excellent :)
<Alantas>
foo = ec2.instances.inject...
<rking>
And s/ntly/nently/
DRCALKIN has quit [Client Quit]
<deryl>
hehe dude you see how often i typo.
bosphorus has quit [Remote host closed the connection]
awarner has quit [Remote host closed the connection]
<rking>
Some day I'm going to begin Platinum IRC Mode, where from that day forward I correct 100% of my IRC typos.
<subr00t>
Alantas: exactly, all what i need is how to store the id/status to the db, the last line isn't needed
digitalcakestudi has quit [Read error: Connection reset by peer]
mneorr_ has joined #ruby
<shevy>
rking I like your typos
<deryl>
rking, i want a automated typo fixer :)
<wmoxam>
I hate IOS autocorrect
<deryl>
and language structure fixer (an automated, not a automated)
<carloslopes>
wmoxam: like i said before.. i agree with you too, but in part... because, if my site is not like twitter (and i think that is really difficult to find anyone here with a case like twitter).. i don't need to have my web app written in C to respond with 50ms to my client.. my client is satisfied with 300-500ms :)
<coyo>
what, like the autocorrect for ios?
<rking>
deryl: That's like the last fronteir of AI. It'll never happen in our lifetimes.
<wmoxam>
it always screws up my texts
<deryl>
rking, hahah unfortunately
<deryl>
coyo, well one with better accuracy
davidcelis has quit [Quit: K-Lined]
snearch has joined #ruby
<deryl>
one that doesn't turn pen is into penis
<wmoxam>
carloslopes: I've been trolling fyi
<coyo>
deryl, good luck.
<rking>
wmoxam: I really like the way my current Android SMS does it — there's a list of suggestions above the keyboard that you can tap, good for both completion and correction, but nothing's automatically replaced.
<wmoxam>
:p
<roolo>
How do i raise a value in record in sequel update
<roolo>
?
<coyo>
:P
<rking>
s/fronteir/frontier/; # btw
<carloslopes>
wmoxam: ¬¬ hahaha
<rking>
carloslopes: Double-negative?
<roolo>
I mean i have column with value a and i want to do UPDATE .... SET number = number +3
<coyo>
ruby is fast enough for the vast majority of things.
<rking>
Yes! Let's have the efficiency discussion to totally punish wmoxam for trolling about it.
mneorr has quit [Ping timeout: 260 seconds]
<rking>
Woohoo.
<coyo>
:D
tobago has quit [Quit: Powered by fIRC v1.0.1 (r130) the Android IRC client.]
<rking>
You see, dear friends, Premature Optimization is the Root of All Evil.
* coyo
sits down like a good kiddie and listens.
<shevy>
no
<shevy>
I am the Root of All Evil.
<shevy>
I take great pride in that
<carloslopes>
rking: no, is dull face ;)
<rking>
Though a certain language, such as Ruby, might have less efficient function call semantics, this is for a higher-level purpose. At any point you can convert some code to C or even Asm… [stop me when I've countertrolled enough]
* coyo
giggles.
<shevy>
I'll never stop countertrolling
<shevy>
I support you fully rking
<TTilus>
*facepalm*
tobago has joined #ruby
<wmoxam>
rking: Ruby is ok, just make sure you compile it with -funrollups
<coyo>
hello TTilus
<Hanmac>
shevy no, eval is the Mother Root of all evil
<shevy>
that bitch
<rking>
Grr... countercountertrolled. >=\
<shevy>
retorttrolled!
<coyo>
wmoxam, you mean --fruitrollups?
tatsuya_o has joined #ruby
<deryl>
wtf is an apt compiler in relation to jruby? jruby-head build keeps puking due to Error running apt compiler
<rking>
You know, I realized I was an old man the day I shotgunned a pack of Fun Dip. If I had a Fruit Rollup in front of me I'd wad & chew it, too.
<deryl>
wondering if someone typo'd and meant ant rather than apt
<rking>
wmoxam: Thanks for that link. I'm slowly sliding in the Gentoo Ricer direction.
<wmoxam>
lolz
<wmoxam>
I wasted many hours on Gentoo in 2002-2003
<wmoxam>
I've learned my lesson :/
<rking>
s/wast/invest/
<wmoxam>
no, it was a waste
<rking>
s/st//g
<deryl>
line its bitching about is deprecation="true" encoding="UTF-8" includeantruntime="true"> happy happy joy joy
<shevy>
man
<shevy>
compiling
<shevy>
the problem is
<shevy>
it's no fun the way how linux works!
mbhnyc has joined #ruby
<rking>
shevy: Ineveryjesthereissometruth. What's the truth part of that?
* coyo
giggles at the site
jonny has joined #ruby
jonny has left #ruby [#ruby]
mbhnyc has quit [Client Quit]
<coyo>
gentoo ricer
yeggeps_ has quit [Read error: Connection reset by peer]
kvirani has joined #ruby
<shevy>
rking when things dont work together
yeggeps has joined #ruby
<rking>
shevy: But like, where does it work better?
mattonrails has joined #ruby
<shevy>
it does not work better really :(
<shevy>
perhaps on gobolinux
albemuth has quit [Quit: Leaving...]
<rking>
I guess I need to look at gobolinux. 2nd time you've mentioned it.
<shevy>
but the classical distributions will never abandon the status quo
albemuth has joined #ruby
<shevy>
rking, well you could use gobolinux just like any other distribution. cd /usr/bin works. but everything is installed into versioned directories. /Programs/Python/2.5.2
digitalcakestudi has joined #ruby
<shevy>
the thing here is that you suddenly no longer depend on a package manager per se
<wmoxam>
meh
kil0byte has quit [Remote host closed the connection]
<shevy>
you can still use one if you like to. but there is no more need to make a mess like the other distributions do it, up to the point where as a user you dont have any real alternative rather than use the package manager
<shevy>
coyo, I got one guy who moved from gentoo to archlinux, then moved back again after a while. he said, gentoo gave him more options to fine tune his compile targets
linus95014 has quit [Quit: linus95014]
<wmoxam>
coyo: the great thing about it is it's stellar documentation
schovi has joined #ruby
PragCypher has joined #ruby
<coyo>
shevy: arch is too l33t for me.
<shevy>
hehe
<TTilus>
aszurom: Pathname(var).dirname
<wmoxam>
shevy: why the fuck does one want to "fine tune his compile targets"?
<TTilus>
aszurom: or File.dirname(var)
<coyo>
one does not simply fine tune one's compile targets
Facefox has quit [Remote host closed the connection]
<aszurom>
every time I try to build something by hand, I find out that it was built-in all along
<aszurom>
which is fine by me
<shevy>
wmoxam I think he wanted to compile and use stuff he wants, rather than get this option presented by other developers (archlinux packagers)
bluOxigen has quit [Ping timeout: 256 seconds]
<phipes>
i have a modular sinatra app, which has a config.ru and a separate file that contains: puts …, i want to see the output in the terminal but i don't know how
<shevy>
I dont know what CFLAGS archlinux uses by default. dont think it will be O3
<wmoxam>
shevy: yeah, but for what purpose?
<wmoxam>
"Because I want to" ??
invalidusrname has joined #ruby
<TTilus>
phipes: would you possibly be debugging with that puts?
Facefox has joined #ruby
Facefox has quit [Max SendQ exceeded]
<shevy>
wmoxam dunno really. for extra speed perhaps, for some other configure options, perhaps for httpd server inbuilt with some extra modules, or to compile something statically (I actually compile the base stuff of linux statically... make, m4, coreutils and a few more programs)
<wmoxam>
shevy: sounds like a bunch of horse shit to me
<shevy>
wmoxam what distribution do you use?
Facefox has joined #ruby
<wmoxam>
shevy: currently OSX (laptop) + Ubuntu (desktop)
<phipes>
TTilus: yes, i want to know how to log the output of some ruby files that's outside MyApp < Sinatra::Base
linus95014 has joined #ruby
<wmoxam>
I'd run OpenBSD on the desktop, but I decided I wanted to play some SC2 on the desktop
<coyo>
supcom2 <3
<TTilus>
phipes: how about logger?
<wmoxam>
OpenBSD just doesn't have the 3D support. Plus I just didn't want to fuck around configuring an OS
<TTilus>
phipes: or if you are debugging, pry
davidcelis has joined #ruby
<wmoxam>
shevy: (I've used many distros in the past. Stuck with Arch for a couple of years at one point)
petercs has quit [Ping timeout: 252 seconds]
robdodson has joined #ruby
maxok has joined #ruby
MrGando_ has joined #ruby
ymasory has quit [Ping timeout: 276 seconds]
celm has joined #ruby
<wmoxam>
I find that a distro with a mass audience cuts down on Yak Shaving. If you run into a problem there a good chance that someone else has and has blogged/created a ticket/posted to a forum about it.
<Boohbah>
More modern use of the term came up in a 1991 Ren & Stimpy cartoon citing "Yak Shaving Day," a Christmas-like Holiday where participants hang diapers instead of stockings, stuff rubber boats with cole slaw, and watch for the shaven yak to float by in his canoe.
<lectrick>
Is there a friendlier synonym for this oft used bit of ruby code? if __FILE__==$0
<lectrick>
idiomatic I should say
ciopte7 has quit [Quit: ciopte7]
bluOxigen has joined #ruby
<heftig>
no
bluOxigen has quit [Changing host]
bluOxigen has joined #ruby
subr00t has quit [Quit: subr00t]
wargasm has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
<Boohbah>
lectrick: if __FILE__ == $PROGRAM_NAME
<RubyPanther>
it is still cryptic and has to be looked up
jimeh3 has joined #ruby
<lectrick>
boo.
<billiamii>
Anybody know whether there are bindings for newer versions of Box2D anywhere? Googling is showing me 1.4.3 (~2007) only.
<RubyPanther>
You could always just add lots of hearts # <3 <3 <3
<lectrick>
also just noticed this from a 7 year old presentation that I never knew until now: "If a variable called SCRIPT_LINES__ is defined to be a Hash, it will be filled with the source of each file it parses (key is file path)"
Bartholomeae has quit [Ping timeout: 245 seconds]
<lectrick>
I can't even alias __FILE__ to something else because, well, of how it works
bluOxigen has quit [Ping timeout: 244 seconds]
GuidovanPossum has left #ruby [#ruby]
looopy has quit [Remote host closed the connection]
Foxandxss has joined #ruby
d3c has joined #ruby
Helius has joined #ruby
ymasory has joined #ruby
<heftig>
billiamii: problem with box2d is that it has a c++ interface
<heftig>
that makes it immediately unappealing to write bindings for
fr0gprince_mac has joined #ruby
<billiamii>
Ahh, that makes sense.
fr0gprince_ has joined #ruby
petercs has joined #ruby
krz has joined #ruby
zeromodulus has quit [Remote host closed the connection]
<Hanmac>
billiamil i may could look at the classes of box2d but it think it should be easy to make ruby bindings for it ... (only ruby1.8 could be problematic)
bosphorus has joined #ruby
jackiechan0 has quit [Quit: Sto andando via]
awarner has joined #ruby
IPGlider has joined #ruby
dnyy has joined #ruby
davidw has joined #ruby
davidw is now known as Guest21949
apeiros_ has joined #ruby
<Hanmac>
i mean billiamii
Jackneill has quit [Ping timeout: 260 seconds]
Guedes is now known as Guedes_out
kpshek has quit []
geekbri has joined #ruby
Bosma has joined #ruby
conor_ireland has joined #ruby
<billiamii>
Hanmac, that would be awesome. There are some things that chipmunk does not handle (continuous collision detection) that I understand box2d does.
mib_mib has joined #ruby
lorandi has quit [Quit: Leaving]
<mib_mib>
hi guys, i'm having trouble getting ruby 1.9.2 to install - the package is supposedly called ruby1.9.1-full but it is only installing ruby1.9.1 ( see this link http://www.ruby-lang.org/en/downloads/ ) - i already did sudo apt-get update to update repos - can someone help?
ciopte7 has joined #ruby
<carloslopes>
mib_mib: use rvm or rbenv to install your rubies
<shevy>
mib_mib debian, right?
<mib_mib>
ubuntu
<carloslopes>
mib_mib: it's easier and better :)
<shevy>
yeah quite the same, ubuntu just reuses all choices debian makes
<mib_mib>
yep
<shevy>
mib_mib, the problem is that, basically, debian decided how things shall happen for ruby on debian (and ubuntu and all the other derivatives)
<mib_mib>
i would use rvm but i cant really make that choice right now, just need 1.9.2
schovi has quit [Remote host closed the connection]
<shevy>
so the proper way, if you decide to stick in the debian scheme, is to ask them how a user is supposed to install that
netogallo has quit [Ping timeout: 260 seconds]
<carloslopes>
mib_mib: hmm understood :)
<shevy>
mib_mib, Hanmac here is a debian guru
<shevy>
he also uses the ruby that comes with debian
<aszurom>
when you create an array by saying array2 = array1 and you change elements in array1, it also changes array2. I read about that, but forget how you prevent that
Bosma has quit [Quit: leaving]
heftig has joined #ruby
<shevy>
aszurom you could do array1.dup
<chrisbdaemon>
mib_mib: install rvm, then use rvm to install ruby 1.9.2
<aszurom>
.dup it is
<aszurom>
thanks
<wmoxam>
mib_mib: what version of debian?
<Hanmac>
mib_mib, the package is only called 1.9.1 but its 1.9.2
<wmoxam>
mib_mib: because that probably is 1.9.2 or 1.9.3
luxurymode has quit [Quit: Computer has gone to sleep.]
linoj_ has joined #ruby
<shevy>
:)
<mib_mib>
Hanmac: no, after i installed it i did ruby - v and its 1.9.1
<wmoxam>
mib_mib: which version of debian?
<mib_mib>
10.04
<wmoxam>
ah, Ubuntu
<Hanmac>
yeah your ubuntu is a bit old .P
<mib_mib>
yes, ubuntu
<mib_mib>
yes =D
<wmoxam>
mib_mib: yeah, packaged Ruby pre 11.04 sucks
<mib_mib>
lolol
harukomoto has joined #ruby
<mib_mib>
is it possible that people just arent updating the package for 10.04?
<fowl>
billiamii, hav you played with chipmunk much
kpshek has joined #ruby
<Hanmac>
mib_mib: apt-get dist-upgrade
Urth|Away is now known as Urthwhyte
<wmoxam>
mib_mib: most people don't use the Ubuntu ruby package pre 11.x
linoj has quit [Ping timeout: 240 seconds]
linoj_ is now known as linoj
<wmoxam>
rubygems is the real problem in those older releases :/
<mib_mib>
Hanmac: if i upgrade my distro - will it affect my current filesystem?
<Urthwhyte>
Most people use rvm though
rippa has quit [Read error: Connection reset by peer]
<wmoxam>
Urthwhyte: depends
<Hanmac>
nope, your filesystem should be fine
<mib_mib>
Hanmac: will it install all the same package for the new distro?
rippa has joined #ruby
<Urthwhyte>
Upgrading the distro to upgrade your ruby version is -_-
yankov has quit [Quit: yankov]
ryanf has quit [Ping timeout: 260 seconds]
<billiamii>
fowl, I have not
<Tasser>
Urthwhyte, that's why I use archlinux :-)
dzhulk has joined #ruby
<Hanmac>
Urthwhyte: yeah and you still uses IE6 right?
<wmoxam>
Tasser: so you can upgrade your distro all the time?
zeromodulus has joined #ruby
<Urthwhyte>
Hanmac: that's a ridiculous line of argument
<Tasser>
wmoxam, indeed
<Urthwhyte>
if I was going to stick with something that's no longer being supported, roll your own debs
<Tasser>
wmoxam, gradual upgrade pain instead of all-at-once ;-)
delinquentme has quit [Ping timeout: 276 seconds]
<Urthwhyte>
I prefer OS X
* Hanmac
is daily packages not new enough
<Urthwhyte>
nothing works exactly as I want it to, and upgrades break stuff with no choice involved!
<wmoxam>
lol
C0deMave_ has joined #ruby
<Tasser>
Urthwhyte, you forgot the money you've got to pay for it ;-)
mengu has quit [Quit: Konversation terminated!]
<wmoxam>
I'm a psyco who requires complete control over everything all the time
<wmoxam>
That's why I use Gentoo
xnm has quit [Quit: WeeChat 0.3.7]
<wmoxam>
and spit on anyone else
<graspee>
gentoooooo
<graspee>
EMERGE, MY CREATURES
<wmoxam>
ahahahaa
<Urthwhyte>
hah
<Tasser>
pacman, EAT THEM ALL!
chrisbdaemon has left #ruby [#ruby]
<Urthwhyte>
All I want is Xmonad for OS X
schovi has joined #ruby
<Tasser>
Urthwhyte, grab some ObjC and start hacking
shadoi has quit [Remote host closed the connection]
<graspee>
it must be because i'm new to ruby but i can't understand the question exactly
Solnse has joined #ruby
francisfish has joined #ruby
fayimora has joined #ruby
kpshek has joined #ruby
beneggett has joined #ruby
v0n has joined #ruby
beneggett has quit [Client Quit]
hukl has quit [Quit: Leaving...]
looopy has joined #ruby
<Mon_Ouie>
I also tend not to understand your questions
conor_ireland has quit [Quit: slán]
<any-key>
lol same
<graspee>
the answer can't be as easy as "well delete the initialize method with your text editor"
oooPaul has joined #ruby
Guest21949 has quit [Read error: Operation timed out]
<graspee>
could it be that you want the hash to be initialized when you create the object, but somehow the data is not being stored and you think that the initialize method is being called again but actually the problem is something else?
<becom33>
graspee, wait lemme show you somthing
<graspee>
ok
mdw_ has joined #ruby
francisfish has quit [Remote host closed the connection]
<Hanmac>
run as long as you can :P
<graspee>
my legs were surgically amputated in 1993
<graspee>
so that won't be far
d3c has quit [Quit: Quit]
<Hanmac>
then crawl
test34 has quit [Ping timeout: 265 seconds]
<davidcelis>
well this escalated quickly
<graspee>
i was just kidding
<graspee>
but that wasn't the reaction i was expecting!
chienpo has left #ruby [#ruby]
mdw has quit [Ping timeout: 245 seconds]
<becom33>
https://gist.github.com/e5922bc7be3bd9ba5159 this is a output of my privious paste and two more files which I'm using to input data into the hash in my privious file .
<any-key>
stay class, #ruby
<Hanmac>
you are the next victim
<graspee>
if my legs had been amputated i'd probably be pretty offended right now
* graspee
makes note not to share any real personal information
<becom33>
the problem is if you can see after "setindex"=>{:type=>"c", :disc=>"will clean the screen " the hash gets reset . I guess its because of the initialize
aszurom has quit [Quit: Leaving]
Urth|Away is now known as Urthwhyte
<davidcelis>
your code is scary
<graspee>
give me a sec
<becom33>
davidcelis, why is that ?
<davidcelis>
well, for one, hard tabs with a size of 8
<davidcelis>
odd indentation in general
<davidcelis>
not very readable overall
<graspee>
it's only short code fragments i can cope
linoj has quit [Quit: linoj]
<any-key>
put it in vim, and type ggVG=
<becom33>
there is nothing to read
ciopte7 has quit [Quit: ciopte7]
<becom33>
only two files of few lines coe
<becom33>
code *
philcrissman_ has quit [Remote host closed the connection]
Facefox has quit [Remote host closed the connection]
<Urthwhyte>
any-key: gg=G should work actually
<any-key>
Urthwhyte: neat!
<graspee>
is this for a virus scanner or something?
<any-key>
ah duh = takes a modifier
<Urthwhyte>
yup
adeponte has joined #ruby
<becom33>
umm ??
awarner has quit [Remote host closed the connection]
luxurymode has joined #ruby
Facefox has joined #ruby
yeggeps has quit [Ping timeout: 252 seconds]
<Veejay>
Would you guys use each_slice to split an array into two equal halves? something like enum = a.each_slice(a.size / 2); [enum.next, enum.next]
cek has joined #ruby
<graspee>
i have tried reading through it, becom33 but i'm not good enough at ruby yet. i don't think i can help you sorry
<Veejay>
Any other simpler method is welcome
<Veejay>
Maybe slice itself
<cek>
Anyone familiar with shoulda? Why is it runing my setup block for each test even if tests are beneath a level of context?
fayimora has quit [Ping timeout: 240 seconds]
<any-key>
Veejay: slice on size/2
<Mon_Ouie>
davidcelis: Except tabs = 8 spaces is just what you see on the web page, not necessarily what he sees in his editor
<novodinia>
how would you use ri to lookup info on "alias"?
<graspee>
ri alias
<becom33>
graspee, well self those modules are called in to a one class . so I need do include Module . soo that self is used to do the include automatally all the modules in a dfir
<becom33>
./lib/helpset.rb:14:in `set': undefined method `[]=' for nil:NilClass (NoMethodError)
schovi has quit [Remote host closed the connection]
<graspee>
you need to call new on the class so it can initialize
Gavilan has joined #ruby
<becom33>
i guess thats what Singleton was doing
<graspee>
you will need to have um i dunno a global variable maybe? i'm such a noob, that holds an instance of helpset
<rking>
gem install should put the doc stuff in a background process.
<becom33>
graspee, I was stickly pohibited to use global variable unless its really necessary :/ shevy
etehtsea has joined #ruby
<graspee>
?! who strictly prohibited yoU?
cearls has joined #ruby
davidcelis has joined #ruby
<rking>
graspee: He's not ready for it.
<rking>
graspee: I wouldn't recommend globals until like month 6
<graspee>
i just wondered whether we helping someone do their class assignment or their job
ghanima has left #ruby ["Leaving."]
looopy has quit [Remote host closed the connection]
<rking>
Nah.
<rking>
Only a #ruby prohibition.
bglusman has quit [Remote host closed the connection]
bglusman has joined #ruby
bglusman has quit [Read error: Connection reset by peer]
<graspee>
i wouldn't pay any attention to that then
IPGlider has quit []
schovi has joined #ruby
niklasb has quit [Ping timeout: 252 seconds]
looopy has joined #ruby
<graspee>
if the same channel that tells you that you can't use a global variable can't help you with the problem you get from not using it then there's something wrong
<novodinia>
ri alias gives
<novodinia>
.alias not found, maybe you meant: RVM::Environment#alias_create
kylemcgill has joined #ruby
<novodinia>
#alias_list, etc.
<graspee>
in my pry it works
<graspee>
i don't know what i did different, sorry
<graspee>
wait, are you typing ri .alias or ri alias?
visof has joined #ruby
visof has quit [Changing host]
visof has joined #ruby
leonid00 has joined #ruby
<graspee>
nvm both work
brianpWins has quit [Quit: brianpWins]
tilde` has joined #ruby
mvangala_ has joined #ruby
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
iamjarvo has joined #ruby
leonid00 has left #ruby ["*.net *.split"]
albemuth has quit [Ping timeout: 245 seconds]
thecreators has joined #ruby
dhaskew has joined #ruby
cearls_ has joined #ruby
cearls_ has quit [Client Quit]
kevinbond has quit [Quit: kevinbond]
phantasm66 has quit [Quit: *sleeeeep*]
etehtsea has quit []
albemuth has joined #ruby
cearls has quit [Ping timeout: 252 seconds]
cek has quit [Quit: жопа диридай диридиридай]
wiwillia has quit [Ping timeout: 244 seconds]
nlc has quit [Quit: Leaving]
<Mon_Ouie>
novodinia: That's because alias is syntax, not a method
yxhuvud has quit [Ping timeout: 248 seconds]
<Mon_Ouie>
(btw, alias_method is a method that has the same effect)
carlyle has quit [Remote host closed the connection]
theRoUS has quit [Ping timeout: 260 seconds]
Urthwhyte is now known as Urth|Away
zaiste_ is now known as zaiste
<Seabass>
MF,GDI how do I turn off join/quit notifications in XChat?
davidpk has quit [Quit: Computer has gone to sleep.]
<novodinia>
i thought it would break only if a wasn't a string
invalidusrname has quit [Quit: invalidusrname]
<Seabass>
grats wmoxam
<Seabass>
guess I identify with Tom Waits too much
<avandenhoven>
bnagy: I've been thinking about that weird problem with $1 you and I were looking at last night (https://gist.github.com/ac5508c50bd1435174d7). I wonder if there is something in _my_ code that could cause $1 to stop working as expected.
bigkevmcd has joined #ruby
<novodinia>
what i'm trying to do is access parameters passed to a function
<graspee>
a isn't a string, is it, novodinia ?
<novodinia>
how do you do that?
<fowl>
Seabass, then i can make an assumption that you are, by association, incredibly awesome. don't let me down (:
<novodinia>
graspee: it's a "symbol" supposedly
<Synthead>
with Erubis, can I pass binding() (to pass all local variables) and a couple other variables too?
<canton7>
novodinia, it is a symbol
<graspee>
well you can't plusserize it then afaik
TTilus has quit [Read error: Operation timed out]
<novodinia>
i figured it would be a variable of type 'string', or at least that's what i figured ruby would enforce automatically
<canton7>
novodinia, call .to_s on it if you want to convert it to a string, or use string interpolation to get rid of all of those +'s
bbttxu has quit [Quit: bbttxu]
chson has quit [Remote host closed the connection]
<Seabass>
fowl, maybe awesomely creative. I've only decided that Ruby is my new Legos.
TTilus has joined #ruby
<Mon_Ouie>
Does it also hurt when you accidentally step on your rubies bare feet, which happens all the time?
jonathanwallace has quit [Remote host closed the connection]
dv310p3r has quit [Read error: Operation timed out]
mneorr has joined #ruby
<novodinia>
thanks
<fowl>
lol
aaroncm has quit [Remote host closed the connection]
<Seabass>
that was my mothers problem, she was blind LOL
<canton7>
novodinia, however the next bit of your gist doesn't make sense... what exactly are you trying to do?
mneorr_ has quit [Read error: Connection reset by peer]
zii has quit [Ping timeout: 248 seconds]
SuperrMann has joined #ruby
kevinbond has joined #ruby
heftig has quit [Ping timeout: 245 seconds]
mdw has quit [Remote host closed the connection]
MasterIdler_ has joined #ruby
MasterIdler_ has quit [Client Quit]
<Seabass>
well I'm off for a while to go do this KOAN tutorial thing with all the eastern philosophy references
welterde has quit [Ping timeout: 264 seconds]
TorpedoSkyline has joined #ruby
MasterIdler has quit [Ping timeout: 244 seconds]
Karmaon has joined #ruby
<becom33>
i had enough . going to sleep
<becom33>
bye
becom33 has quit [Quit: Leaving]
heftig has joined #ruby
Morkel has quit [Quit: Morkel]
flori_ is now known as flori
<Seabass>
attempted to make witty remark about virtual feet stepping on rubies, but... failed...
cgag has quit [Ping timeout: 248 seconds]
markjwlee has joined #ruby
<markjwlee>
hi all
<Mon_Ouie>
Also, rubies are kind of expansive when compared to legos
brianpWins has joined #ruby
TorpedoSkyline_ has joined #ruby
<markjwlee>
Can someone tell me what the ideal/conventional location would be in the linux filesystem structure to place ruby web apps?
TorpedoSkyline has quit [Disconnected by services]
DrShoggoth has quit [Quit: Leaving]
kil0byte_ has joined #ruby
kil0byte has quit [Ping timeout: 244 seconds]
<novodinia>
canton7: i was just defining a function and trying to access its parameters
<rking>
Anyone know how to start a regex match at a position offset? In perl you can assign to pos($str).
welterde has joined #ruby
<Urthwhyte>
rking: hackiily, you can just split the string
<Seabass>
Ruby gems are inexpensive compared to Legos, and I can keep more of them in a box
<rking>
Urthwhyte: Surely that's not the only way.
TorpedoSkyline has joined #ruby
<rking>
Urthwhyte: If anything I'd do /(?:.{#{offset})#{real_regex}/
TorpedoSkyline_ has quit [Ping timeout: 240 seconds]
alanp has quit [Remote host closed the connection]
<rking>
I'm porting a thing from Perl and I know this is a touchy area of the code (it's part of a parser), if I don't get it just right I'm pretty sure everything will explode everywhere always.
<Urthwhyte>
heh
<rking>
Oh goodness. There's a 2nd param to .match
kil0byte_ has quit [Ping timeout: 240 seconds]
<rking>
'asdf'.match /./, 2 ⇒ 'd'
wmoxam has quit [Ping timeout: 276 seconds]
ahuman_ has joined #ruby
ciopte7 has quit [Quit: ciopte7]
kpshek has quit []
<eam>
why is it that 'ri' documentation never fully documents the calling signature of methods (eg, String#match doesn't mention a second arg)
alanp has joined #ruby
<rking>
eam: Maybe because that's hard to parse? E.g. it could be "arg1, *args"
<oooPaul>
eam: My copy of it does.
<oooPaul>
str.match(pattern) or str.match(pattern, pos)
<eam>
Aah, the second arg didn't exist in 1.8 :)
kil0byte has joined #ruby
albemuth has quit [Ping timeout: 245 seconds]
PragCypher has quit [Read error: Connection reset by peer]
PragCypher has joined #ruby
<fowl>
time to quit 1.8
<fowl>
it being 2012 and all
mvangala_ has quit [Ping timeout: 245 seconds]
albemuth has joined #ruby
Zolrath has quit [Quit: Computer has gone to sleep.]
joshman_ has quit [Quit: Computer has gone to sleep.]
axl_ has quit [Quit: axl_]
n1x has quit [Quit: Ex-Chat]
ken_barber has quit [Remote host closed the connection]
axl_ has joined #ruby
<Seabass>
fml I can't even follow a ruby tutorial well enough to learn
saschagehlich has quit [Ping timeout: 248 seconds]
<Seabass>
rking I kinda cheated and got the answer by trail and error without really understanding, so I'ma stop there for now
<rking>
Seabass: There are thousands of ways to cheat the Koans. Figuring out the ways is probably a valuable exercise in itself, but knowing what they meant by the test is important.
linus95014 has quit [Quit: linus95014]
Facefox has joined #ruby
<rking>
Seabass: Which part of that are you confused about?
<Seabass>
rking maybe I'm over eager to learn faster than I should be, trying to jump in the deep end of the pool
aantix has quit [Ping timeout: 260 seconds]
<rking>
Seabass: The Quickstart can literally be 20min long (only longer if you spend more quality time goofing off in irb).
<Seabass>
I don't know what the ex is
<Seabass>
I don't know what ex.class means
<Seabass>
I don't know how they expect me to now I should type NoMethodError
awarner has quit [Remote host closed the connection]
<rking>
Seabass: Aha. It's an Exception. It's like a weird flow control tool. You can be deep in some code somewhere and throw an Exception that starts bubbling back up the call stack until something handles it.
liluo has joined #ruby
<Seabass>
like a bubble come up from the deep of the dark ocean
<rking>
Seabass: For example, if you try to read from a file that doesn't exist on the disk, you'll get an Errno::ENOENT: No such file or directory exception.
fbernier has joined #ruby
Chryson has joined #ruby
<Sou|cutter>
Exceptional Ruby is an interesting book
<Alantas>
Exceptions are used for signaling errors. It basically aborts all active function calls up to the point where something says it's willing to handle that type of exception.
<Seabass>
hey boss we got a problem; I don't know how to deal with it, let me ask my boss;
linus95014 has joined #ruby
<Seabass>
upper management is on it
<rking>
Seabass: The nice thing about Exceptions is that each method can opt in or out of the error handling. E.g., the very last method might begin/rescue/end the Errno::ENOENT exception and know what to do if the file didn't exist, such as create it and keep going… or none of the layers could handle it, leaving it up to the default handler, which will print an error message and exit.
<rking>
Seabass: That's a good way of putting it.
<Seabass>
i c
<Alantas>
Exceptions are good. a(); b(); If a() raises an exception on failure, and you get past a(), you can safely assume a() succeeded; you don't need to check return codes or the like.
<rking>
Sou|cutter: Ahh, cool. I might follow on with that after Metaprogramming Ruby (which I 100% recommend, btw. It's not only about wizardry/weird stuff)
<rking>
Anyone know where the default Exception handling lives?
<Sou|cutter>
rking: ooh, I have not read that. Thanks :)
piotr__ has quit [Ping timeout: 276 seconds]
<Seabass>
ok I'm going to go do the ruby in 20 min tutorial
novodinia has quit [Quit: leaving]
<Alantas>
And when something raises an exception, it could be caught in different places (depending on the current call stack), each of which can handle it in their own way. It's like returning a value from a method (different callers can use your return value in their own ways), except you return PAIN.
<eam>
win 1
<Seabass>
PAIN?
mneorr has quit [Remote host closed the connection]
<graspee>
if you want to set something to a string then you could do name=name.to_s i think
<Seabass>
let me meditate on that for a second to see if I get a lightbulb
<Alantas>
Yeah. You can't convert it in-place, you'd have to assign it like graspee showed.
<graspee>
well let's say x is 4
<graspee>
x is 4 so it's a number, x.to_s will be "4" a string, but that's an expression- you're not actually changing x
<graspee>
if you want to do that you have to use assignment like x=x.to_s
<Alantas>
Right.
<Seabass>
got it
<Alantas>
It's like 1+2, you're not changing the value of 1 or 2, you're getting a new value.
<Seabass>
expression is needs to be part of a statement to manipulate variable
<graspee>
yes
<graspee>
well, in assignment you are setting a variable to the value of an expression
Vainoharhainen has joined #ruby
benatwork has quit [Remote host closed the connection]
<Alantas>
It's like taking a picture of the variable. name.to_s takes the picture (it "evaluates to" the string), but what do you do with it?
<graspee>
so in x=x.to_s x is a variable, x.to_s is an expression and the whole thing is an assignment statement
<graspee>
and = is the assignment operator
<rking>
I need to find the official definitions for "expression" and "statement".
<Seabass>
so let me see if I can successfully h(somepersonsname) now
<graspee>
actually technically, x=x.to_s the whole thing is an expression too
<graspee>
because you can do y=x=x.to_s
tobym has quit [Remote host closed the connection]
<rking>
An expression is a suitable RHS?
<graspee>
but that's a bit confusing right now
<Seabass>
your face is an expression
<rking>
E.g., something with a value.
<graspee>
it is right now!
<Seabass>
ROFL
ZachBeta has joined #ruby
<rking>
Wikipedia actually goofs it up, saying that "In most languages, statements contrast with expressions in that statements do not return results and are executed solely for their side effects, while expressions always return a result and often do not have side effects at all."
mvangala_ has joined #ruby
<rking>
That's clearly not true.
<rking>
I'd be interested to find even one language where that holds.
<graspee>
basic?
<rking>
I donno, does it?
<graspee>
in most basic basics statements don't return results
mvangal__ has joined #ruby
<graspee>
let x=3, goto porcupine,
<graspee>
gosub pangolin
<graspee>
return
<graspee>
none of those return anything. they are just statements
<rking>
Hrm. And then no expressions have side-effects?
<graspee>
depends on the basic again
<graspee>
if an expression has a function call in it then obviously it has a side effect if you want
<rking>
Basically, in a language where expressions cannot have side effects, and statements can't evaluate to a value, you could never have an open().
rodent` has joined #ruby
rodent` has quit [Remote host closed the connection]
<LiquidInsect>
Seabass: you still seem to expect name.to+s to do something to name
<LiquidInsect>
er, name.to_s that is
<graspee>
you need to call it with a string
<LiquidInsect>
graspee: that's not it
<graspee>
i think you think that calling the function with like robert is going to turn robert into a string
<graspee>
by putting quotes round it
<LiquidInsect>
graspee: oh oh oh that may be what's he's doing yeah
<Seabass>
I want h to accept h"name" and h(name) and still print "hello name!"
<Mon_Ouie>
I always thought #to_s was a confusing name — I see it more like "as_s"
<LiquidInsect>
Seabass: that's not possible
<graspee>
you need to call your function like h("bobby")
mvangala_ has quit [Ping timeout: 256 seconds]
<graspee>
and you don't need the whole .to_s line
<canton7>
LiquidInsect it is... but it's hacky
<graspee>
just take out line 2
gtuckerkellogg has joined #ruby
<graspee>
and make sure you put quotes round the name you pass to the fn and it will be fine
<LiquidInsect>
canton7: well. maybe. You'd need to get into the caller's context and find out which local variable was passed in and oh god I'm gone crosseyed
<Alantas>
graspee: You don't need to_s for interpolating the bare variable into the string; but you do if you want to call string-specific methods on it, like capitalize().
dtang has joined #ruby
<graspee>
oh i didn't know that
<Seabass>
so I'm trying to do something I should be trying to do
<graspee>
sorry to be confusing then
<LiquidInsect>
Alantas: sure, but he really should just chain the methods anyway, name.to_s.capitalize
<Alantas>
LiquidInsect: Indeed. I already suggested that.
<LiquidInsect>
ah.
<Seabass>
mostly I think I am trying to see what the difference between h() and h"" is
<LiquidInsect>
I have like no back buffer and I refuse to press pgup.
<canton7>
LiquidInsect, there's a trick with using method_missing to support bare strings, but doesnt' seem to be working in 1.9 boo
kirun has quit [Quit: Client exiting]
<graspee>
the brackets are not needed but most people like them for style
<Alantas>
h() calls it with no argument. h("") calls it with one argument, an empty string.
<LiquidInsect>
canton7: oh I know you can do weird things, I did this a while back... let me find it
<Mon_Ouie>
Seabass: and h("foo") and h"foo" are the same thing
<Alantas>
In this case, h()'s first argument will default to "World".
<LiquidInsect>
I was bored.
<Seabass>
I get it parenths are always there wheither I type them or not
<Alantas>
So h() will print "Hello World!" while h("") -- which overrides the default -- will print "Hello !"
cableray has quit [Quit: cableray]
Solnse has quit [Read error: No route to host]
<Mon_Ouie>
h(foo) calls h with the object referred to be the local variable foo (or the result of calling the foo method if that variable doesn't exist)
<Alantas>
Seabass: Yes. But parentheses are not a substitute for the "quote" marks: if you want a literal string, you always need them.
<indeterminate>
Didn't realize PHP used that syntax too.
<indeterminate>
In some languages, "1" == 1 is true while "1" === 1 is false.
<LiquidInsect>
so it's just sugar for is_a?
<LiquidInsect>
bleh
<LiquidInsect>
shouldn't use that for case statements either
<Alantas>
LiquidInsect: When used with a class on the left side, yes, basically.
<canton7>
it's designed to be overridden, see the same method in Object
<Alantas>
case foo; when herp; ...; when derp; ...
<LiquidInsect>
if you're doing if foo.is_a? Bar then x elsif foo.is_a? Baz then y, you're doing it wrong
<Alantas>
This matches on herp===foo or derp===foo respectively.
<LiquidInsect>
you implement the behavior in each class and just call the same method
<LiquidInsect>
duck typing exists for a reason
<LiquidInsect>
well. same named method
<LiquidInsect>
which does different things in each class
<Alantas>
Class has === for "is-a" relationships, so you can do stuff like: case foo; when Integer; "it's an integer"; when String; "it's a string"; etc
<LiquidInsect>
sure. Or you implement whatami in String and Integer to do what you want and just call whatami on the object
<LiquidInsect>
whichever type it is it'll do what you want
king313 has quit [Quit: .]
<Alantas>
case "foo"; when /^f/ then "starts with f!"; when /^t/ then "starts with t!"; else "what is this i dont even"; end
tomzx has joined #ruby
<Alantas>
Regexp#=== does a match operation.
Beoran_ has quit [Ping timeout: 252 seconds]
<LiquidInsect>
and its behavior is then defined in the object's class, not some third class that shouldn't need to know what the object is
<Alantas>
So, === is not "like == but with adjustments"; it's more like "case_match?".
<David_Mi1ler>
good evening folks, can I span a long if clause across multiple lines?
rdesfo has quit [Ping timeout: 245 seconds]
<Alantas>
David_Mi1ler: Yep.
<David_Mi1ler>
Alantas: I must be doing something wrong then
<Alantas>
Wait. By "clause", do you mean the conditional part or the body?
<Alantas>
if conditional; body; end
<David_Mi1ler>
conditional
<indeterminate>
Are you doing something like "if x || y || z # ... ; ...; end"?
jonatha__ has joined #ruby
<LiquidInsect>
if your conditional is that long, consider moving it to a separate method
<indeterminate>
If so, you can do if x || y ||\nz ; ... ; end
mdhopkins has joined #ruby
fbernier has quit [Ping timeout: 260 seconds]
DanBoy has quit [Remote host closed the connection]
<David_Mi1ler>
LiquidInsect: that is good advice and I've already done a little of that
<Alantas>
Yeah. Otherwise it'll be interpreted as end-of-expression.
<indeterminate>
You may also be able to use \ at the end of a line to continue it. I forget if Ruby has that.
<canton7>
if it's not clear that the statements isn't finished yet, you need to use a \ to tell ruby you're continuing it
<canton7>
s/statements/statement
<Alantas>
\, or just an operator at the end.
TorpedoSkyline has quit [Read error: Connection timed out]
billiamii has joined #ruby
ragnok has joined #ruby
<David_Mi1ler>
excellent, thanks everyone
jonathanwallace has quit [Ping timeout: 260 seconds]
MrGando has joined #ruby
<David_Mi1ler>
\ at the end does it
TorpedoSkyline has joined #ruby
<David_Mi1ler>
because I think its more readable that way but others may disagree :)
ragnok has left #ruby ["Leaving"]
Asher has quit [Remote host closed the connection]
<Alantas>
if (bad_practice || can_be_excused || and_you_do_not_want_to_make_a_function && that_can_be_abused) burma_shave
<indeterminate>
haha
Asher has joined #ruby
jayrulez has quit [Remote host closed the connection]
tatsuya_o has joined #ruby
berserkr1 has joined #ruby
cousine has joined #ruby
jonatha__ has quit [Remote host closed the connection]
jayrulez has joined #ruby
UdontKnow has quit [Read error: Operation timed out]
kickroot has quit [Read error: Operation timed out]
berserkr has quit [Ping timeout: 276 seconds]
DarkFoxDK has quit [Read error: Operation timed out]
SirFunk has quit [Ping timeout: 245 seconds]
jshsu has quit [Ping timeout: 250 seconds]
jonathanwallace has joined #ruby
xpot-station has quit [Read error: Connection reset by peer]
nuba has quit [Read error: Operation timed out]
Beoran_ has joined #ruby
elliottcable has quit [Ping timeout: 245 seconds]
mlue has quit [Ping timeout: 252 seconds]
kevinbond has joined #ruby
cid404 has quit [Ping timeout: 250 seconds]
looopy has quit [Remote host closed the connection]
AnswerGu1 has quit [Ping timeout: 240 seconds]
oddraisin has quit [Ping timeout: 244 seconds]
pradeepto has quit [Ping timeout: 244 seconds]
bpgoldsb has quit [Ping timeout: 248 seconds]
hoelzro|away has quit [Ping timeout: 272 seconds]
SecretAgent has quit [Ping timeout: 272 seconds]
warebec|1at has quit [Ping timeout: 265 seconds]
skinny_m has quit [Ping timeout: 276 seconds]
d_roge has quit [Ping timeout: 276 seconds]
wmoxam has joined #ruby
bfrog has quit [Ping timeout: 260 seconds]
wmoxam has quit [Changing host]
wmoxam has joined #ruby
rdesfo has joined #ruby
cdepue has quit [Remote host closed the connection]
fbernier has joined #ruby
gtuckerkellogg has quit [Quit: Computer has gone to sleep.]
rdesfo has left #ruby [#ruby]
mlue has joined #ruby
iocor has quit [Quit: Computer has gone to sleep.]
Targen_ has quit [Ping timeout: 245 seconds]
Dreamer3 has joined #ruby
nari has joined #ruby
cdepue has joined #ruby
<shadoi>
burma_shave?
wilmoore has quit [Remote host closed the connection]
tatsuya_o has quit [Remote host closed the connection]
MrGando has quit [Quit: Bye]
<shadoi>
ah, got it.
<shadoi>
Interesting.
patrick99e99 has joined #ruby
ramblex has quit [Quit: ramblex]
oooPaul has quit [Quit: Ciao for now!]
<patrick99e99>
Hi everyone... I have a question about passing around blocks..... I am trying to DRY up some rspec test code, and I am getting a scope error now.. can anyone give me some suggestions on how I might be able to do this better? https://gist.github.com/2778523
<rking>
Can someone show me where my assumption is failing? str = 'Welcome to Zombocom'; [ str.match(/Welcome /), str.match(/\Gto Zombocom/) ] # This returns [#<MatchData "Welcome ">, nil]
<rking>
I expected it to be a pair of matches, not only the first one.