ChanServ changed the topic of #ruby-lang to: Ruby 1.9.3-p125: http://ruby-lang.org | Paste >3 lines of text on http://pastie.org or use a gist
andrewhl has joined #ruby-lang
Clordio has joined #ruby-lang
crudson has quit [#ruby-lang]
Austin__ has joined #ruby-lang
seanstickle has joined #ruby-lang
shevy has joined #ruby-lang
mikeric has joined #ruby-lang
gregmoreno has joined #ruby-lang
nofxx has joined #ruby-lang
bryancp has joined #ruby-lang
takaokouji has joined #ruby-lang
Joeysomo has joined #ruby-lang
elemarjr has joined #ruby-lang
igotnolegs has joined #ruby-lang
twelvechairs has joined #ruby-lang
mikeric has joined #ruby-lang
jtoy has joined #ruby-lang
WillMarshall has joined #ruby-lang
Clordio has joined #ruby-lang
fgomez has joined #ruby-lang
elemarjr has quit [#ruby-lang]
elemarjr has joined #ruby-lang
fgomez has joined #ruby-lang
boxmo has joined #ruby-lang
mikeric has joined #ruby-lang
fgomez has joined #ruby-lang
gorsuch has joined #ruby-lang
AndChat| has joined #ruby-lang
shtirlic_ has joined #ruby-lang
tenderlove has joined #ruby-lang
tenderlove has joined #ruby-lang
tomzx has joined #ruby-lang
m3nd3s has joined #ruby-lang
mistym has joined #ruby-lang
naz has joined #ruby-lang
slimfit has joined #ruby-lang
Brainix has joined #ruby-lang
zenspider has joined #ruby-lang
kvirani has joined #ruby-lang
<mistym> Is there a preferred ncurses gem?
<mistym> Sad that builtin curses has no colour :9
<mistym> :(
<imperator> bunch of curses gems; gem search -r -d curses
<mistym> Yeah, was hoping to get opinions if anyone here'd used them.
<imperator> not i
<imperator> this is your chance to become an ncurses authority!
<zenspider> rawr
shajith has joined #ruby-lang
<zenspider> hoe 3.0.2 released
<zenspider> minitest 2.12.0 released
<zenspider> uh oh
<zenspider> or not?
<zenspider> no, it got pushed
<zenspider> something f'd up on the blog side...
Karmaon has joined #ruby-lang
shajith has joined #ruby-lang
shajith has joined #ruby-lang
<erikh> greetimgs from my new phone
<erikh> that i am so very excited about
Banistergalaxy has joined #ruby-lang
<seanstickle> erikh: Nokia Lumia with Windows 7?
<erikh> seanstickle: of course!
<imperator> greetings new phone!
<seanstickle> WinRuby on the phone for the win
<erikh> i got a droid 4
<seanstickle> Oh, I am so sorry.
<erikh> i like it so far, physical keyboard is nice.
<seanstickle> I mean … congratulations on an excellent choice …
<erikh> hahaha
<imperator> why, what's wrong with it seanstickle ?
<seanstickle> Why, nothing at all!
towski has joined #ruby-lang
Luxx_ has joined #ruby-lang
PsiliPharm has joined #ruby-lang
Axsuul has joined #ruby-lang
sdeobald has joined #ruby-lang
qpingu has joined #ruby-lang
mikeric has joined #ruby-lang
dr0id has joined #ruby-lang
_mario has joined #ruby-lang
knightMBP has joined #ruby-lang
rohit has joined #ruby-lang
hagabaka has joined #ruby-lang
hagabaka has joined #ruby-lang
dfr|mac has joined #ruby-lang
havenn has joined #ruby-lang
rushed has joined #ruby-lang
dreieins has joined #ruby-lang
_Mon_Ouie_ has joined #ruby-lang
<TTilus> erikh: was the winphone a joke?
Mon_Ouie has joined #ruby-lang
rippa has joined #ruby-lang
ianm_ has joined #ruby-lang
gsav has joined #ruby-lang
<erikh> yes
mikeric has joined #ruby-lang
<ianm_> anyone have experience releasing Ruby/SDL apps on windows or OSX?
kitallis has joined #ruby-lang
esad has joined #ruby-lang
gix has joined #ruby-lang
WillMarshall has joined #ruby-lang
sodani has joined #ruby-lang
<sodani> can someone tell me what the = sign after something like 'def method=' means?
takaokouji has joined #ruby-lang
segy has joined #ruby-lang
Banistergalaxy has joined #ruby-lang
yxhuvud has joined #ruby-lang
savage- has joined #ruby-lang
<havenn> sodani: The '=' designates it as a setter method and provides some syntactic sugar. So if you have: def set= this #you can call it thusly: set= "this" #or the sugary way: set = "this".
<sodani> havenn: thanks. very helpful
<havenn> sodani: By the way, `attr_writer :symbol_here` creates a `symbol_here=` method. No prob!
fayimora has joined #ruby-lang
yumike has joined #ruby-lang
t_ has joined #ruby-lang
|Vargas| has joined #ruby-lang
|Vargas| has joined #ruby-lang
JohnBat26 has joined #ruby-lang
towski has joined #ruby-lang
gouthamvel has joined #ruby-lang
Banistergalaxy has joined #ruby-lang
Boohbah has joined #ruby-lang
regius has joined #ruby-lang
Joeysomo has joined #ruby-lang
esad has joined #ruby-lang
towski has joined #ruby-lang
kyrylo has joined #ruby-lang
kyrylo has joined #ruby-lang
x0F_ has joined #ruby-lang
heftig has joined #ruby-lang
woollyams has joined #ruby-lang
Tearan has joined #ruby-lang
thrcka has joined #ruby-lang
<zenspider> sodani: with a caveat... you need to call the METHOD and not assign to a local variable
<zenspider> set = 42 # is a local variable assignment
<zenspider> self.set = 42 # is a call to #set=
gnufied has joined #ruby-lang
gokul has joined #ruby-lang
workmad3 has joined #ruby-lang
solars has joined #ruby-lang
takaokouji has joined #ruby-lang
pw_ has joined #ruby-lang
pw_ has quit [#ruby-lang]
pw_ has joined #ruby-lang
robbyoconnor has joined #ruby-lang
spuk has joined #ruby-lang
yumike has joined #ruby-lang
ianm_ has quit [#ruby-lang]
Banistergalaxy has joined #ruby-lang
qz has joined #ruby-lang
robbyoconnor has joined #ruby-lang
tekin has joined #ruby-lang
tjadc has joined #ruby-lang
rue has joined #ruby-lang
rue_XIV has joined #ruby-lang
futurechimp has joined #ruby-lang
gouthamvel has joined #ruby-lang
workmad3 has joined #ruby-lang
apeiros_ has joined #ruby-lang
esad has joined #ruby-lang
<andrewvos> morning all
mikeric has joined #ruby-lang
ridders24 has joined #ruby-lang
<andrewvos> hi andrewvos!
francisfish has joined #ruby-lang
<ridders24> How I get the drive letter to be included in the outut path? so for example "F:/DATA/abc-12" instead of just "DATA/abc-12" http://pastie.org/3725709
tr-808 has joined #ruby-lang
rohit has joined #ruby-lang
woollyams has joined #ruby-lang
morozovm has joined #ruby-lang
<andrewvos> paths.map{|p| File.expand_path(p)}
<andrewvos> ridders24: ^
robotmay has joined #ruby-lang
shaman42 has joined #ruby-lang
cyndis has joined #ruby-lang
kedare has joined #ruby-lang
<ridders24> that doesnt seem to do anything
<ridders24> do I need to change |P| ?
<andrewvos> paths = paths.map{|p| File.expand_path(p)}
<andrewvos> ridders24: ^
<andrewvos> ridders24: paths.map!{|p| File.expand_path(p)}
<andrewvos> Or that
zmack has joined #ruby-lang
srbartlett has joined #ruby-lang
ridders24 has joined #ruby-lang
<ridders24> andrewvos: I still couldnt get that to work, all it gave me was a txt file that said F:
heftig has joined #ruby-lang
rohit has joined #ruby-lang
Banistergalaxy has joined #ruby-lang
qz has joined #ruby-lang
gouthamvel has joined #ruby-lang
pluesch0r has joined #ruby-lang
gokul has joined #ruby-lang
<pluesch0r> hi everybody. i'm trying to write an expect script in ruby to interface with hp procurve switches via ssh. i keep getting vt100 escape sequences; i've looked into the PTY class as i expected to be able to set the terminal type there, but it didn't work. is there a way to do what i want?
<esad> pluesch0r: can you do sth like PTY.spawn 'env TERM=ansi <your-command>'
codelette has joined #ruby-lang
gouthamvel has joined #ruby-lang
r0bby has joined #ruby-lang
ddoucette has joined #ruby-lang
y3llow_ has joined #ruby-lang
gnufied1 has joined #ruby-lang
weeb1e has joined #ruby-lang
mtkd_ has joined #ruby-lang
postmodern has joined #ruby-lang
Swimmin__ has joined #ruby-lang
slaytani1 has joined #ruby-lang
linless has joined #ruby-lang
fjfish has joined #ruby-lang
zigidias_ has joined #ruby-lang
zigidias has joined #ruby-lang
Axsuul has joined #ruby-lang
thrcka has joined #ruby-lang
gregf has joined #ruby-lang
iHerb has joined #ruby-lang
<iHerb> Hello, and please sorry for that =) Have a nice day!
<iHerb> iHerb.com - Vitamins, Supplements & Natural Health Products & etc!
<iHerb> please used and saved $10 with the iHerb coupon code VAD515 or please visit my link http://iherb.com?rcode=vad515, and free Shipping on orders over $20. And FREE SAMPLE for every purchase!
<andrewvos> heh
<iHerb> sorry )
tla has joined #ruby-lang
toretore has joined #ruby-lang
dejongge has joined #ruby-lang
judofyr has joined #ruby-lang
stoor has joined #ruby-lang
Indian has joined #ruby-lang
stoor has quit [#ruby-lang]
manveru has joined #ruby-lang
neurotech has joined #ruby-lang
<neurotech> yo
srbartlett has joined #ruby-lang
<neurotech> Anyone on
<andrewvos> like 500 people
<andrewvos> neurotech: So yes
<neurotech> andrewvos: I have a really basic question about ruby
<neurotech> http://pastie.org/3726332 <-- how can I add 1 to the number received from gets in line 2 and have it display in line 3
heftig has joined #ruby-lang
<andrewvos> (fave.to_s+1)
dejongge has joined #ruby-lang
<neurotech> andrewvos: I replace fave on line 3 with that?
<neurotech> I started learning ruby today :{}
dous has joined #ruby-lang
<andrewvos> yeah
<neurotech> puts 'That\'s a nice number. I prefer the bigger, better number of ' + (fave.to_s+1)
<neurotech> Like that?
<andrewvos> neurotech: Did you try it?
<neurotech> try2.rb:3:in `+': can't convert Fixnum into String (TypeError)
<neurotech> from try2.rb:3
<neurotech> That's the error I get.
rohit has joined #ruby-lang
<andrewvos> neurotech: I mean fave.to_i sorry
<andrewvos> Or just Integer(face)
<andrewvos> fave*
<neurotech> ah
<rking> What is Integer("3") doing?
<neurotech> Same error
<rking> It looks like a python-style constructor...
<rking> Oh my... yeah, Ruby can do that instead of .new. =) I don't remember that from before, but I'm rusty.
<andrewvos> rking: It takes a value and converts it to an integer
<rking> That's one of those things that is kind of hard to Google for... is Foo.new(__) === Foo(___) in all cases?
<andrewvos> No
<andrewvos> It's not a constrcutor
<andrewvos> It's a method
<rking> Oh, class Integer; def ()(o); .. ?
kain_ has joined #ruby-lang
<rippa> no
<rippa> def Integer ...
<neurotech> Test
<neurotech> Are there any linux irc clients that have a CSS theming engine ala LimeChat on OSX?
<rking> rippa: Hrm.. so because Integer (and the other one I tried was String) are so commonly-used, that is added as a convenience?
<rking> Also, is not their implementation going to be: def Integer o; o.to_i end ?
<rippa> no
<rippa> Integer raises exception if it can't convert, for one thing
<rking> K, that's good to know.
Banistergalaxy has joined #ruby-lang
retro|cz has joined #ruby-lang
vesan has joined #ruby-lang
woollyams has joined #ruby-lang
Sailias has joined #ruby-lang
Radium has joined #ruby-lang
Sulfur has joined #ruby-lang
slyphon has joined #ruby-lang
<imperator> good morning
fayimora has joined #ruby-lang
yalue has joined #ruby-lang
<rking> imperator: Possibly the best of mornings.
vesan has joined #ruby-lang
Jake232 has joined #ruby-lang
<imperator> rking, oh? do tell
<rking> imperator: I'm having one of those "great to be alive" kinds of mornings, is all.
Zolrath has joined #ruby-lang
kain has joined #ruby-lang
kain has joined #ruby-lang
gouthamvel has quit [#ruby-lang]
WillMarshall has joined #ruby-lang
mark_locklear has joined #ruby-lang
imperator has joined #ruby-lang
banister has joined #ruby-lang
workmad3_ has joined #ruby-lang
<banister> workmad3: halp
m3nd3s has joined #ruby-lang
Harzilein has joined #ruby-lang
Harzilein has joined #ruby-lang
Harzilein has joined #ruby-lang
Harzilein has joined #ruby-lang
Harzilein has joined #ruby-lang
Harzilein has joined #ruby-lang
vesan has joined #ruby-lang
qz has joined #ruby-lang
mssola has joined #ruby-lang
neurotech has quit ["Konversation terminated!"]
elemarjr has joined #ruby-lang
mstratman has joined #ruby-lang
tommyvyo_ has joined #ruby-lang
gnufied has joined #ruby-lang
enebo has joined #ruby-lang
kvirani has joined #ruby-lang
tekin has joined #ruby-lang
jxie has joined #ruby-lang
jtoy has joined #ruby-lang
nuby has joined #ruby-lang
tommyvyo_ has joined #ruby-lang
bglusman has joined #ruby-lang
dv310p3r has joined #ruby-lang
imajes has joined #ruby-lang
morozovm_ has joined #ruby-lang
justinxreese has joined #ruby-lang
slx has joined #ruby-lang
Sailias has joined #ruby-lang
scampbell has joined #ruby-lang
frem has joined #ruby-lang
datanoise has joined #ruby-lang
JEG2 has joined #ruby-lang
codewrangler has joined #ruby-lang
mistym has joined #ruby-lang
outoftime has joined #ruby-lang
slyphon has joined #ruby-lang
melter has joined #ruby-lang
morozovm_ has quit [#ruby-lang]
<mistym> Friend of mine's thinking of pickign up Learn to Program as a first programming book. Anyone have an opinion on it?
msisk has joined #ruby-lang
<shevy> mistym hmm the chris pine one? I did not read it, the online version is nice and easy though
dfr|mac has joined #ruby-lang
<mistym> shevy: That's the one, yeah. Thanks!
<judofyr> mistym: I've heard good things about it
Austin__ has joined #ruby-lang
imperator has joined #ruby-lang
sodani has quit [#ruby-lang]
Austin__ has joined #ruby-lang
rdavila has joined #ruby-lang
nevynxxx has joined #ruby-lang
bougyman has joined #ruby-lang
bougyman has joined #ruby-lang
bougyman has joined #ruby-lang
bougyman has joined #ruby-lang
Defusal_ has joined #ruby-lang
Defusal_ has joined #ruby-lang
slyphon has joined #ruby-lang
fayimora has joined #ruby-lang
rippa has joined #ruby-lang
andrewhl has joined #ruby-lang
florentg2 has joined #ruby-lang
Radium has joined #ruby-lang
ericmuyser has joined #ruby-lang
crudson has joined #ruby-lang
lsegal has joined #ruby-lang
slx has quit [#ruby-lang]
jondot has joined #ruby-lang
io_syl has joined #ruby-lang
brianpWins has joined #ruby-lang
Swimming_Bird has joined #ruby-lang
apeiros_ has joined #ruby-lang
wmoxam has joined #ruby-lang
d3vic3 has joined #ruby-lang
adambeynon has joined #ruby-lang
rolfb has joined #ruby-lang
mssola has joined #ruby-lang
m3nd3s has joined #ruby-lang
headius has joined #ruby-lang
slaytanic has joined #ruby-lang
tekin has joined #ruby-lang
SuperTaz_work has joined #ruby-lang
gnufied has joined #ruby-lang
36DAA2WSX has joined #ruby-lang
18VAAD1KD has joined #ruby-lang
savage- has joined #ruby-lang
<imperator> hm, should i learn coffeescript? ward cunningham says i should
<shevy> imperator yeah!
<shevy> you could then tell me if it is really better than javascript
<frem> it's not really better, it's pretty much just shorthand
<frem> (but i like it :-)
towski has joined #ruby-lang
TvL2386 has joined #ruby-lang
publicvoid has joined #ruby-lang
H2H has joined #ruby-lang
jarred has joined #ruby-lang
<Defusal_> shevy, it is better
<Defusal_> imperator, yes you should
vesan has joined #ruby-lang
<slyphon> drbrain: what's the substantive difference between using \A \Z in a regex and ^ $, when dealing with a string that is not multiline
<Defusal_> "CoffeeScript is well done and more convenient to use than JS" - Brendan Eich (creator of JavaScript)
<slyphon> they both seem to do the same thing
<apeiros_> slyphon: even if you asked drbrain - with a single line string: none
<Defusal_> slyphon, there isnt any, most people use ^ and $
<slyphon> kk
<apeiros_> most people wrongly use ^ and $
<slyphon> yeah, i use ^ and $, and i *know* it's semantically incorrect
<apeiros_> you shouldn't assume things when it comes to regexen. i.e, saying "but the string will always be a single line" is an assumption.
<slyphon> i just didn't know if there were some like, reason to not
<slyphon> ah
<apeiros_> I've seen that argument being made in many situations where a user can easily sneak in multiline strings instead, and thus bypass e.g. validations
<slyphon> ahh
<slyphon> yeah, in that case being as correct as possible is a necessity
<apeiros_> also, my good old "habits" argument
* slyphon nods
<slyphon> yeah, i remember explaining security as 'hygeine' to someone
jondot_ has joined #ruby-lang
<slyphon> "why do you always do XYZ?"
<any-key> if security were hygeine, what would protecting against CSRF be?
<slyphon> "Why do you always wash your hands after taking a dump?"
<any-key> washing behind your ears?
<imperator> are we talking \A and \Z vs ^ and $ ?
<slyphon> yes
<imperator> oh dammit, my stupid irc client
<slyphon> i'm not looking ot start a holy war
<slyphon> the "it's more correct" argument was accepted
<imperator> HOLY WAR LAUNCHED
<slyphon> hahahah
<any-key> take cover!
workmad3 has joined #ruby-lang
<imperator> AYAYAYAYAYYAYAYAY!
hagabaka has joined #ruby-lang
hagabaka has joined #ruby-lang
<imperator> but first, lunch
<slyphon> i asked about ' vs " for strings, and rue said something like, "I really don't want to have to insult you by explaining 'style' to you"
crackity_jones has joined #ruby-lang
<slyphon> and now i use ' when i'm not doing interpolation
<apeiros_> haha
* apeiros_ is a lazy bitch and sticks with " and %{}
<slyphon> i think it does help to make things clearer
<any-key> I use '' when it's just a single word
<apeiros_> yeah, it's slightly less noise
<slyphon> i like %r%% for anything regexing paths
<slyphon> /\/foo\/bar/ is horrible to me
<any-key> I like the dancing lines!
<apeiros_> sawteeth
<any-key> \\/\///\/\/\///\/
<slyphon> yeah, bawd
<slyphon> gawd
<any-key> it looks pretty
<slyphon> like what JSON does by default
<slyphon> makes my head hurt
<apeiros_> I usually use %{}, %r{} and %w[]
<slyphon> %w[] is one of the bestest things ever
<any-key> %w{}
<any-key> is %r regex?
<slyphon> yep
<any-key> that's neat, I should use that
<apeiros_> any-key: I prefer %w[] over %w{}, as it reminds more of it being an array
<any-key> dat's true
<any-key> I haven't needed to use %w in real code since I learned about it
<any-key> sadly, that was only in the last month or so >.>
crackity_jones has joined #ruby-lang
benjammin_ has joined #ruby-lang
gnufied has joined #ruby-lang
benjammin_ has quit ["Leaving"]
<rippa> not like you use string array literals often
<rippa> it's more for testing
r0bby has joined #ruby-lang
<apeiros_> I've actually quite a couple
<apeiros_> but then again, our code base is rather… big
<any-key> put quotes around "code base" and all of a sudden that sentence is suggestive >.>
erics has joined #ruby-lang
Skif_home has joined #ruby-lang
rue has joined #ruby-lang
benjammin_ has joined #ruby-lang
headius has joined #ruby-lang
Skif has joined #ruby-lang
mattyoho has joined #ruby-lang
envygeeks has joined #ruby-lang
nofxx has joined #ruby-lang
<yxhuvud> well, as long as you don't use '% foo ' to create strings
<apeiros_> total win at code obfuscation contests
<yxhuvud> %w.foo..bar could create a good wtf as well.
<apeiros_> combine that with a flip-flop
<shevy> I love %w( cat dog horse )
shajith has joined #ruby-lang
<yxhuvud> gah
<shevy> hey cant you use ... %w% cat dog horse % too?
<yxhuvud> apeiros_: flipflops are insane just by themselves. (especially the trinary variant _why constructed)
<yxhuvud> hmm. now that would be a way of making 99 bottles..
* apeiros_ fully agrees @flip-flops being insane
<apeiros_> hehe
<any-key> wait what
<any-key> flip-flops
krz has joined #ruby-lang
<apeiros_> any-key: don't bother. it'll only fry your brain and not be useful for anything but code-obfuscation and -golf
<envygeeks> "%0sWin" % ' ' * 1000
<shevy> hmmm
<erikh> only perl has the goatse operator
<erikh> =()=
kvirani has joined #ruby-lang
<any-key> that is nifty
qpingu has joined #ruby-lang
solars has joined #ruby-lang
t has joined #ruby-lang
msisk has joined #ruby-lang
Carnage\ has joined #ruby-lang
gregf has joined #ruby-lang
uniqanomaly has joined #ruby-lang
achiu has joined #ruby-lang
<Defusal_> hmm this is a little tricky
ttilley has joined #ruby-lang
florentg2 has joined #ruby-lang
<Defusal_> a spawned script raises an Errno::EPIPE exception while writing to STDOUT (the parent process), which should just kill the child, but it kills the parent with the child processes exception and no backtrace of the parent at all
<Defusal_> im not exactly sure why the exception occurs while writing to STDOUT in the first place, but the second part is even more confusing
<yxhuvud> apeiros_: hmm. \n works as well for % o_o
<apeiros_> awsum!
<shevy> what
<Mon_Ouie> That's even better than spaces!
<shevy> how is that used hmm
<Mon_Ouie> str = %\nfoo\n
<Mon_Ouie> Replace \n with actual new-lines
<shevy> ohh
<yxhuvud> also works with chaining .. %\nfoo\n.to_s
<shevy> man that is just weird
<Defusal_> nevermind me, i just realized it was not what it appeared to be
<shevy> http://pastie.org/3728346 is valid!
<Defusal_> the actual issue had no output at all, so i will have to figure out how to reproduce it before digging further
<yxhuvud> shevy: well, it is not as if % test .to_s isn't weird
imperator has joined #ruby-lang
<shevy> hehe
<shevy> the % there confuses me on a first look
havenn has joined #ruby-lang
<envygeeks> does anybody around here possibly know how I can convince ruby-webmachine to use rack middleware?
tjadc has joined #ruby-lang
<imperator> contact the author?
<whitequark> read the source?
NoobChumpsky has joined #ruby-lang
<shevy> play lotto?
NoobChumpsky has quit [#ruby-lang]
NoobChumpsky has joined #ruby-lang
NoobChumpsky has quit [#ruby-lang]
Sailias has joined #ruby-lang
Brainix has joined #ruby-lang
tenderlove has joined #ruby-lang
NoobChumpsky has joined #ruby-lang
NoobChumpsky has quit [#ruby-lang]
markit has joined #ruby-lang
JohnBat26|2 has joined #ruby-lang
<markit> hi, I've this command that works fine in shell (returns the interface name of the main gateway):
<markit> ip -oneline -family inet route show | sed -n '/^default .* dev \([^ ]*\).*/s//\1/p'
<markit> but if I use %x[ip -oneline -family inet route show | sed -n '/^default .* dev \([^ ]*\).*/s//\1/p'] returns nothing
<markit> I have to omit the "-n" in sed, so strange
<markit> any tip?
<bougyman> um
<markit> (took from a python code)
<Defusal_> markit, use backticks instead of %w[] ``
<Defusal_> and do the parsing in ruby instead of with sed
workmad3 has joined #ruby-lang
<bougyman> no, %x[]
<bougyman> is proper.
<bougyman> backticks are lazy
<Defusal_> bougyman, what?
<bougyman> Defusal_: did I stutter?
<bougyman> %x{} is the correct way
<markit> Defusal_: in any case, I would love to know why THAT code does not work
<Defusal_> markit, i'm guess because of the piping, but i have never piped something inline like that
<markit> Defusal_: but from shell works fine
<Defusal_> bougyman, not according to https://github.com/bbatsov/ruby-style-guide
<Defusal_> but ok
<markit> so I expect that ruby "shells" that code and returns the result
<yxhuvud> cute. as opposed as for %w, space and \n work for %x as well :D
<Defusal_> it says: Avoid %q, %Q, %x, %s, and %W.
judofyr has joined #ruby-lang
<Defusal_> markit, well if you want to do it like that, maybe someone else can help you get it to work
<markit> Defusal_: I have alternate code that works, but what puzzles me is understand why it does not
<markit> the same code that works well in shell
<Defusal_> the -n could be being passed to the ip command
<markit> so I can act properly in the future
<Defusal_> you could try add " -- " before the |
<bougyman> markit: %x{ip -oneline r}.scan(/^default.*/m).first.split[4]
<bougyman> it's because sed isn't getting all the lines right.
<apeiros_> if only there was a good way to format case/when nicely :(
xml_issue has joined #ruby-lang
<bougyman> Defusal_: it's stupid.
<markit> Defusal_: you mean something like %x[ip -oneline -family inet route show -- | sed -n 's/.*default.*/NEWSTRING/']
<bougyman> i mean, saying to disregard the %x things.
<bougyman> they have very specific pruposes.
<markit> what do you mean with "--" before | ?
<xml_issue> Hi all, does anyone know why nokogiri's .xpath method would return true instead of a node?
<Defusal_> bougyman, i know they do, but i try to follow most of the ruby style guide never the less
<markit> bougyman: how is that? I mean, this overcomplicated my usage of ruby just as a "shell commands" glue
<Defusal_> personally i have spawned processes in 10 different ways
<Defusal_> %x has never been one of them though
<bougyman> markit: using ruby overcomplicates that?
<bougyman> Defusal_: I generally use open3 because I like more control
<markit> bougyman: I mean, I've some shell commands that I run
<Defusal_> markit, you're overcomplicating it by having to spawn another process
<markit> bougyman: I just make a ruby command with a menu and options and then use them in the correct order
<markit> but if syntax changes, I'm doomed
<Defusal_> bougyman, i use whatever works best with my EM platforms for whatever i need at the time
retro|cz has joined #ruby-lang
<bougyman> do whatcha gotta do.
<bougyman> i don't think I ever shell out in EM
xml_issue has quit [#ruby-lang]
<Defusal_> for my current application, i have had to a lot
* markit ignorant.. what is EM ?
<Defusal_> i have has to implement open3 deferring to another thread and then calling back to EM for that too
<Defusal_> because EMs implementations have some flaws which don't work for everything
<bougyman> markit: event machine, asynchronous framework.
judofyr_ has joined #ruby-lang
<bougyman> Defusal_: the reactor is not a flaw, it's the magic!
<bougyman> the downside is, it wants to be threadmaster.
<Defusal_> bougyman, err
<Defusal_> the flaws i speak of would not be found in common use cases
<Defusal_> i use EM for almost every single one of my applications
<bougyman> same
<Defusal_> but i too don't usually need to spawn things
<bougyman> but i'd use a job queue for shelling out
<Defusal_> not always ideal
phipes has joined #ruby-lang
<bougyman> like when?
<Defusal_> btw, if you use Process.detach after EM.popen, em never fires evens
phipes has joined #ruby-lang
<Defusal_> events*
<bougyman> i never background anything, we've talked about htat before.
<Defusal_> that is one reason i had to wrap popen 3 in a defer block
phipes has quit [#ruby-lang]
<bougyman> detaching a process is not Unix Way.
<Defusal_> if you say so
<bougyman> everything we have runs in the foreground with stdin/stdout handled properly.
<bougyman> i didn't make up the Unix Way, i wasn't even born then.
<Defusal_> i detach things for two reasons
<bougyman> but "backgrounding" is not part of it.
<Defusal_> 1, if they defunct when exiting if not detached
<bougyman> that never happens with a supervisor
<Defusal_> and 2, if i don't want them to die when my applcation dies or is restarted
<bougyman> i haven't seen a zombie on my system in 13 years.
<bougyman> iirc, zombies _only_ happen to backgrounded/detached processes.
<Brainix> You know, virtualization has brought back to life some very weird Unix problems that I hadn't seen in years.
vpamulap has joined #ruby-lang
<Brainix> Thank god I'm a developer now, and not a devops guy. :-)
<Defusal_> bougyman, i guess i could have written another daemon to supervise spawned processes, and it would have been less effort, if i knew what a pain detaching properly was when i was implementing that
<bougyman> Defusal_: you never have to detach, sir.
<bougyman> i run tons of ruby processes without ever detaching.
<Defusal_> then i would have just had to use DRb to communicate with the supervisor
<bougyman> no, you wouldn't.
<Defusal_> instead of being able to use STDOUT
<Defusal_> then what?
<bougyman> we've been using runit for 12 years, and daemontools before that.
<bougyman> nothing ever is 'in the background'
<Defusal_> i need pids in realtime
<bougyman> yes, we have that.
<Defusal_> when they are spawned
<bougyman> whenever they're not running.
<bougyman> that's what a supervisor does.
<Defusal_> that does not suite my use case.
<bougyman> huh?
<Defusal_> well i actually don't follow
<Defusal_> [20:46:59] <bougyman> whenever they're not running.
<Defusal_> [20:47:04] <bougyman> that's what a supervisor does.
<Defusal_> that is an incomplete sentence :/
<bougyman> when a process that is supervised stops running, it will be started again.
<bougyman> as soon as it stops running.
<Defusal_> my processes are spawned and stopped on demand
<Defusal_> and my platform needs to have their pids
<bougyman> that's possible, to.
<Defusal_> in realtime
<bougyman> and getting the pid is trivial
<bougyman> bougyman@xena ~ % sudo sv s /service/*
<bougyman> run: /service/bougyman: (pid 3302) 30239s; run: log: (pid 1659) 30700s
<bougyman> note that doesn't depend on a pid file
<Defusal_> polling the filesystem for the pid is not efficient
<bougyman> it's an actual, guarnteed good pid.
<bougyman> right.
<bougyman> that's why I noted that
<bougyman> it doesn't poll shit.
<bougyman> it's the parent, it doesn't have to poll.
<Defusal_> well anyway, im sure there are solutions
<Defusal_> not the spawner
<Defusal_> my platform
<Defusal_> i spawn processes directly to avoid the complexity of syncing data back and forward between the real spawning process
<Defusal_> it may very well be easier to write my own spawning daemon, than interface with something that already exists
<Defusal_> im not saying its not possible, im sure it is, but its not tailored to my use case
<Defusal_> also, the command that is spawned is dynamic
<Defusal_> and so is the ENV that it is spawned under
<Defusal_> and the user
<Defusal_> making a realtime interface between my application and whatever daemon for all that would not very too simple bougyman
<bougyman> that's exactly why we started using runit.
<bougyman> it's quite simple
<bougyman> spawning on-demand, even across servers.
<Defusal_> if you say so
<bougyman> we had an eMesh product that would spawn new rails processes on different (idle) servers and change the ipvs server to point to them.
<bougyman> when capacity was getting full.
<Defusal_> bougyman, so out of interest sake, what interface do you use to tell the daemon to spawn a new process with a custom command, stdin and env under a custom user and then have it send the pid to your process?
<bougyman> Defusal_: ln -s /etc/sv/process /service
<bougyman> that starts it.
<bougyman> the pid is immediately available.
<bougyman> to stop it, sv d process (to take it down for now) or rm /service/process (to take it down forever)
<Defusal_> err
<Defusal_> so you have to first write a script with the command to the filesystem
<Defusal_> then do that
<Defusal_> and then how do you pass stuff to stdin?
<bougyman> each service directory is repsonsible for how to start the process it's responsible for, correct.
<Defusal_> or specify the user
<bougyman> specifying the user is done in the startup (run) file.
<Defusal_> bleh
<Defusal_> see all this is still gonna be needed to be scripted
<Defusal_> its a pain
<Defusal_> as i said, all this changes dynamically
<bougyman> no, it's really not a pain.
<Defusal_> every time the process starts
<bougyman> and it can be automatically generated.
<Defusal_> sure it can be
<Defusal_> but the point is it must be
<bougyman> it must be now for you already.
<bougyman> any data you have to have has to come from somewhere.
<bougyman> my only point is: runit and daemontools and other supervisors are made for this.
<Defusal_> nevermind, thanks
<Defusal_> i will probably use it at some point in the future, for less specialized needs
Radium has joined #ruby-lang
wallerdev has joined #ruby-lang
<wallerdev> is there an idiomatic way to do case statements for ranges that are open ended, like case when 0…5, 6…20, 21…40, 41…infinity
<Defusal_> but as i said, i almost never need background processes
<Defusal_> between EM and crontab, theres not much i cannot do
<Defusal_> wallerdev: Inf = (1/0.0)
<wallerdev> yeah i know, i just wasnt sure if that would be the clearest way to handle that
H2H has joined #ruby-lang
<wallerdev> i think ill just use an if statement
<yxhuvud> iirc, 1.9 have it as a constant
<Defusal_> yxhuvud, in which case, Inf = Infinity :P
<Defusal_> "Infinity" is too long for most case statments, it makes it look really ugly
<Defusal_> but yeah an if statement is usually better wallerdev
hzlocky has joined #ruby-lang
<hzlocky> Guys, is there anyway to define method with name [][](first_arg, second_arg) in my class?
<mstratman> hzlocky, wallerdev, and too many people in general: Cleverness is overrated. :-p
<mstratman> Just write readable, maintainable code for crying out loud ;)
<hzlocky> agree
<envygeeks> hzlocky: play some trickery and use a Proc since you can call Procs with []
t has joined #ruby-lang
<hzlocky> but something[][] looks so cute
<wallerdev> mrchrisadams: thats why i was asking if there was an idiomatic way to do it haha
<mstratman> no. No it doesn't
<mstratman> yeah, fair enough wallerdev :)
<hzlocky> like Sasha Grey with Topology book
<mstratman> now everyone get off my lawn.
rue has joined #ruby-lang
<hzlocky> ok, class is Configuration, so config[feature_group, feature] works without problems, but config[feature_group][feature] looks good too
<envygeeks> do inception on your procs, but that would make the code pretty complicated and not even worth it
<hzlocky> other ways?
<TTilus> config.feature_group.feature
<hzlocky> not sexy enough
<TTilus> then id go with []
<envygeeks> why not just do a multi dimensional array?
thrcka has joined #ruby-lang
<TTilus> not sexy enough?
<TTilus> ;)
<envygeeks> array['val']['proc']
<hzlocky> I do, but want to give users way to use Config[a][b] as well
<hzlocky> Config is a Class
<TTilus> class Config; def [](a); array[a]; end; end
<TTilus> whoops
<TTilus> class Config; def self.[](a); array[a]; end; end
xml_issue has joined #ruby-lang
<hzlocky> thats ruines login inside []
<xml_issue> Anyone here familar with the .xpath method in Nokogiri?
<bougyman> yes
<andrewvos> xml_issue: Yes. Probably everyone here.
<xml_issue> Great, thanks. For some reason, it's just return true/false for me. It doesn't return a Node. Any ideas?
divoxx has joined #ruby-lang
<envygeeks> hzlocky: use method missing then and hack up a hash like OpenStruct?
scientes has joined #ruby-lang
<hzlocky> mine team mates hate method_missing
<hzlocky> they think it was invented by devil
<envygeeks> o.O
<xml_issue> adrewvos: For example, doc.xpath('//mods:identifier="' + id + '"', {'mods'=>'http://www.loc.gov/mods/v3'})
curtism has joined #ruby-lang
curtism has joined #ruby-lang
dejongge has joined #ruby-lang
<xml_issue> andrewvos: For example, doc.xpath('//mods:identifier="' + id + '"', {'mods'=>'http://www.loc.gov/mods/v3'})
<xml_issue> andrewvos: It's just returning true of type TrueClass.
mrsolo has joined #ruby-lang
justinmcp has joined #ruby-lang
<somebody> is there a library that will parse for me the query string from an HTTP post request, given the entire HTTP request as a string?
<envygeeks> hzlocky: something like this perhaps? https://gist.github.com/02af006bf470ee0ebe3b
<envygeeks> somebody: If you are using Rack it's Rack::Utils.parse_nested_query
<envygeeks> you could always just steal the source from there too
tekin has joined #ruby-lang
<somebody> envygeeks: we're using em-proxy :(
thrcka has joined #ruby-lang
gregf has joined #ruby-lang
msisk has joined #ruby-lang
chimkan_ has joined #ruby-lang
vbatts has joined #ruby-lang
benanne has joined #ruby-lang
Radium has joined #ruby-lang
headius has joined #ruby-lang
savage-_ has joined #ruby-lang
rue has joined #ruby-lang
ddfreyne has joined #ruby-lang
Teddy2steper has joined #ruby-lang
apeiros_ has joined #ruby-lang
srbartlett has joined #ruby-lang
publicvoid has joined #ruby-lang
<mistym> Cool. I didn't know Apple shipped a ruby cli interface to Quicktime at some point.
<lianj> using applescript?
<mistym> lianj: Looks like it's all ruby.
frangiz has joined #ruby-lang
solars has joined #ruby-lang
tekin has joined #ruby-lang
envygeeks has quit [#ruby-lang]
irb has joined #ruby-lang
<irb> hello!
<irb> quick oci8 question, any help is appreciated..here is my 3 lines of code
<irb> conn = OCI8.new("#{db_user}/#{db_pwd}@#{db_name}")
<irb> cursor = conn.parse('insert into iaas_instance_srvc_logs(id,srvc_deployed,srvc_id,srvc_cfg_data,instance_id')
<irb> cursor.bind_param(1,'seq_iaas_instance_srvc_logs.nextval')
frangiz_ has joined #ruby-lang
<irb> the binding param for the first value is causing an error and I'm following the example on the oci8 doc page
<erikh> you usually need a :1 in there somewhere
<erikh> and bound params bind values, not statements
<erikh> there, you don't really need a bound parameter. you could just use insert into ... (columns) values (blah.nextval)
solars has joined #ruby-lang
Teddy2steper has joined #ruby-lang
<irb> ok, let me try that
Yu\2 has joined #ruby-lang
tenderlove has joined #ruby-lang
kyrylo has joined #ruby-lang
kyrylo has joined #ruby-lang
matt_yoho has joined #ruby-lang
<mistym> Crap. pcastaction doesn't work when I'm using my own ruby in rvm.
<mistym> Even though it's hardcoded to use /usr/bin/ruby
<erikh> rvm doesn't use /usr/bin/ruby
<mistym> erikh: I know! It's executing from /usr/bin/ruby, but failing to load a gem it's looking for (which exists in the system ruby's installation)
<mistym> It works if I `rvm use system`, but not when the active ruby is mine.
rdavila has joined #ruby-lang
<erikh> oh, that's because of GEM_HOME most likely.
<erikh> or GEM_PATH.
<erikh> and... I would strongly caution you against setting those directly
<erikh> basically know what you're doing before you attempt it
mattyoho has joined #ruby-lang
<lianj> grep pcast_ruby `which pcastaction`
<lianj> grep cocoa `which pcastaction` also
<mistym> lianj: require 'usr/lib/podcastproducer/pcast_ruby'; require 'osx/cocoa'
<mistym> erikh: Haven't touched them myself so far.
<lianj> mistym: yes, rvm use other_ruby; ruby -rusr/lib/podcastproducer/pcast_ruby -rosx/cocoa thats prolly why it will not work
<mistym> lianj: It's hardset to /usr/bin/ruby so it's executing with the system version. erikh was right, it's GEM_HOME
frangiz has joined #ruby-lang
m3nd3s_ has joined #ruby-lang
<mistym> erikh: Hm. Maybe if I unset GEM_HOME before launching pcastaction from within my script.
<erikh> yeah, I'd unset GEM_PATH as well
<erikh> alternatively, you could append to GEM_PATH but I wouldn't recommend that.
m3nd3s__ has joined #ruby-lang
<mistym> Yeah, that sounds more dangerous.
<lianj> ah so you dont want to run it with another ruby, ok
<erikh> in short: you need a shell wrapper
<erikh> now, I think newer rvm's can generate them for you
<erikh> but that's a big *think*
<erikh> but migth be worth surfing #rvm
<mistym> lianj: Yeah, I don
<mistym> 't want it to run in my ruby, I just want it to run period!
<mistym> erikh: Good point. I'll ask there sometime.
<erikh> is this apple ruby?
<erikh> apple ruby is, er, special
<erikh> what you're doing may not work on plain ol' 1.8.7
<rue> It's got a chunk bit out of it
<mistym> erikh: I'm using 1.9.3, pcastaction is hardcoded to Apple ruby.
<erikh> right right
<erikh> anyhow; hope that helps.
postmodern has joined #ruby-lang
<lianj> erikh: pcastaction seams to be shipped with leopard (by apple)
<lianj> just logged into a remote apple, its there too :)
<mistym> lianj: I'm on Snow Lep, here too.
<mistym> Excellent. Unsetting GEM_HOME within my program before calling it worked.
frangiz_ has joined #ruby-lang
Indian has joined #ruby-lang
<erikh> lianj: missing the point; the ruby that apple builds and installs by default comes with some "enhancements"
<mistym> "enhancements"?
<erikh> yeah.
<erikh> cocoa support and some other tweaks... there's even some hacks around it in newer versions of rubygems.
slaytanic has joined #ruby-lang
frangiz has joined #ruby-lang
benanne has joined #ruby-lang
m3nd3s has joined #ruby-lang
benanne has joined #ruby-lang
frangiz_ has joined #ruby-lang
<rue> There's also a method they've added, it's either Object#iTunes or Object#iTControl, you can pass :play, :pause, :fwd, :back to it to control iTunes playback
thone_ has joined #ruby-lang
deobald has joined #ruby-lang
WillMarshall has joined #ruby-lang
enebo has joined #ruby-lang
crackity_jones has joined #ruby-lang
enebo has joined #ruby-lang
m3nd3s has joined #ruby-lang
judofyr has joined #ruby-lang
msisk has joined #ruby-lang
jaffachi_ has joined #ruby-lang
H2H has joined #ruby-lang
Oloryn_lt2 has joined #ruby-lang
ttilley has joined #ruby-lang
woollyams has joined #ruby-lang
mihar has joined #ruby-lang
<shevy> hmm
<shevy> isn't it iObject?
<lianj> ;)
<lianj> its the Kernel::ShutUpSlave module
savage- has joined #ruby-lang
Jake232 has joined #ruby-lang
nofxxx has joined #ruby-lang
crackity_jones_ has joined #ruby-lang
Carnage\ has joined #ruby-lang
Swimming_Bird has joined #ruby-lang
mattyoho has joined #ruby-lang
gorsuch has joined #ruby-lang
Swimming_Bird has joined #ruby-lang
Slackwise has joined #ruby-lang
<ReinH> rue: that's on BasicObject right?
<ReinH> for maximal availability?
judofyr has joined #ruby-lang
H2H has joined #ruby-lang
andrewhl has joined #ruby-lang
slyphon has joined #ruby-lang
wallerdev has joined #ruby-lang
woollyams has joined #ruby-lang
msisk has joined #ruby-lang
kyrylo has joined #ruby-lang
kyrylo has joined #ruby-lang
WillMarshall has joined #ruby-lang
esad has joined #ruby-lang
Boohbah has joined #ruby-lang
sepp2k has joined #ruby-lang
Joeysomo has joined #ruby-lang
retro|cz has joined #ruby-lang
dous has joined #ruby-lang
slyphon has joined #ruby-lang
Banistergalaxy has joined #ruby-lang
fgomez has joined #ruby-lang
aroop has joined #ruby-lang
mattyoho has joined #ruby-lang
Brainix has joined #ruby-lang