<apeiros>
and the point of your question again was what?
v0n has joined #ruby
<rburton->
Any recommendations for a replacement of Foreman that will work with JRuby? When I try to run foreman via jruby it's dependent on posix/spawn which has native extensions
<apeiros>
tintin: you are NOT required to show us all you found, you know?
<danneu>
tintin: wtf?
<tintin>
danneu: What do you want ?
tvw has quit [Remote host closed the connection]
<apeiros>
we'd even prefer if you did not paste them all here. paste them if you've got an actual question *related* to any of those articles. thank you.
geermc4 has quit [Remote host closed the connection]
hsbt_away is now known as hsbt
<tintin>
Ok, thank you. bye
tintin has quit [Client Quit]
<apeiros>
tick…
bigmac has joined #ruby
anachronistic has quit [Quit: anachronistic]
Keva161 has quit [Ping timeout: 255 seconds]
Takehiro has joined #ruby
u89 has joined #ruby
roadt has joined #ruby
hbpoison has joined #ruby
hbpoison_ has joined #ruby
_alejandro has joined #ruby
bigmac is now known as i8igmac
<jake_>
lets say i just setup passenger and apache for my rack app, but passenger complains I haven't run 'bundle install' (but i have). What should I google?
<apeiros>
jake_: you sure your passenger runs the same ruby as you do?
dpatel has quit [Quit: dpatel]
<jake_>
yes. i removed ruby < 1.9.1 and backtrace has 1.9.1 in it. i can link you to the backtrace if that would help
maxer has quit [Quit: maxer]
Takehiro has quit [Ping timeout: 240 seconds]
clj_newb has joined #ruby
havenn has joined #ruby
<apeiros>
no. but the configuration lines of passenger would be interesting, and what `which ruby` before running bundle install prints
hbpoison_ has quit [Ping timeout: 248 seconds]
hbpoison has quit [Ping timeout: 244 seconds]
zodiak has joined #ruby
ceej has joined #ruby
<apeiros>
I also assume that you verified that the `bundle install` was indeed successful
Iszak has quit []
<jake_>
yes. i can run the app with puma no problem
mahmoudimus has joined #ruby
<apeiros>
ok
<jake_>
which ruby is /usr/bin/ruby
maxer has joined #ruby
jjbohn has joined #ruby
BadProphet has quit [Quit: This computer has gone to sleep]
zodiak has quit [Max SendQ exceeded]
zodiak has joined #ruby
zodiak has quit [Max SendQ exceeded]
BadProphet has joined #ruby
codecaster has quit [Quit: Leaving.]
<jake_>
the rackup config file or the passenger config file?
BadProphet has quit [Client Quit]
arubin_ has joined #ruby
thinkdevcode has quit [Remote host closed the connection]
ltsstar has joined #ruby
<jake_>
I think the important part is what went into apache?
<jake_>
symlinked, redid the bundle, same issue. atleast there is one less bug. thanks apeiros
hsbt_away is now known as hsbt
<apeiros>
I don't think symlinking them is a good idea. I'd do a proper install of passenger with the ruby you want to run it under.
<apeiros>
and then bundle with that same ruby.
QKO has quit [Changing host]
QKO has joined #ruby
_alejandro has quit [Read error: Connection reset by peer]
<barce>
how do i replace %q[&'] with %q[&\'] ? str = %q[&'] ; str.gsub(%q[&'], %q[&\']) # doesn't work.
tyfighter has quit [Quit: tyfighter]
hsbt is now known as hsbt_away
<jake_>
well, i symlinked them and changed the config file to point to the one that which ruby returned because thats the one that gem install passenger would have used.
`brendan has joined #ruby
butblack has joined #ruby
cirwin has joined #ruby
kbeddingfield has quit [Ping timeout: 260 seconds]
maxer has quit [Quit: maxer]
baphled has joined #ruby
cobragoa_ has quit [Remote host closed the connection]
hsbt_away is now known as hsbt
eataix has joined #ruby
thisirs has quit [Remote host closed the connection]
<apeiros>
that part really needs better docs in String#gsub
fantazo has quit [Ping timeout: 276 seconds]
<jake_>
the same issue shows up in python.
h4mz1d has quit [Ping timeout: 256 seconds]
<apeiros>
yes, it's due to \', \0-\9 etc. having a meaning in the replacement string
<apeiros>
so you need double escaping - once plain string escaping, and then again to escape it from special meaning in gsub.
rakm has quit [Remote host closed the connection]
stephenjudkins has joined #ruby
_alejandro has joined #ruby
samphippen has quit [Quit: Computer has gone to sleep.]
<barce>
jake_: thanks
<jake_>
np
jrajav has quit []
jrajav has joined #ruby
Nisstyre has quit [Quit: Leaving]
armando_canals has quit [Ping timeout: 256 seconds]
ryanf has joined #ruby
crackfu has joined #ruby
Keva161 has joined #ruby
F1skr has quit [Quit: WeeChat 0.3.9]
ryanlecompte has quit [Remote host closed the connection]
zeade has left #ruby [#ruby]
SeoxyS has joined #ruby
kenneth has quit [Read error: Connection reset by peer]
SeoxyS is now known as kenneth
baphled has quit [Ping timeout: 245 seconds]
<danneu>
Oh wow. To follow up my noob question above, if anyone's using Treetop or want to write their own grammar, check out the Citrus library. Amazing README: https://github.com/mjijackson/citrus
Tania has quit [Quit: :p]
tds has quit [Quit: tds]
awarner has quit [Remote host closed the connection]
crackfu has quit [Ping timeout: 244 seconds]
nga4 has quit [Ping timeout: 246 seconds]
baroquebobcat has joined #ruby
jeffreybaird has joined #ruby
jjbohn has quit [Quit: Leaving...]
warb0`laptop has joined #ruby
nari has joined #ruby
armando_canals has joined #ruby
hsbt is now known as hsbt_away
alexim has quit [Quit: bye]
jjbohn has joined #ruby
<jake_>
for anyone having my problem: 'bundle pack' is the solution.
jlwestsr has quit [Ping timeout: 246 seconds]
jgrevich has quit [Ping timeout: 260 seconds]
mneorr has quit [Remote host closed the connection]
mneorr has joined #ruby
mmitchell has quit [Remote host closed the connection]
baroquebobcat has quit [Quit: baroquebobcat]
cableray has quit [Quit: cableray]
maletor has quit [Quit: Computer has gone to sleep.]
JustinCampbell has quit [Remote host closed the connection]
joast has joined #ruby
<rburton->
damn strugglign to get God to start Sidekiq
linoj has quit [Quit: linoj]
<rburton->
/me let there be light.. nothing!
jaygen has joined #ruby
jgrevich has joined #ruby
zeitgeist_arkeo has joined #ruby
Nisstyre has joined #ruby
artOfWar has quit [Ping timeout: 265 seconds]
Takehiro has joined #ruby
hbpoison has joined #ruby
hbpoison_ has joined #ruby
emergion has joined #ruby
sailias has joined #ruby
armando_canals has quit [Ping timeout: 244 seconds]
jlwestsr has joined #ruby
Takehiro has quit [Ping timeout: 244 seconds]
hbpoison has quit [Ping timeout: 256 seconds]
hbpoison_ has quit [Ping timeout: 256 seconds]
emmanuelux has quit [Remote host closed the connection]
slainer68 has joined #ruby
sailias has quit [Ping timeout: 256 seconds]
Tearan has quit [Quit: Sleepy Badger....]
sn0wb1rd has quit [Quit: sn0wb1rd]
<rburton->
Anyone have any success at running sidekiq via God?
slainer68 has quit [Ping timeout: 256 seconds]
<rburton->
sort of frustrated at this point
<rburton->
It spawns it but doesn't monitor it. wanted to see if anyone had a God script I could look at
earthquake has joined #ruby
ddd has quit [Quit: Leaving.]
mneorr has quit [Remote host closed the connection]
x82_nicole has joined #ruby
chimkan has joined #ruby
mneorr has joined #ruby
voodoofish430 has quit [Quit: Leaving.]
jaygen_ has joined #ruby
jslowe has quit [Read error: Connection reset by peer]
jaygen has quit [Ping timeout: 252 seconds]
thinkdevcode has joined #ruby
werdnativ has quit [Ping timeout: 246 seconds]
dakine has quit [Quit: Leaving]
mklappstuhl has quit [Ping timeout: 256 seconds]
thinkdevcode has quit [Ping timeout: 256 seconds]
cirwin has quit [Ping timeout: 252 seconds]
dakine has joined #ruby
nga4 has joined #ruby
tds has joined #ruby
_alejandro has quit [Read error: Connection reset by peer]
jeffreybaird has quit [Quit: jeffreybaird]
u89 has quit [Remote host closed the connection]
bairui has quit [Ping timeout: 260 seconds]
crackfu has joined #ruby
hsbt_away is now known as hsbt
mahmoudimus has quit [Quit: Computer has gone to sleep.]
adeponte has quit [Remote host closed the connection]
justinmcp has joined #ruby
sn0wb1rd has quit [Ping timeout: 244 seconds]
sn0wb1rd_ is now known as sn0wb1rd
geggam has joined #ruby
postmodern has joined #ruby
jjbohn has quit [Ping timeout: 240 seconds]
KnowTheLedge has joined #ruby
mneorr has quit [Remote host closed the connection]
vickaita has quit [Ping timeout: 260 seconds]
mneorr has joined #ruby
justinmcp has quit [Ping timeout: 240 seconds]
mneorr has quit [Remote host closed the connection]
mneorr has joined #ruby
rakl has quit [Quit: sleeping]
<jake_>
ive got a ruby app setup via passenger and apache. it is returning type 'httpd/unix-derectory' instead of plain text. anyone ever had a problem like this or know how to fix it?
jjbohn has joined #ruby
Jscob__ has quit [Ping timeout: 240 seconds]
issyl0 has quit [Ping timeout: 608 seconds]
apok has quit [Quit: apok]
Goles has quit [Remote host closed the connection]
Xeago has quit [Remote host closed the connection]
ananthakumaran has joined #ruby
Grieg has quit [Ping timeout: 268 seconds]
<n_blownapart>
hi could use help with line 9 in this prog. Not sure what the [1] notation means, and it doesn't return an empty array as textbook promises. Only commented line returns empt. array altho not sure about the global variable there either. thanks: http://pastie.org/5147991
jjbohn has quit [Quit: Leaving...]
Grieg has joined #ruby
Grieg has quit [Changing host]
Grieg has joined #ruby
mercwithamouth has quit [Ping timeout: 240 seconds]
jjbohn has joined #ruby
smook has quit [Remote host closed the connection]
mercwithamouth has joined #ruby
jabs has joined #ruby
bairui has joined #ruby
colinbm has quit [Quit: colinbm]
alvaro_o has quit [Quit: Ex-Chat]
ceej has quit [Quit: ceej]
dv_ has quit [Ping timeout: 260 seconds]
justinmcp has joined #ruby
wargasm has joined #ruby
lastd0nkeY has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
Gmind has joined #ruby
bricker has quit [Read error: Operation timed out]
<apeiros>
n_blownapart: that's odd code
<apeiros>
Regexp#match returns a MatchData object or nil, patching it to return an empty array instead of nil doesn't make much sense to me…
<n_blownapart>
thanks yeah apeiros its in a part of the book what not to do in ruby.
joeycarmello has quit [Remote host closed the connection]
<apeiros>
n_blownapart: but to (maybe) explain the rationale: without that monkey-patch, the line 9 would fail, it'd raise an exception
CaptainJet has quit [Read error: Connection reset by peer]
<apeiros>
you see, normally `/abc/.match("x")` # => nil
<apeiros>
and nil does not respond to the [] method (x[1] invokes the method named [] on x), so you get a NoMethodError
kenneth has quit [Quit: kenneth]
<n_blownapart>
apeiros: my problem is with the [1] vs. $1 notation. is [1] a monkey-patch?
<apeiros>
no
goldenwest has joined #ruby
<apeiros>
monkey-patch is when you change an existing class
<goldenwest>
I've got mod_ruby working with cgi but it fails with a SecurityError if I try to require a gem
<apeiros>
and line 1-6 changes the Regexp#match method
<n_blownapart>
apeiros: got it. one sec if you have time I want to show you another prog...
jaygen has joined #ruby
<apeiros>
n_blownapart: foo[1] is just a method call, just like foo.getIndex(1)
<apeiros>
just a fancy name. you could write it as foo.[](1) too (foo[1] is just syntax sugar)
sailias has joined #ruby
<n_blownapart>
apeiros: oh but what is it an index to?
<apeiros>
n_blownapart: as said, Regexp#match returns a MatchData object. and MatchData#[] returns the nth capture
spo12 has joined #ruby
<n_blownapart>
apeiros: thanks one sec studying that...
<apeiros>
/(.)(.)(.)/.match("abc")[1] # => "a" (0 is the full match, so "abc")
g-ram has quit [Quit: Computer has gone to sleep.]
<apeiros>
x = /(.)(.)(.)/.match("abc") # => #<MatchData …>
<apeiros>
x[0] # => "abc"
<apeiros>
x[1] # => "a"
CaptainJet has joined #ruby
<apeiros>
x[3] # => "c"
<apeiros>
x[4] # => nil - since you have only 3 captures
<n_blownapart>
apeiros: yeah I think I get that there are four captures altogether including full string.
<n_blownapart>
apeiros: that is cool !
<n_blownapart>
apeiros: thanks much I wanted to ask you about this notation in lines 7 and 11 : http://pastie.org/4906423
brianpWins has quit [Quit: brianpWins]
jjbohn is now known as jjbohn|afk
<n_blownapart>
apeiros: above explanation big help I couldn't have that explained properly hitherto.
<apeiros>
what's your issue with those lines?
<apeiros>
\\1 references the first capture, \\2 the second
emergion has quit [Quit: Computer has gone to sleep.]
ejholmes has quit [Quit: ejholmes]
<n_blownapart>
apeiros: but its more than merely a reference because the output changes. First I don't see how \\1 \\2 and \\1 \\1 produces those two outputs.
g-ram has joined #ruby
<apeiros>
gsub means "globally substitute"
ejholmes has joined #ruby
<apeiros>
the methods job is indeed to change the string
<apeiros>
a capture in a regex is the part in parens. you use them to be able to reference them again
<n_blownapart>
apeiros: got that. in line 9 the first entry in the array is unchanged, then the last two words of the string are returned. why?
<apeiros>
because that's the last thing that was matched
<apeiros>
and the string is unchanged because what is matches is replaced by exactly the same
dorei has quit []
ryanlecompte has joined #ruby
<n_blownapart>
apeiros: sorry I'm trying to see what its doing...
ryanf has quit [Ping timeout: 244 seconds]
ryanlecompte has quit [Remote host closed the connection]
<n_blownapart>
apeiros: so on line 9 is "double every word here." the \\0 capture ?
<apeiros>
hu?
<goldenwest>
I'm getting this error: Insecure operation - exist? (SecurityError) when I try to load a gem with $SAFE = 1
jblack has joined #ruby
<apeiros>
n_blownapart: I think you get confused by the rest of the stuff that goes on
<apeiros>
just focus on `"double every word here.".gsub(/\b(\w+) (\w+)/, "\\1 \\2")` first
<apeiros>
you have string.gsub(match_this, replace_with_that)
<apeiros>
and your "match_this" says "match two words, store word 1 in capture 1, and word 2 in capture 2"
proshot has quit [Read error: Connection reset by peer]
<apeiros>
and your "replace_with_that" says "replace it with capture 1, space and capture 2"
<apeiros>
which is essentially: don't do a thing.
alvaro_o has joined #ruby
stephenjudkins has quit [Quit: stephenjudkins]
jaygen has quit [Ping timeout: 252 seconds]
<n_blownapart>
apeiros: yeah confusing. so \\1 is Double every
<apeiros>
no, \\1 is "first capture"
atlantaman has joined #ruby
<apeiros>
the effect of doubling happens because you say "first capture" twice
stephenjudkins has joined #ruby
<apeiros>
the second example changes the "replace_with_that" to "\\1 \\1", which means "replace it with capture 1, space and capture 1 again"
emanon_ has joined #ruby
<n_blownapart>
aoh apeiros I think I see this: the string is split in two because there are two (\w+) 's.
<apeiros>
yes, as said, the stuff in parens are captures
<apeiros>
\w+ means "match characters", and (\w+) means "match characters and store it"
proshot has joined #ruby
<n_blownapart>
yeah apeiros so each (\w+) can only accomodate two words in a four word string.
<apeiros>
no
<apeiros>
each (\w+) accommodates *one* word
<apeiros>
gsub substitutes twice.
<apeiros>
if you use sub instead of gsub, you'll see
<apeiros>
"double every word here.".sub(/\b(\w+) (\w+)/, "\\1 \\1") # => "double double word here"
Hanmac1 has joined #ruby
<apeiros>
the first match is "double every", with capture 1 == "double" and capture 2 == "every"
<apeiros>
so replacement "\\1 \\1" becomes "double double"
<apeiros>
and sub (not gsub) stops after that first replacement
g-ram has quit [Quit: Computer has gone to sleep.]
slainer68 has quit [Remote host closed the connection]
<apeiros>
if you use gsub, it'll proceed after that match. the second match being "word here", meaning capture 1 == "word", capture 2 being "here"
<apeiros>
which is why $1 and $2 are set to "word" and "here" after the gsub. because that's what the captures stored in the last match.
Hanmac has quit [Ping timeout: 244 seconds]
emanon_ has quit [Quit: Leaving]
jaygen has joined #ruby
<n_blownapart>
apeiros: that is rough but I think I'm starting to see it. thanks very much.
hbpoison has joined #ruby
tekacs has quit [Quit: Disappearing... *poof*]
jaygen has quit [Read error: Connection reset by peer]
jaygen_ has joined #ruby
flyinprogramer has quit [Quit: flyinprogramer]
sabfer has joined #ruby
DrShoggoth has quit [Quit: Leaving]
pipopopo has quit [Ping timeout: 276 seconds]
vickaita has joined #ruby
wolfman2000 has joined #ruby
tekacs has joined #ruby
pipopopo has joined #ruby
owzim has joined #ruby
<owzim>
hello, after installing how can I access the gem? In every tutorial that uses a gem the gem is accessible via its name instantly. Why not in my case?
<thinkit>
are any freelancers available in here for work?
<owzim>
ruby work?
<thinkit>
I am looking to launch a social ratings website and have the html/css all done and just need someone to code the backend.
<thinkit>
got specs all written out.
<thinkit>
and design ready to go
<owzim>
backend is not my thing =) sorry
<thinkit>
owzim: yes preferably.
sabfer has left #ruby [#ruby]
Takehiro has joined #ruby
<wolfman2000>
Evening. Foundation CSS question: when using the top-bar and dropdown functionality, there is a white triangle to the right of the initial li that contains the drop down choices. How can I customize this triangle? I haven't found where in the CSS that is utilized.
freakazoid0223 has joined #ruby
cableray has joined #ruby
warb0`laptop has quit [Quit: Lost terminal]
CaptainJet has quit []
<apeiros>
wolfman2000: this is #ruby, not #css
hotovson has joined #ruby
<wolfman2000>
apeiros: my bad. I thought that it was acceptable here since foundation is tied to ruby in some way. Compass or something.
vickaita has quit [Ping timeout: 246 seconds]
g-ram has joined #ruby
Vinz_ is now known as Vinz_`
alvaro_o has quit [Quit: Ex-Chat]
scx has quit [Read error: Connection reset by peer]
adeponte has joined #ruby
mneorr has quit [Remote host closed the connection]
<katfro>
I'm really new to this and hoping I can get a hand? I can get ri to give me useful info as root, but not as my regular user in the terminal. What can I do to fix this?
havenn has joined #ruby
d3c has quit [Read error: Connection reset by peer]
love_color_text has quit [Remote host closed the connection]
irleif has joined #ruby
Vert has joined #ruby
monkegjinni has quit [Remote host closed the connection]
havenn has quit [Ping timeout: 260 seconds]
_alejandro has joined #ruby
<apeiros>
shevy3: nag the author until he updates
<apeiros>
shevy3: or patch yourself
yshh has quit [Remote host closed the connection]
und3f1 has joined #ruby
und3f has quit [Read error: Connection reset by peer]
<katfro>
Please help? I can use RDoc by typing ri ___ as root, but not as my normal user. I don't know how to fix this.
love_color_text has quit [Ping timeout: 244 seconds]
<Hanmac>
sheerun and you maybe do not understand that ruby has string interpolation too
<sheerun>
Hanmac: the question is not about interpolation, bro
Xeago has quit [Remote host closed the connection]
pmros has joined #ruby
<shevy3>
what do you want ruby to do with %
<pmros>
hi!
<shevy3>
'%3s' % '1' -> ' 1'
<Hanmac>
sheerun rubys % method is more mighty than everything Scala could do :'D
withnale has joined #ruby
ABK has quit [Read error: Connection reset by peer]
<sheerun>
It's about rewriting: %r(foo bar $baz) = String.r("foo bar $bar", baz)
<sheerun>
And allowing new % methods
<Hanmac>
why? why do you want to write String.r ? why? ...
<shevy3>
but String.r is just for regexes
<shevy3>
I dont even use %r myself, I always use // directly
mengu has quit [Read error: Connection reset by peer]
mengu has joined #ruby
mengu has quit [Changing host]
mengu has joined #ruby
<sheerun>
/ is build in language, as well as %r
<sheerun>
desugaring %r to method invocation makes language extensible
<Hanmac>
sheerun and then weeping why ruby loses 90% of its speed
<sheerun>
Hanmac: you can add operators to Int, and it does not mean that some basic operators are optimized in C
<sheerun>
That's not an argument
<sheerun>
some operators can't be optimized*
chussenot has quit [Quit: chussenot]
<Hanmac>
some features cant be done with "method invocation"
Morkel has quit [Quit: Morkel]
ltsstar has joined #ruby
scx has joined #ruby
kidoz has quit [Quit: Ухожу я от вас]
<pmros>
have you tried ruby 2.0.0-preview1?
<sheerun>
All features of current % notations can
danneu has quit [Quit: WeeChat 0.3.8]
<Hanmac>
sheerun: /(?<name>\d+)/ =~ "a123b";name
Axsuul has quit [Ping timeout: 265 seconds]
seanyo has joined #ruby
<sheerun>
ok, that's hard
jlwestsr has joined #ruby
Emmanuel_Chanel has quit [Quit: Leaving]
* Hanmac
wins
<shevy3>
guys what is better
<eph3meral>
that is quite mysterious
ABK has joined #ruby
<eph3meral>
I take it (?…) is zero width lookahead?
<eph3meral>
but what's <name>
<shevy3>
raise "Not a string" unless input.is_a? String
<shevy3>
vs.
<shevy3>
input = input.to_s
<sheerun>
Hanmac: but it's also inconsistent on Ruby side
<eph3meral>
and I thought // is regex, but you guys are saying something about method invocations and %r() ? where do I read about those? (as in, not "the manual" but which chapter would that be in?)
<shevy3>
and I mean in general, in a collection of 10.000 different .rb files
<Hanmac>
it does all standing in the docs, why is noone reading it?
clj_newb has quit [Ping timeout: 252 seconds]
<apeiros>
sheerun: that behavior is clearly documented
<apeiros>
and it has a clear reason why it is that way
<sheerun>
documented incostintency
<apeiros>
(no dynamic lvar creation)
<Hanmac>
"If =~ is used with a regexp >>>literal<<< with named captures, captured strings (or nil) is assigned to local variables named by the capture names."
<apeiros>
sheerun: expected insanity
<apeiros>
(from your part, I mean)
<eph3meral>
Hanmac: hmm, so is (? zero width? or is (? part of this "named capture" business where it's required that you have (?<foo> for example?
<sheerun>
why insanity?
<apeiros>
sheerun: implement a language yourself and learn
<apeiros>
hint, if you use hashes to implement lvars, you're doing it wrong™
<Hanmac>
eph3meral: named captures: /(?<foo>.)(?<bar>.)(?<baz>.)/.names #=> ["foo", "bar", "baz"]
irleif has quit [Quit: Computer has gone to sleep.]
nari has quit [Ping timeout: 252 seconds]
<eph3meral>
Hanmac: (? is normally the zero width assertion e.g. in perl, is that the case here as well or is (? a specific part of the named capture syntax?
<eph3meral>
I'm guessing the latter
<eph3meral>
I just want to double check
<eph3meral>
or, I suppose it could be both :)
lushious has quit [Ping timeout: 252 seconds]
<Hanmac>
both
<apeiros>
eph3meral: no, (? starts special groups
<apeiros>
(?: e.g. is not zero-width either and is older than look-arounds
<apeiros>
(it's simply a non-capturing group)
<apeiros>
with the addition of allowing you to specify different flags for a sub-part of your regex
Emmanuel_Chanel has joined #ruby
<eph3meral>
wow, subflags
<eph3meral>
where's the docs on the syntax for that?
<apeiros>
ri Regexp
<apeiros>
iirc as of 1.9.3 it's properly documented
<apeiros>
it's simply (?i-m: (before the - is added flags, behind the - is removed flags) (iirc)
mhag has joined #ruby
Erfankam has quit [Ping timeout: 260 seconds]
<apeiros>
also you can just /some regex/i.to_s
<apeiros>
it'll output it in that syntax (to enable composed regexen)
scx has quit [Ping timeout: 255 seconds]
<eph3meral>
nifty
irleif has joined #ruby
<sheerun>
apeiros: There's nothing wring with that. See for example Scala's unapply method.
* Hanmac
sings "Ruby is better than Scala ..."
<apeiros>
sheerun: and how's scala's unapply method related to local variables?
lushious has joined #ruby
hbpoison has joined #ruby
scx has joined #ruby
<apeiros>
or are we making arguments by non-sequitur
<sheerun>
it extracts them from object
<apeiros>
like php's - what was it… - explode?
<eph3meral>
sheerun, you said "/ is build in language, as well as %r", were you referring to Scala there?
<sheerun>
no, to ruby
hiroyuki has quit [Read error: No route to host]
<eph3meral>
ok, what is "build in language"?
<eph3meral>
like, what does that mean? you can use / for something other than regex?
<sheerun>
is defined as language's syntax
<apeiros>
s/build/built/
<apeiros>
and yeah, it means it's syntax. it's interpreted at parse-time already.
<eph3meral>
ahh, built-ins, gotcha
<sheerun>
and don't desugar to functions / methods
<eph3meral>
mmm, I don't understand that either, what?
<eph3meral>
functions / methods?
<apeiros>
ah, it wasn't explode, it was extract
mengu_ has joined #ruby
mengu_ has quit [Changing host]
mengu_ has joined #ruby
mengu has quit [Remote host closed the connection]
nedbat has left #ruby ["Leaving"]
<sheerun>
%r(foo bar $baz) => String.r("foo bar $bar", baz)
<apeiros>
sheerun: from googling, unapply doesn't seem to do what you claim it to do
<eph3meral>
extract() was quite handy for making template handlers
<eph3meral>
almost as bad as eval, but that's the one thing it's sort of legit for IMO
<sheerun>
and String.r would instantiate Regexp class
hbpoison has quit [Ping timeout: 256 seconds]
<eph3meral>
sheerun: what's wrong with Regex.new ?
<eph3meral>
or // ?
Erfankam has joined #ruby
<sheerun>
nothing, I talked about % notation
<sheerun>
It's not generalized
<apeiros>
also, why don't you just use String.r("…")
tungd has quit [Read error: Connection reset by peer]
<apeiros>
it is generalized. generalized as syntax, not methods.
<sheerun>
??
pjb3 has quit [Quit: pjb3]
Erfankam has quit [Client Quit]
tungd has joined #ruby
<apeiros>
it's a design decision to have something as syntax. there's rationales, and you're just blowing them away with "I don't like it and I think it's not generalized". the first is a subjective matter and the second just wrong.
<eph3meral>
sheerun, ok, so String.r doesn't exist and you'd like it to? what exactly is .r supposed to do here?
<eph3meral>
and how do you get from $baz to $bar in `%r(foo bar $baz) => String.r("foo bar $bar", baz)`
<sheerun>
that's typo
<eph3meral>
ok, so what's it supposed to be?
<sheerun>
Custom interpolation
<shevy3>
eph3meral: except that there are like ten different ways of eval in ruby
<sheerun>
you can do things to baz variable
<iamjarvo>
so this exercise wanted me to convert a nested array to a hash.in the inner loop i looped through the contents of the array but the writer loops through the headers. i was wondering which is the preferred way and if there are any downsides to either http://pastie.org/private/zdzsqmzs4v4z0nqgam3czw
<shevy3>
in ruby 3.0 we will have fifty ways to eval
<sheerun>
And then insert to "foo bar $baz" string wherever you want
<eph3meral>
shevy3: I wasn't talking about ruby in the context of my comment about extract/eval, I was talking about PHP
mercwithamouth has quit [Ping timeout: 256 seconds]
colinbm has joined #ruby
<sheerun>
do we have some ruby repl bot here?
irleif has quit [Quit: Computer has gone to sleep.]
Virunga has quit [Remote host closed the connection]
pjb3 has joined #ruby
butblack has joined #ruby
Virunga has joined #ruby
<apeiros>
sheerun: no
<apeiros>
there was one, but I guess it was removed due to security concerns.
Erfankam has joined #ruby
<sheerun>
by the chat admins or creator of bot? don't you recognize?
iPhoneMRZ has joined #ruby
tungd has quit [Read error: Connection reset by peer]
tungd has joined #ruby
<shevy3>
the author could no longer host it
<shevy3>
Xeago at one point wanted to host it but it never happened
<shevy3>
so the bot died a tragic death
<shevy3>
like all ruby projects
rbuck has joined #ruby
ABK has quit [Read error: Connection reset by peer]
<sheerun>
lol
ABK has joined #ruby
punkrawkR has joined #ruby
<rbuck>
i am going to cross post a question here because i am not getting any response on the rubygems irc nor the rubygems google group...
irleif has joined #ruby
<rbuck>
is there anyone here that could explain one detail about gem push? namely why when i push the new gem date is the date of the FIRST gem pushed, and the lastest description is that of the FIRST gem pushed???
<rbuck>
9:16
<rbuck>
9:17
<rbuck>
i'd like later gems to have updated descriptions and dates reflected on http://rubygems.org/
<rbuck>
how does one change the description and have it show up on http://rubygems.org/, the date too? i use a .gemspec with spec.date and spec.description fields that i update
pen has quit [Remote host closed the connection]
colinbm has quit [Quit: colinbm]
beilabs has joined #ruby
<shevy3>
dunno but cant you cheat and simply make it a part of the description? :D
Virunga has quit [Ping timeout: 255 seconds]
<rbuck>
the description doesnt update on rubygems.org either or i would do that
<rbuck>
it just displays the first description only
<apeiros>
rbuck: kudos for disclosing that you crosspost
ABK has quit [Read error: Connection reset by peer]
<shevy3>
rbuck yeah but you could just use that description part to add additional information or?
crackfu has quit [Remote host closed the connection]
<shevy3>
and python + perl + ruby combined could dethrone php!!!!!!
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
crackfu has quit [Read error: Connection reset by peer]
crackfu has joined #ruby
ABK has quit [Read error: Connection reset by peer]
<rbuck>
shevy3 - is my understanding flawed? i would have thought that spec.date becomes the published date on rubygems.org, and the spec.description becomes the page title on that site. is that right/wrong?
ABK has joined #ruby
paul_s has quit [Quit: paul_s]
<rbuck>
btw, i notice some projects don't use spec.date at all but they get updated dates
ABK has quit [Read error: Connection reset by peer]
ABK has joined #ruby
<rbuck>
also, all i do is simply `gem push mygemfile.gem`
Virunga has joined #ruby
<rbuck>
shevy3, or others, am i missing a step when pushing a gem to rubygems.org?
<shevy3>
rbuck no real idea yet, I try to use gems in the simplest manner possible
<shevy3>
I also never have a spec.date thing
<shevy3>
I push via alias always :)
<shevy3>
gem push *.gem
samphippen has joined #ruby
hiroyuki has joined #ruby
<rbuck>
let me drop the spec.date
<rbuck>
maybe that will help
lkba has quit [Ping timeout: 276 seconds]
n00b982 has quit [Ping timeout: 255 seconds]
<rbuck>
unrelated, re TIOBE, i am surprised ruby isnt higher; i've only used it for 5+ months, after doing c/c++/java for 15-20 years; loving ruby more than any other language i have ever used
u89 has joined #ruby
<rbuck>
i **love** enumerable, array, hash; wow, i wish we had that flexibility and simplicity in other languages
Banistergalaxy has quit [Ping timeout: 256 seconds]
<rbuck>
i am using ruby very successfully for analytics; pivoting data, summarization, etc. it works great and is really succinct
Erfankam has quit [Ping timeout: 264 seconds]
hbpoison has joined #ruby
ltsstar has quit [Quit: ltsstar]
<shevy3>
I think TIOBE changes very slowly and it shows only a specific part of usage
bairui_ has joined #ruby
<shevy3>
but still the thing is, python is used more widely than ruby... and probably perl is used more widely than ruby too, if only for legacy reasons alone :(
Banistergalaxy has joined #ruby
beilabs has quit [Ping timeout: 276 seconds]
ABK has quit [Read error: Connection reset by peer]
ABK has joined #ruby
bairui has quit [Ping timeout: 265 seconds]
bairui_ is now known as bairui
<rbuck>
sorry, i gotta flame: having used python quite extensively, no offense to python fans, but python sucks; i spend more time spelunking to find information i need than reading any doc, then spend lots of time fixing crud thrown over the fence (have had to patch ssh/scp/sftp/boto and the list goes on)
bigmcq77 has joined #ruby
irleif has quit [Quit: Computer has gone to sleep.]
<rbuck>
i am liking ruby because for the most part, it simply works, and works as advertized; the community does a great job building quality components
<shevy3>
well the documentation of ruby is quite a bit away from being perfect :(
dhruvasagar has quit [Ping timeout: 240 seconds]
<shevy3>
some components I just hate
<shevy3>
like webrick
pjb3 has joined #ruby
<shevy3>
and I dont like drb too much either
<shevy3>
the core of ruby is ok
AndChat| has joined #ruby
n00b982 has joined #ruby
Banistergalaxy has quit [Ping timeout: 255 seconds]
rjsamson has joined #ruby
beilabs has joined #ruby
mappum has joined #ruby
<rbuck>
i love event machine; though it was tricky getting a single event machine working with both amqp and sinatra/thin in a single vm app, it works fantastic, and is very light weight
Zai00 has joined #ruby
squidz has quit [Quit: Lost terminal]
freeayu has quit [Remote host closed the connection]
hemanth has quit [Read error: Connection reset by peer]
hemanth has joined #ruby
F1skr has quit [Quit: WeeChat 0.3.9]
juarlex__ has joined #ruby
juarlex_ has quit [Read error: Connection reset by peer]
fantazo has joined #ruby
tsousa has joined #ruby
Slivka has quit [Read error: Connection reset by peer]
<tsousa>
which tutorial you guys recommend for learning ruby?
tnk1 has quit [Read error: Connection reset by peer]
mappum has quit [Ping timeout: 256 seconds]
Emmanuel_Chanel has quit [Quit: Leaving]
tnk1 has joined #ruby
ltsstar has joined #ruby
jfire has joined #ruby
_alejandro has quit [Ping timeout: 260 seconds]
_alejandro has joined #ruby
ltsstar has quit [Ping timeout: 252 seconds]
leifmadsen has joined #ruby
<leifmadsen>
morning all! I'm going to order myself a ruby book, and am curious what one(s) people prefer?
jfire has left #ruby [#ruby]
<leifmadsen>
I've done some ruby hacking with chef over the last few months, but want to expand my knowledge and style
pjb3 has quit [Quit: pjb3]
rakunHo has quit [Remote host closed the connection]
baphled has joined #ruby
huntercool has joined #ruby
tsousa has quit [Remote host closed the connection]
daniel_- has quit [Ping timeout: 256 seconds]
uuair has joined #ruby
love_color_text has joined #ruby
Virunga has quit [Remote host closed the connection]
Erfankam has joined #ruby
monkegjinni has joined #ruby
Emmanuel_Chanel_ has quit [Quit: Leaving]
Trioke has joined #ruby
mercwithamouth has joined #ruby
g-ram has quit [Quit: Computer has gone to sleep.]
love_color_text has quit [Ping timeout: 255 seconds]
Slivka has joined #ruby
Slivka has quit [Read error: Connection reset by peer]
<rbuck>
shevy3: i removed the spec.date field, and now BOTH the current date AND the description shows up on rubygems.org !!! there is some sort of bug there
fantazo has quit [Remote host closed the connection]
moshee has quit [Ping timeout: 240 seconds]
scx has quit [Ping timeout: 260 seconds]
moshee has joined #ruby
jcaudle has joined #ruby
scx has joined #ruby
<shevy3>
rbuck hehehe
Cidan is now known as zz_Cidan
<shevy3>
can you gimme a link to that gem?
<shevy3>
leifmadsen: I used the pickaxe back then
<shevy3>
"the ruby programming language" is also ok
hotovson has quit [Remote host closed the connection]
<shevy3>
but remember in the end, only the stuff you write on your own is really what counts
jcaudle has quit [Client Quit]
<leifmadsen>
shevy3: for sure -- I tend to use books more for syntax usage and best practices as I've done enough hacking in my day to pretty much know the logic I want to implement
<leifmadsen>
so far have been pretty impressed with the low learning curve of ruby
<leifmadsen>
looping through arrays is too easy.
<shevy3>
well
<shevy3>
there are the easy parts, yes
<shevy3>
but ruby is also a bit complex :\
<leifmadsen>
ya most languages get complex at some level, even English :)
<shevy3>
procs, and when to use thim, still confuses me
<shevy3>
*them
GazCMarsh has joined #ruby
<shevy3>
always when I seem to be end up wanting to use a proc, it seems as if I can completely ignore them, and still achieve all I want to use
<leifmadsen>
ya, I'm to the point now I want to start learning some of the more complex functionality
<shevy3>
yeah, that's where things become more complicated for me hehe
<shevy3>
my brain likes for things to remain simple and straightforward
chussenot has joined #ruby
<leifmadsen>
shevy3: ditto
<leifmadsen>
shevy3: which book is the pickaxe book? Is that an O'Reilly published one?
<mercwithamouth>
i know there's a instance_variables method but i'm not sure gives me the control i want
samphippen has joined #ruby
<canton7>
mercwithamouth, did you mean :name not name: ?
<mercwithamouth>
canton7: o_O; possibly lol
chimkan has quit [Ping timeout: 256 seconds]
jeffreybaird has joined #ruby
<mercwithamouth>
canton7: thank you
<mercwithamouth>
that was blowing my mind =P "this just seems like it should work!"
Tania has quit [Read error: Connection reset by peer]
n00b982 has joined #ruby
havenn has joined #ruby
butblack has joined #ruby
<canton7>
it's often handy to strip things back to the basic... does array << {foo: => 'test'} work? OK, what abouts puts {foo: => 'test'} ? That failed, how about puts foo:
<canton7>
By that point, the problem should be fairly clear :P
hsbt_away is now known as hsbt
linoj has joined #ruby
chimkan has joined #ruby
n00b982 has quit [Ping timeout: 248 seconds]
jeffreybaird has quit [Quit: jeffreybaird]
snearch has quit [Quit: Verlassend]
maletor has joined #ruby
leoncamel has quit [Ping timeout: 252 seconds]
chimkan has quit [Quit: chimkan]
tenmilestereo has quit [Quit: Leaving]
Guest8723 has joined #ruby
Guest8723 has left #ruby [#ruby]
dhruvasagar has joined #ruby
samphippen has quit [Quit: Computer has gone to sleep.]
arturas has joined #ruby
rafter has joined #ruby
hbpoison has quit [Ping timeout: 260 seconds]
marius has quit []
rjsamson has quit [Remote host closed the connection]
rjsamson has joined #ruby
<mercwithamouth>
canton7: very true....i was too busy 'trying something new' to pay attention =(
earthquake has quit [Quit: earthquake]
Araxia has joined #ruby
Keva161 has joined #ruby
CamonZ has joined #ruby
<CamonZ>
hey
arvindravi has joined #ruby
<CamonZ>
is it valid ruby to use a rescue clause without a begin clause?
keyvan has quit [Remote host closed the connection]
earthquake has joined #ruby
leoncamel has joined #ruby
<mercwithamouth>
when thinking about regular expressions.....what would you call the actual symbols you use to define a regex? (.*\..~, etc) not operators???
BadLarry has quit [Quit: quitting]
chimkan has quit [Client Quit]
<matti>
mercwithamouth: \. is a dot and ~ will be just syntax sugar; but . (any character) will be an operator and then + or * might be called quantifier.
hbpoison has quit [Ping timeout: 256 seconds]
<matti>
mercwithamouth: Why do you need it?
BadLarry has joined #ruby
rbuck has joined #ruby
iamjarvo has quit [Quit: Computer has gone to sleep.]
<mercwithamouth>
matti: ahh i see. i'm just toying with regular expressions and writing notes and it occurred to me that I didn't know the names of the symbols I was using. just general curiosity
maletor has quit [Quit: Computer has gone to sleep.]
huntercool has quit [Ping timeout: 246 seconds]
earthquake has quit [Quit: earthquake]
baroquebobcat_ has joined #ruby
philcrissman has quit [Remote host closed the connection]
JustinCampbell has quit [Remote host closed the connection]
uuair has quit [Quit: uuair]
juha_ has quit [Ping timeout: 244 seconds]
anachronistic has quit [Quit: anachronistic]
elico has joined #ruby
poga has quit [Remote host closed the connection]
Gmind has joined #ruby
brianpWins has joined #ruby
khakimov has quit [Quit: Computer has gone to sleep.]
samuelharden has joined #ruby
`brendan has quit [Quit: - nbs-irc 2.39 - www.nbs-irc.net -]
khakimov has joined #ruby
ejholmes has joined #ruby
savage- has joined #ruby
jeffreybaird has quit [Quit: jeffreybaird]
baroquebobcat_ has quit [Quit: baroquebobcat_]
roelof_ has joined #ruby
Schafro has quit [Quit: Leaving]
<roelof_>
Anyone who knows how to solve this error : undefined method `[]' for nil:NilClass (NoMethodError) on this code : https://github.com/roelof1967/tamara
Tearan has joined #ruby
jjbohn is now known as jjbohn|afk
maxer has joined #ruby
<shevy3>
you have a nil there
<shevy3>
it probably is supposed to be an array
<shevy3>
on array you can use []
<shevy3>
but on a nil, the [] will fail
hbpoison has joined #ruby
jcaudle has joined #ruby
Tearan has quit [Client Quit]
<havenn_>
you could call #to_a on your nil :P
<havenn_>
roelof_: #RubyOnRails
begriffs has joined #ruby
savage- has quit [Quit: savage-]
<roelof_>
haven : Do you mean I have asked in the wrong forum ???
tenmilestereo has joined #ruby
qwerxy has joined #ruby
<havenn_>
roelof_: Usually #RubyOnRails is a better channel when the problem involves Rails. Not always I guess.
roelof_ has left #ruby [#ruby]
<begriffs>
I'm writing a gem that provides a module in its lib/ folder and a Ruby script in bin/. However, when I say require 'gem_name' in the script and try to run it, the require doesn't work. What am I doing wrong?
pjb3 has joined #ruby
sepp2k1 has joined #ruby
<begriffs>
I need to access the gem's module from within the script, that's why I want to require the file.
baroquebobcat has joined #ruby
zeknox has quit [Quit: Lost terminal]
juha_ has joined #ruby
darthdeus has quit [Quit: Leaving...]
hbpoison has quit [Ping timeout: 265 seconds]
jgrevich_ has joined #ruby
<havenn_>
begriffs: In your .gemspec you'd usually #require_paths = ["lib"]
<havenn_>
begriffs: Oh, I might not have understood your question. Did you generate the gem structure with 'bundle gem gem_name_here' or use another generator or did it manually?
<begriffs>
I used bundler to create my gem, so it added the require_paths line you mention, @havenn
tds has joined #ruby
<havenn_>
begriffs: Gotcha.
<begriffs>
Not sure if I have to run another command to "install" my gem or something before I can require the module stuff from bin/
n00b982 has joined #ruby
wallerdev has quit [Quit: wallerdev]
<havenn_>
begriffs: Did ya 'gem build blahblah.gemspec'?
<begriffs>
No. Do I have to run that everytime I want to test my binary?
_alejandro has joined #ruby
|Monie| has joined #ruby
linoj_ has joined #ruby
baroquebobcat_ has joined #ruby
awarner has quit [Remote host closed the connection]
ViperMaul|_ has joined #ruby
<havenn_>
begriffs: Ya, pretty much. You can just build it locally and then gem install it from the local copy.
<shevy3>
swarley: what worked for me was to write a file called "projects"
<shevy3>
projects.cgi actually. in there I list my projects, and assign work-load to it, what I want to do, what I should do etc...
<shevy3>
this keeps growing and growing and is a great way to work on things and features little by little
jaygen has joined #ruby
<shevy3>
without it getting (too) boring
Cache_Money has joined #ruby
jaygen_ has quit [Read error: Connection reset by peer]
<jrajav>
I don't think I've ever reached a point yet where I'm asking myself what to do next
<jrajav>
Rather I can barely keep track of all the stuff I want to continue working on
samuelharden has joined #ruby
jaygen has quit [Read error: Connection reset by peer]
swarley has quit [Ping timeout: 252 seconds]
<jrajav>
In fact, what I really need to do right now is actually finish some crap
jaygen has joined #ruby
Gmind has quit [Quit: Leaving.]
arielpts has quit [Ping timeout: 276 seconds]
Danielpk has quit [Ping timeout: 255 seconds]
arielpts has joined #ruby
jaygen has quit [Read error: Connection reset by peer]
thinkdevcode has joined #ruby
samuelharden has quit [Ping timeout: 268 seconds]
armando_canals has joined #ruby
mneorr has joined #ruby
jaygen has joined #ruby
swarley has joined #ruby
jeremywrowe has joined #ruby
i8igmac has quit [Quit: Leaving]
rburton- has joined #ruby
otters has quit [Ping timeout: 260 seconds]
quest88 has quit [Quit: quest88]
Danielpk has joined #ruby
ceej has quit [Quit: ceej]
jeremywrowe_ has joined #ruby
rbuck has joined #ruby
mneorr has quit [Remote host closed the connection]
ABK has quit [Read error: Connection reset by peer]
nga4 has quit [Ping timeout: 255 seconds]
jeremywrowe has quit [Ping timeout: 256 seconds]
jeremywrowe_ is now known as jeremywrowe
rbuck has quit [Client Quit]
Bosma has joined #ruby
mengu_ has quit [Read error: Connection reset by peer]
jaygen_ has joined #ruby
dakine has quit [Quit: Leaving]
jaygen has quit [Ping timeout: 252 seconds]
jeremywrowe has quit [Quit: jeremywrowe]
nicoulaj has quit [Read error: Operation timed out]
Zai00 has quit [Quit: Zai00]
shevy3 has quit [Ping timeout: 246 seconds]
colinbm has joined #ruby
ejholmes has quit [Quit: ejholmes]
ukd1 has joined #ruby
ls4352 has joined #ruby
<ukd1>
hey
Rydefalk has quit [Read error: Connection reset by peer]
Rydefalk_ has joined #ruby
ukd1 has quit [Client Quit]
jblack has joined #ruby
syamajala has quit [Remote host closed the connection]
jaygen_ has quit [Read error: Connection reset by peer]
starship has quit [Quit: WeeChat 0.3.9]
jaygen has joined #ruby
karakedi has joined #ruby
colinbm has quit [Quit: colinbm]
kzrl has quit [Ping timeout: 240 seconds]
ABK has joined #ruby
_alejandro has joined #ruby
<ls4352>
problem with unpack - i have a 6 byte packed decimal field when i unpack the field everything is fine except the last 4 bits which is the sign bit it gives all field a sign of "f" which is +, raw data has some negative field which is a "d".
Tearan has joined #ruby
werdnativ has quit [Quit: werdnativ]
kzrl has joined #ruby
yourmysin has quit [Remote host closed the connection]
elentras has joined #ruby
qwerxy has quit [Quit: offski]
Xeago has joined #ruby
verbad has quit []
un1x01d has joined #ruby
Rydefalk has joined #ruby
Rydefalk_ has quit [Read error: Connection reset by peer]
ABK has quit [Read error: Connection reset by peer]
hbpoison has joined #ruby
kkh is now known as Guest92447
bradhe has joined #ruby
_alejandro has quit [Ping timeout: 244 seconds]
ls4352 has quit [Ping timeout: 244 seconds]
<un1x01d>
Hi, trying to understand how to do this in ruby "grep ^string file.txt | awk '{print $2}'", any directions ?
anderse has joined #ruby
qwerxy has joined #ruby
ABK has joined #ruby
shevy3 has joined #ruby
Takehiro has quit [Remote host closed the connection]
kirun has quit [Ping timeout: 265 seconds]
<apeiros>
don't know about the awk part, but the grep part: File.foreach('file.txt').grep(/^string/)
iamjarvo has quit [Ping timeout: 252 seconds]
KnowTheLedge has quit [Read error: Connection reset by peer]
jlwestsr has quit [Ping timeout: 246 seconds]
<un1x01d>
apeiros, thanks - the awk piece would just print the second field after the space delimiter, any way to do that in ruby ?
KnowTheLedge has joined #ruby
armando_canals has quit [Ping timeout: 260 seconds]
<havenn_>
un1x01d: "first second third".split[1] #=> "second"
<havenn_>
un1x01d: Or you could use regex.
<un1x01d>
havenn_, can i use a different delimiter with split ?
<shevy3>
of course I don't agree much at all with him, but it's up to you anyway what to think of it, it is just one side of the medal :) hope you can upgrade your gem version either way (I dont even know how to manage different versions in debian... you cant install two ruby versions into the same prefix usually right?)
brianpWins has joined #ruby
u89 has joined #ruby
n00b982 has joined #ruby
Gliner is now known as Rix
Axsuul has joined #ruby
VegetableSpoon has joined #ruby
jjbohn has quit [Quit: Leaving...]
lkba has quit [Ping timeout: 252 seconds]
proshot is now known as statarb3
h4mz1d has joined #ruby
statarb3 has quit [Changing host]
statarb3 has joined #ruby
Cultofmetatron has joined #ruby
somazero has quit [Ping timeout: 265 seconds]
baroquebobcat has quit [Quit: baroquebobcat]
hsbt is now known as hsbt_away
joeycarmello has quit [Read error: Connection reset by peer]
fredjean has joined #ruby
<dpk>
hmm, is there something like %w that will give me symbols instead of strings?
otters has joined #ruby
<dpk>
(1.9.3)
blacktulip has joined #ruby
bier_ has joined #ruby
zarubin has quit [Read error: Connection reset by peer]
earthquake has quit [Quit: earthquake]
zarubin has joined #ruby
darthdeus has joined #ruby
hsbt_away is now known as hsbt
<swarley>
dpk; %I has been proposed for 2.0 i dont believe it is in 1.9
<dpk>
swarley: k, thanks. .map(&:to_sym) will do then
F1skr has quit [Quit: WeeChat 0.3.9]
daniel_- has joined #ruby
sn0wb1rd has quit [Quit: sn0wb1rd]
helichopter has quit [Ping timeout: 244 seconds]
n00b982 has quit [Ping timeout: 276 seconds]
lkba has joined #ruby
sn0wb1rd has joined #ruby
Chryson has joined #ruby
cirwin has joined #ruby
<havenn>
dpk: %s{hi} #=> :hi
<swarley>
huh, i didnt notice that
<swarley>
i tried %S though
<burgestrand>
It’s just one symbol.
<dpk>
havenn: thank you for your suggestion. please file it into the nearest trash can.
<burgestrand>
Same as :"hi"
<swarley>
oh
ejholmes has joined #ruby
<havenn>
yeah, not like %w
<swarley>
yeah i didnt think so
<burgestrand>
%i works in 2.0.0 though. :)
<burgestrand>
Like you said swarley
ejholmes has quit [Client Quit]
<swarley>
we should go % crazy. Have one for an array of constants, an array of methods, and array of arrays..
<swarley>
and an*
tbrock has joined #ruby
<tbrock>
any of you guys know a ton about jruby?
<swarley>
not a ton.
<tbrock>
I'm having trouble whereby Process.kill(0, pid) returns immediately
<tbrock>
I *think* before the process actually starts
<swarley>
are you running it in a threaded environment?
selwyn has quit [Ping timeout: 245 seconds]
<tbrock>
no
fredjean has quit [Quit: Computer has gone to sleep.]
<tbrock>
i mean, the process should run asynchronously because i'm using Process.spawn
<tbrock>
so in that sense, yes
armando_canals has quit [Ping timeout: 276 seconds]
elaptics`away is now known as elaptics
bradhe has quit [Remote host closed the connection]
_alejandro has joined #ruby
hsbt is now known as hsbt_away
<tbrock>
jruby is a huge pain in the ass
<swarley>
what is the situation that you are killing a process manually?
<swarley>
Like, why are you doing it?
n00b982 has joined #ruby
<tbrock>
well kill with zero signal just stats the process to see if its running
<tbrock>
works perfect in 1.8.7 1.9.3 and 2.0.0
<tbrock>
obviously you can't fork + exec in jruby
Araxia has quit [Quit: Araxia]
<tbrock>
so you have to use Process.spawn
havenn has quit [Remote host closed the connection]
<tbrock>
which is kinda the same
crackfu_ has joined #ruby
<tbrock>
anyway, after you spawn a process, i need to check if its running
<tbrock>
so you call Process.kill(0, pid)
havenn has joined #ruby
sn0wb1rd_ has joined #ruby
samphippen has joined #ruby
butblack has left #ruby [#ruby]
keyvan has joined #ruby
keyvan has quit [Changing host]
keyvan has joined #ruby
tds has joined #ruby
havenn has quit [Read error: Operation timed out]
h4mz1d has quit [Ping timeout: 268 seconds]
sn0wb1rd has quit [Ping timeout: 252 seconds]
sn0wb1rd_ is now known as sn0wb1rd
adeponte has joined #ruby
hbpoison has joined #ruby
jake_ has joined #ruby
sn0wb1rd has quit [Quit: sn0wb1rd]
heftig is now known as nethearsonanzani
nethearsonanzani is now known as heftig
sn0wb1rd has joined #ruby
_alejandro has quit [Ping timeout: 244 seconds]
havenn has joined #ruby
somazero has joined #ruby
hbpoison has quit [Ping timeout: 246 seconds]
jake_ has quit [Ping timeout: 276 seconds]
cousine has joined #ruby
baroquebobcat has joined #ruby
<shevy3>
dumdedum
rjsamson has joined #ruby
baroquebobcat has quit [Client Quit]
F1skr has joined #ruby
geggam has quit [Quit: planned network outage]
Tearan has quit [Quit: Sleepy Badger....]
ryanf has quit [Ping timeout: 252 seconds]
jarred_ has joined #ruby
banisterfiend has quit [Ping timeout: 246 seconds]
keyvan has quit [Remote host closed the connection]
keyvan has joined #ruby
keyvan has quit [Changing host]
keyvan has joined #ruby
tommylom1ykins is now known as tommylommykins
jjbohn has joined #ruby
Keva161 has quit [Quit: Leaving...]
mahmoudimus has quit [Ping timeout: 260 seconds]
answer_42 has quit [Quit: WeeChat 0.3.9]
darthdeus has quit [Quit: Leaving...]
hsbt_away is now known as hsbt
rjsamson has quit [Remote host closed the connection]
rjsamson has joined #ruby
rjsamson has quit [Read error: Connection reset by peer]
rjsamson has joined #ruby
helichopter has joined #ruby
bradhe has joined #ruby
mahmoudimus has joined #ruby
keyvan has quit [Remote host closed the connection]
qwerxy has joined #ruby
Cultofmetatron has quit [Remote host closed the connection]
Cultofmetatron has joined #ruby
workmad3 has joined #ruby
mpereira has joined #ruby
arturas has quit [Remote host closed the connection]
sysbeast has quit [Quit: Verlassend]
Cultofmetatron has quit [Ping timeout: 240 seconds]
workmad3 has quit [Ping timeout: 252 seconds]
bradhe has quit [Ping timeout: 256 seconds]
ejholmes has joined #ruby
adeponte has quit [Remote host closed the connection]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
<swarley>
blah i wish i knew what i wanted to do
<un1x01d>
"I'll start coding, you go ask what they want"
<swarley>
i've started like 3 little mini things today, and i want to finish none of them
<stanigator>
shevy3: What are you looking to do with mruby?
hsbt_away is now known as hsbt
iPhoneMRZ has joined #ruby
iPhoneMRZ has quit [Client Quit]
ryanf has joined #ruby
verbad has quit []
jjbohn|afk is now known as jjbohn
<shevy3>
stanigator: not sure yet... I want to learn C next, seriously (I always stopped when I came to pointers)
<stanigator>
shevy3: are you a student?
<shevy3>
and I'd rather use mruby than lua then. it's much easier to extend my ruby-knowledge, than learn lua when I know that ruby is the clearly superior overall language if compared with lua for merits of feature alone
<shevy3>
kind of :)
<shevy3>
but never informatics
jjbohn has quit [Quit: Leaving...]
<shevy3>
biology and chemistry mostly
irleif has quit [Quit: Computer has gone to sleep.]
<swarley>
pointers are meh. They are a lot less scary when you get the basics down
keyvan has joined #ruby
keyvan has quit [Changing host]
keyvan has joined #ruby
u89 has quit [Remote host closed the connection]
chimkan has quit [Ping timeout: 240 seconds]
rakl has joined #ruby
jjbohn has joined #ruby
Takehiro has quit [Remote host closed the connection]
mneorr has quit [Remote host closed the connection]
mpereira has quit [Ping timeout: 246 seconds]
mneorr has joined #ruby
srji has joined #ruby
mpereira has joined #ruby
anachronistic has quit [Quit: anachronistic]
<stanigator>
I may have a strange question here, but what are the main problems Ruby programmers typically face recently?
u89 has joined #ruby
<cirwin>
stanigator: what kind of thing are you looking for? Ruby programmers have problems when Strings and Symbols get mixed up for example
Astral has joined #ruby
Slivka has joined #ruby
srji has quit [Client Quit]
Astral is now known as Guest91311
Astral_ has joined #ruby
<stanigator>
cirwin: i don't have a good idea yet. I mean, I went through some tutorial materials earlier in the year, but not sure what's causing pros like you pain recently
tds has quit [Quit: tds]
havenn has quit [Remote host closed the connection]
<knite>
just learned about Procs, trying to figure out why my_array.map(&:foo) works when foo is a method but not a symbol. might not have my terms exactly correct here - what I mean is, the above works if I have an array of class instances and foo is a method, but not if foo is an attr_acessor.
havenn has joined #ruby
<cirwin>
knite: my_array.map(&:foo) is the same as my_array.map{ |x| x.foo }
<cirwin>
attr_accessor's are just methods, so it should work for either
v0n has quit [Ping timeout: 260 seconds]
<cakehero>
I'm having trouble understanding the proper way to build this SOAP request https://gist.github.com/e2d29d364cd733eee965 using savon - does anyone have any advice they can give me to help me out?
blacktulip has quit [Remote host closed the connection]
BrianJ has joined #ruby
savage- has joined #ruby
jimeh has joined #ruby
jjbohn has joined #ruby
Guest91311 has quit [Quit: Leaving]
butblack has joined #ruby
brianpWins_ has joined #ruby
brianpWins has quit [Ping timeout: 255 seconds]
brianpWins_ is now known as brianpWins
tbrock has quit [Quit: Leaving]
jblack has quit [Ping timeout: 252 seconds]
Russell^^ has quit [Quit: Russell^^]
havenn has joined #ruby
<havenn>
shevy3: If he could go back 20 years, would do away with global variables. :)
keyvan has quit [Remote host closed the connection]
keyvan has joined #ruby
keyvan has quit [Changing host]
keyvan has joined #ruby
<cirwin>
you don't need them when you can just change the value of constants :)
<havenn>
I wouldn't miss class variables either. >.>
<apeiros>
you don't need them even if you couldn't change the value of constants
<apeiros>
I miss useable cvars :(
<apeiros>
share them only between class & instances
<cirwin>
yeah, everything could be done on instances of constants
<stanigator>
who programs for a living here?
<cirwin>
meee!
<cirwin>
probably most people I'm guessing
<stanigator>
really?
<cirwin>
I'd have thought >50% of people here, but I might be wrong
<stanigator>
I have no idea either, hence wanted to ask to find out
<apeiros>
I do
<havenn>
I do, though I feel like an impostor.
keyvan has quit [Remote host closed the connection]
cakehero has quit [Quit: Computer has gone to sleep.]
<apeiros>
how come?
<apeiros>
you professionally code VB?
<cirwin>
oxymoron :p
BrianJ has quit [Quit: BrianJ]
<apeiros>
hm, my bash scripting is very weak, how do I require an argument to a script?
jenrzzz has quit [Ping timeout: 245 seconds]
<cirwin>
echo ${1?Please specify an argument}
Vert has quit [Read error: Connection reset by peer]
<cirwin>
(you might need to set -e for that to actually kill the script, but you should do that anyway)
<apeiros>
exit 1 will do to kill the script I'd say :)
alanp_ has joined #ruby
<havenn>
I have no CS degree. I enrolled in a few intro classes but never made it past the first day. Never had prereqs to take interesting classes.
jjbohn has quit [Quit: Leaving...]
<stanigator>
apeiros: interesting, can i hear more about it?
<stanigator>
just want to talk to more professional programmers to learn their stories
<havenn>
Philosophy then Law. Now Ruby. >.>
<cirwin>
havenn: you're the second person I know who did that — crazy wordl!
lenovodroid has quit [Read error: Connection reset by peer]
<apeiros>
cirwin: basically I'm having difficulties writing the `if then` part only
<apeiros>
I hate bash syntax :( always forget how it works…
lenovodroid has joined #ruby
<cirwin>
apeiros: yeah, if statements are not pretty: if [ "$1" == "" ]; then; fi
<cirwin>
I think you can be fancier, but that has the advantage of working
<apeiros>
; in the oddest places…
<apeiros>
that's quite a nice advantage :D
<cirwin>
just put everything on new lines
<apeiros>
works
<cirwin>
though I agree it looks odd to have then on a line on its own
alanp has quit [Ping timeout: 240 seconds]
<ccooke>
apeiros: if COMMAND ;then SOMETHING ; elif COMMAND; then SOMETHING ; else SOMETHIG ELSE ; fi
keyvan has joined #ruby
keyvan has quit [Changing host]
keyvan has joined #ruby
mahmoudimus has joined #ruby
<apeiros>
thanks cirwin
pac1 has quit [Quit: I got it one line of code at a time]
stanigator has quit [Quit: Page closed]
<ccooke>
apeiros: you can also short circuit if you just want something quick:
okapi has quit [Ping timeout: 256 seconds]
u89 has quit [Read error: Connection reset by peer]
Slivka has quit [Remote host closed the connection]
Takehiro has joined #ruby
u89 has joined #ruby
<ccooke>
[ "$1" ] || error "need a param"
Slivka has joined #ruby
<apeiros>
that's how I did it: if [ "$1" == "" ]; then; echo "USAGE: $0 DB_SUPERUSER"; exit 1; fi # on multiple lines, that is
<ccooke>
(note that you'd need to define error as a function for that)
<cirwin>
ccooke: he already rejected my ${1?need a param} idea :(
<ccooke>
cirwin: so sad
<apeiros>
cirwin: mind explaining that one?
<cirwin>
apeiros: looks good to me
<cirwin>
apeiros: ? is a variable modifier or something that means "if the variable $1 is not defined, output this error message"
<ccooke>
apeiros: you don't need the semicolkns after the 'then'
<apeiros>
ccooke: I have a newline there
<cirwin>
:- is the other useful one USERNAME=${1:-root} — will be $1 if $1 is defined, and use root as the default
Guest___ has joined #ruby
<ccooke>
right
<apeiros>
cirwin: but would that also terminate the script?
Zai00 has joined #ruby
<apeiros>
maybe I should just try…
<ccooke>
apeiros: and for brevity, the test I used is equivalent
<ccooke>
apeiros: if you have "set -e" above it, any error will terminate the script
<cirwin>
apeiros: yes
<cirwin>
it terminates it even without set -e
<apeiros>
ah yes, but it gives an ugly error message :(
keyvan has quit [Remote host closed the connection]
<cirwin>
true that :)
justinmcp has quit [Remote host closed the connection]
sertaconay has joined #ruby
dzmitry_ has joined #ruby
JarJar has joined #ruby
keyvan has joined #ruby
keyvan has quit [Changing host]
keyvan has joined #ruby
elico has quit [Quit: elico]
keyvan has quit [Remote host closed the connection]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
keyvan has joined #ruby
keyvan has quit [Changing host]
keyvan has joined #ruby
u89 has quit [Read error: Connection reset by peer]
chimkan has joined #ruby
u89 has joined #ruby
dmiller has joined #ruby
classix has quit [Ping timeout: 252 seconds]
keyvan has quit [Remote host closed the connection]
Mon_Ouie has quit [Read error: Connection reset by peer]
Takehiro has quit [Ping timeout: 276 seconds]
joeycarmello has joined #ruby
LucidDreamZzZz has joined #ruby
Mon_Ouie has joined #ruby
GeekOnCoffee has joined #ruby
dzmitry_ has quit [Quit: dzmitry_]
t0rc has joined #ruby
thinkdevcode has joined #ruby
bigmac has joined #ruby
n00b982 has quit [Ping timeout: 255 seconds]
LucidDreamZzZ has quit [Ping timeout: 276 seconds]
baroquebobcat has joined #ruby
Banistergalaxy has joined #ruby
<t0rc>
I have a gem that I am making in which users will be able to contribute content via github (fork, add content, merge). Only someone who cloned from their github, should be able to add content, since otherwise it does not make sense to do so (they'd be adding content locally only in this case at best). Would it be wise to simply create rake tasks that are meant for helping users create new content or still leave
<t0rc>
them as commands of the gem? Is there some way I can distinguish between a gem only installation and a clone from their own fork?
Guest___ has quit [Quit: Computer has gone to sleep.]
AndChat- has joined #ruby
rakl has quit [Quit: sleeping]
chimkan has quit [Quit: chimkan]
lenovodroid has quit [Read error: Connection reset by peer]
AndChat| has quit [Ping timeout: 255 seconds]
lenovodroid has joined #ruby
Banistergalaxy has quit [Ping timeout: 248 seconds]
lenovodroid has quit [Read error: Connection reset by peer]
lenovodroid has joined #ruby
sertaconay has quit [Remote host closed the connection]
tommyvyo has joined #ruby
<cirwin>
t0rc: once the gem has been installed I don't think you can tell where it came from
<cirwin>
t0rc: you could probably use the github api to make a fork for the user
<cirwin>
and automate the setup process for them
jenrzzz has joined #ruby
Banistergalaxy has joined #ruby
<t0rc>
cirwin: yeah I thought as much. Oh interesting idea. I was going to say I could also provide commands that let them move the content easily to somewhere else from their gem.
<cirwin>
sounds sane
lenovodroid has quit [Read error: Connection reset by peer]
<cirwin>
you might want to look at how CocoaPods manages user-submitted content via github
<t0rc>
cirwin: ahhh, excellent, will check that project out too. Looks like they make users fork manually and just allow them to create the content from their gem
AndChat- has quit [Ping timeout: 248 seconds]
chimkan has joined #ruby
Banistergalaxy has quit [Ping timeout: 248 seconds]
lenodroid has quit [Read error: Connection reset by peer]
pskosinski has joined #ruby
Tania has joined #ruby
<pskosinski>
Is there an easy way to remove e.g. first and third element from every row of an array? E.g. I have array where every row has 5 elements and want to have array with rows with only 2nd and 4th elements
<pskosinski>
2nd and 4th colun
<apeiros>
delete_at
n00b982 has joined #ruby
havenn has quit [Remote host closed the connection]