quatron has quit [Quit: ChatZilla 0.9.90.1 [Firefox 27.0.1/20140212131424]]
andy has quit [Remote host closed the connection]
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
mikepack has joined #ruby
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
Zunonia__ has quit [Ping timeout: 244 seconds]
rootshift has quit [Quit: My MacBook has decided to go to sleep. Zzzz..]
olivier_bK has quit [Ping timeout: 246 seconds]
burlyscudd has joined #ruby
ta9to has quit [Ping timeout: 272 seconds]
burlyscudd has quit [Client Quit]
xaq has quit [Remote host closed the connection]
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
jmau5 has quit [Remote host closed the connection]
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
<centrx>
jrhorn424, The class it's include in?
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
Asher has joined #ruby
zeade has quit [Quit: Leaving.]
Zunonia___ has quit [Read error: Connection reset by peer]
burlyscudd has joined #ruby
razrunelord has quit []
burlyscudd has quit [Client Quit]
_bart has quit [Remote host closed the connection]
carlyle has joined #ruby
Zunonia___ has joined #ruby
coderdad has joined #ruby
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
<jrhorn424>
centrx that makes sense. i was thinking it might refer to an instance.
butblack has quit [Ping timeout: 246 seconds]
sambao21 has quit [Quit: Computer has gone to sleep.]
burlyscudd has joined #ruby
<centrx>
jrhorn424, Yes, sorry, the instance of the class it's included it
andy has joined #ruby
burlyscudd has quit [Client Quit]
carlyle has quit [Read error: Connection reset by peer]
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
lpavan has quit [Quit: Saindo]
<jrhorn424>
centrx is there a rule-of-thumb for when self refers to a class versus instance?
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
<jrhorn424>
i guess def self.foo ; end is obviously referring to the class. is self inside a method always referring to an instance?
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
<centrx>
jrhorn424, Only if it's an instance method
snuffeluffegus has quit [Write error: Broken pipe]
mikepack has quit [Ping timeout: 259 seconds]
<jrhorn424>
centrx thanks. :)
cmhobbs has joined #ruby
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
aryaching has joined #ruby
rickruby has joined #ruby
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
mikecmpbll has quit [Quit: ciao.]
habanany has joined #ruby
omegahm has quit [Quit: Killed by a giraffe]
moneydouble has joined #ruby
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
coderdad has quit [Ping timeout: 264 seconds]
mlpinit has quit [Remote host closed the connection]
aryaching has quit [Read error: Connection reset by peer]
shinobi_one has quit [Quit: shinobi_one]
ephemerian has quit [Quit: Leaving.]
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
bean has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
dayepa has joined #ruby
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
mlpinit has joined #ruby
lethjakman has quit [Quit: WeeChat 0.4.0]
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
rickruby has quit [Ping timeout: 264 seconds]
sparrovv has quit [Remote host closed the connection]
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
brucele__ has quit [Ping timeout: 272 seconds]
Aryasam has joined #ruby
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
mocfive_ has quit [Quit: Leaving...]
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
Salve has quit [Remote host closed the connection]
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
Salve has joined #ruby
andy has quit [Remote host closed the connection]
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
kevind has joined #ruby
glaksmono has joined #ruby
<glaksmono>
how do you pass by reference in ruby?
<glaksmono>
i want to modify the array but i want it through a reference, ideas?
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
jrhorn424 is now known as zz_jrhorn424
burlyscudd has joined #ruby
funburn has quit [Quit: funburn]
burlyscudd has quit [Client Quit]
alexju has quit [Remote host closed the connection]
nanoyak has quit [Quit: Computer has gone to sleep.]
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
pietr0 has quit [Ping timeout: 246 seconds]
zumba_addict has joined #ruby
serp` has joined #ruby
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
figgleberry has joined #ruby
danshultz has joined #ruby
thomasxie has joined #ruby
kenneth has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
mikepack has joined #ruby
Zunonia____ has joined #ruby
lukec has quit [Quit: lukec]
subbyyy_ has quit [Ping timeout: 272 seconds]
Zunonia____ has quit [Remote host closed the connection]
burlyscudd has joined #ruby
Salve has quit [Ping timeout: 244 seconds]
Zunonia___ has quit [Read error: Connection reset by peer]
burlyscudd has quit [Client Quit]
mlpinit has quit [Remote host closed the connection]
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
lw has quit [Quit: s]
Zunonia____ has joined #ruby
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
meatherly has joined #ruby
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
wjlafrance__ has joined #ruby
oso|away is now known as oso96_2000
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
dingus_khan has quit [Remote host closed the connection]
mocfive has joined #ruby
Zunonia_____ has joined #ruby
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
dingus_khan has joined #ruby
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
jetblack has joined #ruby
Waheedi has quit [Quit: Waheedi]
ilyam has joined #ruby
burlyscudd has joined #ruby
dayepa has quit [Ping timeout: 272 seconds]
burlyscudd has quit [Client Quit]
marr has joined #ruby
lw has joined #ruby
sailias has joined #ruby
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
<slowcon>
hey guys, having a little trouble with my script. it goes to a zippyshare.com download page, but I've noticed that on the first 2-3 attempts at using a browser.goto(zippy share url), it redirects to some other ad page. on the third browser.goto it will show the correct link. do you guys have anyway to recommend to handle getting past those ad pages? http://pastebin.com/SPUs8ZQ3
nichtdiebohne1 has joined #ruby
cj3kim has quit [Remote host closed the connection]
snath has joined #ruby
burlyscudd has joined #ruby
burlyscudd has quit [Changing host]
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
Zunonia____ has quit [Read error: Connection reset by peer]
marr has quit [Client Quit]
nichtdiebohne has quit [Ping timeout: 246 seconds]
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
dingus_khan has quit [Ping timeout: 244 seconds]
Jetchisel has joined #ruby
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
<slowcon>
centrx: apeiros: havenwood
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
jetblack has quit [Ping timeout: 272 seconds]
jetblack has joined #ruby
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
serp` has quit [Quit: serp`]
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
Mongey has quit [Quit: Mongey]
carlyle has joined #ruby
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
iliketurtles has quit [Quit: zzzzz…..]
burlyscudd has joined #ruby
shadoi has quit [Quit: Leaving.]
burlyscudd has quit [Client Quit]
m00nlight has joined #ruby
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
jgoss has quit [Read error: Connection reset by peer]
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
SteveBenner09 has joined #ruby
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
Kricir has joined #ruby
<Robbo_>
ruby exceptions in terminal are horrible
itadder has quit [Remote host closed the connection]
burlyscudd has joined #ruby
stryek has joined #ruby
burlyscudd has quit [Client Quit]
<Robbo_>
I remember seeing something that made them better but I can't remmeber what it was
<slowcon>
pry?
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
<pontiki>
PRY!
<pontiki>
oh sorry
burlyscudd has joined #ruby
<Robbo_>
that's to run the shell, can I use it to run other stuff too?
evenix has quit [Remote host closed the connection]
burlyscudd has quit [Client Quit]
<Robbo_>
to be exact, middleman serve
<pontiki>
sorry, i was just responding to "pry?"
<pontiki>
well, you could
burlyscudd has joined #ruby
<pontiki>
but it would mean modifying the middleman source a tiny bit
burlyscudd has quit [Client Quit]
hfp`away is now known as hfp
Megtastique has quit []
<Robbo_>
I just want to easily be able to read exceptions
braincra- has joined #ruby
<pontiki>
and it would be for debugging
Hobogrammer has quit [Ping timeout: 247 seconds]
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
hfp is now known as hfp`away
burlyscudd has joined #ruby
<Robbo_>
awesome_print is the one I heard of
burlyscudd has quit [Client Quit]
dayepa has joined #ruby
<pontiki>
yes, but whatever your running has to actually call it
saarinen has quit [Quit: saarinen]
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
tvw has quit []
<Robbo_>
I will just set it to load them gem when in development
<Robbo_>
which is always
Kricir has quit [Ping timeout: 246 seconds]
<Robbo_>
lol
thumpba has joined #ruby
burlyscudd has joined #ruby
aspires has quit []
burlyscudd has quit [Client Quit]
<pontiki>
set *what* to load the gem?
dizzdiamods has joined #ruby
jonah_k has quit [Remote host closed the connection]
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
<Robbo_>
add it to the gemfile?
itadder has joined #ruby
<dizzdiamods>
what's a more concise way to do the following using built in methods on emums? http://pastie.org/8784483
burlyscudd has joined #ruby
<Robbo_>
doesn't do what I thought it did anyway
<Robbo_>
it is for shell use
burlyscudd has quit [Client Quit]
<pontiki>
that doesn't cause middleman to require it, and also call ap when it's outputting something
braincrash has quit [Ping timeout: 264 seconds]
burlyscudd has joined #ruby
<Robbo_>
meh ill live with default stuff
burlyscudd has quit [Client Quit]
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
burlyscudd has joined #ruby
Zunonia______ has joined #ruby
hfp`away is now known as hfp
burlyscudd has quit [Client Quit]
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
<pontiki>
dizzdiamods: that's totally a reduce
thumpba has quit [Ping timeout: 272 seconds]
Zunonia______ has quit [Remote host closed the connection]
<firewater>
havenwood: One other question, any idea of a simple method that lists things (strings) alphabetically? I can probably do it manually but doubt its as fast.
burlyscudd has quit [Client Quit]
shadoi has quit [Quit: Leaving.]
<centrx>
firewater, String#sort
<centrx>
firewater, Actually, Array#sort
burlyscudd has joined #ruby
Celm has quit [Remote host closed the connection]
<firewater>
yep, thanks centrx . Forgot about that. I was going to look through docs, but figured it was something easy like that.
pigzzcanfly has joined #ruby
burlyscudd has quit [Client Quit]
<firewater>
So, you would have to put the strings in an array first then right centrx ?
<firewater>
To use the sort?
pfg has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<centrx>
firewater, Yes, or any enumerable
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
<firewater>
right, kk.
<havenwood>
firewater: `['a', 'c', 'g'].sort` or `{aim: 'a', follow: 'c'}.sort_by { |k, v| v }` etc.
ta9to has joined #ruby
burlyscudd has joined #ruby
<havenwood>
firewater: When you sort a Hash an Array is returned. So you'll need to turn it back into a Hash if that's what you want.
burlyscudd has quit [Client Quit]
<firewater>
It can be an array.
jlast has joined #ruby
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
xerox357 has joined #ruby
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
jtdowney has quit []
itadder has quit [Ping timeout: 272 seconds]
burlyscudd has joined #ruby
poguez_ has quit [Quit: Connection closed for inactivity]
burlyscudd has quit [Client Quit]
jonr22 has quit [Ping timeout: 246 seconds]
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
<firewater>
What is up with all the spam entering and leaving this IRC today btw?
burlyscudd has joined #ruby
<havenwood>
firewater: can you disable enter/leave notification for your irc client?
burlyscudd has quit [Client Quit]
pigzzcanfly has quit [Ping timeout: 246 seconds]
<firewater>
Probably, I just don't really care about looking into it.
<firewater>
Its not usually an issue.
<firewater>
I can ignore it.
<firewater>
Its just really random tonight.
<havenwood>
firewater: when freenode auth gets ddos'ed things get crazy
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
<havenwood>
firewater: blame GHCQ
<firewater>
Why would someone ddos freenode?
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
lyanchih_ has joined #ruby
<firewater>
Is that really what its associated with?
Spami has quit [Quit: This computer has gone to sleep]
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
freerobby has quit [Quit: Leaving.]
burlyscudd has joined #ruby
jlast has quit [Ping timeout: 272 seconds]
burlyscudd has quit [Client Quit]
<havenwood>
firewater: I don't know about this DDoS, but GCHQ's JTRIG got caught redhanded illegally DDoSing IRC.
charliesome has joined #ruby
burlyscudd has joined #ruby
burlyscudd has quit [Client Quit]
<firewater>
Was it related to those docs sent out?
<firewater>
They just need to stop, this is getting stupid.
<existensil>
clearly your references of i isn't the problem
<existensil>
despite eval-in not letting me use %x
<apeiros>
existensil: "gives errors". you just learned that being vague is bad. why are you still vague?
<apeiros>
if you get an error, paste it along.
* apeiros
got to get back at work anyway, though
jlast has joined #ruby
<existensil>
not sure what you mean by "return from the for loop". for loops aren't exactly encouraged, and it would return the range 2..3, not the the return value
<existensil>
apeiros: you meant that for brandthdl
<apeiros>
existensil: d'oh, yes, of course. sorry.
jlast has quit [Ping timeout: 264 seconds]
lyanchih has joined #ruby
jayne has quit [Ping timeout: 600 seconds]
brucele_ has joined #ruby
einarj has joined #ruby
claymore has joined #ruby
<brandthdl>
thanks guys
bleak has quit [Ping timeout: 264 seconds]
mikepack has quit [Ping timeout: 244 seconds]
cj3kim_ has quit [Read error: Connection reset by peer]
dayepa has quit [Ping timeout: 272 seconds]
cj3kim has joined #ruby
workmad3 has quit [Ping timeout: 244 seconds]
cj3kim has quit [Read error: Connection reset by peer]
cj3kim has joined #ruby
whomp has quit [Ping timeout: 272 seconds]
davedev24 has quit [Remote host closed the connection]
axsuul has joined #ruby
sk87 has joined #ruby
tonni has joined #ruby
camilasan has joined #ruby
itadder has joined #ruby
yacks has joined #ruby
Kelgors has joined #ruby
blaxter_ has joined #ruby
echevemaster has quit [Quit: Leaving]
auxbuss_ has joined #ruby
auxbuss_ has quit [Client Quit]
jetblack has joined #ruby
itadder has quit [Ping timeout: 246 seconds]
coder_neo has joined #ruby
funburn has quit [Quit: funburn]
lolmaus has joined #ruby
incade has joined #ruby
jetblack has quit [Ping timeout: 244 seconds]
aryaching has joined #ruby
MJBrune has joined #ruby
pigzzcanfly has joined #ruby
gja has joined #ruby
greenarrow has joined #ruby
pigzzcanfly has quit [Ping timeout: 272 seconds]
whomp has joined #ruby
ilyam has joined #ruby
BWStearn1 has joined #ruby
kitak has joined #ruby
pontiki has joined #ruby
timonv has joined #ruby
mengu has joined #ruby
jlebrech has quit [Quit: Konversation terminated!]
jlebrech has joined #ruby
robbyoconnor has joined #ruby
jlebrech has quit [Client Quit]
sski has joined #ruby
gigetoo has quit [Remote host closed the connection]
mansi has joined #ruby
gigetoo has joined #ruby
noopq has quit [Ping timeout: 246 seconds]
tedstriker has joined #ruby
_bart has joined #ruby
n88 has joined #ruby
whomp has quit [Ping timeout: 272 seconds]
gigetoo has quit [Read error: Connection reset by peer]
j416 has quit [Quit: o/]
anarang has quit [Ping timeout: 246 seconds]
Salve has joined #ruby
mansi has quit [Ping timeout: 244 seconds]
jlebrech has joined #ruby
gigetoo has joined #ruby
sski has quit []
Wolland has joined #ruby
sski has joined #ruby
ponga has joined #ruby
roolo has joined #ruby
klaut has quit [Remote host closed the connection]
starfox21 has joined #ruby
olivier_bK has joined #ruby
Salve has quit [Ping timeout: 264 seconds]
ilyam has quit [Quit: ilyam]
Wolland has quit [Ping timeout: 246 seconds]
jhass|off is now known as jhass
nvrch has joined #ruby
evenix has quit [Remote host closed the connection]
craigp_ has quit [Remote host closed the connection]
evenix has joined #ruby
elcontrastador has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
plexus_ has joined #ruby
ikaros has joined #ruby
Matriks has joined #ruby
BWStearn1 has quit [Ping timeout: 246 seconds]
timonv_ has joined #ruby
spider-mario has joined #ruby
timonv has quit [Ping timeout: 264 seconds]
evenix has quit [Ping timeout: 264 seconds]
noopq has joined #ruby
einarj_ has joined #ruby
jlast has joined #ruby
einarj has quit [Ping timeout: 264 seconds]
ephemerian has joined #ruby
Black-Heaven has joined #ruby
<sigurding>
anyone able to tell me, why I get `init_object': undefined method `constantize' when doing `init_object': undefined method `constantize'
sigurding has left #ruby [#ruby]
dayepa has joined #ruby
sigurding has joined #ruby
<apeiros>
sigurding: because you call a method 'constantize' which is not defined.
elaptics`away is now known as elaptics
mikepack has joined #ruby
<certainty>
captain obvious strikes back :)
<sigurding>
apeiros: that's what I guessed
jayne has joined #ruby
<sigurding>
:D
_Andres has joined #ruby
obs has joined #ruby
<apeiros>
constantize is a method added by activesupport
<apeiros>
maybe you tried to use rails code outside of rails?
razibog has joined #ruby
ponga has left #ruby ["Leaving :)"]
lxsameer has quit [Ping timeout: 264 seconds]
<sigurding>
apeiros: I did 'gem install constantize'
<sigurding>
perhaps I missed the correct require
anarang has joined #ruby
jlast has quit [Ping timeout: 244 seconds]
m00nlight has quit [Quit: Konversation terminated!]
<certainty>
sigurding: but you are using activerecord there in your project? That's what constantize seems to be for
aryaching has quit [Ping timeout: 272 seconds]
lxsameer has joined #ruby
<sigurding>
certainty: yes
<certainty>
sigurding: so you installed it and you required it?
mikepack has quit [Ping timeout: 246 seconds]
supershabam_ has quit []
flowerhack has joined #ruby
<sigurding>
certainty: `require': cannot load such file -- constantize
plexus_ has quit [Ping timeout: 244 seconds]
supershabam_ has joined #ruby
<sigurding>
argh one moment
<certainty>
sigurding: do you have a Gemfile?
supershabam_ has quit [Client Quit]
<sigurding>
certainty: yes
<certainty>
sigurding: did you add it to your gemfile?
<Black-Heaven>
Hi all, I'm trying to limit some external programs execution time, but I'm failing to kill them when the time is over. I have this code: http://bpaste.net/show/182867/ (runner.rb) and this code http://bpaste.net/show/182867/ (tmp.rb), when I run the runner, it is unable to kill tmp.rb because it has forked. Have any idea on this problem? Thanks by advance for your help.
<sigurding>
nope, that's what I think is missing
_Andres has quit [Read error: Connection reset by peer]
subbyyy has quit [Ping timeout: 250 seconds]
rdark has joined #ruby
supershabam has joined #ruby
TMM has joined #ruby
flowerhack is now known as hoypriest
<certainty>
Black-Heaven: you linked the same paste twice
gja has quit [Quit: This computer has gone to sleep]
mipo has joined #ruby
mipo has left #ruby [#ruby]
<certainty>
Black-Heaven: also how do you tell that it could not be killed?
dayepa has quit [Ping timeout: 272 seconds]
timonv_ has quit [Remote host closed the connection]
hoypriest has quit [Remote host closed the connection]
<Black-Heaven>
I think it can be killed, but currently it isn't because I still can see it <ith top
<certainty>
Black-Heaven: you need to kill the entire process group, otherwise you'll just create orphans
<Black-Heaven>
with*
<certainty>
also -9 is pretty rude
<Black-Heaven>
ok, how can I do this ?
oso|away is now known as oso96_2000
<certainty>
Black-Heaven: just negate the pid
<Black-Heaven>
It is unsafe code
<certainty>
so if you want to kill the father and all children and the father's pid is 42 then do kill -9 -42
nari has quit [Ping timeout: 245 seconds]
<certainty>
s/pid/group id/
dayepa has joined #ruby
<apeiros>
-9 -42?
<apeiros>
not -9 42?
<Black-Heaven>
I have done kill -9 -#{pid} and I have this error: kill: sending signal to -25645 failed: No such process
<toretore>
-
vlad_starkov has joined #ruby
<toretore>
.abs
jetblack has joined #ruby
dayepa has quit [Remote host closed the connection]
avril14th has joined #ruby
<toretore>
oh
<apeiros>
at least BSD kill doesn't seem to support negative pids to indicate "and all descendants"
vlad_sta_ has joined #ruby
dayepa has joined #ruby
<apeiros>
also you don't have to shell out for kill
<apeiros>
Process.kill
plexus_ has joined #ruby
zeade has quit [Quit: Leaving.]
Faris has joined #ruby
vlad_starkov has quit [Read error: Connection reset by peer]
Hanmac1 has joined #ruby
klaut has joined #ruby
pigzzcanfly has joined #ruby
shaileshg has quit [Quit: Connection closed for inactivity]
Hanmac has quit [Ping timeout: 244 seconds]
karupanerura is now known as zz_karupanerura
Xeago has joined #ruby
jetblack has quit [Ping timeout: 264 seconds]
ylluminate has quit [Quit: Bye!]
Giorgio has quit [Read error: Connection reset by peer]
srji_ has quit [Quit: leaving]
skammer has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
srji has joined #ruby
einarj_ has quit [Remote host closed the connection]
<sigurding>
certainty: now I have defined it in my gem file and I am now getting: uninitialized constant Constantize::ClassMethods::ActiveSupport
pigzzcanfly has quit [Ping timeout: 244 seconds]
<sigurding>
Gemfile has the following line: gem 'constantize', :require => 'activerecord, activesupport'
<certainty>
Black-Heaven: note the substitution i wrote after, the negative groupid not pid. I just looked at SO and it seems that the preferred way is to select the child pids first and then kill them. I'm pretty sure though that i have a script at work that works with the negative group id
<apeiros>
sigurding: I don't think this works: :require => 'activerecord, activesupport'
<existensil>
ha, no. at least i hope that doesn't work.
<sigurding>
apeiros: removed I, but error still exists
<apeiros>
whenever I think I have it, the data manages to come up with *yet another* stupid mess
<apeiros>
I'd like to flail whoever thought validations were not necessary for the entry forms of this horror
<sigurding>
jhass: that's what I found. What's not documented is how configure my Gemfile and which requires are necessary
<certainty>
also the code is actually quite simple
skaflem has quit [Read error: Connection reset by peer]
makara has joined #ruby
camilasan has quit [Remote host closed the connection]
<diegoviola>
i'm working with a codebase that is not tested, the code feels terribly clumsy, what's the best thing to do in this case?
<diegoviola>
no organization at all with the code
camilasan has joined #ruby
<jhass>
sigurding: gem 'activesupport', require: no and require 'active_support/core_ext/string/inflections' but think again, AS is quite a huge dependency for a functionality like this, it's easy to implement a simple version
camilasan has quit [Read error: Connection reset by peer]
makara has left #ruby [#ruby]
jetblack has joined #ruby
<jhass>
er, require: false of course
<diegoviola>
it seems like they just care about "things that work" but trying to implement a new feature with the current code is harder
camilasan has joined #ruby
<certainty>
diegoviola: if you have time and it's feasable you should add tests. Start with the greatest integration
skaflem has joined #ruby
<certainty>
to cover the core functionality without having too much to know about internals
camilasan has quit [Read error: Connection reset by peer]
<diegoviola>
certainty: will do, thanks
camilasan has joined #ruby
<sigurding>
jhass: ok, so there are other implementations?
camilasan has quit [Read error: Connection reset by peer]
<jhass>
simplest one is Object.get_const('Foo')
pigzzcanfly has quit [Ping timeout: 272 seconds]
camilasan has joined #ruby
<jhass>
what you need entirely depends on the specific usecase you have
camilasan has quit [Read error: Connection reset by peer]
<sigurding>
as you said to me yesterday, I stopped talking and started coding
<certainty>
that's different from String#constantize as added by activesupport
roolo has quit [Read error: Connection reset by peer]
<sigurding>
jhass: that's what I am trying to do: value.instance_of?(Hash) ? (get_module_name + klass.to_s.capitalize).constantize.new(value) : value
roolo has joined #ruby
camilasan has quit [Read error: Connection reset by peer]
camilasan has joined #ruby
<certainty>
ok apparently not
ctp has joined #ruby
jetblack has quit [Ping timeout: 272 seconds]
sk87 has joined #ruby
<jhass>
okay, then the slightly more complex version that respects namespaces: klass = 'Foo::Bar'.split('::').inject(Object) {|mod, const| mod.const_get const }
<jhass>
stuff that into a utility method somewhere and be happy
<sigurding>
food, will be back soon
<jhass>
oh and I hope value isn't user input
sigurding has quit [Read error: Connection reset by peer]
<certainty>
:)
ksinkar has joined #ruby
yasushi has quit [Remote host closed the connection]
_bart_ has quit [Remote host closed the connection]
klaut has quit [Remote host closed the connection]
lolmaus has quit [Ping timeout: 272 seconds]
<marius>
hi, I'm playing with knife tool and I try to hack gem files - how to add my current work dir to gem search path?
mikecmpbll has joined #ruby
eVRiAL has joined #ruby
klaut has joined #ruby
__main__ has quit [Read error: Connection reset by peer]
cj3kim has joined #ruby
meatherly has joined #ruby
__main__ has joined #ruby
meatherl_ has joined #ruby
meatherly has quit [Read error: Connection reset by peer]
dvorak has quit [Ping timeout: 252 seconds]
bricker`LA has quit [Read error: Connection reset by peer]
dvorak has joined #ruby
pontiki has quit [Ping timeout: 250 seconds]
sawtooth_ has quit [Ping timeout: 252 seconds]
nomenkun has joined #ruby
sawtooth has joined #ruby
meatherl_ has quit [Ping timeout: 272 seconds]
noopq has quit [Ping timeout: 246 seconds]
pontiki has joined #ruby
anarang has quit [Ping timeout: 264 seconds]
browndawg has quit [Ping timeout: 272 seconds]
_bart has joined #ruby
_tpavel has joined #ruby
Xeago has joined #ruby
timonv has quit []
rahult has joined #ruby
himsin has joined #ruby
Salve has joined #ruby
itadder has quit []
kirun has joined #ruby
blackmesa has joined #ruby
Atrumx has quit [Remote host closed the connection]
Xeago has quit [Remote host closed the connection]
Xeago has joined #ruby
Salve has quit [Ping timeout: 244 seconds]
flayer has joined #ruby
mengu has joined #ruby
poulson has joined #ruby
workmad3 has quit [Ping timeout: 246 seconds]
<flayer>
Hi I have a small issuel with my ruby installation. every script I start I get "No such file or directory - (unreachable) (Errno::ENOENT)" error.
spider-mario has quit [Read error: Connection reset by peer]
vlad_sta_ has quit [Remote host closed the connection]
<flayer>
I has worked before. now it isn't. I honestly don't know what I did to botch it.
workmad3 has joined #ruby
camilasa_ has joined #ruby
timonv has joined #ruby
habanany has joined #ruby
noopq has joined #ruby
brucele_ has quit [Ping timeout: 246 seconds]
anarang has joined #ruby
browndawg has joined #ruby
sigurding has joined #ruby
camilasan has quit [Ping timeout: 264 seconds]
Mongey has joined #ruby
<flayer>
When I start irb I get "(unreachable)/code" when I am running puts Dir.pwd. I imagine this is my issue
intuxicated has quit [Ping timeout: 264 seconds]
jlast has joined #ruby
_bart has quit [Remote host closed the connection]
yeboot has joined #ruby
<yeboot>
hi, I'm trying to find rdoc documentation so I can put latex math symbols in my code
jtdowney has joined #ruby
<yeboot>
(in the comments)
danshultz has joined #ruby
aasmith has joined #ruby
Gadgetoid has joined #ruby
dawkirst has quit [Ping timeout: 272 seconds]
jlast has quit [Ping timeout: 246 seconds]
bricker`LA has joined #ruby
yfeldblum has joined #ruby
phreax_ has quit [Ping timeout: 264 seconds]
davedev24 has joined #ruby
Mongey has quit [Quit: Mongey]
<sigurding>
jhass: not sure I understand your sample code correctly
danshultz has quit [Remote host closed the connection]
sensen has quit [Ping timeout: 249 seconds]
<jhass>
what troubles you?
burlyscudd1 has joined #ruby
pigzzcanfly has joined #ruby
burlyscudd1 has quit [Client Quit]
Atw has quit [Ping timeout: 244 seconds]
yfeldblum has quit [Ping timeout: 244 seconds]
mostlybadfly has joined #ruby
[gmi] has joined #ruby
<Hanmac1>
jhass: newer ruby support "::" in const_get
<jhass>
oh, didn't notice. what's newer? 2.0?
tolstoi has quit [Ping timeout: 245 seconds]
phreax has joined #ruby
coder_neo has joined #ruby
nomenkun has quit [Quit: Leaving...]
coder_neo has quit [Client Quit]
<Hanmac1>
hm i think 2.0
Fraeon has joined #ruby
super_g has joined #ruby
m00nlight has joined #ruby
<Hanmac1>
>> module A; B = 3; end; Object.const_get("A::B")
itadder has quit [Remote host closed the connection]
Xeago has joined #ruby
Xeago has quit [Remote host closed the connection]
SystemObject has quit [Ping timeout: 246 seconds]
<jhass>
what's your ruby version?
itadder has joined #ruby
boboc_ has joined #ruby
<jhass>
also that line is waaay too long for my taste
boboc has quit [Client Quit]
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
boboc_ has quit [Client Quit]
boboc has joined #ruby
<apeiros>
Hanmac: omits a couple of cases, though
lyanchih has quit [Ping timeout: 264 seconds]
jlast has joined #ruby
boboc has quit [Client Quit]
sk87 has joined #ruby
pigzzcanfly has joined #ruby
himsin has quit [Quit: himsin]
<jhass>
sigurding: so inject takes each element in the array and passed it to the block, together with the result of the previous iteration, with the optional parameter you can set the initial value to something else than the first two elements of the array. For example you can use this to build a sum: [1,2,3].inject {|a,b| a+b}
itadder has quit [Ping timeout: 264 seconds]
<jhass>
if a symbol is passed but no block inject will call the corresponding method
poulson has quit [Ping timeout: 246 seconds]
ndrei has joined #ruby
jlast has quit [Ping timeout: 246 seconds]
<sigurding>
jhass: version is 2.0.0
sk87 has quit [Client Quit]
<jhass>
so as Hanmac pointed out you can skip the split.inject part and just do Object.const_get("Foo::Bar")
yfeldblum has joined #ruby
pigzzcanfly has quit [Ping timeout: 246 seconds]
xaq has joined #ruby
poulson has joined #ruby
pigzzcanfly has joined #ruby
Jetchisel has quit [Quit: "Unfortunately time is always against us" -- *Morpheus*]
PLejeck has quit [Ping timeout: 240 seconds]
Xeago has joined #ruby
<sigurding>
mh this is really embarrassing. learning a new language is always frustating
<sigurding>
to much patterns from your known languages in your head, but troubles to get it running
itadder has joined #ruby
PLejeck has joined #ruby
bluehavana_ has quit [Quit: Connection closed for inactivity]
krnflake has quit [Excess Flood]
yfeldblum has quit [Ping timeout: 334 seconds]
<certainty>
sigurding: why's that embarrassing? We all go through that phase when we learn a new language
<itadder>
it so hard to focus on learning
pigzzcanfly has quit [Ping timeout: 272 seconds]
krnflake has joined #ruby
<itadder>
but it is fun when you do bulid something
<toretore>
sigurding: learning ruby should really not include the kind of stuff you're doing in that gist
<itadder>
learning is starting to get harder
<itadder>
to much information to learn from
<toretore>
that's advanced usage, and quite smelly
<itadder>
bbl
itadder has quit [Client Quit]
<sigurding>
toretore: but if that would work, it would help me a lot
<sigurding>
:)
<toretore>
it would also hurt you a lot in the long term
kukyakya_ has quit [Remote host closed the connection]
<existensil>
i doubt "a lot". its usually not that hard to unlearn bad practices.
<toretore>
it teaches him that this sort of stuff is standard practice in ruby, when it is far from it
jetblack has joined #ruby
<existensil>
that's all true, just saying if this is his goal, achieving it isn't going to set him back "a lot"
<toretore>
it's ok if you just think it's interesting, but for real code, no
<existensil>
but kind of a moot point. i agree its not something you should be doing
danshultz has joined #ruby
<sigurding>
mh
* sigurding
is sad now
<sigurding>
;)
marcgg has joined #ruby
marcgg_ has quit [Read error: Connection reset by peer]
<olivier_bK>
i get on error in my script and i dont understand
<jhass>
olivier_bK: define the method before you call it. Also why that useless begin end block?
yasushi has joined #ruby
stryek has quit [Ping timeout: 244 seconds]
tkuchiki has joined #ruby
<olivier_bK>
gr....
<olivier_bK>
i m stupid
<olivier_bK>
sorry jhass
<olivier_bK>
thanks
avril14th has quit [Ping timeout: 245 seconds]
<dachi>
hi
<dachi>
i was just reading some articles about ruby community
<dachi>
i know you're all here
<dachi>
I've got a question like, what does one need to do to become a part of your community
mlpinit has joined #ruby
Megtastique has joined #ruby
dkamioka has joined #ruby
tjr9898 has quit [Remote host closed the connection]
dachi has quit [Quit: ...]
greenarrow has quit [Quit: 500]
dkamioka has quit [Remote host closed the connection]
end_guy has quit [Ping timeout: 240 seconds]
Xeago has quit [Ping timeout: 246 seconds]
dkamioka has joined #ruby
ikaros has quit [Quit: Ex-Chat]
davidcollom is now known as davidcollom_afk
IceyEC has joined #ruby
meatherly has joined #ruby
rahult has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mercwithamouth has joined #ruby
greenarrow has joined #ruby
moneydouble has joined #ruby
meatherly has quit [Ping timeout: 272 seconds]
mansi has joined #ruby
yeticry has quit [Read error: Connection reset by peer]
jcs222 has quit [Quit: Lost terminal]
end_guy has joined #ruby
decoponio has joined #ruby
tolstoi has quit [Ping timeout: 245 seconds]
mansi has quit [Ping timeout: 264 seconds]
Salve has joined #ruby
mcls has joined #ruby
yeticry has joined #ruby
<apeiros>
more patience, as it seems…
Megtastique has quit []
LekeFly has joined #ruby
phutch1ns has joined #ruby
mary5030 has quit [Remote host closed the connection]
davidcollom_afk is now known as davidcollom
Salve has quit [Ping timeout: 260 seconds]
Mongey has quit [Quit: Mongey]
aryaching_ has joined #ruby
sdouglass has joined #ruby
aryaching has quit [Ping timeout: 244 seconds]
yacks has quit [Ping timeout: 244 seconds]
heftig has joined #ruby
ffranz has joined #ruby
Kelgors has joined #ruby
mcls has quit [Remote host closed the connection]
starfox21 has quit [Quit: starfox21]
sdouglass has quit [Ping timeout: 259 seconds]
Advocation has quit [Quit: Advocation]
tonni has quit [Remote host closed the connection]
Speed has joined #ruby
elimS has quit [Remote host closed the connection]
ndrei has quit [Ping timeout: 244 seconds]
mark_locklear has joined #ruby
mikepack has joined #ruby
elimS has joined #ruby
Salve has joined #ruby
elimS has quit [Client Quit]
elimS has joined #ruby
jlast has joined #ruby
Megtastique has joined #ruby
jtdowney has joined #ruby
vpretzel has joined #ruby
ndrei has joined #ruby
norm has joined #ruby
pigzzcanfly has joined #ruby
Astralum has joined #ruby
<norm>
i'm receiving raw TCP data, appending it to a string, then parsing the string with .unpack(). I have to manually manage an offset for how far into the string i need to read. is there a better class to use? something like java's buffered readers?
<norm>
something made for binary parsing
LekeFly has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<existensil>
but by default ruby should at least give you some basic information when it crashes
<existensil>
indicating the exception and where it was thrown
mary5030 has joined #ruby
ikaros has quit [Quit: Ex-Chat]
jerius has joined #ruby
lkba has quit [Read error: Connection reset by peer]
slowcon has joined #ruby
burlyscudd1 has joined #ruby
burlyscudd1 has quit [Client Quit]
vindictive27 has joined #ruby
thumpba has joined #ruby
ahawkins has joined #ruby
tonni has quit [Read error: Connection reset by peer]
jetblack has joined #ruby
jerius has quit [Client Quit]
<pontiki>
Time.now.appropriate_greeting
jackneill has joined #ruby
nowthatsamatt has joined #ruby
anarang has quit [Quit: Leaving]
<toretore>
yuck
<toretore>
appropriate_greeting(Time.now)
Speed has quit [Ping timeout: 244 seconds]
mlpinit_ has joined #ruby
ikaros has joined #ruby
cj3kim has quit [Ping timeout: 240 seconds]
thumpba has quit [Ping timeout: 272 seconds]
himsin has joined #ruby
danshultz has joined #ruby
fridim__ has joined #ruby
pedda has joined #ruby
cmhobbs has quit [Ping timeout: 253 seconds]
jetblack has quit [Ping timeout: 244 seconds]
<sikor_sxe>
hello, in rails i have an unique index in my schema. to get proper error handling, i also need a validation for that. that seems a bit redundant to me? am i doing anything wrong here?
<ddd>
#rubyonrails
mlpinit has quit [Ping timeout: 244 seconds]
robbyoconnor has quit [Ping timeout: 244 seconds]
danshultz has quit [Read error: Connection reset by peer]
tagrudev has quit [Remote host closed the connection]
Gspot has joined #ruby
xerox357 has joined #ruby
Azulinho has joined #ruby
rails426 has quit [Ping timeout: 272 seconds]
ndrei has joined #ruby
sambao21 has joined #ruby
Gspot has left #ruby [#ruby]
mengu has quit []
dx7 has quit [Ping timeout: 246 seconds]
AlexRussia has quit [Remote host closed the connection]
koell has joined #ruby
yfeldblum has joined #ruby
lw has joined #ruby
_bart has quit [Remote host closed the connection]
AlexRussia has joined #ruby
matchaw has joined #ruby
rails426 has joined #ruby
baroquebobcat has joined #ruby
Es0teric has quit [Remote host closed the connection]
rippa has joined #ruby
browndawg1 has joined #ruby
jprovazn_ has joined #ruby
yfeldblum has quit [Ping timeout: 240 seconds]
gja has joined #ruby
browndawg has quit [Read error: Connection timed out]
ndrei has quit [Ping timeout: 272 seconds]
rayners has joined #ruby
jprovazn_ has quit [Client Quit]
jprovazn has quit [Ping timeout: 246 seconds]
NovapaX has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
matchaw has quit [Ping timeout: 244 seconds]
end_guy has quit [Ping timeout: 240 seconds]
pigzzcanfly has joined #ruby
ggg has quit [Ping timeout: 245 seconds]
<certainty>
rails426: i think you wanted to ask apeiros
niftyn8 has joined #ruby
j416 has joined #ruby
jonr22 has joined #ruby
<j416>
o/ is the source of Net::HTTP available somewhere? Perferably 1.9.3. The documentation is rather lacking.
SCommette has joined #ruby
tkuchiki has quit [Remote host closed the connection]
<apeiros>
j416: github.com/ruby/ruby
<apeiros>
j416: also obviously on your machine…
tkuchiki has joined #ruby
<j416>
ah, just found. thanks.
bean has quit [Remote host closed the connection]
tommyvyo__ has joined #ruby
elimS has quit [Remote host closed the connection]
Es0teric has joined #ruby
abstractj has quit [Changing host]
abstractj has joined #ruby
lkba has joined #ruby
tkuchiki_ has joined #ruby
acrussell has joined #ruby
tkuchiki_ has quit [Remote host closed the connection]
freezey has joined #ruby
shime has joined #ruby
andy__ has quit [Remote host closed the connection]
figgleberry has joined #ruby
tonni has joined #ruby
alexju has joined #ruby
dseitz has joined #ruby
<j416>
is there a way to pass an optional block (not specified as argument but checked with block_given?) as an argument to another method taking a block?
tkuchiki has quit [Remote host closed the connection]
<j416>
I want to do something like: File.open(path, 'rb', &block) if block_given?
<j416>
obviously there is no &block
NovapaX has joined #ruby
<j416>
do I have to: File.open(path, 'rb') { |io| yield io } if block_given?
<shevy>
in these moments I always remember how apeiros wanted to have multiple blocks passed to the same method :-)
<j416>
?
niharvey has quit [Remote host closed the connection]
<j416>
shevy: o_O
wald0_ has joined #ruby
incade_ has joined #ruby
<shevy>
j416 when he was young and energetic he even worked on a new programming language
abstractj is now known as abstractj_
<shevy>
but all of that changed when he got into rails :-(
ptierno has joined #ruby
ahawkins_ has joined #ruby
<j416>
eek
havenwood has joined #ruby
abstractj_ is now known as abstractj
<shevy>
I have not tested, but given that you can convert blocks into objects, what you wanted above should be possible
incade has quit [Write error: Broken pipe]
mikee has quit [Write error: Broken pipe]
wald0 has quit [Write error: Broken pipe]
jcs222 has quit [Write error: Connection reset by peer]
<shevy>
you can yield-assign it to a variable after all
_bart has joined #ruby
griffindy has joined #ruby
gl- has quit [Remote host closed the connection]
ahawkins has quit [Remote host closed the connection]
<j416>
I was thinking maybe it is stored in some magic variable
destructure has quit [Write error: Broken pipe]
Guest14870 has quit [Remote host closed the connection]
<dorei>
j416: i think u've got to specify it to the definition of the method, aint sure
<norm>
is there a way to peek at upcoming bytes on an IO without actually reading them? that is, without advancing the pointer?
<dorei>
def some_method(args, &block)
mikee has joined #ruby
noopq has quit [Ping timeout: 267 seconds]
lachesis has left #ruby ["Leaving"]
<j416>
dorei: alright, thanks
<dorei>
norm: i'm pretty sure u can, let me check
<norm>
dorei: i could have sworn there was a .peek(), but i don't see it anywhere
ndrei has joined #ruby
<shevy>
isn't it seek()?
Xeago has quit [Remote host closed the connection]
<j416>
seek is like pos
<dorei>
norm: i think i've seen something low level that allows you to do it with sockets ( C / linux )
<apeiros>
shay-: stop trying to put everything into a single line
<shevy>
j416 did not modify your code much at all, did he ;)
<apeiros>
seriously, it's stupid
sk87 has joined #ruby
mary5030 has joined #ruby
* apeiros
off, commute
<shevy>
when apieros says so it is true!
kpshek has quit []
apeiros has quit []
<j416>
shay-: as you see, << returns the array with the value appended, so you can use it just like that. Parentheses is just to get the right grouping.
yarou has joined #ruby
<j416>
yes, I also agree with God on this
<j416>
separate lines look better
sailias has quit [Ping timeout: 246 seconds]
mary5030 has quit [Remote host closed the connection]
niharvey has joined #ruby
mary5030 has joined #ruby
<NovapaX>
wel... depends on context and function. If I need to choose I just read the line. If it doesn't make sense in my mind I rewrite it
<shevy>
they are easier to debug
ndrei has quit [Ping timeout: 272 seconds]
<shevy>
but when there are no bugs, it's ok to be terse!
<NovapaX>
Same with if not / unless
sailias has joined #ruby
pigzzcanfly has joined #ruby
<shevy>
given that I do not make bugs, my ruby code is all on one line
<shevy>
NovapaX do you use unless?
<NovapaX>
haha... that would be a nice challenge
kpshek has joined #ruby
lw has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
sdouglass has quit [Remote host closed the connection]
jprovazn has joined #ruby
stringoO has joined #ruby
BWStearns has joined #ruby
freezey has quit [Remote host closed the connection]
<NovapaX>
yes i do:
_maes_ has joined #ruby
CaptainJet has joined #ruby
JasmeetQA has joined #ruby
<NovapaX>
unless food.is_good?
<NovapaX>
call pizzeria
<NovapaX>
trash food
<NovapaX>
end
<NovapaX>
hmm... thought I could use line-breaks in a msg....
depesz has left #ruby ["WeeChat 0.4.2"]
[ROOT]XxNeoLiTHi has joined #ruby
x81robert has joined #ruby
<NovapaX>
hmm.. bad example I might use if not here
<[ROOT]XxNeoLiTHi>
hi all, anyone here using vagrant
x81robert has left #ruby [#ruby]
npearson has quit [Ping timeout: 240 seconds]
<[ROOT]XxNeoLiTHi>
i have a vagrant config with more than one provider and I tried setting the config.ssh settings inside one of the provider blocks but noticed that it took effect for the other provider as well even though I didnt want it to. How can I check the current provider being used before setting the value?
LekeFly has joined #ruby
shay- has left #ruby [#ruby]
gja has quit [Quit: This computer has gone to sleep]
LekeFly has quit [Client Quit]
bean has joined #ruby
npearson has joined #ruby
sailias has quit [Quit: Leaving.]
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
gaussblurinc has quit [Quit: Leaving.]
davidcollom is now known as davidcollom_afk
mikepack has joined #ruby
lmickh has joined #ruby
mikepack has quit [Remote host closed the connection]
sk87 has joined #ruby
MattStratton has joined #ruby
super_g has joined #ruby
zachallett has quit [Remote host closed the connection]
mikepack has joined #ruby
crus has quit [Read error: Connection reset by peer]
pietr0 has quit [Quit: pietr0]
apeiros has joined #ruby
WormDrink has quit [Ping timeout: 252 seconds]
rurban_ has quit [Ping timeout: 240 seconds]
apeiros has quit [Read error: Connection reset by peer]
Xeago has quit [Remote host closed the connection]
sambao21 has joined #ruby
Xeago has joined #ruby
zachallett has joined #ruby
<shevy>
hmm
OdNairy has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
freezey has joined #ruby
<shevy>
do modern consoles output R,G,B colours? like kde or gnome-terminal
NovapaX has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<shevy>
it's not much fun to keep on using ansi colours alone :(
mary5030 has quit [Remote host closed the connection]
xerox357 has quit [Quit: Leaving...]
<j416>
doubt
<j416>
but not sure
<j416>
256 colours at least.
<j416>
@ shevy
jeregrine has joined #ruby
cherrypeel has joined #ruby
rails426 has quit []
cherrypeel has left #ruby [#ruby]
rurban_ has joined #ruby
shime has quit [Ping timeout: 244 seconds]
kaliya has joined #ruby
m1lt0n has quit [Quit: leaving]
<shevy>
hmm yeah
<shevy>
256 colour shades of pink
jonr22 has quit [Remote host closed the connection]
<shevy>
it works for osx users?
<shevy>
I think they can do fancy unicode symbols in their terminal at least
<j416>
that depends on the font, not the colours
<j416>
(yes we can, btw @ fancy unicode)
guilleiguaran has joined #ruby
<wuest>
shevy: konsole supports 24 bit colour, I believe.
<j416>
whoa.
<j416>
I'm using iTerm2 on OS X, that supports 246 at least
jtdowney has quit []
kirun has quit [Ping timeout: 272 seconds]
budrose has joined #ruby
jtdowney has joined #ruby
sriehl has joined #ruby
snath has joined #ruby
xaq has joined #ruby
<shevy>
wuest hmm
xerox357 has joined #ruby
rurban_ has quit [Ping timeout: 240 seconds]
<shevy>
wuest ok, logically that should mean... I could output all those colours, from a ruby script, onto the kde konsole terminal and it *should*, in principle, work, right?
xaq_ has joined #ruby
lw has quit [Quit: s]
ndrei has joined #ruby
kevind_ has joined #ruby
Advocation has quit [Quit: Advocation]
<wuest>
shevy: shevy should.
shiftins has joined #ruby
yfeldblum has joined #ruby
heftig has quit [Quit: Quitting]
b00stfr3ak has joined #ruby
b00stfr3ak has quit [Changing host]
b00stfr3ak has joined #ruby
chipotle_ has joined #ruby
<wuest>
shevy: Yup, works
lw has joined #ruby
xaq has quit [Ping timeout: 244 seconds]
kevind has quit [Ping timeout: 244 seconds]
<wuest>
"\e[38;2;#{r};#{g};#{b}m"
kevind_ is now known as kevind
lw has quit [Client Quit]
<xibalba>
what does :: signify? when you've got ::MY_VAR
chipotle has quit [Read error: Connection reset by peer]
shime has joined #ruby
<j416>
wuest: that's crazy.
<j416>
cool.
mary5030 has joined #ruby
* j416
afk o/
davidcollom_afk is now known as davidcollom
mehlah has quit [Quit: Leaving...]
LadyRainicorn has joined #ruby
browndawg1 has quit [Read error: Connection timed out]
brucele_ has joined #ruby
yfeldblum has quit [Ping timeout: 240 seconds]
<shevy>
wow
<shevy>
wuest, you are my new hero!
zachalle_ has joined #ruby
zachallett has quit [Read error: Connection reset by peer]
<shevy>
\o/
Advocation has joined #ruby
<shevy>
death to ansi!
<shevy>
long live a million shades of pink
<wuest>
shevy: :)
<LadyRainicorn>
What did wuest do?
browndawg has joined #ruby
<shevy>
LadyRainicorn he gave me RGB colours for KDE konsole!
<LadyRainicorn>
ooh
browndawg has quit [Max SendQ exceeded]
no0code has joined #ruby
<LadyRainicorn>
Yay pink!
* LadyRainicorn
color rays the room pink.
<wuest>
I prefer to approximate colors from 24b to 214color (ANSI), personally -- but fewer shades of pink in such a case.
npearson has quit [Remote host closed the connection]
_maes_ has joined #ruby
npearson has joined #ruby
_Andres has joined #ruby
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
Faris has quit [Ping timeout: 272 seconds]
lyanchih_ has quit [Ping timeout: 272 seconds]
evenix has joined #ruby
existensil has quit [Quit: leaving]
mary5030 has quit [Remote host closed the connection]
Slavox is now known as Slavox|AFK
<s2013>
so if i have time range arrays in this format: ["02:15", "04:30"], ["05:15", "06:30"] etc.. and i need to get number of seconds that the range is between for each hour.. ie 2-3: 1800, 3-4: 3600, 4-5: 900 etc..
cina has joined #ruby
bal has quit [Write error: Broken pipe]
poulson has joined #ruby
evenix has quit [Remote host closed the connection]
mary5030 has joined #ruby
brucele_ has quit [Ping timeout: 240 seconds]
evenix has joined #ruby
<s2013>
how would i best approach it? it hought about converting them into something like ["02:15", "03:00", "04:00", "04:30"] and then get the time difference for each of those segments and put them in a hash
<s2013>
can someone suggest a better approach?
chipotle has quit [Read error: Connection reset by peer]
nfk has quit [Quit: yawn]
nfk has joined #ruby
jkamenik has joined #ruby
baroquebobcat has joined #ruby
<wuest>
s2013: are you getting 2-tuples, or n-tuples? What do you want the output to look like? Is your format guaranteed to always be "HH:MM"?
<s2013>
yes wuest
PLejeck has quit [Changing host]
PLejeck has joined #ruby
PLejeck is now known as nuck
<s2013>
its always going to be HH:MM and i have a method that gets the time difference between two "HH:MM"
Xeago has quit [Remote host closed the connection]
<s2013>
its always going to be arrays of ["HH:MM", "HH:MM"]
<wuest>
Then it sounds like a solved problem.
<s2013>
im thinking if there is a more elegant solution
<s2013>
or wondering rather
bigkevmcd has quit [Read error: Connection reset by peer]
<havenwood>
s2013: not that your usecase requires that, but nice
gemmy has joined #ruby
<s2013>
yeah tahts very nice
<s2013>
im tryign to break it down and see wth you did
jmau5 has quit [Ping timeout: 240 seconds]
<havenwood>
/s/havenwood/Hanmac
mocfive has joined #ruby
<havenwood>
shevy: Ruby 2.1.1!
BlakeRG has joined #ruby
<shevy>
well
<s2013>
but anyways i was more curiosu about how youd approach it, rather than the code itself. so thats what im trying to figure out
<shevy>
doesn't matter as long as I can not use non-utf for yaml!
[ROOT]XxNeoLiTHi has quit [Quit: Leaving.]
<havenwood>
shevy: sure!
<havenwood>
shevy: is the yaml related to your editor? was curious what the tie in is?
blaxter_ has quit [Quit: foo]
<shevy>
yeah
cina has quit [Ping timeout: 240 seconds]
<havenwood>
shevy: could you just convert the yaml to utf-8, or editor balks?
<b00stfr3ak>
How do you guys seperate code? I know library code goes in a lib folder but what about other types of files?
<shevy>
the editor displays german umlauts incorrectly when I do so havenwood
timonv has quit [Remote host closed the connection]
<havenwood>
b00stfr3ak: the filesystem should mirror the namespace
<havenwood>
shevy: ahhh
browndawg has quit [Quit: Leaving.]
<havenwood>
how odd
blaxter_ has joined #ruby
gomix has joined #ruby
olivier_bK has quit [Ping timeout: 264 seconds]
<shevy>
pwdlöinya: pwdlinyam
<havenwood>
b00stfr3ak: so `RootNamespace::Something#this` would be in `/lib/root_namespace/something/this.rb`
<shevy>
pwdlöinya: pwdlinyam
<shevy>
do these two appear the same for you?
Advocation has quit [Quit: Advocation]
redlines has quit [Read error: Connection reset by peer]
<b00stfr3ak>
havenwood: ahh ok thanks
glaksmono has joined #ruby
<havenwood>
shevy: the left and right now, the above and below yes
<havenwood>
/s/now/no
<BlakeRG>
Hey all, this is kind of off topic but i need to give a presentation today. Is there anything simple/free that can do network topology stuff as well?
<shevy>
hmmmm
burlyscudd1 has joined #ruby
redlines has joined #ruby
burlyscudd1 has quit [Client Quit]
zeade has joined #ruby
saarinen has joined #ruby
razrunelord has joined #ruby
OdNairy has joined #ruby
<shevy>
I just tried with vim as well
<shevy>
the display is now pwdlöin rather than ö inside
<havenwood>
b00stfr3ak: the `this.rb` of course doesn't have to be per-method, but good to have folders mirror the module/class namespaces
<shevy>
:set fileencoding=utf-8
nfk has quit [Quit: yawn]
<IceDragon>
shevy: QUICK, Tell me whats new in Ruby 2.1.1 ! ;_; I haven't been ruby-ing lately
nfk has joined #ruby
<havenwood>
pop quiz!
einarj has quit [Remote host closed the connection]
yfeldblum has joined #ruby
<shevy>
IceDragon no idea, I dont follow it as I cant upgrade
mikecmpbll has quit [Ping timeout: 272 seconds]
yacks has quit [Quit: Leaving]
<redlines>
Was Ruby 1.9 > Ruby 2 a huge change?
<IceDragon>
say wut
mmoretti has joined #ruby
retnuh has joined #ruby
<shevy>
redlines sure
vpretzel_ has quit [Quit: Adios!]
<havenwood>
redlines: an incremental chance, not breaking like 1.8 to 1.9
<redlines>
RailsInstaller still includes 1.9.3
<IceDragon>
performance wise, probably :O nothing compared to 1.8.x to 1.9
<havenwood>
redlines: think of 1.9 as the release candidate for 2.0 :P
mmoretti has quit [Remote host closed the connection]
<shevy>
redlines code that would perfectly work on 1.9 won't work in 2.0 - if you use invalid yaml files for instance
xerox357_ has quit [Remote host closed the connection]
<ReachingFarr>
I accidentally pushed a bad version of a gem, so I yanked it. Now, when I try and push the correct version I get `Repushing of gem versions is not allowed.` What am I doing wrong?
tolstoi has quit [Ping timeout: 245 seconds]
Hobogrammer_ has joined #ruby
tolstoi has joined #ruby
tolstoi has quit [Changing host]
tolstoi has joined #ruby
wiku5_ has joined #ruby
centrx has joined #ruby
dbf has quit [Quit: Page closed]
<agarie>
You'll probably need to push a newer version
xerox357 has joined #ruby
klaut has quit [Remote host closed the connection]
koell has joined #ruby
kaliya has quit [Quit: Lost terminal]
BadProphet has joined #ruby
Finlay has joined #ruby
Megtastique has quit []
Vivekananda has quit [Remote host closed the connection]
Hobogrammer has quit [Ping timeout: 264 seconds]
<Finlay>
How would I get the path of the current ruby file? Is there a constant or something?
<jhass>
yep, __FILE__
<shevy>
Finlay yeah __FILE__
<Finlay>
ah, thank you very much
<jhass>
since 2.0 there's also __dir__ for the directory of the current file
<shevy>
ReachingFarr hmm interesting
<havenwood>
Finlay: or __dir__ for the containing directory
<havenwood>
jhass: beat me to it ;)
whomp has joined #ruby
jonah_k has quit [Remote host closed the connection]
<shevy>
ReachingFarr anyway, just increment the version by +1 minor. if you can't or don't want, ask the guys on #rubygems
<Finlay>
like PHP then. I should have guessed/been able to find that. I'm in puppet and was searching the puppet docs to no avail. Should have expanded my search :)
Hanmac1 has joined #ruby
<shevy>
ack
<shevy>
PHP!
<ReachingFarr>
shevy: Done and done.
<ReachingFarr>
shevy: Thanks
<shevy>
\o/
<Finlay>
shhhh
<shevy>
the rubygems.org policy is weird
<shevy>
they keep yanked gems
alexherbo2 has joined #ruby
<shevy>
I hate that
<havenwood>
shevy: for the sake of dependency managers
<havenwood>
shevy: yeah, you just need to contact a human to do a full-blown removal
<havenwood>
shevy: for now..
VTLob has joined #ruby
<shevy>
havenwood what is there to manage when I want it gone? it is my gem, not some other dude's gem
xerox357 has quit [Remote host closed the connection]
zeeraw has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<hopkin>
Honestly this is my first time doing anything like this beyond normal less and grep from the logs and occasionally awk
_ixti_ has joined #ruby
<hopkin>
normally I just less and pipe in grep but these are huge logs so I have to do something different
freezey has quit [Remote host closed the connection]
rails426 has joined #ruby
mehlah has joined #ruby
cj3kim has quit [Ping timeout: 240 seconds]
Trynemjoel has joined #ruby
ahawkins_ has quit [Remote host closed the connection]
ixti has quit [Read error: Connection reset by peer]
<hopkin>
and I figured since I am working on learning Ruby I might try to hack something out with it
Faris2 has quit [Ping timeout: 246 seconds]
mansi has joined #ruby
aspires has quit []
derpdederp has joined #ruby
<shevy>
ok
<hopkin>
I have to look for 4 urls over a 90 day period and when I do a grep for just the count on 1 url over a 9 day period it takes 20 minutes so that is bad for me.
TMM has joined #ruby
xerox357 has joined #ruby
<shevy>
huh
<shevy>
grep requires 20 minutes?
<shevy>
how huge is that log file
<shevy>
hopkin it helps to reduce the problem down to small, solvable components
<shevy>
(1) File.readlines to iterate over the file
<shevy>
(2) grep
gja has joined #ruby
gja has joined #ruby
gja has quit [Changing host]
<shevy>
(3) display
<shevy>
hmm no
<hopkin>
1259991226 per day
<shevy>
not File.readlines
yfeldblum has joined #ruby
mjs2600 has joined #ruby
<shevy>
File.foreach
<hopkin>
sorry basically 1gb per file
aspires has joined #ruby
<hopkin>
9 days = ~9gb
<shevy>
hmm
<hopkin>
90 days is just over 100 gb of logs
<shevy>
why does it take your grep 20 minutes
himsin has quit [Quit: himsin]
<hopkin>
so I did this less filename | grep -iwc 'url'
npearson has quit [Remote host closed the connection]
<shevy>
hopkin ok I guess the first thing you need is to build a regex that works
<hopkin>
So the reason I was thinking Ruby is I could use this bit over again and I can use it to make an output file based on the url I am looking for, I could even get fancy and ask for a piece of the url to look for if I don't have a full string
<shevy>
come on slash_nick!
dachi has joined #ruby
<slash_nick>
:)
<shevy>
hopkin you wanna use ruby on big heavy chunks, I would have rather tried to start with some smaller
mary5030 has joined #ruby
<shevy>
hopkin I have an idea - let's pretend the log file is like 10 lines long only
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
vlad_starkov has joined #ruby
kraljev5 has joined #ruby
alvaro_o has joined #ruby
<havenwood>
hopkin: or shell out from Ruby with a parallel grep then do your logic in Ruby once you've got your mark
<kraljev5>
I'm using MonitorMixin
<kraljev5>
However, when I use synchronize {} block, I cannot access @ variables from it
<hopkin>
so I put a copy in my gist of one of the entries in the log file if that helps
<havenwood>
hopkin: GNU grep plus parallel would make it scream
<hopkin>
er freebsd I mean lol
<havenwood>
multiple cores and much more optimized grep
Hanmac1 has quit [Ping timeout: 272 seconds]
xerox357 has quit [Remote host closed the connection]
<hopkin>
I sadly can't as I am only app support the ops team I don't think will implement this before I need to turn in my findings on the urls I am searching for lol
apeiros has quit [Ping timeout: 264 seconds]
<havenwood>
aha
aspires has quit [Client Quit]
<hopkin>
and apachelogregex looks good I just have to figure it out beyond 'require apachelogregex'
<hopkin>
that and Rubular should help me out lol
whomp has quit [Ping timeout: 272 seconds]
nhhagen has joined #ruby
JarJarBi1ks has quit [Read error: Operation timed out]
JarJarBinks has joined #ruby
aspires has joined #ruby
mjs2600 has quit [Remote host closed the connection]
nhhagen has quit [Remote host closed the connection]
xerox357 has joined #ruby
<shevy>
hopkin, there is one regex that works: (^http:\/\/\d+.\d+.\d+.\d+)
Kricir has joined #ruby
andy__ has quit [Ping timeout: 264 seconds]
vlad_starkov has quit [Remote host closed the connection]
Hanmac has joined #ruby
pietr0 has quit [Quit: pietr0]
<shevy>
hopkin p File.read('name_of_your_logfile_here').scan(/(^http:\/\/\d+.\d+.\d+.\d+)/).flatten
banister has joined #ruby
senayar has joined #ruby
pigzzcanfly has joined #ruby
Xiti has joined #ruby
SloggerKhan has quit [Quit: Leaving.]
randomnick_ has joined #ruby
whomp has joined #ruby
Solnse has joined #ruby
yarou has quit [Remote host closed the connection]
pietr0 has joined #ruby
<hopkin>
so I put some test data into rubular and tried that regex but it says no matches and when I try ).flatten is says invalid option
<shevy>
you are trying .flatten in rubular?
<shevy>
use rubular only for testing a regex
<shevy>
once you have the regex, use the ruby irb
shadoi has joined #ruby
alexherbo2 has quit [Ping timeout: 244 seconds]
rubyracer has joined #ruby
<shevy>
hopkin give the specific line that has a URL
<shevy>
I mean here on #ruby so I can test
<hopkin>
I tried just this in rubular (^http:\/\/\d+.\d+.\d+.\d+)
<shevy>
ok but what was the input string you used
sailias has joined #ruby
rdark has quit [Quit: leaving]
freezey has quit [Remote host closed the connection]
<havenwood>
hopkin: there are many patterns to match on, but depending on how uniform the logs are your options vary
<hopkin>
it can yeah but the parts I pasted there are the same
<hopkin>
I need the url
<shevy>
hopkin ok then http can not match because your input string lacks that part
<havenwood>
hopkin: can you give an actual example Gist of 5 or 10 logs?
<shevy>
hopkin, in that case, try at rubular: ^\d+.\d+.\d+.\d+
<havenwood>
lines*
yarou has joined #ruby
mansi has quit [Read error: Connection reset by peer]
<hopkin>
shevy that matches the ip out it looks like
<slash_nick>
\d{1,3}
mjs2600 has joined #ruby
<shevy>
hopkin \o/
mansi has joined #ruby
<havenwood>
oh, i was confused what was desired
<havenwood>
today that is happening a lot
<shevy>
hopkin now you should try it in irb
senayar_ has joined #ruby
senayar has quit [Ping timeout: 264 seconds]
jaredrhine has quit [Read error: Connection reset by peer]
marcdel has joined #ruby
bean has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sparrovv has quit [Remote host closed the connection]
<dachi>
hello. i have got another question... I am Christian but as a person I am having not few prejudices about different things. I always found Ruby to be positive, but I understand that you are using Vim as real community tool for terminal editing. I am thinking that I need to stay away from that because of vi beast thing, and that is why I am still using nano. . . what do you think? Is this stupid that vim = vi 6 thing?
<wuest>
(Keep in mind that \d{1,3} is not going to only match valid IPs)
shinobi_one has joined #ruby
derpdederp has quit [Remote host closed the connection]
shinobi_one has quit [Client Quit]
<shevy>
wtf
yeboot has quit [Quit: afkbrb]
<centrx>
dachi, What is the "vi beast thing"?
<shevy>
a Christian and a Vim user
wiku5_ has quit [Ping timeout: 272 seconds]
jaredrhine has joined #ruby
Kelgors has quit [Remote host closed the connection]
<shevy>
dachi the end goal is to use ruby to generate ruby really
<dachi>
so? shevy you understand yes? I should stay away from vim right?
shashin has joined #ruby
shashin has joined #ruby
shashin has quit [Changing host]
<shevy>
you should stay away from vim in general
<dachi>
thank you I will not ask anything more about this. Thank you.
<shevy>
it messes with your brain
<shevy>
you'll start to think in terms of 6dd :set wtf
<wuest>
vim uber alles.
<centrx>
vim is a good text editor.
<shevy>
wuest yeah, at work I have to use vim :(
jlast has quit [Remote host closed the connection]
DrShoggoth has joined #ruby
<wuest>
(seriously though, I had my fill of holy wars two decades ago; I don't care what others use to edit)
<shevy>
I don't care but I insult them
shashin has quit [Client Quit]
<havenwood>
vim and emacs are powerful, but TIMTOWTDI
<shevy>
gvim is best
mocfive has quit [Remote host closed the connection]
bricker has quit [Remote host closed the connection]
<wuest>
havenwood: thank you, exactly :)
<shevy>
dachi, use gvim
<shevy>
the g stands for
<shevy>
hmmm
<shevy>
something
<havenwood>
shevy: graphical
jlast_ has joined #ruby
<shevy>
great
crystal77 has joined #ruby
mocfive has joined #ruby
<shevy>
no, I think it is standing for greatness havenwood
<havenwood>
shevy: goody-goody-gumdrops
<shevy>
hehehe
<shevy>
I remember the old days of the web with the warez sites
<wuest>
shevy: heh. My gvimrc is one line: set guioptions=ac
<crystal77>
In ruby, I can do "echo {1..100}". Does ruby have anything similar? I just want to make an array of 1 to 100 in irb, but don't want to type it all out :p
<shevy>
I don't know what that option does, but actually, vim beats gvim hands down
<crystal77>
*In bash, I can do
<wuest>
(Because when I launch gvim really I just want real vim in a gui, none of this extra gui nonsense)
shime has joined #ruby
<havenwood>
crystal77: [*1..100]
<havenwood>
crystal77: or: 1.upto(100).to_a
<havenwood>
crystal77: etc
<centrx>
(1..100).to_a
npearson_ has quit [Remote host closed the connection]
<shevy>
crystal77 ruby beats bash!
<centrx>
Last one is faster
<havenwood>
centrx: depending...
npearson has joined #ruby
skaflem has left #ruby ["Leaving"]
<centrx>
havenwood, Depending on what?
timonv has joined #ruby
<havenwood>
centrx: the implementation of Ruby
<centrx>
Well, it's faster in 2.0 and 2.1
<crystal77>
hmm. let me try.
<centrx>
MRI
<centrx>
about 2x as fast in MRI 2.0
<havenwood>
centrx: aye, in incredibly tight loops, but i think aesthetics is the real deciding factor
mary5030 has quit [Remote host closed the connection]
freezey has joined #ruby
<hopkin>
@shevy I am in the irb and trying to type something like p File.read('access-hop-201311*-cbnwrwlb*.log).scan(^\d+.\d+.\d+.\d+)/).flatten put it comes back with nothing at all
<shevy>
havenwood centrx beat you there!
jmau5_ has quit [Remote host closed the connection]
<shevy>
hopkin look man
<shevy>
hopkin ruby is short and elegant and so you must look with your eyes carefully
no0code has quit [Ping timeout: 246 seconds]
<shevy>
hopkin in your case, you seem to have forgotten a '
cina has quit [Quit: leaving]
mocfive has quit [Ping timeout: 244 seconds]
jmau5 has joined #ruby
<havenwood>
centrx: I'm not seeing that speed difference, depending on what I bench.
<shevy>
youa lso seem to have forgotten a /
jlast_ has quit [Read error: Connection reset by peer]
<shevy>
so please first look if you properly used the chars
jlast has joined #ruby
<shevy>
hopkin if you need to first do a match, do this: Dir['access-hop-201311*-cbnwrwlb*.log'][0] before passing this into File.read
<havenwood>
centrx: `1.upto(100_000_000).to_a` vs `(1..100_000_000).to_a` vs `[*1..100_000_000]` i'm seeing chaotic but similar results
<shevy>
hopkin if the command gets too long, using the editor is usually better
<shevy>
irb is helpful for small snippets of code
<havenwood>
centrx: i think [*1..100] is pretty pretty
<shevy>
I like the .upto more
<havenwood>
centrx: though i prefer: 1.upto 100
<havenwood>
shevy: hooah
<shevy>
in that specific case at least
<wuest>
[*1..100] is definitely the prettiest, havenwood
* wuest
states subjective opinions in an objective manner.
<centrx>
havenwood, 100,000,000 is going to implicate the garbage collector and so forth more than the range/array
<shevy>
I am a weird person though, I like loop {} more than while
<shevy>
and I hate for
super_g has quit [Quit: Page closed]
<shevy>
every single time I use for, it stands out at being at odds with the rest of the code it resides in :(
jlast has quit [Remote host closed the connection]
momomomomo has quit [Quit: momomomomo]
<shevy>
wuest [*1..100] is ok too, it's terse, terse is almost always great
bricker has joined #ruby
<shevy>
I just don't like endless method chaining... .map.tap.scratch.the.monkey
<crystal77>
How come puts 1.upto(100) doesn't work? ;_;
Asher has joined #ruby
<shevy>
crystal77 what should it do
jmau5 has quit [Ping timeout: 246 seconds]
<crystal77>
put 1 through 100 in my console...
<shevy>
crystal77 and did you try my variant... 1.upto(100).each {|e| print e,' ' }
Asher has quit [Client Quit]
<shevy>
crystal77 no it just counts up
<shevy>
there is no put there so it won't put
<havenwood>
centrx: i don't think speed should factor in on this particular decision expect for vary rare cases, but good point re GC (i'd argue it does matter though since premature optimization foiled! :p)
jmau5 has joined #ruby
<havenwood>
crystal77: you need to turn it into an Array
<havenwood>
crystal77: 1.upto(100).to_a
<centrx>
havenwood, Yeah, it looks like the huge difference is only with very small n too
<crystal77>
1.upto(100) { |i| puts i } works (; - though not too elegant
JustinAiken has joined #ruby
<centrx>
havenwood, with n=100 it is only 15% faster than #upto and even less than [*]
<centrx>
with
<shevy>
crystal77 but puts appends a newline
<shevy>
your shell variant does not, so print should be used
<hopkin>
@shevy thanks I got the ' and the / as well as a ( that I was missing
<shevy>
hopkin \o/ time to use a good editor too!
<shevy>
a programmer should have sharp eyes
<shevy>
sadly, most programmers have awful eyes
<hopkin>
yeah that was totally on the command line
noopq has quit [Ping timeout: 246 seconds]
<hopkin>
I normally use sublime
<shevy>
\o/
<hopkin>
well computer users have bad eyes because we stare at computers all day long lol
slacko26050 has joined #ruby
<hopkin>
and night
<shevy>
hmm
<shevy>
yeah
<shevy>
too much indoor, not enough sunshine
<havenwood>
crystal77: `[1..100]` is an Array with a Range as its single element, but the splat in `[*1..100]` explodes the Range into 100 elements.
<shevy>
especially bad when you are young
lolmaus has quit [Remote host closed the connection]
<havenwood>
crystal77: another example is `[*'a'..'z']` versus `'a'.upto('z').to_a`.
mary5030 has quit [Remote host closed the connection]
<crystal77>
Ahh my brain!
<shevy>
hopkin happens to the best of us
<shevy>
crystal77 DESTROY IT!
xibalba has joined #ruby
Kelgors has joined #ruby
mary5030 has joined #ruby
m8 has quit [Ping timeout: 264 seconds]
sailias has quit [Ping timeout: 246 seconds]
Advocation has quit [Quit: Advocation]
<kraljev5>
Array.new {|i| i}
freerobby has quit [Quit: Leaving.]
<wuest>
crystal77: actually. This should be enlightening for you, if you haven't done it yet: `1.upto(100).class`
<kraljev5>
Array.new(100) {|i| i}
arcanez has left #ruby [#ruby]
vlad_starkov has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
mengu has quit [Read error: Connection reset by peer]
<wuest>
kraljev5: 101. Fencepost. :)
<kraljev5>
Array.new(100) {|i| i+1} # this one :)
<crystal77>
The Enumerator class...interesting. I didn't know such a class existed.
momomomomo has joined #ruby
<wuest>
Yep. Become friends with Enumerator. It's nice.
freerobby has joined #ruby
<existensil>
I've been using Enumerator.new{ } a lot lately
no0code has joined #ruby
<centrx>
dachi, Have you tried Ubuntu Christian Edition?
SHyx0rmZ has joined #ruby
<dachi>
I don't know what's that
dingus_khan has joined #ruby
<dachi>
I'm using osx
<dachi>
and debian for server
<dachi>
I don't think Ubuntu Christian is going to be something really christian related
<kraljev5>
something is unlocking my mutex, i have no #unlock or #synchronize
<dachi>
i'm just trying to stay away form evil things
<centrx>
dachi, I do not know. I just stumbled on it. I thought you might be interested.
s2013 has quit [Ping timeout: 244 seconds]
<shevy>
dachi lol
momomomomo has quit [Client Quit]
vlad_starkov has quit [Read error: Connection reset by peer]
Azulinho has joined #ruby
<centrx>
dachi, According to an article in a 2006 edition of Linux Format magazine, "One of the great features of Ubuntu Christian Edition is the inclusion of a popular firewall, preconfigured for parental control of harmful web content."
s2013 has joined #ruby
tjr9898 has quit []
<JustinAiken>
what happens if a ruby class wraps something in #synchronize, without specifying a Mutex or the such?
bogeyd6 has joined #ruby
<shevy>
crystal77 let ruby replace all of bash
tjr9898 has joined #ruby
atmosx has joined #ruby
dingus_khan has quit [Ping timeout: 240 seconds]
SCommette has quit [Quit: SCommette]
<havenwood>
JustinAiken: #synchronize is a method on Mutex (other classes as well, but not available universally)
faulkner has joined #ruby
senayar_ has quit [Remote host closed the connection]
<havenwood>
JustinAiken: but NoMethodError if it isn't available
alekst has joined #ruby
rootshift_ has quit [Quit: My MacBook has decided to go to sleep. Zzzz..]
<atmosx>
havenwood: mutex has to be used only when you write you rown tcp server right? where you need to handle simultaneous connections/requests?
<crystal77>
shevy: trying. trying real hard to be a rails dev. some of the things just confuse the heck out of me. :)
<havenwood>
atmosx: threading is one option for concurrency but not the only way
<wuest>
atmosx: mutex/etc. is useful anywhere that you're dealing with concurrency and any manner of shared state.
<havenwood>
wuest: if threading
<shevy>
crystal77 pfft I thought you came to ruby because of ruby... railsers are sent into hell aka #rubyonrails
<atmosx>
ah okay
<wuest>
havenwood: "shared state"
<shevy>
hey atmosx
elaptics is now known as elaptics`away
SegFaultAX has quit [Excess Flood]
<havenwood>
wuest: good point, you can use mutexes with IPC
<atmosx>
shevy: hey, how's the work?
<shevy>
atmosx awful
<atmosx>
shevy: started writing my thesis, I spent 4 hours for 2 paragraphs
<havenwood>
wuest: aye
<atmosx>
shevy: really? :-(
<shevy>
atmosx they use different rubies on different servers and I have to connect via putty on a windows machine to the rest
<shevy>
atmosx yeah. but they are nice so I can't complain, I just can't wait to get out of there
<havenwood>
atmosx: what is your thesis on?
<shevy>
atmosx is that good? 2 paragraphs? how many paragraphs will you need?
agent_white has joined #ruby
tjr9898_ has joined #ruby
xibalba has left #ruby ["Leaving"]
s2013_ has joined #ruby
<atmosx>
havenwood: current status and future developments of sequence alignment, why do you ask? :-P
<havenwood>
atmosx: curiosity
<atmosx>
shevy: I need ~ 50 pages
<atmosx>
havenwood: ah sure, I thought you were on the field or something, into bioinformatics
s2013 has quit [Write error: Broken pipe]
tjr9898 has quit [Write error: Broken pipe]
snath has quit [Ping timeout: 240 seconds]
<atmosx>
havenwood: I also have to write a proof of concept, sequence software (sinatra or rails + fasta format for E.Coli)... it's easy..
<atmosx>
with the bio gem
<crystal77>
shevy: LOL. I'd rather be pure ruby, then a rails guru.
<dachi>
centrx i don't know but i believe that should be better than http://ubuntusa*anic.org/ for some
<shevy>
atmosx cool you'd fit right next to the guy that sits next to me haha
<havenwood>
atmosx: very cool, is the bio gem related to BioRuby
Advocation has joined #ruby
shashin has joined #ruby
rubyoskar has joined #ruby
<rubyoskar>
Is it possible to convert this SQL Query Request into Datamapper? SELECT twitchtv FROM twitchtvsts WHERE twitchtvsts.user_id = thisisavaraible
<shevy>
all day long people come to him and ask him random stuff about sequence algorithms
<havenwood>
crystal77: Ruby on Ruby > Ruby on Rails
<atmosx>
shevy: it's slow. I'm doing the 'history' part now. It's impressive, theoretical biologists were *there* since 1970s
vindictive27 has joined #ruby
<rubyoskar>
Is it possible to convert this SQL Query Request into Datamapper? SELECT twitchtv FROM twitchtvsts WHERE twitchtvsts.user_id = thisisavaraible
blueOxigen has joined #ruby
<shevy>
crystal77 I remember the days before rails, it was great
<wuest>
atmosx: neat. I had always associated python with the sciences, rather than ruby.
<shevy>
even _why was still here!
<atmosx>
havenwood: yeah I'm usint ig
<wuest>
s/had/have/
<atmosx>
havenwood: using it
<rubyoskar>
yes
<rubyoskar>
Is it possible to convert this SQL Query Request into Datamapper? SELECT twitchtv FROM twitchtvsts WHERE twitchtvsts.user_id = thisisavaraible
<centrx>
rubyoskar, Stop spamming
<rubyoskar>
sorry sorry!
<centrx>
rubyoskar, Go look at the Datamapper docs, it is probably the very first example.
<havenwood>
rubyoskar: you said sorry twice!
<atmosx>
wuest: yeah, python has way more libraries but I'm a rubyist (proud of it) and for what I do, I don't need much more. I could roll my own if I didn't find anything (or maybe go with py)
<havenwood>
rubyoskar: j/k j/k
jlast has joined #ruby
rails426 has quit []
<rubyoskar>
havenwood: !ping sorry.
<rubyoskar>
sorry
SegFaultAX has joined #ruby
joelroa has quit [Ping timeout: 264 seconds]
<havenwood>
:P
bklane has joined #ruby
<atmosx>
rubyoskar: sure it's possible
bluOxigen has quit [Ping timeout: 260 seconds]
<shevy>
damn
<shevy>
python has too many libraries
<shevy>
why are you people not writing more gems
<wuest>
atmosx: Bignum's slowness doesn't kill you? (As I understand it, that's where python coders get big benefit over ruby--but I don't do python so don't speak from firsthand experience)
casheew_ has joined #ruby
weeems has joined #ruby
lw has joined #ruby
mercwithamouth has quit [Ping timeout: 244 seconds]
marcgg has joined #ruby
rbartos has joined #ruby
<atmosx>
wuest: no. No one is going to use my PoC for any serious tasks, thre's BLAST for that.
xerox357_ has joined #ruby
<terrellt>
shevy: 72k gems on rubygems is enough for me.
<wuest>
(Not a snarky response. Ruby has some decent documentation which is weird and rare for a language)
<shevy>
crystal7_ if you have an array, populated with the data you need, you simply print it out
<havenwood>
crystal7_: the Enumerable methods are important to learn
<crystal7_>
wuest: haha, looking. Trying to do select.class or something, guess I forgot the syntax for that already.
<apeiros>
crystal7_: the receiver is the object you call the method on
SegFaultAX has quit [*.net *.split]
vindictive27 has quit [*.net *.split]
Advocation has quit [*.net *.split]
SHyx0rmZ has quit [*.net *.split]
wiku5_ has quit [*.net *.split]
mcls has quit [*.net *.split]
rubyracer has quit [*.net *.split]
Solnse has quit [*.net *.split]
pietr0 has quit [*.net *.split]
banister has quit [*.net *.split]
xerox357 has quit [*.net *.split]
dachi has quit [*.net *.split]
_ixti_ has quit [*.net *.split]
MattStratton has quit [*.net *.split]
marcgg_ has quit [*.net *.split]
ndrei has quit [*.net *.split]
yekta has quit [*.net *.split]
bleak has quit [*.net *.split]
shiftins has quit [*.net *.split]
moted has quit [*.net *.split]
forced_request has quit [*.net *.split]
chipotle has quit [*.net *.split]
JustinAiken has quit [*.net *.split]
FL1SK has quit [*.net *.split]
dx7 has quit [*.net *.split]
LadyRainicorn has quit [*.net *.split]
xaq_ has quit [*.net *.split]
guilleiguaran has quit [*.net *.split]
CaptainJet has quit [*.net *.split]
gl- has quit [*.net *.split]
caveat- has quit [*.net *.split]
mikee has quit [*.net *.split]
lkba has quit [*.net *.split]
Es0teric has quit [*.net *.split]
rayners has quit [*.net *.split]
crystal77 has quit [*.net *.split]
blackmesa has quit [*.net *.split]
axl_ has quit [*.net *.split]
geopet has quit [*.net *.split]
phantasm66 has quit [*.net *.split]
meatherly has quit [*.net *.split]
Wolland has quit [*.net *.split]
pico-pete has quit [*.net *.split]
kaldrenon has quit [*.net *.split]
dblessing has quit [*.net *.split]
Salve has quit [*.net *.split]
dguettler has quit [*.net *.split]
IceyEC has quit [*.net *.split]
dvorak has quit [*.net *.split]
Scientz has quit [*.net *.split]
axsuul has quit [*.net *.split]
pfg has quit [*.net *.split]
lele has quit [*.net *.split]
Waheedi has quit [*.net *.split]
ziyadb_ has quit [*.net *.split]
Nyyx has quit [*.net *.split]
The-Mad-Pirate has quit [*.net *.split]
kevinykchan has quit [*.net *.split]
weie has quit [*.net *.split]
weems has quit [*.net *.split]
sirecote has quit [*.net *.split]
casheew has quit [*.net *.split]
aboudreault has quit [*.net *.split]
pitzips has quit [*.net *.split]
maZtah has quit [*.net *.split]
Sammael has quit [*.net *.split]
Olipro has quit [*.net *.split]
ohcibi has quit [*.net *.split]
jds has quit [*.net *.split]
msch has quit [*.net *.split]
justinxreese has quit [*.net *.split]
Angelous has quit [*.net *.split]
`MArceLL` has quit [*.net *.split]
halfie has quit [*.net *.split]
eregon has quit [*.net *.split]
tommyblue has quit [*.net *.split]
the_mentat has quit [*.net *.split]
jinie has quit [*.net *.split]
phrozen77 has quit [*.net *.split]
mtjandra has quit [*.net *.split]
hanikazmi has quit [*.net *.split]
Emmanuel_Chanel has quit [*.net *.split]
artmann has quit [*.net *.split]
Koshian has quit [*.net *.split]
idoru has quit [*.net *.split]
Takumo has quit [*.net *.split]
Soulcutter has quit [*.net *.split]
juni0r has quit [*.net *.split]
pietr0_ is now known as pietr0
moted_ is now known as moted
dguettler_ is now known as dguettler
dblessing_ is now known as dblessing
sirecote_ is now known as sirecote
yekta_ is now known as yekta
timonv has quit [Write error: Broken pipe]
the_ment- is now known as the_mentat
weeems is now known as weems
<apeiros>
crystal7_: obj.foo # <-- obj is the receiver, foo is the method called on the receiver
<shevy>
crystal7_ #each in general is used to iterate over something. think of it as a container like a backpack, that is your array. you apply something on each element
weems has quit [Changing host]
weems has joined #ruby
<shevy>
huh... is freenode acting crazy again
<apeiros>
and it's called receiver, because it receives a message (the method call)
<crystal7_>
ahh, gotcha. I just call it the object
<wuest>
shevy: compared with a few weeks ago, I'll settle for this level of "weird" from freenode
<apeiros>
crystal7_: every receiver is an object, not every object is a receiver
<crystal7_>
makes sense why select wouldn't work. it's trying to iterate on...nothing..
pigzzcanfly has quit [Remote host closed the connection]
SegFaultAX has joined #ruby
<shevy>
you have a video for every occasion
mdpatrick has joined #ruby
ferr has quit [Write error: Connection reset by peer]
ktosiek has quit [Ping timeout: 244 seconds]
yfeldblum has quit [Ping timeout: 240 seconds]
tjr9898 has quit [Remote host closed the connection]
msch has joined #ruby
The-Mad-Pirate has joined #ruby
The-Mad-Pirate has quit [Excess Flood]
The-Mad-Pirate has joined #ruby
Olipro has joined #ruby
nanoyak_ has joined #ruby
The-Mad-Pirate has quit [Excess Flood]
elcontrastador has joined #ruby
The-Mad-Pirate has joined #ruby
The-Mad-Pirate has quit [Excess Flood]
ndrei has quit [Quit: leaving]
tjr9898 has joined #ruby
zachallett has joined #ruby
The-Mad-Pirate has joined #ruby
ndrei has joined #ruby
kirun has quit [Remote host closed the connection]
The-Mad-Pirate has quit [Excess Flood]
jmau5 has quit [Remote host closed the connection]
Notte has joined #ruby
<shabgard>
how to select the smallest amount using regex?
The-Mad-Pirate has joined #ruby
<shabgard>
I'm trying to find mp3 files with this pattern: https?://.*\.mp3
The-Mad-Pirate has quit [Excess Flood]
ilyam has quit [Quit: ilyam]
jmau5 has joined #ruby
<shabgard>
which gets more than expected
The-Mad-Pirate has joined #ruby
klaut has joined #ruby
The-Mad-Pirate has quit [Excess Flood]
saturn_usa has left #ruby ["Leaving"]
The-Mad-Pirate has joined #ruby
The-Mad-Pirate has quit [Excess Flood]
<RubyPanther>
It is a 90s classic, that video was even on the local BBSes before they died
rubyoskarisback has joined #ruby
The-Mad-Pirate has joined #ruby
The-Mad-Pirate has quit [Excess Flood]
<rubyoskarisback>
Datamaapper question.. . get '/watch/:id' do |id| erb :mystream @result = Twitchtvst.all( :fields => [:Twitchtv ], :conditions => { :user_id => "#{id}" } ) puts @result end ( how Do I get twitchtv only instead of evetything in @reusult??
nanoyak has quit [Ping timeout: 264 seconds]
The-Mad-Pirate has joined #ruby
<centrx>
shabgard, You mean not use greedy expression for .* ?
twiceaday has quit [Ping timeout: 244 seconds]
The-Mad-Pirate has quit [Excess Flood]
<rubyoskarisback>
@result.inspect ?!?!??!?!
<RubyPanther>
I haven't made it up to those newfangled xkcd links
fedesilv_ has quit [Read error: Connection reset by peer]
<AntelopeSalad>
why does that not return the same data type as foo.scan(/^export COOL_.*/)
The-Mad-Pirate has quit [Excess Flood]
oso|away is now known as oso96_2000
<AntelopeSalad>
the first one returns an array while the second return a string
The-Mad-Pirate has joined #ruby
fedesilv_ has joined #ruby
momomomomo has quit [Quit: momomomomo]
The-Mad-Pirate has quit [Excess Flood]
<AntelopeSalad>
but rubular doesn't show this difference
The-Mad-Pirate has joined #ruby
<bean>
AntelopeSalad: because one has a match group, the other doesn't
The-Mad-Pirate has quit [Excess Flood]
<centrx>
AntelopeSalad, "If the pattern contains no groups, each individual result consists of the matched string, $&. If the pattern contains groups, each individual result is itself an array containing one entry per group."
<bean>
string = "export COOL_"
The-Mad-Pirate has joined #ruby
<AntelopeSalad>
bean: how can i modify it so that the first one returns a flattened result just like the 2nd?
The-Mad-Pirate has quit [Excess Flood]
<bean>
AntelopeSalad: see what centrx said.
The-Mad-Pirate has joined #ruby
kpshek has joined #ruby
<ineb>
i have some troubles with duck-typing. i have a function which needs a integer as parameter. should my function also accept a string or any object that supports .to_i?
kate_r has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
fella5s has quit [Ping timeout: 252 seconds]
<centrx>
AntelopeSalad, Maybe don't use scan if you need something special from it?
<centrx>
apeiros, The-Mad-Pirate kept quitting and re-joining. Looks like it might be over
<apeiros>
yeah, looking at that right now
edwardly has joined #ruby
jonr22 has joined #ruby
<AntelopeSalad>
centrx: previously i didn't have to use (foo|bar) in my regex and the return value of scan worked great in what i was doing afterwards
<AntelopeSalad>
it wasn't until i started using (foo|bar) where it became a problem
craigp has quit []
vt102 has quit [Ping timeout: 252 seconds]
<ineb>
centrx: in my case its a variable which holds a size value (in bytes). i then put it into a filesize object to easy calculate it in MB, GiB etc.
vt102 has joined #ruby
<centrx>
AntelopeSalad, #match always returns a MatchData object, from which you can get an array with #captures
<ineb>
centrx: so ich have set_size(bytes) as function, and i need a numeric value or filesize object
lolmaus has quit [Read error: Connection reset by peer]
vlad_starkov has quit [Remote host closed the connection]
<ineb>
but an object like string, which represents a number would also be fine i guess
agent_wh1te has quit [Quit: leaving]
agent_white has quit [Quit: leaving]
mikepack has joined #ruby
lolmaus has joined #ruby
<centrx>
ineb, Duck typing is generally favored
<AntelopeSalad>
centrx: might be easier if i gist what i'm doing?
raluxgaza has joined #ruby
<centrx>
AntelopeSalad, Yes
meatherl_ has quit [Remote host closed the connection]
ctp has quit [Quit: Leaving...]
Xuisce has quit [Remote host closed the connection]
<ineb>
centrx: how should i code it? sth. like begin x.is numeric ? rescue x.to_i rescue ... ?
<centrx>
ineb, Duck typing would be something like: raise TypeError unless x.respond_to?(:to_i)
Xuisce has joined #ruby
zxq9 has quit [Remote host closed the connection]
<centrx>
ineb, Otherwise, you can use x.is_a?(Numeric)
<pipework>
Well, that's more like duck-checking.
zxq9 has joined #ruby
Jeticus has quit []
dguettler has quit [Quit: dguettler]
<centrx>
Whatever it's called, it's a duck
<ineb>
centrx: okay, but your second thought would fail for strings
Spami has joined #ruby
<ineb>
yes, i got the idea, but i struggle in implementing it a bit.
<centrx>
ineb, is_a? works with any class
Spami has quit [Max SendQ exceeded]
<apeiros>
or Module even
<centrx>
ineb, respond_to?(:to_i) will return true for any class that has a #to_i method
raluxgaza has quit [Remote host closed the connection]
<apeiros>
object, even
<ineb>
centrx: i think thats better. string is not a numeric and will fail
Spami has joined #ruby
mary5030 has quit [Remote host closed the connection]
fedesilv_ has quit [Ping timeout: 264 seconds]
pigzzcanfly has joined #ruby
mary5030 has joined #ruby
<pipework>
ineb: Asking if something responds to a message is one way of not asking if it's a kind of a thing. Most people take duck typing with tell don't ask principle and just send the message.
<centrx>
AntelopeSalad, I can tinker with this, but would /^export #{something}_.*/.match(contents).captures not return the desired result?
glaksmono has quit [Quit: This computer has gone to sleep]
<pipework>
There's certainly nothing wrong with asking if something responds_to something, but it makes some pretty intimidated code, one would think. Look into Confident Code by Avdi Grimm.
<ineb>
pipework: so what would be your solution for my problem?
<pipework>
ineb: Just call #to_i
<pipework>
Or use Integer(arg)
<pipework>
Or whatever.
<AntelopeSalad>
centrx: on my side your proposed solution returns an empty hash
lachesis has joined #ruby
CaptainJet has joined #ruby
aces1up9939 has joined #ruby
<AntelopeSalad>
but i assigned it to env_vars in this case and left everything else as is
reset has joined #ruby
<pipework>
AntelopeSalad: I see what you're doing, but I cna't find what you're trying to accomplish at a higher level.
<aces1up9939>
what does this error mean ? Unable to activate mws-connect-0.0.3, because nokogiri-1.6.1-x86-mingw32 conflicts with nokogiri (~> 1.5.5) my nokogiri is 1.6.1 which is > 1.5.5
<AntelopeSalad>
my end goal would be to return the single hash with all 3 matches
momomomomo has joined #ruby
rezzack has joined #ruby
<ineb>
pipework: Confident Code lookup on Amazon gave me 'The Confidence Code: The Science and Art of Self-Assurance---What Women Should Know'. dont know what that means
dapz has joined #ruby
<ineb>
but i think 'confident ruby' is it.
Hobogrammer has joined #ruby
npearson has quit [Remote host closed the connection]
mansi has quit [Remote host closed the connection]
lukec has joined #ruby
ndrei has quit [Ping timeout: 264 seconds]
<pipework>
Oh sorry, yeah it's Confident Ruby.
sambao21 has quit [Quit: Computer has gone to sleep.]
<AntelopeSalad>
btw what does it expect as input? i tried feeding it file.read
mercwithamouth has joined #ruby
kayamm has left #ruby ["part"]
JBreit has quit [Ping timeout: 240 seconds]
<AntelopeSalad>
but then it blows up with an undefined method split
wiku5__ has joined #ruby
jlast has quit [Remote host closed the connection]
<pipework>
AntelopeSalad: Read manual. Is good.
Notte has quit [Remote host closed the connection]
glaksmono has joined #ruby
<aces1up9939>
how can i resolve this error ? Unable to activate mws-connect-0.0.3, because nokogiri-1.6.1-x86-mingw32 conflicts with nokogiri (~> 1.5.5)
<AntelopeSalad>
pipework: it says it belongs to String
bklane has quit [Remote host closed the connection]
<aces1up9939>
seem 1.6.1 > 1.5.5 where would this gem be saying it needs ~> 1.5.5 ?
<AntelopeSalad>
pipework but file.read returns a string
mr_red has quit [Ping timeout: 244 seconds]
einarj has quit [Remote host closed the connection]
carraroj has quit [Quit: Konversation terminated!]
mlpinit_ has quit [Remote host closed the connection]
papes11 has joined #ruby
m8 has joined #ruby
jlast has joined #ruby
papes11 has left #ruby [#ruby]
<AntelopeSalad>
pipework: it says it returns an enumerator but you can't split on an enum
shashin has joined #ruby
shashin has quit [Changing host]
shashin has joined #ruby
mlpinit has joined #ruby
alexherbo2 has joined #ruby
ktosiek has joined #ruby
<slash_nick>
AntelopeSalad: i feel like it said none of those things, rather those are your interpretations of the actual output..
v0n has quit [Ping timeout: 264 seconds]
<shevy>
hehe
<AntelopeSalad>
slash_nick: the documentation says When neither a block nor a second argument is supplied, an Enumerator is returned.
<shevy>
AntelopeSalad ok, when you pass a hash, you actually get back an Enumerator
<AntelopeSalad>
ok, yes IO.read returns a string
plexus_ has joined #ruby
<pipework>
shevy: I forgot to add the regular expression as the first arg when passing a hash to #gsub
<dvorak_>
well, except that IO#read and File#read can take different parameters, so it really sucks that File#read isn't documented
<shevy>
pipework hmm dunno, I never would have expected it to actually return an enumerator... I always thought it would return a string, now I learned something
<dvorak_>
actually, I take that back, nm!
<shevy>
scary .gsub
<AntelopeSalad>
what's the missing link then? don't use the hash style arg into gsub?
jayne has quit [Read error: Connection reset by peer]
<AntelopeSalad>
look at line 9 (2 lines under)
KK4MGV has quit [Remote host closed the connection]
saltsa has quit [Read error: Connection reset by peer]
yarou_ is now known as yarou
predator117 has joined #ruby
bogeyd6 has quit [Read error: Connection reset by peer]
Hamled has joined #ruby
camt has quit [Write error: Connection reset by peer]
Hamled|Erp has quit [Write error: Broken pipe]
yarou has quit [Changing host]
yarou has joined #ruby
mr_red has joined #ruby
casheew_ has quit [Write error: Connection reset by peer]
lmickh_ has quit [Write error: Connection reset by peer]
glaksmono has quit [Write error: Connection reset by peer]
gsvolt has quit [Write error: Connection reset by peer]
beardedn1nja has quit [Write error: Broken pipe]
<pipework>
From there you can reject things, but I'd probably slip in the reject/select stuff in the array before turning it into a hash.
AlSquire has quit [Write error: Connection reset by peer]
<AntelopeSalad>
that is like 45 trillion times more complicated
<pipework>
Yeah, sucks that you have to actually write code to do things.
<pipework>
But the benefit is that you're not using regular expressions.
incade has joined #ruby
<AntelopeSalad>
well, i did write the code to do exactly what i wanted, it's just scan seems to return it in a different format when you use ()
<pipework>
'when you use ()' doesn't mean much to me thinking in ruby.
<AntelopeSalad>
that's why i came here, hoping maybe i could do something to make it work how it works without ()
<bricker>
AntelopeSalad: you get the undefined method when you try to do what?
<AntelopeSalad>
bricker: when i uncomment line 9 and comment line 12
<pipework>
Mind that my version is a bit compacted.
<AntelopeSalad>
the only difference between those 2 lines is that i introduce a () style match in the regex
<pipework>
If you broke it across a few lines, it'd be easier, but IRC isn't great for multiple lines.
pranny has joined #ruby
<AntelopeSalad>
being compact is fine, it's just extremely complicated
<pipework>
Well, if you'd rather write regular expressions over ruby, I can't fix that.
pranny has quit [Read error: Connection reset by peer]
<pipework>
Oh no, it's super simple.
<bricker>
AntelopeSalad: did you read the String#scan documentation? "If the pattern contains groups, each individual result is itself an array containing one entry per group."
pranny1 has joined #ruby
<AntelopeSalad>
bricker: yeah i was hoping i could have done something to flatten it all, but i couldn't get it to work -- that's why i came here
pranny1 has quit [Read error: Connection reset by peer]
_adeponte is now known as adeponte
popl has joined #ruby
popl has quit [Changing host]
popl has joined #ruby
<pipework>
I can't fix the desire to use regular expressions, I'm going to go play with some tests.
<AntelopeSalad>
pipework: maybe if you have multiple years of ruby under your belt it's simple, but there's a lot of craziness going on there
<pipework>
AntelopeSalad: Oh, nothing in there is crazy.
<pipework>
It's all simple methods on simple objects.
thejoecarroll_ has joined #ruby
thejoecarroll has quit [Read error: Operation timed out]
jph98 has joined #ruby
prc has joined #ruby
axl_ has quit [Quit: axl_]
npearson has quit [Read error: Operation timed out]
<AntelopeSalad>
i mean look at it lol
<AntelopeSalad>
you're doing all of that inside of the key of a hash
<AntelopeSalad>
how does the value of the hash even get set?
pranny has joined #ruby
npearson has joined #ruby
jmau5 has quit [Remote host closed the connection]
<pipework>
I'm sure you know what File#read, String#gsub, String#split, Array#map, and Hash[] are.
casheew has joined #ruby
<pipework>
It isn't the key of a hash, it's Hash[]
<AntelopeSalad>
i've neve seen Hash[] being used like that
<pipework>
It's a neat thing.
machuga_ has joined #ruby
Jeticus has quit []
<pipework>
So you just need to learn what Hash[] is, luckily for you it's documented.
<AntelopeSalad>
it says it makes a new hash
predator217 has quit [Remote host closed the connection]
Gate has quit [Remote host closed the connection]
randomnick_ has quit [Excess Flood]
machuga_ is now known as machuga__
rezonanc_ has joined #ruby
<pipework>
It says a lot more than that.
klaut has quit [Remote host closed the connection]
beardedninja has joined #ruby
randomnick_ has joined #ruby
mansi has quit [Ping timeout: 252 seconds]
lukec has quit [Ping timeout: 252 seconds]
einarj has joined #ruby
CaptainJet has quit [Ping timeout: 252 seconds]
axsuul has quit [Ping timeout: 252 seconds]
nowthatsamatt has quit [Ping timeout: 252 seconds]
ItSANgo_ has quit [Ping timeout: 252 seconds]
bean has quit [Ping timeout: 252 seconds]
toretore has quit [Ping timeout: 252 seconds]
nowthatsamatt_ is now known as nowthatsamatt
crystal77 has quit [Ping timeout: 252 seconds]
spyderma_ has quit [Ping timeout: 252 seconds]
IceyEC has quit [Ping timeout: 252 seconds]
vindictive27 has quit [Ping timeout: 252 seconds]
blackmes1 has quit [Ping timeout: 252 seconds]
IceyEC_ is now known as IceyEC
vindictive27_ is now known as vindictive27
machuga has quit [Disconnected by services]
machuga__ is now known as machuga
banister_ has quit [Ping timeout: 252 seconds]
Asher has quit [Ping timeout: 252 seconds]
mjs2600 has quit [Ping timeout: 252 seconds]
Xiti has quit [Ping timeout: 252 seconds]
hopkin has quit [Ping timeout: 252 seconds]
razrunelord has quit [Ping timeout: 252 seconds]
thumpba has quit [Ping timeout: 252 seconds]
baroquebobcat has quit [Ping timeout: 252 seconds]
kevind has quit [Ping timeout: 252 seconds]
awarner_ has quit [Ping timeout: 252 seconds]
beardedninja has quit [Remote host closed the connection]
baroquebobcat_ is now known as baroquebobcat
Asher2 is now known as Asher
kevind_ is now known as kevind
grotr has joined #ruby
<AntelopeSalad>
i don't see anything else there in the docs, unless that massive chain of function calls returns something other than an array?
<pipework>
AntelopeSalad: Yours is slightly better in that it matches before it gets to the hash.
<AntelopeSalad>
pipework: is that identical to the ver i pasted?
testcore has joined #ruby
<shevy>
hmm centrx that seems worse than the two alternatives
<AntelopeSalad>
(only without using a regex of course)
<pipework>
AntelopeSalad: Except for using the regular expression, it outputs roughly the same.
<centrx>
shevy, It is the most user friendly.
<shevy>
no, because you nag the user
<incade>
aces1up9939: I'm stabbing in the dark here, 'http.verify_mode = OpenSSL::SSL::VERIFY_NONE' ?
<pipework>
And we used nothing surprising except maybe Hash[]
<AntelopeSalad>
pipework: i figured i'd do the it before the map because then map does less work?
<AntelopeSalad>
not that it matters
<centrx>
shevy, Your alternatives are to silently accept the user's incorrect value, or to nag the user even worse with an explosive error.
<shevy>
centrx indeed except that in the first case I continue without problem, in the second at least there is a clear indication about an error
<pipework>
shevy: You set it to 255
<pipework>
But you'd show them the output or the value after it's been limited to 255 instead of the greater value, if you can.
<AntelopeSalad>
pipework: is there a convention to break this into multiple lines so it's readable?
<shevy>
hmm
<AntelopeSalad>
i would normally put line breaks before the period, but i mean about the Hash[] part
<pipework>
AntelopeSalad: Just format the code differently
pigzzcanfly has joined #ruby
<shevy>
AntelopeSalad readability is a good thing
jmau5_ has joined #ruby
<pipework>
AntelopeSalad: I already did 90% of the conversion for you.
DouweM has joined #ruby
<centrx>
shevy, Telling the user that he entered an incorrect value is a clear indication.
<pipework>
I'm sure you can break this one-liner into multiple lines with local variables for taste.
<shevy>
centrx hmm yeah I guess I can agree there
<centrx>
shevy, Continuing "without problem" is not continuing without problem. You are silently assuming you know best what the user meant, when he actually entered an incorrect value.
jmau5 has quit [Read error: Connection reset by peer]
<shevy>
but I do know
<centrx>
shevy, If user does not know what he is doing, it is best to tell him
jhass is now known as jhass|off
<pipework>
shevy: Mind that none of us, as much as we'd like to insist, are professional UX engineers of any merit.
<shevy>
he is an idiot for inputting anything greater than 255
testcore has quit [Client Quit]
maximski has quit [Remote host closed the connection]
<pipework>
If it were me, I'd just set it to 255 and optionally output a warning.
maximski has joined #ruby
jprovazn has quit [Quit: Odcházím]
<pipework>
AntelopeSalad: Probably not what I'd write.
vlad_starkov has joined #ruby
evenix is now known as eenix
aspires has quit []
<AntelopeSalad>
pipework: what don't you like about it?
v0n has quit [Ping timeout: 240 seconds]
<shevy>
pipework I think centrx said something similar along those lines, at least I haven't yet heard someone say that it should raise, which confuses me
<pipework>
AntelopeSalad: If your patterns might vary, I'd do something a bit different.
<pipework>
shevy: Why would you raise?
eenix is now known as evenix
<shevy>
it's an error!
<pipework>
That's not a program-ending situation.
<pipework>
It's user input!
<shevy>
the user is an error!
<pipework>
If you think raising for that is appropriate, I don't want to see any of your code ever.
<AntelopeSalad>
pipework: i'd break the .select line into a do/end multi-block as soon as it got out of hand
<shevy>
well perhaps his cat mistyped for him
jgoss has joined #ruby
<pipework>
shevy: So the program should end?
jmeeuwen has quit [Quit: Disconnecting from stoned server.]
<pipework>
Read Exceptional Ruby
<shevy>
pipework hmm perhaps
poulson has quit [Remote host closed the connection]
axl_ has joined #ruby
popl has quit [Ping timeout: 272 seconds]
xerox357_ has quit [Remote host closed the connection]
ctp has joined #ruby
xerox357 has joined #ruby
<centrx>
shevy, Should your IRC client disconnect you if you misspell a word?
elimS has joined #ruby
<AntelopeSalad>
pipework: thanks btw, also it passed my tests on the real env file too
<shevy>
centrx no but it should disconnect others who misspell words
larissa has joined #ruby
<pipework>
So to whomever suggested raising, I think you should either read Exceptional Ruby or jump off a cliff.
jmeeuwen has joined #ruby
aspires has joined #ruby
xerox357 has quit [Read error: Connection reset by peer]
meatherly has joined #ruby
xerox357 has joined #ruby
xerox357 has quit [Read error: Connection reset by peer]
jkamenik has left #ruby [#ruby]
nanoyak_ has quit [Quit: Computer has gone to sleep.]
xerox357 has joined #ruby
ndrei has joined #ruby
vlad_starkov has quit [Read error: Connection reset by peer]
xerox357 has quit [Read error: Connection reset by peer]
xerox357 has joined #ruby
zegerjan has quit [Quit: WeeChat 0.4.3]
chuk has joined #ruby
mneorr has joined #ruby
charliesome has joined #ruby
xerox357 has quit [Read error: Connection reset by peer]
<RubyPanther>
exception raising and when to do it and what generally to use exceptions for is a subject with a history of various opposing exclusive opinions, generally, if you hold any of them strongly you're simply wrong by consensus
hiyosi has joined #ruby
<AntelopeSalad>
shevy: i scrolled up, i'd just cap it at 255 if it's > 255
idkazuma has joined #ruby
* centrx
raises an exception on RubyPanther and crashes his IRC client
ukd1 has joined #ruby
idkazuma has quit [Remote host closed the connection]
no6 has joined #ruby
xerox357 has joined #ruby
<pipework>
Good thing that I don't simply depend on consensus to determine what's right and wrong.
x1337807x has joined #ruby
idkazuma has joined #ruby
<RubyPanther>
Sorry, I use xchat, you'll have to trick me into installing a plugin for that to happen
<shevy>
pretty definite so far, 0 are for raise
<slash_nick>
if you've got an issue with raising, i suggest you handle it
<AntelopeSalad>
i'm a big fan of just fixing user errors when possible
<shevy>
ok slash_nick is the first one
<slash_nick>
shevy: i'm just making jokes...
<AntelopeSalad>
but i wouldn't do it always, like i wouldn't just truncate someones password without letting them know hah
<slash_nick>
comedic relief
Stalkr_ has joined #ruby
<shevy>
ok, back to 0 again then
xerox357 has quit [Read error: Connection reset by peer]
idkazuma has left #ruby [#ruby]
mary5030 has quit [Remote host closed the connection]
<pipework>
Luckily there are other flow control mechanisms you can make use of since exceptions really aren't meant to handle that.
<AntelopeSalad>
you could always troll them and modulo it
habanany has joined #ruby
<RubyPanther>
If everybody agrees it is subjective and that real engineers have varying opinions, there is nothing noble or superior in insisting your One True Way is true. At that point you should join the "opinionated programming" set, because a strong opinion can't be wrong, just different, but claiming things are universal when they're opinions is wrong, even if the opinion itself is acceptable
xerox357 has joined #ruby
<pipework>
RubyPanther: Are you really meta-arguing?
<pipework>
I just meta^2-argued.
<RubyPanther>
It is the level where the mistake happened.
<Stalkr_>
Anyone used the RubyPython gem before?
_Cody has joined #ruby
<_Cody>
i try to setup guard-livereload
<_Cody>
is there a tutorial explaining guardfile-syntaxb
<RubyPanther>
The difference between subjective and objective is actually rather critical to understanding even your own opinions
<pipework>
RubyPanther: Yeah, arguing for using exceptions to do things they aren't or is the problem.
<AntelopeSalad>
pipework: is there alternative to using Hash[] btw?
<RubyPanther>
But one person, who didn't invent exceptions, can't decide what they "are"
phat4life has joined #ruby
<AntelopeSalad>
chef's version of ruby seems to not support that
<pipework>
I, however, don't subscribe to "It works, and there's no law saying it shouldn't be done" I leave that to quitters.
<RubyPanther>
It is well known there are lots of views on that, from real engineers.
<phat4life>
is it possible to eval() the contents of an entire file
ddelrio1986 has quit [Quit: Leaving]
IceyEC has quit [Quit: IceyEC]
<shevy>
well we also have catch and throw
<slash_nick>
This really is an exceptional dialogue guys, thanks :)
<centrx>
RubyPanther, Too bad there aren't any real engineers here.
mjs2600_ has quit [Remote host closed the connection]
<pipework>
I sometimes think that most rubyists aren't engineers, and then I look at who I figure those people are, and I feel confirmed.
ndrei has quit [Ping timeout: 272 seconds]
<phat4life>
im a real engineer
hiyosi has quit [Ping timeout: 265 seconds]
<sigurding>
that's my impression as well centrx
<sigurding>
;)
* pipework
is an IRC engineer
lmickh has quit [Remote host closed the connection]
shashin has quit [Quit: shashin]
<centrx>
Did you know that the first commercial steam train (Stephenson’s “Rocket”) managed to reach the speed of 96 kilometers per hour in 1830?
<RubyPanther>
No, no, but when real engineers have already considered this problem before you were out of diapers, maybe it is good to consider that your own opinions are probably only opinions. Especially if you're unfamiliar with the details of the opposing views. And there are a huge variety of views on exceptions.
thomd has joined #ruby
<shevy>
phat4life should be possible... something like: eval File.read('name_of_file') or something like that
mansi_ has quit [Remote host closed the connection]
<phat4life>
shevy: this file is 100k lines long
sambao21 has quit [Quit: Computer has gone to sleep.]
ndrei has joined #ruby
<phat4life>
this is the most insane rails migration ever
v0n has joined #ruby
mansi has joined #ruby
<shevy>
wow
<pipework>
RubyPanther: I think it's cute that you want to shove any thoughts we have into opinions. It may have some validity, but if you take it far enough, nothing is ever objective.
<shevy>
when did rails become java phat4life
<centrx>
RubyPanther, That's just an opinion.
xerox357 has quit [Read error: Connection reset by peer]
<pipework>
So with that in mind, I'd like to say that my ultimately subjective opinion is that you don't understand exceptions.
<RubyPanther>
If you take it "too far," sure it would eventually get too far.
Port3M5[Work] has joined #ruby
xerox357_ has joined #ruby
<pipework>
RubyPanther: That's your opinion.
testcore has joined #ruby
grotr has quit [Quit: Leaving.]
<RubyPanther>
At the other end, it is _well_established_ that there is no consensus on what exceptions are "for"
rootshift__ has quit [Quit: My MacBook has decided to go to sleep. Zzzz..]
<phat4life>
shevy: the databases schema changed so much, and we have so much production data
<pipework>
RubyPanther: Can you give a concrete objective example?
freggles has quit [Remote host closed the connection]
<RubyPanther>
There are a wide variety of sets of best practices for exceptions
xerox357_ has quit [Read error: Connection reset by peer]
<pipework>
There's zero value to sitting back and going, "You guys, it's just opinions!"
<slash_nick>
Well, you know, that's just like, your opinion, man!
<sigurding>
sorry to disturb this meta-discussion, but is there a lib for scheduling tasks?
<phat4life>
we had to metaprogramically generated updates and creates for every db object
xerox357 has joined #ruby
<centrx>
sigurding, Several. The one off the type of my head is called DelayedJob
<pipework>
Some opinions, subjectively, are much better than others.
kcombs has quit [Remote host closed the connection]
xerox357 has quit [Read error: Connection reset by peer]
* centrx
raises an exception any time a user uses HM:T instead of HABTM
xerox357 has joined #ruby
testcore has quit [Client Quit]
<pipework>
I raise exceptions randomly just to keep users on their toes, subjectively.
thomd has left #ruby [#ruby]
<sigurding>
centrx: if found whenever
xerox357 has quit [Read error: Connection reset by peer]
DrShoggoth has quit [Quit: Leaving]
AlSquirrel has quit [Quit: This computer has gone to sleep]
Notte has quit [Remote host closed the connection]
<RubyPanther>
Right, if your understanding of the subject is such that you only know about the ways you use exceptions, ways you think are wrong, and random exceptions (which isn't anybody's view), then your opinion is simply not well founded. It has no chance of being useful.
<slash_nick>
sigurding: that's the one i was going to suggest... if i could've recalled its name
<sigurding>
centrx: on that right now :)
<sigurding>
thx
sambao21 has joined #ruby
mansi has quit [Ping timeout: 240 seconds]
oso96_2000 is now known as oso|away
aspires has quit []
testcore has joined #ruby
workmad3 has joined #ruby
kindjal has joined #ruby
xerox357 has quit [Read error: Connection reset by peer]
zachallett has quit [Remote host closed the connection]
larissa has quit [Quit: Leaving]
xerox357 has quit [Read error: Connection reset by peer]
<sigurding>
clockwork looks nice as well
mary5030 has joined #ruby
wiku5__ has quit [Ping timeout: 240 seconds]
xerox357 has joined #ruby
mansi has joined #ruby
mary5030 has quit [Remote host closed the connection]
xerox357 has quit [Read error: Connection reset by peer]
enebo has quit [Ping timeout: 264 seconds]
mary5030 has joined #ruby
codabrink has joined #ruby
xerox357 has joined #ruby
<pipework>
RubyPanther: You're trying to assert that I only know the way I prefer? I think you're grasping really hard here.
<pipework>
Good try, come again.
<codabrink>
Just a quick syntax question.. If 'unless' didn't exist in ruby, how would I go about implementing it?
<pipework>
codabrink: It's a keyword, in C.
<pipework>
I don't think you could do it with the same syntax
<codabrink>
How would I write it in ruby, though?
<RubyPanther>
No, I'm saying there are a wide variety of different theories on how to use exceptions, on what they are "for," and that holding any of them out as the One True Way, or claiming the others are wrong, is wrong
<shevy>
codabrink perhaps via a filter
<pipework>
codabrink: You can't.
xerox357 has quit [Read error: Connection reset by peer]
aspires has joined #ruby
<pipework>
RubyPanther: I disagree, but it's probably just a hint that we'd have a hard time writing code together.
<RubyPanther>
There simple is no agreement on what exceptions "are for" other than in general terms
xerox357 has joined #ruby
<pipework>
In your opinion, perhaps.
<pipework>
I think that there's agreement with a certain group of people who adopt a particular name for that group though.
xerox357 has quit [Remote host closed the connection]
habanany has quit [Ping timeout: 240 seconds]
AFKGeek has joined #ruby
xerox357 has joined #ruby
mansi_ has joined #ruby
weems has quit [Ping timeout: 244 seconds]
<pipework>
But I don't really care to get 100% buy-in from everyone who ever existed and thought about exceptions.
<RubyPanther>
No, that is objective; there are lots of views and there is no consensus best practices. The best practices are all within a particular viewpoint, but are different.
v0n has quit [Quit: WeeChat 0.4.3]
<gl->
pipework what's wrong with unless = if not() ?
<RubyPanther>
It is not opinion that there are conflicting opinions ;)
mary5030_ has joined #ruby
<pipework>
gl-: Does it work?
mansi has quit [Read error: Connection reset by peer]
<gl->
or did I misunderstand the question ?
v0n has joined #ruby
evenix has quit [Ping timeout: 240 seconds]
<shevy>
now that's an evil idea... to define a method called not
codabrink has quit [Client Quit]
<shevy>
not.exist?
codabrin_ has joined #ruby
<pipework>
RubyPanther: Ah, I re-read it and corrected your mistake.
codabrin_ is now known as codabrink
<pipework>
Yes, there is a difference of opinion on a great many things, it doens't mean that one party isn't correct.
<gl->
hmm unless is checking that the tested condition is negative
<gl->
so you just have to negate the tested condition and use if
<shevy>
slash_nick you were right, it was an exceptional dialogue
<momomomomo>
RubyPanther: pipework I think you're both right and wrong; pipework you might benefit from reading this https://news.ycombinator.com/item?id=7270978 and RubyPanther might benefit from reading Exceptional Ruby :p
<momomomomo>
shevy: i'm not instigating, just adding to the discussion because I think it's relevant.
rbartos has quit [Remote host closed the connection]
Hobogrammer_ has joined #ruby
<RubyPanther>
At least somebody pays attention to content, thanks momomomomo :)
<shevy>
oh man ... if I'd have time to discuss, I'd even throw in why we have catch and throw in ruby, but I have to sleep soon and go to work so I shut up
mrchris has joined #ruby
<mrchris>
Is there a ruby gem that can automatically detect what type of media content is in a blob of text and insert the appropriate markup? So lets say there is a youtube url in the text then it will add the youtube container, or if i add a link to a web video then it will add the html ???
<RubyPanther>
catch and throw may be disgusting, but I've heard of real engineers who claim to make good use of them
mary5030 has quit [Ping timeout: 264 seconds]
<AntelopeSalad>
hey pipework, i have a really important question for you
plexus_ has quit [Ping timeout: 265 seconds]
<shevy>
mrchris hmm sounds rather specialized... I think there may be a couple of different gems that do parts of what you need, at the very least
<AntelopeSalad>
pipework: why does this have so many warnings using your Hash[] trick? https://eval.in/106034
<mrchris>
shevy: there is a gem which does it all but im not even sure what to search for
rbartos has joined #ruby
<slash_nick>
shevy: github has a library for recognizing languages, i wonder if it'd handle it
Hobogrammer has quit [Ping timeout: 240 seconds]
<shevy>
hmm
axl_ has quit [Quit: axl_]
AFKGeek has quit [Quit: Leaving]
<shevy>
we could need a way to rate gems on rubygems...
<eval-in___>
AntelopeSalad => odd number of arguments for Hash (ArgumentError) ... (https://eval.in/106038)
<AntelopeSalad>
>> puts Hash[[1, 2, 3]]
<eval-in___>
AntelopeSalad => /tmp/execpad-cbb1cab31b62/source-cbb1cab31b62:2: warning: wrong element type Fixnum at 0 (expected array) ... (https://eval.in/106039)
dingus_khan has quit [Remote host closed the connection]
alvaro_o has quit [Quit: Ex-Chat]
_bart_ has quit []
shinobi_one has joined #ruby
xerox35__ has quit [Remote host closed the connection]
s2013 has quit [Ping timeout: 244 seconds]
jonah_k_ has quit [Remote host closed the connection]
snath has joined #ruby
elcontrastador has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
linojon has joined #ruby
<Stalkr_>
How is RubyPython exactly supposed to work? How do I specify I am dealing with a Python dict, not just some object, I need to convert it to a hash https://gist.github.com/anonymous/9240033
zB0hs has joined #ruby
Salve_ has quit []
Salve has joined #ruby
habanany has joined #ruby
jonah_k has joined #ruby
grvgr has joined #ruby
chrisja has joined #ruby
nowthatsamatt has quit [Quit: nowthatsamatt]
Matriks has quit [Remote host closed the connection]
<gl->
Stalkr_: I hope you have a good reason to use such crazy stuff to mix languages :)
acrussell has quit [Quit: Leaving.]
s2013 has joined #ruby
alvaro_o has joined #ruby
<Stalkr_>
gl-: My only reason is being lazy, Ruby doesn't have a guess library unfortunately
<slash_nick>
what is a guess library anyway?
<shevy>
you guess its name
pigzzcanfly has quit [Remote host closed the connection]
<RubyPanther>
Stalkr_: normally you would know what is from what language by where you got it
mikepack has quit [Remote host closed the connection]
mikepack has joined #ruby
Voodoofish430 has quit [Ping timeout: 244 seconds]
Jagori has joined #ruby
Voodoofish430 has joined #ruby
<RubyPanther>
Stalkr_: Data has to come from somewhere. Normally when you're mixing languages, their data comes from different places, and is being combined.
lw has quit [Quit: s]
Astralum has quit [Ping timeout: 264 seconds]
<gl->
Stalkr_: I'd rather instantiate another python script to do the guess for me giving it the attribute with whatever inter-procee method (easiest probably being stdin-stdout)
Kricir has quit [Remote host closed the connection]
<RubyPanther>
If you want to mix data together, you need to put each chunk in some sort of labeled container before mixing
dapz has quit [Ping timeout: 265 seconds]
asteros_ has joined #ruby
<gl->
Stalkr_: that would be easier to code and debug.
<gl->
and reuse.
Kricir has joined #ruby
<Stalkr_>
gl-: and save the output from the python script so Ruby can read it?
<gl->
you read stdout
joelroa has quit [Ping timeout: 252 seconds]
<gl->
basically it's like reading/writing a file, except you do it with a process.
Kricir has quit [Read error: Connection reset by peer]
rudisimo has quit [Remote host closed the connection]
<gl->
I've never done this in ruby but normally it's called popen
benatkin has joined #ruby
Kricir has joined #ruby
rudisimo has joined #ruby
<Stalkr_>
So Ruby calls a Python script, Python just writes out (with print I assume), the Ruby is able to read the output?