apeiros_ changed the topic of #ruby to: Ruby 1.9.3-p194: http://ruby-lang.org || Paste >3 lines of text on gist.github.com || Rails is in #rubyonrails || Log: http://irclog.whitequark.org/ruby
nari has quit [Ping timeout: 255 seconds]
PaciFisT has joined #ruby
pingveno has quit [Remote host closed the connection]
r0bby has joined #ruby
crankycoder has quit [Remote host closed the connection]
robbyoconnor has quit [Ping timeout: 240 seconds]
r0bby is now known as robbyoconnor
sunblush has joined #ruby
Foxandxss has quit [Quit: KVIrc 4.0.4 Insomnia http://www.kvirc.net/]
davidpk has quit [Quit: Computer has gone to sleep.]
deryl has joined #ruby
vitor-br has joined #ruby
jimeh3 has joined #ruby
krusty_ar_ has quit [Read error: Connection reset by peer]
jimeh3 has quit [Ping timeout: 248 seconds]
benson has quit [Quit: Leaving]
nai has joined #ruby
baphled has joined #ruby
josefig has quit [Remote host closed the connection]
iocor has quit [Quit: Computer has gone to sleep.]
nai has quit [Remote host closed the connection]
nai has joined #ruby
PaciFisT has quit [Quit: Leaving.]
subbyyy has quit [Read error: Connection reset by peer]
subbyyy has joined #ruby
tds has quit [Quit: tds]
banghouse has quit [Remote host closed the connection]
fbernier has joined #ruby
tds has joined #ruby
yoklov has left #ruby ["bye!"]
g0bl1n has joined #ruby
joch_n has quit [Quit: Linkinus - http://linkinus.com]
joch_n has joined #ruby
joch_n has quit [Client Quit]
liluo has quit [Remote host closed the connection]
cbuxton has quit [Quit: Leaving.]
jwang has quit [Ping timeout: 264 seconds]
nai has quit [Remote host closed the connection]
<tightwork> oh look at that, my fav gem error.. invalid date format
crankycoder has joined #ruby
noganex has quit [Read error: Operation timed out]
cascalheira has joined #ruby
<fowl> tightwork, thats just a warning
ephemerian has left #ruby [#ruby]
noganex has joined #ruby
adamkittelson has quit [Ping timeout: 246 seconds]
fbernier has quit [Ping timeout: 264 seconds]
jamesaxl has quit [Read error: Operation timed out]
sunblush has quit [Quit: sunblush]
tds has quit [Quit: tds]
igotnolegs has joined #ruby
beilabs_ has quit [Remote host closed the connection]
emmanuelux has quit [Ping timeout: 252 seconds]
baphled has quit [Ping timeout: 244 seconds]
igotnolegs has quit [Ping timeout: 250 seconds]
umttumt has joined #ruby
Guedes has joined #ruby
dkissell_ has joined #ruby
dnyy has quit [Remote host closed the connection]
EstanislaoStan has quit [Quit: Bye]
dkissell has quit [Ping timeout: 252 seconds]
dkissell_ is now known as dkissell
g_rotbart has joined #ruby
itnomad has joined #ruby
brianpWins has quit [Quit: brianpWins]
deryl has quit [Quit: deryl]
cascalheira has quit [Remote host closed the connection]
heftig has joined #ruby
deryl has joined #ruby
Hanmac has quit [Ping timeout: 244 seconds]
<shevy> hmmm I have a string ... string = "foobar". now I want to make a hash from this, with one character removed each. example "fooba" => "foobar", "fooba" => "foobar", "foob" => "foobar". is there a simple way to do that?
vantage has joined #ruby
jameshyde has joined #ruby
igotnolegs has joined #ruby
nari has joined #ruby
gorpon has joined #ruby
thecreators has joined #ruby
<offby1> ha, you're doing a puzzle that I saw posted today, aren't you
ken_barber has quit [Remote host closed the connection]
<offby1> shevy: the answer is: almost certainly. However I am not sure what algorithm you have in mind
<ryanf> shevy: Hash[string.length.downto(1).map { |i| [string[0...i], string] }] ?
<ryanf> I bet there's a nicer way
nai has joined #ruby
bikr has joined #ruby
fbernier has joined #ruby
Hanmac has joined #ruby
<rmc3> um
<rmc3> ryanf: that is a lot prettier than the solution I was thinking of :)
<rmc3> but I'm a relative ruby noob
dnyy has joined #ruby
luckyruby has joined #ruby
Travis-42 has quit [Quit: Travis-42]
adamkittelson has joined #ruby
ipoval has joined #ruby
fearoffish has joined #ruby
fearoffish has quit [Client Quit]
bikr has quit [Read error: Connection reset by peer]
Spooner has quit [Ping timeout: 246 seconds]
umttumt has quit [Remote host closed the connection]
Nisstyre has quit [Ping timeout: 246 seconds]
thecreators has quit [Quit: thecreators]
perryh is now known as perry
mwilson_ has quit [Excess Flood]
radic has quit [Disconnected by services]
mwilson_ has joined #ruby
radic_ has joined #ruby
radic_ is now known as radic
EstanislaoStan has joined #ruby
gigi67 has joined #ruby
gigi67 has left #ruby [#ruby]
<EstanislaoStan> What am I doing wrong here? I'm trying to use << to push my command names into this array, but for some reason it seems like it's overwriting the previous name. I must not be using my class variable correctly or something. http://pastie.org/4202020 Thanks!
vantage has quit [Remote host closed the connection]
hugoxrosa has quit [Ping timeout: 240 seconds]
<cirwim> line 6 should be ||=
liuchong has joined #ruby
<cirwim> but you should probably override Command.new instead of Command#initialize to do things like that
<EstanislaoStan> What do you mean by override? And why doesn't << work? Sorry >.<. Don't understand.
<cirwim> EstanislaoStan: << is working fine
gtuckerkellogg has joined #ruby
<cirwim> but on line 6 you are replacing the array by []
emmanuelux has joined #ruby
ciopte7 has joined #ruby
dhodgkin has joined #ruby
Nisstyre has joined #ruby
dnyy has quit [Remote host closed the connection]
noganex has quit [Ping timeout: 244 seconds]
straind` has joined #ruby
noganex has joined #ruby
straind has quit [Ping timeout: 264 seconds]
Guest66238 has joined #ruby
Guest34924 has quit [Ping timeout: 244 seconds]
<ryanf> haha
<ryanf> "you should probably override *.new"
<ryanf> phrases you don't hear very often
savage- has quit [Remote host closed the connection]
<Spaceghostc2c> :D
Hunner has quit [Ping timeout: 245 seconds]
<ryanf> EstanislaoStan: cirwim is right about why it isn't working (you're overwriting @@command_list_array with an empty array every time you make a new Command)
<fowl> use whoreequals! (||=)
<ryanf> but also most people avoid class variables. you might consider writing it like this: http://pastie.org/4202128
pastjean has quit [Remote host closed the connection]
<cirwim> ryanf: you're so much more helpful than me :p
mdszy has joined #ruby
<ryanf> haha
<Spaceghostc2c> fowl: lolwhoreequals
hugoxrosa has joined #ruby
ciopte7 has quit [Quit: ciopte7]
ipoval has quit [Quit: ipoval]
dymk has joined #ruby
<dymk> 'ello, is it possible to create class methods in a module, and then have them included in other classes?
<cirwim> dymk: just define the methods in the module like instance methods; and then 'extend Module' into all the classes you want
notjohn has quit [Quit: notjohn]
<dymk> Would extend Module be called in the class, akin to just including it?
<cirwim> yes
jumpingcloud has quit [Ping timeout: 246 seconds]
<cirwim> extend makes the methods available as class-methods; include makes the methods available as instance-methods
<mdszy> dymk: here's an example
notjohn has joined #ruby
<dymk> Ah, I see, thanks
heftig has quit [Quit: leaving]
<mdszy> np
ilyam has quit [Quit: ilyam]
crankycoder has quit [Remote host closed the connection]
umttumt has joined #ruby
Progster has joined #ruby
heftig has joined #ruby
nai has quit [Remote host closed the connection]
<any-key> how would I go about trapping whatever happens when an error occurs?
<any-key> without doing a try catch block around all of my code
<any-key> I just need to kill something every time an error occurs
<mdszy> you mean begin ... rescue ... end?
<any-key> nonono
<any-key> well
<any-key> I mean, I just don't want to catch all errors
<fowl> any-key, if it makes you feel any better every method has an implied begin block, def foo() raise Error; rescue Error; ...; end
<any-key> that's it!
<any-key> thanks!
<any-key> well
<any-key> no
stefanp has joined #ruby
stefanp has quit [Changing host]
stefanp has joined #ruby
<any-key> if I did begin;rescude;<code>;end I'd have to do stuff
<any-key> wait, can I catch any error, kill the thing I have to, then raise it?
<any-key> I don't want to lose the error information
<fowl> any-key, sure
<fowl> rescue => e; stuff; raise e
<any-key> aha
<any-key> wow, I used to know that
<any-key> I've been writing too much rails >.>
<bnagy> any rails is too much rails
heftig has quit [Ping timeout: 245 seconds]
<mdszy> It always makes me feel better to know I'm not the only one who doesn't like Rails XD
<any-key> lol
<any-key> I like web dev a lot
bbttxu has quit [Quit: bbttxu]
<mdszy> I really like Sinatra.
<any-key> yeah sinatra is neato
<mdszy> Sinatra + HAML = Awesome
radic has quit [Disconnected by services]
radic_ has joined #ruby
radic_ is now known as radic
umttumt has quit [Remote host closed the connection]
stefanp_ has quit [Ping timeout: 265 seconds]
<mdszy> and probably LESS/SASS too. But I always end up using regular ol' CSS.
umttumt has joined #ruby
<Spaceghostc2c> mdszy: I'm always critical of pretty much everything.
<Spaceghostc2c> Especially me. :(
Juul has joined #ruby
<mdszy> heh
minijupe has joined #ruby
<EstanislaoStan> Thanks everyone who helped me earlier. Sorry I didn't respond for so long.
EstanislaoStan has quit []
dhruvasagar has joined #ruby
umttumt has quit [Remote host closed the connection]
umttumt has joined #ruby
hoangtran has joined #ruby
umttumt has quit [Remote host closed the connection]
mockra has joined #ruby
banister`sleep has quit [Read error: Connection reset by peer]
jsime has quit [Quit: Leaving]
apok has quit [Ping timeout: 252 seconds]
banister`sleep has joined #ruby
mwilson_ has quit [Excess Flood]
l2trace99 has joined #ruby
mwilson_ has joined #ruby
Kovensky has quit [Remote host closed the connection]
baroquebobcat has quit [Read error: Connection reset by peer]
heftig has joined #ruby
maxmmurphy has quit [Quit: maxmmurphy]
sonkei has quit [Quit: WeeChat 0.3.8]
baroquebobcat has joined #ruby
sonkei has joined #ruby
ananthakumaran has joined #ruby
ringotwo has quit [Remote host closed the connection]
larissa has quit [Quit: gone]
VegetableSpoon has joined #ruby
mengu has quit [Read error: Connection reset by peer]
Hunner has joined #ruby
Hunner has quit [Changing host]
Hunner has joined #ruby
luckyruby has quit [Remote host closed the connection]
luckyruby has joined #ruby
berserkr has quit [Quit: Leaving.]
tds has joined #ruby
Dreamer3 has joined #ruby
mdszy has quit [Quit: nini]
bradb has left #ruby [#ruby]
delinquentme has joined #ruby
<delinquentme> anyone in here happen to know of a checklist to go through before opensourcing a project for the first time?
Guedes has quit [Quit: Saindo]
nai has joined #ruby
snail has joined #ruby
Bonkers has quit [Quit: Leaving]
<snail> hello all, is http://ruby-doc.org/stdlib-1.9.3/libdoc/rexml/rdoc/REXML/Formatters/Pretty.html broken for everyone or is it being corrupted by the firewall i'm behind?
mohits has quit [Ping timeout: 246 seconds]
<graspee> looks fine to me
<snail> ok, thanks
wookiehangover has quit [Quit: i'm out]
ePirat_ has joined #ruby
wookiehangover has joined #ruby
t3hk0d3|2 has joined #ruby
Progster has quit [Ping timeout: 260 seconds]
ringotwo has joined #ruby
dhruvasagar has quit [Ping timeout: 250 seconds]
t3hk0d3 has quit [Ping timeout: 252 seconds]
tomku has quit [Read error: Connection reset by peer]
dhruvasagar has joined #ruby
nai_ has joined #ruby
tomku has joined #ruby
nai has quit [Ping timeout: 250 seconds]
g0bl1n has quit [Ping timeout: 240 seconds]
justsee has joined #ruby
justsee has quit [Client Quit]
<bnagy> what's the REST cliet lib people use these days?
ilyam has joined #ruby
ePirat_ has quit [Remote host closed the connection]
minijupe has quit [Quit: minijupe]
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
gtuckerkellogg has quit [Quit: Computer has gone to sleep.]
mwilson_ has quit [Excess Flood]
mwilson_ has joined #ruby
ringotwo has quit [Remote host closed the connection]
monkegji_ has joined #ruby
monkegjinni has quit [Read error: Connection reset by peer]
chimkan_ has joined #ruby
digitalcakestudi has joined #ruby
chimkan_ has quit [Client Quit]
ryansch has joined #ruby
fbernier has quit [Ping timeout: 246 seconds]
kpshek has joined #ruby
savage- has joined #ruby
kpshek has quit [Client Quit]
kpshek has joined #ruby
kpshek has quit [Client Quit]
ilyam has quit [Quit: ilyam]
savage- has quit [Remote host closed the connection]
bwlang has joined #ruby
minijupe has joined #ruby
digitalcakestudi has quit [Read error: Connection reset by peer]
ciopte7 has joined #ruby
xscc has joined #ruby
<xscc> o
acotie is now known as {^_^}
savage- has joined #ruby
dymk has quit [Ping timeout: 265 seconds]
<offby1> good question.
emmanuelux has quit [Quit: @+]
<icy`> hi, what happens when an object suddenly dies? is there someth i can mess with before at_exit is triggered? to save data, etc
<offby1> I'm so focused on rails programming that I never gave any thought to client-side stuff
<icy`> when a script* suddenly dies
<offby1> very different question
<offby1> with scripts, I assume that you can "hook" 'exit'.
<offby1> But it's always possible that your script will die from a signal, and won't get a chance to run your code, so it's not a totally reliably way to clean up
<offby1> (you can set exit hooks in perl, so I assume you can do it in ruby too)
codezombie has joined #ruby
Jackneill has joined #ruby
sailias has joined #ruby
<icy`> came across something with .define_finalizer ... hmm
balki has joined #ruby
alanp has joined #ruby
jfoley has quit [Quit: jfoley]
<bnagy> define_finalizer is a huge pain to use, and won't run when you get killed by signal
<bnagy> if it runs at all
<bnagy> I usually trap('INT') { ... }
<bnagy> and try to do the rest with ensure and Visitor pattern
<offby1> and pray you don't get a -9
<offby1> the ultimate, I suppose, is to make your program "crash-only". Dunno how practical that is though.
<icy`> interesting
xscc has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
jrajav has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
Kesava has quit [Ping timeout: 246 seconds]
bluOxigen has quit [Ping timeout: 240 seconds]
<icy`> actually, nvm, this isnt the problem i need to solve
<icy`> my object would still be alive... it's just the server that would die
sailias has quit [Ping timeout: 246 seconds]
Jackneill has quit [Ping timeout: 240 seconds]
<icy`> it was something for an irc bot, and the server suddenly died ;P
tds has quit [Quit: tds]
<offby1> pff ... only fools spend time writing IRC bots
* icy` shrugs
<offby1> I say that having spent many happy hours writing mine :)
<icy`> i might end up rewriting someone's imdb scraper ;P
rudybot has joined #ruby
<offby1> rudybot: how ya doin'
<rudybot> *offby1: "Blanche, what're all these loonies doin' in our basement?!"
<icy`> slool
rudybot has left #ruby [#ruby]
<icy`> lol*
<icy`> is that a movie quote or something
nai has joined #ruby
nai_ has quit [Ping timeout: 255 seconds]
tewecske has quit [Quit: Leaving.]
beneggett has quit [Ping timeout: 250 seconds]
<icy`> btw, hpricot is about the same speed as nokogiri now, right?
<icy`> with css selectors, for example. I remember nokogiri used to have the edge
qos has joined #ruby
beneggett has joined #ruby
wargasm has quit [Read error: Connection reset by peer]
mikepack has joined #ruby
<jameshyde> how to iterate this one: b=[['c',['d']], ['e', ['f1', 'f2']]]
dhruvasagar has quit [Ping timeout: 265 seconds]
<bnagy> to do what?
savage- has quit [Remote host closed the connection]
<ryanf> icy`: hasn't hpricot been unmaintained for years?
billiamii has quit [Ping timeout: 246 seconds]
<jameshyde> output like e: f1,f2 (2), c: d (1)
Targen has quit [Ping timeout: 250 seconds]
Targen has joined #ruby
<bnagy> jameshyde: something like b.map {|(k,ary)| "#{k}: #{ary.join(',')} (#{ary.size})"}
<icy`> ryanf, oh, lol. just went to its github : README.md 2 months ago Add closure message [evanphx]
<jameshyde> bnagy, nice!
<bnagy> and join that with ',' or whatever you want
<icy`> guess i'll switch back to noko
ciopte7 has quit [Quit: ciopte7]
lxsameer has joined #ruby
vitoravelino is now known as vitoravelino`afk
yxhuvud has joined #ruby
minijupe has quit [Quit: minijupe]
khakimov has joined #ruby
r126l has quit [Ping timeout: 252 seconds]
ananthakumaran has quit [Quit: Leaving.]
Ethan has quit [Quit: *poof*]
azhao has joined #ruby
tonini has joined #ruby
mikepack has quit [Read error: Connection reset by peer]
mwilson_ has quit [Excess Flood]
mwilson_ has joined #ruby
mikepack has joined #ruby
beneggett has quit [Quit: Computer has gone to sleep.]
learc83 has joined #ruby
ciopte7 has joined #ruby
mockra has quit [Remote host closed the connection]
wrapids has joined #ruby
azhao has quit [Quit: 离开]
kjellski_ has joined #ruby
wallerdev has quit [Quit: wallerdev]
wallerdev has joined #ruby
mwilson_ has quit [Excess Flood]
mwilson_ has joined #ruby
kjellski has quit [Ping timeout: 245 seconds]
vectorshelve has joined #ruby
nai has quit [Remote host closed the connection]
r126l has joined #ruby
subbyyy has quit [Quit: Leaving.]
ABK_ has joined #ruby
nachtwandler has joined #ruby
wargasm has joined #ruby
itnomad has quit [Quit: Leaving]
wargasm has quit [Read error: Connection reset by peer]
Gavilan has left #ruby [#ruby]
brianpWins has joined #ruby
bwlang has quit [Quit: bwlang]
dankest has joined #ruby
twinturbo has joined #ruby
<vectorshelve> Why People Run lol -> http://i.imgur.com/Mi5k8.jpg
td123 has quit [Quit: WeeChat 0.3.8]
rakunHo has joined #ruby
ananthakumaran has joined #ruby
Chryson has quit [Quit: Leaving]
djdb has joined #ruby
wrapids has quit [Ping timeout: 246 seconds]
maxmmurphy has joined #ruby
mikepack has quit [Remote host closed the connection]
ipoval has joined #ruby
heftig has quit [Ping timeout: 245 seconds]
TPFC-SYSTEM has joined #ruby
delinquentme has quit [Ping timeout: 246 seconds]
vis__ has joined #ruby
dankest has quit [Quit: Linkinus - http://linkinus.com]
vis__ has quit [Client Quit]
mikepack has joined #ruby
arturas has joined #ruby
tagrudev has joined #ruby
dankest has joined #ruby
zommi has joined #ruby
burgestrand has quit [Quit: Leaving.]
ciopte7 has quit [Quit: ciopte7]
jgrevich has joined #ruby
subbyyy has joined #ruby
amaus has joined #ruby
heftig has joined #ruby
gorpon has quit [Remote host closed the connection]
Zolrath has joined #ruby
richardcreme has joined #ruby
amaus has quit [Ping timeout: 252 seconds]
workmad3 has joined #ruby
khakimov has quit [Quit: Computer has gone to sleep.]
subbyyy has quit [Quit: Leaving.]
ghanima has joined #ruby
nachtwandler has quit [Ping timeout: 244 seconds]
g_rotbart has quit [Remote host closed the connection]
heftig has quit [Quit: leaving]
ipoval has quit [Quit: ipoval]
qwerxy has joined #ruby
heftig has joined #ruby
fridim_ has joined #ruby
Eldariof-ru has joined #ruby
Rochefort has joined #ruby
Morkel has joined #ruby
workmad3 has quit [Ping timeout: 252 seconds]
workmad3 has joined #ruby
learc83 has quit [Quit: learc83]
Cache_Money has joined #ruby
davejacobs has quit [Ping timeout: 245 seconds]
andrewhl has joined #ruby
hugoxrosa has quit [Remote host closed the connection]
dhodgkin has quit [Read error: Connection reset by peer]
Kesava has joined #ruby
lolmaus has joined #ruby
ciopte7 has joined #ruby
baphled has joined #ruby
quest88 has quit [Quit: quest88]
perry is now known as perryh_away
Eldariof-ru has quit []
Ionic` has quit [Ping timeout: 244 seconds]
beneggett has joined #ruby
workmad3 has quit [Ping timeout: 252 seconds]
Ethan has joined #ruby
beneggett has quit [Client Quit]
fowl has quit [Ping timeout: 240 seconds]
fantazo has quit [Remote host closed the connection]
fowl has joined #ruby
fowl has quit [Changing host]
fowl has joined #ruby
bfgun has joined #ruby
bfig has quit [Read error: Connection reset by peer]
dhruvasagar has joined #ruby
qwerxy has quit [Quit: offski]
hoelzro|away is now known as hoelzro
arturas has quit [Remote host closed the connection]
igotnolegs has quit [Quit: Computer has gone to sleep.]
fowl has quit [Ping timeout: 245 seconds]
jwang has joined #ruby
Bosma has quit [Ping timeout: 255 seconds]
jdahm has quit [Quit: WeeChat 0.3.8]
wallunit has joined #ruby
gilead has joined #ruby
RainbowDashh has joined #ruby
Cache_Money has quit [Read error: Connection reset by peer]
Cache_Money has joined #ruby
shadoi has quit [Quit: Leaving.]
andrewhl has quit [Remote host closed the connection]
niklasb has joined #ruby
mohits has joined #ruby
liuchong has quit [Ping timeout: 246 seconds]
fowl has joined #ruby
qos has quit [Quit: Leaving...]
burgestrand has joined #ruby
Eldariof-ru has joined #ruby
punkrawkR has quit [Ping timeout: 252 seconds]
adamkittelson has quit [Remote host closed the connection]
Targen has quit [Ping timeout: 264 seconds]
qos has joined #ruby
elhu has joined #ruby
Cache_Money has quit [Read error: Connection reset by peer]
Cache_Money has joined #ruby
ampersandy has joined #ruby
niklasb has quit [Ping timeout: 252 seconds]
bigkevmcd has quit [Quit: outta here]
bigkevmcd has joined #ruby
ephemerian has joined #ruby
ampersandy has quit [Quit: ampersandy]
wobr has joined #ruby
baphled has quit [Ping timeout: 250 seconds]
jgrevich has quit [Quit: jgrevich]
liuchong has joined #ruby
dekroning has joined #ruby
<dekroning> hi
ampersandy has joined #ruby
<Paradox> ÷
<Hanmac> ×
kaiwren has joined #ruby
<Paradox> «««««¿÷?»»»»»
<Hanmac> ...………...
<Paradox> ≠≈≠≈≠≈≠≈≠
indian has quit [Ping timeout: 248 seconds]
<Paradox> its a fence
qwerxy has joined #ruby
<Paradox> meditation time
<Paradox> Ω
<Paradox> Ω
<Paradox> Ω
qwerxy has quit [Client Quit]
<bnagy> itym electrician time
ampersandy has quit [Quit: ampersandy]
<Paradox> •••
ampersandy has joined #ruby
<bnagy> ॐ
<shevy> god
<bnagy> man that's a shit glyph
cezar has joined #ruby
<shevy> all I see are question marks
indian has joined #ruby
imami|afk has quit [Excess Flood]
banseljaj has joined #ruby
blacktulip has joined #ruby
<Paradox>
<Paradox>
<Hanmac> i like the chars if an stoked cycle inside ... where you could concat multible chars into one (into one that is not in the unicode list)
<Paradox> heh
<Paradox> l⃞ike this?
cezar has quit [Client Quit]
brianpWins has quit [Quit: brianpWins]
Houdini has joined #ruby
<Hanmac> yeah :D
<Paradox> o⃝r⃝t⃝h⃝i⃝s⃝?⃝
<Paradox> i said or this
<Paradox> ⃝⃝⃝⃝⃝⃝⃝⃝⃝⃝⃝⃝⃝⃝⃝⃝
wallerdev has quit [Quit: wallerdev]
<Paradox> i lol when the python devs i know bitch about UTF-8
<Paradox> i'm like "lrn2ruyb"
<Paradox> and they are like :(
<Paradox> ruyb
<Paradox> wow
<Paradox> i shouldnt drunk so much
<Paradox> ⃝º⃝.⃝
<Paradox> ⃝ eats your name border
<mikekelly> zomg
<fowl> what
<mikekelly> confirmed on limechat
<mikekelly> pretty sure that wouldn't work on irssi ?
<bnagy> it works on irssi here
<hoelzro> same here
<mikekelly> interesting
<Paradox> doesnt on linkinus
<Paradox> but thats because linkinus is pretty
ampersandy has left #ruby [#ruby]
<fowl> ⃝º⃝.⃝
schovi has joined #ruby
<fowl> those look like tiny faces to me
schovi has quit [Remote host closed the connection]
madjester has joined #ruby
<madjester> hi there
<madjester> how do I set the Content-Type for a Net::HTTPRequest?
<madjester> I cannot send multipart requests
<Paradox> ⃝
<Paradox> ⁣⁢⁤
<Paradox> art thou angry brother?
<madjester> I believe I saw that page already
<Paradox> a
yannis has joined #ruby
yonggu_ has joined #ruby
<madjester> https://gist.github.com/3052196 <- here's the code
<madjester> and here are the values for Content-Type and X-Content-Type:
<madjester> [CONTENT_TYPE] => application/x-www-form-urlencoded
<madjester> [HTTP_CONNECTION] => keep-alive
<madjester> [HTTP_X_CONTENT_TYPE] => multipart/form-data; boundary=----WebKitFormBoundaryzh07nRhzBHXrjkK5
<madjester> might it be because it's not an allowed media type or something?
schovi has joined #ruby
Houdini has quit [Read error: Connection reset by peer]
yonggu has quit [Ping timeout: 240 seconds]
schovi has quit [Remote host closed the connection]
fowl has quit [Ping timeout: 246 seconds]
fowl has joined #ruby
nilg has joined #ruby
bier has quit [Ping timeout: 246 seconds]
bier|tp has quit [Ping timeout: 244 seconds]
banister`sleep is now known as banisterfiend
pk1001100011 has quit [Quit: I've got a feeling there's a fish in the floor; I'd better squish it or he'll swim out the door; Sometimes they take me for a walk in the sun; I see my fish and I have to run]
Cache_Money has quit [Ping timeout: 255 seconds]
fowl has quit [Ping timeout: 264 seconds]
monkegji_ has quit [Read error: Connection reset by peer]
monkegjinni has joined #ruby
fixl has joined #ruby
tashi has joined #ruby
tashi has left #ruby [#ruby]
maxmmurphy has quit [Quit: maxmmurphy]
dominikh has quit [Remote host closed the connection]
workmad3 has joined #ruby
dominikh has joined #ruby
pk1001100011 has joined #ruby
elhu has quit [Ping timeout: 264 seconds]
vantage has joined #ruby
pk1001100011 has quit [Client Quit]
elhu has joined #ruby
ksk has joined #ruby
<ksk> hi
bier|tp has joined #ruby
bier has joined #ruby
liuchong has quit [Ping timeout: 252 seconds]
fowl has joined #ruby
myth17 has joined #ruby
<ksk> using "erb" - is it possible to leave a value empty, making erb producing just nothing at execution?
<ksk> nevermind, one can just set var = "" and it works. thanks ;)
<madjester> fowl: setting it in the request object via the hash access method; request['Content-Type'] = '...', or via the setter; request.content_type('...') seems to have no effect
Aaton_off is now known as Aaton
neersighte[d] is now known as neersighted
Aaton is now known as Aaton_off
dankest has quit [Quit: Leaving...]
qwerxy has joined #ruby
tvw has joined #ruby
Spooner has joined #ruby
zz_chrismcg is now known as chrismcg
qos_ has joined #ruby
qos has quit [Read error: Connection reset by peer]
charlenopires has joined #ruby
tatsuya__ has joined #ruby
Kesava has quit [Ping timeout: 240 seconds]
jameshyde has quit [Remote host closed the connection]
timonv has joined #ruby
qwerxy has quit [Ping timeout: 244 seconds]
davidw has joined #ruby
myth17 has quit [Ping timeout: 264 seconds]
davidw is now known as Guest80510
thone has quit [Ping timeout: 240 seconds]
qwerxy has joined #ruby
baphled has joined #ruby
thone has joined #ruby
dekroning has quit [Ping timeout: 246 seconds]
charlenopires has quit [Quit: Computer has gone to sleep.]
baphled has quit [Client Quit]
sonkei has quit [Ping timeout: 244 seconds]
myth17 has joined #ruby
Criztian has joined #ruby
mikepack has quit [Remote host closed the connection]
jamesaxl has joined #ruby
saschagehlich has joined #ruby
g_rotbart has joined #ruby
saschagehlich_ has joined #ruby
monkegjinni has quit [Remote host closed the connection]
baphled has joined #ruby
monkegjinni has joined #ruby
niklasb_ has joined #ruby
Ethan has quit [Ping timeout: 248 seconds]
sspiff has quit [Remote host closed the connection]
saschagehlich has quit [Ping timeout: 246 seconds]
saschagehlich_ is now known as saschagehlich
ramblex has joined #ruby
monkegjinni has quit [Ping timeout: 244 seconds]
thisirs has joined #ruby
RainbowDashh has quit [Read error: Connection reset by peer]
cirwim has quit [Quit: sleeeeeep……..ping!]
niklasb_ has quit [Ping timeout: 245 seconds]
RainbowDashh has joined #ruby
cascalheira has joined #ruby
saschagehlich has quit [Quit: saschagehlich]
berserkr has joined #ruby
Rochefort has quit [Remote host closed the connection]
sspiff has joined #ruby
sspiff has quit [Changing host]
sspiff has joined #ruby
luckyruby has quit [Remote host closed the connection]
saschagehlich has joined #ruby
ryanf has quit [Quit: leaving]
myth17 has quit [Ping timeout: 246 seconds]
baphled has quit [Read error: Connection reset by peer]
dekroning has joined #ruby
tommyvyo has joined #ruby
fridim_ has quit [Ping timeout: 264 seconds]
cascalheira has quit [Quit: cascalheira]
ramblex has quit [Quit: ramblex]
cascalheira has joined #ruby
Ethan has joined #ruby
jimeh3 has joined #ruby
niklasb_ has joined #ruby
myth17 has joined #ruby
Tricks has quit [Read error: Connection reset by peer]
Bosma has joined #ruby
Tricks has joined #ruby
<kapowaz> Do I understand correctly that there is still no simple/easy way of installing ruby 1.9.2 on OS X when you have Xcode 4.3.x installed?
<JonnieCache> whats stopping you currently?
<kapowaz> sorry, missed part of that — when also using rvm :)
<kapowaz> rvm complains about it
<JonnieCache> what does it say?
<kapowaz> it suggests downgrading to Xcode 4.1
<JonnieCache> something about missing gcc i guess?
<kapowaz> I can't recall the message exactly. Something about the LLVM though.
<JonnieCache> yeah with xcode 4.2 apple ditched gcc for llvm
<bnagy> llvm ftw
<JonnieCache> homebrew has an apple-gcc42 package
<kapowaz> oh, so that's the workaround now?
mucker_ has joined #ruby
<JonnieCache> or theres a way of making llvm pretend to be gcc
<JonnieCache> thats probably better
<JonnieCache> also, why do you want ruby 1.9.2 rather than 1.9.3?
banseljaj is now known as imami|afk
<Hanmac> gcc42? serious? i have gcc4.7
neersighted is now known as neersighte[d]
dekronin1 has joined #ruby
flype has joined #ruby
<JonnieCache> Hanmac: what os?
<Hanmac> a better then OSX :D
<JonnieCache> but yeah it is old. thats why apple ditched it for llvm/clang
<JonnieCache> the latest shit
<kapowaz> JonnieCache: no particular reason I *want* 1.9.2, but it's what I've been developing all my recent apps under, so it cuts out one possible issue if I stick to the same environment for existing projects
<kapowaz> plus I think it's what Heroku uses in the Cedar stack?
Foxandxss has joined #ruby
baphled has joined #ruby
<JonnieCache> kapowaz: there isnt much changed between 1.9.2 and 1.9.3 apart from its faster
<JonnieCache> so if that fixes your rvm issue, just use 1.9.3 your life will improve
<kapowaz> yeah, maybe that'll be fine.
foofoobar has joined #ruby
mucker_ has quit [Read error: Connection reset by peer]
<JonnieCache> especially if you have to load a lot of files, 1.9.3 is much much faster
dekroning has quit [Read error: Connection reset by peer]
dekronin1 has quit [Ping timeout: 245 seconds]
dekroning has joined #ruby
nari has quit [Ping timeout: 245 seconds]
tonini has quit [Remote host closed the connection]
<foofoobar> I'm looking for a simple and easy way to make my application extensible. A perfect solution would be that there is a folder called "Modules" where I can place files like myextension_ext.rb
mucker has joined #ruby
<foofoobar> My application automatically loads all files in this folder and makes it accessible on runtime
<foofoobar> How can I do this ?
<Paradox> shanks
<Hanmac> Dir["*.rb"].each{|s| require_relative s}
myth17 has quit [Ping timeout: 264 seconds]
neku has joined #ruby
TrahDivad__ has joined #ruby
pk1001100011 has joined #ruby
tommyvyo has quit [Quit: Computer has gone to sleep.]
TrahDivad_ has quit [Ping timeout: 252 seconds]
dr0p has joined #ruby
Spooner_ has joined #ruby
mucker has quit [Read error: Connection reset by peer]
nemesit has joined #ruby
charliesome has joined #ruby
Spooner has quit [Ping timeout: 252 seconds]
justinmcp has joined #ruby
<foofoobar> Hanmac: but how should my application know what do execute and what the name of the class inside this is?
myth17 has joined #ruby
<Hanmac> it dont need to know ...
qos_ has quit [Quit: Leaving...]
qos has joined #ruby
vectorshelve has quit [Ping timeout: 245 seconds]
Spooner_ is now known as Spooner
cousine has joined #ruby
qos has quit [Read error: Connection reset by peer]
vectorshelve has joined #ruby
qos has joined #ruby
mucker has joined #ruby
poincare101 has joined #ruby
indian has quit [Ping timeout: 265 seconds]
baphled has quit [Quit: leaving]
baphled has joined #ruby
<foofoobar> Hanmac: why?
<foofoobar> If the loaded module wants to interact with data, I have to pass it so I need to know what to execute right?
<Hanmac> require only loads the ruby code ...
<Hanmac> you need define your own plugin-system
qos has quit [Quit: Leaving...]
qos has joined #ruby
Helius has joined #ruby
ramblex has joined #ruby
poincare101 has quit [Ping timeout: 245 seconds]
<banisterfiend> Hanmac: Und.
ramblex has quit [Client Quit]
<Hanmac> Oder
ramblex has joined #ruby
<banisterfiend> Hanmac: if i visit germany could i take u for a beer
<Hanmac> no, i dont drink beer
<banisterfiend> Hanmac: well i could have a beer and you could have a soft drink?
mucker has quit [Read error: Connection reset by peer]
<foofoobar> Hanmac: do I have to write that on my own or are there already some solutions I can use?
<JonnieCache> foofoobar: theres the Concern pattern
<JonnieCache> thats popular
poincare101 has joined #ruby
<Hanmac> like a global $plugins = {} and $plugins['plugin_a'] = Plugin.new ... or something like this
<poincare101> Hi everyone. I just wrote an article on RubySource, and, I was hoping you guys could check it out: http://rubysource.com/a-look-at-dsls/ It is about the development of domain specific languages in Ruby.
<foofoobar> okay
vitor-br has quit [Quit: Saindo]
dekroning has quit [Ping timeout: 252 seconds]
<JonnieCache> oooh look at this templating language: http://slim-lang.com/
<JonnieCache> its like haml but with less weirdness
Sweet-P has joined #ruby
cubicme has joined #ruby
<banisterfiend> poincare101: hint: replace 'instance_eval' with another more communicative method name
chrismdp has joined #ruby
<banisterfiend> poincare101: explicitly using instance_eval is demonstrating (IMO) that the object doesn't really encourage the "DSL", but instead you're just accessing the internals manually
Poapfel has quit [Read error: Operation timed out]
<JonnieCache> yeah just wrap/alias it in some other name even if it doesnt do anything. you want your DSL to look swanky when youre using it
wallunit has quit [Ping timeout: 252 seconds]
indian has joined #ruby
Poapfel has joined #ruby
sepp2k has joined #ruby
wvms has quit [Ping timeout: 248 seconds]
gander has joined #ruby
gander has left #ruby ["Leaving"]
<vectorshelve> banisterfiend: hai buddy long time no see :)
baphled_ has joined #ruby
baphled has quit [Read error: Connection reset by peer]
heftig has quit [Quit: leaving]
VegetableSpoon has quit [Quit: Leaving]
heftig has joined #ruby
nemesit has quit [Quit: Leaving...]
etehtsea has joined #ruby
BrokenCog has joined #ruby
ciopte7 has quit [Quit: ciopte7]
chrismdp has quit [Quit: leaving]
chrismdp has joined #ruby
heftig_ has joined #ruby
poincare101 has quit [Quit: Page closed]
heftig has quit [Client Quit]
baphled_ has quit [Quit: leaving]
vitoravelino`afk is now known as vitoravelino
baphled has joined #ruby
Rochefort has joined #ruby
schovi has joined #ruby
wallunit has joined #ruby
lkba has joined #ruby
jamesaxl has quit [Ping timeout: 246 seconds]
monkegjinni has joined #ruby
<shevy> hey vectorshelve
<shevy> are you still busy with rails
<shevy> with booooring boring rails
mobilegamelabs has joined #ruby
<Hanmac> in the future we will have flying cars, who needs rails then?
talumees has joined #ruby
zagabar has joined #ruby
<shevy> hehe
<zagabar> I am using ruby to run redmine, the project managing thingy. After upgrading ruby, using the ruby manager application, then I get a 70% cpu usage by the process ruby1.8 all the time.
<zagabar> Any ideas on what may cause this?
qos has quit [Quit: Linkinus - http://linkinus.com]
<shevy> sounds as if there is some serious bug
schovi has quit [Remote host closed the connection]
myth17 has quit [Ping timeout: 246 seconds]
baphled has quit [Quit: leaving]
dekroning has joined #ruby
baphled has joined #ruby
baphled has quit [Client Quit]
baphled has joined #ruby
<shevy> Hanmac: how would you go about creating your own programming language?
<Hanmac> why should i do this? ruby is fine for me :D
myth17 has joined #ruby
iocor has joined #ruby
Kesava has joined #ruby
Tricks has quit [Read error: Connection reset by peer]
heftig_ is now known as heftig
baphled has quit [Quit: leaving]
<shevy> hmm you feel ruby is 100% perfect?
baphled has joined #ruby
<JonnieCache> why design your own language when you can learn lisp? :)
<JonnieCache> i really need to do that soon...
neku is now known as neku|away
TrahDivad_ has joined #ruby
<JonnieCache> clojure seems pretty awesome
saschagehlich has quit [Quit: saschagehlich]
baphled has quit [Read error: Connection reset by peer]
TrahDivad__ has quit [Read error: Connection reset by peer]
<shevy> (lisp(has(this(horrible(parens(problem
<shevy> I also never saw it touted for its great OOP thinking
residentwhackjob is now known as xc
foofoobar has quit [Quit: Computer has gone to sleep]
<JonnieCache> oop is overrated
fridim_ has joined #ruby
<JonnieCache> of course lisp is not good for oop it is a functional language
Kesava has quit [Ping timeout: 246 seconds]
pygospa has quit [Ping timeout: 246 seconds]
<shevy> overrated hmm but a success story still :D
baphled has joined #ruby
TrahDivad_ has quit [Ping timeout: 250 seconds]
<shevy> a new language similar to ruby in syntax, but with a different OOP model
<JonnieCache> if you want to do oop ruby has potentially the best object model i have experienced
<Hanmac> i would like to see short forms for Klass.method(:sym) :P
<JonnieCache> so if i were to leave ruby i would leave oop
<shevy> I dont like the use of both mixins and subclassing, it feels as if someone couldn't quite make up his mind what he prefers to
pygospa has joined #ruby
<JonnieCache> yeah well that is the ruby thing of letting you do anything you want
<JonnieCache> personally i never use inheritance
<shevy> interesting
cousine has quit [Remote host closed the connection]
<JonnieCache> it has always created more problems than it has solved in my experience. thats probably my fault though
<shevy> it has created problems?
<JonnieCache> go looks *really* nice as well
<davidcelis> lisp? ah yes, that language is good for domain-specific solutions, but it doesn't solve the problem ofmultiple inheritance out of the box
<oddmunds> the pipes in the block variable syntax ( whatever {|x| something } ) feels a little wrong to me
baphled has quit [Ping timeout: 240 seconds]
hoangtran has quit [Quit: ChatZilla 0.9.88.2 [Firefox 13.0.1/20120614114901]]
<shevy> oddmunds: yeah but somehow you need to tell ruby that x is a block variable
<oddmunds> yeah, i haven't been able to come up with a better solution
<JonnieCache> shevy: i just end up fighting with the language when i do inheritance. things end up being inherited that i dont want, and i have to override them
<shevy> I see
<JonnieCache> but like i said that probably a result of my failings as a software engineer
<shevy> in one project, I tried to have class Base, and then subclass from this class for all my other classes, in the same project
<JonnieCache> i find it easier to do lots of mixins and keep absolute control over what code goes where
moshee has quit [Ping timeout: 246 seconds]
<shevy> but I am not convinced that this was good
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
<shevy> in class Base though, I use things like @debug variable, just to disable or enable debugging. :\
<JonnieCache> hmmm thats what globals are for man
<shevy> did not know another way to set a bunch of instance variables on my subclass
<shevy> argh globals...
<JonnieCache> yeah you shouldnt use them generally but a debug switch is one place where it is appropriate surely?
cubicme has quit [Quit: #ruby]
cubicme has joined #ruby
<shevy> when I set a global in a class, it is global everywhere isn't it? class Foo; $debug = true; end; Foo.new; $debug # => true
<Mon_Ouie> You can always replace them with an instance variable on a module/class — minus some name clash risks
zommi_ has joined #ruby
zommi has quit [Ping timeout: 264 seconds]
JustinCampbell has joined #ruby
mohits has quit [Read error: Connection reset by peer]
baphled has joined #ruby
arkiver has joined #ruby
bubu\a has joined #ruby
madjester has left #ruby [#ruby]
mengu has joined #ruby
baphled has quit [Read error: Connection reset by peer]
baphled has joined #ruby
flype has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
ttilley_off is now known as ttilley
carloslopes has joined #ruby
ttilley is now known as ttilley_off
baphled has quit [Read error: Connection reset by peer]
<vectorshelve> shevy: hai :) was away for a meeting
arkiver has quit [Ping timeout: 246 seconds]
vantage has quit [Remote host closed the connection]
bubu\a has quit [Read error: Connection reset by peer]
myth17 has quit [Ping timeout: 265 seconds]
tk___ has joined #ruby
atmosx has joined #ruby
ddbtnl has joined #ruby
Priteshjain has joined #ruby
liuchong has joined #ruby
monkegjinni has quit [Remote host closed the connection]
monkegjinni has joined #ruby
liuchong has quit [Client Quit]
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
jxpx777 has joined #ruby
sailias has joined #ruby
jxpx777 has quit [Client Quit]
justinmcp has quit [Ping timeout: 265 seconds]
justinmc_ has joined #ruby
myth17 has joined #ruby
<shevy> yo vectorshelve
bubu\a has joined #ruby
Travis-42 has joined #ruby
Flex\a has joined #ruby
justinmc_ has quit [Ping timeout: 255 seconds]
<atmosx> hello
<atmosx> hm does File.read(logfile).grep(/something/) work ? theoritically?
<vectorshelve> shevy: yo :)
hero has joined #ruby
<shevy> atmosx: it calls unicorns to chase down bytes, collect them into a bag, then return them to you
justinmcp has joined #ruby
saschagehlich has joined #ruby
<atmosx> sounds nice
<bnagy> atmosx: theoretically, no, cause grep isn't a method on String
<atmosx> doesn't work thouugh
<atmosx> weirds, returns class 'string' should work...
<atmosx> ah
<atmosx> isn't?
<bnagy> try scan or something
bubu\a has quit [Ping timeout: 246 seconds]
<shevy> if (!NIL_P(offset)) {
<shevy> struct seek_arg sarg;
<atmosx> scan will return only the regexp'ed word… and I'm having a hard time combining 2 different regexp's
<shevy> return rb_ensure(io_s_read, (VALUE)&arg, rb_io_close, arg.io);
zommi_ has quit [Ping timeout: 245 seconds]
<bnagy> how would grep have helped?
chrismdp has quit [Quit: leaving]
<atmosx> bnagy: If I could grep the strings containt the keyword, then I could use the residual regexp on these lines...
<atmosx> I'm trying to put together two regex in ruby (macosx/linux): This (^[0-9]{4}-[0-9]{2}-[0-9]{2}) and this (/Ban\s\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/) … The idea is grep date 'Ban' word and IP from a linux like this: 2012-05-24 17:25:32,432 fail2ban.actions: WARNING [ssh-iptables] Ban 189.1.162.244
Kesava has joined #ruby
<matled> atmosx: if you mean to grep on the lines of the file then do so
<atmosx> that's the original idea, but I'm failing miserably with combining the above regexp together
brendan` has joined #ruby
<bnagy> why not readlines then seleect match then scan or something?
<atmosx> match?
<bnagy> File.readlines("foo").select {|line| line.match /regexp1/
<bnagy> then scan those lines, or something
<atmosx> let me try, this makes sense...
<bnagy> or match them again, or whatever
<workmad3> bnagy: you could do File.readlines("foo").grep(/regexp/) too, I believe ;)
vitoravelino is now known as vitoravelino`afk
<bnagy> yeah that would be less verbose
<bnagy> but if those are the lines I think it's one step, pretty much
<atmosx> grep works too...
<bnagy> line[/Ban (.*)$/,1]
<atmosx> yes thank you both :D
<atmosx> bnagy: that last one is very cryptic
<JonnieCache> thank god for git-blame
<JonnieCache> hah
saschagehlich has quit [Quit: saschagehlich]
<bnagy> "2012-05-24 17:25:32,432 fail2ban.actions: WARNING [ssh-iptables] Ban 189.1.162.244\n"[/Ban (.*)$/,1] => "189.1.162.244"
hero has quit [Ping timeout: 240 seconds]
<JonnieCache> every so often i think "how did people get by before git"
<JonnieCache> then i remember that I used svn for years, and it sucked.
<JonnieCache> i must have repressed the memories
myth17 has quit [Ping timeout: 245 seconds]
<atmosx> bnagy: nice, I'll keep that as a note also. Looks fancy hehe
hero has joined #ruby
hero has joined #ruby
<bnagy> date,ip=l.match(/^(.*?) .*Ban (.*)$/)[-2..-1]
<bnagy> etc
tommyvyo has joined #ruby
ac4s3 has joined #ruby
ddbtnl has quit [Quit: Page closed]
fixl has quit [Quit: KVIrc 4.1.3 Equilibrium http://www.kvirc.net/]
chrismdp has joined #ruby
<bnagy> I hate regexp :(
chrismdp has quit [Client Quit]
notjohn has quit [Quit: notjohn]
Criztian has quit [Remote host closed the connection]
<workmad3> JonnieCache: you do realise that 'git-blame' is behaviour lifted from SVN, right?
<workmad3> JonnieCache: and that SVN also gave you the alias 'praise' too
ssspiff has joined #ruby
ssspiff has quit [Changing host]
ssspiff has joined #ruby
dr0p has quit [Remote host closed the connection]
<JonnieCache> yes i know that. the "git-blame is great" comment and the "god svn sucked" comment were meant separately :)
sspiff has quit [Ping timeout: 246 seconds]
chrismdp has joined #ruby
nanderoo has joined #ruby
<workmad3> JonnieCache: :)
chrismdp has quit [Client Quit]
saschagehlich has joined #ruby
djdb has quit [Remote host closed the connection]
jgarvey has joined #ruby
krusty_ar has joined #ruby
chrismdp has joined #ruby
chrismdp has quit [Client Quit]
chrismdp has joined #ruby
jamesaxl has joined #ruby
bwlang has joined #ruby
<JonnieCache> http://www.ebuyer.com/390394-higgs-boson-higgs126 NOW AVAILABLE FOR PRE-ORDER!
<JonnieCache> only £7297.35 inc vat
<workmad3> awesome
<workmad3> JonnieCache: what's slightly worrying though is that you can click on order and it takes you to a shopping cart...
<workmad3> JonnieCache: I'm worried what would happen if I clicked to order :)
<JonnieCache> lol i reckon they would take the money
<JonnieCache> then call you up and laugh at you and reverse the transfer
geekbri has joined #ruby
bubu\a has joined #ruby
Axsuul has quit [Ping timeout: 245 seconds]
<workmad3> JonnieCache: :)
Flex\a has quit [Remote host closed the connection]
wataken44_ has joined #ruby
vitoravelino`afk is now known as vitoravelino
xc has left #ruby ["to the batcave!"]
arkiver has joined #ruby
Criztian has joined #ruby
neku|away is now known as neku
tommyvyo_ has joined #ruby
vectorshelve has quit [Quit: Page closed]
bwlang has quit [Quit: bwlang]
lorandi has joined #ruby
jxpx777 has joined #ruby
lxsameer has quit [Ping timeout: 246 seconds]
rakunHo has quit [Remote host closed the connection]
Sweet_P has joined #ruby
shvelo has joined #ruby
fbernier has joined #ruby
schovi has joined #ruby
Sweet-P has quit [Ping timeout: 252 seconds]
saschagehlich_ has joined #ruby
kvirani has joined #ruby
saschagehlich has quit [Ping timeout: 246 seconds]
saschagehlich_ is now known as saschagehlich
schovi has quit [Ping timeout: 256 seconds]
crankycoder has joined #ruby
larissa has joined #ruby
liluo has joined #ruby
arkiver has quit [Ping timeout: 244 seconds]
mucker has joined #ruby
lxsameer has joined #ruby
lxsameer has quit [Changing host]
lxsameer has joined #ruby
_whitelogger has joined #ruby
lxsameer has quit [Max SendQ exceeded]
Priteshjain has quit [Quit: Leaving]
lxsameer has joined #ruby
lxsameer has quit [Changing host]
lxsameer has joined #ruby
lxsameer has quit [Max SendQ exceeded]
lxsameer has joined #ruby
dekroning has quit [Ping timeout: 244 seconds]
sailias has quit [Ping timeout: 265 seconds]
indian has quit [Ping timeout: 245 seconds]
lorandi has quit [Quit: Leaving]
<dagobah_> So how do we convert a string representing a currency into something like a BigInteger in ruby? e.g "5,950.45"
coderhs has quit [Ping timeout: 252 seconds]
ksergio has joined #ruby
bluenemo has quit [Remote host closed the connection]
g_rotbart has quit [Remote host closed the connection]
bwlang has joined #ruby
bwlang has quit [Read error: Connection reset by peer]
<JonnieCache> dagobah_: the class you want is BigDecimal
arkiver has joined #ruby
<JonnieCache> not float
<carloslopes> dagobah_: you can use '5,950.45'.gsub!(/,/, '').to_i
<JonnieCache> except its not an integer
<carloslopes> dagobah_: but you will loose the decimal value.. so, the correct is '5,950.45'.gsub!(/,/, '').to_f
<dagobah_> Excellent thanks, can I not use BigDecimal('5,950.45'.gsub!(/,/, ''))
freeayu has joined #ruby
<chrismdp> dagobah_: except that we shouldn't store money as floats, so you're better of with '5,950.45'.gsub(/,|\./, '').to_i
bbttxu has joined #ruby
<dagobah_> Is money as floats a bad idea?
<JonnieCache> no you should use BigDecimal
<JonnieCache> using floats leads to rounding errors
<chrismdp> dagobah_: yes, a really bad idea
<JonnieCache> BigDecimal('5,950.45'.gsub(/,|\./, ''))
<JonnieCache> will do
<JonnieCache> you have to require it first
<chiel> better to store it as pennies or something like that
<chiel> or 100th of pennies or whatever
<JonnieCache> that would work. but theres no reason not to just use the proper decimal datatype
<carloslopes> dagobah_: yes, DigDecimal for money is better
<JonnieCache> doing the pennies thing invites mistakes
<carloslopes> BigDecimal*
<dagobah_> Sure, thanks.
<dagobah_> No Currency-like object?
<JonnieCache> dagobah_: make sure you get it right in the db layer if youre using a db
<JonnieCache> if you want a Money or a Currency class there are gems for that
bglusman has joined #ruby
<JonnieCache> RubyMoney or something iirc
dv310p3r has joined #ruby
wallerdev has joined #ruby
mvangala_home has joined #ruby
monkegji_ has joined #ruby
<chrismdp> dagobah_: you need to think about things like money = 100; money/3 # who gets the odd penny?
<dagobah_> True.
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
<dagobah_> Gets rather nasty.
kvirani has quit [Remote host closed the connection]
monkegjinni has quit [Read error: Operation timed out]
<fasta> Doesn't Ruby have bignums by default?
bluenemo has quit [Remote host closed the connection]
ABK_ has quit [Ping timeout: 265 seconds]
mvangala_home is now known as mvangala
<carloslopes> fasta: yes.. the Bignum class
<fasta> carloslopes: you don't even need to know about classes.
kpshek has joined #ruby
<carloslopes> fasta: yeah.. ruby handles it automatically for you
brendan` has quit [Ping timeout: 248 seconds]
<carloslopes> 2222.class => Fixnum ; 222222222222222222222222.class => Bignum
<shevy> 718257859127891257891257891257891257891257891527891257895127891257891257891258654675478.class => Monsternum
<carloslopes> shevy: hahahahahaha
<fasta> Is there an integrated environment for Ruby like SLIME is for Common Lisp?
carlyle has joined #ruby
niku4i has joined #ruby
<JonnieCache> not really
<JonnieCache> pry is sort of like that except its not an editor
`brendan has joined #ruby
zommi has joined #ruby
<banisterfiend> fasta: pry can be used to launch editors though
<banisterfiend> fasta: edit-method YourClass#your_method
<banisterfiend> so it's editor agnostic :P
<fasta> banisterfiend: yes, I just saw the screencast.
joshman_ has joined #ruby
<banisterfiend> fasta: oh ok
jsime has joined #ruby
<fasta> I didn't really see anything hugely attractive compared to irb.
<fasta> The documentation stuff is rather nice, but then again I don't use ruby a lot.
axl_ has joined #ruby
<fasta> I like some ruby libraries.
arkiver has quit [Read error: Connection reset by peer]
akem has quit [Ping timeout: 264 seconds]
<banisterfiend> fasta: viewing source, viewing docs, navigating the program structure (with cd/ls), editing methods, viewing monkeypatches, etc, there's a lot of cool things, not to mention the debugging functionality, which is further enhanced by plugins
SeySayux has quit [Ping timeout: 264 seconds]
mucker has quit [Read error: Operation timed out]
<banisterfiend> fasta: banisterfiend.wordpress.com/2012/02/14/the-pry-ecosystem/
<shevy> fasta: you can walk objects in pry
devdazed has joined #ruby
<fasta> banisterfiend: require "<TAB>" should show a list of modules I can load, imho.
Hounddog has joined #ruby
chrismdp has quit [Ping timeout: 245 seconds]
devdazed has quit [Client Quit]
<Hounddog> hi, am i correct here for the net:ssh? am having some problems with it...
<banisterfiend> fasta: Yeah, completion is one aspect that needs some work
SeySayux has joined #ruby
mobilegamelabs has quit [Quit: http://www.MGGGGG.com/ap Angry Polygon - my first Android/iOS/Mac game!]
<banisterfiend> fasta: but completion is hard to do properly with the broken editline implementation that comes with osx
<fasta> banisterfiend: isn't that why rlwrap was invented?
tzvi has joined #ruby
<banisterfiend> fasta: i've never heard of rlwrap
<hoelzro> fasta: rlwrap only remembers history, afaik
<banisterfiend> fasta: what is it?
<fasta> Anyway, it sounds like a rather bad excuse to make something not work. Money might be an argument.
jasond` has joined #ruby
<hoelzro> banisterfiend: it's a program that wraps another program to provide simple readline abilities
hydrozen has joined #ruby
<fasta> banisterfiend: it adds readline capabilities to anything which doesn't have it.
jasond` has left #ruby [#ruby]
<hoelzro> rlwrap wouldn't make a difference, since it will still be linking to editline
<fasta> I use it for all fringe languages.
<hoelzro> fringe languages?
<fasta> Anyway, I doubt it is impossible to make something which works on OSX.
<banisterfiend> fasta: i dont think it'll help here, it's inherent limitations in editline's C implementation.
<fasta> So, it's just that nobody has any intention to make it work, because of money.
<fasta> Which is fine, but don't talk as if it is a problem.
<fasta> I am also not sure why we are talking about osx in the first place.
yonggu_ has quit [Remote host closed the connection]
<fasta> Or is that because that is the hipster OS of choice?
<banisterfiend> fasta: because most rubyists use osx
monkegji_ has quit [Remote host closed the connection]
<banisterfiend> hehe
yonggu has joined #ruby
<fasta> In theory I can see why one would want OSX, but practically it's also not bug free.
<JonnieCache> it is the OS of choice for those who need to use illustrator and apache at the same time every day
<Spaceghostc2c> I can see the want for OSX, but not the want to support Apple.
<fasta> Although, it's likely easier to get the basics working in OSX.
<fasta> For advanced stuff, I think a more open system is more stable/controllable.
<banisterfiend> fasta: i dont think anything is bug free :) but osx is a pretty nice OS; but it's more the hardware that interests me, also i have to use XCode
<hoelzro> fasta: I agree 100%
<hoelzro> I have so much pain getting a lot of OSS stuff running on my work machine
<JonnieCache> also: good luck writing music under linux. i wish i had the cash for multiple boxes with different OSes but not yet unfortunately
<fasta> banisterfiend: yeah, for a laptop what Linus does is reasonable.
<fasta> JonnieCache: you can run VMs.
<JonnieCache> lol good luck writing music in a VM
<JonnieCache> you need to be as close to the metal as possible
<Spaceghostc2c> I have a machine that runs 8-16 vms.
<fasta> JonnieCache: I think that should work in principle.
<JonnieCache> i have latency problems as it is
<fasta> JonnieCache: huh?
<Spaceghostc2c> JonnieCache: Not really. Depends on your VT
<JonnieCache> basically you need the minimum delay between pressing a key on my keyboard and the note coming out the speakers
<fasta> JonnieCache: Linux RT has latencies in the microsecond level.
<JonnieCache> otherwise you cant play
dhodgkin has joined #ruby
<fasta> JonnieCache: a VM might add something to that, but it's never going to be more than 1ms.
atmosx has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<fasta> Spaceghostc2c: why so many?
<fasta> Spaceghostc2c: one for each project?
<JonnieCache> its not about that. its because the overhead of the VM and the host OS means that I have to increase the buffer size of my audio interface, which means increasing the latency
<fasta> Spaceghostc2c: how do you keep everything up to date?
<fasta> JonnieCache: oh, buffer bloat.
chrismdp has joined #ruby
<Spaceghostc2c> fasta: Testing scaling a project I'm working on. You network boot a VM, then watch as it gets absorbed into the network and purposed as resources for an automagical cloud tool.
<Spaceghostc2c> fasta: init scripts my friend.
<Spaceghostc2c> I think I should get some cron updating too.
<kalleth> Spaceghostc2c: DHCP + PXE?
<Spaceghostc2c> kalleth: Yeah.
<kalleth> we use that for our deploys here
<kalleth> pretty awesome
<JonnieCache> that kind of stuff is fun
<JonnieCache> makes you feel like a wizard every time
<fasta> Spaceghostc2c: I was talking about the update, not the starting.
notjohn has joined #ruby
<fasta> Spaceghostc2c: also, I'd think that having all the VMs run all the time is a waste of memory.
<Spaceghostc2c> kalleth: You basically turn on your server and within a few minutes, you'll have another machine that automatically starts hosting virtual machines and hosting services.
sameerynho has joined #ruby
lxsameer has quit [Ping timeout: 250 seconds]
<fasta> Spaceghostc2c: which VM tech do you use?
tomb has quit [Quit: Computer has gone to sleep.]
sameerynho has quit [Max SendQ exceeded]
<Spaceghostc2c> fasta: For testing this on my beefy desktop, vmware.
<fasta> Spaceghostc2c: don't you need to pay an arm and a leg if you want to get that running in production?
arkiver has joined #ruby
erichmenge has joined #ruby
myth17 has joined #ruby
baphled has joined #ruby
Ionic` has joined #ruby
neku is now known as neku|away
neku|away is now known as neku
justinmc_ has joined #ruby
justinmc_ has quit [Remote host closed the connection]
tomb has joined #ruby
<Spaceghostc2c> fasta: I'm using Xen in production.
niku4i has quit [Remote host closed the connection]
tomb has quit [Client Quit]
shevy has quit [Ping timeout: 252 seconds]
niku4i has joined #ruby
<Spaceghostc2c> For system level stuff. We're also planning on using a few other VTs for their nifty features. LXC for 'shared' plans.
dhruvasagar has quit [Ping timeout: 255 seconds]
justinmcp has quit [Ping timeout: 244 seconds]
niku4i has quit [Remote host closed the connection]
uris has joined #ruby
<fasta> Spaceghostc2c: I don't really like that Xen doesn't even have up to date documentation.
niku4i has joined #ruby
Hounddog has left #ruby [#ruby]
<fasta> Spaceghostc2c: it seems like one of those things you have to learn by trial and error.
<Spaceghostc2c> fasta: It definitely doesn't help. My friend is building out a jsonrpc service around it.
<fasta> Spaceghostc2c: it?
<fasta> Spaceghostc2c: the lack of docs?
<Spaceghostc2c> That the docs can be a bit old.
mohits has joined #ruby
mohits has quit [Changing host]
mohits has joined #ruby
<fasta> I think it's part of their business model.
fearoffish has joined #ruby
<fasta> Provide bad documentation, such that it is cheaper to call a consultant.
RainbowDashh has quit [Quit: SLEEP MODE. [NSFW!] [WIERD] [WTF] http://pastebin.com/6L0WjKRk]
<kalleth> Spaceghostc2c: how do you add it to the services round-robin once provisioned?
<JonnieCache> Spaceghostc2c: whats LXC? virtualization tech?
<kalleth> what kind of clevefr stuff do you do there
<Spaceghostc2c> JonnieCache: Google it, my friend.
<fasta> Spaceghostc2c: which company do you work for?
<Spaceghostc2c> kalleth: We're using a ring key value system to tell all the other nodes where each other are.
<JonnieCache> ahhh thought so. i needed something like that recently but now i dont. what a shame.
<Spaceghostc2c> fasta: Personal project. We might accept funding from a very prominent hosting company.
<kalleth> Spaceghostc2c: ooooh. cool.
schovi has joined #ruby
<Spaceghostc2c> kalleth: You'll be able to use the website or the json api. It'll route through our redundancy crap to a sinatra app that routes requests back into a background job system. An erlang process takes it and acts on the job, calling the necessary rpc's and stuff to complete teh request.
<kalleth> oh, so the VM makes a call post-boot to a JSON api saying 'i'm here' and the central management svc then calls back via some kind of authenticated 'run this command' system to set itself up?
<kalleth> or rather, the former isn't required
<kalleth> as the PXE boot can be the notification
ananthakumaran has quit [Quit: Leaving.]
Sweet-P has joined #ruby
dhruvasagar has joined #ruby
Sweet_P has quit [Ping timeout: 255 seconds]
tomb has joined #ruby
apeiros_ has joined #ruby
internet_user has joined #ruby
shevy has joined #ruby
arkiver has quit [Ping timeout: 250 seconds]
kvirani has joined #ruby
devdazed has joined #ruby
carloslopes has quit [Quit: Leaving.]
jsime has quit [Read error: Connection reset by peer]
josefig has joined #ruby
josefig has quit [Changing host]
josefig has joined #ruby
dekroning has joined #ruby
<kapowaz> hmm, getting errors trying to install ruby 1.9.3 with rvm (OS X)
jsime has joined #ruby
<cubicme> /ignore * ALL -PUBLIC -ACTIONS
<kapowaz> the logfile it points do doesn't exitst
cubicme has quit [Quit: leaving]
macnix has joined #ruby
<Xethron> ok
<hoelzro> kapowaz: echo '-k' > ~/.curlrc should solve it
cubicme has joined #ruby
<hoelzro> but I wouldn't keep that setting around
<kapowaz> what's that do? ignore certificate validity?
<hoelzro> yes
<kapowaz> hmm, it downloaded it, but then the archive was unrecognised.
<kapowaz> it's trying to download ruby-1.9.3-preview1 when I do rvm install 1.9.3 — shouldn't there be a stable release?
ghanima has quit [Quit: Leaving.]
<hoelzro> yes
<hoelzro> -p125, I think
<kapowaz> hmm, that was corrupt too.
<hoelzro> actually -p194 is the current stable
blazes816 has joined #ruby
<kapowaz> what's this all about!?
<hoelzro> kapowaz: try downloading the URL via curl on the command line
<hoelzro> it could be that a proxy or something is getting in your way
<hoelzro> hence the SSL cert errors
mdszy has joined #ruby
<kapowaz> how would I find out what the URL is? I don't see it in the output from rvm
<hoelzro> and the "corrupt" archives which are probably 403 Forbidden pages
<hoelzro> =(
* hoelzro shrugs
<kapowaz> I just checked — they're actually the documentation page of RVM
hunglin has joined #ruby
liluo has quit [Remote host closed the connection]
<kapowaz> (rvm.io)
<cubicme> /ignore * ALL -PUBLIC -ACTIONS
tatsuya__ has quit [Remote host closed the connection]
<Xethron> hmm
<Xethron> ok
<Xethron> cubicme wants to ignore us it seems :P
cubicme has quit [Quit: leaving]
kevinbond has joined #ruby
lorandi has joined #ruby
<apeiros_> anybody got a performant solution to query (DNS) for the MX for a given domain?
<apeiros_> I have a solution using the stdlib resolv lib, but it's quite slow
Foxandxss has quit [Quit: KVIrc 4.0.4 Insomnia http://www.kvirc.net/]
williamherry has quit [Remote host closed the connection]
kenperkins has quit [Quit: Computer has gone to sleep.]
<apeiros_> (got a suggestion to use `dig …`, but I doubt that shelling out will be faster…)
<dekroning> I would like to use Mocha in irb
<dekroning> however, as soon as I set a stub it blows up, and I get a backtrace
<dekroning> apeiros_: notice, that i'm not saying 'it doesn't work' ;-)
sonkei has joined #ruby
nachtwandler has joined #ruby
<apeiros_> "it blows up" is semantically equivalent to "it doesn't work"
<apeiros_> hm, no, actually it's not
<apeiros_> it *is* more information. and if even only by a little bit.
<apeiros_> (doesn't work could also mean "I get an unexpected return value")
dcampano has joined #ruby
thecreators has joined #ruby
Juul has quit [Ping timeout: 246 seconds]
minijupe has joined #ruby
ben_alman has quit [Excess Flood]
jamesaxl has quit [Ping timeout: 252 seconds]
jamesaxl has joined #ruby
<Spaceghostc2c> kalleth: That's the current idea.
<apeiros_> dekroning: really, you only cut your self by asking such unsubstantiated questions.
Helius has quit [Remote host closed the connection]
xscc has joined #ruby
xscc has quit [Remote host closed the connection]
<dekroning> when trying out Mocha in irb, after setting a stub (like: Order.stubs(:find).returns({ id: 1 })) it seems to be that it's immediatly running the mock verification. Is there a way to postpone this verification when running Mocha via irb ?
chrismdp has left #ruby [#ruby]
neku is now known as neku|away
chson has joined #ruby
adamgamble has joined #ruby
ben_alman has joined #ruby
<walbert> apeiros_: for checking MX records, i keep a list of my most-often seen 1000 domain names cached, and defer to Resolv when something doesn't match. Doesn't help the worst case, but in practical terms, the worst case is a rarity.
markab has quit [Quit: Leaving.]
markab has joined #ruby
<shevy> hmmm
<shevy> again I got confused by: puts "foo\n" vs puts "foo"
<apeiros_> walbert: yeah, will probably be what I will do
<apeiros_> just that I'll cache all
myth17 has quit [Ping timeout: 252 seconds]
<apeiros_> it's only a couple of thousand domains
markab has left #ruby [#ruby]
dkissell_ has joined #ruby
tds has joined #ruby
nilg has quit [Remote host closed the connection]
<kalleth> Spaceghostc2c: :)
dkissell has quit [Ping timeout: 264 seconds]
dkissell_ is now known as dkissell
<apeiros_> walbert: I'll also try to thread the resolving for multiple domains. if it's only IO bound…
ckrailo has quit [Quit: Computer has gone to sleep.]
Hanmac has quit [Ping timeout: 246 seconds]
myth17 has joined #ruby
shvelo has left #ruby [#ruby]
ananthakumaran has joined #ruby
adamgamble has left #ruby ["["Textual IRC Client: www.textualapp.com"]"]
blazes816 has quit [Quit: Leaving]
neku|away is now known as neku
yonggu_ has joined #ruby
sailias has joined #ruby
billiamii has joined #ruby
Synthead has joined #ruby
ilyam has joined #ruby
<Synthead> is there a method to print html-escaped strings? (I'm on rails, if it helps)
akem has joined #ruby
akem has quit [Changing host]
akem has joined #ruby
yonggu has quit [Ping timeout: 264 seconds]
tvw has quit [Remote host closed the connection]
tk___ has quit [Quit: ばいばい]
ipoval has joined #ruby
indian has joined #ruby
TPFC-SYSTEM has quit [Quit: TPFC-SYSTEM]
bowlowni has quit [Remote host closed the connection]
monkegjinni has joined #ruby
charliesome has quit [Quit: Textual IRC Client: www.textualapp.com]
<apeiros_> Synthead: #rubyonrails
ben_alman has quit [Excess Flood]
<apeiros_> and the default in rails is to consider strings to be "unsafe" and escape it
<apeiros_> you have to mark a string as already html_safe in order to let rails leave it untouched
dwon has joined #ruby
ben_alman has joined #ruby
<Synthead> apeiros_: ah, okay
<Synthead> apeiros_: thanks :)
macnix has quit [Ping timeout: 252 seconds]
ckrailo has joined #ruby
Paul-Atreides has joined #ruby
Paul-Atreides has quit [Changing host]
Paul-Atreides has joined #ruby
Araxia has joined #ruby
Paul-Atreides is now known as enroxorz
dinkoko__ has joined #ruby
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
hero has quit [Ping timeout: 246 seconds]
Shahor has joined #ruby
Shahor has quit [Client Quit]
hero has joined #ruby
dinkoko__ has quit [Quit: Page closed]
quest88 has joined #ruby
robozahn has joined #ruby
Spooner has quit [Ping timeout: 248 seconds]
kenperkins has joined #ruby
andrewhl has joined #ruby
cakehero has joined #ruby
hero_ has joined #ruby
walbert has quit []
robozahn has quit [Read error: Connection reset by peer]
robozahn has joined #ruby
monkegjinni has quit [Ping timeout: 255 seconds]
hero has quit [Read error: Connection reset by peer]
nemesit has joined #ruby
umttumt has joined #ruby
robozahn has quit [Client Quit]
tomzx has joined #ruby
tomzx has left #ruby [#ruby]
bikr has joined #ruby
jfoley has joined #ruby
nilsine has joined #ruby
kaiwren has quit [Quit: kaiwren]
Morkel has quit [Quit: Morkel]
ipoval has quit [Quit: ipoval]
<bikr> This may be a very misguided question, as I'm pretty new, but I wrote a ruby script that I launch via command line via: ruby myfile.rb argument1 argument2 is there a way I can include that file somehow and feed the arguments from form html form fields or something instead of running from command line so it can be hit in a browser, form filled out and on submit sent to the script with standard out displayed in the browser somehow
mohits has quit [Read error: Operation timed out]
<nilsine> hi
<shevy> hi nilsine
<bikr> hi there
neku is now known as neku|away
<ramblex> bikr: I think the easiest way to do something like that would be to use sinatra (or something similar)
foofoobar has joined #ruby
tagrudev has quit [Quit: Me = Awesome]
nilsine_ has joined #ruby
pk1001100011 has quit [Remote host closed the connection]
<nilsine_> submit your most beautiful snippets of ruby code at the first ruby beauty contest :-D
larissa has quit [Quit: Saindo]
<bikr> ramblex: Looking into it now (never heard of it)
ghanima has joined #ruby
pskosinski has joined #ruby
nilsine has quit [Quit: Quitte]
darthdeus has joined #ruby
<Sou|cutter> nilsine_: hard to judge snippets in isolation. Interesting, though
<darthdeus> what is the convention for bang methods? I've heard somewhere that there should always be a non-bang method if i want to use it ... but to me it seems like a kind of good idea to do something like "current_user.signup!" for a method that does something with side effects
<nilsine_> you judge beauty, not fonctionnality
withnale has joined #ruby
<apeiros_> darthdeus: the convention is that you name your method with a bang if it is "dangerous". that's all.
<apeiros_> darthdeus: there are however a lot of methods that exist in pairs, bang meaning in-place, non-bang meaning that it returns the modified value
<apeiros_> often the bang methods in those pairs will return nil if nothing was changed (cf. String#gsub!, tr!, delete! etc.)
<darthdeus> apeiros_: so it's not against the convention to jsut have the bang method?
<apeiros_> no. it's just uncommon.
<canton7> normally the bang is reserved for when you have a pair of methods, one more "dangerous" than the other
<darthdeus> because i've got in a habit of using it for any method that has side effects, and i got told it's not right :X
<oddmunds> nilsine_: how can they be separated?
<apeiros_> it is more often the case that you only have a no-bang method which is in-place, though. (cf. Array#push, #pop, #shift etc.)
<darthdeus> like if i have a method on a model which creates another model, i'll always write that method with a bang
<apeiros_> I think bang-only is very rare.
* apeiros_ ponders to search…
<darthdeus> that way if i have current_user.signup! .. i'll know it's doing something like creating a record in the database :X
LowKey has quit [Quit: changing servers]
bradhe has quit [Remote host closed the connection]
<nilsine_> oddmunds: it's just a fun contest, but of course the code have to worked
wobr has quit [Ping timeout: 265 seconds]
<nilsine_> *work
talumees has quit [Quit: Leaving]
<oddmunds> i think it's interesting
<oddmunds> but i'm itching to comment
<darthdeus> hm taking this to extreme, i'm thinking that if i write most of my code side-effect-free, it could be a good idea to mark anything with side effects with bang right?
<apeiros_> ok, 37 bang methods in IRB upon plain start (with some stdlibs required)
Hounddog has joined #ruby
<oddmunds> i'd rather was def recent_file?; updated_at > 4.hours.ago; end
mengu has quit [Remote host closed the connection]
<nilsine_> I see what you mean, I think comments is the next functionnality we have to add
<canton7> oddmunds, I thought that at first, but then I realised the whole example was contrived to show off #ago
<Hounddog> don't know how many here use vlad... but it seems that it is not creating the release folder. if you have any suggestions or a place where i can get help on this am all ears...
<apeiros_> there are 0 methods where there exists a bang method but no non-bang
<apeiros_> (only exception being the bang method itself - but it's hard to have a non-bang counterpart to that method)
freeayu has quit [Quit: 离开]
<darthdeus> hmm, i guess i'm trying to be too functionaly pure :X but it seems to me there should be a way to mark side-effect heavy methods without having to dupliacte the code
<oddmunds> canton7: then it could be trimmed down even more to not distract from the nice ago
<canton7> oddmunds, true
<nilsine_> don't hesitate if you have beautiful snippets in your hard disk, the contest need more :-D
carloslopes has joined #ruby
<darthdeus> for example say that i have a decorator, and some of its methods just return a value, but other methods do something hardcore with side effects .... shouldn't that be somehow obvious from the point where i am calling the method?
<oddmunds> i'll keep it in mind
blazes816 has joined #ruby
<oddmunds> nilsine_: since you seem to be involved in this, can i come with a feature request?
<nilsine_> oddmunds: yes
carloslopes has quit [Client Quit]
<oddmunds> a description field for the snippet to explain what the purpose is. to me it's hard to appreciate a solution if do not know the problem.
carloslopes has joined #ruby
<nilsine_> there is the remarks field for that
Sweet_P has joined #ruby
Quintus_q has joined #ruby
gentz has quit [Remote host closed the connection]
Sweet-P has quit [Ping timeout: 252 seconds]
<oddmunds> yeah, but it doesn't show up in the overview
<oddmunds> it's hidden
<oddmunds> as far as i can tell it's the only thing that's hidden from the overview
<nilsine_> yes, it's show on "snippet page"
ryansch has quit [Quit: Linkinus - http://linkinus.com]
gilead has quit [Quit: This computer has gone to sleep]
<nilsine_> maybe we can show it on the overview also
froy has quit [Ping timeout: 244 seconds]
<oddmunds> i can only speak for myself, obviouslty
niku4i has quit [Remote host closed the connection]
gentz has joined #ruby
niku4i has joined #ruby
jasond` has joined #ruby
cezar has joined #ruby
nachtwandler has quit [Ping timeout: 252 seconds]
cezar has quit [Read error: Connection reset by peer]
thisirs has quit [Remote host closed the connection]
Natch has quit [Ping timeout: 246 seconds]
blacktulip has quit [Remote host closed the connection]
niku4i has quit [Ping timeout: 246 seconds]
burgestrand has quit [Quit: Leaving.]
jesly has joined #ruby
foofoobar has quit [Quit: bb]
blacktulip has joined #ruby
hoelzro is now known as hoelzro|away
cdepue has joined #ruby
myth17 has quit [Quit: Leaving]
benson has joined #ruby
jfoley has quit [Quit: jfoley]
bradhe has joined #ruby
Quintus_q has quit [Quit: Valete!]
Guest80510 is now known as davidw
davidw has quit [Changing host]
davidw has joined #ruby
silentpost has joined #ruby
rasbonics has joined #ruby
tewecske has joined #ruby
punkrawkR has joined #ruby
blacktulip has quit [Remote host closed the connection]
davidw has quit [Ping timeout: 240 seconds]
maletor has joined #ruby
davidpk has joined #ruby
bluenemo has joined #ruby
wallunit has quit [Quit: Leaving.]
silentpost has quit [Ping timeout: 244 seconds]
dhruvasagar has quit [Ping timeout: 246 seconds]
savage- has joined #ruby
cordoval has joined #ruby
<cordoval> hi guys i am getting this error ~ vagrant init precise64 /home/cordoval/.rvm/gems/ruby-1.9.2-p290/gems/vagrant-0.8.10/lib/vagrant/config/vm.rb:31:in `forward_port': wrong number of arguments (2 for 3) (ArgumentError) any hints?
beneggett has joined #ruby
<mdszy> seems like a bug in the gem itself, open a bug report
<kapowaz> so, I just swapped over to using rbenv instead of rvm, and as part of the swap I've given bundler a global setting to install gems in vendor/bundle, relative to the project path.
<cordoval> lol \joinback #symfony2
Hounddog has quit [Remote host closed the connection]
cordoval has left #ruby [#ruby]
cbuxton has joined #ruby
<kapowaz> I'm sure this is a pretty obvious answer, but how then do you require these gems in your project?
thecreators has quit [Quit: thecreators]
<mdszy> use bundler and an older version of the gem without the bug
<mdszy> gem 'vagrant', 'x.x.x'
jxpx777 has quit [Quit: Mac is sleeping…]
kaiwren has joined #ruby
carlyle has quit [Remote host closed the connection]
carlyle has joined #ruby
<workmad3> kapowaz: require 'bundler/setup' and then just require the gems as normal
gokul has joined #ruby
Alien_Elite has quit [Ping timeout: 268 seconds]
Alien_Elite has joined #ruby
Natch has joined #ruby
arturaz has quit [Ping timeout: 246 seconds]
chico_chicote has joined #ruby
<kapowaz> workmad3: now I get LoadError: no such file to load -- bundler/setup
<workmad3> kapowaz: hmm, what version of ruby and bundler do you have?
<kapowaz> looks like the problem may actually be with pow
gokul has quit [Client Quit]
<workmad3> banisterfiend: oh, I decided to investigate the non rvm world by switching to rbfu :)
bluenemo has quit [Remote host closed the connection]
<banisterfiend> workmad3: how is it
Yarou has joined #ruby
Yarou has quit [Changing host]
Yarou has joined #ruby
<any-key> I haven't had any real problems with RVM thus far
<workmad3> banisterfiend: not bad, although I've already hacked my brew-installed version of it to add my bundler binstubs directory into the setup paths :)
<workmad3> banisterfiend: the fact that I could do that in about 30s shows how simple it is :)
<banisterfiend> workmad3: why do u think rbenv/rvm didnt use the rbfu approach? just didnt think of it?
<workmad3> banisterfiend: what do you mean?
digitalcakestudi has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
<banisterfiend> workmad3: the approach to version switching, i haven't looked into how it works, but it's the simplest one right? why do you think rbenv went with a shim approach compares to whatever approach rbfu uses?
<tds> can anyone help explain this behaviour?
<banisterfiend> compared*
jfoley has joined #ruby
<tds> i guess i'm unclear on how class variable resolution works
mohits has joined #ruby
mohits has quit [Changing host]
mohits has joined #ruby
<any-key> that makes sense
<workmad3> banisterfiend: automation, I believe... rbfu needs to manipulate the environment variables directly, while rbenv can just update some symlinks
etehtsea has quit []
<workmad3> banisterfiend: I don't mean automation... I think I meant style :)
<any-key> hmmm actually I dunno
<workmad3> banisterfiend: I could see rbfu getting a bit confused if I was in the habit of playing around with my PATH while a ruby is activated... but I'm not :)
TPFC-SYSTEM has joined #ruby
bglusman has quit [Remote host closed the connection]
<banisterfiend> ah ok
<workmad3> banisterfiend: however, I believe rbenv can basically leave your environment alone once it's done the initial setup
bglusman has joined #ruby
<workmad3> banisterfiend: and RVM does a lot of environment manipulation to give more features :)
oooPaul has joined #ruby
beneggett has quit [Quit: Computer has gone to sleep.]
<tds> are class variables resolved like constants?
bglusman_ has joined #ruby
<tds> in their lexical scope rather than in the calling scope
<workmad3> tds: no
<tds> then why does this
<tds> work
<banisterfiend> workmad3: have the rvm guys other project?
<banisterfiend> workmad3: have you seen*
<Sou|cutter> bdsm?
<workmad3> tds: because you only get one class var in the entire inheritance tree
<tds> workmad3: but they print two separate things
<banisterfiend> workmad3:
<banisterfiend> Sou|cutter: yeah, what do u think of it?
<tds> workmad3: you get bar and baz
<workmad3> tds: ah, probably because you're using modules
<tds> yeah, exactly
<tds> workmad3: but i can't find any information on this
<tds> workmad3: was not expected behaviour
<workmad3> tds: most of the behaviour of class variables falls under 'not expected' :)
cousine has joined #ruby
<tds> haha, it would seem that way :)
apeiros_ has quit [Remote host closed the connection]
EstanislaoStan has joined #ruby
<banisterfiend> Sou|cutter: ?
cezar has joined #ruby
ph^ has joined #ruby
bglusman has quit [Ping timeout: 245 seconds]
cezar has quit [Client Quit]
bricker88 has joined #ruby
avandenhoven has joined #ruby
bglusman_ has quit [Ping timeout: 245 seconds]
<Sou|cutter> banisterfiend: I don't really know enough about it, other than it exists
quest88 has quit [Quit: quest88]
itnomad has joined #ruby
snearch has joined #ruby
<EstanislaoStan> So yesterday someone here suggested to me not to do what I was trying to do with class variables because most people don't like them or something along those lines. So my question is: What are the drawbacks of class variables that people don't like and is it true most people don't use them?
MatthewGA has joined #ruby
learc83 has joined #ruby
<JonnieCache> nobody uses them, and the reason is the way they interact with inheritance. its very unintuitive
<banisterfiend> EstanislaoStan: ask tds :)
<banisterfiend> tds: tell him! :P
<JonnieCache> instead, people use class singleton variables, which actually work like you expect
silentpost has joined #ruby
<banisterfiend> EstanislaoStan: https://gist.github.com/6483382e261039b948c0
<JonnieCache> but yeah ask the guy who is just this minute experiencing that problem
<tds> EstanislaoStan: their behaviour is not very clear
<tds> EstanislaoStan: and when it is clear, it is limited
ph^ has quit [Ping timeout: 264 seconds]
jimeh3 has quit [Ping timeout: 248 seconds]
<tds> EstanislaoStan: class instance variables are a much safer bet
<tds> EstanislaoStan: look at the gist that banisterfiend put up there… that's the weirdness I was just seeing
nilsine_ has quit [Quit: Quitte]
ben_alman has quit [Excess Flood]
Niamkik has joined #ruby
<workmad3> JonnieCache: class instance variables is, I believe, the normal name
ben_alman has joined #ruby
<workmad3> but yes... class instance variables follow the principle of least surprise that most people expect from class variables
mucker has joined #ruby
<workmad3> which I guess explains a bit why class variables act the way they do... because class instance variables act so you get a per-class variable, class variables act so you get a per-inheritance-hierarchy variable
<tds> unless you extend a module in, in which case, they appear to be lexically scoped ;)
<workmad3> tds: yeah, that's odd
cirwin has joined #ruby
<workmad3> tds: but then extending a module does some interesting internal stuff :)
thecreators has joined #ruby
<tds> yeah, i was looking at that a while ago
<banisterfiend> tds: if u replace extending a module with just inheritance, how does it behave?
<banisterfiend> oh wait
<tds> normally
<banisterfiend> extending != including
<tds> yeah
<tds> e
<tds> extending actually includes the module into the eigenclass of the class you're extending on
<tds> as far as i can tell
<workmad3> tds: wouldn't surprise me if what you've ended up with is a class var @@foo between B and its instances, and another one that's looked up by the module methods for B and B.singleton_class
ianbrandt has joined #ruby
<tds> yep, that's what I was thinking
<tds> very strange
<workmad3> tds: or maybe between B and the wrapper class that gets created to insert a module into a class ancestor chain...
<workmad3> tds: because when I tried to create another module and extend it into the same class, I got yet another copy of the class var
<tds> that's really fascinating
<tds> but programming languages shouldn't make you fascinated with their behaviour generally ;)
cousine has quit [Remote host closed the connection]
<workmad3> sure they should :)
<workmad3> it's how you learn more about them ;)
beneggett has joined #ruby
<workmad3> it's when normal stuff makes you fascinated you should worry, rather than edge-case behaviour :)
<tds> ah, true
<tds> good point
lolmaus has quit []
<JonnieCache> down that route lies java
umttumt has quit [Remote host closed the connection]
<workmad3> nah, java syntax doesn't have fascinations... it's just stupid :P
<JonnieCache> exactly
<workmad3> jvm behaviour can be fascinating though :)
<JonnieCache> it is the least fascinating language ever
<JonnieCache> its designed so corporate programmers cant hurt themselves with it
<JonnieCache> i agree, the jvm is a different matetr
<JonnieCache> *matter
ixx is now known as any-keyed
<Tasser> JonnieCache, I use jruby as soon as I need power
any-keyed is now known as ixx
<Tasser> jruby + peach + blade = fast
<JonnieCache> indeed, the jvm is one of the most impressive modern technologies of its type
<JonnieCache> its a triumph
yonggu_ has quit [Remote host closed the connection]
<workmad3> yeah, java flips things a bit... it sort of flips it so that the clever people who know it in-depth are more likely to hurt things and break things badly, rather than the 'average' coder :)
yonggu has joined #ruby
<JonnieCache> if you want to get even remotely close to losing a limb in java you have to type out pages of code. have you seen the reflection api?
<JonnieCache> so you cant really do it by accident
<workmad3> sure you can... just write your own class loader :P
<JonnieCache> how many lines is that though?
<workmad3> I believe you can do a class loader quite simply nowadays
darthdeus has quit [Ping timeout: 264 seconds]
<workmad3> pages of code, but that's more because of java than because of class loader stuff :)
<workmad3> you need an essay to do Hello World in java after all :)
bikr has left #ruby [#ruby]
<tds> i haven't programmed java in ages
<tds> thankfully
<JonnieCache> me neither. apparently it has moved on. they almost have closures now!
<tds> haha, if anyone wants to laugh, you should see php's implementation of closures
<workmad3> almost! maybe in java 8... or java 9
<blazes816> workmad3: and that essay is just setting the classpath from terminal
<workmad3> blazes816: :D
bigoldrock has joined #ruby
jfoley has quit [Quit: jfoley]
<JonnieCache> oh my gosh did you see that recent php rant
thecreators has quit [Quit: thecreators]
<JonnieCache> there have been many anti-php blogposts over this years but this one is a doozy
<blazes816> lol
thecreators has joined #ruby
thecreators has quit [Read error: Connection reset by peer]
schaerli has joined #ruby
<tds> with good reason
mrkhat has left #ruby [#ruby]
Eldariof-ru has quit [Read error: Operation timed out]
<tds> if you want to use a closure in php, you have to specify which variables you want to use from the enclosing scope
g0bl1n has joined #ruby
Aszurom has joined #ruby
<blazes816> tds: lmao, really? how is that not just a function then?
<blazes816> other than perhaps it changes the outside?
Awsumlazer has joined #ruby
<tds> yeah, i think that would be the only advantage
Criztian has quit [Remote host closed the connection]
<JonnieCache> that almost sounds like a java-ism
<tds> also that you can return a function
<tds> with its scope defined
<canton7> $a = 5; array_map(function($x) use ($a){ return $x + $a; }, array(1, 2, 3)); # yay readability
<tds> yeah its that use($a) bit
<tds> that specifies the variable you want to use in the closure
<JonnieCache> W. T. F.
<canton7> which you can't pass in as a straight argument, as array_map doesn't work that way
<JonnieCache> the interpreter internals must be a MESS if they had no choice but to demand that
exchgr has joined #ruby
<canton7> have you not seen them? :)
<tds> haha
<JonnieCache> lol no the same way i dont go looking for snuff porn or execution videos
jesly has quit [Ping timeout: 264 seconds]
<tds> php is a mess
<JonnieCache> or any other awful shit
<canton7> good man. stay away
<tds> in php you have mysql_real_escape_string and mysql_escape_string
jfoley has joined #ruby
mockra has joined #ruby
<JonnieCache> didnt they get rid of those?
<tds> yeah, they are deprecated now, but still usable
stkowski has joined #ruby
ben_alman has quit [Excess Flood]
thecreators has joined #ruby
Rochefort has quit [Remote host closed the connection]
<JonnieCache> tbh my favourite is the automatic casting that the comparison operators do
<tds> ah, yes
<JonnieCache> look in that link i posted. so amusing.
pdtpatrick has joined #ruby
apeiros_ has joined #ruby
<tds> i like the part about it not being transitive
<JonnieCache> its the non-reversible ones that i like
<tds> yeah, haha
<JonnieCache> transitive thats the word
shadoi has joined #ruby
baphled has quit [Quit: leaving]
grekkos has joined #ruby
Cache_Money has joined #ruby
baphled has joined #ruby
<pdtpatrick> Question - is Nokogiri the best way to parse XML? I've also seen libxml and simplexml and REXML -- but there's not a good examples on how to use either. Has anyone a blog or wiki that can help?
<canton7> nokogiri does seem to be the most popular, on here at least
apok has joined #ruby
banghouse has joined #ruby
<blazes816> I like nokogiri a lot. and the website has a lot of documentation.
<Sou|cutter> doesn't nokogiri use libxml under the covers?
shadoi has quit [Client Quit]
<blazes816> I think so
<grekkos> Hi there I'm kinda new to ruby, working with hashes here and I'm wondering if there's a way to set a label to point to a subset of values inside that hash... something like this https://gist.github.com/57e6d17fe733865ee940 but the output isn't what i was looking for
brianpWins has joined #ruby
<grekkos> i wanted to get the same output on the second line as the first
<canton7> puts $test_config[$test_config[:default]]
<pdtpatrick> i've gone through the docs and .css works but their .xpath returns nothing. http://nokogiri.org/tutorials/searching_a_xml_html_document.html .. will continue digging
ringotwo has joined #ruby
<grekkos> canton7: alright thanks let me try that
<bnagy> except don't, that's a horrible idea
<bnagy> also, try not to use $globals
shadoi has joined #ruby
<grekkos> bnagy: it's for my rakefile i don't think it matters all that much
darthdeus has joined #ruby
<bnagy> use another hash for your subset
<tds> yeah, agree with bnagy
<bnagy> self referential hashes are gross
<tds> and potentially unreliable
<bnagy> or keep a list of keys and do hsh.values_at keys
<bnagy> or probably lots of other ways
Aszurom has quit [Ping timeout: 255 seconds]
<grekkos> hmm the way i have it set up right now is basically the config hash has sub hashes of sites, the idea being to do $config[:site] and get the proper config values
dwon has quit [Quit: Leaving]
c0rn_ has joined #ruby
<grekkos> what's a better way to design that?
<canton7> that, on its own, is fine
elhu has quit [Ping timeout: 244 seconds]
<bnagy> apart from the global :)
<canton7> it's the fact that there's a special key, :default, which references something else in the bash, which we don't like
<canton7> s/bash/hash
joch_n has joined #ruby
<bnagy> if you want defaults that's fine
<bnagy> normally you would make a hash of defaults, then do myhsh=defaults.merge myhsh
<grekkos> ah ok
noganex has quit [Quit: Eagles may fly, but a weasel will never be sucked into a jet engine.]
<grekkos> so I can set a default outside
<bnagy> then anything not set will get the default, otherwise values from myhsh will win
<grekkos> oh that's not a bad idea
voodoofish430 has joined #ruby
ben_alman has joined #ruby
<bnagy> there's probably a nicer syntax, but that's my standard pattern
mockra has quit [Remote host closed the connection]
alindeman has quit [Quit: /quit]
<grekkos> well thanks for the ideas at least
<grekkos> I think I got a better idea of what I was trying to do out of this
dankest has joined #ruby
<JonnieCache> what bnagy described with merging the defaults is a very common pattern
<JonnieCache> it works well
workmad3 has quit [Ping timeout: 265 seconds]
<JonnieCache> activesupport even has a reverse_merge method on hash that makes it easier
<grekkos> yeah I like that idea I didn't know about the merge method
tvw has joined #ruby
<Synthead> how can I check if a hash index is in a hash?
<JonnieCache> hash.has_key?(:key)
<canton7> #include?
<JonnieCache> they are the same
ixti has joined #ruby
<canton7> though #has_key? is probably clearer
jgrevich has joined #ruby
<JonnieCache> you can also apparently use key? and member?
skryking has quit [Quit: Konversation terminated!]
<JonnieCache> all the aliases in stdlib is one of the things i dislike about ruby
ixti has quit [Client Quit]
cdepue has quit [Remote host closed the connection]
mockra has joined #ruby
<canton7> in some cases I think it adds clarity -- which alias you choose can give information on what you're using it for. In other cases, as you say, they only seem to add clutter though
mockra has quit [Remote host closed the connection]
<JonnieCache> i agree it can add clarity. they go too far sometimes though
Targen has joined #ruby
<JonnieCache> four methods to check for the presence of a key is too many imo
<canton7> yeah, I do completely agree there
zommi has quit [Remote host closed the connection]
<JonnieCache> and for years i used collect and inject all the time, not realising that I was implementing the mapreduce pattern
<Mon_Ouie> I don't really like Hash#include?, because it's not consistent with Enumerable#include?
mwilson_ has quit [Excess Flood]
<JonnieCache> one day i decided to learn this fancy mapreduce thing everyone talks about, only to find i already used it but the methods had different names
<Mon_Ouie> I'd expect {:a => :b}.include? [:a, :b] to be true
mwilson_ has joined #ruby
<JonnieCache> Mon_Ouie: yeah. that would have questionable usefulness though...
<JonnieCache> doesnt that go against how youre meant to use a hash?
<Mon_Ouie> Generic methods supposed to work with any Enumerable
<blazes816> Mon_Ouie, but [:a, :b] isn't a key. :a is.
<blazes816> {[:a, :b] => :b}.include? [:a, :b]
<Mon_Ouie> blazes816: I know what Hash#include? does, I'm arguing that's not how it works for other enumerable objects.
<bnagy> has_key? is a lot clearer
<bnagy> btu I think you'd have to write a lot of C++ or java to expect your way to work, Mon_Ouie :)
ringotwo has quit [Remote host closed the connection]
<blazes816> Mon_Ouie, how does it differ?
<apeiros_> blazes816: basically his include? would be an include_pair?
ringotwo has joined #ruby
<blazes816> to be the same, should what you said be false? and {:foo => [:a, :b]}.include? [:a, :b] be true?
<apeiros_> with include?([key, value]), since each yields [key, value]
<bnagy> yeah
<blazes816> ah
<blazes816> interesting
<blazes816> that makes sense
<bnagy> makes some sense, but I think it's a bit cruel to the parser
<JonnieCache> yeah the ruby parser has it bad enough as it is heh
noganex has joined #ruby
<pdtpatrick> Question - I'm trying to use Nokogiri to parse XML and i'm just failing at it. Here's the XML: https://gist.github.com/c5b5700c743b2e8ffa36 , here's the code: https://gist.github.com/967f3182f0349624eb20 , and here's the output: https://gist.github.com/815c3617b6faf62ce8ef . Somehow it only sees the first HSItemPrice and never proceeds to the next.
<bnagy> without a way to explicitly 'cast' it as a pair
cirwin has left #ruby [#ruby]
<JonnieCache> pdtpatrick: for future reference you can include multiple files in one gist
baphled has quit [Quit: Changing server]
<pdtpatrick> Thanks Jonnie - will do so next time
<JonnieCache> pdtpatrick: your xml is not proper xml and that's probably confusing nokogiri, which is quite a strict parser
<JonnieCache> pdtpatrick: give it a root node and try it again
<pdtpatrick> K - will try that now
<JonnieCache> its probably treating the first HSItemPrice as the root node and ignoring everything after it
<Synthead> thanks! :D
<blazes816> pdtpatrick: also change the leading // to / in your xpath
<blazes816> maybe not...
alindeman has joined #ruby
<blazes816> after re-reading the docs
`brendan has quit [Ping timeout: 265 seconds]
<apeiros_> bnagy: how does that affect the parser?
Fairish91 has joined #ruby
chrismcg is now known as zz_chrismcg
<Fairish91> lklkl
<blazes816> pdtpatrick: /rootnode/HSItemPrice
<pdtpatrick> http://pastie.org/private/p94jn8onfbdyyxhpecikq -- here i've added the root
<apeiros_> Mon_Ouie: and would you settle for a test with eql? for the key and == only for the value? or does the key need to be == too?
<apeiros_> the latter would require a full scan of the hash
<apeiros_> the former could be done with hash lookup
<Fairish91> nite
baphled has joined #ruby
Fairish91 has left #ruby [#ruby]
<shevy> dumdedum
khakimov has joined #ruby
bubu\a has quit [Remote host closed the connection]
bubu\a has joined #ruby
<blazes816> pdtpatrick: for one, you're searching by xpath, not css
<blazes816> I'm looking at it...
baphled has quit [Client Quit]
akem has quit [Quit: Forget progress by proxy. Land on your own moon.]
nyuszika7h has quit [Ping timeout: 264 seconds]
dcampano_ has joined #ruby
<pdtpatrick> blazes816: If i use xpath - it returns nothing. http://pastie.org/private/hyrax4qioj8xluuwm9aing
neersighte[d] is now known as neersighted
darthdeus has quit [Quit: Linkinus - http://linkinus.com]
dcampano has quit [Read error: Connection reset by peer]
axl_ has quit [Quit: axl_]
beneggett has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<ramblex> pdtpatrick: you don't take into account the namespaces on your elements
bubu\a has quit []
bubu\a has joined #ruby
axl_ has joined #ruby
bubu\a has quit [Client Quit]
<pdtpatrick> ramblex: so you're saying because the HSItemPrice has the same namespace throughout, it is just looking for one of it ?
beneggett has joined #ruby
blazes816 has quit [Quit: Leaving]
baphled has joined #ruby
<EstanislaoStan> Ok, I don't remember who helped me with this yesterday, but I still have a few questions concerning this pastie: http://pastie.org/4202128 I don't understand why, in the self.print_all_commands method command_list is not an object variable like it is in self.command_list. It works either way oddly enough. Also, why is command_list referenced through self.class.command_list? Why is the class
<EstanislaoStan> required? Is it because if @command was simply changed it would be chaning the array for that object but not for the entire class? Thanks everyone! ^-^.
ph^ has joined #ruby
blacktulip has joined #ruby
ph^_ has joined #ruby
jfoley has quit [Quit: jfoley]
akem has joined #ruby
akem has quit [Changing host]
akem has joined #ruby
Toumar has joined #ruby
<ramblex> pdtpatrick: doc.xpath("//ns:HSItemPrice", 'ns' => "http://example.org/HSItemPrice.xsd")
<pdtpatrick> I c - going to try that
<ramblex> or if you want to ignore the namespaces completely, use `doc.remove_namespaces!`
<Mon_Ouie> apeiros_: Hm, didn't think about the difference. The implementation in my mind would have been using the former, since iterating over a hash to see if it contains an element sounds like a waste of time.
<apeiros_> Mon_Ouie: but that would not be matching Enumerable#include? then either :)
<Mon_Ouie> Yeah
digitalcakestudi has quit [Ping timeout: 264 seconds]
wagle has quit [Read error: Operation timed out]
kaiwren has quit [Quit: kaiwren]
cdepue has joined #ruby
ph^ has quit [Ping timeout: 250 seconds]
Monofu has joined #ruby
Alien_Elite has quit []
Foxandxss has joined #ruby
<Toumar> For anyone familiar with the fog gem - is there a way to change the way Fog interacts with the known_hosts file? I created ~/.ssh/config but Fog doesn't seem to be respecting the settings in that file.
wagle has joined #ruby
bluenemo has joined #ruby
bluenemo has joined #ruby
jasond` has left #ruby ["Killed buffer"]
sonkei has quit [Quit: WeeChat 0.3.8]
baphled has quit [Quit: leaving]
baphled has joined #ruby
imami|afk is now known as banseljaj
sonkei has joined #ruby
ABK_ has joined #ruby
bluenemo has quit [Remote host closed the connection]
gmci has quit [Read error: No route to host]
ABK_ has quit [Read error: Connection reset by peer]
ABK_ has joined #ruby
khakimov has quit [Quit: Computer has gone to sleep.]
gmci has joined #ruby
ABK_ has quit [Read error: Connection reset by peer]
<shevy> dont think many know that gem Toumar
<Toumar> shevy: Seems that way.
stephenjudkins has joined #ruby
khakimov has joined #ruby
maletor has joined #ruby
maletor has quit [Client Quit]
Tricks has joined #ruby
kevinbond has quit [Quit: kevinbond]
btanaka has joined #ruby
cascalheira has quit [Quit: cascalheira]
ramblex_ has joined #ruby
ramblex_ has quit [Client Quit]
vitoravelino is now known as vitoravelino`afk
twinturbo has quit [Ping timeout: 244 seconds]
twinturbo has joined #ruby
Maniacal has joined #ruby
twinturbo has quit [Client Quit]
ramblex has quit [Ping timeout: 246 seconds]
dekronin1 has joined #ruby
adeponte has joined #ruby
jesly has joined #ruby
booginga has joined #ruby
dekroning has quit [Ping timeout: 248 seconds]
jeff_sebring has joined #ruby
mdszy has quit [Quit: bye for now]
qwerxy has quit [Ping timeout: 244 seconds]
ABK_ has joined #ruby
cdepue_ has joined #ruby
wobr has joined #ruby
stkowski_ has joined #ruby
ABK_ has quit [Read error: Connection reset by peer]
ABK_ has joined #ruby
rdg has joined #ruby
ABK_ has quit [Read error: Connection reset by peer]
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
and has joined #ruby
<and> hi
<and> i have a problem
ABK_ has joined #ruby
dekronin1 is now known as dekroning
wobr has quit [Client Quit]
cdepue has quit [Ping timeout: 264 seconds]
wobr has joined #ruby
<and> i try rake environment RAILS_ENV=production and than no such file to load -- /var/www/myapp/config/config/environment.rb
<and> why two config?
<and> config/config
ABK_ has quit [Read error: Connection reset by peer]
<and> anyone can help me to fix this
<apeiros_> and: I think this belongs to #rubyonrails
<and> oh okay
ABK_ has joined #ruby
adamkittelson has joined #ruby
mockra has joined #ruby
stkowski has quit [Ping timeout: 255 seconds]
stkowski_ is now known as stkowski
ABK_ has quit [Read error: Connection reset by peer]
and has left #ruby [#ruby]
ABK_ has joined #ruby
indian has quit [Ping timeout: 265 seconds]
<pdtpatrick> Question - how would i grab just the <HSItem> using Nokogiri. http://pastie.org/private/ck5ijxljvexz3368hpeg .. I've tried using .xpath(".//HSItem") and that returns blank. Here is the XML I'm using: http://pastie.org/private/gfogdbrojb80o3e6bynsw
bluenemo has quit [Remote host closed the connection]
<dekroning> anyone know if there is a channel on freenode, specifically for tdd/bdd ?
wobr has quit [Ping timeout: 245 seconds]
<Synthead> is there a way I can test if a hash contains an index and a value in one statement (rather than h.include?(:this) and h[:this] == "something")?
headius has joined #ruby
mucker has quit [Quit: leaving]
<pdtpatrick> dekroning: maybe #cucumber ?
<dekroning> pdtpatrick: ah great one indeed
mucker has joined #ruby
<dekroning> anyone that recommends a mocking lib ?
ABK_ has quit [Read error: Connection reset by peer]
fantazo has joined #ruby
lorandi has quit [Ping timeout: 248 seconds]
ABK_ has joined #ruby
altivec has joined #ruby
baphled has quit [Read error: Connection reset by peer]
ABK_ has quit [Read error: Connection reset by peer]
ABK_ has joined #ruby
rdg has quit [Quit: ttfn]
baphled has joined #ruby
Eldariof-ru has joined #ruby
bglusman has joined #ruby
Natch has quit [Ping timeout: 240 seconds]
zemanel has joined #ruby
ABK_ has quit [Read error: Connection reset by peer]
bglusman has quit [Read error: Connection reset by peer]
ABK_ has joined #ruby
manizzle has joined #ruby
bglusman has joined #ruby
blazes816 has joined #ruby
bglusman has quit [Read error: Connection reset by peer]
bglusman has joined #ruby
ABK_ has quit [Read error: Connection reset by peer]
ABK_ has joined #ruby
Toumar has left #ruby [#ruby]
ABK_ has quit [Read error: Connection reset by peer]
Dan has joined #ruby
ABK_ has joined #ruby
ABK_ has quit [Read error: Connection reset by peer]
ABK_ has joined #ruby
ABK_ has quit [Read error: Connection reset by peer]
Monofu has quit [Quit: quit]
alek_b_ has joined #ruby
dankest has quit [Ping timeout: 264 seconds]
ABK_ has joined #ruby
ciopte7 has joined #ruby
mockra has quit [Remote host closed the connection]
exchgr has quit [Quit: exchgr]
jimeh3 has joined #ruby
ABK_ has quit [Read error: Connection reset by peer]
ABK_ has joined #ruby
alek_b has quit [Ping timeout: 264 seconds]
anothervenue has joined #ruby
TomRone has joined #ruby
ABK_ has quit [Read error: Connection reset by peer]
ABK_ has joined #ruby
skryking has joined #ruby
Ontolog has joined #ruby
S1kx has joined #ruby
mxweas has quit [Read error: Operation timed out]
Axsuul has joined #ruby
sbanwart has joined #ruby
ABK_ has quit [Read error: Connection reset by peer]
chienpo has joined #ruby
ABK_ has joined #ruby
kenneth has joined #ruby
<kenneth> hey, if i'm using bundler, do i still have to require individual gems?
Natch has joined #ruby
mxweas has joined #ruby
<learc83> yes
<canton7> there is some magic you cna do with Bundler.setup iirc
<canton7> but I haven't found it particularly good
<apeiros_> kenneth: be aware that if you don't, you basically force the users of your project to use bundler.
<apeiros_> a coupling that isn't worth it IMO.
kstephens has quit [Ping timeout: 246 seconds]
Vendethiel has joined #ruby
ABK_ has quit [Read error: Connection reset by peer]
ABK_ has joined #ruby
jfoley has joined #ruby
<dekroning> lot's of documentation online, that uses mocha also uses mock() method, however when i'm trying to use that method, it's giving me 'undefined method'
ABK_ has quit [Read error: Connection reset by peer]
ABK_ has joined #ruby
kstephens has joined #ruby
xanaru has joined #ruby
anothervenue has quit [Quit: WeeChat 0.3.7]
ABK_ has quit [Read error: Connection reset by peer]
<kenneth> apeiros_: this is for internal things, bundlers is a requirement that i'm willing to make
<kenneth> if i do require 'bundler/setup', it'll take care of requiring all the gems in the gemfile?
nyuszika7h has joined #ruby
<apeiros_> easy to try :-p
itnomad has quit [Quit: Leaving]
avandenhoven has left #ruby [#ruby]
<apeiros_> make an empty directory, add a Gemfile, run bundle exec ruby -e 'p SomeGemsNamespace'
<apeiros_> or instead of bundle exec, add -rbundler/setup
lorandi has joined #ruby
<learc83> don't you still need to require the files in your individual scripts?
selvakumaran has joined #ruby
<apeiros_> I don't know. I require all the f'ing time anyway
Niamkik has quit [Quit: leaving]
<learc83> according to the site you still need to require
<learc83> *just checked
<kenneth> ok
xanaru has quit [Remote host closed the connection]
<shevy> ewwww bundler
Goles has joined #ruby
PaciFisT has joined #ruby
mockra has joined #ruby
PaciFisT has quit [Client Quit]
cdepue_ has quit [Ping timeout: 264 seconds]
c0rn_ has quit [Quit: Computer has gone to sleep.]
jxf has joined #ruby
hero_ has quit [Quit: leaving]
alta has quit [Ping timeout: 240 seconds]
<fowl> shevy, lets start calling it bungler, prob wont take long to catch on
<blazes816> what's the problem with bundler? is there a better way to manage dependencies?
mockra has quit [Remote host closed the connection]
alta has joined #ruby
indian has joined #ruby
tsou has joined #ruby
ciopte7 has quit [Quit: ciopte7]
kenichi has joined #ruby
pting has joined #ruby
<erikwb> blazes816: depends on what you're doing
luckman212 has joined #ruby
<erikwb> for a lot of cases it makes more sense to generate RPMs via fpm or w/e
<erikwb> and manage them using the system
Sweet-P has joined #ruby
<blazes816> that's true. that's what we do in python at my day job
jesly has quit [Ping timeout: 245 seconds]
stephenjudkins has quit [Quit: stephenjudkins]
<erikwb> it really really depends what you're doing
Sweet_P has quit [Ping timeout: 245 seconds]
echoes has joined #ruby
Gavilan has joined #ruby
<erikwb> choose which side of the app vs system divide it lives on
<erikwb> and do the right thing for whichever makes sense
echoes has left #ruby ["Leaving"]
tomzx has joined #ruby
axl__ has joined #ruby
<blazes816> definitely, it just seemed as if they disliked bundler in all cases
tomzx has left #ruby [#ruby]
ABK_ has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
bigfg has joined #ruby
niklasb_ is now known as niklasb
ABK_ has quit [Read error: Connection reset by peer]
schovi has quit [Remote host closed the connection]
ramblex has joined #ruby
ABK_ has joined #ruby
axl_ has quit [Ping timeout: 245 seconds]
axl__ is now known as axl_
bfgun has quit [Ping timeout: 264 seconds]
ABK_ has quit [Read error: Connection reset by peer]
ABK_ has joined #ruby
ABK_ has quit [Read error: Connection reset by peer]
<shevy> I do
ph^_ has quit [Ping timeout: 252 seconds]
etehtsea has joined #ruby
<shevy> it's slower than the slowest snail
<shevy> it is trying to do things noone told it to do - ask banister
<bricker88> I have an array and I am passing it to a method that takes a splat as its argument… should that work, or do I have to "explode" the array somehow?
digitalcakestudi has joined #ruby
<shevy> and what is most important, it does not seem to really be needed for anyone who knows how to do things. I mean, we have gems. and the use cases of bundler I have seen most often is to batch-install a bunch of different gems
<shevy> bricker88: def foo(*i) <--- i will be an array
heftig has quit [Ping timeout: 245 seconds]
<shevy> if you pass an array to it, it will probably become an array in an array
<shevy> in which case you can apply .flatten on i. i.flatten (or i.flatten!)
timonv has quit [Remote host closed the connection]
<shevy> def foo(*i); pp i; end; foo([1,2,3]) # => [[1, 2, 3]]
jxf has quit [Read error: Connection reset by peer]
Awsumlazer has quit [Quit: Colloquy for iPad - http://colloquy.mobi]
jxf has joined #ruby
atmosx has joined #ruby
<shevy> fowl: hey... perhaps I am going to file an issue to have bundler renamed to bungler
<shevy> or burglar
<fowl> buttbungler
<shevy> lol
fearoffish has quit [Ping timeout: 244 seconds]
`brendan has joined #ruby
<apeiros_> shevy: or he could just splat it on passing…
<apeiros_> more sane than applying flatten in the method
<atmosx> hello
azm has joined #ruby
azm has quit [Changing host]
azm has joined #ruby
<shevy> yeah
billiamii has quit [Read error: Connection reset by peer]
mucker has quit [Quit: leaving]
<shevy> atmosx!!!! how are your trees
wobr has joined #ruby
kirun has joined #ruby
Dan has quit [Quit: Linkinus - http://linkinus.com]
jarred has joined #ruby
dankest has joined #ruby
<shevy> I am using weechat as client right now and I don't like it :(
jesly has joined #ruby
ph^ has joined #ruby
stephenjudkins has joined #ruby
workmad3 has joined #ruby
khakimov has quit [Quit: Computer has gone to sleep.]
hadees has joined #ruby
tatsuya_o has joined #ruby
jxpx777 has joined #ruby
havenn has joined #ruby
Spooner has joined #ruby
ramblex has quit [Quit: ramblex]
heftig has joined #ruby
Eldariof-ru has quit []
ciopte7 has joined #ruby
cousine has joined #ruby
yannis has quit [Ping timeout: 250 seconds]
ac4s3 has quit [Quit: Leaving]
boobah is now known as Boohbah
Boohbah has quit [Changing host]
Boohbah has joined #ruby
cousine has quit [Remote host closed the connection]
mdszy has joined #ruby
cjlicata has joined #ruby
adeponte has quit [Remote host closed the connection]
selvakumaran has quit [Quit: Leaving]
workmad3 has quit [Ping timeout: 250 seconds]
ph^ has quit [Ping timeout: 246 seconds]
S1kx has quit [Quit: Leaving]
sam113101 has quit [Remote host closed the connection]
khakimov has joined #ruby
carlyle has quit [Ping timeout: 245 seconds]
ph^ has joined #ruby
dankest has quit [Quit: Leaving...]
cjlicata has quit [Remote host closed the connection]
carlyle has joined #ruby
snearch has quit [Quit: Verlassend]
sam113101 has joined #ruby
vitoravelino`afk is now known as vitoravelino
dkissell_ has joined #ruby
S1kx has joined #ruby
duality has joined #ruby
jgrevich has quit [Read error: Connection reset by peer]
dnyy has joined #ruby
jgrevich has joined #ruby
mohits has quit [Read error: Connection reset by peer]
lorandi has quit [Quit: Leaving]
dkissell has quit [Ping timeout: 250 seconds]
dkissell_ is now known as dkissell
windowsrefund has joined #ruby
schovi has joined #ruby
<windowsrefund> hello, I'm wondering if someone could help me understand why I can't get the seed_dump gem to work as documented
S2kx has joined #ruby
S2kx has quit [Remote host closed the connection]
Gadgetoid has quit [Remote host closed the connection]
chimkan_ has joined #ruby
S1kx has quit [Read error: Connection reset by peer]
duality has left #ruby ["Leaving"]
wobr has quit [Quit: Leaving.]
workmad3 has joined #ruby
Nisstyre has quit [Read error: Connection reset by peer]
<Tasser> no error logs?
tatsuya_o has quit [Remote host closed the connection]
c0rn_ has joined #ruby
S1kx has joined #ruby
S1kx has quit [Changing host]
S1kx has joined #ruby
Nisstyre has joined #ruby
alek_b has joined #ruby
arturas has joined #ruby
atmosx has quit [Ping timeout: 264 seconds]
alek_b_ has quit [Ping timeout: 248 seconds]
S1kx has quit [Quit: Leaving]
tvw has quit [Remote host closed the connection]
dross has joined #ruby
timonv has joined #ruby
mohits has joined #ruby
stkowski_ has joined #ruby
ph^ has quit [Remote host closed the connection]
TPFC-SYSTEM has left #ruby [#ruby]
<mdszy> j
<mdszy> whoops
atmosx has joined #ruby
dekroning has quit [Ping timeout: 246 seconds]
Jay_Levitt has joined #ruby
elhu has joined #ruby
khakimov has quit [Quit: Computer has gone to sleep.]
yannis has joined #ruby
stkowski has quit [Ping timeout: 248 seconds]
stkowski_ is now known as stkowski
timonv has quit [Ping timeout: 255 seconds]
davidw has joined #ruby
billiamii has joined #ruby
davidw is now known as Guest89338
elhu has quit [Client Quit]
mohits has quit [Read error: Connection reset by peer]
alek_b_ has joined #ruby
sailias has quit [Quit: Leaving.]
jesly has quit [Ping timeout: 250 seconds]
alek_b has quit [Read error: Operation timed out]
havenn has quit [Remote host closed the connection]
c0rn_ has quit [Quit: Computer has gone to sleep.]
digitalcakestudi has quit [Ping timeout: 244 seconds]
c0rn_ has joined #ruby
<EstanislaoStan> Ok, I don't remember who helped me with this yesterday, but I still have a few questions concerning this pastie: http://pastie.org/4202128 I don't understand why, in the self.print_all_commands method command_list is not an object variable like it is in self.command_list. It works either way oddly enough. Also, why is command_list referenced through self.class.command_list? Why is the class
<EstanislaoStan> required? Is it because if @command was simply changed it would be chaning the array for that object but not for the entire class? Thanks everyone! ^-^.
wobr has joined #ruby
kennyd_ has joined #ruby
kennyd_ has left #ruby [#ruby]
jxf has quit [Ping timeout: 264 seconds]
schovi has quit [Remote host closed the connection]
azm has quit [Ping timeout: 248 seconds]
cdepue has joined #ruby
<shevy> is it advisable to always use ENV['SOME_VALUE'].dup ?
sepp2k has quit [Ping timeout: 246 seconds]
<shevy> I seem to stumble into ... tainted input problems or whatever was the name, every time only with ENV stuff
EstanislaoStan has quit [Ping timeout: 244 seconds]
EstanislaoStan has joined #ruby
<sernin> Can anyone point me in the right direction as to why this code returns 'invalid next'? http://pastie.org/4206418
<mdszy> because you're not in a loop
<mdszy> if you want to get out of the method, you'd use `return`
<apeiros_> sernin: also notice that the 'seen' variable is initialized in a different scope
<apeiros_> seen in line 1 and seen in line 5 are two totally different variables
<apeiros_> (that's why they're called *local* variables - because they are local to their lexical scope)
SQLStud has joined #ruby
<mdszy> sernin: here's a better version, also added a bang to the method name beacuse it modifies something passed to it
havenn has joined #ruby
<canton7> mdszy, that's not the logic behind a bang method
<mdszy> changed it, then, sorry
<mdszy> just now tested, realized I was wrong
<mdszy> canton7: ! methods just change things that call it?
nanderoo has quit [Quit: Leaving.]
<sernin> mdszy, apeiros_: thank you both. And canton7, I understood that bang methods modify things in-place rather than returning a copy as well
<canton7> mdszy, bang methods are almost exclusively one of a pair of methods, which do very similar things. the bang one is understood to be the more dangerous, or unexpected
<canton7> we had this discussion earlier today :P
<any-key> !!!!!
Guest89338 has quit [Read error: Operation timed out]
<any-key> as in, DANGER!!!
<mdszy> canton7: Ah, I get it. But with me? I never had that discussion.
<mdszy> I don't recall it.
<canton7> mdszy, nah, was with some other guys
<mdszy> ah
Progster has joined #ruby
mohits has joined #ruby
S1kx has joined #ruby
schaerli has quit [Remote host closed the connection]
dankest has joined #ruby
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
jxpx777 is now known as jxpx777|afk
<canton7> someone did a search of the stdlib, and found that, I think, there are no instances of bang methods without matching bang methods
kevinbond has joined #ruby
mrsolo has joined #ruby
dnyy has quit [Remote host closed the connection]
jxpx777|afk is now known as jxpx777
tsou has left #ruby [#ruby]
fbernier has quit [Ping timeout: 264 seconds]
workmad3 has quit [Ping timeout: 250 seconds]
sepp2k has joined #ruby
mnaser has joined #ruby
<apeiros_> canton7: that someone being me
<canton7> ah yes, of course
<apeiros_> I have written some bang-only methods, though.
cjlicata has joined #ruby
cjlicata has quit [Remote host closed the connection]
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
x0F_ is now known as x0F
cjlicata has joined #ruby
carlyle has quit [Read error: Connection reset by peer]
tatsuya_o has joined #ruby
mnaser has quit [Ping timeout: 246 seconds]
Kesavoka has joined #ruby
yxhuvud has quit [Ping timeout: 255 seconds]
headius_ has joined #ruby
headius has quit [Disconnected by services]
headius_ is now known as headius
chico_chicote has quit [Quit: Page closed]
Kesava has quit [Ping timeout: 246 seconds]
wallerdev has quit [Quit: wallerdev]
Aaton_off is now known as Aaton
joch_n has quit [Quit: Linkinus - http://linkinus.com]
mdszy has quit [Quit: bye for now]
bluenemo has quit [Read error: Connection reset by peer]
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
olrrai has joined #ruby
Sweet_P has joined #ruby
bashdy has joined #ruby
Sweet-P has quit [Ping timeout: 246 seconds]
ridingwithrails has joined #ruby
geekbri has quit [Remote host closed the connection]
dnyy has joined #ruby
jxpx777 is now known as jxpx777|afk
wobr has quit [Quit: Leaving.]
uris has quit [Read error: Connection reset by peer]
bashdy has quit [Quit: bashdy]
ksergio has quit [Ping timeout: 246 seconds]
ridingwithrails has left #ruby [#ruby]
notjohn has quit [Quit: notjohn]
ridingwithrails has joined #ruby
AlbireoX has quit [Read error: Connection reset by peer]
olrrai has quit [Quit: Saliendo]
enroxorz has quit [Quit: Leaving]
cdepue has quit [Remote host closed the connection]
maletor has joined #ruby
robbyoconnor has quit [Max SendQ exceeded]
robbyoconnor has joined #ruby
cdepue has joined #ruby
jxf has joined #ruby
cead22 has joined #ruby
youdonotexist has joined #ruby
Guedes has joined #ruby
Guedes has quit [Changing host]
Guedes has joined #ruby
atmosx has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
greasegum_ has joined #ruby
robbyoconnor has quit [Remote host closed the connection]
robbyoconnor has joined #ruby
mdszy has joined #ruby
ryanf has joined #ruby
`brendan has quit [Quit: - nbs-irc 2.39 - www.nbs-irc.net -]
booginga has left #ruby ["Leaving"]
Cache_Money has quit [Ping timeout: 255 seconds]
<shevy> def shoot!
sam113101 has quit [Remote host closed the connection]
AlbireoX has joined #ruby
<apeiros_> shevy.shoot!
mattrae has joined #ruby
<any-key> foot.shoot!
<apeiros_> !> NoTargetError
wvms has joined #ruby
tatsuya__ has joined #ruby
<apeiros_> shevy.foot!(foot) # => #<Shevy:0x00000001 state=lots of pain>
<apeiros_> shoot! :(
<apeiros_> shevy.shoot!(foot) # => #<Shevy:0x00000001 state=lots of pain>
kevinbond has quit [Quit: kevinbond]
andrewhl has quit [Remote host closed the connection]
sam113101 has joined #ruby
jblack has joined #ruby
Mon_Ouie has quit [Ping timeout: 264 seconds]
<jblack> Is anyone familiar with a good location to get assistance on mechanize?
<any-key> the author is either in here or #ruby-lang
<any-key> shit, who was it?
<any-key> I forget
Gadgetoid has joined #ruby
greasegum_ is now known as greasegum
<jblack> tenderlove?
<shevy> oh man I am being mutilated here
<jblack> Aaron Patterson
<any-key> yeah, that guy!
<any-key> his nick is tenderlove in #ruby-lang
<any-key> go find 'em!
<any-key> looks like he left, actually
headius has quit [Quit: headius]
tatsuya_o has quit [Ping timeout: 265 seconds]
mockra has joined #ruby
billiamii has quit [Read error: Connection reset by peer]
<jblack> hell of a mullet on his gravatar.
<jblack> :)
mdszy has quit [Quit: bye for now]
cead22 has left #ruby [#ruby]
robbyoconnor has quit [Remote host closed the connection]
robbyoconnor has joined #ruby
<greasegum> jblack I have been tinkering with mechanize over the past couple weeks. there are some good resources out there but it depends on what you are trying to accomplish.
mvangala has quit [Remote host closed the connection]
<jblack> greasegum: Well, it's been working great for me for a while, but on one particular form, when I'm trying to set values for fields, it's making new fields.
nemesit has quit [Quit: Leaving...]
robbyoconnor has quit [Max SendQ exceeded]
robbyoconnor has joined #ruby
<jblack> I'm poking around on http://ucc.state.ri.us/CorpSearch/CorpSearchInput.asp, and I'm doing a corpform=form.first(), and I can see the forms when I pp the form, but when attempt to set fields via corpform[key]=value, it makes a new field of type "field", rather than fixing existing fields of type input
jfoley has quit [Quit: jfoley]
zeromodulus has joined #ruby
<jblack> Such as instead of updating: [text:0x..fdb6cdaf8 type: text name: EntityName value: ] , it's creating [field:0x..fdb6b3d1a type: name: EntityName value: cake]
<greasegum> huh, can you pastebin your code?
tommyvyo_ has quit [Quit: Computer has gone to sleep.]
<EstanislaoStan> Ok, I don't remember who helped me with this yesterday, but I still have a few questions concerning this pastie: http://pastie.org/4202128 I don't understand why, in the self.print_all_commands method command_list is not an object variable like it is in self.command_list. It works either way oddly enough. Also, why is command_list referenced through self.class.command_list? Why is the class
<EstanislaoStan> required? Is it because if @command was simply changed it would be chaning the array for that object but not for the entire class? Thanks everyone! ^-^. (Sorry if someone answered this, my computer went to sleep for a few seconds I think, so I might have missed it.)
<jblack> gresegum: http://pastebin.com/tCi7cQGE
c0rn_ has quit [Quit: Computer has gone to sleep.]
khakimov has joined #ruby
pureluck has quit [Read error: Operation timed out]
dnyy has quit [Remote host closed the connection]
bowlowni has joined #ruby
silentpost has quit [Ping timeout: 265 seconds]
bbttxu has quit [Quit: bbttxu]
crankycoder has quit [Remote host closed the connection]
<jblack> greasegum: I've been looking at it for a couple hours and I can't figure it out
pureluck has joined #ruby
bigoldrock has quit [Ping timeout: 248 seconds]
stephenjudkins has quit [Quit: stephenjudkins]
bigoldrock has joined #ruby
otters has quit [Ping timeout: 255 seconds]
chson has quit [Remote host closed the connection]
Vendethiel has quit [Ping timeout: 244 seconds]
tatsuya_o has joined #ruby
chimkan_ has quit [Ping timeout: 245 seconds]
jfoley has joined #ruby
<greasegum> I've had similar problems as well, getting forms to fill properly. Might not be able to help. This is probably beyond my expertise at this time.
tatsuya_o has quit [Remote host closed the connection]
<greasegum> Sorry, man. :(
Goles has quit [Quit: Computer has gone to sleep.]
<greasegum> however I have gotten some good help on different packages in #ruby-pro
cjlicata has quit [Ping timeout: 245 seconds]
g0bl1n has quit [Ping timeout: 240 seconds]
<greasegum> *libraries not packages
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
<jblack> I can try it.
<jblack> I'm sure it's something stupid, and I'd be thrilled to dump a 50 in someones paypal for it.
ridingwithrails has quit [Quit: Leaving.]
tatsuya__ has quit [Ping timeout: 246 seconds]
dcampano_ has quit [Quit: dcampano_]
kevinbond has joined #ruby
<shevy> the way to enlightenment comes from greater understanding of things
<jblack> shevy: True, but us mere mortals were given buddha for hints. =)
<shevy> and from finding useful patterns
jsime has quit [Quit: Leaving]
nemesit has joined #ruby
blacktulip has quit [Remote host closed the connection]
<jblack> will someone in #ruby-pro tell the channel that their instruction site is down?
maletor has quit [Quit: Computer has gone to sleep.]
elvis4526 has joined #ruby
<elvis4526> Hi, after that you call the method argument (inside the "()"), what "do" mean and what the "|" mean
<elvis4526> Thanks
wallerdev has joined #ruby
hydrozen has quit [Quit: Computer has gone to sleep.]
apeiros_ has quit [Remote host closed the connection]
<jblack> if a method returns an array, you can iterate through them with a temp variable.
<elvis4526> What is an array
<elvis4526> Sorry if it is an obvious question, im pretty dumb.
itnomad has joined #ruby
<jblack> Let's find you a good ruby tutorial to get started, yes?
<elvis4526> I read already the 20 minutes introduction
<elvis4526> And like 2 or 3 others
kenperkins has quit [Quit: Computer has gone to sleep.]
jarred has quit [Quit: jarred]
Horofox has joined #ruby
<jblack> Let's get you another one, that explains that part of the code for you
<elvis4526> Do you know one?
<Horofox> how do I get the list of classes inside a module?
alanp_ has joined #ruby
balki_ has joined #ruby
<jblack> http://troubleshooters.com/codecorn/ruby/basictutorial.htm here, and the array part will be of particular use for you
balki has quit [Ping timeout: 244 seconds]
alanp has quit [Ping timeout: 244 seconds]
sobol has joined #ruby
<elvis4526> thanks ill look at this
saschagehlich has quit [Ping timeout: 264 seconds]
<tds> Horofox: you get get constants with mod.constants
internet_user has quit [Remote host closed the connection]
<tds> then just filter out the ones that aren't classes
zeromodulus has quit [Remote host closed the connection]
stkowski has quit [Quit: stkowski]
<tds> Horofox: mod.consants.select { |c| c.is_a? Class }
<Horofox> I'm building a UrlBuilder module with a bunch of classes and I use method_missing on another class to delegate the method call to a class that can respond to this call
<Horofox> is it wrong?
<Horofox> I want to chain shit :(
jxpx777|afk has quit [Quit: Mac is sleeping…]
bigkevmcd has quit [Quit: outta here]
<tds> i can't say if that's wrong or not without really seeing the code
<elvis4526> It doesn't explain what is an array. :S
<tds> elvis4526: an array is an ordered list of objects
<tds> basically speaking
<elvis4526> Okay
jrajav has joined #ruby
<elvis4526> But what is the point with the array and the "|"
<tds> what do you mean?
<elvis4526> I was looking to download a file directly from a ruby script
<Horofox> tds: I want to do a chain like I.love.you and only execute what I want in the you.
<Horofox> tds: method_missing is the way, right?
<elvis4526> And at some point in the coad, you can see "do" and some words inside "|word|" like this.
carloslopes has quit [Quit: Leaving.]
<tds> Horofox: somewhat
<elvis4526> I don't understand what is it.
<blazes816> elvis4526: do/end denotes a block of code
<blazes816> and the stuff in the || are the variables that get passed to that block
<tds> Horofox: it might be harder to do a chain like that though
sbanwart has quit [Ping timeout: 265 seconds]
andrewhl has joined #ruby
arturas has quit [Remote host closed the connection]
<elvis4526> A block is a bunch of methods right?
<blazes816> elvis4526: check out the section titled "Iterators and Blocks" in that tutorial you were linked to earlier
<blazes816> evis4526, no a block is a chunk of code.
<elvis4526> omg
<tds> Horofox: as a wise person said to me just yesterday, simplicity is a virtue ;)
<elvis4526> The tutorial does not explain anything, it is just a bunch of example.
<tds> Horofox: you can probably get the chaining you desire, but in order to remember the previous calls, it's going to be a bit harder to accomplish that
baroquebobcat has quit [Quit: baroquebobcat]
<Horofox> tds: I know… but I want to develop a cool wrapper to some random api in order to learn chaining
<tds> yeah
<tds> well
<elvis4526> blazes816: Thanks I'll look into it
etehtsea has quit []
<tds> chaining can be done in many ways
the_jeebster has joined #ruby
<tds> it depends on what you need the chaining to do
<the_jeebster> is it possible to have an object be a hash key in ruby?
<tds> the_jeebster: yes
<blazes816> the_jeebster, yes
baroquebobcat has joined #ruby
<the_jeebster> fucking a, awesome
<the_jeebster> thanks
<tds> be careful with it though
Kesavoka has quit [Read error: Connection reset by peer]
<jblack> I don't suppose there's someone here that wouldn't mind making a few dollars helping me debug this particular problem with mechanize?
dv310p3r has quit [Ping timeout: 264 seconds]
<the_jeebster> tds: how so?
Kesavoka has joined #ruby
bfgun has joined #ruby
<the_jeebster> is it generally a bad idea to not use primitives as keys?
<tds> it's ok to use objects, just don't use mutable objects
<elvis4526> what exactly does collect!
<the_jeebster> tds: right, that makes sense
havenn has quit [Remote host closed the connection]
<blazes816> elvis4526, you pass it a block. for every element in the array or hash, or whatever, it passes it to the block. Then, the result of the block is saved as its new value.
cakehero has quit [Quit: Computer has gone to sleep.]
<tds> elvis4526: if you want a more technical explanation of concepts, then i would recommend getting a book
<jblack> what happens when you use a mutable object?
stephenjudkins has joined #ruby
<tds> jblack: if you change the object, typically its hash code will change
<elvis4526> No it's ok, if even with the noobie explanation I don't understand a shit, I can't imagine with a professional book
<tds> jblack: which means your hash table is corrupt
<jblack> so non-referenceable entries in the hash?
<the_jeebster> any sort of mutation in a hash is deadly :)
<tds> right
Sheehan has joined #ruby
<Tasser> ... great. nokogiri segfaults :-/
<blazes816> elvis4526, then you got to take it slower. they make books for people of every level
bigfg has quit [Ping timeout: 264 seconds]
<jblack> mmmm, I'll remember that if I ever come across a problem with memory leaking
<the_jeebster> elvis4526: it took me a while to understand some of the enumerable methods. I think the docs are extremely specific in language and they can seem a bit confusing until you're quite comfortable programming with ruby
baroquebobcat has quit [Quit: baroquebobcat]
<elvis4526> Yeah, this is true.
<the_jeebster> and I come from no CS background
<the_jeebster> in all honesty, the best way to see how they work is to mess around in irb
<the_jeebster> play in the sand
axl_ has quit [Quit: axl_]
<shevy> hehe
<elvis4526> But anyway, I think that I learn better when I try to do something that is concrete. Not just playing with number for fun. I have a little idea of a script that could help me for doing some stuff that I need to do. I would like to know how to download a file with ruby.
<blazes816> elvis4526, did that code from that stack overflow question not work?
saschagehlich has joined #ruby
<elvis4526> I don't know, but I don't understand it.
Cache_Money has joined #ruby
<elvis4526> Why there is not a function that do http.savefile("http://google.com/index.html", "/path/to/destination")
<elvis4526> And it would save the index.html file
<tds> what are you trying to accomplish?
<elvis4526> Download a file from a website
<benson> elvis4526: why are you trying to do this with ruby?
* elvis4526 is trying to download a file
<EstanislaoStan> Ok, I don't remember who helped me with this yesterday, but I still have a few questions concerning this pastie: http://pastie.org/4202128 I don't understand why, in the self.print_all_commands method command_list is not an object variable like it is in self.command_list. It works either way oddly enough. Also, why is command_list referenced through self.class.command_list? Why is the class
<EstanislaoStan> required? Is it because if @command was simply changed it would be chaning the array for that object but not for the entire class? Thanks everyone! ^-^. (Sorry if someone answered this, my computer went to sleep for a few seconds I think, so I might have missed it.)
<blazes816> elvis4526, wget http://google.com/index.html
<blazes816> if you type that in the terminal it will download that file
<elvis4526> I knew it. But isn't better to do it with native ruby?
<elvis4526> I want to do it inside my ruby program
olrrai has joined #ruby
<Ontolog> I want to do something like array.select { |elem| ... } but stop after n number of elements have been selected. Any clever way to do this concisely?
<elvis4526> Oh you, don't begin to talk to me about array
<elvis4526> lol
<Ontolog> ?
<blazes816> Ontolog: array[,n].select?
bowlowni has quit [Remote host closed the connection]
<Ontolog> blazes816: if im not mistaken that will only run the select on a portion of the array
<Ontolog> not what i want
<blazes816> oh, gotcha. sorry. misread
bowlowni has joined #ruby
<Ontolog> i guess i can put a break in the select?
bowlowni has quit [Remote host closed the connection]
<Ontolog> hmm that's not going to work though since my condition is checking the size of the array being generated
<Ontolog> damnit...
<blazes816> can you pastie what you have?
jgarvey has quit [Quit: Leaving]
cdepue has quit [Remote host closed the connection]
hugoxrosa has joined #ruby
Criztian has joined #ruby
nemesit has quit [Quit: Leaving...]
k_89 has joined #ruby
<elvis4526> Honestly I do not find ruby less complicated then other language. :|
<k_89> is there a console.log of thing in ruby ??
<k_89> i am trying to pick it up .. its not :P
<k_89> it has more concepts than say, js
<tds> lol
<k_89> or, well, php
Progster has quit [Ping timeout: 260 seconds]
<tds> you can print text using 'puts'
<k_89> please do not bash php .. php 5.4 is pretty decent .. on the other hand, can someone point me to a console.log or var_dump equivalent in ruby
EstanislaoStan has quit []
<tds> k_89: 'p' would be the closest thing to var_dump
<k_89> k, thanks
timonv has joined #ruby
headius has joined #ruby
<blazes816> Ontolog, I can't come up with anything super pretty
seanstickle has joined #ruby
<tds> k_89: i won't bash php too much, but i think there are somethings that irreparably wrong with that language ;)
<k_89> tds, oh no .... thats not what i am looking for
<tds> some things*
<tds> k_89: what are you looking for?
Natch has quit [Remote host closed the connection]
Goles has joined #ruby
Goles has quit [Client Quit]
<k_89> tds if you write js, then the functionality which console.log provides
<tds> i do write js
Goles has joined #ruby
Goles has quit [Client Quit]
<tds> but im still a bit confused =/
<tds> you cited var_dump
Sheehan has quit [Quit: Sheehan]
havenn has joined #ruby
<k_89> var_dump is php's console.log
<k_89> a sec
kpshek has quit []
<tds> well you can't just var_dump("hello world")
<tds> but
<k_89> i'll paste and example
<tds> k
jarred has joined #ruby
timonv has quit [Ping timeout: 244 seconds]
baphled has quit [Quit: leaving]
<elvis4526> I think you need to be god to understand programming languages.
jxf has quit [Ping timeout: 264 seconds]
<elvis4526> How can this way of thinking become natural?
baphled has joined #ruby
<seanstickle> elvis4526: it's just a bit of applied logic
Kesavoka has quit [Quit: Leaving]
<blazes816> elvis4526 years of practice
<elvis4526> In my opinion, it's not logic, it's just total non-sense
<blazes816> you'll soon find that everything else is total non-sense
<seanstickle> elvis4526: well, your opinion doesn't count for much if you can't even understand it.
kvirani has quit [Remote host closed the connection]
<tds> k_89: don't think ruby provides something like that, but I could be wrong
<blazes816> k_89, try puts "my_var.inspect"
<k_89> k
<blazes816> "puts my_var.inspect"
sebastorama has joined #ruby
<blazes816> without quotes
<tds> no
<tds> that's just what
tatsuya_o has joined #ruby
<k_89> obv
<elvis4526> Yes, and? I can't say that I don't find programming language unlogical because my opinion doesn't count?
<tds> 'p my_var' would do
<k_89> tds, no
<tds> really?
<tds> alright
<seanstickle> elvis4526: well, that and your terrible grammar
<elvis4526> I'm french canadian, sorry.
<elvis4526> But I'm sure you all understand what I'm trying to say.
tewecske has quit [Quit: Leaving.]
<blazes816> grammar isn't an indication of intelligence
<tds> k_89: yeah, I was saying that 'p x' is just shorthand for 'puts x.inspect'
<seanstickle> Neither is baldness
<k_89> blazes816, tds yeah .. eventhe inspect thing displays the objects memory location
<tds> k_89: i'm not sure if there is a straightforward way of doing that
<seanstickle> But quadruple negatives in a sentence is bad form
<k_89> k
<blazes816> hence I don't judge people's opinion's validity based on hair content
baphled has quit [Client Quit]
<k_89> guess will need to look up the reflection stuff
<seanstickle> blazes816: and that is why cats and dogs will always triumph over you
kpshek has joined #ruby
<k_89> will probably do that later .. js's console.log beats php's var_dump hands down though .. almost the whole object is there for you to read through
moshee has quit [Ping timeout: 246 seconds]
<k_89> === less referencing of docs
Kabaka has joined #ruby
<elvis4526> i've tried for years to understand different programming language, and I always failed. It is just disgusting when you have the feeling to read something that is more complicated then chinese. Actually, chinese is simpler, you just have to learn what the symbols mean.
<tds> yeah, console.log is fairly useful
moshee has joined #ruby
emmanuelux has joined #ruby
<seanstickle> elvis4526: are you any good at math?
baphled has joined #ruby
<seanstickle> elvis4526: geometry perhaps?
berserkr has quit [Quit: Leaving.]
<elvis4526> In high school, yeah.
EstanislaoStan has joined #ruby
<seanstickle> elvis4526: well, that's good
<elvis4526> But I don't see anything that I learnt at school in programming language
<theRoUS> rdoc question: how can i add documentation for a method that's created with 'define_method' rather than 'def' ?
<seanstickle> elvis4526: no, but at least you can calculate a tip for restaurants
<elvis4526> shut up
R_Macy has joined #ruby
<R_Macy> Anyone here with experience using ffi?
<Boohbah> elvis4526: you aren't going to do any learning with that attitude
<elvis4526> He is insulting me.
kevinbond has quit [Quit: kevinbond]
<EstanislaoStan> Does anyone know a really good ruby-centric script editor? I've been using FreeRIDE but I'm sick of it screwing up and not opening until I figure out how to clear it's cache in AppData or whatever. Thanks ^-^.
hadees has quit [Quit: hadees]
<seanstickle> EstanislaoStan: Vim has a very nice Ruby mode
silentpost has joined #ruby
<theRoUS> elvis4526: well, you're kinda dissing the reason a lot of people are in this channel.. :-/
hugoxrosa has quit [Remote host closed the connection]
<k_89> elvis4526, try php .. :P
Synthead has quit [Quit: p33 ba115]
qo has quit [Ping timeout: 244 seconds]
<the_jeebster> what's the proper method of defining a hash's keys and values after defining an empty hash?
sebastor_ has joined #ruby
hugoxrosa has joined #ruby
<k_89> elvis4526, really after learning html+css, learning curve to making a basic app in php is very small
Criztian has quit [Remote host closed the connection]
<tds> :/
sebastorama has quit [Disconnected by services]
<tds> yeah
<tds> i guess that's true
sebastor_ is now known as sebastorama
<the_jeebster> html/css to php
<the_jeebster> are you high?
<k_89> nope :P
<tds> a basic app is pretty simple
<elvis4526> k_89: Yeah, maybe i'll check it if i'm not too mad.
<seanstickle> Clearly the path to wisdom is to adopt ColdFusion
<tds> so many magic variables
<the_jeebster> you've gotta have some OOP basics before moving there. I'd argue javascript to php
<the_jeebster> html/css -> js -> php
<k_89> yeah
<tds> js is not the place to learn about OOP
saschagehlich has quit [Ping timeout: 240 seconds]
<tds> nor is PHP for that matter
<the_jeebster> of course it's not
<havenn> the_jeebster: hash = {}; hash[:key] = 'value'
<k_89> oh yeah
<the_jeebster> but basic elements: conditionals, recursion, etc.
<k_89> js's oop is 'unconventional' to say the least
tatsuya_o has quit [Remote host closed the connection]
<havenn> the_jeebster: == { :key => 'value' }
<k_89> and php is ok for learning oop
hunglin has quit [Ping timeout: 244 seconds]
yoklov has joined #ruby
<R_Macy> anyone experience issues trying to import a file on a ebs volume?
<R_Macy> via ffi?
elvis4526 has left #ruby ["ERC Version 5.3 (IRC client for Emacs)"]
<k_89> you can have a decent oop design in php
ePirat has quit [Quit: Ciao]
robotmay has joined #ruby
Goles has joined #ruby
silentpost has quit [Ping timeout: 265 seconds]
<k_89> it'd be best though if you stick with php5.4 (or if you cant stick with 5.4, dont go below 5.3)
qo has joined #ruby
kirun has quit [Quit: Client exiting]
<EstanislaoStan> Thanks seanstickle.
<seanstickle> EstanislaoStan: sure thing
vladiim has joined #ruby
<seanstickle> k_89: php5.4 is actually pretty nice
<seanstickle> k_89: array literals, built in web server, etc.
<k_89> traits
<k_89> closures inside classes reference $this properly
<seanstickle> True
<seanstickle> It works well for me in the nonprofit world.
emmanuelux has quit [Quit: @+]
ping-pong has quit [Ping timeout: 252 seconds]
<shevy> what can you do with traits what you cant do in ruby
<k_89> nothing
<seanstickle> Nothing
<k_89> ruby's require/include stuff is way more better
<seanstickle> But you can do something very useful with PHP that is harder to do with Ruby.
<k_89> ?
<havenn> seanstickle: like what?
<seanstickle> Hire people at reasonable rates.
<k_89> haha
<shevy> lol
<seanstickle> Which is handy in the nonprofit sector where I work.
hugoxrosa has quit [Remote host closed the connection]
<shevy> people often hire for "ruby on rails"
<shevy> and noone for ruby :(
<k_89> i find rails bloat
<k_89> after working with several modern php frameworks
<tds> yeah
<havenn> is getting a Symphony 2 or CakePHP dev really that much cheaper?
hugoxrosa has joined #ruby
<tds> at my old job, I worked with kohana
<seanstickle> havenn: yes
<tds> much simpler framework
<tds> rails is huge
<k_89> i've been using laravel for past 4-5 months ... loving it
c0rn_ has joined #ruby
<seanstickle> havenn: also, between Drupal, WordPress, and SugarCRM, there are a lot of standalone things written in PHP that it's useful to hire people to customize.
<tds> k_89: php's oop implementation is weird. they copied java/c++ for some reason
<tds> t
sam113101 has quit [Remote host closed the connection]
<k_89> i guess for familiarity
<tds> yeah, but then you get things like interfaces
<tds> duck typing is one of the most useful parts of a dynamic language
<tds> not to say you can't duck type with php
<tds> but i just dont know why they have interfaces
<zaargy> anyone have config to automatically do bundler exec if i am in a dir with a Gemfile?
<TomRone> tds: to make it easier to implement GoF patterns
<TomRone> perhaps
<tds> gof patterns are less useful in dynamic langs, imo
robotmay has quit [Remote host closed the connection]
<tds> at least as they are classically structured
<TomRone> tds: when i use php i have the impulse to declae type lol
nari has joined #ruby
baphled has quit [Quit: leaving]
<tds> i think they actually have optional type annotations now
<TomRone> yeah thats what I hear
baphled has joined #ruby
mrsolo has left #ruby ["Leaving"]
<havenn> k_89: What do you think of Sinatra compared to Laravel?
<k_89> havenn, i don't have too much experience with sinatra to answer that properly
<k_89> i'm too familiar with php's autoloaders i guess
<TomRone> just want to say I am a big fan of fuelphp
thecreators has quit [Quit: thecreators]
the_jeebster has quit [Quit: Leaving.]
<k_89> i'm tying to keep myself from making a php style autoloader for ruby
<k_89> cos from what i've read, thats not how you do things in ruby
Sweet-P has joined #ruby
<tds> rails has an autoloader
<havenn> gah, leave the dark side... making my eyes bleed: function __autoload($name) {
<k_89> havenn, they have built cleaner solutions around that
<k_89> they == php folks
jxf has joined #ruby
Sweet_P has quit [Ping timeout: 246 seconds]
g_rotbart has joined #ruby
<havenn> k_89: Ruby: autoload :MyStuff
youdonotexist has quit [Quit: youdonotexist]
chson has joined #ruby
<k_89> havenn, afaik, thats not considered a best practice, is deprecated i guess
<k_89> also it doesn't handle loading from sub-dirs
<k_89> also, i think silex micro-framework is nearer to sinatra in terms of what it offers
<k_89> laravel is pretty full stack and easily extendable
banisterfiend has quit [Remote host closed the connection]
banseljaj is now known as imami|afk
banisterfiend has joined #ruby
<tds> it's not a best practice because it's not thread-safe
<havenn> k_89: autoload is in the current Ruby (1.9.3) and will be in 2.0 as well. Being dropped for 3.0 because: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/41149
<TomRone> I use ruby mostly for shell script stuff. If I wanted to do web dev stuff in ruby id use sinatra prolly. Not a fan of rails exactly.
cantonic has joined #ruby
<keyvan> hey guys. I have a module called CanMethods which has 4 methods in it (can!, cannot!, can?, cannot?), and before the meat of each of these methods, i call a method called "reload". i was just wondering if there's a way to have my module run some method x (in this case reload) before any of its methods
<keyvan> thanks in advance
freeayu has joined #ruby
cousine has joined #ruby
<gogiel> keyvan: what do you mean before
ciopte7 has quit [Quit: ciopte7]
<heftig> keyvan: IIRC there are not decorators in the standard library
ping-pong has joined #ruby
<gogiel> keyvan: you mean something like before callback?
<k_89> keyvan, put an underscore before all those methods and leverage method_missing
<heftig> gogiel: no, like rails' before-filters
<keyvan> gogiel: like say you have a method foo that calls puts "my name is steve". i want to say, hey module, before that method foo, run puts "hi there"
<havenn> keyvan: Can you post a gist of the code? You could switch it from a Module to a Class and put #reload in the #instantiate.
<keyvan> yea heftig, gogiel what heftig said
<havenn> **initialize
<keyvan> ah that is smart havenn
<keyvan> k_89: i dont know that solution. ? underscore? sounds strange
<k_89> keyvan, a min
kjellski_ has quit [Quit: Leaving]
<gogiel> keyvan: aliast method chain
digitalcakestudi has joined #ruby
neku|away is now known as neku
banisterfiend has quit [Ping timeout: 248 seconds]
<keyvan> havenn: your solution sounds the best/dryest
<keyvan> i will create a gist of the problem for u guys
sam113101 has joined #ruby
<heftig> methods(false).each { |sym| next if sym == :reload; meth = method(sym); define_method(sym) { |*args, &blk| reload; meth.call(*args, &blk) } }
<k_89> sorry for my lack of ruby knowledge :P
<k_89> but thats how i'd do that
Vert has joined #ruby
<k_89> last 'that' === what you want to do
<keyvan> k_89: i appreciate the help but that grosses me out
<keyvan> not very ruby-like
<keyvan> thanks for your effort though
<k_89> ??
<k_89> why
<k_89> ?
<k_89> iirc, you cant include a Class, can you ?
<keyvan> k_89: a bunch of reasons, like the underscore and method missing, thre must be a better way.
<keyvan> k_89: and i dont believe you can, no, trying to find the best approach
<keyvan> prepping the gist here in a second hang on
yannis has quit [Quit: yannis]
<EstanislaoStan> Is the method self.print_all_commands getting the return value of the self.command_list method, the variable @command_list, and then running the each method on it? http://pastie.org/4207193
<keyvan> wait i just realized something... my can methods are calling Ability.new() anyway, so i can have the Ability initializer call reload on the user
<keyvan> heftig: i am putting that into clean syntax so i can understand it. thanks for your help
andoriyu has joined #ruby
<keyvan> heftig: haha that's clever and neat
<keyvan> still kinda nasty like k_89's solution but very cool nonetheless
<keyvan> (and sorry to use words like gross and nasty to describe it)
<tds> i think the cleanest solution is to just put reload in your method definition
<heftig> the pasted version uses instance_methods
<keyvan> tds: yeah pretty much, it's 4 lines of code (4 methods) whereas all these hax are way longer
<k_89> haha .. np .. i use php and like it, i'm used to gross and nasty
<k_89> :P
<keyvan> and don't immediately show the user what the hell is happening
<keyvan> user == developer i mean
<heftig> if your methods are declared singleton (or as module_methods) you can use the version i posted here, which i tested with Kernel
<gogiel> keyvan: alias your method
greasegum has quit [Quit: Leaving]
<gogiel> keyvan: http://pastie.org/4207211
jfoley has quit [Quit: jfoley]
<gogiel> keyvan: not sure it's what you meant
rasbonics has quit [Quit: rasbonics]
baphled has quit [Ping timeout: 265 seconds]
jarred_ has joined #ruby
jarred has quit [Ping timeout: 264 seconds]
jarred_ is now known as jarred
sepp2k has quit [Remote host closed the connection]
neku has quit [Quit: Linkinus - http://linkinus.com]
<keyvan> gogiel: yeah, that's clever thank you. since it is only 4 methods it isnt worth it. but thanks for the tricks
<gogiel> keyvan: http://pastie.org/4207251 more generic
EstanislaoStan has quit []
tommyvyo has joined #ruby
<keyvan> gogiel: thanks for your help :D
mockra has quit [Remote host closed the connection]
<gogiel> the flaw is that you can only have on filter
<gogiel> one~
mockra has joined #ruby
cakehero has joined #ruby
ben_alman has quit [Excess Flood]
ben_alman has joined #ruby
gift has quit [Remote host closed the connection]
havenn_ has joined #ruby
wargasm has joined #ruby
billiamii has joined #ruby
cdepue has joined #ruby
banisterfiend has joined #ruby
AlbireoX`Laptop has joined #ruby
weasels has joined #ruby
cdepue has quit [Ping timeout: 245 seconds]
Chryson has joined #ruby
liluo has joined #ruby
weasels has quit [Client Quit]
otters has joined #ruby
niklasb has quit [Ping timeout: 246 seconds]
ben_alman has quit [Excess Flood]
jimeh3 has quit [Ping timeout: 252 seconds]
brianpWins has quit [Quit: brianpWins]
zemanel has quit [Quit: Remote hottie closed the connection]
ben_alman has joined #ruby
SQLStud has quit [Read error: Connection reset by peer]