<f0ster>
I cannot figure out what pattern/structure to create this with, https://gist.github.com/f0ster/96a7091a76af06665cdf . basically, I just want to have somethign that's liek a static class which has data stored in, i take in an object, based on the object, i look something up in the static hash and return a value
x1337807x has quit [Client Quit]
nisstyre has joined #ruby
<f0ster>
I don't want to have to instantiate an object of this class ju;st to use it, hence the self. But there isnt anyway to have "static" member variables on an uninstantiated class as far as I know
marr has quit [Ping timeout: 240 seconds]
kaspergrubbe has quit [Remote host closed the connection]
timonv has quit [Ping timeout: 240 seconds]
<bilbo_swaggins>
class vars?
kevind has quit [Quit: kevind]
bilbo_swaggins has quit [Quit: Leaving]
<f0ster>
bilbo_swaggins: ah right, that is what i am doing now
<f0ster>
not workgin for some reason
SHyx0rmZ has quit [Quit: ネウロイを負かさなきゃならないね]
<f0ster>
"unitialized class var"
beneggett has joined #ruby
karmatr0n has quit [Remote host closed the connection]
eynj has joined #ruby
x1337807x has joined #ruby
x1337807x has quit [Client Quit]
matcouto has joined #ruby
<f0ster>
i need like a singleton class that checks to see if an instance has been instantiated yet when someoen tries to access it
<horrorvacui>
What about lazy initialization?
momomomomo has quit [Quit: momomomomo]
nisstyre has quit [Client Quit]
<f0ster>
thats kind of what i mean but doing it manually, what are you thinking horrorvacui ?
x1337807x has joined #ruby
momomomomo has joined #ruby
b00stfr3ak has quit [Ping timeout: 240 seconds]
momomomomo has quit [Client Quit]
<f0ster>
like.. @@property ||= self.new kind of thing
<f0ster>
?
jorts has quit [Read error: Operation timed out]
<f0ster>
since i am using class vars
wallerdev has joined #ruby
mercwithamouth has joined #ruby
<f0ster>
i could also create a new of my class, but i dont really want the need to do that, since all the methods on it are class methods
<horrorvacui>
yeah but I still don't see what is wrong with how you are doing it
saarinen has quit [Quit: saarinen]
Wigflip has joined #ruby
<f0ster>
well if i just call MyClass.method, when m ethod tried to acccess @@var it just fails, even though @@var is hardcoded in the class def
<f0ster>
because MyClass has never been instnatiated
Wigflip has quit [Client Quit]
beneggett has quit [Client Quit]
<f0ster>
i coudl not use a class, and module, since i am doing only class methods, e.g. def self.method... but then how do I store the hardcoded string ?
havenwood has joined #ruby
mary5030 has quit [Remote host closed the connection]
juanmnl has quit [Quit: My dingdong has gone to sleep. ZZZzzz…]
user___ has joined #ruby
greggroth has quit [Ping timeout: 240 seconds]
tylersmith has quit [Remote host closed the connection]
snath has joined #ruby
codabrink has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<user___>
ah apparently ihadn't installed that package, ythanks
user___ has quit [Remote host closed the connection]
djbender has quit [Quit: djbender]
brain_shim has quit [Ping timeout: 240 seconds]
ndrei has quit [Ping timeout: 240 seconds]
brain_shim has joined #ruby
pigzzcanfly has joined #ruby
kitak has quit [Remote host closed the connection]
dayepa has joined #ruby
vim_shim_ has joined #ruby
kitak has joined #ruby
freezey has quit [Remote host closed the connection]
Martxel has quit [Ping timeout: 240 seconds]
evenix has joined #ruby
evenix has quit [Remote host closed the connection]
asteros_ has joined #ruby
f0ster has quit [Ping timeout: 240 seconds]
evenix has joined #ruby
asteros has quit [Ping timeout: 240 seconds]
asteros_ is now known as asteros
pigzzcanfly has quit [Ping timeout: 240 seconds]
evenix has quit [Read error: Connection reset by peer]
CaptainJet has quit [Ping timeout: 240 seconds]
locriani has joined #ruby
lolmaus has quit [Ping timeout: 252 seconds]
evenix has joined #ruby
beneggett has joined #ruby
Speed has quit [Read error: Connection reset by peer]
Speed has joined #ruby
Speed has quit [Client Quit]
blackmesa has quit [Quit: WeeChat 0.4.3]
jamto11 has joined #ruby
BP-out has joined #ruby
mercwithamouth has quit [Ping timeout: 240 seconds]
SCommette has quit [Quit: SCommette]
locriani has quit [Ping timeout: 265 seconds]
tkuchiki has quit [Ping timeout: 255 seconds]
oo_ has joined #ruby
<BP-out>
hey all. I have a Message class and a PrivateMessage subclass. Can I check for a variable or attribute in the Message initialize method and determine there if it should be a regular Message or PrivateMessage? Or is there a better place to do the check
<BP-out>
Also I'm sort of certain this would be a good place to use a factory method
<nahkunt>
is Learn Ruby The Hard Way a bad book?
<nahkunt>
my friend told me it's bad, and i've only just started on it... seems alright to me so far
ascarter has joined #ruby
ascarter has quit [Max SendQ exceeded]
papercode has quit [Quit: WeeChat 0.4.4-dev]
beneggett has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ascarter has joined #ruby
ascarter has quit [Max SendQ exceeded]
oo_ has quit [Remote host closed the connection]
testcore has quit [Quit: [BX] 2014: year of the BitchX]
Es0teric has quit [Quit: Computer has gone to sleep.]
<wallerdev>
nahkunt: do you have experience with programming
<horrorvacui>
nahkunt: Its okay but I've read better. However, I'd defer to someone else as to whats best because I've pieced my learning from so many books and websites I can't really remember which is which.
<wallerdev>
BP-out: i think you're using inheritance wrong, if you want specific behavior for privatemessage you should put it in the privatemessage class
<horrorvacui>
nahkunt: My favorite was Well Grounded Rubyist
chichou has joined #ruby
<wallerdev>
_why's poignant guide
<nahkunt>
no why's poignant guide is too silly for me
<nahkunt>
i'm a very distractible person
<nahkunt>
i need no nonsense
<nahkunt>
even though it's a funny book
<wallerdev>
haha yeahi tried to read it awhile back, but couldnt make it through haha
<wallerdev>
i read pickaxe in like 2008 or something and it was a good read, not sure whats out now though
<horrorvacui>
its short and sweet lazy :P
fabrice31 has joined #ruby
<BP-out>
wallerdev: it has specific behavior, but it seems like it makes sense to inherit from Message parent classs
newUser1234 has joined #ruby
<wallerdev>
you should override the method thats different in the child class
<BP-out>
okay, I see
<horrorvacui>
Pickaxe book is good but if you are just beginning ruby I'd get something else first.
cescalante is now known as ce_afk
<BP-out>
I'll refactor this a bit
JordanJ2 has left #ruby ["Leaving"]
x77686d has quit [Quit: x77686d]
<horrorvacui>
nahkunt: I liked Bastard's book but every time I've suggested it someone yells at me for recommending an incomplete book.
<horrorvacui>
I like that it uses projects to teach ruby. Something I feel is missing in a lot of the other books.
mehlah has quit [Ping timeout: 268 seconds]
sethen has joined #ruby
<crome>
does it have talking foxes?
chipotle has quit [Quit: cya]
<horrorvacui>
no
<crome>
boring
<horrorvacui>
ikr
randomnick_ has quit [Quit: Leaving]
<horrorvacui>
They said why's was not for them though :(
<wallerdev>
tryruby.org has talking foxes
fabrice31 has quit [Ping timeout: 240 seconds]
<horrorvacui>
I totally forgot that it had them too.
freezey has joined #ruby
davy_ has quit [Remote host closed the connection]
<nahkunt>
horrorvacui: well i haven't really programmed before but i've used linux for 8 years so i do know bash and sed and things. so i don't like to read a whole chapter explaining how to open cmd.exe
<nahkunt>
horrorvacui: think pickaxe sounds good or still maybe too hard for me?
<horrorvacui>
nahkunt: just do what I do. Give them all a try. I just don't like one books chapter on say classes for example, I look at another books description.
<horrorvacui>
If thats not an issue money wise.
Es0teric has joined #ruby
<nahkunt>
it is, yes. but i spose i have some swedish friends who could help me out with that
<horrorvacui>
nahkunt: I think pickaxe will be fine because its like the ruby bible and you'll want it later anyhow.
<nahkunt>
ok
nateberkopec has quit [Read error: No route to host]
<horrorvacui>
Just make sure you get the latest one.
<horrorvacui>
I've got the one from 2008 unfortunately but I'm pretty sure there is a new one for ruby > 2.0
bricker`LA has joined #ruby
jzig has quit [Remote host closed the connection]
jzig has joined #ruby
r_rios has joined #ruby
evenix has quit [Remote host closed the connection]
freezey has quit [Ping timeout: 240 seconds]
toastynerd has quit [Remote host closed the connection]
<nahkunt>
the well grounded rubyist is for 1.9... should i be looking for >2.0 books?
<havenwood>
nahkunt: there is a new beta release of Well Grounded though, seems to be coming along well
kitak_ has joined #ruby
lolmaus has joined #ruby
<nahkunt>
havenwood: will it be a problem to use the 1.9 version for now?
<nahkunt>
i'm on ruby 2.1.1p76
jzig has quit [Ping timeout: 265 seconds]
<havenwood>
nahkunt: nope, but you'll quickly run into little things that wont work - for the most part it is all fine though
toastynerd has joined #ruby
<havenwood>
nahkunt: but it looks like they have most of the early chapters done in the beta, you might just want to get the new edition
<nahkunt>
why do so many people have a hatred of ruby? i try to ask people what they suggest to learn ruby and most of the time i get told not to learn it
francisfish has joined #ruby
yfeldblum has joined #ruby
zorak has joined #ruby
greggroth has quit [Ping timeout: 268 seconds]
SidWu_ has joined #ruby
SidWu_ has quit [Max SendQ exceeded]
<arubin>
nahkunt: Are you asking in #python?
benzrf|offline is now known as benzrf
<benzrf>
via my brother:
<nahkunt>
arubin: haha
<benzrf>
'im in a band called 1023MB. we havent got a gig yet.'
horofox__ has quit [Quit: horofox__]
<arubin>
benzrf: heh
unstable has joined #ruby
<benzrf>
nahkunt: it's because ruby and python fill the same niche
jameswlane has joined #ruby
jameswlane has quit [Max SendQ exceeded]
<zorak>
im trying to run some scrips, but im getting this error
<zorak>
irb -r factorial1.rb -r fibonacci1.rb
<zorak>
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require':LoadError: cannot load such file -- factorial1.rb
<zorak>
irb(main):001:0>
<zorak>
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require':LoadError: cannot load such file -- fibonacci1.rb
evenix has quit [Remote host closed the connection]
<benzrf>
if you learn one then you will probably have no need for the other
<benzrf>
[unless youre like me and prefer one and switch to it]
supermarin_ has quit [Ping timeout: 255 seconds]
jameswlane has joined #ruby
jameswlane has quit [Max SendQ exceeded]
charliesome has joined #ruby
jameswlane has joined #ruby
dayepa has quit [Quit: dayepa]
francisfish has quit [Ping timeout: 240 seconds]
freerobby has joined #ruby
yfeldblum has quit [Ping timeout: 268 seconds]
charliesome has quit [Read error: Connection reset by peer]
larissa has quit [Quit: Leaving]
<horrorvacui>
nahkunt: Who told you to stay away from ruby?
charliesome has joined #ruby
ce_afk is now known as cescalante
nari has joined #ruby
s2013 has joined #ruby
<benzrf>
yo charliesome u should try quick
<benzrf>
:-D
jameswlane has quit [Ping timeout: 240 seconds]
r_rios has quit [Ping timeout: 268 seconds]
horrorvacui has quit [Remote host closed the connection]
<zorak>
solved adding ./ to the script name
<zorak>
irb -r ./factorial1.rb -r ./fibonacci1.rb
snath has quit [Ping timeout: 240 seconds]
tylersmith has joined #ruby
godd2 has joined #ruby
charliesome has quit [Read error: Connection reset by peer]
evenix has joined #ruby
charliesome has joined #ruby
jameswlane has joined #ruby
CyborgCygnus has joined #ruby
paradisaeidae has joined #ruby
tvw has quit [Ping timeout: 255 seconds]
jameswlane has quit [Max SendQ exceeded]
twiceaday has quit [Ping timeout: 245 seconds]
twiceaday has joined #ruby
maximski has joined #ruby
jameswlane has joined #ruby
locriani has joined #ruby
<godd2>
afternoon, all
<wallerdev>
evening
jameswlane has quit [Client Quit]
<bawNg>
morning
s2013 has quit [Remote host closed the connection]
jason__ has joined #ruby
Royalb15 has joined #ruby
jameswlane has joined #ruby
newUser1234 has joined #ruby
jameswlane has quit [Max SendQ exceeded]
SCommette has quit [Quit: SCommette]
cescalante is now known as ce_afk
x77686d has joined #ruby
hfp has quit [Remote host closed the connection]
trhodes_ has joined #ruby
benzrf is now known as benzrf|offline
timonv has joined #ruby
subbyyy_ has quit [Ping timeout: 240 seconds]
JacobHayes has joined #ruby
<BP-out>
why does var = "\d
<BP-out>
er
<BP-out>
why does var = "\d" in pry return "d" ?
Hanmac1 has joined #ruby
JBreit has joined #ruby
<wallerdev>
because its not a valid escape character?
<BP-out>
but then "\\d" returns "\\d"
<BP-out>
is this just a pry thing?
<BP-out>
because repl.it shows "\\d" as returning "\d"
<wallerdev>
\\ will be \ when outputted
<BP-out>
oh
<BP-out>
i see
<wallerdev>
so "\\d" will output as \d
<BP-out>
it escapes once output through like puts
havenwood has quit []
<BP-out>
right, ok
<BP-out>
thank you
<wallerdev>
if you print it
rafaelmagu has joined #ruby
Hanmac has quit [Ping timeout: 255 seconds]
<wallerdev>
"\d" is an unrecognized escape sequence so it just assumes you meant "d"
reset has quit [Quit: Leaving...]
_maes_ has joined #ruby
greggroth has joined #ruby
timonv has quit [Ping timeout: 240 seconds]
supermarin_ has joined #ruby
ignoch has quit [Remote host closed the connection]
kennym has quit [Quit: Leaving.]
nari has quit [Ping timeout: 255 seconds]
pwh_ has quit [Ping timeout: 240 seconds]
hfp has joined #ruby
chipotle has joined #ruby
paradisaeidae has quit [Remote host closed the connection]
jameswlane has joined #ruby
asteros has quit [Quit: asteros]
jameswlane has quit [Max SendQ exceeded]
krz has joined #ruby
JBreit has left #ruby ["Leaving"]
jameswlane has joined #ruby
wallerdev has quit [Quit: wallerdev]
jameswlane has quit [Max SendQ exceeded]
supermarin_ has quit [Ping timeout: 240 seconds]
jameswlane has joined #ruby
jameswlane has quit [Max SendQ exceeded]
paradisaeidae has joined #ruby
frem has quit [Quit: Connection closed for inactivity]
pwh has joined #ruby
jameswlane has joined #ruby
meatherly has quit [Remote host closed the connection]
jameswlane has quit [Max SendQ exceeded]
momomomomo has joined #ruby
jameswlane has joined #ruby
meatherly has joined #ruby
rezzack has quit [Ping timeout: 268 seconds]
simono has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jameswlane has quit [Max SendQ exceeded]
dkpi has quit [Ping timeout: 255 seconds]
kennym has joined #ruby
narcan has joined #ruby
george2 has joined #ruby
s2013 has joined #ruby
meatherly has quit [Ping timeout: 252 seconds]
justin_pdx has joined #ruby
justin_pdx has quit [Client Quit]
justin_pdx has joined #ruby
sensen has joined #ruby
Celm has joined #ruby
<zorak>
whats the name of this "||="??
snkcld has joined #ruby
<snkcld>
how can i get this to work?
<snkcld>
puts “#{my_name}” if my_name = “joe"
<BP-out>
conditional assignment, zorak
<zorak>
BP-out: thanks!
<BP-out>
as in, "assign this variable on the condition specified"
<BP-out>
np
juanmnl has quit [Quit: My dingdong has gone to sleep. ZZZzzz…]
<BP-out>
snkcld: change the = to a double ==
<BP-out>
single = is assignment, == is comparison
glide has joined #ruby
<glide>
I have a simple question about accessing arrays. Can someone help me?
<BP-out>
also the quotes after the puts are redudant, since my_name is a string anyways
<BP-out>
go ahead, glide
<snkcld>
BP-out: but i want to assign on the right
<snkcld>
im not comparing it
juanmnl has joined #ruby
<snkcld>
my_name doesnt exist at that point ;P
pigzzcanfly has joined #ruby
rahult has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<BP-out>
but an "if" statement requires a condition
<BP-out>
what are you trying to do, anyways snkcld
<glide>
Hey guys, I had a question but I figured it out.
<glide>
Any pointers on learning Ruby from scratch as a first language?
yfeldblum has joined #ruby
cj3kim_ has quit [Remote host closed the connection]
cj3kim_ has joined #ruby
<snkcld>
i learned ruby by making a gem
<benzrf>
glide: dont
Hobogrammer has quit [Ping timeout: 268 seconds]
<benzrf>
glide: start w/ python
nari has joined #ruby
* arubin
eyes benzrf suspiciously.
<benzrf>
having used both i prefer ruby, BUT i do think python is better for a beginner
radic has quit [Ping timeout: 255 seconds]
<benzrf>
ruby has much more in the way of wacky idiosyncrasies and an extra paradigm v. python
<benzrf>
and the syntax is very more complicated
<glide>
benzrf: I chose Ruby because it seems to be an in-demand language. Is the ease of learning of Python worth starting with it instead?
<ericwood>
they're both great
<ericwood>
I learned on python
<ericwood>
but ruby gels better with my brain
fabrice31 has joined #ruby
radic has joined #ruby
volk_ has joined #ruby
<ericwood>
in my mind they're even in terms of learnability for beginners
<glide>
Speaking of idiosyncrasies, I came here to ask the a question about arrays that does involve something odd (array = [:peanut, :butter, :and, :jelly], array[5,0] returns nil; but array[4,0] returns [])
<ericwood>
glide: I was in middle school, my dad recommended it after doing some research
<ericwood>
it was before ruby really caught on and became popular
<benzrf>
ericwood: ruby is not significantly more in-demand than python \
<benzrf>
* glide
cj3kim_ has quit [Remote host closed the connection]
<benzrf>
and u can always hop over afterward
<ericwood>
I never said anything about demand
<ericwood>
I think demand is a shitty reason to learn your first language
<benzrf>
ericwood: hence '* glidw'
<benzrf>
*glide
<ericwood>
oh haha
<benzrf>
ericwood++
<ericwood>
:P
<ericwood>
I actually really like the idea of JS as a first language, quickly followed by another language
andy__ has joined #ruby
<ericwood>
instant feedback, ubiquitous, tons of great APIs for making neat stuff immediately
<ericwood>
but I like it as an entry point as far as teaching goes
<arubin>
glide: "Additionally, an empty array is returned when the starting index for an element range is at the end of the array. Returns nil if the index (or starting index) are out of range."
<glide>
Of course I'm trying to understand underlying principles so that I can learn more, but I thought Ruby was popular, has a big community, and I can learn to make something sooner.
<ericwood>
Ruby is a great language
fabrice31 has quit [Ping timeout: 255 seconds]
<ericwood>
I love it!
<glide>
JS = javascript?
<arubin>
I am not sure how "at the end of the array" is not "out of range".
<ericwood>
yes
greggroth has quit [Ping timeout: 240 seconds]
<glide>
arubin: Yeah I just figured that out. It's wierd!
<soahccc>
And everytime I use a different language I miss all the tiny bits. It's like when I have to use windows again for some reason
<glide>
benzrf: What about both at once? :)) What resources do you recommend?
volk_ has joined #ruby
<arubin>
soahccc: heh
maximski has quit []
<arubin>
glide: I disagree with benzrf, but I do not care to argue about it.
<glide>
arubin: Of course. I'm just happy to hear different perspectives :)
<soahccc>
glide: I was referring to the gems. you can make such good DSLs with ruby which integrate so seamlessly… and the community is also pretty good
<benzrf>
glide: the way i see it python is just simpler and more no-frills than ruby
<benzrf>
which is good when you're starting out
jrhorn424 is now known as zz_jrhorn424
<glide>
benzrf: How long would it take to learn to make an interesting web app or something fun?
<glide>
soahcc: I see. Cool.
snath has joined #ruby
<benzrf>
glide: learn to program
<benzrf>
then learn to use that knowledge to make a web app
<benzrf>
arubin: try quick :-3
cj3kim_ has quit [Remote host closed the connection]
<arubin>
Quick?
<arubin>
Oh, your project.
* arubin
starts the new slow programming movement.
benzrf|offline has quit [Read error: Operation timed out]
supermarin_ has quit [Ping timeout: 240 seconds]
<obbo>
is there an easy way to detect if an image is an animated gif using RMagick?
<Jonah11_>
godd2, sorry, i didn't mean that. i was thinking more along the lines of a shortcut similar to [1,2,3].reduce(:+) -- the thing is if yoiu pass in a proc iw will be called upon each elm in map, rather than doing proc.call(elm)
Guest4157 has quit [Remote host closed the connection]
rm_ has joined #ruby
jack_rabbit_ has joined #ruby
<mozzarella>
dr0ff: I have to gem install it manually
<mozzarella>
I had*
mary5030 has quit [Ping timeout: 240 seconds]
pigzzcanfly has quit [Remote host closed the connection]
jack_rabbit has quit [Ping timeout: 268 seconds]
Elhu has joined #ruby
fabrice31 has quit [Remote host closed the connection]
rm_ has quit [Ping timeout: 240 seconds]
nvrch has joined #ruby
ikaros has joined #ruby
reset has joined #ruby
dr0ff has left #ruby [#ruby]
rdark has joined #ruby
rylev has joined #ruby
pfg has joined #ruby
obs has joined #ruby
sk87 has joined #ruby
ndrei has joined #ruby
DouweM has quit [Ping timeout: 246 seconds]
pfg has quit [Client Quit]
klaas has joined #ruby
heftig has joined #ruby
reset has quit [Ping timeout: 268 seconds]
timonv has joined #ruby
klaut has quit [Remote host closed the connection]
klaas_ has quit [Ping timeout: 252 seconds]
polysics has joined #ruby
donnoc has joined #ruby
mansi has joined #ruby
luckyruby has joined #ruby
Biohazard has quit [Quit: tropicraft.net]
poikon has joined #ruby
Xeago has joined #ruby
skammer is now known as skammer|afk
skammer|afk is now known as skammer
cj3kim has joined #ruby
ktosiek has joined #ruby
coder_neo has joined #ruby
Biohazard has joined #ruby
mansi has quit [Ping timeout: 240 seconds]
xardas has quit [Ping timeout: 240 seconds]
JacobHayes has quit [Remote host closed the connection]
roolo has joined #ruby
xardas has joined #ruby
aspiers has joined #ruby
kung has joined #ruby
olivier_bK has joined #ruby
Celm has joined #ruby
Biohazard has quit [Ping timeout: 264 seconds]
fabrice31 has joined #ruby
<olivier_bK>
hy
markisonfire has quit [Quit: markisonfire]
chinkung has quit [Ping timeout: 240 seconds]
donnoc has quit [Ping timeout: 240 seconds]
Celm has quit [Ping timeout: 240 seconds]
donnoc has joined #ruby
mehlah has joined #ruby
ghr has joined #ruby
ktosiek has quit [Ping timeout: 255 seconds]
hamed_r has quit [Quit: Ex-Chat]
ktosiek has joined #ruby
axeman_ has joined #ruby
axeman- has quit [Ping timeout: 255 seconds]
Jeticus has quit []
ktosiek has quit [Ping timeout: 240 seconds]
supermarin_ has joined #ruby
okdas has quit [Ping timeout: 240 seconds]
marr123 has joined #ruby
marr123 has quit [Client Quit]
freerobby has joined #ruby
Stalkr_ has joined #ruby
ktosiek has joined #ruby
Stalkr_ has quit [Changing host]
Stalkr_ has joined #ruby
supermarin_ has quit [Ping timeout: 255 seconds]
elaptics`away is now known as elaptics
gnephiak has quit [Quit: Konversation terminated!]
freerobby1 has joined #ruby
freerobby has quit [Read error: Connection reset by peer]
einarj has joined #ruby
mikecmpbll has joined #ruby
nahkunt has joined #ruby
freerobby1 has quit [Read error: Operation timed out]
timonv has quit [Remote host closed the connection]
znub has joined #ruby
AlSquire has joined #ruby
ktosiek has quit [Ping timeout: 240 seconds]
kenndel_ has joined #ruby
<znub>
hi, ruby newbie here, I would like to know if there's a better way to do : hash[:foo] = get_foo if get_foo where get_foo method obviously returns (or not) the value for :foo key in the hash.
bluOxigen has quit [Ping timeout: 240 seconds]
greenarrow has quit [Quit: 500]
kenndel has quit [Ping timeout: 255 seconds]
greenarrow has joined #ruby
marr has joined #ruby
linuxer1 has joined #ruby
<linuxer1>
I need to convert a string that actually has a binary value to a Fixnum...problem is to_i drops the leading zeros and jacks the binary all up. How can I get a string to a fix num without losing the leading zeros? My string is "0110111"
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
robbyoconnor has quit [Excess Flood]
riotjones has joined #ruby
Kryptonical has quit [Read error: Connection reset by peer]
robbyoconnor has joined #ruby
donnoc has quit [Ping timeout: 255 seconds]
workmad3 has joined #ruby
klaut has joined #ruby
codenapper has joined #ruby
chrisseaton has joined #ruby
rahult has joined #ruby
ndrei has quit [Quit: Lost terminal]
ndrei has joined #ruby
reset has joined #ruby
timonv has joined #ruby
yfeldblu_ has quit [Remote host closed the connection]
cj3kim has quit [Remote host closed the connection]
yacks has joined #ruby
yfeldblum has joined #ruby
robbyoconnor has quit [Read error: Connection reset by peer]
robbyoconnor has joined #ruby
viscera has quit [Ping timeout: 240 seconds]
reset has quit [Ping timeout: 255 seconds]
jamto11 has joined #ruby
mansi has joined #ruby
diverdude has joined #ruby
yfeldblum has quit [Ping timeout: 255 seconds]
<diverdude>
hello, i am trying to do sudo gem install rmagick -v '2.13.2' but i get the following error: http://paste.ubuntu.com/7197827/ what is going wrong?
<jlebrech>
i want to gsub something out of a string but just at the beginning ie images/http-google.com.png I wanna remove 'images/' from the start but not from anywhere else in the string.
luriv has quit [Remote host closed the connection]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<pontiki>
hi
<catphish>
i think that's genuine insanity, but thanks
<apeiros>
catphish: threads + select on smaller numbers?
<catphish>
apeiros: that makes a lot of sense :)
ndrei has quit [Ping timeout: 268 seconds]
<catphish>
i'll break it down into selects of 1,000 sockets and put each in a thread
<apeiros>
catphish: maybe use a library which supports notification (push instead of poll)
<popl>
why is it insane?
<catphish>
the other option is to use poll and put *everything* in the poll (clients and listeners)
yfeldblum has joined #ruby
yfeldblum has quit [Read error: Connection reset by peer]
poikon has quit [Ping timeout: 240 seconds]
<catphish>
popl: running tens of thousands of pre-forked processes just seems unmanageable
<popl>
you asked for a way to do it in a threadsafe manner.
mercwithamouth has quit [Ping timeout: 240 seconds]
<popl>
That's what the framework is for.
fgo has quit [Remote host closed the connection]
<catphish>
forking isn't "threadsafe"
<catphish>
lol
<apeiros>
it kinda is :)
<catphish>
lol
<apeiros>
being in separate processes and all…
davy_ has quit [Ping timeout: 240 seconds]
<popl>
yes
eka has joined #ruby
charliesome has joined #ruby
<apeiros>
but probably comes with its own set of problems for your scenario
<catphish>
apeiros: thanks anyway, i'll try getting everything into a poll() as that seems the most efficinent, failing that i'll use threaded selects
<catphish>
my app is a tcp proxy that listens on a wide range of ports, so everything is io driven and may be able to work in a single thread
<apeiros>
catphish: alternatively: no threads, select iteratively on small arrays without blocking
<workmad3>
catphish: have you considered using something like EventMachine?
<catphish>
that's a tad cpu hungry i fear
monkegjinni has joined #ruby
<popl>
I try to avoid threads when I can.
<catphish>
workmad3: not yet, i guess that uses one huge poll()
mikepack has joined #ruby
hermanmunster has quit [Remote host closed the connection]
<catphish>
popl: that's the safest approach if you don't understand them well, but sadly they're often very useful
ndrei has joined #ruby
sandstrom has joined #ruby
sandstrom has joined #ruby
<popl>
ah
<catphish>
particularly as a way to handle multiple network clients
hermanmunster has joined #ruby
<sandstrom>
What is this syntax `0x25` in Ruby? It returns the 37 fixnum
<catphish>
hex
<sandstrom>
Ah!
<maasha>
bleh :o( something is not right in my fork pool. When I hit it with lots of real data the parent process is busy, the workers are mostly idle, and it blows memory: https://gist.github.com/maasha/9d0b7e88ca6cf200cfed
<sandstrom>
catphish: thanks
sigurding has joined #ruby
<catphish>
sandstrom: also be aware of octal eg: 020
<eval-in>
jmaister => undefined local variable or method `sandwich' for main:Object (NameError) ... (https://eval.in/131206)
<jmaister>
Well, that's a new excuse
relix has joined #ruby
nvrch has joined #ruby
<apeiros>
jmaister: try that in bash
Lewix has joined #ruby
supermarin_ has quit [Ping timeout: 255 seconds]
<jmaister>
make: *** No rule to make target `me'. Stop.
<jmaister>
but that's zsh though
<popl>
make isn't a shell command
nuck has quit [Ping timeout: 240 seconds]
freerobby has quit [Ping timeout: 240 seconds]
<popl>
so it shouldn't matter :)
<catphish>
apeiros: now i'm confused, i just ran it with no threads using select on 10,000 listeners and it didn't break
osxorgate has joined #ruby
<catphish>
isn't that supposed to explode in a spectacularly fiery mess?
gaussblurinc has quit [Quit: Leaving.]
<apeiros>
nice. so you don't need to break it down it seems.
<jmaister>
:(
<workmad3>
catphish: what happens when you throw realistic levels of data at the sockets?
<jmaister>
It's so dissappointing when something you expect to explode fails to do so
<apeiros>
well, it depends on your OS' select
<apeiros>
I was a bit surprised when you said 10k wouldn't work with select, but took it at face value
<popl>
jmaister: That's the best defense against a troll.
poikon_ has joined #ruby
kitak_ has quit [Remote host closed the connection]
<pontiki>
"Where was the Earth-shattering ka-boom?"
<catphish>
workmad3: nmap localhost -p10000-19999 - no issues
<popl>
pontiki: in her pants
<popl>
HEYO
<catphish>
all 10,000 get accepted
<workmad3>
popl: I find the best defense against a troll is to push them off the bridge... but I'm somewhat old-skool
<workmad3>
catphish: right... but what about when data is flowing in?
<pontiki>
how can you push them off a bridge when they live under it?
<apeiros>
aahahaha: "poll and select are basically the same speed-wise: slow."
<catphish>
i don't know, i'm not putting the data streams into the select
<workmad3>
catphish: as it's not really about whether they're accepted, it's about if you can get data through your system fast enough ;)
<catphish>
each actual client stream gts a thread
<workmad3>
catphish: are you using jruby or rubinius? or will you have the GIL to contend with?
poikon has quit [Ping timeout: 240 seconds]
<catphish>
i'm using MRI 2.1.1
<apeiros>
catphish: from a quick google, I'd say a libev wrapper would perform best
ndrei has quit [Ping timeout: 240 seconds]
shaileshg has joined #ruby
chipotle has quit [Quit: cya]
<catphish>
it's working great, i just don't understand why
<workmad3>
catphish: so that's a 'yes' on the GIL front... which is why you should be checking if that setup can perform at the expected data load rates (as only one thread will be active at a time)
nuck has joined #ruby
<catphish>
sure, well the main thread is normally just waiting on select()
njection_ has joined #ruby
<catphish>
which helps
<workmad3>
catphish: 1 thread waiting amongst 10,000 doesn't seem like much help personally ;(
<workmad3>
;)
greenarrow has quit [Quit: 500]
Elhu has quit [Quit: Computer has gone to sleep.]
<catphish>
there aren't 10,000 threads, one thread to listen on 10,000 ports, then one thread for each client, almost all will be waiting for data with select()
njection has quit [Ping timeout: 268 seconds]
<catphish>
but that's not to say load testing isn't in order
<catphish>
more interested in making it works first
aagdbl has joined #ruby
<catphish>
and it does appear to
<catphish>
thanks all, thats a few things for me to try now :)
dEPy has joined #ruby
danshultz has joined #ruby
ndrei has joined #ruby
workmad3 is now known as wm3|lunch
CyborgCygnus has quit [Remote host closed the connection]
atmosx has quit [Ping timeout: 265 seconds]
francisfish has quit [Remote host closed the connection]
<osxorgate>
my osx comes with ruby 2.0, i try to run a particular gem but it fails, apparently because it was designed for 1.9 . Is there a way for me to run this gem using 1.9 instead of 2.0 ?
<Hanmac>
or a problem that grit might not compatible with your git version
_Andres has joined #ruby
jollyy_ has joined #ruby
repinski has quit [Read error: Connection reset by peer]
kaspergrubbe has quit [Ping timeout: 240 seconds]
<tulak>
Hello, I am having two arrays of objects of class MyObject, and I am trying to do the substraction a = [obj1, obj2]; b = [obj2, obj3]; a - b => [obj1, obj2] but it does not substract array b from a. The class MyObject implements method <=> for comparing, and even a[1] == b[0] is true. What else should I implement to get this working ?
jollyy has quit [Ping timeout: 240 seconds]
reset has joined #ruby
francisfish has quit [Remote host closed the connection]
jollyy has joined #ruby
danshultz has quit [Remote host closed the connection]
danshultz has joined #ruby
jollyy__ has joined #ruby
greenarrow has joined #ruby
<osxorgate>
Hanmac: maybe i can use RVM ? (i am 100% ruby noob)
oo_ has quit [Remote host closed the connection]
<Hanmac>
osxorgate: i am not 100% sure if that would solv your problem
dfranciosi has quit [Remote host closed the connection]
atmosx has joined #ruby
dfranciosi has joined #ruby
Xeago has joined #ruby
hemanth has joined #ruby
<Hanmac>
tulak: did you include the Comparable module? if yes, try to add the methods #hash and #eql?
hemanth has quit [Max SendQ exceeded]
rylev has quit [Remote host closed the connection]
oo_ has joined #ruby
jollyy_ has quit [Ping timeout: 268 seconds]
hemanth has joined #ruby
hemanth has quit [Max SendQ exceeded]
hemanth has joined #ruby
reset has quit [Ping timeout: 240 seconds]
mansi has joined #ruby
jollyy has quit [Ping timeout: 268 seconds]
jollyy__ is now known as jollyy
kitak has quit [Remote host closed the connection]
<canton7-mac>
bear in mind that 0.3 seconds isn't very long
<gr33n7007h>
canton7, awesome it works well fast
<shredding>
My problem: $terminal.ask
<shredding>
solves it.
<gr33n7007h>
what about 0.7
Beoran_ has quit [Ping timeout: 265 seconds]
<canton7-mac>
I'd leave a few seconds at least
<canton7-mac>
sometimes it does take a while to get a connection
<gr33n7007h>
ok one sec lemme try 3 secs
habanany has quit [Ping timeout: 240 seconds]
sk87 has joined #ruby
supermarin_ has quit [Ping timeout: 255 seconds]
freerobby has quit [Ping timeout: 240 seconds]
spicerack has joined #ruby
papasierra has quit [Ping timeout: 240 seconds]
rylev has quit [Remote host closed the connection]
<gr33n7007h>
It seems to be working but sometimes it says port 443 is closed when using 3 second timeout when port 443 is open
<canton7-mac>
maybe it takes longer than 3 secs? maybe there's a firewall blocking your spamming?
<gr33n7007h>
should I try a higher timeout?
<canton7-mac>
dunno
<canton7-mac>
I'd just use nmap :P
deryl has joined #ruby
<gr33n7007h>
well true, but really i'm just trying to understand threads :)
<canton7-mac>
which is fair enough
dblessing has joined #ruby
spicerack has quit [Client Quit]
vpretzel_ is now known as vpretzel
<gr33n7007h>
So close yet so far away
atno has quit [Quit: Leaving]
Xeago__ has quit [Remote host closed the connection]
axisys has quit [Quit: leaving]
<gr33n7007h>
canton7-mac, Thanks for your help buddy :)
<canton7-mac>
:)
axisys has joined #ruby
Guest25829 has joined #ruby
chrisseaton has quit [Ping timeout: 240 seconds]
wald0 has joined #ruby
axisys has quit [Client Quit]
<gr33n7007h>
you too Mon_Ouie :)
francisfish has joined #ruby
geoffw8_ has quit [Quit: Connection closed for inactivity]
axisys has joined #ruby
axisys has quit [Changing host]
axisys has joined #ruby
gaussblurinc has joined #ruby
SolarSailor has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
thesheff17 has joined #ruby
Xeago has joined #ruby
fgo has joined #ruby
<gr33n7007h>
Just a quick question do threads automatically join in a pry/irb session?
<r_rios>
Is there any (official, preferably) documentation on creating virtual attributes in Rails 4?
taf2 has joined #ruby
<apeiros>
gr33n7007h: no
<apeiros>
r_rios: #rubyonrails is probably more competent on that
<r_rios>
Oops
<r_rios>
Sorry
<canton7-mac>
gr33n7007h, no. although, in your case, the process stopped executing before the threads completed, which killed the threads. that won't be the case in irb
<gr33n7007h>
apeiros, canton7-mac got ya! cheers
mary5030 has joined #ruby
kpshek has joined #ruby
rvraghav93 has quit [Ping timeout: 240 seconds]
sepp2k has joined #ruby
mr_snowf1ake has joined #ruby
viscera has quit [Ping timeout: 240 seconds]
kennym has joined #ruby
mary5030 has quit [Remote host closed the connection]
Xeago has quit [Remote host closed the connection]
tkuchiki_ has joined #ruby
mary5030 has joined #ruby
mansi has joined #ruby
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
flowerpot has joined #ruby
JacobHayes has joined #ruby
nisstyre has quit [Ping timeout: 268 seconds]
mansi has quit [Remote host closed the connection]
tkuchiki has quit [Ping timeout: 240 seconds]
pu22l3r__ has quit [Remote host closed the connection]
pu22l3r has joined #ruby
DEA7TH has joined #ruby
DEA7TH has quit [Changing host]
DEA7TH has joined #ruby
tkuchiki_ has quit [Ping timeout: 255 seconds]
tvw has joined #ruby
<DEA7TH>
What do people typically use Ruby for, outside of Ruby on Rails?
flowerpot has quit [Ping timeout: 255 seconds]
fgo has quit [Remote host closed the connection]
browndawg has joined #ruby
danshultz has joined #ruby
nouitfvf_ has joined #ruby
davedev2_ has quit [Ping timeout: 240 seconds]
davedev24 has joined #ruby
andrewlio has quit [Quit: Leaving.]
<olivier_bK>
DEA7TH, i use ruby for creat some task like send mail , backup mysql , connect to irc ..
<olivier_bK>
DEA7TH, i use ruby also for create an ide
pu22l3r has quit [Ping timeout: 240 seconds]
lolmaus has quit [Quit: No Ping reply in 180 seconds.]
nouitfvf has quit [Ping timeout: 240 seconds]
reset has joined #ruby
abdulsattar has joined #ruby
xcv has quit [Remote host closed the connection]
<olivier_bK>
and if i have a time in few month i would want to creat a game with gosu
tjr9898 has joined #ruby
<canton7>
general sysadmin stuff, general glue, sinatra websites/webservices, we use a unit testing framework for C written in it
<tobiasvl>
DEA7TH: I use ruby for anything
jlast has joined #ruby
<DEA7TH>
I mean, Python is common in numeric/scientific applications, and I heard networking
<canton7>
and if I need to knock something up quickly, I'll use ruby
mary5030_ has joined #ruby
tvw has quit [Read error: Connection reset by peer]
<DEA7TH>
C++ for systems programming and high-performance and scientific stuff
<tobiasvl>
I mostly use ruby as a Perl replacement (I'm a sysadmin)
tvw has joined #ruby
<DEA7TH>
PHP for web development (unfortunately)
<DEA7TH>
and so on
<shevy>
tobiasvl \o/
<shevy>
I do everything in ruby right now
<tobiasvl>
but also for web stuff (although not rails, I've used sinatra for example)
lolmaus has joined #ruby
<DEA7TH>
of course everything can be done in everything, even websites in C++, but some languages have typical usages
<shevy>
DEA7TH yes, all usages are covered with ruby here, not sure what else to tell you :)
<DEA7TH>
and I observe that this channel has twice the amount of visitors as #RubyOnRails
<shevy>
#RubyOnRails is restricted
<shevy>
you must register to join
RaptorJesus has quit [Ping timeout: 240 seconds]
<tobiasvl>
DEA7TH: ruby is a multi-purpose scripting language. I use it to write scripts. :)
alaibe has joined #ruby
hamakn has joined #ruby
St_Marx has quit [Ping timeout: 245 seconds]
niharvey|brb is now known as niharvey
mary5030 has quit [Ping timeout: 255 seconds]
jonno11 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
marcux has quit [Quit: marcux]
<DEA7TH>
canton7: general blue?
<DEA7TH>
oops misread
<DEA7TH>
a nvm
marcux has joined #ruby
crystal77 has joined #ruby
marcux has quit [Client Quit]
francisfish has quit [Remote host closed the connection]
<shevy>
DEA7TH I would assume you would get just about the same answer on #python and #perl
jonno11 has joined #ruby
jollyy has joined #ruby
newUser1234 has joined #ruby
clamstar has joined #ruby
<DEA7TH>
I know every language can be used for everything, but some *tend* to be used for specific things - I'm not commenting on whether they are good at those things
reset has quit [Ping timeout: 255 seconds]
meatherly has joined #ruby
<DEA7TH>
although most of the time they should be decent
<tobiasvl>
DEA7TH: and ruby tends to be used with rails. there's no denying that. what are you actually wondering about?
Morkel_ has joined #ruby
Morkel has quit [Ping timeout: 240 seconds]
Morkel_ is now known as Morkel
<elisarver>
DEA7TH: I use ruby to build test automation using selenium and cucumber
<DEA7TH>
tobiasvl: my question was about other usages of Ruby, if there are some not mentioned already
<elisarver>
DEA7TH: we also use it to process xml from one system's format to another, filling in the missing information via atom queries
<shevy>
DEA7TH languages that are catered towards a specific usage domain are often having a very bad design
<elisarver>
DEA7TH: and of course there's puppet
<shevy>
DEA7TH like php
francisfish has joined #ruby
<elisarver>
DEA7TH: and vagrant
jonmorehouse has joined #ruby
<DEA7TH>
but I suppose there are no specific fields for Ruby? except for web dev, I mean
<shevy>
DEA7TH rails didn't exist when I started with ruby, ruby is really for most everything a better variant of perl in my opinion
<shevy>
why you keep on writing "web dev" :P
<DEA7TH>
shevy: because obviously Ruby is famous for Rails - even if it didn't start that way, right now Rails is a big subset of Ruby's usages
<shevy>
aha
<shevy>
well I use ruby since 10 years without rails still
<shevy>
I estimate ruby lost 20% devs in a year according to TIOBE
<gr33n7007h>
canton7-mac, Is there away to get the output sane?
banister has joined #ruby
codabrink has joined #ruby
banister has quit [Max SendQ exceeded]
<chichou>
It's really hard to find ruby dev :)
<shevy>
possibly
SolarSailor has joined #ruby
<DEA7TH>
why would people move away from Ruby
<shevy>
old folks often know perl, python is larger than ruby, php is used a lot for web-related stuff
<DEA7TH>
growth of BigData -> less interpreted languages?
<shevy>
DEA7TH I would not know but that is what TIOBE says!
Guest25829 has quit [Remote host closed the connection]
banister has joined #ruby
banister has quit [Max SendQ exceeded]
spyderman4g63 has joined #ruby
<shevy>
DEA7TH nah, you will rarely see clusters use just one language, they tend to use multiple languages at the same time
Bumptious has quit [Remote host closed the connection]
krz has quit [Quit: WeeChat 0.4.3]
<DEA7TH>
growth of VB.NET according to TIOBE? it could be that it's just growth of developers then
spyderman4g63 has quit [Client Quit]
Bumptious has joined #ruby
banister has joined #ruby
<chichou>
DEA7TH: they don't move away from, just that less people learn ruby than learn php
<DEA7TH>
perhaps development used to be done by a more selective part of the population
chrisseaton has joined #ruby
banister has quit [Max SendQ exceeded]
<canton7-mac>
gr33n7007h, either use some locks, or get all threads to post their messages back to a single thread (could be the main thread), which prints them
<DEA7TH>
oh well, at least Scala has a bright future :)
banister has joined #ruby
crystal77 has quit [Quit: Computer has gone to sleep.]
banister has quit [Max SendQ exceeded]
cj3kim has quit [Ping timeout: 255 seconds]
nari has joined #ruby
<elisarver>
DEA7TH: except grumbling that jdk 8 will kill it with incompatiblities :(
banister has joined #ruby
Celm has joined #ruby
banister has quit [Max SendQ exceeded]
<gr33n7007h>
canton7-mac, I'll lookup locks on ruby website thanks
<chichou>
Go is #36, behind COBOL on TIOBE :D
rvraghav93 has joined #ruby
carraroj has quit [Ping timeout: 268 seconds]
banister has joined #ruby
banister has quit [Max SendQ exceeded]
<elisarver>
and I disregard TIOBE, since it's mainly a measure of people trying to get *help* in a language (based on searches of forum community size, number of (potentially stupid) topics posted, etc.)
banister has joined #ruby
<DEA7TH>
yeah TIOBE is weird for some things
tkuchiki has joined #ruby
momomomomo has quit [Remote host closed the connection]
<DEA7TH>
and VB is like #7? it's not even maintained for more than a decade now
<shevy>
hehe
<shevy>
but there are still people making money with it!
St_Marx has joined #ruby
simono has quit [Ping timeout: 268 seconds]
linuxthefish has joined #ruby
<linuxthefish>
why ruby broken? :(
flowerpot has quit [Quit: leaving]
carraroj has joined #ruby
<linuxthefish>
/usr/lib/ruby/site_ruby/1.8/rubygems/core_ext/kernel_require.rb:55:in `gem_original_require': no such file to load -- json (LoadError)
<canton7-mac>
say with that connection.open? inside the definition of open? you might have '!!@connection'. why not have '!@connection.nil?' or '@connection != nil' ?
<toretore>
cat.dead? #=> both
<shevy>
lol toretore
<j416>
this is a real use-case
mary5030_ has quit [Remote host closed the connection]
<j416>
SELECT 1 FROM something WHERE something_id = $1::int
<j416>
SQL
<j416>
end
<toretore>
eyy
<j416>
blergh, indentation failed, but you see.
<canton7-mac>
j416, so you're expecting that to return nl, or something else?
<canton7-mac>
*nil
<shevy>
man
<shevy>
today is typing fail day
<canton7-mac>
:P
mary5030 has joined #ruby
<j416>
canton7-mac: it's a ? method, so expected to return true or false, nothing else
chrisseaton has joined #ruby
<shevy>
I want to return either nl or tre
<shevy>
or perhaps flse
<canton7-mac>
j416, sorry, mistype. you're expecting @db.exec to return somethign that is either nil, or some object?
sambao21 has joined #ruby
<j416>
canton7-mac: @db.exec returns true or nil
chichou has quit [Remote host closed the connection]
<j416>
sorry
<shevy>
hmm
<toretore>
j416: your use of !! is fine
kevind has joined #ruby
<toretore>
i do it like that too, and i am perfect
<canton7-mac>
j416, ouch :P yeah, it is fine. personally I'd check using .nil? or == nil
<shevy>
j416 you don't like !! ?
wm3|lunch has quit [Ping timeout: 240 seconds]
<maasha>
!!!!
<canton7-mac>
in languages where lots of things are falsy, !! makes more sense - it will turn an emptystring, emptyarray, emptyhash, 0, 0.0, etc, into false. in ruby that isn't the case
<toretore>
the reason people sometimes don't like !! is because of people not understanding what it does and just slapping it on expressions everywhere
vasilakisFiL has joined #ruby
<canton7-mac>
the only things it'll turn into false are false and nil. the false is pointless, and the nil you might as well just check yourself
<j416>
canton7-mac: but it'd be != nil
freezey has joined #ruby
<j416>
shevy: I don't dislike it, I think it looks rather elegant
<canton7-mac>
j416, and !....nil?, yes
<vasilakisFiL>
hey do you have any better alternative for this boilcode? Imagine that I had 1000 such values.... https://gist.github.com/vasilakisfil/35077a16c1f7a68c8249 (the json comes frome an external API that's the reason of CamelCase)
<j416>
shevy: just wondering if it's generally seen as good or bad practice
Soda has quit [Read error: Connection reset by peer]
duggiefresh has joined #ruby
<shevy>
ok so we use !! in ruby to get back either true or false in a reliable way?
<toretore>
vasilakisFiL: why are you putting them in instance variables?
<canton7-mac>
in pre-stdbool C it's really important. it'll turn a value that's >1 into one that's == 1, and a bool value that's >1 is full of potential subtle bugs
<j416>
shevy: that's .. how I use it
mary5030 has quit [Ping timeout: 240 seconds]
mikecmpbll has joined #ruby
<linuxthefish>
Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources
<toretore>
vasilakisFiL: gist the whole file plz
<linuxthefish>
i've installed openssl, how to rebuild?
<canton7-mac>
but in ruby the only thing that there's any point in using it on is nil, and imo just checking for nil is cleaner and more obvious :P
descala has quit [Ping timeout: 264 seconds]
<j416>
vasilakisFiL: you could just store the hash as-is, or you could if you want loop through the keys you need and assign using meta
<toretore>
linuxthefish: how did you install it?
freezey_ has joined #ruby
<linuxthefish>
compiled from source :D
<linuxthefish>
i tried recompile but no :/
<toretore>
then re-compile
<toretore>
oh
JacobHayes has quit [Remote host closed the connection]
aagdbl has quit [Quit: This computer has gone to sleep]
<toretore>
vasilakisFiL: use ActiveModel::AttributeMethods
<toretore>
i can't link to it because of some js bs
<toretore>
but it lets you define an `attributes` method
freerobby has quit [Ping timeout: 240 seconds]
rylev has joined #ruby
mary5030 has joined #ruby
<vasilakisFiL>
aha ok thanks !
mary5030 has quit [Remote host closed the connection]
linuxthefish has quit [Remote host closed the connection]
jarray52 has joined #ruby
linuxthefish has joined #ruby
mary5030 has joined #ruby
thesheff17 has quit [Remote host closed the connection]
reset has joined #ruby
JohnBat26 has quit [Read error: Operation timed out]
dx7 has joined #ruby
jonmorehouse has joined #ruby
andikr has quit [Remote host closed the connection]
roolo has joined #ruby
randomnick_ has joined #ruby
sandstrom has quit [Remote host closed the connection]
afreidah1 has joined #ruby
dx7 has quit [Remote host closed the connection]
brain_shim has quit [Remote host closed the connection]
vim_shim_ has quit [Remote host closed the connection]
JohnBat26 has joined #ruby
nooteh has joined #ruby
rylev has quit [Ping timeout: 268 seconds]
dx7 has joined #ruby
garndt has joined #ruby
ndrei has quit [Ping timeout: 268 seconds]
LiohAu has joined #ruby
CorySimmons has quit [Quit: Bye!]
banisterfiend has quit [Read error: Connection reset by peer]
<nooteh>
hi there, I'd like to ask if one of you has some experience with http://ruboto.org. I'm thinking of using it for one app
banister has joined #ruby
banister has quit [Max SendQ exceeded]
phantummm has joined #ruby
ffranz has joined #ruby
<shevy>
linuxthefish there may be some more "binaries" in /usr/bin like irb ri rdoc
marr has quit [Ping timeout: 240 seconds]
banister has joined #ruby
banister has quit [Max SendQ exceeded]
<shevy>
linuxthefish if you compile from source with the --prefix=/usr then it should not matter, as already existing files will be "overwritten" when you do make install
Mon_Ouie has quit [Ping timeout: 240 seconds]
jonmorehouse has quit [Ping timeout: 240 seconds]
reset has quit [Ping timeout: 240 seconds]
<linuxthefish>
i'm trying with some rvm thing
monkegjinni has quit [Remote host closed the connection]
<linuxthefish>
hopefully...
banister has joined #ruby
chipotle has joined #ruby
<toretore>
linuxthefish: not rvm
<toretore>
use rbenv or that other thing
<toretore>
chruby
chichou has joined #ruby
<shevy>
ack
xardas has quit [Remote host closed the connection]
dx7_ has joined #ruby
<shevy>
come on man, use the source: wget ftp://ftp.ruby-lang.org/pub/ruby/2.1/ruby-2.1.1.tar.bz2
rvraghav93 has quit [Read error: Operation timed out]
elisarve1 has joined #ruby
pu22l3r has joined #ruby
Solnse has joined #ruby
elisarver has quit [Read error: Connection reset by peer]
Solnse has quit [Remote host closed the connection]
Solnse has joined #ruby
Hobogrammer has quit [Read error: Connection reset by peer]
pu22l3r_ has joined #ruby
dx7 has quit [Ping timeout: 268 seconds]
linuxthefish has quit [Remote host closed the connection]
banister has quit [Ping timeout: 240 seconds]
linuxthefish has joined #ruby
linuxthefish has quit [Changing host]
linuxthefish has joined #ruby
elisarve1 has quit [Ping timeout: 255 seconds]
<linuxthefish>
yey, compile from source worked for one server :D
phutchins has joined #ruby
browndawg has left #ruby [#ruby]
chipotle has quit [Quit: cya]
chipotle has joined #ruby
chipotle has quit [Max SendQ exceeded]
jeregrine has joined #ruby
chipotle has joined #ruby
pu22l3r has quit [Ping timeout: 240 seconds]
chipotle has quit [Max SendQ exceeded]
<shevy>
really?
stevenliang has joined #ruby
<shevy>
what does ruby -v say there
oo_ has joined #ruby
<stevenliang>
hi, everyone. have you installed rubydns?
phantummm has quit [Quit: phantummm]
angusigu1ss has joined #ruby
Celm has joined #ruby
<stevenliang>
on centos 6
rails426 has joined #ruby
shaileshg has quit [Quit: Connection closed for inactivity]
<stevenliang>
from rubydns installation doc, it need to rum "gem", "bundle", and etc.
robbyoconnor has quit [Read error: Operation timed out]
<stevenliang>
my question is how to prepare ruby env for rubydns? thank you.
benzrf has joined #ruby
<benzrf>
hows it goin ruby people
snath has joined #ruby
<benzrf>
im thinkin of finally picking up rails426
<benzrf>
*rails
linuxthefish has quit [Remote host closed the connection]
<benzrf>
¬_¬
banister has joined #ruby
davy_ has joined #ruby
<benzrf>
i finally read up on what REST is exactly and it sounds like a pretty good set of guidelines
Celm has quit [Ping timeout: 265 seconds]
<shevy>
what is REST benzrf
<benzrf>
so i think i get how rails could use MVC to accomplish that
<DouweM>
benzrf: nice
<benzrf>
shevy: it is a set of rules and ideas about how to design APIs
<benzrf>
and other kinds of interfaces i guess??
<rails426>
benzrf you picking me up?
nateberkopec has joined #ruby
<benzrf>
rails426: of course i am
<shevy>
lol
angusigu1ss has quit [Ping timeout: 268 seconds]
<shevy>
rails426 he often mis-tab-completes on IRC
<benzrf>
>tfw tab compleatang
<shevy>
I am trying to have him fall into stupid work-nicks
jonno11 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dik_dak has joined #ruby
ndrst has joined #ruby
<shevy>
but he is much more creative than I am
yfeldblum has joined #ruby
elioat has quit [Ping timeout: 268 seconds]
zachallett has joined #ruby
<benzrf>
shevy: can u into REST
maasha has quit [Quit: Page closed]
francisfish has quit [Remote host closed the connection]
<benzrf>
anyway now that i understand how to design things in a RESTful manner i get why MVC is a good approach for that o=
* benzrf
has turned into a buzzword spout
<benzrf>
:(
claymore has joined #ruby
rvraghav93 has joined #ruby
<benzrf>
any day now im gonna start using a macbook and spending all my time in starbucks
AlexRussia has quit [Quit: Konversation terminated!Good bye!]
AlexRussia has joined #ruby
poikon has joined #ruby
mengu has quit [Remote host closed the connection]
ffranz has quit [Quit: Leaving]
freerobby has joined #ruby
<DouweM>
benzrf: :D
tagrudev has quit [Remote host closed the connection]
<benzrf>
whut is happen
aganov has quit [Remote host closed the connection]
thesheff17_ has joined #ruby
<benzrf>
im too hipster to be this mainstream hipster
<benzrf>
=[
thesheff17_ has quit [Read error: Connection reset by peer]
thesheff17 has joined #ruby
<benzrf>
DouweM: try quick god daddit
<benzrf>
it will like
<benzrf>
EXPLODE UR MindfulMonk
<benzrf>
*mind
<DouweM>
nah I've got shit to do and I don't feel like spending hours to fail to install fuse :P
<benzrf>
ur loss dude
<benzrf>
[so much loss omg]
<DouweM>
I know
soulkey has joined #ruby
thesheff17 has left #ruby [#ruby]
<soulkey>
Hi I wondered if someone with experience with Omniauth could help out or point me in the right direction for a channel. Lets say I've gone to a URL auth/developer?foo=bar can i get the callback to include foo in params on return?
ffranz has joined #ruby
poikon_ has quit [Ping timeout: 268 seconds]
<DouweM>
benzrf: screencast of mindblowing stuff you've added? :P
<benzrf>
um
<benzrf>
-.-
<benzrf>
hold on o-o
stevenliang has quit [Quit: Leaving]
freerobby has quit [Ping timeout: 240 seconds]
<benzrf>
DouweM: basically just now u can use a regular command instead of putting in code
<benzrf>
>.<
<benzrf>
DouweM: remind me what ive showed u so farn
<benzrf>
*far
<DouweM>
ah yeah you mentioned
<DouweM>
noice
<benzrf>
hold on i will do a thing
<DouweM>
just that you can add/edit files with a couple ofm ethods that'll be loaded into the repl automatically
<benzrf>
kk
<benzrf>
1 sec
<benzrf>
o=
Nukepuppy has joined #ruby
<DouweM>
=o
<Nukepuppy>
anyone have a good suggestion on porting all my gem versions to another desktop? can i just make a Gemfile for all my gems and versions?
sigurding has joined #ruby
simoz111 has joined #ruby
descala has joined #ruby
Lewix has quit [Remote host closed the connection]
rayners has joined #ruby
elisarver has joined #ruby
<benzrf>
DouweM: made a short recording of its use
<benzrf>
let me upload it, 1 sec
willb1 has quit [Ping timeout: 240 seconds]
<benzrf>
ah man it's in the middle of outputting
<benzrf>
-.-
enebo has joined #ruby
<DouweM>
hehe
danshultz has quit [Remote host closed the connection]
thesheff17_ has joined #ruby
danshultz has joined #ruby
ruby-newbie has joined #ruby
<ruby-newbie>
hello
lenoxe has quit [Ping timeout: 245 seconds]
Aquilo has quit [Ping timeout: 240 seconds]
<ruby-newbie>
Time#to_i returns seconds from 1970-01-01 00:00:00-00 right?
browndawg has joined #ruby
<Jamo>
I think so
SolarSailor has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
zachallett has quit [Remote host closed the connection]
willb1 has joined #ruby
<Jamo>
Iv been using (Time.now.to_f*1000).to_i to get it in milliseconds, and then its same as Javas timeInMillis()
Solnse has quit [Remote host closed the connection]
<benzrf>
D:
sigurding has quit [Ping timeout: 268 seconds]
ixti has quit [Ping timeout: 268 seconds]
spyderman4g63 has joined #ruby
sigurding has joined #ruby
greggroth has joined #ruby
<sigurding>
sorry, back again. anyone has an idea suggestion?
thesheff17_ has quit [Quit: Leaving]
maroloccio has quit [Quit: WeeChat 0.4.3]
monkegjinni has quit [Remote host closed the connection]
<benzrf>
sigurding: for what again?
<DouweM>
benzrf: how about uploading a working vid
jottr has joined #ruby
Solnse has joined #ruby
<sigurding>
benzrf: for my previous question. I just repeat it: is there any option to build a pluggable (extendable) Optionsparser. Based on the include via require, I want to output all options
rayners has quit [Remote host closed the connection]
freezey_ has quit [Remote host closed the connection]
<benzrf>
sigurding: why not us an existing framework like slop or thor
andy__ has joined #ruby
parduse has quit []
spyderman4g63 has quit [Remote host closed the connection]
jerius has joined #ruby
<soahccc>
sigurding: what's wrong with the stdlib optparse? Not sure what you mean with pluggable
spyderman4g63 has joined #ruby
bal has quit [Quit: bal]
rylev has joined #ruby
<sigurding>
soahccc: the problem I have is: I have standard set of optparses
<sigurding>
but I want to be able to require mylib.rb, and therein define additional optparser, which should be automatically wired into the standard set
<benzrf>
aw wait wtf
parduse has joined #ruby
<benzrf>
it froze near the end >:o
<benzrf>
DouweM: would u like just the typescript/timings without a fancy website to host e
<benzrf>
m
jonmorehouse has quit [Ping timeout: 240 seconds]
pontiki has joined #ruby
chipotle has joined #ruby
<DouweM>
yeah it froze, but even what I've seen is pretty fucking awesome
atno has quit [Remote host closed the connection]
<DouweM>
yeah sure, gimme the script
<soahccc>
sigurding: well you can extend it if you initiate the optparse in a singleton and parse it after all plugins are loaded/registered
<benzrf>
:-)
<benzrf>
1 sec
ndrei has joined #ruby
<sigurding>
soahccc: the next thing I am struggeling with is, that I need some params to be required
Soda has joined #ruby
<soahccc>
sigurding: if you define an option twice it overrides the old one though
<sigurding>
which seems to the next pretty difficult task
spyderma_ has quit [Remote host closed the connection]
ixti has joined #ruby
Emmanuel_Chanel has quit [Ping timeout: 240 seconds]
TheDick has quit [Quit: TheDick]
<soahccc>
sigurding: well not really required options but that the option requires a value but it's not hard to check
<sigurding>
soahccc: hm
spyderma_ has joined #ruby
spyderma_ has quit [Remote host closed the connection]
spyderman4g63 has quit [Ping timeout: 240 seconds]
rylev has quit [Ping timeout: 240 seconds]
<sigurding>
soahccc: I found myself having some trouble with it today
spyderman4g63 has joined #ruby
<benzrf>
DouweM: kk it's up
<soahccc>
sigurding: after parse! your ARGV still includes non option arguments if you want to use these
JacobHayes has joined #ruby
rayners has joined #ruby
<benzrf>
DouweM: fun fact i discovered the other day btw
horrorvacui has joined #ruby
<benzrf>
DouweM: if you pipe scriptreplay into netcat you can serve scripts over netcat connections
<benzrf>
=D
newUser1234 has quit [Remote host closed the connection]
<benzrf>
DouweM: just have the other person 'nc -l 9001', then 'scriptreplay whatever -ttiming | nc their_ip 9001'
Beoran has left #ruby ["Leaving"]
dumdedum has quit [Quit: foo]
<benzrf>
\o/
DrShoggoth has joined #ruby
<sigurding>
soahccc: what do you think of highline?
arietis has quit [Quit: Computer has gone to sleep.]
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
tulak has quit [Quit: Leaving.]
reset has quit [Ping timeout: 240 seconds]
<DouweM>
benzrf: ha, cool
dumdedum has joined #ruby
chuk_ has joined #ruby
zz_jrhorn424 is now known as jrhorn424
WillAmes has quit [Read error: Operation timed out]
<DouweM>
benzrf: cool demo man. I have no idea when this would be useful, but it's a cool PoC
fijimunkii has joined #ruby
St_Marx has quit [Quit: Ex-Chat]
Akuma has quit [Read error: Operation timed out]
St_Marx has joined #ruby
jorts has joined #ruby
<DouweM>
benzrf: but I hate you for using tabs for indentation
<benzrf>
=p
<benzrf>
DouweM: i was thinking use it as a dev env for working on normal ruby projects
taf2 has quit [Quit: taf2]
Akuma has joined #ruby
fabrice31 has quit [Remote host closed the connection]
greggroth has quit [Read error: Connection reset by peer]
arubincloud has joined #ruby
<benzrf>
DouweM: whenever youre doing codes, you boot up quick and require your existing project
tulak has joined #ruby
greggroth has joined #ruby
<benzrf>
DouweM: you write some more code in a live env
<benzrf>
then when its working right you copy the code back to your static project dir
<benzrf>
ima add dmtcp integration also so that you can freeze and thaw sessions if you need to pause work
<DouweM>
yeah, that could be useful
sk87 has joined #ruby
<benzrf>
:-)
<benzrf>
ive heard rumors that emacs already has something like this
<benzrf>
ignore them
<DouweM>
now figure out a way to automate the "copy back into static project" step :P
<benzrf>
it's probably horribly buggy and in alpha or something
<DouweM>
hehe
* benzrf
coughs
<DouweM>
:)
<benzrf>
DouweM: i can probs do that
<benzrf>
do 'quick export <other dir>' and it sticks your code files into 'class ::Foo' wrappers, then copies them to <other dir>
<benzrf>
or something along those lines
kitak has quit [Remote host closed the connection]
kith has joined #ruby
tulak has quit [Client Quit]
kitak has joined #ruby
<DouweM>
I can't really envision a perfect way of automatic exporting .you probably want those new methods etc in a logical place in your current class file
andikr has joined #ruby
<benzrf>
yeah
<shevy>
<benzrf> EXPLODE UR MindfulMonk
<shevy>
lol
<benzrf>
it already depends on ruby_parser to validate that you arent trying to smuggle non-method-def code into a class tho
<bilbo_swaggins>
The first PDF was more of a powerpoint overview and inscrutable, because it never really defined certain important things
<bilbo_swaggins>
but I have Fielding's original dissertation as well
<bilbo_swaggins>
I'll read that
<benzrf>
bilbo_swaggins: it is p simple really
<benzrf>
bilbo_swaggins: the basic idea is:
crystal77 has quit [Quit: Computer has gone to sleep.]
<benzrf>
1. your api is composed of RESOURCES
<bilbo_swaggins>
it seems like it, but there was a lot of obfuscatory language
<DouweM>
arubincloud: why bah?
<benzrf>
each resource is at some uri
dx7 has quit [Ping timeout: 240 seconds]
yfeldblum has joined #ruby
<kith>
i mean it seems to be worse with snmp stuff... i dont get why
<benzrf>
a resource is usually either a thing or a collection of things
<benzrf>
[this is REST as applied to HTTP btw]
<bilbo_swaggins>
and you pass state back and forth
ValicekB has joined #ruby
<arubincloud>
DouweM: Because the bot's output was not helpful in that case.
wm3|lunch has joined #ruby
<bilbo_swaggins>
rather than maintaining it at any one location
<benzrf>
that's a requirement to be considered RESTful
<benzrf>
well not precisely
<DouweM>
arubincloud: ah
<benzrf>
there is no /session state/ on the server
<bilbo_swaggins>
the doc never defined "resource"
<bilbo_swaggins>
ah yes
<benzrf>
but it's fine for resources to have state
<bilbo_swaggins>
yes
<bilbo_swaggins>
I realized that had to be true for a multi-user game
noop has quit [Ping timeout: 268 seconds]
<benzrf>
2. you interact with all resources using a set of universal predefined verbs
<benzrf>
bilbo_swaggins: a game could be a resource :u
<benzrf>
in the case of REST over HTTP, those verbs are the http verbs
<bilbo_swaggins>
I'm not going to send clients secret info though
<benzrf>
usually GET, POST, PUT, and DELETE
AlexRussia has quit [Read error: Connection reset by peer]
<bilbo_swaggins>
it's a game for programmers, they'll hack and cheat :P
<bilbo_swaggins>
so some info can't be shared
sambao21 has quit [Quit: Computer has gone to sleep.]
<benzrf>
so keep it on the server
michaeldeol has joined #ruby
wm3|lunch is now known as workmad3
Es0teric has joined #ruby
<benzrf>
but a /session with an application/ should not have state on the server
<benzrf>
if you have a resource on the server that can be modified and updated, that's fine
<benzrf>
don't keep an interaction session on the server though
<bilbo_swaggins>
right
<bilbo_swaggins>
makes sense
<DouweM>
benzrf: PATCH ftw
<bilbo_swaggins>
is there something like ActiveRecord that automatically maps class structure to URIs?
<benzrf>
DouweM: fu patch is fail
AlexRussia has joined #ruby
<benzrf>
bilbo_swaggins: i think that's what rails does actually
<benzrf>
bilbo_swaggins: i just read about this stuff yesterday and today ;p
<DouweM>
benzrf: PATCH and PUT have different semantics, via HTTP
<benzrf>
w/e dude
<DouweM>
hahaha
<benzrf>
bilbo_swaggins: a resource can be represented in different formats
<benzrf>
so return xml or html or something based on what the client asks forced_request
<benzrf>
*for
<benzrf>
the point is for each uri to be a resource, not a document
<benzrf>
a resource is more abstractj
<benzrf>
it represents some kind of thing you can deal with
r0bby has joined #ruby
<bilbo_swaggins>
stop hitting tab
<bilbo_swaggins>
:P
<benzrf>
which may have multiple representations
<benzrf>
:P
<benzrf>
finally there's HATEOAS
<bilbo_swaggins>
that's where the definitions eluded me
karmatr0n has joined #ruby
<bilbo_swaggins>
what do you mean "multiple representations"
<benzrf>
well
<benzrf>
if you have some object on your server
robbyoconnor has quit [Ping timeout: 240 seconds]
<bilbo_swaggins>
I understand a resource is basically an object of any kind
<benzrf>
or row in a db
baniste__ has quit [Ping timeout: 268 seconds]
<bilbo_swaggins>
okay
<benzrf>
a representation is some kind of way of representing the abstract resource
yfeldblum has quit [Ping timeout: 265 seconds]
<benzrf>
such as, as json or xml
<bilbo_swaggins>
oh
<bilbo_swaggins>
jeeze
<benzrf>
or even html
<bilbo_swaggins>
that's simple
<benzrf>
yeah ;P
crystal77 has joined #ruby
<benzrf>
HATEOAS is the idea that an api should behave like a state machine
<benzrf>
ish
<bilbo_swaggins>
I think for this project I may be better off with Sinatra and ActiveRecord than full on Rails
arietis has quit [Quit: Computer has gone to sleep.]
<bilbo_swaggins>
interesting
<bilbo_swaggins>
I'll wiki that
tjr9898 has quit [Remote host closed the connection]
<benzrf>
bilbo_swaggins: it's p simple actually
mrnugget has quit [Quit: mrnugget]
<benzrf>
bilbo_swaggins: basically each response should contain links to other resources labelled with their relationship
AlexRussia has quit [Remote host closed the connection]
<benzrf>
bilbo_swaggins: i.e. actions that modify the current state
freerobby has joined #ruby
rhys has joined #ruby
<bilbo_swaggins>
oh
<benzrf>
bilbo_swaggins: so if you GET a resource representing a match in your game
<bilbo_swaggins>
weird
<bilbo_swaggins>
I never realized the web was a state machine
<benzrf>
the representation should somehow indicate the URIs for related resources
banister has joined #ruby
<benzrf>
and how they are related
AlexRussia has joined #ruby
<bilbo_swaggins>
so the client agent can decide based on the labels
<benzrf>
right
<benzrf>
like how you do when browsing the web
<bilbo_swaggins>
so it's really as simple as <a href=URL>label</a>
<benzrf>
more or lessless
<benzrf>
*less
<benzrf>
it depends on your representation :-)
<bilbo_swaggins>
You gonna support git integration for managing revisions of your smalltalk-VM-ish Ruby project checkpointy things? (do you have names for these concepts yet?)
<benzrf>
bilbo_swaggins: maybe?
<benzrf>
quick has kinda turned into more of a live dev env than a true smalltalky thing
<benzrf>
:I
<bilbo_swaggins>
I've never used smalltalk proper
<benzrf>
ruby isnt really equipped or suited for that
<bilbo_swaggins>
but I like the idea
<bilbo_swaggins>
well the idea of live editing code and then *saving that revision* when it works is neat
<benzrf>
download pharo
<benzrf>
:-D
NovapaX has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<bilbo_swaggins>
don't want to learn ANOTHER language right now :P
<abstractj>
benzrf I would like to be a document, please
<DouweM>
The thing is that Dutch people don't care about their bikes, so we're all riding around on pieces of crap
<DouweM>
yeah because that's the prototypical Dutch male
<platzhirsch>
looks, that's pretty much me
phutchins has quit [Ping timeout: 240 seconds]
<DouweM>
But bikes like that are common for sure
<platzhirsch>
Except that my beard, if I would start growing one, would look more like the one of a 15 yo
<DouweM>
My bike has had this loud CLICK on every turn of the pedals for like 4 months but I'm not quite bothered enough to get a new one
jottr has quit [Ping timeout: 240 seconds]
duggiefresh has quit [Remote host closed the connection]
<DouweM>
hehe
enebo has joined #ruby
bitglue has joined #ruby
enebo has joined #ruby
<workmad3>
DouweM: you could always, I dunno, make sure your gears aren't loose or that one of the teeth isn't breaking or something... or just oil your chain!
einarj has quit [Remote host closed the connection]
<DouweM>
yeah I went to the bike repair shop and they said is was beyond repair, they were surprised it was still working at all, and that I should get a new one
<DouweM>
That was 3 months ago
duggiefr_ has joined #ruby
<platzhirsch>
DouweM: and you should buy a new one in their shop of course
timonv has quit [Remote host closed the connection]
RowdyChild|Away is now known as RowdyChildren
<DouweM>
but seriously, getting a crappy new bike is usually cheaper than getting a good new one. and getting a good new one is stupid, because nice bikes are stolen in a week
<DouweM>
eh
dumdedum has quit [Quit: foo]
<DouweM>
I didn't mean to say "getting a good new one", meant "repairing your current one"
<DouweM>
so yeah
spyderman4g63 has joined #ruby
jollyy has quit [Quit: jollyy]
arietis has quit [Quit: Computer has gone to sleep.]
<benzrf>
vjbhyrdhjguy
<benzrf>
ftgvhjkdtcf hbn\
<DouweM>
are you possessed by an evil spirit?
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
kauto has quit [Read error: Connection reset by peer]
jollyy has joined #ruby
afreidah1 has quit [Ping timeout: 268 seconds]
cescalante is now known as ce_afk
davy_ has quit [Remote host closed the connection]
<workmad3>
DouweM: or a kitty walked over the keyboard
<workmad3>
DouweM: which is an evil spirit, but probably not a possession :)
<DouweM>
hehe
<benzrf>
DouweM: no
NightGriffin has joined #ruby
<benzrf>
DouweM: the guy sitting next to me antagonized me
<benzrf>
so i retaliated
jollyy has quit [Client Quit]
<benzrf>
then he mashed my kbd :[
<platzhirsch>
anyone worked with highline to create a CLI?
klaut has quit [Remote host closed the connection]
<mikecmpbll>
alo
Senjai has quit [Quit: WeeChat 0.3.7]
andrewlio has joined #ruby
<_1_chopi4453>
k tal
<DouweM>
platzhirsch: I've heard good things about highline
s2013 has quit [Ping timeout: 240 seconds]
x1337807x has joined #ruby
<_1_chopi4453>
espain
Senjai`work has joined #ruby
skammer has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<platzhirsch>
DouweM: Highline is a cool DSL, but I can't get menu choices like I 3 2 working where I is the menu choice and 3 and 2 are parsed as arguments
x1337807x has quit [Max SendQ exceeded]
railzForDaiz has joined #ruby
Senjai`work has quit [Changing host]
Senjai`work has joined #ruby
Senjai`work is now known as Senjai
x1337807x has joined #ruby
papercode has joined #ruby
browndawg has left #ruby [#ruby]
x1337807x has quit [Max SendQ exceeded]
toastynerd has quit [Remote host closed the connection]
sigurding has quit [Ping timeout: 252 seconds]
RowdyChildren is now known as RowdyChild|Away
<platzhirsch>
ah there is an example to build shells
vasilakisFiL has quit [Read error: Connection reset by peer]
afreidah1 has joined #ruby
<platzhirsch>
maybe that's it
yfeldblum has joined #ruby
jollyy has quit [Quit: jollyy]
sigurding has joined #ruby
f0ster has joined #ruby
<shevy>
DouweM hah my bike had that as well, damn crap bikes... cheap and crappy
mark_locklear has quit [Ping timeout: 240 seconds]
MatthewsFace has joined #ruby
phansch has quit [Quit: WeeChat 0.4.2]
<shevy>
this whole crap minimalism for mass production is so annoying
_1_chopi4453 has quit [Remote host closed the connection]
tylersmith has joined #ruby
<DouweM>
Dutch bikes aren't crap because of mass production, they're crap because they're just tools to us, and shiny tools get stolen
<benzrf>
highline more like LOWline o snapcase
<benzrf>
*snap
ndrei has quit [Ping timeout: 252 seconds]
<DouweM>
I'm starting a petition to stop benzrfs abuse of the tab key
GaryOak_ has joined #ruby
Stalkr_ has joined #ruby
<shevy>
no!
<shevy>
I will counter this proposal
francisfish has quit [Remote host closed the connection]
<shevy>
it provides so much entertainment on #ruby
rainmanjam has joined #ruby
<shevy>
<benzrf> EXPLODE UR MindfulMonk
<workmad3>
DouweM: ItSANgo__ wormwood benzrf fudanchii ignoch hermanmunster dik_dak ignoch willb1 evenix wormwood (it would be funny if he did it with every work... and sorry for the highlights everyone)
<benzrf>
kek
Lewix has joined #ruby
alexherbo2 has quit [Quit: WeeChat 0.4.3]
<DouweM>
hehe
bitglue has left #ruby [#ruby]
jobewan has joined #ruby
Xeago has quit [Remote host closed the connection]
<DouweM>
shevy: yeah that one was great
jprovazn has quit [Quit: Odcházím]
<shevy>
workmad3 lol
<shevy>
workmad3 but it's not as funny when it is pre-planned :(
yfeldblum has quit [Ping timeout: 265 seconds]
<shevy>
wow
x1337807x has joined #ruby
<shevy>
we even have hermanmunster here...
<shevy>
50% are like never writing anything
Solnse has quit [Remote host closed the connection]
<DouweM>
I don't recognize any of those names
<GaryOak_>
just fbi bots listening in
mr_red has joined #ruby
canton7-mac has quit [Quit: Leaving]
<shevy>
I think there are only a total of like 3 dozen people talking here on #ruby
dyoko1 has joined #ruby
dyoko has quit [Quit: Leaving.]
<horrorvacui>
I'm confused, I don't understand whats happening.
<shevy>
horrorvacui go have a beer
railzForDaiz has left #ruby [#ruby]
freerobby has joined #ruby
jerius has quit [Quit: Computer has gone to sleep.]
<DouweM>
shevy: 3 dozen regulars, and the occasional newbie
<shevy>
yeah
<horrorvacui>
I can't drink I've severe GERDs
<shevy>
NERDs?
<horrorvacui>
Alcohol is like gasoline on the fire.
<shevy>
yeah
keen__ has joined #ruby
<horrorvacui>
Actually it is...
<GaryOak_>
hahaha
RowdyChild|Away is now known as RowdyChildren
<DouweM>
that doesn't sound fun horrorvacui :/
mikecmpbll has quit [Read error: Operation timed out]
CreativeEmbassy has joined #ruby
keen_ has quit [Ping timeout: 240 seconds]
djbender has joined #ruby
<horrorvacui>
It's not to bad, I get to eat healthy because there is no other option.
jlebrech has quit [Quit: Konversation terminated!]
greggroth has joined #ruby
kaspergrubbe has joined #ruby
apeiros has joined #ruby
<f0ster>
are there any performance differences with looking up a var from ENV vs an value on a instantiated class
<sigurding>
is it possible to add list of parser.on() (Optionparser) to an existing list?
taf2 has joined #ruby
rakm has joined #ruby
<shevy>
f0ster I think ENV is pretty much as fast as a normal hash, perhaps just a wee bit slower
Es0teric has quit [Quit: Nigga, im OUTIE 5000]
<shevy>
I hate optionparser so much
<f0ster>
shevy: figured.. not 100% sure what ENV is doing
<horrorvacui>
f0ster did you see my response on your gist from earlier?
<f0ster>
would ENV stuff be in RAM or on the HEAP
freerobby has quit [Ping timeout: 268 seconds]
<f0ster>
horrorvacui: no actually, i was just coming up with a solution still
<f0ster>
now that the day is anew here at work
<shevy>
f0ster it should have all environment variables, usually in bash those who have defined via $ (or access via $ in bash); and it has some extra methods, like ENV.to_hash
toastynerd has joined #ruby
pzula has joined #ruby
<shevy>
*have been defined
<f0ster>
horrorvacui: my coworker said i should just put the hash values in yaml from an initializer, then fetch them everytime from a helper module function
<horrorvacui>
f0ster: you had a typo in the variable that is why class variables weren't working.
<f0ster>
horrorvacui: lol oh really
kaspergr_ has quit [Ping timeout: 240 seconds]
kaspergr_ has joined #ruby
<shevy>
f0ster I guess yaml files might be slightly better, some environments have different ENV, like if you try to use ENV in a ruby .cgi script for instance
sigurding has quit [Quit: sigurding]
<shevy>
and ENV can be tainted too
arietis has joined #ruby
<shevy>
In the past, I used to write ruby classes like so:
<shevy>
class Foo
<shevy>
HOME_DIR = ENV['MY_VIDEO_STUFF']
bilbo_swaggins has joined #ruby
<f0ster>
shevy: right but he was saying yaml -> initializer -> env -> helper
<shevy>
INFO_FILE = HOME_DIR+'/videos.info'
<shevy>
end
IceDragon has quit [Ping timeout: 240 seconds]
<shevy>
and that was bad because some environments might not have that set
coderhs has joined #ruby
coderhs has quit [Remote host closed the connection]
francisfish has joined #ruby
<shevy>
I dont know what is an "initializer", sounds terribly fancy. he just means to load the dataset or? what env and helper is I have no idea
kauto has joined #ruby
<shevy>
why does he not say what he means!
jollyy has joined #ruby
<shevy>
f0ster I hate your coworker already
jerius has joined #ruby
<shevy>
fire him
<f0ster>
no no, so he has these hash definitions in a yaml file
<kauto>
Anyone familiar with mechanize?
<workmad3>
shevy: an 'initializer' is most likely a rails initializer... which is just a file in config/initializers
<f0ster>
on an intializer he loads them to the env, then the helper method just fetches the hash values form teh ENV
<shevy>
ohhhhh... railsers. ok
<f0ster>
yeah rails, my bad
<shevy>
they use strange names
spicerack has joined #ruby
<shevy>
factory girl and factory mom
jollyy has quit [Read error: Connection reset by peer]
<f0ster>
lol
IceDragon has joined #ruby
<shevy>
kauto I used to use it like 5 years ago
<shevy>
I could even click on stuff
<kauto>
Well, that is pretty amazing
<horrorvacui>
lol
jollyy has joined #ruby
<shevy>
then mechanize changed, either it got away from hpricot ... I think it moved to nokogiri. nokogiri did not work for me back then, since then I lost all interest in it, I get frustrated too easily
kaspergr_ has quit [Ping timeout: 240 seconds]
<kauto>
Yeah it moved to nokogiri I believe
kaspergrubbe has quit [Ping timeout: 268 seconds]
<kauto>
I'm just having trouble getting this field to not be hidden so I can scrape it
pwh has quit []
Hobogrammer has joined #ruby
jerius_ has joined #ruby
MatthewsFace has quit [Quit: This computer has gone to sleep]
greenarrow has quit [Quit: 500]
RowdyChildren is now known as RowdyChild|Away
duggiefr_ has quit []
nomenkun has quit [Remote host closed the connection]
duggiefresh has joined #ruby
timonv has joined #ruby
saarinen has joined #ruby
mikepack has quit [Remote host closed the connection]
nomenkun has joined #ruby
jonmorehouse has joined #ruby
Es0teric has joined #ruby
zigomir has quit [Remote host closed the connection]
spyderman4g63 has quit [Ping timeout: 252 seconds]
jerius has quit [Ping timeout: 268 seconds]
yohanobs_ has joined #ruby
jollyy has quit [Quit: jollyy]
jollyy has joined #ruby
soulkey has quit [Ping timeout: 255 seconds]
dtcrshr has joined #ruby
soulkey has joined #ruby
nomenkun has quit [Ping timeout: 240 seconds]
nfk has joined #ruby
elaptics is now known as elaptics`away
nvrch has quit [Quit: nvrch]
<f0ster>
thanks again horrorvacui, i was disappointed i couldnt use my approach
<f0ster>
glad to know it was just a dumb typo
jonmorehouse has quit [Ping timeout: 255 seconds]
<platzhirsch>
How do I access the hash values/set values inside the Hash class itself (monkey patching)
<horrorvacui>
yeah well it took me actually trying your gist before I found the typo, its one of those you can overlook a 100 times.
f0ster is now known as dude
dude is now known as f0ster`
<workmad3>
platzhirsch: self[key] or self[key] = value
postdata has quit []
ghr has quit [Ping timeout: 240 seconds]
<platzhirsch>
right, thanks man
<f0ster`>
horrorvacui: yeah i still didnt even see it at first glance, just replaced my refs to my class var
<workmad3>
platzhirsch: you could also use fetch
Elhu has quit [Quit: Computer has gone to sleep.]
Mon_Ouie has joined #ruby
<workmad3>
platzhirsch: and update
Kricir has quit [Ping timeout: 240 seconds]
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
greggroth has quit [Ping timeout: 240 seconds]
xcv_ has joined #ruby
wald0 has quit [Ping timeout: 240 seconds]
Bumptious has quit [Remote host closed the connection]
kenndel_ has quit [Read error: Connection reset by peer]
Kricir has joined #ruby
catphish has left #ruby ["Leaving"]
kenndel_ has joined #ruby
ktosiek has joined #ruby
xcv has quit [Ping timeout: 255 seconds]
Xeago has joined #ruby
xcv_ has quit [Read error: Connection reset by peer]
xcv has joined #ruby
jollyy has quit [Quit: jollyy]
chuk_ has quit [Quit: Leaving]
jollyy has joined #ruby
xcv_ has joined #ruby
x1337807x has joined #ruby
crystal77 has quit [Quit: Computer has gone to sleep.]
zachallett has quit [Remote host closed the connection]
ce_afk is now known as cescalante
bklane has joined #ruby
jollyy has quit [Read error: Connection reset by peer]
bklane has quit [Remote host closed the connection]
mikemar10 has joined #ruby
mikemar10 has quit [Max SendQ exceeded]
xcv__ has joined #ruby
jollyy has joined #ruby
crystal77 has joined #ruby
bilbo_swaggins has quit [Quit: Leaving]
thesheff17_ has joined #ruby
bluenemo has quit [Remote host closed the connection]
fabrice31 has joined #ruby
afreidah1 has quit [Ping timeout: 240 seconds]
mikepack has joined #ruby
Guest77325 has joined #ruby
<Guest77325>
http://www.marketglory.com/strategygame/galahad1st for online gamers, if you didn't already, use this link to register on MerketGlory: a free2play financial strategy game where virtual currency can be converted into real money. It starts out slow but in time you can turn a good profit that is if you have the necessary patience to grow a little bit every day :P
Guest77325 has left #ruby [#ruby]
zachallett has joined #ruby
xcv has quit [Ping timeout: 255 seconds]
AndChat| has joined #ruby
zachallett has quit [Read error: Connection reset by peer]
rylev has joined #ruby
LiohAu has quit [Quit: LiohAu]
thesheff17_ has quit [Client Quit]
zachallett has joined #ruby
lkba has quit [Read error: Connection reset by peer]
AndChat- has joined #ruby
wald0 has joined #ruby
xcv_ has quit [Ping timeout: 255 seconds]
<benzrf>
>tfw ads
aspires_ has joined #ruby
mansi has quit [Remote host closed the connection]
mansi has joined #ruby
einarj has joined #ruby
mark_locklear has joined #ruby
<horrorvacui>
Somone make a ruby controlled robotic lawnmower
sambao21 has quit [Quit: Computer has gone to sleep.]
reset has joined #ruby
fabrice31 has quit [Ping timeout: 268 seconds]
AndChat| has quit [Ping timeout: 240 seconds]
mansi_ has joined #ruby
rylev has quit [Ping timeout: 252 seconds]
aspires_ has quit [Read error: Connection reset by peer]
wallerdev has joined #ruby
phantummm has joined #ruby
benzrf is now known as benzrf|offline
aspires has quit [Ping timeout: 240 seconds]
jollyy has quit [Quit: jollyy]
aspires has joined #ruby
jollyy has joined #ruby
Shidash has joined #ruby
kauto has quit [Quit: Leaving]
pzula has quit [Quit: Lost terminal]
mansi has quit [Ping timeout: 240 seconds]
Spami has joined #ruby
jollyy_ has joined #ruby
mattmcclure has joined #ruby
mikepack has quit [Remote host closed the connection]
alaibe has quit [Ping timeout: 240 seconds]
saarinen has quit [Quit: saarinen]
reset has quit [Ping timeout: 252 seconds]
mansi_ has quit [Read error: Connection reset by peer]
Jetchisel has joined #ruby
<shevy>
a lawnmoaner?
simono has quit [Read error: Connection reset by peer]
mansi has joined #ruby
arietis has quit [Quit: Computer has gone to sleep.]
kpshek has quit []
Solnse has joined #ruby
jobewan has quit [Ping timeout: 240 seconds]
jollyy has quit [Ping timeout: 268 seconds]
jollyy_ is now known as jollyy
saarinen has joined #ruby
papercode has quit [Ping timeout: 240 seconds]
dumdedum has joined #ruby
sputnik1_ has joined #ruby
kaspergrubbe has joined #ruby
Guedes has joined #ruby
subbyyy_ has joined #ruby
geggam has quit [Remote host closed the connection]
nahkunt has quit [Ping timeout: 240 seconds]
poikon_ has quit []
geggam has joined #ruby
xcv__ has quit [Remote host closed the connection]
SCommette has joined #ruby
mikecmpbll has joined #ruby
tvw has joined #ruby
hemanth has quit [Quit: This computer has gone to sleep]
Speed has quit [Read error: Connection reset by peer]
Vitor has joined #ruby
obs has quit [Quit: Konversation terminated!]
Jake232 has joined #ruby
fijimunkii has quit [Read error: Connection reset by peer]
obs has joined #ruby
fijimunkii has joined #ruby
Speed has joined #ruby
Zai00 has quit [Quit: Zai00]
ghr has joined #ruby
timonv has quit [Remote host closed the connection]
GreatSUN has quit [Ping timeout: 245 seconds]
aspires_ has joined #ruby
nisstyre has quit [Remote host closed the connection]
robbyoconnor has joined #ruby
olivier_bK has quit [Ping timeout: 240 seconds]
njection has joined #ruby
saarinen has quit [Quit: saarinen]
aspires has quit [Ping timeout: 240 seconds]
jerius_ has quit [Quit: Computer has gone to sleep.]
yxhuvud has quit [Remote host closed the connection]
NightGriffin has quit [Read error: Connection reset by peer]
afreidah1 has quit [Ping timeout: 240 seconds]
<shevy>
kbarry hehehe
<shevy>
wow
robbyoconnor has quit [Read error: Connection reset by peer]
<shevy>
iswop is abot
<shevy>
*bot
robbyoconnor has joined #ruby
yxhuvud has joined #ruby
monkegji_ has joined #ruby
rylev has quit [Read error: No route to host]
zchrykng-work has quit [Ping timeout: 240 seconds]
atno has joined #ruby
rylev has joined #ruby
arietis has joined #ruby
fijimunkii has joined #ruby
monkegjinni has quit [Read error: Operation timed out]
crystal77 has joined #ruby
yfeldblum has joined #ruby
carraroj has quit [Quit: Konversation terminated!]
Bumptious has quit [Ping timeout: 255 seconds]
jprovazn has joined #ruby
yfeldblum has quit [Remote host closed the connection]
yfeldblum has joined #ruby
tjr9898 has quit [Remote host closed the connection]
benzrf|offline is now known as benzrf
rylev has quit [Ping timeout: 240 seconds]
<mary5030>
when one conditionally creates a ruby object how do we make sure to conditionally destroy it?
<benzrf>
mary5030: hmm?
<mary5030>
ex: find or create when destroying want to conditionally destroy
nooteh has quit [Quit: Leaving.]
<benzrf>
i dont understand
<mary5030>
not ruby sorry active record
<jhass>
mary5030: provide some example code of your problem
dumdedum has quit [Quit: foo]
markisonfire has joined #ruby
<shevy>
mary5030 just keep track that you created it
neolithic has joined #ruby
<jhass>
there should be a better solution
<jhass>
this is most likely a design issue
<jhass>
or at least a code structure one
<mary5030>
by keeping track you mean assign it to a veriable?
<workmad3>
mary5030: just check that you found an object before trying to call .destroy on it
crystal77 has quit [Quit: Computer has gone to sleep.]
ovrflw0x has joined #ruby
pigzzcanfly has joined #ruby
<shevy>
mary5030, yeah that would be a simple way. if you could do so without having to use a variable, that would be even better
<ovrflw0x>
why is "gem install rails" taking so long to download?
<ovrflw0x>
is it a large file?
carraroj has joined #ruby
<shevy>
ovrflw0x probably a lot of docu
atno has quit [Ping timeout: 240 seconds]
<workmad3>
ovrflw0x: lots of dependencies
<jhass>
mary5030: if you want a definite answer show your actual code
adlerdias has joined #ruby
<ovrflw0x>
can anyone tell me approximate size of rails? 100MB?
<mary5030>
for ex: remove_public_ip_block = public_block.destroy i only want to destroy the once that were created
atno has joined #ruby
sk87 has joined #ruby
<mary5030>
ones*
<workmad3>
ovrflw0x: the rails gem itself is pretty tiny... it's just an umbrella gem for the rest of the gems in the framework
<shevy>
rails 4.0.2 gem is 1548800
crystal77 has joined #ruby
Elhu has joined #ruby
jobewan has quit [Quit: Leaving]
jobewan has joined #ruby
<shevy>
so 1.5 MB
<neolithic>
hi all, for any chef users, would you happen to know if its possible to use Ohai data in knife.rb? Im looking to call platform_family? but cant find any references to proper syntax, so dont know if I can just call it directly or if I have to get it from node['platform_family'].
roolo has quit [Quit: Leaving...]
<ovrflw0x>
shevy: how about "rails +dependecies" what's the size then?
<shevy>
dunno
<shevy>
I am not using rails, the guys on #rubyonrails are
<jhass>
mary5030: it still makes no sense to me, show your whole method
<workmad3>
ah, the rails gem also has all the guides in it
arietis has quit [Quit: Computer has gone to sleep.]
dblessing has quit [Ping timeout: 255 seconds]
<shevy>
there is a download for rails on windows btw
<shevy>
standalone
<shevy>
railsinstaller-2.2.2.exe
<shevy>
62 MB
<shevy>
also includes ruby.exe :P
monkegji_ has quit [Remote host closed the connection]
Shidash has quit [Ping timeout: 240 seconds]
<benzrf>
>2014
mengu has joined #ruby
<benzrf>
>using windows
<benzrf>
>not using unix
adlerdias has quit [Ping timeout: 240 seconds]
<benzrf>
>not using FLOSS
<workmad3>
ovrflw0x: most of the time when a gem install takes a while, it's nothing to do with size, it's because a request to rubygems for resolving some dependencies is being a bit slow
<workmad3>
ovrflw0x: you could ctrl-c the install and redo it with a -V param turn on verbose mode
Xeago_ has joined #ruby
atno has quit [Remote host closed the connection]
freezey has quit [Remote host closed the connection]
geggam has quit [Ping timeout: 240 seconds]
atno has joined #ruby
<ovrflw0x>
shevy should I stop "gem install rails" command and download rails-installer.exe?
greggroth has joined #ruby
<workmad3>
ovrflw0x: are you using windows?
<ovrflw0x>
yes
<shevy>
oh
<shevy>
you are on windows
<shevy>
you have my comforts man
<workmad3>
ovrflw0x: I'd probably suggest using rails-installer then, yes
<benzrf>
im sorry to hear that youll have to work with java
brain_shim has joined #ruby
<shevy>
ubuntu was bad before unity
<shevy>
with unity it killed itself
james_d_h has joined #ruby
<ovrflw0x>
k bye
<ovrflw0x>
bb again on linux
ovrflw0x has left #ruby [#ruby]
<shevy>
lol
olivier_bK has joined #ruby
pu22l3r has quit [Ping timeout: 240 seconds]
carraroj has quit [Quit: Konversation terminated!]
<shevy>
that was one funny guy though
tcstar has quit [Read error: Connection reset by peer]
kobain has joined #ruby
<shevy>
we forgot to ask him why he wants to learn ruby
afreidah1 has joined #ruby
linuxer1 has joined #ruby
tjr9898 has joined #ruby
dyoko has joined #ruby
crystal77 has joined #ruby
alaibe has joined #ruby
keeguon has joined #ruby
wjlafrance has joined #ruby
adlerdias has joined #ruby
kirun has joined #ruby
arietis has quit [Quit: Computer has gone to sleep.]
<alaibe>
exit
alaibe has quit [Client Quit]
ArchBeOS has joined #ruby
teddyp1cker has joined #ruby
<ArchBeOS>
are there any inherit setbacks or flaws from using require_relative?
<Sou|cutter>
it's 1.9+
jobewan has quit [Quit: Leaving]
jobewan has joined #ruby
<Sou|cutter>
not that most people care about 1.8 anymore
robbyoconnor has quit [Quit: Konversation terminated!]
<benzrf>
if youre relying on 1.8 then u suck
<ArchBeOS>
so require_relative is ok to use for an app buing built with 2.x MRI?
<jhass>
ArchBeOS: it can be a smell, if you do it in a gem, you're doing it wrong
<ballPointPenguin>
fwiw Ubuntu 14.04 Gnome (not unity) on MacBook retina is best linux + retina experience I've had yet
freerobby has joined #ruby
<jhass>
ArchBeOS: and it still might be better to just append $LOAD_PATH instead
carraroj has joined #ruby
geggam has joined #ruby
<ArchBeOS>
jhass: damn, i should use LOAD_PATH
<ArchBeOS>
thanks
<shevy>
ArchBeOS it's longer to write
userx has joined #ruby
<shevy>
ArchBeOS require itself works perfectly fine when someone has a gem-like structure in a project too
<ArchBeOS>
shevy: ok. i need to re-think how im bringing in my ruby files and I think LOAD_PATH might be the right way for me to do this
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<shevy>
just layout a gem-like structure and let gem or setup.rb install into SITE_DIR, then LOAD_PATH should have it
reset has joined #ruby
zorak has joined #ruby
jottr_ has joined #ruby
<shevy>
in my main directory where I keep my ruby stuff, let's call it x
elisarver has left #ruby [#ruby]
<shevy>
I have it setup like this, for project called "foobar", I'd put into x/foobar/lib/foobar/ <-- and here I usually put foobar.rb which loads the other files below that hierarchy
afex has joined #ruby
<kbarry>
I want to use ".match" but get the second result
<kbarry>
I "thought" that might be done with
Celm has quit [Remote host closed the connection]
<kbarry>
variable.match(/regex/)[1]
<ArchBeOS>
thanks shevy
freerobby has quit [Ping timeout: 240 seconds]
Celm has joined #ruby
<shevy>
for non-gem projects I cheat
<shevy>
I simply symlink that main dir into ruby site dir x/
bricker has joined #ruby
<shevy>
then I can do like: require 'x/tools/purge_directories.rb'
jackneill has joined #ruby
<shevy>
kbarry how does your regex and your string look?
<kbarry>
ohh, i only get to use it a bit every week,
<kbarry>
started about a month ago
<kbarry>
(using it in chef)
Elhu has quit [Client Quit]
<shevy>
Hanmac I think you have to tell this those who ask the question :D
<shevy>
cool
<shevy>
one month only
jonmorehouse has joined #ruby
<IceDragon>
Hanmac: can I haz pancakes, also do you want an invite to keybase? https://keybase.io/
rubensten has joined #ruby
sepp2k has quit [Read error: Operation timed out]
fijimunkii has quit [Read error: Connection reset by peer]
fijimunkii has joined #ruby
<rubensten>
What would be a good book to start learning Ruby for an older person with no programming experience at all. I know HTML and CSS, but don't know any programming languages at all. My goal is to learn Ruby and then move to rails...
kpshek has quit []
centrx has joined #ruby
spicerack has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<papasierra>
from these strings "foo/bar/baz" and "x/y", how do i obtain "foo/bar" and "x", respectively? i.e. discard the last part of the path?
davy_ has joined #ruby
rippa has quit [Ping timeout: 252 seconds]
<shevy>
platzhirsch I dont even nkow what EMI means
subbyyy_ has joined #ruby
<platzhirsch>
me neither
<shevy>
hehehe
Unfriendly has quit [Quit: HydraIRC -> http://www.hydrairc.com <- Like it? Visit #hydrairc on EFNet]
<platzhirsch>
It means I will be involved when the company makes debts
<shevy>
papasierra several ways. simplest one is by .split('/') -ing
<horrorvacui>
papasierra: one direct way is to split the strings on "/" and reassemble. also you can use regex to match depending.
<neolithic>
Is rbconfig available in all ruby versions (ie 1.8.5+)?
freerobby has joined #ruby
xcv has joined #ruby
decoponio has quit [Quit: Leaving...]
etqqkoiflwhb has joined #ruby
<shevy>
neolithic yeah I think so
mansi has quit [Remote host closed the connection]
<horrorvacui>
Didn't it go through a rename somewhere in the past though? Like didn't the module use to be called Config?
<s2013>
platzhirsch, yeah meaning in 3 years youll get .3%
<s2013>
but until then it will be counted on a monthly basis
<s2013>
so lets say you leave after year and half youll get .15%
<platzhirsch>
s2013: ah okay
<platzhirsch>
and now, from what?
freerobby has quit [Ping timeout: 268 seconds]
<platzhirsch>
.3% of ...
mansi has joined #ruby
<s2013>
of the company
<s2013>
is it for a job?
diegoviola has joined #ruby
<platzhirsch>
yes
<s2013>
3 years vesting si a bit too much but whatever
<s2013>
yeah then you get .3% equity in the company
<platzhirsch>
shares
freezey has quit [Remote host closed the connection]
<platzhirsch>
Isn't it like, I have to buy the shares?
<s2013>
no
<s2013>
you cant buy shares
<s2013>
its not public company
<s2013>
you just get shares
<s2013>
is it a startup?
<platzhirsch>
so after 3 years I own 0.3% of the company
<platzhirsch>
yes
<s2013>
yeah
boombadaroomba has joined #ruby
<platzhirsch>
and this becomes interesting when the company does IPO?
<s2013>
similarly how early employees of fb/google etc made rich
<s2013>
yup
<platzhirsch>
and if they never go IPO?
<shevy>
hmm
<s2013>
chances are eventually if the company still survives youll have lot less than .3%
<s2013>
because of dilution. if they never have an ipo then if they get bought out
<shevy>
platzhirsch, you seem to dive in head first ;)
<s2013>
there has to be soem exit strategy
etqqkoiflwhb has quit [Ping timeout: 252 seconds]
<platzhirsch>
ah ok, if they are bought then I also get a share
<s2013>
yes
<s2013>
so if they get bought out for $100m. you get $300K assuming you still retain .3%
<platzhirsch>
ok, so I have to make sure that my work leads to that point
<s2013>
is it some fancy social media startup that makes no revenue?
<platzhirsch>
mixlr.com
sski has quit [Remote host closed the connection]
<platzhirsch>
they make revenue, have a paid plan
zigomir_ has joined #ruby
wallerdev has quit [Quit: wallerdev]
<s2013>
are they profitable?
sambao21 has quit [Quit: Computer has gone to sleep.]
<platzhirsch>
No clue at the moment
<platzhirsch>
They will, after I start
<s2013>
heh cool
etqqkoiflwhb has joined #ruby
<shevy>
lol
<s2013>
how many employees
<platzhirsch>
8-ish
<shevy>
platzhirsch deserves his nick
<s2013>
hmm .3% isnt that bad then. whats the salary offer and where are they located
<platzhirsch>
is it bad if I tell that in the channel?
<shevy>
perhaps
<horrorvacui>
I'd not mention it
pwh has joined #ruby
<shevy>
could be competition here!
testcore has joined #ruby
<horrorvacui>
Keep it between you and s2013
dkamioka has quit [Remote host closed the connection]
<horrorvacui>
Just incase :P
<shevy>
including the hot kisses
<s2013>
yeah just msg me then
<s2013>
ok
<papasierra>
horrorvacui: if i split('/') and then reassemble, i'll need to reassemble the first n-1 elements.
<horrorvacui>
papasierra: yeah thats exactly why we need to know what you intend
sambao21 has joined #ruby
<papasierra>
horrorvacui: yes, 'x/y/z' becomes 'x/y' (drop the last /element
zigomir has quit [Ping timeout: 240 seconds]
adeponte is now known as cyphactor
cyphactor is now known as adeponte
altamic has quit [Quit: altamic]
adeponte is now known as cyphactor
<shevy>
papasierra yes that is simple [0..-2]
<horrorvacui>
papasierra: well is that element variable in size? Does the element you want removed always stay 1 char?
klaut has joined #ruby
eka has quit [Quit: My computer has gone to sleep. ZZZzzz…]
Martxel has joined #ruby
<papasierra>
horrorvacui: that's irrelevant. once i "split" it's just an array, doesn't matter how many chars. it's variable in size, but must always drop the *last* element. so 'a/bbb/cccccc/d' becomes 'a/bbb/cccccc'
eka has joined #ruby
<papasierra>
shevy: i'm reading up on that now
eka has quit [Client Quit]
<papasierra>
shevy: so [0..-1] right?
<horrorvacui>
papasierra: Well you mentioned n - 1 so I thought you were saying that splitting has a O(n) or something
dkamioka has joined #ruby
diegoviola has quit [Quit: WeeChat 0.4.3]
Nogbit has joined #ruby
<shevy>
papasierra did you read what I wrote
<shevy>
because if you would have done, I wonder how you came to -1
<papasierra>
yes, i went off and read about it, then made a typo when i repeated back to you what i thought were my new learnings.
<shevy>
the [] method is fairly consistent across different ruby classes
<shevy>
you can use it on class String and class Array
jollyy has joined #ruby
<shevy>
and you can use it in your custom class via: def self.[](i)
<banister>
shevy there are men here who want to do you harm - i am the only thing between you and incredible suffering
<shevy>
papasierra ok, makes sense with that explanation :)
<papasierra>
ok i'll practice that just now (the self.[](i) thing). firstly i'll try your solution in the repl to make sure i understand it. thanks
noop has quit [Ping timeout: 240 seconds]
cherry_lin has quit [Ping timeout: 240 seconds]
<papasierra>
shevy: right, so 'x/y/z'.split('/')[0..-2].join('/') works just right. so [0..-2] means "from the 0th, to the (length-2)th", have i got it?
jottr_ has joined #ruby
nari has quit [Ping timeout: 240 seconds]
<papasierra>
[0..-1] would just do the entire array.
rvraghav93 has quit [Read error: Connection reset by peer]
Jinkins has joined #ruby
<papasierra>
and [0..0] makes no sense. i imagine that's an array containing only the 0th element
robbyoconnor has joined #ruby
<shevy>
papasierra yeah
timonv has quit [Remote host closed the connection]
jackneill has quit [Remote host closed the connection]
<shevy>
it's easiest to work on a string to understand that
<shevy>
I think that might be different in ruby 1.8.x
<neolithic>
If i use "%USERPROFILE%\.chef" as a path on WIndows do I have to run this through File.expand_path or will things that take a path figure it out?
<shevy>
can someone test the above in ruby 1.8.x?
ephemerian has joined #ruby
cherry_lin has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
rvraghav93 has joined #ruby
wuest has quit [Quit: :q]
Solnse has quit [Quit: Leaving.]
wuest has joined #ruby
m8 has joined #ruby
olivier_bK has quit [Ping timeout: 246 seconds]
mikepack has quit [Ping timeout: 255 seconds]
linuxer1_ has joined #ruby
GaryOak_ has quit [Remote host closed the connection]
DEA7TH has quit [Ping timeout: 252 seconds]
mikepack has joined #ruby
yfeldblum has quit [Ping timeout: 240 seconds]
tobago has quit [Remote host closed the connection]
alvaro_o_ has joined #ruby
pikitgb_i has joined #ruby
linuxer1 has quit [Ping timeout: 240 seconds]
kennym has quit [Quit: Leaving.]
rylev has joined #ruby
sambao21 has joined #ruby
linuxer1 has joined #ruby
supermarin_ has joined #ruby
kennym has joined #ruby
kennym has quit [Changing host]
kennym has joined #ruby
Squarepy has quit [Quit: Leaving]
linuxer1_ has quit [Ping timeout: 255 seconds]
<kbarry>
shevy: about groups
pigzzcanfly has quit [Remote host closed the connection]
<kbarry>
I need to parse the name a different way
<kbarry>
i need the non numbers between 2 pair of numbers
<kbarry>
ie nm01servername04
<kbarry>
i need "servername
zigomir_ has quit [Quit: Leaving]
jlast has quit [Remote host closed the connection]
eka has joined #ruby
<kbarry>
i know i might do something like \d{2}\w*\d{2}
phutchin1 has quit [Ping timeout: 240 seconds]
armstrjare has joined #ruby
armstrjare has quit [Max SendQ exceeded]
rylev has quit [Ping timeout: 240 seconds]
dfranciosi has quit [Remote host closed the connection]
<kbarry>
i don't evne know what its called, only that if can be done
<kbarry>
where I can essentially so soemthing like
dfranciosi has joined #ruby
pikitgb_i has left #ruby [#ruby]
<kbarry>
(\d{2})(\w*)(\d{2})
Elhu has joined #ruby
<BraddBitt>
\d\d(\w+)\d\d
<BraddBitt>
and your matching name will be the first group
<BraddBitt>
assuming a name never has a number in it
<kbarry>
Ohhhh, nice
<kbarry>
nope
<kbarry>
:)
<BraddBitt>
yeah that should work
<BraddBitt>
you can test on rubular
<kbarry>
whats the difference between \w and\D
teddyp1cker has quit [Remote host closed the connection]
<BraddBitt>
\d is digit
<BraddBitt>
\D is any non-digit
<kbarry>
ok
<kbarry>
in this case, its the same
<BraddBitt>
\w is any word
<kbarry>
OHHHHH
monkegjinni has joined #ruby
_justin has joined #ruby
<BraddBitt>
actually \w will capture numbers iirc
<BraddBitt>
\d\d(\D+)\d\d
claymore has quit [Ping timeout: 240 seconds]
<BraddBitt>
that would be better
<mary5030>
ju
<kbarry>
ok
<BraddBitt>
/\d\d(\D+)\d\d/.match(string)[1]
<BraddBitt>
will extract the name
monkegjinni has quit [Remote host closed the connection]
<Mon_Ouie>
You can use ri Regexp to see what those character classes mean exactly
Hobogrammer has quit [Ping timeout: 252 seconds]
<Mon_Ouie>
For instance, /\w/ - A word character ([a-zA-Z0-9_])
<kbarry>
.match(string)[1] or [0]
<kbarry>
and literally put "string"
Kricir has quit [Remote host closed the connection]
ascarter has joined #ruby
ascarter has quit [Max SendQ exceeded]
<BraddBitt>
isn't [0] the entire match result, disregarding groupings?
Elhu has quit [Ping timeout: 240 seconds]
<Mon_Ouie>
Yes it is
<BraddBitt>
god some fucking bot on #freenode is spam querying me
<BraddBitt>
i think itc
ascarter has joined #ruby
<kbarry>
is this a good case or scan?
<Mon_Ouie>
Also you can use string[regexp, capture_group_id]
zachallett has quit [Remote host closed the connection]
<kbarry>
a good case for scan?
<Mon_Ouie>
Do you want to iterate over all matches of the regular expression?
epichero has joined #ruby
<kbarry>
there will be only one
<Mon_Ouie>
Then no
pwh has quit []
claymore has joined #ruby
platzhirsch has left #ruby [#ruby]
mrmargolis has quit []
b00stfr3ak has joined #ruby
b00stfr3ak has joined #ruby
b00stfr3ak has quit [Changing host]
mrmargolis has joined #ruby
<mary5030>
shevy: can some check and guid me how i can conditionally destroy this active record object? it is created in line 4 and trying to remove in line 34
<shevy>
yaymukund I always include it, unless it is a project/gem
wallerdev has joined #ruby
Hobogrammer is now known as Hobogrammer
alexju has quit [Read error: Connection reset by peer]
soulcake has quit [Ping timeout: 240 seconds]
<shevy>
yaymukund that way when I look at my code, I instantly know what it refers to
alexju has joined #ruby
benzrf|offline is now known as benzrf
freerobby has joined #ruby
robert_ has joined #ruby
robert_ has quit [Changing host]
robert_ has joined #ruby
selina345 has joined #ruby
<mary5030>
jhass: i was basically trying to not roll back the part that comes after rescue
<yaymukund>
shevy: cool, that makes sense too.
<mary5030>
jhass: and shevy thank you guys anyways I think i wasn't able to explain myself well
<jhass>
mary5030: I do understand that. I'm saying that you should try to have no reason to rollback because you only should persist when you know it won't fail
<mary5030>
and that is a small part of my code from two different class that i combined in one gist
<shevy>
dgarstang there is with_index somewhere
<shevy>
I forgot where haha ... Enumerable? Enumerator?
sambao21 has quit [Quit: Computer has gone to sleep.]
neolithic has left #ruby [#ruby]
doodleha_ has joined #ruby
<shevy>
dgarstang it should not matter whether it is erb or not btw, as long as you use ruby code, it will work, in or outside of erb
paulfm has quit []
<shevy>
of course an added difficult is that erb code is almost as ugly as embedded php
<mozzarella>
HELP
<shevy>
RESCUE
<crome>
retry
<mary5030>
you mean shouldnt have to use transaction
<mary5030>
?
<shevy>
mozzarella require is very simple
<mozzarella>
is test::unit dead?
<shevy>
don't think it is dead yet
<shevy>
people like minitest
<mozzarella>
should I use minitest or test::unit?
<mozzarella>
I'm new at testing
<shevy>
I asked the same
<shevy>
6 people here said minitest
<shevy>
one guy said something else
<mozzarella>
OK
<shevy>
that was like 2 or 3 weeks ago
tomato has quit [Quit: Leaving]
<crome>
in the end it doesnt really matter
<shevy>
I think jhass said minitest
<mozzarella>
I guess I'll use minitest
<shevy>
or perhaps he was the odd one, I forgot :P
arubincloud has joined #ruby
freerobby has quit [Ping timeout: 255 seconds]
chichou has quit [Remote host closed the connection]
<mozzarella>
also
Solnse has joined #ruby
soulcake has joined #ruby
<crome>
a test framework is just like anything else, you can write a crap and mostly useless test coverage with any of them ;>
<jhass>
mary5030: you can get a long way without hitting the database in AR. The other possibility is to extend the transaction to all points that do call the database and should be reverted upon failure. Right now you seem to be half way between
<mozzarella>
I am under the impression that my ruby installation didn't come with everything… like, I had to install rake manually
<mozzarella>
isn't rake supposed to come with ruby?
davy__ has quit [Remote host closed the connection]
<jhass>
toretore: have fun getting explained by #freenode that spam is your problem
<toretore>
eh. surely the operators of a channel can choose to ban a spammer
CreativeEmbassy has quit [Quit: FO SHO]
Hanmac1 has quit [Ping timeout: 240 seconds]
<jhass>
this one won't
<centrx>
I think there is only one active op in this channel, and he says he can't ban in channel for spam sent by private message
<toretore>
but who is making that decision?
supermarin__ has quit [Client Quit]
<toretore>
apeiros: ^?
doodleha_ has quit [Ping timeout: 252 seconds]
supermarin_ has quit [Ping timeout: 240 seconds]
zommi has quit [Remote host closed the connection]
<centrx>
toretore, Yes
sailias has quit [Quit: Leaving.]
supermarin__ has joined #ruby
yubrew has quit [Remote host closed the connection]
<toretore>
no, i mean i thought apeiros could chime in himself if he wanted to
cj3kim has joined #ruby
spyderman4g63 has quit [Remote host closed the connection]
<centrx>
toretore, It might be something fflush told him, but fflush is never here now
<toretore>
if he's not making the final decision
<toretore>
ok
<toretore>
so it's out of his hands, and the guy whose hands it's in isn't here
<jhass>
I think it's his own decision
Azure has quit [Quit: My MBP went to sleep.]
obs has quit [Quit: Konversation terminated!]
Shidash has joined #ruby
claymore has quit [Quit: Leaving]
hermanmunster has quit [Ping timeout: 240 seconds]
supermarin__ has quit [Ping timeout: 255 seconds]
cj3kim has quit [Remote host closed the connection]
timonv has joined #ruby
dgaffney has quit []
relix_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
pigzzcanfly has joined #ruby
einarj has joined #ruby
dewolfe has joined #ruby
Emmanuel_Chanel has quit [Quit: Leaving]
centrx has quit [Quit: All this computer hacking is making me thirsty]
sterlingcalder has joined #ruby
wjlafrance has joined #ruby
<apeiros>
toretore: what?
centrx has joined #ruby
<dewolfe>
Hey guys can anyone tell me how to patch 1.9.3 against CVE-2014-2525 with rvm?
linuxer1_ has joined #ruby
sterlingcalder has quit [Client Quit]
<jhass>
just update your libyaml
WillAmes has joined #ruby
cj3kim has joined #ruby
feniix has joined #ruby
chrisseaton has joined #ruby
<feniix>
hello I am trying to use RSpec::Puppet::Coverage and I keep gettin this error coverage_spec.rb:1:in `block in <top (required)>': uninitialized constant RSpec::Puppet::Coverage (NameError)
aspires_ has quit []
monkegjinni has joined #ruby
<feniix>
i'd appreciate some pointer on how to look at that
evenix has joined #ruby
cj3kim has quit [Remote host closed the connection]
timonv has quit [Ping timeout: 268 seconds]
linuxer1 has quit [Ping timeout: 255 seconds]
linuxer1_ is now known as linuxer1
joast has joined #ruby
<toretore>
apeiros: we were just talking about the spammers, but my questions have been answered
wjlafrance has quit [Client Quit]
Emmanuel_Chanel has joined #ruby
Emmanuel_Chanel has quit [Max SendQ exceeded]
monkegji_ has joined #ruby
postmodern has joined #ruby
afreidah1 has quit [Ping timeout: 240 seconds]
Emmanuel_Chanel has joined #ruby
aspires has joined #ruby
monkegjinni has quit [Ping timeout: 240 seconds]
Kricir has quit [Remote host closed the connection]
joast has quit [Ping timeout: 240 seconds]
chipotle has quit [Quit: cya]
unstable has joined #ruby
zachallett has joined #ruby
kennym has quit [Quit: Leaving.]
phantummm has quit [Quit: phantummm]
davy_ has joined #ruby
phantummm has joined #ruby
phantummm has quit [Client Quit]
DrShoggoth has quit [Quit: Leaving]
matcouto has joined #ruby
supermarin__ has joined #ruby
mary5030 has quit [Remote host closed the connection]
mary5030 has joined #ruby
Joel has joined #ruby
<Joel>
array of files, any of the files might be a glob, how can I check the files exist?
robert_ has quit [Read error: Connection reset by peer]
ixti has joined #ruby
railzForDaiz has left #ruby [#ruby]
rylev has quit [Ping timeout: 252 seconds]
saarinen has quit [Quit: saarinen]
meatherly has joined #ruby
phantummm has quit [Quit: phantummm]
saarinen has joined #ruby
phantummm has joined #ruby
dkpi has quit [Read error: Connection reset by peer]
Speed has joined #ruby
michaeldeol has joined #ruby
klaut has quit [Remote host closed the connection]
teddyp1cker has joined #ruby
djbender has quit [Quit: djbender]
robert_ has joined #ruby
mercwithamouth has quit [Ping timeout: 240 seconds]
chichou has joined #ruby
yubrew has quit [Ping timeout: 240 seconds]
rahult has joined #ruby
Celm has quit []
spicerack has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
enebo has quit [Quit: enebo]
cj3kim has joined #ruby
chipotle has joined #ruby
phantummm has quit [Ping timeout: 252 seconds]
Speed has quit [Ping timeout: 240 seconds]
Celm has joined #ruby
teddyp1cker has quit [Ping timeout: 240 seconds]
SCommette has quit [Quit: SCommette]
GaryOak__ has joined #ruby
einarj has quit [Remote host closed the connection]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
f0ster` is now known as f0ster
f0ster has quit [Changing host]
f0ster has joined #ruby
kennym has quit [Quit: Leaving.]
dstynchula has quit []
riotjones has quit [Ping timeout: 255 seconds]
lolmaus has quit [Ping timeout: 252 seconds]
riotjones has joined #ruby
dr0ff has joined #ruby
geggam has quit [Remote host closed the connection]
phansch has quit [Quit: WeeChat 0.4.2]
mary5030 has joined #ruby
jrhorn424 is now known as zz_jrhorn424
mercwithamouth has joined #ruby
mary5030 has quit [Remote host closed the connection]
fabrice31 has joined #ruby
crystal77 has quit [Quit: Computer has gone to sleep.]
jobewan has quit [Quit: Leaving]
Kricir has joined #ruby
Xeago has joined #ruby
chipotle has quit [Quit: cya]
abdulsattar has quit [Ping timeout: 252 seconds]
mary5030 has joined #ruby
bilbo_swaggins has joined #ruby
zigomir has quit [Remote host closed the connection]
bilbo_swaggins has quit [Client Quit]
<Joel>
so, trying to stick with the spirit of the code I'm trying to fix, this is what I have: if missing_file = files.detect { |f| Dir.glob(f) { |fg| !File.exists?(fg) }}
zigomir has joined #ruby
george2 has quit [Remote host closed the connection]
<Joel>
The only issue in this case is if a file doesn't exist that's in files it doesn't return nil
kpshek has quit []
feniix has quit [Quit: leaving]
dblessing has quit [Quit: dblessing]
garndt has quit [Quit: Connection closed for inactivity]
rahult has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Joel>
I think detect is the issue in this case
george2 has joined #ruby
<jhass>
hm, Dir.glob(f).any? {|fg| File.exists?(fg) } I think
<dr0ff>
it return false
siwica has joined #ruby
fabrice31 has quit [Ping timeout: 268 seconds]
mercwithamouth has quit [Ping timeout: 240 seconds]
Xeago has quit [Ping timeout: 240 seconds]
<jhass>
er, !File.exists?(fg) still
<Joel>
The trick is getting back what file, if any, is missing.
linuxer1 has quit [Quit: linuxer1]
hermanmunster has joined #ruby
<dr0ff>
File.exists?(fg) || nil
rahult has joined #ruby
cj3kim has quit [Remote host closed the connection]
monkegji_ has quit [Remote host closed the connection]
ascarter has quit [Max SendQ exceeded]
rm_ has quit [Disconnected by services]
Jon30 has quit [Remote host closed the connection]
bryanculver has quit [Quit: Connection closed for inactivity]
Jon30 has joined #ruby
ascarter has joined #ruby
siwica has joined #ruby
rm__ has joined #ruby
tjr9898 has joined #ruby
aspires has joined #ruby
RealMarc is now known as Marc
joast has joined #ruby
Marc is now known as Guest746
m8 has quit [Quit: Sto andando via]
olivier_bK has quit [Remote host closed the connection]
chipotle has quit [Quit: cya]
jhass is now known as jhass|off
bricker has joined #ruby
mary5030_ has joined #ruby
osvico has joined #ruby
mercwithamouth has quit [Ping timeout: 240 seconds]
robbyoconnor has quit [Ping timeout: 268 seconds]
thrillagorilla has quit [Remote host closed the connection]
ndrei has joined #ruby
mary5030 has quit [Ping timeout: 240 seconds]
Chronocity has quit [Ping timeout: 268 seconds]
zachallett has joined #ruby
andrewlio has quit [Quit: Leaving.]
kennym has joined #ruby
dkamioka has quit [Remote host closed the connection]
sailias has joined #ruby
olivier_bK has joined #ruby
workmad3 has quit [Ping timeout: 255 seconds]
horofox_ has joined #ruby
nisstyre has quit [Quit: bai]
shinobi_one has joined #ruby
siwica has quit [Ping timeout: 240 seconds]
wallerdev has joined #ruby
tjr9898 has quit [Remote host closed the connection]
boombadaroomba has quit [Remote host closed the connection]
SCommette has quit [Quit: SCommette]
RaptorJesus has joined #ruby
apeiros has joined #ruby
mjs2600 has quit [Remote host closed the connection]
bricker_ has joined #ruby
bricker has quit [Ping timeout: 255 seconds]
siwica has joined #ruby
glide has quit [Quit: Leaving]
chipotle has joined #ruby
jorts has quit [Quit: jorts]
yubrew has joined #ruby
aspires has quit []
mercwithamouth has joined #ruby
pedrocr has left #ruby [#ruby]
supermarin___ has quit [Quit: Computer has gone to sleep.]
andy__ has quit [Remote host closed the connection]
eka has quit [Ping timeout: 268 seconds]
rylev has joined #ruby
ctp_ has joined #ruby
siwica has quit [Ping timeout: 240 seconds]
ctp has quit [Read error: Connection reset by peer]
jorts has joined #ruby
arubincloud has quit []
Jonah11_ has joined #ruby
RowdyChildren is now known as RowdyChild|Away
yubrew has quit [Ping timeout: 268 seconds]
joast has quit [Quit: Leaving.]
<Jonah11_>
say you building an array to track numbers you have already seen. when you encounter a new number, you will use the array solely to search and check if the new number is already there. is an array, hash, or some other structure fastest for this in ruby?
rylev has quit [Ping timeout: 240 seconds]
freerobby has joined #ruby
Stalkr_ has quit [Quit: Leaving...]
horofox_ has quit [Quit: horofox_]
matcouto has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ce_afk is now known as cescalante
Vovko has joined #ruby
Vovko has quit [Remote host closed the connection]
<shinobi_one>
Jonah11_: hashes are fizast
chrisseaton has quit []
<shinobi_one>
Jonah11_: how many numbers are you dealing with?
chipotle has quit [Quit: cya]
ffranz has quit [Quit: Leaving]
<Jonah11_>
shinobi_one, thousands, maybe 10k, not that many... if i use a hash, would i just be putting in keys with nil values, since i only care about key existence?
doodlehaus has joined #ruby
chipotle has joined #ruby
larissa has joined #ruby
pskosinski has joined #ruby
charliesome has joined #ruby
GaryOak__ has quit [Remote host closed the connection]
pigzzcanfly has quit [Remote host closed the connection]
supermarin___ has joined #ruby
supermarin___ has quit [Remote host closed the connection]
<kbarry>
i got the following.
supermarin___ has joined #ruby
doodlehaus has quit [Ping timeout: 240 seconds]
mary5030_ has quit [Remote host closed the connection]
eka has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
mary5030 has joined #ruby
bricker_ is now known as bricker
yfeldblum has joined #ruby
AndChat- has quit [Ping timeout: 240 seconds]
fijimunkii has quit [Ping timeout: 240 seconds]
ctp_ has quit [Ping timeout: 240 seconds]
wald0 has quit [Quit: Lost terminal]
dtcrshr has quit [Quit: Saindo]
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mehlah has joined #ruby
mary5030 has quit [Ping timeout: 240 seconds]
sski has joined #ruby
<BraddBitt>
can I create a Logger object that writes to both STDOUT as well as a specific log file?
Hanmac has quit [Ping timeout: 252 seconds]
nateberkopec has quit [Quit: Leaving...]
yfeldblum has quit [Ping timeout: 255 seconds]
predator117 has quit [Ping timeout: 268 seconds]
<lupine>
sure
<lupine>
or you could use tee
St_Marx has quit [Quit: Ex-Chat]
<BraddBitt>
how would i do it with ruby's native Logger class?
predator117 has joined #ruby
shinobi_one has quit [Quit: shinobi_one]
<lupine>
i'd tell it to log to stdout then call my-program | tee logfile. otherwise, just build an IOArray class that duplicates writes to multiple fds, and create the logger around that, I guess
Hanmac has joined #ruby
zz_jrhorn424 is now known as jrhorn424
<lupine>
you probably just need to intercept #write, I don't know offhand
mjs2600 has joined #ruby
nateberkopec has joined #ruby
St_Marx has joined #ruby
timonv has joined #ruby
shinobi_one has joined #ruby
rainmanjam has quit [Remote host closed the connection]
xcv_ has joined #ruby
Hobogrammer has quit [Quit: WeeChat 0.4.3]
joast has joined #ruby
Geniack has quit [Disconnected by services]
Geniack_ has joined #ruby
ctp has joined #ruby
xcv_ has quit [Remote host closed the connection]
pu22l3r has joined #ruby
timonv has quit [Ping timeout: 268 seconds]
xcv_ has joined #ruby
pu22l3r has quit [Remote host closed the connection]