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
<macer1> I am going sleeeeep… 02:00 AM. bye ;)
IPGlider has quit []
<shevy> Hanmac, how?
<shevy> if it is interpreted
<shevy> how can it be as fast as C
igaiga has joined #ruby
erichmenge has quit [Quit: erichmenge]
neersight[d] is now known as neersighted
MrGando has quit [Quit: Bye]
albemuth has quit [Quit: Computer has gone to sleep.]
randomautomator has quit [Remote host closed the connection]
kylemcgill has quit [Remote host closed the connection]
itnomad has quit [Ping timeout: 265 seconds]
MrGando has joined #ruby
zeade has quit [Quit: Leaving.]
<Hanmac> shevy i dont know ... google for HPC ruby
<shevy> is this the all-japanese thing again :-)
<shevy> I am going to update ruby-fpdf in the next some days
<shevy> not sure how useful it is considering we have prawn
<shevy> but perhaps it has a niche in being smallish
macer1 has quit [Quit: macer1]
adamkittelson has quit [Ping timeout: 245 seconds]
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]
Juul has quit [Read error: Operation timed out]
kenperkins has quit [Quit: Computer has gone to sleep.]
wpaulson has joined #ruby
benjammin891 has quit [Ping timeout: 260 seconds]
frishi has joined #ruby
Juul has joined #ruby
Fezzler has joined #ruby
QaDeS_ has joined #ruby
otters has quit [Quit: WeeChat 0.3.8]
<Paradox> i cant seem to make rspec run be_instance_of
otters has joined #ruby
kenichi has quit [Remote host closed the connection]
<Paradox> it always spits undefined method `be_instance_of' for #<Class:0x007ff8d1a2e4b0> (NoMethodError)
<Paradox> no matter what i call it on
QaDeS has quit [Ping timeout: 245 seconds]
iocor has quit [Quit: Computer has gone to sleep.]
davidcelis_ has joined #ruby
davidcelis has quit [Read error: Operation timed out]
<Paradox> oh my god, seriously
<Paradox> wait
<Paradox> nvm
<Paradox> maybe not
<Paradox> yup
<Paradox> gem install rspec didnt install expectations
<Paradox> ಠ_ಠ
dr_diamond has joined #ruby
RORgasm has quit [Remote host closed the connection]
RORgasm has joined #ruby
peregrine81 has quit [Quit: Goodbye.]
subbyyy has joined #ruby
subbyyy has quit [Max SendQ exceeded]
sbanwart has quit [Ping timeout: 244 seconds]
subbyyy has joined #ruby
subbyyy has quit [Max SendQ exceeded]
subbyyy has joined #ruby
sbanwart has joined #ruby
jchauncey has joined #ruby
jchauncey has quit [Client Quit]
ilyam has quit [Remote host closed the connection]
ilyam has joined #ruby
g0bl1n has joined #ruby
g0bl1n has quit [Changing host]
g0bl1n has joined #ruby
pk1001100011 has joined #ruby
sonkei has quit [Quit: WeeChat 0.3.8]
ckrailo has quit [Quit: Computer has gone to sleep.]
jimmy1980 has quit [Ping timeout: 276 seconds]
davidcelis_ has quit [Ping timeout: 272 seconds]
ryan0x2_ has joined #ruby
sonkei has joined #ruby
puchi has joined #ruby
vladiim has quit [Quit: vladiim]
bradhe has quit [Remote host closed the connection]
jimmy1980 has joined #ruby
ciopte7 has joined #ruby
beilabs has quit [Ping timeout: 246 seconds]
beilabs_ has quit [Ping timeout: 252 seconds]
QaDeS_ has quit [Quit: Ex-Chat]
vladiim has joined #ruby
Ethan has quit [Read error: Operation timed out]
yaasii has joined #ruby
aantix has quit [Ping timeout: 246 seconds]
punkrawkR has quit [Read error: Connection reset by peer]
GuidovanPossum has joined #ruby
nadirvardar has quit [Quit: Computer has gone to sleep.]
pdtpatrick_ has joined #ruby
manizzle has quit [Read error: Operation timed out]
dr_diamond has quit [Ping timeout: 272 seconds]
manizzle_ has quit [Read error: Operation timed out]
pdtpatrick has quit [Read error: Operation timed out]
pdtpatrick_ is now known as pdtpatrick
perryh_away is now known as perryh
dwaynecrooks has quit [Ping timeout: 276 seconds]
<GuidovanPossum> Could someone help me? I'm trying to read all but the first lime of file_in, and commented out a failed attempt: https://gist.github.com/3a8919272cfdbcb4ca6e
frishi has quit [Quit: Leaving...]
ken_barber has quit [Remote host closed the connection]
igaiga has quit [Remote host closed the connection]
frishi has joined #ruby
<GuidovanPossum> line
A124 has quit [Quit: Leaving.]
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]
pdtpatrick has quit [Quit: pdtpatrick]
freezey has quit [Quit: freezey]
<Paradox> is there any way to get command-line input in rspec?
<Paradox> eh
<Paradox> nvm
<Paradox> disregard that
<cout> I once knew a Paradox from efnet.
<Paradox> its not me
beilabs has joined #ruby
<Paradox> heh
<cout> coulda been :)
Juul has quit [Ping timeout: 264 seconds]
beilabs_ has joined #ruby
dv310p3r has quit [Ping timeout: 276 seconds]
fbernier has joined #ruby
seanstickle has quit [Quit: Nihil sub sole novum]
ryan0x2 has quit [Ping timeout: 265 seconds]
wilmoore has joined #ruby
vladiim has quit [Quit: vladiim]
mnaser has quit [Quit: Computer has gone to sleep.]
niklasb has quit [Ping timeout: 245 seconds]
emet has joined #ruby
<ekaleido> efnet
<ekaleido> brings back memories
havenn has joined #ruby
theRoUS has quit [Read error: Connection reset by peer]
umttumt has joined #ruby
Fezzler has quit [Quit: Leaving]
puchi has quit [Quit: leaving]
blendedbychris has joined #ruby
pdtpatrick has joined #ruby
stephenjudkins has quit [Quit: stephenjudkins]
<ged> GuidovanPossum: Do you mean that you want to open a filehandle, seek past the first line, and then read the rest?
quest88 has joined #ruby
kenperkins has joined #ruby
ilyam has quit [Quit: ilyam]
iori has joined #ruby
savage- has quit [Ping timeout: 264 seconds]
c0rn_ has quit [Quit: Computer has gone to sleep.]
zeromodulus has joined #ruby
wangr has quit [Ping timeout: 276 seconds]
eywu has quit [Quit: Leaving.]
kevinbond has quit [Quit: kevinbond]
<ged> GuidovanPossum: Well, if that's what you meant, I forked your gist and added that.
brianpWins has quit [Quit: brianpWins]
mdaisuke has joined #ruby
soler has joined #ruby
jamesaxl has quit [Ping timeout: 252 seconds]
perryh is now known as perry
nari has joined #ruby
soler has left #ruby [#ruby]
dnyy_ has joined #ruby
skipper has joined #ruby
soler has joined #ruby
soler has left #ruby [#ruby]
skipper has quit [Remote host closed the connection]
havenn has quit [Ping timeout: 252 seconds]
blendedbychris has quit [Ping timeout: 252 seconds]
dnyy has quit [Ping timeout: 244 seconds]
Ontolog has quit [Remote host closed the connection]
blendedbychris has joined #ruby
blendedbychris has quit [Changing host]
blendedbychris has joined #ruby
Hanmac1 has joined #ruby
Enekoos has quit [Remote host closed the connection]
wpaulson has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
Hanmac has quit [Ping timeout: 260 seconds]
mockra has quit [Remote host closed the connection]
kpshek_ has joined #ruby
davidcelis_ has joined #ruby
wpaulson has joined #ruby
apok has quit [Quit: apok]
EzeQL has joined #ruby
DanBoy has quit [Remote host closed the connection]
kpshek_ has quit [Ping timeout: 255 seconds]
fbernier has quit [Remote host closed the connection]
kevinbond has joined #ruby
burntbit has joined #ruby
andrewhl has joined #ruby
kevinbond has left #ruby [#ruby]
burntbit has quit [Quit: Leaving]
wpaulson has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
Gavilan has joined #ruby
uris has joined #ruby
liluo has joined #ruby
benjammin891 has joined #ruby
blendedbychris has quit [Read error: Connection reset by peer]
blendedbychris1 has joined #ruby
Bosma has joined #ruby
mdaisuke has quit [Read error: Connection reset by peer]
<blendedbychris1> http://pastie.textmate.org/private/oz5iofsnwyraf7hchqxq7g << how can i iterate through that in erb?
shadoi has quit [Ping timeout: 244 seconds]
mockra has joined #ruby
igaiga has joined #ruby
beilabs_ has quit [Ping timeout: 260 seconds]
beilabs has quit [Ping timeout: 260 seconds]
bricker88 has quit [Quit: Leaving.]
Vert has quit [Ping timeout: 252 seconds]
pdtpatrick has quit [Quit: pdtpatrick]
lemonade` has left #ruby [#ruby]
noganex has quit [Ping timeout: 264 seconds]
noganex has joined #ruby
Bosma has quit [Quit: leaving]
niku4i has joined #ruby
voodoofish430 has quit [Quit: Leaving.]
Ontolog has joined #ruby
blendedbychris1 has quit [Quit: Leaving.]
blendedbychris has joined #ruby
adeponte has joined #ruby
<greyEAX> anyone in here work with the sqlite3 rubygem?
<greyEAX> $db.execute("SELECT name FROM modules") is giving me ["testmod"] instead of just testmod and i dunno how to fix it
<greyEAX> if i run the command using sqlite3 it just gives me testmod without the quotes and brackets which is what i want
<blendedbychris> what's the proper way to write that hash http://pastie.textmate.org/private/yi260iq4qhzy6odx5ftsvw
<blendedbychris> i'm a ruby idiot trying to get bye here
benjammin891 has quit [Ping timeout: 276 seconds]
<blendedbychris> this is how i'm trying to use it http://pastie.textmate.org/private/n3hywvakhpt6yigz1odvyw
<blendedbychris> with a %> :)
Sheehan has joined #ruby
mockra has quit [Remote host closed the connection]
mockra has joined #ruby
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
x0F_ is now known as x0F
Targen has quit [Ping timeout: 245 seconds]
<Spooner> blendedbychris : bit odd the way it is written, yes
<blendedbychris> Spooner: it's not working i'm getting a syntax error
<Spooner> Do you want to use strings or symbols as the keys?
<blendedbychris> at "services"
<blendedbychris> not sure i understand the difference
Bosma has joined #ruby
<blendedbychris> here's an updated version http://pastie.textmate.org/private/oaxnbum4f8bcgvdufsku1a
<blendedbychris> i ahve to use 'https':
<blendedbychris> but beyond that i'm just trying to pass a hash of hashes :
<blendedbychris> (I presume)
maletor has quit [Quit: Computer has gone to sleep.]
<Spooner> Well, to use strings, you would use { "frog" => 12 }, but as symbols, you'd use { frog: 12 }
<Spooner> or using backwards compatible symbol syntax, { :frog => 12 }
<horesman> Spooner: sup spoondiggitydogg
<Spooner> Hi horesman
igaiga has quit [Remote host closed the connection]
<Paradox> 1.9 syntax > pre 1.9 syntax, imo
<Paradox> same with -> vs lambda
<blendedbychris> bleh
shadoi has joined #ruby
<horesman> Paradox: some ppl feel very strongly about it and wil claw yoru eyes out if they heard u say dat
<Spooner> I've had grief for using new syntax since some people still love to live in the past :P, so I give both. I'd use 1.9 syntax if you can.
<Paradox> horesman, yeah, i know
<Paradox> thats why i just stick ruby >= 1.9 in my gemfiles and whatnot
blendedbychris has quit [Quit: Leaving.]
<Spooner> Oops, it was all too much for blendedbychris :(
<shadoi> what syntax?
<Spooner> Not 100% sure what language they were trying to write Ruby in :D
cjs has joined #ruby
ananthakumaran has joined #ruby
<Spooner> horesman : How're the antipodes treating you?
<horesman> Spooner: not bad not bad though it's winter it's a winters day and wintery evening and walking out into the winter now i may not return
<Spooner> Oh yes, I had forgotten your backwards nature. Have fun in the snow.
<horesman> cya
Sheehan has quit [Quit: Sheehan]
horesman has quit [Remote host closed the connection]
CheeToS has joined #ruby
Spooner has quit [Ping timeout: 246 seconds]
user__ has joined #ruby
akem has quit [Read error: Connection reset by peer]
jumpingcloud has quit [Remote host closed the connection]
freeayu has joined #ruby
Ontolog has quit [Remote host closed the connection]
<greyEAX> okay so apparently its some kind of issue with trying to print the array
<greyEAX> it always leaves the brackets and ""
<greyEAX> i just want the string to print without all that
sbanwart has quit [Ping timeout: 265 seconds]
niku4i has quit [Remote host closed the connection]
blendedbychris has joined #ruby
blendedbychris has quit [Changing host]
blendedbychris has joined #ruby
Ontolog has joined #ruby
<greyEAX> basically i'm pulling data from sqlite and trying to compare everything in the array to a specific string to see if it exists already, but it wont do it beacuse of the damn brackets and quotes
<blendedbychris> :|
<blendedbychris> why am i sooo dumbb
DarthGandalf has joined #ruby
freeayu has quit [Ping timeout: 272 seconds]
rgrinberg has quit [Quit: Leaving]
freeayu has joined #ruby
wpaulson has joined #ruby
General[Soup]imo has joined #ruby
General[Soup]imo has left #ruby [#ruby]
moshee has quit [Ping timeout: 265 seconds]
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
benjammin891 has joined #ruby
macmartine has quit [Ping timeout: 245 seconds]
freeayu has quit [Ping timeout: 272 seconds]
<deryl> greyEAX: arr = ["1", "2", "3"] ; arr.each {|el| puts el.to_s }
<deryl> don't need the .to_s but i add it so I know its a string
<greyEAX> ima try that thx deryl
<greyEAX> kk
<deryl> well if oyu want to *ensure* its a string then use the .to_s
<greyEAX> kk
<Seventoes> EC2 micro instances are so slow T_T
MrGando has quit [Quit: Bye]
<Seventoes> been compiling ruby for like a half hour
stefanp has joined #ruby
stefanp has quit [Changing host]
stefanp has joined #ruby
<deryl> if you have 'pry' gem installed just run pry and paste that entire line. you'll see it works. arr = ["1", "2", "3"] ; arr.each {|el| puts el.to_s }
<greyEAX> perrfect
<greyEAX> it works great thanks
<deryl> np
<greyEAX> how would i check one string against each of those though
<Paradox> Seventoes, compiling is one of those times i splurge on a mega-instance
<greyEAX> say x = 1
<greyEAX> and i want to check if x is in that array
<Paradox> the more processing power i can throw at a compiler, the faster it is, the less time i have to buy
<Seventoes> i wanna stay in the free tier cuz i'm cheap :P
<greyEAX> of 123
<Paradox> i've done the math
<Seventoes> i'm fine with compiling for an hour if it means the instance says totally free
<Seventoes> stays*
<Paradox> its more expensive to compile on the lowest price tear than it is to compile on the highest price one
<Paradox> tier
<Paradox> i failed
<Seventoes> lol
freeayu has joined #ruby
<Seventoes> this instance is just going to be a monitor for my physical servers so i don't need anything big
<greyEAX> deryl
<deryl> ?
<greyEAX> if i wanted to check a string against all of those how would i do that?
<greyEAX> x=1 if x arr.each?
<greyEAX> like that?
wpaulson has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
stefanp_ has quit [Ping timeout: 265 seconds]
noganex has quit [Read error: Operation timed out]
Boohbah has quit [Quit: 3.4.3-1-ck]
<deryl> arr.each {|el| if el == "3" then puts "hello" else puts "bad" end }
<deryl> or do some other comparison checking etc
<greyEAX> cool thx i just tried if butts.each.include? x print "success" and it worked too
<greyEAX> erm, butts being the array lol
<deryl> change it to arr.each do |el| <newline> your_code__goes_here end to make it multiline
<deryl> i'm just doing inline
<greyEAX> kk
<deryl> yeah can do include as well. I was stretching it out so you could see the internal mechanics
<greyEAX> oic
<greyEAX> ty\
<greyEAX> *ty
<deryl> there's probably like 8 different ways to do that hehe
<deryl> np
td123 has quit [Read error: Connection reset by peer]
<deryl> and with that I'm off to bed
axiak has quit [Quit: leaving]
axiak has joined #ruby
axiak has quit [Client Quit]
axiak has joined #ruby
user__ has quit [Read error: Connection timed out]
noganex has joined #ruby
td123 has joined #ruby
mockra has quit [Remote host closed the connection]
xnm has quit [Read error: Connection reset by peer]
jeff_sebring has joined #ruby
axiak has quit [Client Quit]
joshcheek has joined #ruby
sepp2k1 has quit [Remote host closed the connection]
axiak has joined #ruby
beilabs has joined #ruby
beilabs_ has joined #ruby
axiak has quit [Client Quit]
xnm has joined #ruby
axiak has joined #ruby
joshcheek has left #ruby [#ruby]
joshcheek has joined #ruby
umttumt has quit [Remote host closed the connection]
sailias has quit [Quit: Leaving.]
jsebring has joined #ruby
a_a_g has joined #ruby
a_a_g has quit [Client Quit]
blendedbychris has quit [Quit: Leaving.]
jsebring has quit [Client Quit]
jeff_sebring has quit [Quit: Leaving]
jeff_sebring has joined #ruby
ph^ has quit [Remote host closed the connection]
blendedbychris has joined #ruby
blendedbychris has quit [Changing host]
blendedbychris has joined #ruby
ph^ has joined #ruby
emet has quit [Remote host closed the connection]
ph^ has quit [Ping timeout: 276 seconds]
<cjs> Is there a quick reference card somewhere for the C API used when writing Ruby extensions?
ananthakumaran1 has joined #ruby
krusty_ar has quit [Ping timeout: 246 seconds]
ryanf has joined #ruby
jarred has quit [Quit: jarred]
ananthakumaran has quit [Ping timeout: 244 seconds]
GuidovanPossum has left #ruby [#ruby]
_whitelogger_ has joined #ruby
_whitelogger has quit [Remote host closed the connection]
umttumt has joined #ruby
freezey has joined #ruby
sonkei has quit [Quit: WeeChat 0.3.8]
sonkei has joined #ruby
Targen has joined #ruby
savage- has joined #ruby
prometheus has quit [Ping timeout: 260 seconds]
maletor has joined #ruby
davidcelis_ has quit [Quit: K-Lined.]
sepp2k has joined #ruby
davidcelis has joined #ruby
ananthakumaran1 has quit [Quit: Leaving.]
hemanth has quit [Read error: Connection reset by peer]
hemanth has joined #ruby
vvgomes has joined #ruby
robbyoconnor has joined #ruby
ananthakumaran has joined #ruby
pyoor has quit [Ping timeout: 252 seconds]
pyoor has joined #ruby
uris has quit [Ping timeout: 248 seconds]
rgrinberg has joined #ruby
jamesaxl has joined #ruby
tommyvyo has joined #ruby
vvgomes has left #ruby [#ruby]
indian has quit [Ping timeout: 272 seconds]
igotnolegs has joined #ruby
wpaulson has joined #ruby
nirakara has joined #ruby
nirakara has quit [Read error: Connection reset by peer]
brianpWins has joined #ruby
grendlme has quit [Quit: grendlme]
KaOSoFt has joined #ruby
malkomalko has quit [Remote host closed the connection]
imami|afk is now known as banseljaj
mwilson_ has quit [Excess Flood]
mwilson_ has joined #ruby
KaOSoFt has left #ruby [#ruby]
Guest85777 has joined #ruby
zeade has joined #ruby
Guest85777 has quit [Changing host]
Guest85777 has joined #ruby
joshcheek has quit [Quit: joshcheek]
Guest85777 is now known as Yugo
frishi has quit [Quit: Leaving...]
hemanth has quit [Read error: Connection reset by peer]
hemanth has joined #ruby
td123 has quit [Quit: WeeChat 0.3.8]
wpaulson has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
<greyEAX> arrrgh im stuck again
sonkei has quit [Quit: WeeChat 0.3.8]
<bnagy> grease behind the ears
crankycoder has quit [Remote host closed the connection]
sonkei has joined #ruby
daniel_hinojosa has quit [Ping timeout: 244 seconds]
g0bl1n has quit [Ping timeout: 264 seconds]
<greyEAX> that refuses to trigger the else part of that conditional.
d3vic3 has quit [Ping timeout: 245 seconds]
<greyEAX> im sending it something that's NOT already in the database, and it knows that so it doesnt give me the alert saying it is
<greyEAX> but its also bnot putting it in the database
dmwit has joined #ruby
faitswulff has joined #ruby
<bnagy> ok apart from horrible use of globals, why do you need to iterate modarray there?
faitswulff has left #ruby [#ruby]
d3vic3 has joined #ruby
<greyEAX> erm one sec lemme look
<bnagy> aren't you effectively doing modarray.grep /some_module_name/ ?
crankycoder has joined #ruby
<greyEAX> erm i think so
<greyEAX> basically it pulls the data from the sqlite db
<greyEAX> puts it in a global array, modarray
<greyEAX> and i iterate through modarray to see if the name i'm sending is already in the array
<bnagy> which is awful, btw
<greyEAX> why is that
<bnagy> the global
<greyEAX> why?
<greyEAX> i have more than one function that will need that info
<bnagy> anyway I think you're doing matches=modarray.grep(/pdata['connect']['name']/); if matches.empty? # not there yet
<bnagy> then use an instance variable or something
<greyEAX> full code
<bnagy> but this is the result of a query - you SURE you want that to be used by more than one method?
<greyEAX> ignore my dumb code comments
<greyEAX> well i think
<greyEAX> when i pull directly from the sqlite db it formats shit weird
<greyEAX> so i cant test the string properly
horesman has quit [Ping timeout: 264 seconds]
<dmwit> Is there a tutorial written for people who already know a handful of other languages? Something that jumps straight to the stuff that's new and different in Ruby -- the syntax/semantics, an overview of the toolchain, and maybe a quick tour of the standard libraries?
lkba has quit [Read error: Connection reset by peer]
<bnagy> pickaxe I guess?
<greyEAX> ergh i have no idea what im doing with this
<greyEAX> im sure the code is a complete mess']
<bnagy> it is
<dmwit> bnagy: First hit on Google for "pickaxe ruby" is http://pragprog.com/book/ruby/programming-ruby -- is that what you're suggesting?
vladiim has joined #ruby
<ryanf> yes
<bnagy> http://www.rubycentral.com/pickaxe/ is the ancient one
<greyEAX> well i mean im an autodidact. i wish i could have someone that i could just constantly ask questions, but i cant
<dmwit> thanks
<bnagy> I was looking for the updated version
<greyEAX> so most of it is just pieced together from various tutorials and guessworkl
benjammin891 has quit [Ping timeout: 255 seconds]
<cjs> RubyPanther: thanks. Neither is quite what I'm looking for, but both are helpful.
<bnagy> dmwit: you can get a long way by skimming the poignant guide
<bnagy> but the cartoons are an irritant if you are trying to move fast
<bnagy> however I honestly think that the metaprogramming / introspection stuff in there is as good as any
<bnagy> and that's the main 'ahha' area of ruby if you're coming from another language
<RubyPanther> You're trying to move fast buy you're stuck in Dwemthy's Array being eaten by a dragon.
<bnagy> apart from slicker syntax and Enumerable
<bnagy> all of above imho ymmv etc
<bnagy> greyEAX: my suggestion: get rid of all the $vars, put stuff into a class
<bnagy> also, in general, sqlite is fricking USELESS
<bnagy> use a real db
<greyEAX> like what? why is sqlite bad?
<greyEAX> the idea of trying to maintain a sql server for this doesn't work
<bnagy> I'm just saying, it sucks balls. If you're happy with that then fine
<greyEAX> well i mean i dont know anything about dbs
<bnagy> I would use the Sequel gem, at least
<greyEAX> basically i had an idea
<greyEAX> picked ruby
<greyEAX> and have been googling my way through everything
<bnagy> but ultimately I'd look at a KV store, judging by the stuff you're storing, but they do depend on external libs. Oklahoma Mixer is great, ime
<dmwit> bnagy: Okay, I'll look at that one, too. Thanks for the pointers.
<greyEAX> for example i dont understand why 'while true do' works
<greyEAX> to me thats an incomplete thought
<greyEAX> but it works
daym0n has joined #ruby
dnyy_ has quit [Remote host closed the connection]
<bnagy> because true is always true, I hate that idiom though
<bnagy> loop do ...
<bnagy> while true just makes you sound like a retard who is trying to be a smartass
<greyEAX> oic
<bnagy> nothing against you, I guess you saw it somewhere - a lot of people use it
<bnagy> dmwit: also, the docs
<greyEAX> well like i said i don't know anything. i tried learning properly, but going from 'this is how you write an if statement' to 'lets write an irc bot' is a massive jump
jgrep has quit [Quit: Leaving.]
anildigital_work has left #ruby [#ruby]
ben_m has quit [Quit: Leaving]
Sheehan has joined #ruby
bosphorus has joined #ruby
Ontolog has quit [Remote host closed the connection]
umttumt has quit [Remote host closed the connection]
ringotwo has joined #ruby
beilabs has quit [Ping timeout: 245 seconds]
beilabs_ has quit [Ping timeout: 260 seconds]
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
mohits has quit [Read error: Connection reset by peer]
iamlacroix has joined #ruby
ringotwo has quit [Remote host closed the connection]
dnyy has joined #ruby
niku4i has joined #ruby
Chryson has quit [Quit: Leaving]
<dmwit> Yes, this pickaxe book looks good.
andrewhl has quit [Remote host closed the connection]
niku4i has quit [Ping timeout: 252 seconds]
ipoval has joined #ruby
beilabs_ has joined #ruby
beilabs has joined #ruby
ABK has joined #ruby
josefig has joined #ruby
josefig has quit [Changing host]
josefig has joined #ruby
RORgasm has quit [Remote host closed the connection]
davidokner has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
<davidokner> I just found this site called RubyMonk.com . I haven't tried it yet, but I think it might be the best way to learn ruby.
ananthakumaran has joined #ruby
<davidokner> I bought the PickAxe book, but I was expecting some exercises or something.
<davidokner> Is anyone familiar with RubyMonk?
<dmwit> <<-' ' <- this seems like a fun language corner
daym0n has left #ruby [#ruby]
<greyEAX> so i tried to convert my stuff to a class so im not using global variables but now i'm getting a no method error.
<bnagy> so fix it, dear henry...
<bnagy> show me teh codez and the 3rr0rZ
<bnagy> I see.
<bnagy> The cool thing about using classes is that we can instantiate them to make objects
<bnagy> so make an IRCRelay.new, and then you can change most of your $globals to @instance_variables
abionic has joined #ruby
<bnagy> and those @ivars will be visible between methods, for just that instance of your class
ryanf has quit [Quit: leaving]
andrewhl has joined #ruby
<bnagy> also I would move the db stuff into a methods called 'initialize'
<bnagy> which is a special method that gets run when the class is first instantiated
<greyEAX> oic
RainbowDashh has quit [Quit: SLEEP MODE. <@suborbital> no i filtered out RainbowDashh join quit msgs - appearantly it filtered out everything]
<greyEAX> okay ill change it and paste it because i'll probably be totally wrong here
<bnagy> also, if it's not too much trouble
mikeycgto has quit [Remote host closed the connection]
<bnagy> could you change to 2 or 4 space indent and not use pstebin?
<greyEAX> i'm using a 4 space indent actually
<greyEAX> i guess pastebin is being weird about it
<greyEAX> also what should i use instead?
<bnagy> well it's coming out as 8, so maybe you're using tabs or something
<bnagy> pastie gist codepad ...
ABK has quit [Ping timeout: 276 seconds]
<greyEAX> kk
mobilegamelabs has joined #ruby
<greyEAX> erm im using tabs but it should be 2 width now
<greyEAX> idk why its changing to 8 width
<greyEAX> i dont know how to fix it
<Mon_Ouie> A tab is a tab, there are no 8-width tabs or 2-width tabs because they are exactly the same character
josefig has quit [Quit: Textual app]
<Mon_Ouie> There are file viewer configured to assume tab width is 8 or 2 or whatever though
horesman has joined #ruby
siekoku has joined #ruby
<greyEAX> oic
Sheehan has quit [Quit: Sheehan]
TPFC-SYSTEM has joined #ruby
<bnagy> so people who like tabs say 'tabs are awesome because you can view them however you want in your editor'
alexmin has joined #ruby
ZachBeta has quit [Quit: Computer has gone to sleep.]
<bnagy> and people who like spaces say 'tabs suck balls because they're TABS' and you can't view them properly in normal text viewing tools
crankycoder has quit [Remote host closed the connection]
<greyEAX> oic
<greyEAX> i just use tabs because its easier than SPACE SPACE SPACE SPACE
<greyEAX> every time
<bnagy> but tabs vs spaces are one of the third rails of programming debate
maxpenguin has joined #ruby
<bnagy> like vim vs emacs
<greyEAX> oic
<Mon_Ouie> Most text editors can indent automatically with spaces and tabs alike
<bnagy> but in any case, unless you use 4 space indent and vim, you are a fucking retard
<greyEAX> where am i supposed to make the IRCRelay.new btw? i have one at the bottom but its inside a Thread.new
<greyEAX> since running a udp server and a tcp connection needs two threads
<greyEAX> and it doesn't seem to be working
lorn has quit [Read error: Operation timed out]
<bnagy> if you want to share it between threads (dunno if it's threadsafe) then before you start the threads, otherwise inside the thread where you're using it is fine
<greyEAX> share it? well i know i'm passing data read from the tcp stream to the udp server, and passing udp input to the tcp stream
akem has joined #ruby
akem has quit [Changing host]
akem has joined #ruby
vladiim has quit [Quit: vladiim]
Ttech has quit [Ping timeout: 250 seconds]
kiin has quit [Quit: Peace]
maxpenguin has quit [Client Quit]
cout has quit [Ping timeout: 244 seconds]
jgrep has joined #ruby
lorn has joined #ruby
macmartine has joined #ruby
cout has joined #ruby
Utkarsh_ has quit [Quit: No Ping reply in 180 seconds.]
Utkarsh has joined #ruby
keyvan has joined #ruby
Sheehan has joined #ruby
workmad3 has quit [Ping timeout: 245 seconds]
prometheus has joined #ruby
liluo has quit [Remote host closed the connection]
vladiim has joined #ruby
Shoobdidoo has joined #ruby
iori has quit [Remote host closed the connection]
Ttech has joined #ruby
siekoku has quit [Quit: siekoku]
<bnagy> I don't know anything about IRC bots, but..
<greyEAX> oh i managed to get it running by putting the Thread.new things in the def initialize
<bnagy> I wouldn't do that
mdaisuke has joined #ruby
<greyEAX> dammit every time i think i'm doing something right man
<bnagy> I would break out the Cinch bot (whatever that is) into its own class
<greyEAX> oh jeez
<bnagy> and then make one of those in the second thread and then one of the relay thing in the first
<bnagy> that cinch thing is self contained, no?
<greyEAX> i think so
Sheehan has quit [Quit: Sheehan]
<greyEAX> its agem
<dominikh> Yo, Cinch developer here.
<dominikh> Cinch::Bot#start runs the processing loop and thus blocks
<bnagy> ok, so greyEAX you can just take all the contents of your ircinch method and put that in the second thread
<bnagy> if you like
<greyEAX> you mean instead of having it as a method
<matled> Mon_Ouie: ah, you've updated coolline, cool :)
<greyEAX> do thread { all the code from ircinch method }
<greyEAX> ?
tewecske has quit [Quit: Leaving.]
<bnagy> the in the first thread you have relay=IRCRelay.new
<bnagy> then relay.udpserv
<Mon_Ouie> matled: Yep ;)
davidokner has left #ruby [#ruby]
tonini has joined #ruby
bradhe has joined #ruby
<greyEAX> im totally lostr
<bnagy> greyEAX: and I think that should be almost there... you have a typo on line ~39 (I can't see if it's 39 or 40 cause it's indented half way across the screen)
<greyEAX> oic
<matled> Mon_Ouie: do you have any idea what was wrong with my config file? it didn't seem to get called when pressing ^U http://ix.io/2AK/
<greyEAX> this is what it looks like right now
<greyEAX> and it seems to be working
<greyEAX> though the problem i had originally is still there
beilabs_ has quit [Ping timeout: 245 seconds]
<greyEAX> i cant do anything with the stupid database
<Mon_Ouie> Yeah, that's something I had forgotten about — You need to add \C-u *before* other bindings, otherwise the \C-a..\C-z binding (which is a no-op) will get matched first
beilabs has quit [Ping timeout: 255 seconds]
<greyEAX> i guess i can switch over to Sequel
<Mon_Ouie> That's why I added that Coolline.bind method now
j0llyr0tten has joined #ruby
<j0llyr0tten> hey, i'm moving from 1.8 to 1.9 and i hit an upgrade issue
<bnagy> greyEAX: I would put the threads back how you had them t1=Thread.new {IRCRelay.new.updserv}; t2=Thread.new {IRCRelay.new.ircinch}
<greyEAX> but it wasnt working when i did that
<bnagy> that should work
<greyEAX> ill try it again
<dominikh> what exactly are you guys trying to solve?
<j0llyr0tten> undefined reference to rb_str2cstr and STR2CSTR in a C extension, anybody got any ideas ? :)
<bnagy> dominikh: nothing, personally, I'm just helping him refactor
<Mon_Ouie> Use StringValueCStr
<greyEAX> yeah if i put it back like before i get this error undefined method `udpserv' for IRCRelay:Class (NoMethodError)
<bnagy> I guess the actual problem will become obvious soon
<j0llyr0tten> Mon_Ouie: thx
<greyEAX> oh wait
<bnagy> greyEAX: you need to do it like I said. It's an instance method
<greyEAX> IRCRelay.
RainbowDashh has joined #ruby
<j0llyr0tten> Mon_Ouie: instead of ... ?
<matled> Mon_Ouie: ah, so Settings.unshift would've worked? :)
<Mon_Ouie> matled: Yeah
freeayu has quit [Ping timeout: 250 seconds]
<Mon_Ouie> j0llyr0tten: instead of the funciton and macro you mentioned
<dominikh> bnagy: uhm, shouldn't he only create one instance?
<j0llyr0tten> Mon_Ouie: ok, thx, i'll try it out. I'm trying to make the extension work for both 1.8 and 1.9 so i might #ifdef it
<bnagy> dominikh: yeah, the cinch thing should be broken out
<greyEAX> okay i did it like that and its working now
<bnagy> that's next
timonv has joined #ruby
hemanth has quit [Read error: Connection reset by peer]
<Mon_Ouie> Even 1.8 has StringValueCStr
hemanth has joined #ruby
<greyEAX> now i have to break out the Cinch thing?
wvdschel has joined #ruby
<bnagy> greyEAX: ok, now just break out the cinch code. Personally I would make a new class called CinchRelay or something, and put all that cinch stuff in a start method
<bnagy> so in t2 you change to Thread.new {CinchRelay.new.start}
<greyEAX> k
<j0llyr0tten> Mon_Ouie: hmm, ok ...
<bnagy> then you can rip that code out of the IRCRelay class
sspiff has quit [Ping timeout: 246 seconds]
banseljaj is now known as imami|afk
nu11 has joined #ruby
jgrep has quit [Quit: Leaving.]
jimmy1980 has quit [Ping timeout: 244 seconds]
jgrep has joined #ruby
<greyEAX> okay thats it with the cinch thing broken out
<j0llyr0tten> Mon_Ouie: i'm also getting "lvalue required as unary ‘&’ operand" with StringValuePtr ... any ideas?
freeayu has joined #ruby
ziggles has joined #ruby
prometheus has quit [Ping timeout: 244 seconds]
<Mon_Ouie> Depends on how you're using it
<j0llyr0tten> Mon_Ouie: LOL
ananthakumaran has quit [Quit: Leaving.]
beilabs has joined #ruby
beilabs_ has joined #ruby
<j0llyr0tten> name=StringValuePtr(rb_funcall(oName,id_to_s,0));
<j0llyr0tten> name is a chr*
<j0llyr0tten> oName is a VALUE
iori has joined #ruby
<Mon_Ouie> Maybe StringValuePtr needs its argument to be an lvalue for some reason, so store it in a variable first
andrewhl has quit [Remote host closed the connection]
<j0llyr0tten> Mon_Ouie:
<j0llyr0tten> Mon_Ouie: doh! ok, will do
mohits has joined #ruby
mohits has quit [Changing host]
mohits has joined #ruby
trend has quit [Disconnected by services]
neersighted is now known as neersight[d]
<greyEAX> okay so now i'm going to convert the SQL stuff to kyoto cabinet i think
<horesman> Mon_Ouie: do you think you still have innocence
<greyEAX> though i kinda dont want to have to rewrite all that stuff
SeySayux has quit [Read error: Connection reset by peer]
<bnagy> greyEAX: that looks a lot better, once you fix the indenting :)
<greyEAX> yeh yeh
<greyEAX> im using scribe so
<greyEAX> *scribes
<greyEAX> i tried vim
<greyEAX> but it gave me a headache
<greyEAX> it may not be elegant but clicking around to do stuff is a lot more comfortable for me
<greyEAX> by the way bnagy would it be worth splitting this up into more than one file?
<greyEAX> theres going to be more code that handles the input from the udp server to see what it's doing
<greyEAX> and check it against a database
Natch has joined #ruby
savage- has quit [Remote host closed the connection]
jxf has joined #ruby
<bnagy> yep
mohits has quit [Ping timeout: 245 seconds]
<bnagy> now you have your classes broken out you can put each of those classes into a file and require them
<greyEAX> nice
schovi has joined #ruby
<greyEAX> so i should only use globals when i want to pass info between classes, then?
<greyEAX> or are instance variables fine for that?
<bnagy> you should never use globals
<bnagy> until you know enough to prove me wrong
<greyEAX> :/
xnm has quit [Read error: Connection reset by peer]
<greyEAX> but how do i pass information between classes then
<bnagy> via methods
Axsuul has quit [Ping timeout: 245 seconds]
ryan0x2_ has quit [Remote host closed the connection]
Axsuul has joined #ruby
<greyEAX> whaaat
<bnagy> if you want to send information to another object, you invoke one of its methods
<bnagy> that way you have nice happy encapsulation
<bnagy> and the OOP gods are pleased
peterhil has joined #ruby
SeySayux has joined #ruby
<bnagy> globals anger the OOP gods
xnm has joined #ruby
<greyEAX> i dont know how to OOP
<greyEAX> just the two step
<greyEAX> procedural is the only thing i know
<greyEAX> perl taught me to love it
TheHunter_1039 has quit [Quit: TheHunter_1039]
<greyEAX> though apparently perl has OOP too
ryanf has joined #ruby
schovi has quit [Remote host closed the connection]
danielvdotcom has joined #ruby
danielvdotcom has quit [Client Quit]
Shrink has quit [Ping timeout: 244 seconds]
horesman is now known as banisterfiend
quest88 has quit [Quit: quest88]
a_a_g has joined #ruby
nari has quit [Ping timeout: 248 seconds]
CreativeEmbassy has joined #ruby
RainbowDashh has quit [Quit: SLEEP MODE. <@suborbital> no i filtered out RainbowDashh join quit msgs - appearantly it filtered out everything]
Targen has quit [Ping timeout: 245 seconds]
nu11 has quit [Quit: Leaving]
mockra has quit [Remote host closed the connection]
ilyam has joined #ruby
banisterfiend has quit [Remote host closed the connection]
andrew9184 has left #ruby [#ruby]
ananthakumaran has joined #ruby
pu22l3r_ has joined #ruby
kill-9_ has quit []
ilyam has quit [Client Quit]
<j0llyr0tten> rb_str2cstr and StringValueCStr aren't exactly the same :(
timonv has quit [Remote host closed the connection]
pu22l3r has quit [Ping timeout: 245 seconds]
<j0llyr0tten> Mon_Ouie: rb_str2cstr and StringValueCStr aren't exactly the same :(
kill-9_ has joined #ruby
Sgeo has joined #ruby
jgrep has quit [Read error: Connection reset by peer]
jgrep has joined #ruby
prometheus has joined #ruby
workmad3 has joined #ruby
Shrink has joined #ruby
Sgeo has left #ruby [#ruby]
bearlulz has joined #ruby
senny has joined #ruby
schovi has joined #ruby
nilg has joined #ruby
savage- has joined #ruby
<greyEAX> god dammit
ph^ has joined #ruby
<greyEAX> now for some reason i'm getting errors saying that .each and .include are undefined methods
<greyEAX> bnagy, you still there?
Bosma has quit [Ping timeout: 255 seconds]
RainbowDashh has joined #ruby
igaiga has joined #ruby
jgrevich has joined #ruby
davidcelis has quit [Read error: Connection reset by peer]
senny has quit [Remote host closed the connection]
vectorshelve has joined #ruby
igaiga_ has joined #ruby
mikepack has quit [Remote host closed the connection]
<greyEAX> ARGH
macmartine has quit [Read error: Connection reset by peer]
Targen has joined #ruby
RORgasm has joined #ruby
igaiga has quit [Ping timeout: 250 seconds]
bosphorus has quit [Ping timeout: 276 seconds]
RORgasm has quit [Remote host closed the connection]
macmartine has joined #ruby
ziggles has quit [Remote host closed the connection]
igaiga has joined #ruby
macmartine has quit [Remote host closed the connection]
macmartine has joined #ruby
nari has joined #ruby
shadoi has quit [Quit: Leaving.]
arturaz has joined #ruby
igaiga_ has quit [Ping timeout: 250 seconds]
ph^ has quit [Remote host closed the connection]
rakunHo has quit [Remote host closed the connection]
ph^ has joined #ruby
igotnolegs has quit [Quit: Computer has gone to sleep.]
davidcelis has joined #ruby
davidcelis has quit [Changing host]
davidcelis has joined #ruby
cyong has joined #ruby
MrGando has joined #ruby
CreativeEmbassy has quit [Quit: Computer has gone to sleep.]
<Mon_Ouie> j0llyr0tten: How are they different?
<greyEAX> okay i cant figure this out at all
jimeh has joined #ruby
ph^ has quit [Ping timeout: 276 seconds]
EzeQL has quit [Ping timeout: 245 seconds]
dekroning has joined #ruby
adeponte has joined #ruby
Shrink has quit [Quit: ta]
freezey has quit [Quit: freezey]
Niamkik has joined #ruby
Shrink has joined #ruby
RudyValencia has joined #ruby
ipoval has quit [Quit: ipoval]
qwerxy has joined #ruby
Manhose has joined #ruby
gilead has joined #ruby
QaDeS has joined #ruby
ghanima has joined #ruby
ipoval has joined #ruby
workmad3 has quit [Ping timeout: 245 seconds]
alexmin has quit [Remote host closed the connection]
senny has joined #ruby
hoelzro|away is now known as hoelzro
Jackneill has joined #ruby
vladiim has left #ruby [#ruby]
macmartine has quit [Quit: macmartine]
Manhose has quit [Ping timeout: 252 seconds]
fantazo_ has quit [Remote host closed the connection]
fowl has quit [Remote host closed the connection]
charliesome has joined #ruby
sent-hil has joined #ruby
moshef has joined #ruby
moshef has quit [Client Quit]
<sent-hil> does logger.warn only log the last line of the block?
<sent-hil> if i've multiple lines to log, do I've to create multiple lines of log.warn ...; log.warn ... ?
SiliconDon has joined #ruby
JohnBat26 has joined #ruby
adeponte has quit [Remote host closed the connection]
blendedbychris has left #ruby [#ruby]
faulkner has quit [Ping timeout: 260 seconds]
otters has quit [Ping timeout: 260 seconds]
faulkner has joined #ruby
otters has joined #ruby
<sent-hil> found it, logger.warn """ ... \n ... """
<greyEAX> argh can anyone recommend me a good db solution that doesnt need a server?
<greyEAX> tokyocabinet and kyotocabinet refuse to install
lonre has joined #ruby
bosphorus has joined #ruby
bosphorus has quit [Remote host closed the connection]
lonre has left #ruby [#ruby]
djdb has joined #ruby
<hoelzro> greyEAX: have you looked at SQLite?
<greyEAX> im trying it
Shoobdidoo has quit [Quit: Verlassend]
<greyEAX> sequel is not working for me properly
lonre has joined #ruby
<greyEAX> or that is, i dont know how to use it
dnyy has quit [Remote host closed the connection]
<greyEAX> and i cant get it to work properly with the sqlite3 gem either
<greyEAX> so yeah
<bnagy> how does it not install?
<bnagy> what OS are you running?
<greyEAX> archlinux
<greyEAX> latest ruby
<bnagy> well just build tc from source, then gem install oklahoma_mixer
<greyEAX> i can install oklahoma mixer
<greyEAX> but it doesnt have an apio
<greyEAX> *api
<bnagy> of course it does
<RubyPanther> greyEAX: there is always DBM in the stdlib
<greyEAX> i cant find it
<greyEAX> apparently dbm can change if the computer you
<greyEAX> you're using changes
<RubyPanther> If you need to access the data from different computers, then usually you _do_ want a server...
<bnagy> if you use the Hash DB then your OklahomaMixer api just looks more or less exactly like a hash
<bnagy> which is all you need if your data is not relational
<bnagy> and if it's seriously relational then a toy like sqlite isn't going to work anyway
nadirvardar has joined #ruby
subbyyy has quit [Ping timeout: 240 seconds]
<ryanf> what? a toy?
<greyEAX> hashdb?
<ryanf> how so?
roolo has joined #ruby
<ryanf> sqlite seems pretty relational to me
Eldariof-ru has joined #ruby
drmegahertz has joined #ruby
<greyEAX> also if you can find the api for oklahomamixer then i'll read it but i just cant find it
<greyEAX> and i dont know enough about ruby to try and guess my way through this
<bnagy> JEG has several good blog posts
<greyEAX> i guess i could manually do it with json files but i REALLY don't want to
<greyEAX> JEG?
Markvilla has joined #ruby
<greyEAX> dude i don't know any of these terms or acronyms
<bnagy> which you should find really quickly if you google about oklahomamixer
<bnagy> it's the guy's initials :)
wallunit has joined #ruby
<wallunit> What does following code do? (env['HTTP_AUTHORIZATION'] =~ /Negotiate /)
<bnagy> wallunit: probably nothing, unless someone has copied ENV to env
<dmwit> It looks up the key HTTP_AUTHORIZATION in the env hash, and matches it against the regular expression /Negotiate /.
lonre has quit [Read error: Connection reset by peer]
<greyEAX> it says his name is james edward grey
<greyEAX> greay
<greyEAX> *gray
<bnagy> that's the dude
<greyEAX> k
lonre has joined #ruby
<dmwit> Also, I have never touched ruby before about six hours ago, which really says something about how little you worked to understand this code.
<greyEAX> but i dont really understand his blog posts
<cjs> I'm writing a C extension for Ruby, and I want to call functions from another C extension (in this case, openssl). How do I deal with this?
<bnagy> I found the blog posts to be really awesome and thorough
<wallunit> dmwit: thanks
sent-hil has quit [Remote host closed the connection]
<greyEAX> thats the one im reading but again i don't know enough about ruby to understand it.
<greyEAX> i can do guesswork but that's why nothings working
<greyEAX> i dont know what [:etc] does
<greyEAX> and so on
<bnagy> it's a hash lookup
<bnagy> you need to spend some time working with basic classes, maybe
<cjs> Maybe use the dlopen() interface?
<bnagy> you're already using hashes in your existing code, though
<greyEAX> well yeah but this is syntax i'm not familiar with
<cjs> I guess I need to go digging into the Ruby source code...
<greyEAX> i honestly don't know why there are like 5 different ways to write the same thing
zeade has quit [Quit: Leaving.]
<greyEAX> als, for example, after doing OklahomaMixer.open do |db| he does db.size.zero
<greyEAX> i have no way of knowing the methods in oklahoma mixer
<greyEAX> because theres no api
<hoelzro> cjs: hang on
<hoelzro> what exactly are you trying to do?
wilmoore has quit [Remote host closed the connection]
<bnagy> greyEAX: cause it acts like a Hash
<bnagy> that's the api
<bnagy> [], []= etc etc
ipoval has quit [Quit: ipoval]
<cjs> hoelzro: When I try to call ossl_x509ext_new(), which is a function in the Ruby openssl extension, from my extension, I get an...oh...forgot to include the header file. :-)
<bnagy> nosql takes a bit of getting used to, and it's definitely not right for everything
<bnagy> but it's a lot easier to use and more flexible if you can make it fit
mwilson_ has quit [Excess Flood]
<greyEAX> oic
CheeToS has quit [Ping timeout: 245 seconds]
mwilson_ has joined #ruby
perry is now known as perryh_away
<hoelzro> cjs: ok, so why are you trying to call that function from another extension?
<hoelzro> it seems like a bad idea to me right now, but I'm not sure what problem you're trying to solve
nadirvardar has quit [Ping timeout: 245 seconds]
sent-hil has joined #ruby
<cjs> hoelzro: I have an X509_EXTENSION* (defined in the OpenSSL C library), and would like my function to return the Ruby version of that defined by the openssl extension.
MrGando is now known as Goles
<greyEAX> so i just tried oklahoma mixer and it still didnt work
<cjs> hoelzro: The function (marked "public") ossl_x509ext_new in ext/openssl/ossl_x509ext.c will do that for me.
<hoelzro> cjs: does the Ruby openssl extension offer up a Ruby method for getting that?
<hoelzro> if so, I would invoke that
<cjs> hoelzro: But it looks as if I don't actually even have the header file on my system (except in my Ruby source code directories).
<cjs> hoelzro: Ah, it is a Ruby method! That's what I was missing. Thanks!
Markvilla has quit [Ping timeout: 265 seconds]
<greyEAX> i cant even tell why it's not working
<greyEAX> the error doesnt make any damn sense to me
maletor has quit [Quit: Computer has gone to sleep.]
<hoelzro> greyEAX: could you paste the error somewhere so others can have a look?
<cjs> hoelzro: Oh, wait, it's not a Ruby method. There can't be one, because the struct I want to convert is not a Ruby object. (If it were, I'd just return it.) So I need to make a call to a C function that will convert it to a Ruby object for me.
<greyEAX> hoelzro, yeah im doing that now
nadirvardar has joined #ruby
<cjs> hoelzro: So it seems clear that I need to make a call into the other extension (possibly making sure it's loaded, first, if I'm fussy).
nadirvardar has quit [Client Quit]
<hoelzro> cjs: oh, I see
<hoelzro> you can't create a Ruby object version of that struct?
qwerxy has quit [Read error: Connection reset by peer]
dekroning has quit [Read error: Connection reset by peer]
Ste11a has joined #ruby
dekroning has joined #ruby
Hanmac1 is now known as Hanmac
<hoelzro> greyEAX: that looks fun =(
MekkisScreen has quit [Read error: Operation timed out]
<greyEAX> i dunno man
<greyEAX> clearly i wasnt cut out for this
MekkisScreen has joined #ruby
<hoelzro> I don't have much experience, but I'd guess you're missing a shared library or something
beneggett has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
apeiros_ has joined #ruby
<cjs> hoelzro: The way I create the ruby version of that struct is to call that function in the openssl extension.
lonre has quit [Quit: lonre]
<cjs> hoelzro: I think I can do it by finding the dlopen() handle for that extension, if you happen to know how to do that. If not, I'll dive in to the 350 heavily-#ifdef'd lines of dln_load() in the Ruby source code (ow!), figure out out, and let you know what I find.
SiliconDon has quit [Quit: SiliconDon]
<hoelzro> cjs: I know how, but I'm not convinced that's the best solution =(
<hoelzro> I'm not a Ruby expert, however, so I can only guess at an alternative solution
<cjs> hoelzro: I'll happily take your guesses, but this does look to me like the correct solution. After all, it is a Ruby class defined by the openssl extension.
vantage has joined #ruby
preller has quit [Read error: Operation timed out]
<cjs> hoelzro: So, dln_load() was not so bad, I pretty quickly figured out that it returns the dlopen() handle. and rb_require_safe() (in eval.c) pushes that on to the ruby_dln_librefs array.
<hoelzro> that part makes sense
<hoelzro> but circumventing Ruby's loading mechanism and grabbing a C symbol by name seems like a bad idea to me
<vantage> Hi, I have a command line program that takes three unnamed paramaters and then passes them to a method. What's the best way to do this so that if an optional parameter is not entered, nothing is passed to the method?
<hoelzro> vantage: so prog foo bar baz calls method(), but prog --opt foo bar baz calls method(*%w(foo bar baz))?
<cjs> hoelzro: I'm not circumventing Ruby's loading mechanism (I hope): I'm relying on Ruby having loaded the openssl extension in the standard way.
<hoelzro> mkay
<hoelzro> I may be completely wrong on this
<cjs> So, ruby_dln_librefs is actually an interpreter global (Ruby) variable, a Ruby array, set with rb_global_variable(&ruby_dln_librefs).
timonv has joined #ruby
<vantage> hoelzro: prog.rb foo bar baz, then calls method(foo, bar, baz). But if you call prog.rb foo bar, then it calls method(foo, bar) instead of method(foo, bar, baz)
<vantage> hoelzro: I want to only pass the parameters that are entered by the user
<hoelzro> oh, I see
jcromartie has quit [Ping timeout: 246 seconds]
<vantage> hoelzro: that way the method can assign defaults to missing parameters
<hoelzro> use splat
<cjs> Hm. But that does just does a rb_gc_register_address() on it. It's also a C global, but declared (as well as defined) only in eval.c. Guess that means I declare it myself, too. I'd better check if it's the same in Ruby 1.9.....
<vantage> hoelzro: say more about splat? (This is my first day with Ruby)
<hoelzro> vantage: well, the splat operator (*) expands an array inline
<hoelzro> ex. a = %w(foo bar baz) method(*a)
<hoelzro> that's the exact same as method('foo', 'bar', 'baz')
<cjs> Ah, yes Ruby 1.9 has the same C global ruby_dln_librefs. So, dodgy since it's clearly not a really "official" API, but usable.
<cjs> But how the heck do I figure out which dlopen() handle in ruby_dln_librefs is the openssl extension handle?
<vantage> hoelzro: What is %w? How would ARGV fit in to this?
<cjs> I guess maybe I try them all with dlsym() and see which has the symbol I want....
jgrep has quit [Read error: Connection reset by peer]
<hoelzro> vantage: %w is Ruby syntax for creating an array of strings very easily
<hoelzro> %w(foo bar baz) is ('foo', 'bar', 'baz')
<hoelzro> cjs: o_O
<hoelzro> this sounds so dodgy
jgrep has joined #ruby
<hoelzro> vantage: you'd probably do something like method(*ARGV)
mwilson_ has quit [Excess Flood]
mwilson_ has joined #ruby
alup has quit [Ping timeout: 265 seconds]
fayimora has quit [Quit: Be back in a gifii]
<cjs> hoelzro: You are darn right it's dodgy. :-) I've just realized, what I'm trying to do is access an executable's global variable from a shared library that it's loaded.
fayimora has joined #ruby
jxf has quit [Ping timeout: 276 seconds]
drmegahertz has quit [Quit: Lost terminal]
<vantage> hoelzro: That seemed to work. Thanks!
<cjs> hoelzro: I'm asking about this in ##c, if you're curious and want to follow along.
fra000 has joined #ruby
ciopte7 has quit [Quit: ciopte7]
blacktulip has joined #ruby
<wallunit> Is there any difference between or and || ?
<vantage> hoelzro: any reason why numeric parameters are strings and how to convert them easily?
<vantage> hoelzro: it seems weird to be doing .to_i all the time
<hoelzro> wallunit: precedence
<hoelzro> vantage: ARGV only contains strings
<hoelzro> because that's what the OS gives you
ephemerian has joined #ruby
bearlulz has quit [Quit: Computer has gone to sleep.]
<fayimora> What is the difference between the core and standard library?
<hoelzro> vantage: you might want to use a gem for command line applications
<hoelzro> I don't know of any though =(
<vantage> hoelzro: no duck typing, eh?
<hoelzro> well, a String just doesn't behave like a number =)
<vantage> hoelzro: in Perl it does (if you want it to) :)
<hoelzro> vantage: I know, but Ruby != Perl
<vantage> hoelzro: As I'm discovering tonight :)
<hoelzro> heh
<wallunit> hoelzro: can i write code like "n || 2", in order to return n if it i not nil (or 0) and otherwith 2?
preller has joined #ruby
<hoelzro> wallunit: n || 2 will still return 0 if n is 0
<hoelzro> it will only return 2 if n is 2, nil, or false
yonggu has joined #ruby
<wallunit> hoelzro: ok, that's also fine in my particular case.
<wallunit> thanks
TPFC-SYSTEM has quit [Quit: TPFC-SYSTEM]
<Mon_Ouie> To parse command line arguments, you can use a gem like slop or optparse from stdlib
boo1 has joined #ruby
darthdeus has joined #ruby
keppy has joined #ruby
hakunin has quit [Remote host closed the connection]
hakunin has joined #ruby
<apeiros_> fayimora: core is what the ruby executable already contains
<apeiros_> stdlib is what is supposed to be installed with every ruby, but you still have to require it
<apeiros_> @supposed: some distros/package managers (apt, I'm looking at you!) decide that they know better what a complete ruby is than the ruby maintainers, so they don't install it along with the ruby package.
pk1001100011 has joined #ruby
ryanf has quit [Quit: leaving]
<boo1> why does rvm installer is trying to install rvm to '/usr/share/ruby-rvm' not to $HOME?
<Hanmac> cjs you could access the variable from an shared library ... if you know the name
<boo1> And how can I install it to $HOME
williamcotton has joined #ruby
jgrevich has quit [Quit: jgrevich]
banisterfiend has joined #ruby
hakunin has quit [Ping timeout: 276 seconds]
cyong has quit [Quit: Leaving.]
urbann has joined #ruby
Goles has quit [Quit: Computer has gone to sleep.]
<urbann> hi all
<urbann> I try to learn minitest but the examples at http://docs.seattlerb.org/minitest/ give me an error
Drakx has joined #ruby
Drakx has quit [Changing host]
Drakx has joined #ruby
<urbann> is it a typo in the doc ? %r^no/
<urbann> %r^no/ brake the code in textmate
<urbann> ?
scottr34 has joined #ruby
<cjs> Hanmac: turns out I can just access the function directly from the other shared library, since I know the name.
<Hanmac> "extern" is allmighty
Guest24250 has joined #ruby
<cjs> hoelzro: So, problem solved. I don't need anything from the Ruby interpreter at all. The other shared library (the openssl extension) was dlopen()'d with RTLD_GLOBAL, so if I'm loaded after it, my symbols will be resolved against it. I just need to declare the function I want to call, and it will be linked at runtime.
<hoelzro> ah
<hoelzro> cjs: I did something like that with Perl and Lua once
twinturbo has joined #ruby
keyvan has quit [Ping timeout: 245 seconds]
<cjs> The only danger here is that the declaration is not available with a distribution of Ruby since it's ossl_x509.h is not included in the ruby dev packages. So I simply have to declare it myself and hope it doesn't change.
<twinturbo> hey. I can I setup a variable in a superclass that can be customized in further subclasses?
workmad3 has joined #ruby
<twinturbo> but each modification is distinct to that class
<cjs> The other quibble is that I might blow up if someone loads my extension before openssl, but rather than try to deal with that (e.g., I could wrap the load in ruby code that ensures that happens) I think I'll just leave it for the moment.
Ttech has quit [Ping timeout: 265 seconds]
<cjs> Oh, wait, no I do have a convenient place to fix that. Done, then.
andreime has joined #ruby
Nigel has quit [Ping timeout: 248 seconds]
keyvan has joined #ruby
Nigel has joined #ruby
rking has quit [Ping timeout: 265 seconds]
Ttech has joined #ruby
iamlacroix has quit [Remote host closed the connection]
lahwran has quit [Quit: ZNC - http://znc.sourceforge.net]
keppy has quit [Quit: Leaving]
qwerxy has joined #ruby
flype has joined #ruby
igaiga has quit [Remote host closed the connection]
xnm has quit [Ping timeout: 276 seconds]
ananthakumaran1 has joined #ruby
ananthakumaran has quit [Ping timeout: 250 seconds]
robotmay has joined #ruby
jgrep has quit [Read error: Connection reset by peer]
jgrep has joined #ruby
foofoobar has joined #ruby
lahwran- has joined #ruby
Shoobdidoo has joined #ruby
berserkr has joined #ruby
dekroning has quit [Ping timeout: 240 seconds]
cyong has joined #ruby
Criztian has joined #ruby
savage- has quit [Remote host closed the connection]
<greyEAX> okay so i've been at this for hours but i still cant get this
beilabs has quit [Ping timeout: 255 seconds]
<greyEAX> for some reason i cant get the text to compare
beilabs_ has quit [Ping timeout: 276 seconds]
<bnagy> greyEAX: use 'p'
Shoobdidoo has quit [Quit: Verlassend]
<greyEAX> whats the difference?
<bnagy> to inspect the two bits of text that you think should match
<bnagy> p a; p b; if a==b #why is this broken??
<greyEAX> okay i dont know why
<greyEAX> but if my if statement is messed up
<greyEAX> i instead get an error about mismatched indentation
<greyEAX> this is retarded
<bnagy> no I mean do the puts to figure out why it doesn't work
<bnagy> then you can look at the output and go 'oh!"
<greyEAX> oic
yannis has quit [Quit: yannis]
<greyEAX> god dammit
banisterfiend has quit [Ping timeout: 264 seconds]
prometheus has quit [Ping timeout: 244 seconds]
<greyEAX> it doesnt matter what i do
<greyEAX> i get no output
<greyEAX> at all
Guest24250 is now known as davidw
davidw has quit [Changing host]
davidw has joined #ruby
<bnagy> eh? p varname doesn't produce any output?
<greyEAX> nope
<greyEAX> nothing
werdnativ has quit [Quit: werdnativ]
<greyEAX> i dont know what the hell is going on
<greyEAX> im using the sequel gem instead of the sqlite3 one
<bnagy> that probably means the things you're 'p'ing are nil
<greyEAX> using db.run
<greyEAX> and nothing is showing up
<greyEAX> which makes no sense
<greyEAX> or well
<greyEAX> it makes sense
<greyEAX> but the fact that it's not doing anything doesnt
<bnagy> greyEAX: time for a walk
<greyEAX> dude i took a 30 min breakl
<greyEAX> i tried different gems
<greyEAX> i tried using json to read and write to files
<greyEAX> i tried different syntax
<greyEAX> it's reading the string
<greyEAX> it reads it
<greyEAX> it REFUSES to do the conditional
<bnagy> chill. pastie codez
IPGlider has joined #ruby
<greyEAX> result when sending json: http://codepad.org/0lRyxLP8
<greyEAX> it doesn't trigger the "YES" or "NO"
<greyEAX> even if it reads nothing it should at least trigger the "NO"
<greyEAX> or print the "THIS IS: #{x}" with nothing after IS:
<bnagy> x.include?
<bnagy> not x.each.include?
<Mon_Ouie> They are equivalent though
jgrep has quit [Read error: Connection reset by peer]
<greyEAX> i just tried that, same result
<bnagy> yeah
<bnagy> so it doesn't print the THIS IS
<Mon_Ouie> And if #{x} doesn't output anything, it means x.to_s is empty (or whitespaces you don't notice)
mengu has joined #ruby
jgrep has joined #ruby
<Mon_Ouie> Use p or #{x.inspect} to see what it actually is
<apeiros_> def x.inspect; ""; end
<apeiros_> :-p
<bnagy> uh I don't know much about SQL, but that query doesn't look right
<greyEAX> well its not that it's just not outputting #{x} its that the whole string doesnt print
<greyEAX> seeing as it should at least print "THIS IS:"
<apeiros_> print only prints after a newline or after flushing
<apeiros_> alternatively: that line isn't executed.
<greyEAX> bnagy, if it wasnt right the sequel gem would throw an exception
<bnagy> I think it's just returning no results
<bnagy> so that whole block gets skipped
<Mon_Ouie> Oh yeah, you probably want all those print to be puts anyway
<Mon_Ouie> Or you'll get all that output in a single line
<greyEAX> changed it to p
<greyEAX> added p "#{x.inspect}"
<greyEAX> still nothing
<greyEAX> it's just ignoring those lines
<bnagy> p automatically does inspect
<greyEAX> oic
<bnagy> run that query against the db without a block, and then p the result
<bnagy> I bet there isn't one
<greyEAX> changed it to p x
<greyEAX> still nothing
IPGlider has quit [Ping timeout: 272 seconds]
<greyEAX> there isn't anything in the database
<greyEAX> but because there isn't it should respond with "NO"
<Mon_Ouie> So why is it surprising @db.run doesn't yield any result?
<greyEAX> as in the string doesnt match
<bnagy> greyEAX: no, you misunderstand
dhruvasagar has joined #ruby
<greyEAX> ?
<bnagy> that block after the query gets run per result
<bnagy> no results, no block
dekroning has joined #ruby
<greyEAX> okay ill try putting something in there then
<Mon_Ouie> Except what you just said means you're using @db.run wrong
<Mon_Ouie> You're probably looking for x = @db.run(…)
<greyEAX> oic
IPGlider has joined #ruby
monkegjinni has joined #ruby
vlad_starkov has joined #ruby
<greyEAX> okay so i changed it to that
<greyEAX> got this result
<greyEAX> so i guess db.run isnt doing anything
<greyEAX> that sql is valid though
virunga has joined #ruby
<Mon_Ouie> I don't know sequel, check the documentation to know what returning nil means
Axsuul has quit [Ping timeout: 240 seconds]
<Mon_Ouie> I'd guess it means there are no entries in the result
<urbann> in the examles for minitest at:
<urbann> they use the following match refute_match /^no/
<urbann> they use refute_match %r^no/
<urbann> the regexp %r^no/ are throwing the error unterminated regexp meets end of file
<urbann> is it something wrong with my ruby version / gem setup or is this a typo in the docs ?
<Mon_Ouie> It's a typo
<Mon_Ouie> AFAICT at least, probably they wanted to type %r/^no/
<urbann> Mon_Ouie: thanks!
banisterfiend has joined #ruby
<greyEAX> okay so i swtiched back over to the sqlite3 gem
<greyEAX> which was working
<greyEAX> and im back at the same problem before
<greyEAX> when i pull the information from the database
<greyEAX> it's formatted as ["etc"]
<greyEAX> so i cant compare it to my string
<greyEAX> because it will never be the same
<greyEAX> because my string doesnt have that
<Hanmac> %r/^no/ is so silly ... its the same as /^no/
<bnagy> results.include? mystr
<Mon_Ouie> It's an array, you can just get the first element out of it
<bnagy> or results.grep /myster/
<bnagy> etc
dinkoko_ has joined #ruby
fayimora has quit [Ping timeout: 264 seconds]
<Mon_Ouie> (I'm assuming it's more like [["first name"], ["second name"], ["third name"]])
<greyEAX> i need to iterate through all of them
<greyEAX> not just the first element
<bnagy> I don't think you do
<greyEAX> i need to make sure its not in the array
<greyEAX> not just that its not the first element in the array
<bnagy> if it's like Mon_Ouie says you can do results.flatten.include? "third name"
snearch has joined #ruby
<bnagy> etc
<Mon_Ouie> results.include? [name]
<bnagy> or that
<greyEAX> ohey
fayimora has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
<bnagy> but you don't iterate over a collection just to see if it contains something
<bnagy> ever
<greyEAX> x.grep(pdata['connect']['name'] triggered it
<greyEAX> i don't know how it worked but it did
<bnagy> cause grep is like include? but supports regexes
<Mon_Ouie> bnagy: Sure you do. That's how Enumerable#include? works.
<bnagy> if you're not using a regex then x.include? pdata['connect']['name']
<greyEAX> oic
<bnagy> Mon_Ouie: I'm sure being a smartass is incredibly amusing for you
<bnagy> :)
<greyEAX> but now if the incoming string contains anything inside another module
<greyEAX> it'll trigger
<Mon_Ouie> x.grep(pattern) == x.select { |o| pattern === o }
<greyEAX> so like if the module buttsteak is in the database
<greyEAX> and i try to add the module butts
<greyEAX> it thinks that butts is in the database
<Mon_Ouie> It doesn't return something truthy or falsy if nothing matches, just an empty array
tonini has quit [Remote host closed the connection]
d3vic3 has quit [Ping timeout: 248 seconds]
fayimora has quit [Client Quit]
<bnagy> yeah because buttsteak=~/butts/ is true
<bnagy> so use include? like we said
<greyEAX> wait
<greyEAX> crap i dont even know where to put that now
<bnagy> change grep to include?
hemanth has quit [Read error: Connection reset by peer]
<greyEAX> but thats what wasn't working before
<greyEAX> because the strings i pull from the database always have [""] around them
<Mon_Ouie> That's because they're not strings
<bnagy> ok then don't, suffer in your jocks
d3vic3 has joined #ruby
<Mon_Ouie> They're one-element arrays
<cjs> Oh, #@$!$#@%!
<bnagy> if grep works then include? works
<greyEAX> wait what
<greyEAX> i thought they were all in one array
<bnagy> if they're nested arrays then grep wouldn't work
<cjs> The value of T_ARRAY changed between Ruby 1.8 and 1.9. I have to compile different versions of my extension for different versions of Ruby.
binaryplease has joined #ruby
<greyEAX> they're all individual arrays?
<greyEAX> why?
<greyEAX> aaaaaaah
<Mon_Ouie> You didn't actually show the results, so all we can do is guess
<greyEAX> [["testmod", "grey", "BLAH"], ["buttsteak1", "grey", "BLAH"]]"THIS IS:[[\"testmod\"], [\"buttsteak1\"]]"
<greyEAX> [["testmod"], ["buttsteak1"]]
<greyEAX> with buttsteak1 in
<Mon_Ouie> cjs: 1.8 and 1.9 CAPI aren't supposed to be binary compatible in the first place, are they?
<greyEAX> oh i missed the NO
scottr34 has quit [Quit: Leaving]
<greyEAX> i wish there was a better way to explain this
<greyEAX> basically when someone sends in a module name, it has to check the database to see if it exists in there
<greyEAX> if it does, it disregards it
<greyEAX> if it doesn't, it adds it to the database
<bnagy> yes, we know
<greyEAX> this should be simple i don't understand what i'm missing
<bnagy> if x.grep(pdata['connect']['name']) works then x.include?(pdata['connect']['name']) will work
<bnagy> unless I have gone barking mad
<bnagy> they'll return different things though
<greyEAX> it doesn't
<bnagy> but they'll both be the same truthy/falsey
<greyEAX> because like i said, pdata['connect]['name
<greyEAX> because like i said, pdata['connect]['name'] = buttsteak1
<greyEAX> and
<Mon_Ouie> No, #grep is always truthy
<Mon_Ouie> It's always an array
<bnagy> ah you're right
<cjs> Mon_Ouie: Probably not. But it worked a bit, so I had hopes. :-)
<greyEAX> @db.execute("SELECT name FROM modules") = ["buttsteak1"]
<greyEAX> so if i could get rid of the damn [""] it would be perfect
<greyEAX> but i cant
<bnagy> ["foo"].include? "foo" will be true
<Mon_Ouie> greyEAX: You can do it the other way around
<Mon_Ouie> Just check if your array includes [name_you_are_looking_for]
<greyEAX> alright but idk how to delimit that
<greyEAX> x = "["#{@db.execute("SELECT name FROM modules")}"]"
<greyEAX> but that cant be right
<bnagy> greyEAX: honestly, give us the inspect results for x and pdata['connect']['name']
<bnagy> do p on both of those values
<greyEAX> i did .inspect
<greyEAX> kk redid it with p
<greyEAX> pdata is "buttsteak1"
<greyEAX> db.execute is [["testmod"], ["buttsteak1"]]
fermion has joined #ruby
<bnagy> ok then x.flatten.include? pdata['blah'] OR x.include? [pdata['blah']]
<Mon_Ouie> The latter won't have to iterate over the whole array to build a new one without the sub arrrays
<greyEAX> see that triggers YES instead of no
<greyEAX> but when i inspect x.flatten its exactly the same
<bnagy> I don't think it is
<greyEAX> the output is
<bnagy> p x==x.flatten
<greyEAX> false
<greyEAX> or well
<greyEAX> hold on
<greyEAX> yeah false
<greyEAX> it triggers properly now too
<greyEAX> what's flatten?
zomgbie has joined #ruby
<bnagy> turns [[1],[2]] into [1,2]
<Mon_Ouie> [["foo"], "bar", [["baz", "qux"]]] #=> ["foo", "bar", "baz", "qux"]
<Mon_Ouie> (Does it recursively if no argument is passed)
<greyEAX> oh god
<greyEAX> no wonder
<greyEAX> well now it's working
<greyEAX> thanks
<boo1> Why is rvm installer trying to install rvm to '/usr/share/ruby-rvm' not to $HOME?
<greyEAX> it took three hours but thx for sticking with me
<bnagy> boo1: because you're root
<boo1> bnagy, you mean in root group?
<bnagy> no, like hashprompt
<boo1> bnagy, is it possible to specify installation directory?
<bnagy> boo1: probably, I don't like rvm very much
alup has joined #ruby
<greyEAX> thx bnagy, thx Mon_Ouie
<bnagy> but if you run it as a user it will install in $HOME, if you run as root it will do a 'system install' which, in my experience, will usually fuck everything up
<bnagy> greyEAX: no worries
hemanth has joined #ruby
<bnagy> I really don't understand how grep was... ohhh right, he was evaluating it for truthiness, anything would have returned true
<bnagy> yes, I am retarded
mdaisuke has quit [Remote host closed the connection]
<boo1> bnagy, but I'm trying to install it as regular user
<boo1> bnagy, and is there better solution then rvm?
cyong has quit [Quit: Leaving.]
<bnagy> I prefer rbenv, this is OPINION only
Desmond has quit [Ping timeout: 246 seconds]
<hoelzro> bnagy: what is it about rbenv that you prefer?
dwaynecrooks has joined #ruby
<hoelzro> I've only ever used rvm
<Hanmac> my system has latest ruby as system package
<banisterfiend> bnagy: hey naggy, i'm thinking of shifting to rbenv as rvm is giving me bundler hell
<bnagy> rbenv knows how to unix
<banisterfiend> bnagy: it's putting all my apps in a bundler jail without me even saying anything about bundler!
<hemanth> vectorshelve, http://h3manth.com/demo/ght/ google hot trends, made sexier ;)
<bnagy> it's a little thinner though
<vectorshelve> hemanth: let me check it out
mobilegamelabs has quit [Quit: http://www.MGGGGG.com/ap Angry Polygon - my first Android/iOS/Mac game!]
<vectorshelve> hemanth: microsoft trending in google :)
<hemanth> :D
<shevy> google is too big
bambanx has joined #ruby
<bambanx> hi
<vectorshelve> hemanth: the last one was cool
<shevy> banisterfiend bundler is the future
<banisterfiend> shevy: that's what she said
<shevy> Hanmac will enjoy bundler integrated in ruby 2.0
<shevy> and there shall be much rejoicing
<locriani> BUNDLER
<matti> Hi shevy
<locriani> I have a friend
<shevy> ey matti
<locriani> who hated bundler
<vectorshelve> shevy: hi :)
<shevy> matti, meet locriani - he is an IRC poet :)
<locriani> because he didn't know about bundle --without
<bambanx> guys i am using this for formatting my numbers : (maximo['price']+0.01).round(2) but how i can use "," instead "." pls ?
<matti> shevy: Is he?
<locriani> I'm a poet and I didn't even realize
<shevy> yeah
<shevy> lemme find what he wrote a while ago
<locriani> heh
<locriani> something like
<vectorshelve> twitter went down for 2 hours yestreday all throughout the world... was a gr8 experience :D
<matti> Oh dear, a real poet on IRC, oh dear.
<bnagy> banisterfiend: blech as far as I know you need to tr the string once you create it
<locriani> Scanned documents; folder for the world of pain; inbox
<shevy> damn it, scrolled out already
<bnagy> sorry
ghanima has quit [Ping timeout: 250 seconds]
williamcotton has quit [Quit: williamcotton]
<locriani> shevy: I'll find it, my scrollback is 100k lines :V
<banisterfiend> bnagy: tr what string?
<bnagy> bambanx: blech as far as I know you need to tr the string once you create it
<banisterfiend> ah
<locriani> because the limbo eternity stone shone forth with a spoonful of dark last solstice
<locriani> shevy: and the howling echoes in medicated pillow resound
<shevy> oh yes precisely that
<bambanx> what u mean with tr bnagy ?
<shevy> I still dont know what it means but it reads damn awesome
<bnagy> bambanx: but don't, that's retarded
<locriani> haha
<locriani> I don't know what it means either!
<bnagy> "25.52".tr('.',',')
<bnagy> => "25,52"
sent-hil has quit [Remote host closed the connection]
<locriani> what I do know is that I'm thirsty
etehtsea has joined #ruby
<bambanx> is like a gsub bnagy ?
<shevy> I think it is faster than gsub
<bnagy> it's similar
<Mon_Ouie> 'alut matti ;)
<Hanmac> tr is much faster, but gsub can more
<shevy> banisterfiend THEY SPEAK FRENCH!!!
dhruvasagar has quit [Read error: Connection reset by peer]
mobilegamelabs has joined #ruby
<bambanx> ty bnagy
<banisterfiend> shevy: just young euro-boys flirting with one another
<locriani> lol
<locriani> Je parle un peu de français
<matti> お早よう Mon_Ouieさん
dhruvasagar has joined #ruby
sspiff has joined #ruby
sspiff has quit [Changing host]
sspiff has joined #ruby
<locriani> je ne parle pas japanois
<banisterfiend> anyone here seen prometheus?
<banisterfiend> can someone explain wtf happened?
<locriani> japanoise?
<banisterfiend> i dont understand a word of it
saschagehlich has joined #ruby
<locriani> I have not seen prometheus
<matti> This channel is turning weird.
<matti> ;]
<matti> Next, we will have tea break at 5pm, and chat about cricket.
wvdschel has quit [Ping timeout: 276 seconds]
<banisterfiend> matti: or we can all sit quietly and watch you and Mon_Ouie wink at one another
<banisterfiend> ;)
<locriani> basalamic, the vinegar eats at the heart of IRC: fading into grains of rice
<Hanmac> matti its because banister is online
<matti> Hanmac: Oh, good point :)
<matti> banisterfiend: You can join in :)
<matti> banisterfiend: The more the merrier.
hemanth has quit [Read error: Connection reset by peer]
<banisterfiend> matti: not drunk enough yet to swing that way
<locriani> I've always wondered what the energy requirement would be to air condition the state of texas
hemanth has joined #ruby
<banisterfiend> locriani: r u high :)
<matti> banisterfiend: Haha
<locriani> banisterfiend: no but I do have the munchies
dinkoko_ has quit [Quit: Page closed]
<banisterfiend> does anyone know how to make delegator methods private, defined with def_delegators
<banisterfiend> i guess this would work
<banisterfiend> meths = [:meth1, :meth2]; def_delegators :@var, *meths; private *methds
<workmad3> Hanmac: yeah, but no one gives a crap when the tablet runs LCARS
jgrep has quit [Read error: Connection reset by peer]
jgrep has joined #ruby
<Hanmac> workmad3: an lcars-tablet? i would buy it
<workmad3> Hanmac: trekkie :P
QaDeS has quit [Quit: Ex-Chat]
<matti> Hanmac: Me too.
justinmcp has quit [Remote host closed the connection]
wallunit has left #ruby [#ruby]
bluenemo has joined #ruby
justinmcp has joined #ruby
a_a_g has quit [Quit: Leaving.]
`brendan has quit [Quit: - nbs-irc 2.39 - www.nbs-irc.net -]
rashila has joined #ruby
bambanx has quit [Read error: Connection reset by peer]
timonv has quit [Remote host closed the connection]
krz has joined #ruby
justinmcp has quit [Ping timeout: 252 seconds]
justinmcp has joined #ruby
manhunter has joined #ruby
<manhunter> Hi
<daed> hi
<hemanth> vectorshelve, ?
manhunter is now known as tintin
bluenemo has quit [Ping timeout: 244 seconds]
nipra has joined #ruby
<tintin> HI
<tintin> I can't debug ruby source code using gdb
<tintin> I can't display/print/show the value of a variable from ruby source code
_axx has quit [Remote host closed the connection]
<tintin> Anybody?
EzeQL has joined #ruby
<Mon_Ouie> That's because… gdb isn't a Ruby debugger?
binaryplease has quit [Ping timeout: 276 seconds]
arussel has joined #ruby
<tintin> It's the .c code of ruby source code
<tintin> I knew gdb is for .c files
binaryplease has joined #ruby
<vectorshelve> hemanth: yeah tell me
workmad3 has quit [Ping timeout: 255 seconds]
rking has joined #ruby
<vectorshelve> hemanth: hemanth ur site had also showed up :) or is it really trending
<hemanth> vectorshelve, lol, it said trends brought to you by ;)
vlad_starkov has joined #ruby
<vectorshelve> hemanth: ok I just had a glance at ur site name by the time I tabbed back :D
<tintin> Can anyone help me about this? http://www.ruby-forum.com/topic/4403084#new
<vectorshelve> hemanth: u need to change the style of credits dude :D
<hemanth> hmm
ChampS666 has joined #ruby
workmad3 has joined #ruby
<tintin> Can anyone help me about this? http://www.ruby-forum.com/topic/4403084#new
<Hanmac> tintin ... why do you try to change something in array.c ?¿
<Hanmac> and doublepost in irc are very bad
<tintin> I don't want to change any values
<tintin> I just tried to printf the values
<tintin> But i failed
<Hanmac> and can you say to me "why"?
vlad_starkov has quit [Ping timeout: 245 seconds]
<tintin> I'm debugging that array.c:rb_ary_initialize function
flype has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<Hanmac> and "why"?
vantage has quit [Remote host closed the connection]
<tintin> I'm trying to know how it works internally.
<hoelzro> "In order to conserve space, RVM does not automatically generate and install each Ruby's ri / rdoc documentation." Is there a configuration setting to override this?
umttumt has joined #ruby
codelette has quit [Remote host closed the connection]
<tintin> Hanmac: Any idea?
Niamkik has quit [Ping timeout: 272 seconds]
<tintin> Hanmac: Can you contact in #ruby-lang?
<Hanmac> no you can "contact" in ruby-lang itself
<tintin> I'm banned there.
bluenemo has joined #ruby
jgrep has quit [Read error: Connection reset by peer]
<bnagy> hahaha
dr_diamond has joined #ruby
* Hanmac wonders why
iocor has joined #ruby
jgrep has joined #ruby
<banisterfiend> tintin: you're banned because you're a horrible person
<banisterfiend> tintin: you need to go to therapy to improve yourself
<tintin> lol
<banisterfiend> :P
<tintin> You need therapy too, because that should be banisterfriend, not banisterfiend
umttumt has quit [Remote host closed the connection]
<banisterfiend> tintin: the therapists all banned me, too
<Hanmac> no that is currect
<Hanmac> "fiend" is a word too
<hoelzro> fun stuff: I have to run "rvm docs generate all" from ~/.rvm/src
<banisterfiend> hoelzro: i dont need to generate docs :P
nari has quit [Ping timeout: 245 seconds]
umttumt has joined #ruby
<Hanmac> tintin: does your test shows some responce? i think your "redefinition of rb_ary_initialize is WRONG
<tintin> Hanmac: I think so
<Hanmac> look at the function head and say to me whats missing
<tintin> Hanmac: I just can't understand how to handle with RARRAY
<tintin> Which parameter is taking the array? rb_ary_initialize(int argc, VALUE *argv, VALUE ary)
<tintin> argv or ary?
malkomalko has joined #ruby
<Hanmac> try to guess ... but this not what i mean ... your function HEAD is still wrong
<banisterfiend> hoelzro: my documentation tool extracts documention on the fly without requiring things to be pregenerated
<workmad3> hoelzro: I don't think there's a config option to override it, but it tells you how to generate
jgrep has quit [Read error: Connection reset by peer]
<workmad3> hoelzro: or just use google like the rest of us :P
jgrep has joined #ruby
<tintin> Hanmac: ^
<banisterfiend> workmad3: did u know pry can even show module/class source now? :D
yaasii has quit [Quit: Leaving...]
<tintin> Hanmac: static VALUE
yaasii has joined #ruby
<workmad3> banisterfiend: I did not... if I used pry, I might know more :P
<Hanmac> tintin yeah, VALUE as return type ... did you did this in your function too?
<tintin> Hanmac: All are same, i just added the switch
<banisterfiend> workmad3: you should use it, it's truly a heart breaking work of staggering genius
<banisterfiend> Hanmac agrees
<banisterfiend> ;)
<workmad3> banisterfiend: yeah, Hanmac would :P
cjs has quit [Ping timeout: 246 seconds]
<Hanmac> i use it when pry is updated to an newer slop version
<banisterfiend> Hanmac: it's updated on HEAD
mvangala_ has joined #ruby
<banisterfiend> Hanmac: we're on slop 3.3.2 iirc
jbw_ has quit [Ping timeout: 246 seconds]
<Hanmac> and its updated on rubygems too?
mnaser has joined #ruby
<banisterfiend> Hanmac: not yet, probably doing a new release in under a week (i hope). We also added the ability to show C source for methods defined in 3rd party extensions (outside of core)
mvangala_ has quit [Remote host closed the connection]
mvangala_home has joined #ruby
<Hanmac> ... interesting ... i will test it on my c++ gems :P
arkiver has joined #ruby
<tintin> Hanmac: Any idea?
<banisterfiend> Hanmac: dont u have to wrap a member function in a pure C function before u bind it to a ruby method though?
<banisterfiend> it'll likely show the source for that C wrapper
<banisterfiend> so maybe not so useful
<Hanmac> banisterfiend ... yeah i need to do, but i use macros for that ...
<banisterfiend> yeah with macros all bets are off
<Tasser> Hanmac, there are c++ gems? Isn't the API quite c-heavy?
<banisterfiend> as you can build any syntax u like with that..
<Hanmac> Tasser, not realy ... but to support external c++ libs my gems are need to be c++ too
<workmad3> banisterfiend: run the source through the preprocessor before displaying it?
<workmad3> hmm, probably a bit too heavy... would require work setting up load paths, etc
<banisterfiend> workmad3: well we're actually using yard to parse the c file and extract the code, so we dont actually take part in any of that stuff
hemanth has quit [Read error: Connection reset by peer]
<banisterfiend> but i guess if we got realy serious about it we could add that in the future
<workmad3> banisterfiend: would probably make sense to push it into yard if you were interested in that :)
hemanth has joined #ruby
<banisterfiend> workmad3: maybe
<workmad3> banisterfiend: although I guess it would depend on what is more useful... trying to track something back to an 'original' definition before macroisation, or displaying it unprocessed
<workmad3> err, just realised both of those statements were the same :)
<workmad3> would it be better to display before or after preprocessing?
<workmad3> that's what I meant :)
eka has joined #ruby
<eka> hi all
<eka> is there any way I can detect if a string is HTML?
dhruvasagar has quit [Ping timeout: 245 seconds]
berkes has joined #ruby
frishi has joined #ruby
<Tasser> eka, I think that was a stackoverflow question some time ago
Spooner has joined #ruby
<eka> Tasser: ok, I will try to look over it
execute has joined #ruby
<banisterfiend> workmad3: another cool feature we have, is show-source -a ClassName it'll show u all monkeypatches (and the full source for each monkeypatch) for a given class/module
grendlme has joined #ruby
<workmad3> banisterfiend: ok... now how can I make pry my console for 'rails console'? :)
<banisterfiend> workmad3: just stick pry-rails in your Gemfile iirc
<Hanmac> eka: Nokogiri::HTML("document-string").validate
<banisterfiend> workmad3: there's a plugin for it
mvangal__ has joined #ruby
<workmad3> banisterfiend: trying now :)
<hoelzro> workmad3: I prefer viewing docs on the command line
<eka> Hanmac: without having to depend on Nokogiri? but still, useful thanks
dhruvasagar has joined #ruby
<Hanmac> eka, depend on what you want ... is <br> valid for you?
<eka> Hanmac: ah, is installed... lol
<workmad3> banisterfiend: nice, it shows me all the AS additions to array :)
jcromartie has joined #ruby
jbw_ has joined #ruby
acidrain has joined #ruby
<banisterfiend> workmad3: cool
<hoelzro> what's the recommended way to document a C module in Ruby?
<banisterfiend> workmad3: it's more powerful on HEAD as i detect class_eval extensions too
<Hanmac> hoelzro you mean a c-gem?
ph^ has joined #ruby
<eka> Hanmac: yes it's just a snippet, not a whole HTML page.. .that will not validate
mvangala_home has quit [Ping timeout: 260 seconds]
<hoelzro> Hanmac: yes, thanks
<banisterfiend> workmad3: type 'help' for more info on stuff
<workmad3> banisterfiend: found a bug :P
<Hanmac> hoelzro: i would use rdoc for documenting ... what works with rdoc should work for yard too
<banisterfiend> workmad3: gist
<workmad3> banisterfiend: something like a rails model is loaded on demand... so if I show-source before its loaded, it doesn't find it :P
bier has quit [Ping timeout: 252 seconds]
<banisterfiend> workmad3: yeah autoload stuff is a real pain
<Hanmac> thats why autoload will be rermoved
<workmad3> banisterfiend: yeah, I'm not saying it's a *valid* bug... :)
mengu has quit [Remote host closed the connection]
<banisterfiend> workmad3: thankfully they're getting rid of it sometime in the future :) (at least according to matz). But if you file an issue we might be able to do something about it in the meantime: https://github.com/pry/pry/issues
<workmad3> banisterfiend: and it would be fine in prod where that sort of stuff is loaded at boot
<workmad3> and autoload is slated for removal in ruby 3.0 at the earliest, iirc
<workmad3> seeing as we're not even at 2.0, that's likely another 5-10 years
<banisterfiend> yeah
<workmad3> and the main reason it's being removed is because of thread issues with it...
<banisterfiend> workmad3: run a method that generates an exception, then type: cat --ex multiple times
<workmad3> banisterfiend: nice :)
hemanth has quit [Read error: Connection reset by peer]
<banisterfiend> workmad3: edit --ex, also opens the editor to the line that generated the exception
<banisterfiend> anyway, enough marketing
hemanth has joined #ruby
jgrep has quit [Read error: Connection reset by peer]
<workmad3> banisterfiend: shouldn't it bottom out at the line typed into pry though, not 'result = target.eval(code, Pry.eval_path, Pry.current_line)'?
jgrep has joined #ruby
Lachryma has joined #ruby
<banisterfiend> workmad3: i like making the full backtrace available, esp. when pry is used to debug pry, it would make things difficult if we clipped off pry internal stuff
<workmad3> banisterfiend: well, why does it bottom out at the repl invocation then? there's still more stacktrace available after that I bet
fra000 has quit [Quit: Leaving]
Ste11a has quit [Read error: Connection reset by peer]
<workmad3> banisterfiend: oh, it's just because I had multiple layers of repl available
<banisterfiend> workmad3: well it goes through the actual stacktrace, i dont prune it at all, so if it's in the stacktrace it'll bring you through it
Ste11a has joined #ruby
<banisterfiend> cat --ex actually moves throgh _ex_.backtrace where _ex_ is the last exception
<workmad3> banisterfiend: just looked like it stopped at that pry line :)
<banisterfiend> oh ok
<workmad3> banisterfiend: I like that it loops back around :)
<banisterfiend> workmad3: if you include pry-stack_explorer and pry-exception_explorer, then u can actually move through the stack frames to access the state, rather than just looking at code
Morkel has joined #ruby
acidrain has quit [Quit: Linkinus - http://linkinus.com]
<banisterfiend> (assuming they're ruby-level exceptios :/ C exception support is being worked on..)
<workmad3> banisterfiend: maybe later :)
jgrep has quit [Ping timeout: 276 seconds]
<workmad3> I should probably do some work now :)
vlad_starkov has joined #ruby
<shevy> yeah
<shevy> EXCUSES!!!
tintin has left #ruby [#ruby]
jxf has joined #ruby
bier has joined #ruby
<banisterfiend> workmad3: it wasn't a suggestion, more an "if u do this, then X"
nkvorn_ has quit [Remote host closed the connection]
timonv has joined #ruby
iocor has quit [Ping timeout: 276 seconds]
<banisterfiend> icloud is actually pretty cool
rashila has quit [Quit: ChatZilla 0.9.88.2 [Firefox 11.0/20120310010757]]
iocor has joined #ruby
nanderoo has joined #ruby
tommyvyo has joined #ruby
jekhokie has joined #ruby
ramblex has joined #ruby
sepp2k has quit [Remote host closed the connection]
gilesw has joined #ruby
<gilesw> heya rubiers
<roolo> [spec_helper] Am i able to check if it's running from rspec, or rake?
<gilesw> i'm trying to print out some email addresses from a file on the command line
<gilesw> i've got this working
<gilesw> ruby -n -e 'if $_.match(/value=(.*),/); puts $1 ; end ;
<roolo> I am asking because of VCR which is blocking requests, when i run rake in test env
<gilesw> but is there way I can output $1 without having an if statement?
<gilesw> i had a look at the matchdata docs and couldn't find a method
Spooner has quit [Ping timeout: 276 seconds]
pu22l3r_ has quit [Remote host closed the connection]
ramblex has quit [Client Quit]
umttumt has quit [Remote host closed the connection]
ramblex has joined #ruby
pu22l3r has joined #ruby
<hoelzro> gilesw: $_.match(/...)[0]
umttumt has joined #ruby
<gilesw> cheers hoelzro
mobilegamelabs has left #ruby [#ruby]
d3c has joined #ruby
ramblex has quit [Client Quit]
ramblex has joined #ruby
josh- has joined #ruby
josh- has quit [Client Quit]
IrishGringo has quit [Ping timeout: 244 seconds]
umttumt has quit [Ping timeout: 246 seconds]
justinmcp has quit [Remote host closed the connection]
josh- has joined #ruby
eurbach has joined #ruby
<Hanmac> imo using $1 and $_ looks so ... C like ...
<hoelzro> C-like?
<hoelzro> more Perl-like to me =)
justinmcp has joined #ruby
<Hanmac> it looks still outdated
<hoelzro> that snippet could also work in Perl!
<hoelzro> well, nearly
prtksxna has joined #ruby
<hoelzro> perl -E 'say $1 if /value=(.*),/'
prtksxna has quit [Remote host closed the connection]
Criztian has quit [Remote host closed the connection]
Gavilan has left #ruby [#ruby]
geekbri has joined #ruby
iori has quit [Remote host closed the connection]
niklasb has joined #ruby
xbayrockx has joined #ruby
dhruvasa1ar has joined #ruby
dhruvasagar has quit [Ping timeout: 245 seconds]
banisterfiend has quit []
banisterfiend has joined #ruby
berserkr has quit [Quit: Leaving.]
ramblex has quit [Quit: leaving]
ramblex has joined #ruby
gyre007 has joined #ruby
<eka> is there any gem for doing requests that can keep cookies between requests? should not be mechanize
jcromartie has quit [Quit: jcromartie]
yonggu has quit [Read error: Connection reset by peer]
larissa has joined #ruby
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
yugui_zzz is now known as yugui
<shevy> hoelzro hey wait is this not perl 6
atmosx has quit [Ping timeout: 276 seconds]
atmosx has joined #ruby
frishi has quit [Quit: Leaving...]
boo1 has left #ruby [#ruby]
wangr has joined #ruby
nipra has quit [Ping timeout: 260 seconds]
tvw has joined #ruby
`brendan has joined #ruby
fbernier has joined #ruby
ryan0x2 has joined #ruby
josh- has quit [Quit: Linkinus - http://linkinus.com]
dr0p has joined #ruby
boo1 has joined #ruby
d3vic3 has quit [Ping timeout: 264 seconds]
<hoelzro> shevy: hmm?
federic has joined #ruby
d3vic3 has joined #ruby
<boo1> I have created group 'rwm', created user 'username' in this group, loged in as 'username', ran rwm installation script and got 'can not create directory /usr/shar/ruby-rwm'. And question, how can I install rwm to $HOME?
CannedCorn has joined #ruby
lahwran- has quit [Changing host]
lahwran- has joined #ruby
lahwran- is now known as lahwran
niku4i has joined #ruby
nari has joined #ruby
sailias has joined #ruby
yugui is now known as yugui_zzz
Doc_X1 is now known as Doc_X
g0bl1n has joined #ruby
CannedCorn has quit [Quit: Computer has gone to sleep.]
dhruvasagar has joined #ruby
niku4i has quit [Ping timeout: 252 seconds]
dhruvasa1ar has quit [Read error: Connection reset by peer]
vectorshelve has quit [Quit: Page closed]
RainbowDashh has quit [Quit: SLEEP MODE. <@suborbital> no i filtered out RainbowDashh join quit msgs - appearantly it filtered out everything]
iocor has quit [Ping timeout: 265 seconds]
miho has joined #ruby
iocor has joined #ruby
SeanLazer has quit [Quit: SeanLazer]
mirash has joined #ruby
grendlme has quit [Quit: grendlme]
chson has quit [Remote host closed the connection]
mirash has quit [Read error: Connection reset by peer]
QaDeS has joined #ruby
saispo has quit [Ping timeout: 260 seconds]
g0bl1n has quit [Quit: Ex-Chat]
g0bl1n has joined #ruby
mirash has joined #ruby
saschagehlich_ has joined #ruby
My_Hearing has joined #ruby
My_Hearing has quit [Changing host]
My_Hearing has joined #ruby
Mon_Ouie has quit [Ping timeout: 276 seconds]
saispo has joined #ruby
saschagehlich has quit [Ping timeout: 246 seconds]
saschagehlich_ is now known as saschagehlich
riginding has joined #ruby
arkiver has quit [Quit: Leaving]
abionic has quit [Ping timeout: 248 seconds]
td123 has joined #ruby
ken_barber has joined #ruby
francisfish has joined #ruby
linoj has joined #ruby
jrist-afk is now known as jrist
Criztian has joined #ruby
Solnse has joined #ruby
saschagehlich has quit [Ping timeout: 276 seconds]
SeanLazer has joined #ruby
minijupe has joined #ruby
pu22l3r has quit [Remote host closed the connection]
davidpk has joined #ruby
saschagehlich has joined #ruby
minijupe has quit [Client Quit]
hynkle has joined #ruby
<davidpk> Is there any way to set an instance variable, knowing its name beforehand as a symbol, without having to set up attr_(accessor|writer)s?
djdb has quit [Quit: Ухожу я от вас (xchat 2.4.5 или старше)]
carloslopes has joined #ruby
<davidpk> Obviously I could use eval, but is there a better way?
ikaros has joined #ruby
arussel` has joined #ruby
krusty_ar_ has joined #ruby
<banisterfiend> davidpk: instance_variable_set
Progster has joined #ruby
vlad_starkov has quit [Read error: Connection reset by peer]
vlad_starkov has joined #ruby
<davidpk> banisterfiend: aha, excellent, thank you!
krusty_ar has quit [Ping timeout: 264 seconds]
samuel02 has joined #ruby
krusty_ar_ is now known as krusty_ar
arussel has quit [Ping timeout: 252 seconds]
ben_m has joined #ruby
TheHunter_1039 has joined #ruby
andrewhl has joined #ruby
kpshek has joined #ruby
hunglin has joined #ruby
shevy has quit [Ping timeout: 265 seconds]
grendlme has joined #ruby
mbrit has joined #ruby
Shahor has joined #ruby
Shahor has quit [Client Quit]
chson has joined #ruby
JStoker has quit [Excess Flood]
mbrit has left #ruby ["Saliendo"]
cuppsy has quit [Read error: Connection reset by peer]
mirash has quit [Read error: Connection reset by peer]
JStoker has joined #ruby
punkrawkR has joined #ruby
uris has joined #ruby
dv310p3r has joined #ruby
sailias has quit [Ping timeout: 248 seconds]
shevy has joined #ruby
cuppsy has joined #ruby
beilabs has joined #ruby
beilabs_ has joined #ruby
td123 has quit [Quit: WeeChat 0.3.8]
itnomad has joined #ruby
schovi has quit [Remote host closed the connection]
schovi has joined #ruby
mpereira has quit [Ping timeout: 255 seconds]
Spooner has joined #ruby
mpereira has joined #ruby
Shahor has joined #ruby
kill-9_ has quit [Ping timeout: 264 seconds]
digitalcakestudi has joined #ruby
maesbn has quit [Remote host closed the connection]
Shahor has quit [Client Quit]
ananthakumaran1 has quit [Quit: Leaving.]
stefanp has quit [Read error: Connection reset by peer]
d3vic3 has quit [Ping timeout: 252 seconds]
tzvi has joined #ruby
keymone has joined #ruby
tcopp has joined #ruby
kill-9_ has joined #ruby
Emmanuel_Chanel has quit [Quit: Leaving]
tzvi has quit [Remote host closed the connection]
Emmanuel_Chanel has joined #ruby
kevinbond has joined #ruby
schovi has quit [Remote host closed the connection]
enroxorz has joined #ruby
enroxorz has quit [Changing host]
enroxorz has joined #ruby
ramblex has quit [Quit: ramblex]
<M00kaw> any of you that worked with gem tlsmail ? i get these wierd warnings: http://teh-geek.com/paste/index.php?show=11
mnaser has quit [Ping timeout: 272 seconds]
<enroxorz> Hey Guys, hoping i can get a knowledge nugget with my situation. First, I have a gem that can either be called as a library and pulls down all images in a 4chan board. Right now, it pulls it once into the directory called and if called again skips the images that have been already pulled. I want to run this indefinately until the board 404's and I cannot figure an elegant way of doing this.
<enroxorz> Any help would be appreciated. I can do a while true do, but there has to be a better way....
mnaser has joined #ruby
<Tasser> can I somehow define my own \foo stuff in regexp?
<hoelzro> Tasser: what do you mean?
<Tasser> hoelzro, like \w
<hoelzro> Tasser: I don't think so.
* hoelzro wonders if you can interpolate into Ruby regexes
jonathanwallace has joined #ruby
TechCel has joined #ruby
<workmad3> hoelzro: yes, yes you can
nari has quit [Ping timeout: 264 seconds]
<workmad3> /#{whatever}/
Progster has quit [Ping timeout: 240 seconds]
<hoelzro> awesome.
<hoelzro> Tasser: you can store your regexes in variables and interpolate them, like workmad3 so kindly demonstrated
ramblex has joined #ruby
joshman_ has joined #ruby
freeayu has quit [Ping timeout: 252 seconds]
snearch has quit [Quit: Verlassend]
nirakara has joined #ruby
ikaros has quit [Quit: Ex-Chat]
hynkle has quit [Quit: hynkle]
awarner has joined #ruby
CannedCorn has joined #ruby
gyre007 has quit [Quit: Ex-Chat]
malkomalko has quit [Remote host closed the connection]
freeayu has joined #ruby
d3c has quit [Quit: Quit]
awarner has quit [Ping timeout: 276 seconds]
Solnse has quit [Quit: Leaving.]
pu22l3r has joined #ruby
jcromartie has joined #ruby
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
zeromodulus has quit [Remote host closed the connection]
TechCel has quit [Ping timeout: 244 seconds]
xaq has joined #ruby
charliesome has quit [Quit: Textual IRC Client: www.textualapp.com]
josefig has joined #ruby
Progster has joined #ruby
schovi has joined #ruby
randomautomator has joined #ruby
awarner has joined #ruby
zeromodulus has joined #ruby
schovi has quit [Remote host closed the connection]
niklasb has quit [Ping timeout: 276 seconds]
Yugo has quit [Excess Flood]
arturaz has quit [Ping timeout: 265 seconds]
yankhates has joined #ruby
jcromartie has quit [Quit: jcromartie]
ben_alman has quit [Excess Flood]
dhruvasagar has quit [Ping timeout: 245 seconds]
rowanu has joined #ruby
minijupe has joined #ruby
Progster has quit [Ping timeout: 260 seconds]
Guest18559 has joined #ruby
snip_it_ has joined #ruby
Guest18559 has quit [Excess Flood]
pu22l3r has quit [Read error: Connection reset by peer]
M00kaw has quit [Ping timeout: 260 seconds]
pu22l3r has joined #ruby
Progster has joined #ruby
gyre007 has joined #ruby
td123 has joined #ruby
ePirat- has joined #ruby
TechCel has joined #ruby
CheeToS has joined #ruby
pu22l3r_ has joined #ruby
twock has joined #ruby
pu22l3r has quit [Read error: Operation timed out]
<Tasser> bit clumsy, but should do
ipoval has joined #ruby
ben_alman has joined #ruby
Niamkik has joined #ruby
visof has joined #ruby
Progster has quit [Ping timeout: 272 seconds]
RLa has joined #ruby
TechCel has quit [Ping timeout: 250 seconds]
<RLa> by who is bundler install supposed to be run, root?
Progster has joined #ruby
jgrep has joined #ruby
<ramblex> RLa: usually by a normal user i.e. not root
markab has quit [Quit: Leaving.]
nari has joined #ruby
celm has joined #ruby
berserkr has joined #ruby
<RLa> then why would bundle install as normal user cause `mkdir': Permission denied - /usr/local/lib/ruby/gems/1.9.1/cache/bundler (Errno::EACCES)
qwerxy has quit [Ping timeout: 244 seconds]
the_jeebster has joined #ruby
<ramblex> oh right, well if you're installing it system-wide then yes, you'll need to run it as root
davidpk has quit [Quit: Computer has gone to sleep.]
<RLa> so what command i must use to install it locally?
crankycoder has joined #ruby
<RLa> i'm setting up an app here, not a ruby expert
<arussel`> I'm trying to send 6M keys to a redis server but get connection error. It looks like the client doesn't send the command one at a time.
saschagehlich has quit [Quit: saschagehlich]
<arussel`> has anyone succeded in sending about 10M values to a server ?
<ramblex> RLa: bundle install accepts a --path option
<RLa> uh, and where should i install it then?
<RLa> btw, why can't i skip bundle and use raw gem?
qwerxy has joined #ruby
<RLa> because dep is specified as git repo?
joch_n has joined #ruby
jgrep has quit [Quit: Leaving.]
jlogsdon has joined #ruby
adeponte has joined #ruby
JohnBat26 has quit [Quit: KVIrc 4.1.3 Equilibrium http://www.kvirc.net/]
<ramblex> RLa: by default, bundler install gems to the same place as gem install
<RLa> hm, seems like the app i'm installing doesn't like that way
DrShoggoth has joined #ruby
<ramblex> does a normal gem install work?
<RLa> keeps complaining "git://github.com/chrisroberts/dav4rack.git (at master) is not checked out. Please run `bundle install`"
<RLa> no, same error
hynkle has joined #ruby
<shevy> hoelzro when you used 'say', say is a perl 6 feature right?
jxf has quit [Ping timeout: 260 seconds]
celm has quit [Quit: Leaving]
<ramblex> RLa: try `bundle install --path vendor/bundle`
macmartine has joined #ruby
<hoelzro> shevy: no, Perl 5 as well
<hoelzro> (for Perls 5.10 or newer)
strnx has quit [Excess Flood]
PaciFisT has joined #ruby
<RLa> ramblex, interesting Permission denied - /opt/redmine/plugins/redmine_dmsf/.bundle/config (Errno::EACCES)
apeiros_ has quit [Remote host closed the connection]
<RLa> those files have wrong permissions i guess, checking that
bfrog has joined #ruby
strnx has joined #ruby
riginding has quit [Read error: Connection reset by peer]
<shevy> hoelzro ah I see
<shevy> did not know t hat
<hoelzro> mhmm
<shevy> RLa bundler is like a virus :>
<hoelzro> 5.10 brought in a lot of cool stuff
<shevy> so they actually handle 5.x not in a frozen way?
<shevy> I mean
<shevy> if they continue with that, perl 5 could be perl 6 actually one day :P
<hoelzro> shevy: that's kinda what I'm hoping =P
<hoelzro> shevy: Perl 5 has a yearly release process now
<hoelzro> and they make a fair amount of improvements on each release
araujo has quit [Remote host closed the connection]
<bfrog> is there a geohash gem that works with 1.9
Eldariof-ru has quit [Ping timeout: 264 seconds]
<hoelzro> there's talk of including a "real object model" in a future release
<hoelzro> so maybe 5.20, or 5.22
nari has quit [Ping timeout: 260 seconds]
ackz has joined #ruby
Progster has quit [Ping timeout: 244 seconds]
fbernier has quit [Ping timeout: 260 seconds]
Progster has joined #ruby
thone_ has joined #ruby
Jbudal has joined #ruby
jxpx777 has joined #ruby
Jbudal is now known as juli0w
miho has quit [Read error: Connection reset by peer]
ChampS666 has quit []
juli0w has quit [Client Quit]
A124 has joined #ruby
juli0w has joined #ruby
thone has quit [Ping timeout: 265 seconds]
miho has joined #ruby
vitoravelino`afk is now known as vitoravelino
chomp has joined #ruby
ckrailo has joined #ruby
Progster has quit [Read error: Operation timed out]
MarquisDeMizzle has joined #ruby
araujo has joined #ruby
araujo has joined #ruby
araujo has quit [Changing host]
dr0p has quit [Remote host closed the connection]
mnaser has quit [Ping timeout: 244 seconds]
mnaser has joined #ruby
Progster has joined #ruby
araujo has quit [Quit: Leaving]
oooPaul has joined #ruby
IPGlider has quit []
<RLa> ramblex, finally it worked, as root
<RLa> no idea what i did, cleaned as much stuff from old tries and finally it worked
<RLa> black magic
TechCel has joined #ruby
Ethan has joined #ruby
Ethan has quit [Changing host]
Ethan has joined #ruby
dotnull has joined #ruby
d3vic3 has joined #ruby
eywu has joined #ruby
Progster has quit [Ping timeout: 260 seconds]
MarquisDeMizzle has quit [Quit: Leaving]
Progster has joined #ruby
schovi has joined #ruby
gilead has quit [Quit: Leaving]
sailias has joined #ruby
Morkel has quit [Quit: Morkel]
litheum has joined #ruby
TechCel has quit [Ping timeout: 248 seconds]
<ramblex> RLa: great, I guess something ended up with the wrong permissions somehow
lkba has joined #ruby
nirakara has quit [Quit: This computer has gone to sleep]
monkegjinni has quit [Remote host closed the connection]
yannis has joined #ruby
mnaser has quit [Ping timeout: 260 seconds]
itnomad has quit [Ping timeout: 276 seconds]
TechCel has joined #ruby
dr_diamond has quit [Quit: Bye !]
mnaser has joined #ruby
kevinbond has left #ruby [#ruby]
Doc_X has quit [Quit: Leaving.]
araujo has joined #ruby
andrewhl has quit [Remote host closed the connection]
monkegjinni has joined #ruby
Progster has quit [Ping timeout: 260 seconds]
mockra has joined #ruby
adeponte has quit [Remote host closed the connection]
kpshek has quit []
jgrevich has joined #ruby
d3vic3 has quit [Quit: leaving]
Progster has joined #ruby
mikepack has joined #ruby
TechCel has quit [Ping timeout: 260 seconds]
d3vic3 has joined #ruby
indian has joined #ruby
mockra has quit [Remote host closed the connection]
sspiff has quit [Remote host closed the connection]
wvms has quit [Quit: wvms]
mobilegamelabs has joined #ruby
theRoUS has quit [Ping timeout: 245 seconds]
mockra has joined #ruby
Doc_X has joined #ruby
larissa has quit [Quit: Saindo]
mockra has quit [Remote host closed the connection]
enroxorz has quit [Quit: Leaving]
<bfrog> I got it
qos has joined #ruby
<bfrog> man, people need to update their gem's
dwaynecrooks has quit [Ping timeout: 276 seconds]
<bfrog> stuff seems out of date using gem install these days
maesbn has joined #ruby
binaryplease has quit [Read error: Operation timed out]
kpshek has joined #ruby
ipoval has quit [Quit: ipoval]
carloslopes has quit [Ping timeout: 252 seconds]
xiaotian has joined #ruby
Progster has quit [Ping timeout: 265 seconds]
tentimes has joined #ruby
kenperkins has quit [Quit: Computer has gone to sleep.]
tentimes has quit [Client Quit]
tentimes_ has joined #ruby
maesbn has quit [Ping timeout: 245 seconds]
tentimes_ has quit [Client Quit]
freezey has joined #ruby
tentimes has joined #ruby
williamcotton has joined #ruby
xiaotian has quit [Quit: Computer has gone to sleep.]
wilmoore has joined #ruby
schovi has quit [Remote host closed the connection]
davidw has quit [Ping timeout: 245 seconds]
ringotwo has joined #ruby
hynkle has quit [Quit: hynkle]
jxpx777 has quit [Read error: Connection reset by peer]
apeiros_ has joined #ruby
jxpx777 has joined #ruby
mnaser has quit [Ping timeout: 272 seconds]
Enekoos has joined #ruby
Beoran_ has quit [Read error: Connection reset by peer]
v0n has quit [Remote host closed the connection]
jxpx777 has quit [Client Quit]
boo1 has quit [Ping timeout: 246 seconds]
punkrawkR has quit [Read error: Connection reset by peer]
andrewhl has joined #ruby
krz has quit [Ping timeout: 255 seconds]
tintin has joined #ruby
mnaser has joined #ruby
balki has joined #ruby
alanp has joined #ruby
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
foofoobar has quit [Quit: bb]
markab has joined #ruby
hakunin has joined #ruby
prometheus has joined #ruby
robotmay has quit [Remote host closed the connection]
<tintin> Anybody?
<hoelzro> tintin: hmm?
<tintin> I need to printf() the content or array, https://github.com/ruby/ruby/blob/trunk/array.c#L568
<tintin> I'm debugging this,
kpshek has quit []
<hoelzro> ah
t_j has joined #ruby
<t_j> anyone give me hints on how to clone a repo with rugged?
senny has quit [Remote host closed the connection]
Aaton_off is now known as Aaton
bricker88 has joined #ruby
baroquebobcat has joined #ruby
<Hanmac> tintin i think its not easy possible to "replace" the function ..
<tintin> Hanmac: Which function?
quest88 has joined #ruby
baroquebobcat has quit [Client Quit]
dekroning has quit [Ping timeout: 264 seconds]
<Hanmac> the rb_ary_initialize ... i dont think its is easy possible to replace it with gdb
beneggett has joined #ruby
dwaynecrooks has joined #ruby
dhruvasagar has joined #ruby
aantix has joined #ruby
<tintin> Hanmac: I'm not replacing rb_ary_initialize with gdb, rather i set a breakpoint there, and debuggin
Ontolog has joined #ruby
andreime has quit [Quit: Lost terminal]
<Hanmac> as far as i see in the thread you are trying to replace the default function with yours
dhruvasagar has quit [Client Quit]
adeponte has joined #ruby
schovi has joined #ruby
<shevy> got a question
<banisterfiend> i've replaced functions in the rubyruntime before, we some success
<banisterfiend> tintin: u need to use LD_PRELAOD
<shevy> I wrote a little game and want to make this a gem. there is one .rb file that will start that game
Beoran_ has joined #ruby
<shevy> shall I name this file "foo.rb" or rather "foo", without the '.rb' part? I suppose it should be put into bin/ subdirectory
<Hanmac> shevy without '.rb'
<shevy> kk
bradhe has quit [Remote host closed the connection]
<tintin> Hanmac: I just added switch to check type and printf to display the value
deryl has quit [Ping timeout: 265 seconds]
Khyron320 has joined #ruby
<Tasser> I can't use another object than a binding for erb? :-/
<tintin> banisterfiend: What is that LD_PRELOAD, how to use it?
<banisterfiend> tintin: google it
tentimes has quit [Quit: The early bird may get the worm, but the second mouse gets the cheese]
prometheus has quit [Ping timeout: 260 seconds]
fabrice31 has quit [Remote host closed the connection]
workmad3 has quit [Ping timeout: 255 seconds]
moshee has quit [Ping timeout: 265 seconds]
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
baroquebobcat has joined #ruby
kenperkins has joined #ruby
nateberkopec has joined #ruby
gks has joined #ruby
<tintin> Can't understand what to do with LD_PRELOAD
binaryplease has joined #ruby
<tintin> I searched though
jxf has joined #ruby
<shevy> tintin you can pre load .so libraries that way
<tintin> Why do i need some .so library now? What to do with this problem?
maletor has joined #ruby
quest88 has quit [Quit: quest88]
deryl has joined #ruby
carloslopes has joined #ruby
brianpWins has quit [Quit: brianpWins]
Lachryma has quit [Quit: Leaving]
gks has quit [Quit: Linkinus - http://linkinus.com]
Ontolog has quit [Ping timeout: 276 seconds]
Ontolog has joined #ruby
deryldoucette has joined #ruby
niklasb has joined #ruby
teampoop has joined #ruby
sadasd has joined #ruby
<teampoop> hi there.. I have an env quesiton.. I have a variable, CODAPATH set in my .bash_rc, but when I run a gem it's not picking up the ENV['CODAPATH']
<teampoop> any idea why?
itnomad has joined #ruby
<teampoop> when I echo $CODAPATH in terminal it echos just fine
deryl is now known as Guest60214
BeLucid has quit [Read error: Operation timed out]
nateberkopec has quit [Quit: Leaving...]
deryldoucette is now known as deryl
<shevy> teampoop did you export it
Guest60214 has quit [Ping timeout: 272 seconds]
<shevy> when you exported it, test in irb
<shevy> it will show up 100% in irb
xaq_ has joined #ruby
RLa has left #ruby ["Leaving"]
savage- has joined #ruby
sadasd has quit []
<teampoop> oh no.. thank you shevy!
mneorr3 has joined #ruby
kpshek has joined #ruby
Vert has joined #ruby
<shevy> \o/
mnaser has quit [Ping timeout: 240 seconds]
lxsameer has joined #ruby
xaq has quit [Ping timeout: 244 seconds]
mneorr2 has quit [Ping timeout: 246 seconds]
timonv has quit [Remote host closed the connection]
xaq has joined #ruby
mnaser has joined #ruby
rambda has joined #ruby
CheeToS has quit [Ping timeout: 250 seconds]
kenichi has joined #ruby
dhodgkin has joined #ruby
grendlme has quit [Quit: grendlme]
dhodgkin is now known as Guest80820
<rambda> quick question about Net::Telnet, is Prompt required? The equipment I'll be connecting to doesn't give any feedback that it's waiting for input...
<tcopp> /pa/
tcopp has left #ruby [#ruby]
xaq_ has quit [Ping timeout: 260 seconds]
akem has quit [Ping timeout: 265 seconds]
hoelzro is now known as hoelzro|away
Guest80820 is now known as dhodgkin
bradhe has joined #ruby
<shevy> rambda not sure, I think telnet usually did not display any prompt
<shevy> but under windows, with their telnet client, I think there was an option to display what one types at least
<shevy> hmm and in MUDs, the prompt usually was a '>'
ghanima has joined #ruby
darthdeus has quit [Quit: Leaving...]
cantonic_ has joined #ruby
freeayu has quit [Quit: 离开]
albemuth has joined #ruby
Juul has joined #ruby
cantonic has quit [Ping timeout: 240 seconds]
cantonic_ is now known as cantonic
axl_ has quit [Read error: Connection reset by peer]
wilmoore has quit [Remote host closed the connection]
cherrypeel has joined #ruby
zeade has joined #ruby
axl_ has joined #ruby
yannis has quit [Read error: Connection reset by peer]
nadirvardar has joined #ruby
brianpWins has joined #ruby
axl__ has joined #ruby
<shevy> got a question
<shevy> you see something like: https://rubygems.org/gems/ruport
<shevy> there you see about 6 Owners
<shevy> how to make owners to rubygems?
<shevy> (on a specific gem)
Vert has quit [Remote host closed the connection]
<tintin> That sucks
<tintin> Make one owner
axl_ has quit [Ping timeout: 264 seconds]
<shevy> I think they collaborate
<eam> I'd also like to know how to make multiple owners
apok has joined #ruby
boo1 has joined #ruby
axl_ has joined #ruby
tintin has left #ruby [#ruby]
<eam> shevy: looks like gem owner --add
dwaynecrooks has quit [Quit: Ex-Chat]
<shevy> aha!
lbostic has joined #ruby
<shevy> so a commandline command, ok
<shevy> ok that explains that nicely
axl__ has quit [Ping timeout: 276 seconds]
akem has joined #ruby
axl__ has joined #ruby
axl__ has quit [Read error: Connection reset by peer]
axl_ has quit [Ping timeout: 264 seconds]
axl_ has joined #ruby
ramblex has quit [Ping timeout: 276 seconds]
axl_ has quit [Read error: Connection reset by peer]
vitoravelino is now known as vitoravelino`afk
ghanima has quit [Quit: Leaving.]
tvw has quit [Remote host closed the connection]
fantazo has joined #ruby
saschagehlich has joined #ruby
d3vic3 has quit [Quit: leaving]
qos has quit [Quit: Leaving...]
miho has quit [Ping timeout: 252 seconds]
Desmond has joined #ruby
axl_ has joined #ruby
jrallison has joined #ruby
ilyam has joined #ruby
qos has joined #ruby
qos has quit [Remote host closed the connection]
twock has quit [Quit: Lost terminal]
virunga has quit [Read error: Connection reset by peer]
cuppsy has quit [Ping timeout: 260 seconds]
twinturbo_ has joined #ruby
bluenemo has quit [Remote host closed the connection]
qwerxy has quit [Ping timeout: 244 seconds]
iamlacroix has joined #ruby
cuppsy has joined #ruby
twinturbo has quit [Ping timeout: 276 seconds]
twinturbo_ is now known as twinturbo
daniel_hinojosa has joined #ruby
axl_ has quit [Read error: Connection reset by peer]
c0rn_ has joined #ruby
<jlogsdon> shevy: you add them to the authors part of the gemspec
<jlogsdon> oh wait
<jlogsdon> im dumb
<jlogsdon> sorry
carlyle has joined #ruby
<jlogsdon> reading the whole backlog is for chumps, i say
twinturbo has quit [Client Quit]
<shevy> hey it's efficient
<shevy> just digest information in small, little pieces :)
axl_ has joined #ruby
Niamkik has quit [Quit: leaving]
axl__ has joined #ruby
<CannedCorn> is anyone here really good at sinatra?
<CannedCorn> i'm trying to do Rack::Auth::Digest for a single route in my app
prometheus has joined #ruby
<CannedCorn> and there is barely any documentation on this
monkegjinni has quit [Remote host closed the connection]
heftig has quit [Ping timeout: 245 seconds]
Bosma has joined #ruby
`brendan has quit [Quit: - nbs-irc 2.39 - www.nbs-irc.net -]
<macmartine> HOw do I run all the unit tests files in a directory?
shadoi has joined #ruby
<norm> rspec ./path/to/dir
<macmartine> i'm not using rspec
axl__ has quit [Read error: Connection reset by peer]
axl_ has quit [Ping timeout: 272 seconds]
heftig has joined #ruby
Goles has joined #ruby
mwilson_ has quit [Excess Flood]
axl_ has joined #ruby
mwilson_ has joined #ruby
monkegjinni has joined #ruby
BeLucid has joined #ruby
<shevy> let's be bold - there is no way!
<macmartine> just wrote a rake task for it...
axl__ has joined #ruby
axl__ has quit [Read error: Connection reset by peer]
adamkittelson has joined #ruby
adamkittelson has quit [Remote host closed the connection]
xnm has joined #ruby
adamkittelson has joined #ruby
axl__ has joined #ruby
axl_ has quit [Ping timeout: 245 seconds]
axl__ is now known as axl_
jrist is now known as thomasckay
<shevy> oh man
thomasckay is now known as jrist
ianbrandt has joined #ruby
<shevy> I'd wish I could omit "end" in if/else constructs
g0bl1n has quit [Ping timeout: 264 seconds]
<ekaleido> you dont enjoy forgetting it, watching the app puke and then realizing "oh fuck, the end"?
roolo has quit [Quit: Linkinus - http://linkinus.com]
<shevy> no, it actually visually displeases me :(
<shevy> def foo; end
sailias has quit [Ping timeout: 264 seconds]
<shevy> that is kinda ok
<shevy> but to use if/else/end inside that method definition, that is what I dont like
tcopp has joined #ruby
ilyam has quit [Quit: ilyam]
<ekaleido> def foo
<ekaleido> if foo
<ekaleido> else foo
<ekaleido> end
<ekaleido> end
<ekaleido> :D
<shadoi> shevy: foo ? blah : blargh
t_j has left #ruby [#ruby]
axl_ has quit [Read error: Connection reset by peer]
<jlogsdon> doesn't always fit what you're doing
<jlogsdon> i try and stay away from ternary unless its a very simple conditional
<shevy> yeah
<shadoi> shevy: or…. "do_somthing if foo", rinse repeat
<jlogsdon> breaks DRY
<jlogsdon> do_something if foo; do_something_else unless foo;
<shevy> it at least gets rid of the "end" though :)
<jlogsdon> that it does
<shadoi> jlogsdon: if that's not DRY I don't give a shit. :)
<jlogsdon> i like how you can rescue a method without the begin
<shevy> cant there be mixed indent?
<cout> shevy: you could use python
axl__ has joined #ruby
<shevy> I cant stand python
<cout> but it doesn't have end
<shevy> hmm that is not true
<cout> you shold love it!
<jlogsdon> haha
<shevy> I dislike a few choices
<shevy> like explicit self
<centipedefarmer> (foo && do_something; true) || do_something_else :D
<jlogsdon> beautiful
<jlogsdon> im going to use that in everything
<shevy> hehe
<centipedefarmer> haven't actually tried that
<centipedefarmer> could potentially open a black hole or something
<cout> smalltalky: (foo).ifTrue { xxx }.ifFalse { yyy }
<centipedefarmer> might need more parens: (foo && (do_something; true)) || do_something_else
<shevy> wasn't there a project once for ruby to allow omitting of end?
<centipedefarmer> oh yeah, moneypatch an ifTrue and ifFalse method onto TrueClass and FalseClass
<centipedefarmer> i think i saw that in a blog post somewhere
<shevy> moneypatch? is it costly?
<centipedefarmer> lol
<centipedefarmer> i need a moneypatch
hynkle has joined #ruby
<centipedefarmer> it's like a nicotine patch for the profligate
<shevy> I think I saw ifTrue before too, in ruby... dont quite remember where
<shevy> I need to write these things down...
<jlogsdon> ha yeah centipedefarmer that doesn't work D:
<jlogsdon> the semi-colon messes with it
<centipedefarmer> yeah probably
<shevy> how would ifTrue and ifFalse affect the thinking patterns?
axl__ has quit [Read error: Connection reset by peer]
<shevy> oh well. "if" is kinda shorter
<cout> you'd get used to it I'm sure
axl_ has joined #ruby
<shevy> cool
<CannedCorn> dudes?
<jlogsdon> bos
<jlogsdon> bros*
<shevy> wat is it girl
axl_ has quit [Read error: Connection reset by peer]
axl_ has joined #ruby
axl_ has quit [Read error: Connection reset by peer]
enroxorz has joined #ruby
enroxorz has quit [Changing host]
enroxorz has joined #ruby
mrsolo has joined #ruby
axl_ has joined #ruby
binaryplease has quit [Quit: WeeChat 0.3.8]
krusty_ar has quit [Read error: Connection reset by peer]
axiak has left #ruby [#ruby]
axl_ has quit [Read error: Connection reset by peer]
krusty_ar has joined #ruby
ilyam has joined #ruby
narshlob has joined #ruby
axl_ has joined #ruby
axl_ has quit [Read error: Connection reset by peer]
voodoofish430 has joined #ruby
jxf has quit [Ping timeout: 272 seconds]
davidcelis has quit [Ping timeout: 245 seconds]
jrist is now known as jrist-gym
axl_ has joined #ruby
litheum has left #ruby [#ruby]
jeff_sebring has quit [Remote host closed the connection]
musee has quit [Ping timeout: 250 seconds]
A124 has quit [Quit: Leaving.]
axl_ has quit [Read error: Connection reset by peer]
mirash has joined #ruby
axl_ has joined #ruby
kirun has joined #ruby
ph^ has quit [Remote host closed the connection]
axl_ has quit [Read error: Connection reset by peer]
ph^ has joined #ruby
musee has joined #ruby
axl_ has joined #ruby
xclite has quit [Remote host closed the connection]
lxsameer has quit [Quit: Leaving]
indian has quit [Ping timeout: 245 seconds]
blacktulip has quit [Remote host closed the connection]
mirash has quit [Quit: Leaving]
<enroxorz> #rails
boo1 has left #ruby [#ruby]
ph^ has quit [Ping timeout: 276 seconds]
axl_ has quit [Quit: axl_]
saschagehlich has quit [Quit: saschagehlich]
rambda has quit [Quit: Lost terminal]
kenichi has quit [Remote host closed the connection]
CannedCorn has quit [Ping timeout: 244 seconds]
kenichi has joined #ruby
<shevy> #worlddomination
<enroxorz> #deathtocapitalists
<enroxorz> lol. sorry
<enroxorz> i was trying to get a rails answer and my stupid client wasnt fully in focus
dotnull has quit [Read error: No route to host]
Enekoos has quit [Quit: Saliendo]
A124 has joined #ruby
A124 has left #ruby [#ruby]
pdtpatrick has joined #ruby
DrShoggoth has quit [Quit: Leaving]
<beneggett> how do i better write: [ Date.today.year, Date.today.year + 1, Date.today.year + 2] up until Date.today.year + 10 in an array
snip_it__ has joined #ruby
<beneggett> .. in RoR
mnaser has quit [Ping timeout: 244 seconds]
<apeiros_> today = Date.today; Array.new(10) { |i| today+i }
b26 has joined #ruby
<beneggett> thanks apeiros_
mnaser has joined #ruby
snip_it_ has quit [Ping timeout: 265 seconds]
trend has joined #ruby
<wunz> you can use .upto(#) as well no?
<Hanmac> 10.times.with_object(Date.today).map {|i,d|d+i}
<My_Hearing> There are probably tens of ways to do it
<wunz> today = Date.today; 10.times { |i| today+i }
My_Hearing is now known as Mon_Ouie
<wunz> yea, thats what i love about ruby
<Mon_Ouie> You need to call #map too though
<Mon_Ouie> I still prefer the Array.new way
<Hanmac> but when you only want the years: 10.times.map(&Date.today.year.method(:+))
<Mon_Ouie> You must really hate blocks
b26 is now known as brendan`
xclite has joined #ruby
<Hanmac> Mon_Ouie do you mean me?
wallerdev has joined #ruby
<Hanmac> nono i LOVE blocks, but i know that &stuff is faster
<Mon_Ouie> Yeah. It seems so much more natural just to do 10.times.map { |n| Date.today.year + n }
<apeiros_> Hanmac: depends
<eam> I like (1..10).map
luckyruby has joined #ruby
<Mon_Ouie> (1..10) != 10.times though
chienpo has joined #ruby
akem has quit [Read error: Connection reset by peer]
<eam> Mon_Ouie: how do you figure?
<Mon_Ouie> (10.times iterate from 0 to 9, not 1 to 10)
Drewch has joined #ruby
mnaser has quit [Ping timeout: 260 seconds]
tvw has joined #ruby
<eam> Mon_Ouie: well that's what he asked for above
<eam> wasn't it?
akem has joined #ruby
<eam> Mon_Ouie: either way, 0..9 :)
<Mon_Ouie> I think he wanted 0..10 actually
<eam> expressing the start and end of the sequence is better than "X.times"
<luckyruby> I have a script that outputs data to a file. If I run into an exception midway through, how do I take care of deleting the file I've already opened for writing, since it's only partially complete?
<eam> because the indices are explicit
<luckyruby> is it as simple as removing the file in rescue?
mnaser has joined #ruby
<eam> luckyruby: probably yes
rippa has joined #ruby
<Mon_Ouie> Maybe ensure if you need to remove the file when you're done with it even if no error occured
<Mon_Ouie> (Ok, actually that makes no sense, nvm)
davidcelis has joined #ruby
Axsuul has joined #ruby
<shadoi> Anyone else used PacketFu::StructFu?
banghouse has quit [Remote host closed the connection]
arussel` has left #ruby ["ERC Version 5.3 (IRC client for Emacs)"]
Jake232 has joined #ruby
jxpx777 has joined #ruby
hynkle has quit [Read error: Connection reset by peer]
mnaser has quit [Ping timeout: 240 seconds]
xaitec has joined #ruby
lbostic1 has joined #ruby
<xaitec> Has anyone used brightened on ubuntu
tintin has joined #ruby
<tintin> Anybody?
lbostic has quit [Quit: Page closed]
<xaitec> Brightbox
mnaser has joined #ruby
<tintin> Has anyone worked with ruby source code?
<lbostic1> How do you use a class within another class? I tried to require the class file but got an error "cannot load file"
Juul has quit [Ping timeout: 276 seconds]
<shevy> lbostic1 you mean you have problem to require the file
<shevy> lbostic1 how do you try to require the file
<davidcelis> tintin: where's snowy
<shevy> require_relative should work on 1.9.x
<lbostic1> I guess... did know if I was doing it wrong
<lbostic1> Require_relative? What does that do?
SQLStud has joined #ruby
<tintin> davidcelis: snowy is crying , because none can solve my problem
<lbostic1> I did it this way: require 'class file name.rb'
mobilegamelabs has quit [Ping timeout: 252 seconds]
<lbostic1> Within the class
<RubyPanther> rb_funcall(tintin, rb_intern("solve"), 0);
<tintin> Can anyone help me to solve my problem?
<tintin> Would i ask my question here?
xaitec has left #ruby ["AndroIRC"]
<tintin> It's a very complex problem.
<tintin> I'm afraid anyone can solve it
<RubyPanther> You should if you could, but I don't know if you would.
Goles has quit [Quit: Bye]
<tintin> Most of the people only use ruby here, i don't know if they work with the ruby source code
<tintin> that is in C
<RubyPanther> People talk about Ruby C all the time, do not be frightened
<tintin> RubyPanther: You can be RubyPanther , but i need someone like CPanther
hynkle has joined #ruby
<RubyPanther> tintin: http://rubypanther.com/
<tintin> Ok, there you go, this is the problem
<shevy> lbostic1 require the filename
imami|afk is now known as banseljaj
<shevy> lbostic1 if the filename is "santa_claus.rb" then you must require that name
sailias has joined #ruby
<lbostic1> That is what I did
<shevy> lbostic1 our file name is 'class file name.rb' ? with the ' ' ?
mengu has joined #ruby
<shevy> are you on windows :)
beneggett has quit [Remote host closed the connection]
<lbostic1> yes
<shevy> aaaah
<shevy> ok I see
nadirvardar has quit [Ping timeout: 246 seconds]
<shevy> make some test file, call it foo.rb, in irb you should be able to do: load 'foo.rb'
<shevy> then you know that loading a file works
<lbostic1> ok
<shevy> next step is to either use require_relative 'foo.rb' instead, or to add the load path
<shevy> like so:
<shevy> $: << File.dirname(__FILE__)
<shevy> that appends to $:
<shevy> in irb, you can also do:
<lbostic1> I specified the full path name and it still failed
<shevy> require 'pp'; pp $:
<shevy> did you use load
<lbostic1> no
<shevy> did you skip some of my steps ;P
<lbostic1> let me try all these first
<shevy> we need to work on things that are sure to work for you first
<lbostic1> I was just sharing what I did previously
<shevy> load() should work
<lbostic1> I'll try it
beneggett has joined #ruby
<lbostic1> thx!
araujo has quit [Quit: Leaving]
SiliconDon has joined #ruby
fermion has quit [Quit: P]
<shevy> ok load works?
<shevy> you should then test require, which will fail I suppose, but require_relative should work
dnyy has joined #ruby
<shevy> after that, try the $: << File.dirname(__FILE__) trick
<shevy> or perhaps
trend has quit [Read error: Connection reset by peer]
<shevy> $: << File.dirname(Dir.pwd)
trend has joined #ruby
<shevy> I dont remember, I added so much to my irbrc
<lbostic1> Shevy: still got "No such file to load"
<shevy> via require right?
<tintin> RubyPanther: Any idea?
<tintin> davidcelis: Any idea?
<shevy> lbostic1, this is because the current dir is not in the path where ruby looks for by default
<shevy> do pp $:
<RubyPanther> tintin: yeah, 2 of them. one is, are you sure it is a long not an int? And the other is, why do you convert it to a NUM if you want to print it with the C printf?
jxpx777 has quit [Quit: Be back later]
<tintin> RubyPanther: What should i do?
<RubyPanther> "Should" is rather broad
samuel02 has quit [Remote host closed the connection]
<RubyPanther> IMO you probably "should" just leave the arrays as Ruby objects and pull the C values out through the Ruby API instead of trying to juggle C arrays
selvakumaran has joined #ruby
flakrat has quit [Quit: Leaving]
araujo has joined #ruby
jcromartie has joined #ruby
<lbostic1> I am using RubyMine not irb Should not matter but just thought you should know.
<RubyPanther> I mean you have Ruby sitting right there, let it do the stuff it is good at, and let the C parts just be glue
Bosma has quit [Quit: leaving]
<tintin> RubyPanther: Can you pastebin the code?
<bnagy> tintin: still trollin?
<RubyPanther> I am not going to write it, I already have a bunch of Ruby C open in emacs :P
<bnagy> hopefully you die of cancer soon
<RubyPanther> Thanks to mRuby and RiteVM I'm busy trying to learn Ruby ASM
beneggett has quit [Ping timeout: 240 seconds]
<shevy> yay
<bnagy> all - there is a reason tintin is banned on ruby-lang
<shevy> not only RubyPanther is back, he'll also use mRuby!
<shevy> I used mirb
<shevy> and I can not load or require anything with it
<shevy> :(
<RubyPanther> Wait, I was talking up mRuby long before we had the code :)
<shevy> but 5+5 works... so mirb is 50% functional
<tintin> RubyPanther: I could not understand what you said me to do.
<RubyPanther> Yeah, that is the big question... what are we going to do instead of rubygems
<shevy> dunno
<shevy> matz will go to the state before rubygems existed
<shevy> ;)
<shevy> and autoload won't be in mruby either
<shevy> haha
<tintin> bnagy: Still trollin?
<RubyPanther> Perhaps there is need for some sort of rubygems-replacement for RiteVM binaries
Bosma has joined #ruby
<tintin> RubyPanther: I could not understand what you said me to do. Can you show example code?
elux has joined #ruby
* tintin is going to eat.
<elux> hey guys
niklasb has quit [Ping timeout: 245 seconds]
<elux> do people here use thor..? i was wondering why this example doesn't work.. https://gist.github.com/2974508 / http://stackoverflow.com/questions/6561912/ruby-thor-based-executable-with-namespaces
<elux> looks like the author on stackoverflow shows the output of this working.. but maybe something with namespacing in thor has changed since then?
<RubyPanther> tintin: for example instead of doing RARRAY_PTR(ary) ... you could use rb_funcall(ary,rb_intern("some_ruby_method_on_Array"),0)
<Jackneill> can you help me? i cant install a gem.... no error, just in the end it wouldnt install it. but i get the correct messages...
ph^ has joined #ruby
<RubyPanther> If all the messages are correct, everything is working.
<lbostic1> Shevy: RubyMine has a setting for load path. This is already set for the directory where the code is.
<lbostic1> Question when I specify the require should it be in the class or be fore the class or does it matter
yankhates has quit [Ping timeout: 245 seconds]
Guest43828 has quit [Ping timeout: 260 seconds]
<Jackneill> rubypanther: when i do gem list or gem1.8 list i get only 1 gem: rake
<shevy> lbostic1 I have no idea what is RubyMine
<Jackneill> so its not working, i am using ubuntu 12.04
tvw has quit [Remote host closed the connection]
<shevy> I would not trust things like RubyMine too much if I were you
<lbostic1> It is an IDE made by JetBrains
<shevy> lbostic1, it does not matter much where the require happens
<shevy> usually it comes bundled right at the top of the file
<lbostic1> made just for Ruby
cuppsy has quit [Read error: Connection reset by peer]
jgarvey has joined #ruby
ghanima has joined #ruby
<RubyPanther> require goes at the start unless it is conditional, then it may or may not go somewhere else
visof has quit [Ping timeout: 276 seconds]
<lbostic1> This is really a simple thing ... I am sure there is a stupid reason why it is not working
monkegjinni has quit [Remote host closed the connection]
yankhates has joined #ruby
<lbostic1> Should I package it in a module or something?
pcboy_ has quit [Ping timeout: 246 seconds]
<Jackneill> rubypanther im not as pro any idea what should i do?
digitalcakestudi has quit [Quit: Leaving.]
<RubyPanther> Jackneill: well the first question is, are you using rvm or rbenv or the system ruby, and the second question is, did you run gem install as root?
pcboy_ has joined #ruby
jrist-gym is now known as jrist
<Jackneill> rubypanther: i use rvm, and yes, root.
itnomad has quit [Quit: Leaving]
<Jackneill> cause i need to be as root
<Jackneill> cause permissions..
<shevy> the superuser
<shevy> superman is superuser all the time
<shevy> he laughs about sudo
<lbostic1> Shevy: this is my structure : class foo require 'TheClassFileIWantToUse' cls = TheClass.new end ... would this be correct?
jekhokie has quit [Ping timeout: 264 seconds]
<Hanmac> until he installs bumblebee
<Jackneill> sudo su ?
<shevy> lbostic1 but it at the top
<shevy> lbostic1 also, I wrote it before, require alone like this wont work, unless you installed it into the SITE PATH of ruby
pu22l3r_ has quit [Ping timeout: 272 seconds]
cuppsy has joined #ruby
<Jackneill> hm interesting
<RubyPanther> Jackneill: normally it would be system gem and run as root, or rvm and run as user... you might have to reload rvm or exit the shell and open a new one
<Jackneill> in sudo su, when i do gem list i got the colorize lib, and many others.
atmosx has quit [Ping timeout: 276 seconds]
<RubyPanther> Jackneill: you might have to install it like sudo /path/to/rvmruby/gem instead of just sudo gem
<RubyPanther> I think there is some rvm shortcut for that case
<Jackneill> hm
<RubyPanther> presumably /usr/bin/gem list shows the one you installed
ilyam has quit [Quit: ilyam]
atmosx has joined #ruby
<Jackneill> rubypanther: /home/jackneill/.rvm/gems ?
<Jackneill> yes it does shows that one
wargasm has quit [Read error: No route to host]
<RubyPanther> Jackneill: "which gem" as the user should tell you the correct path
<Jackneill> /usr/share/ruby-rvm/rubies/ruby-1.9.3-head/bin/gem
<Hanmac> giggles about rvm errors :P
<shevy> :)
uris has quit [Ping timeout: 246 seconds]
<shevy> if debian wouldn't be run by monkeys, less people would feel the need to use rvm :P
<Jackneill> /usr/share/ruby-rvm/rubies/ruby-1.9.3-head/bin/gem install colorize also wants sudo is ot ok?
<Hanmac> shevy my ubuntu version is 12.10
<Hanmac> so outdated packages are not possible for me XD
<lbostic1> Shevy : hmmm don't have a SITE PATH env var to set...
<RubyPanther> Jackneill: sure, but normally you do not install rvm stuff as root you install everything as the user
<shevy> lbostic1, no the default path for ruby to look for addons
dnyy has quit [Read error: Connection reset by peer]
<shevy> lbostic1, when you install a project called "foobar", there is usually a directory called foobar/ in your site path dir for ruby
<shevy> I am not sure where it is for windows
<Jackneill> rubypanther: yes and thank you, now i got the colorize lib from gem lis
<Jackneill> list*
<shevy> here for me it is at /Programs/Ruby/Current/lib/ruby/site_ruby/1.9.1/
<RubyPanther> shevy: I switched to rbenv and am happier, but I'm also a Fedora user so...
<Jackneill> and it works so thanks again
* Hanmac smells mac path
<shevy> lbostic1, SITE_PATH = INSTALLATION_PREFIX/lib/ruby/site_ruby/1.9.1/
<RubyPanther> yay! works!
<shevy> Hanmac gobolinux
<shevy> I am still sad that it died :(
<lbostic1> ok I'll give it a shot
<shevy> lbostic1 when a .rb file is there, require should work just fine from anywhere you are at
<shevy> like if you are in /tmp, and start irb, require 'foobar' should then work
araujo has quit [Quit: Leaving]
<shevy> lbostic1, but as said before, you can use load or require_relative too
tintin has quit [Quit: tintin]
enroxorz has quit [Quit: Leaving]
wargasm has joined #ruby
<lbostic1> That was what I was thinking ... simple... I am doing something stupid... I'll figure it out... hopefully soon
<shevy> lbostic1 well. load worked for ya, right? if you are in the same dir you should be able to... hmm
werdnativ has joined #ruby
<shevy> lbostic1, if you are in the same dir, this works too:
<shevy> require './foobar.rb'
<lbostic1> no I got an error... I was just thanking for the suggestion... I pay in advance ;)
graspee has joined #ruby
<lbostic1> Shevy: I just need to step back it will come to me... thx for the suggestions .. something will click
lbostic1 has left #ruby [#ruby]
araujo has joined #ruby
hynkle has quit [Read error: Connection reset by peer]
vitoravelino`afk is now known as vitoravelino
mayankkohaley has joined #ruby
Criztian_ has joined #ruby
Criztian_ has quit [Read error: Connection reset by peer]
beneggett has joined #ruby
Criztian_ has joined #ruby
Criztian has quit [Ping timeout: 276 seconds]
samuel02 has joined #ruby
hynkle has joined #ruby
novochar has joined #ruby
akem has quit [Ping timeout: 250 seconds]
subr00t has joined #ruby
ramblex has joined #ruby
Jackneill has quit [Read error: Connection reset by peer]
banghouse has joined #ruby
akem has joined #ruby
<Tasser> [1] pry(main)> morph = IO.popen("lt-proc morph.bin"); morph.puts("udin"); morph.read
<Tasser> IOError: not opened for writing
<Tasser> hm?
dnyy has joined #ruby
selvakumaran has quit [Ping timeout: 276 seconds]
<xclite> exactly what it says
<xclite> you opened it for reading
<xclite> which is the default
<xclite> in your open, send a "w" as your second flag
Niamkik has joined #ruby
<Hanmac> xclite you missread it, its popen and not open
<xclite> Hanmac: which still takes a mode?
gks has joined #ruby
<shevy> popen(cmd, mode="r" [, opt]) ? io
<shevy> popen(cmd, mode="r" [, opt]) {|io| block } ? obj
jgrep has joined #ruby
<gks> I'm trying to use Pry in a very basic script just to test it out. however, i'm getting this error
<gks> test.rb:3:in `require': no such file to load -- pry (LoadError)
<gks> from test.rb:3
Bosma has quit [Quit: leaving]
<gks> already did 'gem install pry'. I can type "pry" at the commandline and it works well. but i can't seem to use it in a script. any ideas?
<xclite> gks: it would help to know what you mean when you say you can't seem to use it in a script
<xclite> gks: is there an error?
<gks> posted the error
Karmaon has quit [Remote host closed the connection]
<xclite> gks: ah sorry
<xclite> gks: I started reading after your problem
<shevy> what ruby version
<xclite> gks: which version are you in?
<gks> 1.8.7, default ruby on Lion
<xclite> gks: prior to 1.9.1 I think you need to require 'rubygems'
Karmaon has joined #ruby
<shevy> aha
<shevy> try that :)
tylersanders has joined #ruby
<gks> yea, that works
<gks> thanks :)
<gks> stupid ass apple
jonathanwallace has quit [Remote host closed the connection]
<xclite> eh
<xclite> that's not apple haha
<bnagy> s/apple/gks/
<xclite> just an older version
<gks> well, it's apple for not including something more modern
<xclite> 1.8.7 is the default a lot of places
<xclite> just happens to be a change
<gks> understood, doesn't make it any less frustrating :)
<xclite> that's true
<xclite> i've done a fair amount of head slamming over version differences (Damn you, Debian!)
<bnagy> which gives you total license to talk shit
<shevy> debian must die
rbanffy has joined #ruby
<Hanmac> but 1.8 first
<bnagy> OMG the world frustrated me... ASSIGN BLAME
<shevy> "other people interested in installing their own version of Ruby (through RVM"
<gks> bnagy: you seem to have issues with people venting their frustrations
<shevy> if debian would work, 80% less people would use RVM
<shevy> 1.8 is indeed kinda dead
DrShoggoth has joined #ruby
tylersanders has left #ruby [#ruby]
<shevy> gks you use a dead ruby :)
<bnagy> gks: no only with people making retarded, unjustified statements that make them look like idiots
hynkle has quit [Quit: hynkle]
Karmaon has quit [Remote host closed the connection]
<gks> bnagy: cool, there's an ignore feature on irc. you're on mine for being a dick
xnm has quit [Read error: Connection reset by peer]
<bnagy> oh these bitter tears I weep
<xclite> shevy: agreed with 80% haha
Karmaon has joined #ruby
<bnagy> which of course you don't see
<bnagy> since you have ignored me
<bnagy> I feel a little guilty now
<bnagy> like.. when you tease retarded people
kpshek has quit []
<bnagy> and then feel secretly good about it
<bnagy> ach shadenfreude
tspy has joined #ruby
cwd1 has joined #ruby
robert_ has joined #ruby
Niamkik has quit [Quit: leaving]
yankhates has quit [Ping timeout: 245 seconds]
robert_ has quit [Ping timeout: 265 seconds]
elux has quit [Quit: Bye!]
litheum has joined #ruby
<eam> 1.8 isn't dead -- it's probably the most widely used version family
<eam> as it's the default on pretty much everything
nanderoo has quit [Quit: Leaving.]
Occult has joined #ruby
jrist is now known as jrist-afk
zeromodulus has quit [Remote host closed the connection]
<Hanmac> eam then we need euthanasia to accel the process :P
<eam> sure, just pointing out the gap between wishful thinking and reality
s0ber_ has joined #ruby
cwd1 has quit [Remote host closed the connection]
<eam> gks is pretty spot-on, in my opinion
<gks> i get that it's widely used... i just don't get why there's such a hold back on old versions
<gks> it isn't as bad as Python
wangr has quit [Read error: Connection reset by peer]
<gks> but it still sucks
bearlulz has joined #ruby
bearlulz has quit [Client Quit]
tshine has joined #ruby
bearlulz has joined #ruby
user__ has joined #ruby
s0ber has quit [Ping timeout: 272 seconds]
s0ber_ is now known as s0ber
federic has quit [Remote host closed the connection]
tshine_ has quit [Read error: Connection reset by peer]
user__ has quit [Max SendQ exceeded]
<bricker88> quick, how do I check the version of nginx running on centos
<gks> nginx --version i believe. could be nginx -v
user__ has joined #ruby
mockra has joined #ruby
user__ has quit [Max SendQ exceeded]
user__ has joined #ruby
akem has quit [Ping timeout: 250 seconds]
cwang has joined #ruby
<gks> bricker88: it's nginx -v
<bricker88> gks: the nginx executable is at /etc/init.d/nginx, but that doesn't have a -v option
<bricker88> I guess it was installed via yum on this system
yankhates has joined #ruby
<gks> err, you sure it's in /etc/? that is probably just the shell script that launches it on boot
<gks> it's probably in /usr/bin or /usr/local/bin
<bricker88> gks: You're probably right - I just don't know where the actual one is
<bricker88> okay I'll look there
monkegjinni has joined #ruby
<gks> i'm not familiar with rpm or yum. but you could use that to tell you where it was installed
<gks> you could also open the shell script and check there
<bricker88> good idea
<bricker88> thank you
<gks> it has to have the full path to the executable
<bricker88> good idea
KaOSoFt has joined #ruby
makkura has quit [Remote host closed the connection]
tcopp has left #ruby [#ruby]
<KaOSoFt> Hello there.
* offby1 checks his wallet
chico_chicote has joined #ruby
<KaOSoFt> I’m curious. While doing something like “gem spec -r” to gems like RedCloth, serve and goliath, I get garbled text in most places where there should be a summary or a gem dependancy name. Is it just me?
gks has quit [Quit: Linkinus - http://linkinus.com]
<KaOSoFt> It works as intended with other gems.
<offby1> no idea :-|
<KaOSoFt> offby1, can you try it yourself? gem spec -r goliath
<offby1> I wonder if the garbling could be either a) escape codes to colorize the output; or b) non-ASCII characters
<offby1> hm, let's see
vlad_starkov has quit [Remote host closed the connection]
kenichi has quit [Remote host closed the connection]
<KaOSoFt> Never happened to me, and I think I had used RedCloth in the past.
<offby1> I don't see anything weird, offhand
<offby1> just a couple of long numbers preceded by an ampersand
visof has joined #ruby
<KaOSoFt> Try the summary, at the end of the response.
<KaOSoFt> This is my goliath summary: “QXN5bmMgZnJhbWV3b3JrIGZvciB3cml0aW5nIEFQSSBzZXJ2ZXJz”
Gavilan has joined #ruby
<KaOSoFt> How weird. Oh, well, I just wanted to check that it wasn’t just me.
kenichi has joined #ruby
stephenjudkins has joined #ruby
Ethan has quit [Ping timeout: 276 seconds]
ryan0x2_ has joined #ruby
<Xethron> Heya. I have a prepared SQL statement. But its being generated based on conditions. Meaning I don't know what the end SQL will look like. How can I add the relevant variables to the excecute ( ) command?
<Xethron> Like, there might be only two variables - excecute ( var1, var2 ) - or there might be none - excecute ( ) -or there might be more.......
<Xethron> But seeing as they aren't added in a single string line, I am not sure how to handle it :/
<Xethron> unlike the sql...
mnaser has quit [Ping timeout: 276 seconds]
<offby1> KaOSoFt: summary: Async framework for writing API servers
mnaser has joined #ruby
<stephenjudkins> Xethron: you haven't mentioned what library you're using to access the DB. the answer depends almost entirely on that.
<Xethron> stephenjudkins: My apologies
<KaOSoFt> Okay... now I am curious, given it’s only a handful with such response. In any case, thanks for confirming my doubts, offby1. :)
<Xethron> the MySQL lib
graspee has quit [Quit: leaving]
<stephenjudkins> Xethron: oh, you're just asking for varargs. nevermind
<stephenjudkins> execute(*array_of_arguments)
<Xethron> stephenjudkins: Thanks! :D
stat1x has quit [Remote host closed the connection]
<chico_chicote> hey guys, can someone explain to me why this does not work? http://pastie.org/private/end6hggt87lhdoeliarrww
tshine has quit [Ping timeout: 264 seconds]
chuck is now known as cmelbye
stat1x has joined #ruby
visof has quit [Ping timeout: 276 seconds]
tewecske has joined #ruby
cjs226 has joined #ruby
fivre has joined #ruby
ph^ has quit [Remote host closed the connection]
etehtsea has quit []
ph^ has joined #ruby
aantix has quit [Ping timeout: 276 seconds]
user__ has quit [Ping timeout: 265 seconds]
<elektronaut> chico_chicote: why not do something like this? https://gist.github.com/8ea56e509926f087dddf
KaOSoFt has left #ruby [#ruby]
<fivre> I've got bundler-1.1.4 in a dir, and set $GEM_HOME=dir, but ruby is complaining that it can't find bundler. What am I doing wrong?
locriani has quit [Changing host]
locriani has joined #ruby
beneggett has quit [Quit: Computer has gone to sleep.]
tommyvyo has joined #ruby
mpereira has quit [Ping timeout: 260 seconds]
locriani has quit [Quit: Leaving...]
aantix has joined #ruby
akem has joined #ruby
locriani has joined #ruby
<chico_chicote> elektronaut: your solution is way clearer, but instance_eval should work in this case, shouldn't it?
akem has quit [Max SendQ exceeded]
Enekoos has joined #ruby
Ethan has joined #ruby
Ethan has quit [Changing host]
Ethan has joined #ruby
project2501a has joined #ruby
akem has joined #ruby
<apeiros_> chico_chicote: the instance_eval will define the attr_accessor as if you'd written it in the clas
<apeiros_> *class
<apeiros_> i.e., it created an instance method, not a class method.
ph^ has quit [Ping timeout: 255 seconds]
<apeiros_> also, self.included hacks should be avoided.
<eka> chico_chicote: cause you are doing instance_eval and then calling it at class level? try r = RandomClass.new; r.random....
<elektronaut> chico_chicote: this works: https://gist.github.com/b94de7076d591315d54b
<apeiros_> elektronaut's solution is much nicer
<project2501a> *wave* hihihi. i am reading the o'reilly book. question: i see a var declared here cash = 1000.00 does that mean that ruby will remember that as float and will keep only the two more significant floats?
<apeiros_> elektronaut: could just write class << klass directly.
<elektronaut> true
<shevy> project2501a no, only one
<shevy> it will be 1000.0
gyre007 has quit [Quit: Ex-Chat]
<shevy> dunno if there is a "scientific calculation" mode for ruby
<apeiros_> um, no shevy
<apeiros_> and no project2501a
<chico_chicote> apeiros_: if i did a class_eval, would it work then?
burgestrand has joined #ruby
<apeiros_> 1000.00 is just a float. with float precision.
<project2501a> single precision?
<apeiros_> native double
<project2501a> hokay!
<project2501a> thank you!
<apeiros_> so `cash = 1000.00` is actually a very bad example
<apeiros_> since floats & currency == horrible idea
geekbri has quit [Remote host closed the connection]
<project2501a> you can have apeira cash
<Xethron> stephenjudkins: should I just go "array_of_arguments = Array.new" / "array_of_arguments[0] = var1" / "array_of_arguments[1] = var2" / "array_of_arguments[2] = var3" / "execute(*array_of_arguments)"
<apeiros_> see BigDecimal (stdlib) or Monetary (gem)
<chico_chicote> well, any recommended readings for metaprogramming? it'd be nice to grok this
niku4i has joined #ruby
fivre has left #ruby [#ruby]
<project2501a> apeiraos, rtfming already
<Hanmac> shevy do you mean like this? 3.5e10 ?
<apeiros_> project2501a: you can tab-complete nicks in almost all chat clients
kaneda has joined #ruby
<apeiros_> avoids typos
<stephenjudkins> Xethron: well, that would technically work... but that's a terrible way to build an array
<shevy> Hanmac no I meant if you weigh something and need the least significant amount
<project2501a> apeiros_: what typo?
kaneda is now known as Guest65264
<Xethron> stephenjudkins: That is?
<stephenjudkins> Xethron: yes
<apeiros_> project2501a: apeiraos != apeiros_
<Xethron> stephenjudkins: whats a better way?
<project2501a> i said "apeira"
<shevy> apeiraos is a pharao of old egypt
<project2501a> I'm Greek dude :P
<stephenjudkins> so... [var1, var2, var3] is much more readable and less code
<project2501a> that was no typo
<apeiros_> project2501a: um, no, `22:41 project2501a: apeiraos, rtfming already ` is apeiraos
<shevy> project2501a man why did you lose in soccer against germany ;(
<project2501a> ah. *that* typo
<project2501a> r.
<stephenjudkins> but you should be building enumerable object through #map, #select from other enumerables
<project2501a> shevy: we owe them money
<Xethron> stephenjudkins, yes, but they are added under if statements, so its not all done in one line.......
<project2501a> if we done, they would have raised interest rates
<Tasser> shevy, well, germany kinda owns the greeks
<project2501a> fucking autocorrect
berserkr has quit [Quit: Leaving.]
<luckyruby> I'm using File.open to write a file. If I write to a directory that doesn't exist, I get no such file or directory exists (no surprise here). How do I make it so if a directory doesn't exist, create that directory and retry? Should I just use rescue with a system call to mkdir -p followed by a retry?
<project2501a> s/done/won/
<apeiros_> project2501a: lol @ autocorrect
<project2501a> apeiros_: anyway, thank you.
<shevy> hehe project2501a
<apeiros_> didn't think about *that* as a possible cause… :)
* apeiros_ off
<stephenjudkins> Xethron: ok, do whatever you want... you can check if it works yourself. but expressions are almost always better to use than statements
<shevy> luckyruby something like FileUtils.mkdir(i) unless File.exist? i
<shevy> luckyruby I dont think you need retry. simply check before you continue.
LowKey has quit [Quit: changing servers]
akem has quit [Quit: Forget progress by proxy. Land on your own moon.]
niku4i has quit [Ping timeout: 248 seconds]
<Hanmac> shevy "why did Greek lose against germany in soccer?" "Because we paid them"
<Spooner> luckyruby shevy: FileUtils.mkdir_p(i) will create unless it exists.
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
atmosx has quit [Ping timeout: 276 seconds]
<luckyruby> awesome
<shevy> Hanmac awwww ;(
<stephenjudkins> shevy: "FileUtils.mkdir(i) unless File.exist? i" is vulnerable to race conditions by other programs
* offby1 nods gravely
akem has joined #ruby
<offby1> ideally "mkdir" would let you pass a "please dont' fail if it already exists" option; otherwise just catch and ignore the exception
n1x has joined #ruby
atmosx has joined #ruby
spycrab0 has joined #ruby
litheum has left #ruby [#ruby]
qwerxy has joined #ruby
jgarvey has quit [Quit: Leaving]
itnomad has joined #ruby
mockra has quit [Remote host closed the connection]
tspy has quit [Remote host closed the connection]
<Spooner> offby1: it does: mkdir_p
<Mon_Ouie> Also notice mkdir_p creates intermediate directory as needed
andrewhl has quit [Remote host closed the connection]
<Spooner> It does also create other dirs as necessary, yes, which is perhaps its "proper use". Sorry, should have mentioned that.
urbann has quit [Ping timeout: 255 seconds]
<spycrab0> i have a problem with a ruby script i wrote
<shevy> spycrab0 then you must slay one kitten
<spycrab0> undefined method `Parse' for main:Object (NoMethodError)
<Hanmac> without pastie noone wants to help you
<shevy> the method Parse was not defined. which is a strange name for a method too
<shevy> usually one would expect it to be "parse()" not "Parse()"
<Hanmac> or is a class Parse, and he use it wrong
<Boohbah> class names and constants start with capitals, not method names
<Boohbah> oh, and modules too
<burgestrand> method names might, useful sometimes
<burgestrand> Array(x) is one
bearlulz has quit [Quit: Computer has gone to sleep.]
<Boohbah> oh
<burgestrand> Not very often though, and you can’t call them without arguments without parentheses
tylersanders has joined #ruby
<burgestrand> so Array is still a constant, Array x is a method call, not confusing at all
<burgestrand> :p
<shevy> spycrab0 you put it into a module
<shevy> so you must tell ruby where to find it
jonathanwallace has joined #ruby
<shevy> ParseCommand::Parse should work
<shevy> or include ParseCommand
<Spooner> Or ParseCommand.Parse (which makes it look more methody perhaps).
<spycrab0> thanks
<spycrab0> okay next time im using include
<Spooner> Oops no, it is not a module method but an instance one, so you need to include ParseCommand; Parse
carloslopes has quit [Quit: Leaving.]
carloslopes has joined #ruby
Synthead has quit [Quit: p33 ba115]
<atmosx> hello
Guest17156 has quit [Ping timeout: 246 seconds]
<spycrab0> ParseCommand::Parse and ParseCommand.Parse doesnt work
yankhates has quit [Ping timeout: 264 seconds]
graft has joined #ruby
ilyam has joined #ruby
<shevy> indeed, use include
<shevy> or def self.Parse
ringotwo has quit [Remote host closed the connection]
<spycrab0> can i use include like require (for Example include "ParseCommand")?
<stephenjudkins> spycrab0: include is a totally different thing from require
SeanLazer has quit [Quit: SeanLazer]
<socomm> when i run 'ri' i get Classes and Modules known to ri:
akem has quit [Ping timeout: 252 seconds]
<stephenjudkins> it's used for mixing modules into each other. require is used to load and parse ruby source files.
<socomm> but nothing after it, im guessing i have to install the docs?
jgrevich has quit [Read error: Connection reset by peer]
<apeiros_> socomm: have you installed ruby via rvm?
<socomm> apeiros_: apt-get
jgrevich has joined #ruby
olrrai has joined #ruby
<apeiros_> ew
<apeiros_> you usually get horribly outdated rubies from apt-get
<apeiros_> also incomplete
kstephens has quit [Ping timeout: 260 seconds]
<apeiros_> but yes, with apt-get, the docs are a separate package.
<socomm> apeiros_: any idea what they'd be called?
<apeiros_> I'd try #ubuntu or #debian
<spycrab0> i cant find a include syntax
<apeiros_> something with ruby-*doc*
rowanu has quit [Remote host closed the connection]
<apeiros_> I'd guess
leifmadsen has joined #ruby
<atmosx> debian is easy to use, IU should switch from Gentoo to Debian... I'm too bored to learn how to use apt-get properly
<shevy> lol
<socomm> atmosx: ?
<atmosx> socomm: what? :-P
<shevy> atmosx is hilarious :-)
<shevy> rking uses gentoo too btw
kstephens has joined #ruby
tylersanders has quit []
<socomm> rubygems-docs, could that be it?
* atmosx is on a rdc-based chipset, you can imagine the hours it takes for a kernel recompile
<socomm> disregard, looks like that was it
<atmosx> socomm: are you in ruby1.8?
<shevy> spycrab0 you use include with module names. If your module is called "module Foobar", then you do this "include Foobar". all without "quotes"
<atmosx> ok
<atmosx> rking is a "racer" :-p
<shevy> he is also a vimster
<spycrab0> i still get the error: uninitialized constant ParseCommand (NameError)
<shevy> and looks like a hamster
<shevy> spycrab0, no. then you did not require the file properly before. you must (a) require, then you can (b) include it. ruby does not know that module before you loaded it
<leifmadsen> hey all, I think I'm grasping at straws here, but maybe someone knows. This maybe slightly OT. I'm using minitest specs with chef via minitest-handler on a machine with ruby 1.8 (CentOS 6). I'm getting this TypeError when using file("foo").must_exist.with(:owner, "root), but if I drop everything after .must_exist, it seems to execute correctly. http://pastebin.ca/2163954
<atmosx> I think I like rking a lot
<shevy> there is no python import like functionality in ruby spycrab0
DanBoy has joined #ruby
<atmosx> bbl
bigkevmcd has quit [Quit: outta here]
<spycrab0> it works no
<spycrab0> *now
<shevy> \o/
<socomm> I'm doing 'ri File' but i don't see the read method under class methods http://pastebin.com/hjuwfDz4 what am i doing wrong?
cherrypeel has quit [Ping timeout: 240 seconds]
<shevy> somehow I hate require_relative :(
<shevy> require is so much less to type
<shevy> socomm could be it is defined somewhere else perhaps
<shevy> IO.read perhaps?
yankhates has joined #ruby
<Hanmac> shevy: i could overwrote to this: require path, true for relative :P
rbanffy has quit [Ping timeout: 276 seconds]
<socomm> shevy: ah!
chico_chicote has quit [Quit: Page closed]
AlbireoX`Laptop has joined #ruby
cjs226 has quit []
<elektronaut> shevy is right, File doesn't have a read method (or at least not a documented one) http://ruby-doc.org/core-1.9.3/File.html
centipedefarmer has quit [Quit: Leaving]
nateberkopec has joined #ruby
<shevy> Hanmac well that sucks as much as require_relative :P
<shevy> or perhaps even more, I am not sure yet
<shevy> %w( foo1.rb foo2.rb foo3.rb ).each {|file| require_relative(file) }
<shevy> hmm
<shevy> also kinda sucks, I am not happy
ph^ has joined #ruby
urbann has joined #ruby
<shevy> import foo1.rb foo2.rb foo3.rb
<Hanmac> shevy what about: relative { require path }
<shevy> now I am happy
<shevy> hmm
<shevy> that reads a bit better
<shevy> is a bit weird though
<shevy> does require make use of a {} block ?
<shevy> Hanmac, I think what is strange is the word "relative" standalone there
Guedes has quit [Quit: Saindo]
joshman_ has quit [Ping timeout: 248 seconds]
<elektronaut> alias :shazam! :require_relative
jgrevich_ has joined #ruby
jgrevich has quit [Read error: Connection reset by peer]
jgrevich_ is now known as jgrevich
<wunz> i have 3 files in my /test project, main monitor monitorlog
<wunz> how can my main file access the monitor class?
brendan` has quit [Remote host closed the connection]
jrallison has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
rbanffy has joined #ruby
havenn has joined #ruby
<shevy> elektronaut, problem is I would have to carry this modification with me in all my projects
explody has joined #ruby
<shevy> I wonder how mruby will solve this
<shevy> will it have all ... a load and a require AND a require_relative
chson has quit [Remote host closed the connection]
k_89 has joined #ruby
<k_89> is there a class-autoloader of sorts in ruby?
<shevy> I think there is via autoload
<shevy> Bundler.autoload
<shevy> Hanmac's favourite method
xnm has joined #ruby
atmosx has quit [Ping timeout: 276 seconds]
<burgestrand> k_89: there is a method that is executed when a constant is requested that does not exist
vlad_starkov has joined #ruby
S1kx has joined #ruby
jonathanwallace has quit [Read error: Connection reset by peer]
<burgestrand> k_89: you can also define certain files to be loaded when certain constant names are requested (essentially you say, if constant A is requested, then load this file and try again)
cbuxton1 has joined #ruby
jonathanwallace has joined #ruby
<burgestrand> However, I believe the autoload feature is getting removed in the future in ruby, so it’d be deprecated
cbuxton has quit [Ping timeout: 265 seconds]
<k_89> oh
<k_89> i was just going to make an autoloader based on it
rippa has quit [Ping timeout: 248 seconds]
<Hanmac> it may work on ruby 2.0 but it will be gone in 3.0
<wunz> do i have to write all my code in ONE file?
mjb2k has joined #ruby
<k_89> burgestrand, thanks .. that'd do
<wunz> i'm trying to split my classes in different files, but how can i call/use them from the main class
<burgestrand> wunz: use require to load files
<wunz> burgestrand: i used required but didn't work
atmosx has joined #ruby
<k_89> wunz, have you used php ?
<burgestrand> wunz: it does
S2kx has quit [Ping timeout: 265 seconds]
<wunz> <internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- Monitor (LoadError)
<k_89> pardon me for taking that name here
* burgestrand shrugs
<wunz> although the file is in the same dir
<burgestrand> wunz: it’s a bit more complicated than that
<Hanmac> wunz you use ruby1.9
<Hanmac> you need require_relative
SeanLazer has joined #ruby
<wunz> ah that worked. thanks hanmac
<burgestrand> require is actually fairly complicated in ruby, now that I think of it, it’s probably best you just do require './monitor' or require_relative 'monitor'
<burgestrand> the ins and outs of require come with time
k_89 has quit [Quit: Leaving]
vlad_starkov has quit [Ping timeout: 248 seconds]
minijupe has quit [Quit: minijupe]
aantix has quit [Remote host closed the connection]
aantix has joined #ruby
<wunz> thanks Hanmac and burgestrand
beneggett has joined #ruby
mnaser has quit [Quit: Computer has gone to sleep.]
<shevy> burgestrand hmm require './monitor' will only work if called from the same dir right?
<burgestrand> shevy: yep
<mjb2k> I'm trying to list contents of a directory on ftp, but I seem to be blocking on FTP#list, I am following the example on the 1.9.3 stdlib page, is there some common "gotcha" I'm missing?
<burgestrand> you eventually run into issues with that approach, which hopefully leads people to learning more about how require works :p
<shevy> mjb2k, depends how it is "blocking"
<shevy> mjb2k do you use passive or active ftp mode
<mjb2k> shevy: it never returns
<burgestrand> using require_relative everywhere appears like an easy solution, but it might lead to people using it ALL the time, and that’s bad
<shevy> try ftp_object.passive = true
<shevy> burgestrand well. that will happen because people hate that require 'foo.rb' fails now... with require_relative 'foo.rb' it'll ... work
<shevy> :>
<shevy> what I dont understand is
<shevy> why does load 'foo.rb' work?
<Hanmac> because there is no load_relative
<Hanmac> :D
wilmoore has joined #ruby
<mjb2k> shevy: that was it, needed passive mode, thanks. I'm surprised I forgot to try that
<Hanmac> ... C as also two different kind of include ... one with "" and one with <>
<shevy> Hanmac, yeah but you can omit the ./ in load
sailias has quit [Quit: Leaving.]
<shevy> since they said there is a security risk to allow the current dir be used with require, it must not happen via load, which confuses me
<elektronaut> wunz: require File.join(File.expand_path(File.dirname(__FILE__)), 'monitor') should work in both 1.8 and 1.9
<shevy> mjb2k, I had that problem once myself, I think I found the answer on stackoverflow
ebanoid has quit []
<shevy> mjb2k I also wrote a few helpers for FTP! I'll make a gem this weekend, perhaps you have suggestions to improve it :)
wpaulson has joined #ruby
<wunz> thanks elektronaut
robotmay has joined #ruby
ph^ has quit [Remote host closed the connection]
iaj has quit [Ping timeout: 246 seconds]
josefig has quit [Quit: Leaving]
johnjohnson has joined #ruby
chomp has quit [Quit: Leaving]
<mjb2k> shevy: I don't usually deal with FTP, but I will be for a small script to pull a bunch of *.gz files from an FTP. I'd definitely be willing to try it out
atmosx has quit [Ping timeout: 276 seconds]
<shevy> ok that is a good use case
luckman212 has joined #ruby
<shevy> you'll probably have solved it already, but once I made it a gem, I'll be curious if it would have been less work with my gem :)
Vert has joined #ruby
gyre007 has joined #ruby
<Mon_Ouie> load loads relatively to the current working directory, require does not — they're not intended for the same use
<mjb2k> that's what I'm thinking, I'll get this all worked out, but then I can do it from scratch with the gem and compare the efforts
joch_n has quit [Quit: Linkinus - http://linkinus.com]
luckman212 has quit [Remote host closed the connection]
<shevy> Mon_Ouie I think on 1.8.x they both worked with the current dir
atmosx has joined #ruby
<Mon_Ouie> No, in both versions require works using the $LOAD_PATH
iaj has joined #ruby
stephenjudkins has quit [Quit: stephenjudkins]
<Mon_Ouie> Which included the current working directory in 1.8
<havenn> They removed '.' from the $:
n1x has quit [Quit: Ex-Chat]
ackz has quit [Quit: Linkinus - http://linkinus.com]
<havenn> Having '.' in load path lets you run any file in the working directory (Dir.pwd(
<werdnativ> Named groups in Regexp, can you reuse the same name to get an array of matches? https://gist.github.com/2975403
samuel02 has quit [Remote host closed the connection]
mnaser has joined #ruby
voodoofish430 has quit [Quit: Leaving.]
CannedCorn has joined #ruby
<havenn> I guess "require './this' is safely presumed to be the directory the file was opened in, whereas '.' in $LOAD_PATH with "require 'this'" could actually be a different working directory.
<shevy> ohhh coool... File.expand_path(__FILE__) # => "/Depot/jj/(irb)"
<shevy> never before saw that expand_path can return a (foo) thing :D
wpaulson has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
<elektronaut> "." is also last in $LOAD_PATH in 1.8, so require 'foo' is a pretty bad idea
<mjb2k> well, turns out iterating an FTP directory and synchronizing files with local based on size and modified date is rather annoying
<shevy> mjb2k heheh I tell you, FTP goes on my nerves a lot :D
<mjb2k> shevy: I can see why you decided to make helpers now, lol
<shevy> yeah
<shevy> it is just no fun to use those things directly
<shevy> I also suggested new commands to base ruby
<shevy> whether a remote target is a file or a directory or a symlink
<shevy> dunno if they accepted it, I suppose not as they follow some... standard... which apparently is super simple and thus super sucks
<elektronaut> i'd probably just shell out to rsync and call it a day :)
<shevy> so I have to parse the result of remote .ls I think
<shevy> or .list, I forgot the name
<shevy> elektronaut, nonono we need ruuuuuby
qwerxy has quit [Quit: offski]
blischalk has joined #ruby
juli0w has quit [Remote host closed the connection]
wvms has joined #ruby
<mjb2k> this is a case where I'll need to support running on Windows if this thing gets accepted as useful
ryan0x2_ has quit [Remote host closed the connection]
dv310p3r has quit [Ping timeout: 276 seconds]
<mjb2k> shevy: [.ls | .list | .dir] all aliased
mnaser has quit [Quit: Computer has gone to sleep.]
qwerxy has joined #ruby
stephenjudkins has joined #ruby
qwerxy has quit [Client Quit]
alanp has quit [Read error: Connection reset by peer]
balki has quit [Read error: Connection reset by peer]
balki has joined #ruby
alanp has joined #ruby
PaciFisT has quit [Quit: Leaving.]
cryptfu has joined #ruby
fayimora has joined #ruby
snip_it__ has quit [Quit: snip_it__]
saschagehlich has joined #ruby
td123 has quit [Ping timeout: 244 seconds]
Jdubya has joined #ruby
Faris has joined #ruby
xaq has quit [Remote host closed the connection]
theRoUS has quit [Ping timeout: 260 seconds]
johnjohnson has quit []
sepp2k has joined #ruby
minijupe has joined #ruby
cbuxton has joined #ruby
<werdnativ> is there anything for returning the array if it has length > 1, or the only element when length == 1?
<werdnativ> Kind of the opposite of Array("something") & Array(["something"]) ?
subr00t has left #ruby [#ruby]
cbuxton1 has quit [Ping timeout: 245 seconds]
RichGuk has quit [Ping timeout: 245 seconds]
<macmartine> Is thi not a valid use of alias_method? https://gist.github.com/2975516
hunglin has quit [Quit: Leaving.]
freezey has quit [Quit: freezey]
<shevy> werdnativ what do you need again from your array
<shevy> #select
<shevy> array = %w( abc defghi jklmgiojggog ); array.select {|x| x.size > 3} # => ["defghi", "jklmgiojggog"]
CannedCorn has quit [Quit: Computer has gone to sleep.]
<werdnativ> shevy: a.length > 1 ? a : a.first
havenn has quit [Remote host closed the connection]
yankhates has quit [Ping timeout: 244 seconds]
<werdnativ> basically that, but wondering if there was a cleaner method on array to do that.
nadirvardar has joined #ruby
<shevy> macmartine did you try to move alias_method below that method yet?
<macmartine> shevy: oh, no
<werdnativ> like the reverse of Kernel.Array()
<shevy> hmm is it only me or is ruby-gnome kinda dormant project now
<shevy> :(
<mjb2k> that's kinda funny, I had to do the opposite of that in javascript before because something was returning just the object if the was only one, instead of an array with one element
<elektronaut> oops, now I have a folder named ~, and rming it is a bit scary
eurbach has quit [Quit: Leaving.]
<macmartine> shevy: that worked, thanks
RichGuk has joined #ruby
<shevy> macmartine \o/
TLFADE has joined #ruby
TLFADE has left #ruby [#ruby]
gyre007 has quit [Quit: Ex-Chat]
cpruitt has joined #ruby
mahmoudimus has joined #ruby
<mjb2k> elektronaut, yeah, I think I'd make sure and use an absolute path on that one, lol
leifmadsen has quit [Quit: This is how I roll; animal print pants outta control!]
the_jeebster has quit [Quit: Leaving.]
<elektronaut> mjb2k: no big deal, rmdir would have bailed on a nonempty dir
r0bby has joined #ruby
carlyle has quit [Remote host closed the connection]
jalljo has quit [Quit: leaving]
<shevy> playing with fire eh? :>
<shevy> I once somehow managed to pass in "/" to a rm_rf
<mjb2k> shevy: here's my crude solution to the FTP directory listing: match(/^[a-z\-]{10}\s+\d+\s+\S+\s+\S+\s+(\d+)\s+(\w+\s{1,2}\d{1,2}\s{1,2}\d{1,2}:\d{2})\s+(\S+)$/i)
<shevy> ack
<shevy> my eyes man
<davidcelis> dude
<davidcelis> fuck
<shevy> now that's a really proud regex you got there
robbyoconnor has quit [Ping timeout: 260 seconds]
<elektronaut> i had a capistrano task rm -rfing everything relative to my home dir once
<epochwolf> interesting regex
<shevy> I am too scared of regexes... if there are more than... 15 chars in a regex, it will be labelled wrong by my brain automatically
<mjb2k> I'm disappointed I had to resort to such measures just to get basic info on an FTP file
<shevy> yeah mjb2k
<elektronaut> luckily it had only started eating into ~/backups when I realized what was going on
<shevy> I've kinda been there at one point too, that was why I wrote to bugs.ruby-lang.org
<shevy> ah well
<epochwolf> shevy: I've worked on regexen with hundreds of characters
<shevy> epochwolf you have a wolverine brain that can take punishment
<davidcelis> elektronaut: it started with ~/backups? not your dotfiles?
<shevy> I have a teletubby brain, things that are harmful must be kept away from it
<epochwolf> shevy: it's just a matter of patience.
<shevy> I am very very impatient :)
<mjb2k> that one is actually overly simplistic and will probably only really work for my case
<dmwit> FTP was not designed for machine consumption, and it really shows.
<mjb2k> no doubt
<epochwolf> gopher is where it's at
<elektronaut> davidcelis: * globbing doesn't include dotfiles, at least not in zsh
<shevy> elektronaut, well for me it usually is not such a big problem, because I keep several and regular backups... but I still lose time when recovering, a few hours usually, and I hate losing time
<dmwit> SFTP doesn't suck.
<davidcelis> elektronaut: ah you're on zsh. good for you
<mjb2k> I'd much rather scp my files, alas, I dont control every file server on the internet
* dmwit nods supportively
<shevy> mjb2k, not you but google perhaps will one day :D
<mjb2k> lol, shevy, perhaps
<shevy> or it will merge with ... facebook ...
<dmwit> ftp.google.com, ftp.facebook.com...
<shevy> facegle... goobook
wilmoore has quit [Remote host closed the connection]
* dmwit shudders
berkes has quit [Ping timeout: 272 seconds]
<shevy> alright, I guess google would not want a rebranding of their name... and facebook won't either
Desmond has quit [Ping timeout: 276 seconds]
<elektronaut> facebook.com/Google
Criztian_ has quit [Remote host closed the connection]
dmwit has left #ruby ["buh-bye"]
mpereira has joined #ruby
Vert has quit [Ping timeout: 252 seconds]
DanBoy_ has joined #ruby
<shevy> omg
<shevy> "Google is on Facebook."
<shevy> is facebook on google+ ?
<shevy> what a stupid name... "google+" ...
<Boohbah> ftp sucks and it needs to die
Karmaon has quit [Quit: WeeChat 0.3.9-dev]
artOfWar has joined #ruby
rcj_ has quit [Quit: ZNC - http://znc.sourceforge.net]
Karmaon has joined #ruby
<epochwolf> Boohbah: definitely
nilg has quit [Remote host closed the connection]
<apeiros_> yupp
<shevy> Boohbah yeah
* apeiros_ often wondered why no superior protocol really supplanted ftp on a wide front…
<epochwolf> apeiros_: because of existing tooling around ftp
<mjb2k> what superior protocol?
<Boohbah> scp/sftp
<apeiros_> mjb2k: that's the point. no one made one. parts, yes. like rsync.
<apeiros_> but I'm unaware of something that does all
<apeiros_> (and webdav sadly ain't superior to ftp in any way…)
<epochwolf> webdav is horrid shit
workmad3 has joined #ruby
<mjb2k> right, there hasn't really been anything to fill all the functionality and offer at least some backwards compatibility
jlogsdon has quit [Remote host closed the connection]
<apeiros_> mjb2k: fuck backwards compat :)
<shevy> :)
<apeiros_> at least if it is to ftp
<mjb2k> and even though FTP sucks, it does still get the job done
<apeiros_> barely
rcj_ has joined #ruby
<apeiros_> you need more than two hands to recount all the problems and issues with it…
crankycoder has quit [Remote host closed the connection]
<shevy> I think FTP works for only one thing really - transferring single files :P
<workmad3> it doesn't even do that particularly well
<workmad3> at least, not trustworthy
<apeiros_> yes. see rsync & scp.
DrShoggoth has quit [Quit: Leaving]
<workmad3> hell, sftp at a minimum
<apeiros_> the technology is all there…
<mjb2k> how much support is there for scp and sftp on windows?
<eam> ssh has completely replaced ftp
<workmad3> mjb2k: putty, winscp, probably many others
akem has joined #ruby
akem has quit [Changing host]
akem has joined #ruby
<mjb2k> I know there is desktop apps like WinSCP and Putty, but what about serverside
<eam> which is why you see people using sftp (ssh) instead of ftps (ftp + ssl)
<mjb2k> (putty make me vomit in my mouth a little)
<workmad3> mjb2k: don't know... I've never been crazy enough to run a windows server seriously :P
<eam> mjb2k: openssh client and server run fine on windows
<eam> have for over a decade
<luckyruby> how do I use gsub to remove all '{','}' from a string?
<mjb2k> workmad3: problem is there are many other people out there who do thing Windows is a suitable server
<workmad3> mjb2k: there are many people out there who think PHP is a suitable language... doesn't make them any more correct
<mjb2k> hey now!, lol
<workmad3> :)
<workmad3> mjb2k: also, the people who think windows is a suitable server don't tend to be sat in an IRC channel about ruby...
suborbital has quit [Quit: to the batcave!]
<mjb2k> I will always defend php as a suitable language, suitable for what exactly is up to debate however
<elektronaut> suitable for getting non-php developers riled up at least
<workmad3> mjb2k: true, you can print out it's implementation to turn good paper into toilet paper...
<workmad3> heh :)
mpereira_ has joined #ruby
<workmad3> I'm in an odd mood tonight
havenn has joined #ruby
Monofu has joined #ruby
<workmad3> I should probably stop talking about things before I say stuff I'll regret tomorrow :)
<Boohbah> luckyruby: string.gsub(/{|}/,'')
<mjb2k> I think it's funny when I see people talk bad about php then praise python, I don't see very much difference between them
<Boohbah> luckyruby: the | means or
<Boohbah> mjb2k: python is much more sane than php
Foxandxss has joined #ruby
<eka> mjb2k: you should try both
<sepp2k> mjb2k: Seriously? Do you see many differences between PHP and Ruby? Because honestly I see more differences between PHP and Python than between Python and Ruby.
<elektronaut> timecube.com is more sane than php
<mjb2k> I do know far more about php than python
Markvilla has joined #ruby
<luckyruby> Boohbah: ty
albemuth has quit [Quit: Computer has gone to sleep.]
spycrab0 has quit [Ping timeout: 256 seconds]
suborbital has joined #ruby
<mjb2k> php definitely lets you do horrible things, but it is also capable of proper design
<mjb2k> python seems to encourage bad design
zeade has quit [Quit: Leaving.]
<eka> mjb2k: so you didn't use python at all
<workmad3> mjb2k: I'd say PHP encourages bad design personally...
eka has left #ruby [#ruby]
td123 has joined #ruby
saschagehlich has quit [Quit: saschagehlich]
<sepp2k> mjb2k: In what way?
kevinbond has joined #ruby
Markvilla has quit [Read error: Connection reset by peer]
maahes has quit [Ping timeout: 244 seconds]
<elektronaut> i was a php developer for 6 years or so. the only nice thing i have to say about it is that it runs pretty much everywhere.
<mjb2k> in python all object members are public, right? that is frightening in itself
ryan0x2_ has joined #ruby
mpereira_ has quit [Ping timeout: 248 seconds]
<mjb2k> i dont think php encourages bad design, but I sure dont think it encourages good design either
<mjb2k> php is more anarchic, if you can find your way fine, but dont look to the language spec to guide you anywhere
awarner has quit [Remote host closed the connection]
frishi has joined #ruby
benjammin891 has joined #ruby
kevinbond has quit [Quit: kevinbond]
Markvilla has joined #ruby
akem has quit [Read error: Operation timed out]
apeiros_ has quit [Remote host closed the connection]
akem has joined #ruby
akem has quit [Changing host]
akem has joined #ruby
<werdnativ> With a repeating regex match, how can I get all occurrences, not just the last one? https://gist.github.com/c5d28db4feedf01bc041
<mjb2k> I'm not trying to say php is really all that good, I just dont think it's quite as bad as people say, and python really isnt nearly as good as people say
<workmad3> mjb2k: I don't say python is good though...
<workmad3> mjb2k: but it's at least better than PHP :P
<elektronaut> i wish i still had my old php code, I made a gloriously terrible hack implementing missing oop features in php4 via parsing backtraces
sailias has joined #ruby
techazard has joined #ruby
carloslopes has quit [Quit: Leaving.]
Jdubya has quit [Ping timeout: 245 seconds]
* offby1 backs away slowly
<mjb2k> I think maybe one of the biggest details to know about php and it's suckage, is that it started out sucking real bad, but they added quite a bit of non-suck-real-bad stuff but also never took out the old garbage
<mjb2k> so even though it has some decent features in it now, the fact that they live along side old rotting garbage just adds to the problem
frishi has quit [Quit: Leaving...]
akem has quit [Ping timeout: 272 seconds]
shadoi has quit [Quit: Leaving.]
peterhil has quit [Ping timeout: 272 seconds]
sepp2k has quit [Remote host closed the connection]
wpaulson has joined #ruby
qos has joined #ruby
Karmaon has quit [Ping timeout: 260 seconds]
ephemerian has quit [Quit: Leaving.]
beilabs has quit [Ping timeout: 264 seconds]
beilabs_ has quit [Ping timeout: 265 seconds]
baroquebobcat has quit [Ping timeout: 245 seconds]
<mjb2k> time to go home!
SQLStud has quit [Read error: Connection reset by peer]
cherrypeel has joined #ruby
linoj has quit [Quit: linoj]
minijupe has quit [Quit: minijupe]
<mjb2k> next time we should talk vi vs emacs, lol
rbanffy has quit [Quit: Ex-Chat]
mjb2k has quit [Quit: Leaving]
RudyValencia has quit [Read error: Connection reset by peer]
RudyValencia has joined #ruby
RudyValencia has quit [Read error: Connection reset by peer]
jimeh has quit [Ping timeout: 245 seconds]
linoj has joined #ruby
mpereira_ has joined #ruby
randomautomator has quit [Remote host closed the connection]
<bgupta> If I am trying to pass a cutom header via rest_client, does this seem right:
linoj has quit [Client Quit]
<bgupta> (The version header)
<bgupta> :headers => { :accept => :json, :content_type => :json, :version => '1' }}.merge(options)).execute.to_s)
Gestahlt has joined #ruby
<bgupta> I'm supposed to be passing: accept:application/json;version=1
wpaulson has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
carlyle has joined #ruby
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]
suborbital has quit [Quit: to the batcave!]
bradhe_ has joined #ruby
nadirvardar has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
beilabs has joined #ruby
beilabs_ has joined #ruby
bradhe has quit [Read error: Connection reset by peer]
Siphonblast has joined #ruby
brianpWins has quit [Quit: brianpWins]
jimeh has joined #ruby
Monofu has quit [Quit: quit]
oooPaul has quit [Quit: Ciao for now!]
seanstickle has joined #ruby
thecreators has quit [Remote host closed the connection]
hemanth has quit [Read error: Connection reset by peer]
hemanth has joined #ruby
teampoop has quit [Quit: Leaving.]
<offby1> OK, I feel dumb, but I _did_ Google: how do I time a ruby expression?
<offby1> I was expecting something like { something }.call_with_timings
burgestrand has quit [Quit: Leaving.]
stephenjudkins has quit [Read error: Connection reset by peer]
Karmaon has joined #ruby
litheum has joined #ruby
luckyruby has quit [Remote host closed the connection]
<seanstickle> offby1: look into the Benchmark module
<seanstickle> offby1: built in!
<offby1> tx
stephenjudkins has joined #ruby
Chryson has joined #ruby
bradhe has joined #ruby
bradhe_ has quit [Read error: Connection reset by peer]
atmosx has quit [Ping timeout: 276 seconds]
ePirat- has quit [Excess Flood]
banseljaj is now known as imami|afk
carlyle has quit [Remote host closed the connection]
atmosx has joined #ruby
Desmond has joined #ruby
ilyam has quit [Quit: ilyam]
macmartine has quit [Quit: macmartine]
albemuth has joined #ruby
cwang has quit [Remote host closed the connection]
robotmay has quit [Remote host closed the connection]
Jake232 has quit [Quit: Computer has gone to sleep.]
Desmond has quit [Read error: Connection reset by peer]
Aaton is now known as Aaton_off
tewecske has quit [Quit: Leaving.]
Siphonblast has quit [Ping timeout: 260 seconds]
Natch has quit [Ping timeout: 248 seconds]
Yugo has joined #ruby
yannis has joined #ruby
carlyle has joined #ruby
itnomad has quit [Quit: Leaving]
carlyle has quit [Remote host closed the connection]
Natch has joined #ruby
<queequeg1> I could use a pointer. I'm using rake to run my minitests, but I would like to use guard. So I installed guard-rake and when my minitests pass guard works fine, but when my minitests fale, rake has a trace and guard prints out that trace. Or rather I would rather not see the trace and only see my pass fail listing. Any hints on how I could do that?
igaiga has joined #ruby
sepp2k has joined #ruby
kenichi has quit [Remote host closed the connection]
artOfWar has quit [Remote host closed the connection]
artOfWar has joined #ruby
workmad3 has quit [Ping timeout: 264 seconds]
adamkittelson has quit [Remote host closed the connection]
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby