<hamush>
hi, quick newcomer ri question, if anyone happens to know: "ri --no-gems Array" fails on my ruby setup... is that expected or is my setup probably broken?
daniel_- has joined #ruby
BSaboia has quit [Read error: Connection reset by peer]
Arzaga has joined #ruby
ariedler has quit [Remote host closed the connection]
hogeo has joined #ruby
<bean>
I hate using, ri, hamush
bricker_ has joined #ruby
<bean>
i much prefer web docs
jon_w has quit [Read error: Connection reset by peer]
bricker has quit [Read error: Operation timed out]
arya has quit [Ping timeout: 255 seconds]
tootooroo has quit [Quit: brb]
<lectrick>
bean: it's... a wrong expectation. We had a developer not realize that he was calling concat, a method that mutates its receiver, on a constant
<cupakromer>
Does anyone know if there is something special about times created via Time.now?
<cupakromer>
it doesn't seem to match times created other ways
wyhaines has quit [Remote host closed the connection]
<lectrick>
cupakromer: Yes, Time.now times are always different. /ducks
<bean>
lectrick, i can agree that its a wrong expectation :p
<majikbytes>
lectrick: what makes that array a constant?
jon_w has joined #ruby
jon_w has quit [Max SendQ exceeded]
<hamush>
bean: ri seems like it'd be much more my style if i could get it to work... those web docs on ruby-doc.org spend so much time consulting with disqus :/
<cupakromer>
lectrick :-/ t = Time.now; f = Time.at t.to_f; t == f; #==> false
jon_w has joined #ruby
jon_w has quit [Excess Flood]
<lectrick>
majikbytes: well, it's assigned in the class context, and it starts with a capital letter... and it should have been frozen, apparently... :O
jon_w has joined #ruby
<bean>
hamush, well, "gem install rdoc rdoc-data", and then "rdoc-data --install" is what the internets say, I can see if it works for me if you want
XRPTrader2 has joined #ruby
<lectrick>
cupakromer: Why would to_f'ing a time be equal to the time? That's silly
<majikbytes>
is it just a ruby thing that when you define a class and an all uppercase identifier is automatically a constant?
SirFunk has joined #ruby
nezumi has joined #ruby
<lectrick>
cupakromer: You are missing an understanding if you think that. Time.now is an object instance of Time. Time.now.to_f is a float. They cannot possibly be equal.
<hamush>
bean: thank you, i bet that's just the push in the right direction i need!
<majikbytes>
i see
<lectrick>
cupakromer: Ah wait. misreading.
<cupakromer>
lectrick I think you misread that. I'm using Time.at with the value returned from Time.now.to_f
<lectrick>
cupakromer: OK that has to do with how a time object is made from a float. Probably imprecise.
arya has joined #ruby
<majikbytes>
I have a question for the good Ruby Sirs:
<cupakromer>
lectrick it seems silly that to compare times you have to re-cast them to floats just because you used Time.now and Time.at
<majikbytes>
how does one define a constant, like in irb
jgrevich_ has joined #ruby
<majikbytes>
so you're in IRB, and you want to create a constant
<lectrick>
cupakromer: well fuck. you did find something interesting. Not sure then, man. Compare their to_f's then. :O
ShellFu is now known as ShellFu_AFK
jgrevich has quit [Ping timeout: 240 seconds]
jgrevich_ is now known as jgrevich
danman has joined #ruby
moted has quit [Ping timeout: 260 seconds]
lewix has joined #ruby
brhelwig has quit [Remote host closed the connection]
<lectrick>
cupakromer: ok now this has made me angry! Wow. Nice find. Damnit. :) The only thing that makes me angrier is that all Ruby methods that mutate receivers should end in a !. :)
<lectrick>
Because I believe that is a significant enough behavior difference to merit a syntax change :O
jonathanwallace has quit [Quit: WeeChat 0.3.9.2]
<cupakromer>
lectrick ;-p you say nice, I say head slamming into wall
<lectrick>
sorry man. :/
<cupakromer>
no worries, just glad i'm not going cray-cray
lewix_ has joined #ruby
<lectrick>
cupakromer: comparing their to_f's works. i know that's still kind of shitty tho
freeayu has joined #ruby
<lectrick>
GL
right1 has joined #ruby
nadirvardar has joined #ruby
jon_w has quit [Ping timeout: 256 seconds]
mithro-- has quit [Ping timeout: 245 seconds]
lewix has quit [Ping timeout: 240 seconds]
idkazuma has joined #ruby
timmow has joined #ruby
cyberarm has joined #ruby
Opettaja has joined #ruby
danman has quit [Quit: danman]
maletor has quit [Quit: Computer has gone to sleep.]
<ghanima>
Is there a doc out there that explains how to use the ruby class Shell... I don't see any examples(including on google) other than ruby-doc and even that doesn't really explains how to spawn a process
mhf has quit [Remote host closed the connection]
adkron has quit [Ping timeout: 256 seconds]
<ghanima>
The reason I am asking is because I am looking at someone's code who is executing a unix process by using the shell class but how they are using I can't find any reference to it, but it does work
<ghanima>
any thoughts
<ghanima>
I am usingruby 1.9
jnoob22 has joined #ruby
jumpei has quit [Remote host closed the connection]
drale2k has quit [Quit: Leaving...]
ariedler has joined #ruby
marcdel has joined #ruby
Michael__ has joined #ruby
danman has joined #ruby
danman has quit [Client Quit]
<JamieJ>
can any one help me wit that problem?
Michael__ has quit [Remote host closed the connection]
arya has quit []
Michael__ has joined #ruby
kristofers has quit []
havenwood has quit [Remote host closed the connection]
gabrielrotbart has quit [Read error: Connection reset by peer]
havenwood has joined #ruby
ner0x has joined #ruby
<lewix>
JamieJ: do you want output the result on a file
gabrielrotbart has joined #ruby
huoxito has joined #ruby
havenn_ has joined #ruby
havenwood has quit [Read error: Connection reset by peer]
daniel_- has quit [Ping timeout: 264 seconds]
bricker_ is now known as bricker
<JamieJ>
no just produce the output on the command prompt
tomsthumb has quit [Quit: Leaving.]
<lewix>
JamieJ: what do you want to do then
<JamieJ>
lewix: for the code to work, the program needs 3 values from the user. i want to make it where they can read those three values from an input.
<JamieJ>
instead of the user
<JamieJ>
lewix: how would i format the input file to do this?
<lewix>
oh
mando has joined #ruby
<lewix>
JamieJ: you could just type 3 value on three different lines
<lewix>
and File.readlines("input.txt")
MehLaptop has joined #ruby
etcetera has quit []
Nuck has quit [Ping timeout: 258 seconds]
pioz has quit [Quit: This computer has gone to sleep]
Nuck has joined #ruby
robscomputer_ has quit [Remote host closed the connection]
headius has quit [Quit: headius]
<JamieJ>
ok
quazimodo has quit [Ping timeout: 255 seconds]
<JamieJ>
lewix: and besides that read command, i wouldnt have to alter the program. currently it loops and ask the user if they wanna get another item
dqminh has joined #ruby
chrisnicola has joined #ruby
memborsky has quit [Read error: Connection reset by peer]
memborsky has joined #ruby
hashmal has quit [Quit: Computer has gone to sleep.]
twoism has quit [Remote host closed the connection]
<cuemin>
I'm familiar with the overview of software testing; does this go over the whole 'spec' vs 'unit test' thing?
bricker`LA has joined #ruby
Michael__ has quit [Remote host closed the connection]
ibash has joined #ruby
freeayu has joined #ruby
sailias has joined #ruby
Michael__ has joined #ruby
<bean>
i don't think so, I've never heard of it being called "spec testing"
<[Neurotic]>
do you mean TDD vs BDD?
<tubbo>
cuemin: just the expectation vs. assertion syntax?
<bean>
i bet thats what he means, tubbo
<cuemin>
yes
<tubbo>
it's really just 2 ways of saying the same thing, though the philosophy of BDD is way different from the philosophy of TDD
<tubbo>
i reckon you could do both in rspec though
<cuemin>
basically, why they have the two different syntaxes to do the same thing (more or less)
<tubbo>
cuemin: choice. do you like beef?
<tubbo>
do you also like steak?
<tubbo>
actually that's a bad example HAHA
tootooroo has quit [Ping timeout: 260 seconds]
<cuemin>
ah, I think I see what you're trying to say...
bricker`1A has quit [Ping timeout: 245 seconds]
<tubbo>
anyway, the point is it's good because there's choice. you can write in expectation syntax and i'll write in assertion syntax and we'll be happy :)
MissionCritical has quit [Ping timeout: 258 seconds]
<tubbo>
cuemin: ruby is a language of choices. test syntax is not the only time you'll be making quite arbitrary decisions for your code
<cuemin>
ah okay, thank you. I was hoping to write in assertion style, but I can't find a minitest extention to deal with eventmachine in assertion style
<tubbo>
cuemin: uhh, minitest does asserts by default
<cuemin>
oh I'm aware, but there's no plugin for MiniTest::Unit::TestCase that will handle eventmachine; only MiniTet::Spec
bricker`LA has quit [Ping timeout: 276 seconds]
tjohnson has joined #ruby
Myconix has quit [Quit: Leaving.]
<tubbo>
cuemin: why do you need a plugin to handle it?
wsterling has joined #ruby
<cuemin>
EventMachine requires the reactor is running for EM classes to run
Michael__ has quit [Read error: Connection reset by peer]
<tubbo>
cuemin: can't you start the reactor in the setup block?
<johnjohn1011>
is ruby 2.0 faster than 1.93?
<tubbo>
johnjohn1011: no it makes your computer shit out dinosaur babies
<cuemin>
no, you can't, because the EM code has to be within the EM.run {} block
<tubbo>
and then what do you have
<tubbo>
a problem, that's what
<tubbo>
a BIG problem.
lewix has joined #ruby
Michael__ has joined #ruby
<tubbo>
cuemin: curses!
kofno has joined #ruby
<lewix>
Jami: did you fix it
<tubbo>
cuemin: well perhaps you could fork the code and write handlers that work in TestCase?
<cuemin>
yeah! oh well, maybe I can just wrap the entire spec in EM.run
timeout has quit [Ping timeout: 264 seconds]
<cuemin>
I think that's what I'll be doing
<johnjohn1011>
nice tubbo
<tubbo>
cuemin: check out the source, it could be as simple as `include EventMachine::TestCaseExtensions`
<tubbo>
johnjohn1011: ;D
r0bby has joined #ruby
<tubbo>
johnjohn1011: it *should* be faster in some areas but http://ruby-lang.org/ and the changelog of Ruby will help you solve that problem. also, i think there are some rubyconf talks on youtube about how ruby 2.0 improves some stuff like GC or something
<tubbo>
i dunno though i haven't watched one of the talks fully yet
<johnjohn1011>
was looking to see if i could get it on my ubuntu 12.04.
<cuemin>
haha holy crap it does exactly that, just wraps the test in a block
<cuemin>
a EM.run block that is
lupine has quit [Excess Flood]
bricker`LA has joined #ruby
<johnjohn1011>
i see there is a ruby rvm. what is that?
io_syl_ has quit [Read error: Operation timed out]
<cuemin>
rvm is ruby version manager
<bean>
it is /not/ recommended by many people here
<cuemin>
it's a tool to manage multiple versions of ruby/set of ruby gems on the same computer
<cuemin>
woah woah woah, rvm isn't some godly tool here?
eka has quit [Quit: Computer has gone to sleep.]
<cuemin>
why not?
* lewix
uses rvm like everybody else
<bean>
no, i can't say i'm a fan
shevy has joined #ruby
<johnjohn1011>
wow, highly recommended.
<cuemin>
so is that most people or just you?
<waxjar>
rbenv :3
Opettaja has quit [Quit: WeeChat 0.4.0]
<johnjohn1011>
i can uninstall 1.9.3 but not sure how to get 2.0 on machine
nezumi has quit [Ping timeout: 260 seconds]
<cuemin>
'rvm install ruby-2.0.0' should do it if you're using rvm
Nisstyre-laptop has quit [Quit: Leaving]
<johnjohn1011>
so leave 1.9.3, make sure rvm is installed and then run that command?
lupine has joined #ruby
<cuemin>
yeah, it'll deal with the system ruby when you install rvm
<bean>
yeah if you ever want to use system ruby, when you're in rvm
<bean>
you just "rvm use system"
BSaboia has quit [Ping timeout: 252 seconds]
* bean
uses homebrew install of ruby on a mac
<bean>
aka "brew install ruby"
dallasm_ has joined #ruby
<waxjar>
can you run multiple versions that way bean?
<cuemin>
ah, mac, that's why you don't prefer rvm :P
<bean>
thats likley, cuemin
<bnagy>
rvm is awful
<bnagy>
they do not even unix, bro
<cuemin>
works pretty well for linux, IMO
<bean>
one of my coworkers like chruby i think
<bnagy>
cuemin: by 'well' you mean overrides cd, is super slow, and start out by asking you to pipe curl into bash?
<tjohnson>
any recommendations for testing command line utils? rspec + `?
<waxjar>
i read rvm messes with your cd and sudo, i don't like that idea
<bnagy>
and, and needs crazy .profile modifications
radic_ has quit [Ping timeout: 246 seconds]
MissionCritical has joined #ruby
<bnagy>
it's just Bad.
<cuemin>
the bash integration is actually pretty useful for my dev machine, but I agree that the curl | bash is sketchy
<bnagy>
rbenv is ok but chruby is apparently the new hotness
<bnagy>
rbenv is pretty damn simple, though, so that's what I still use
ckrailo has joined #ruby
ibash has quit [Remote host closed the connection]
<bnagy>
depends if you want gemsets and frippery and if you don't know how to compile without someone holding your hand
<johnjohn1011>
how do i use rbenv?
<bnagy>
johnjohn1011: just go to their github and follow the instructions
Nisstyre-laptop has joined #ruby
<waxjar>
i use rbenv, it's pretty great. but i think i'd go with chruby if i did a fresh install now
<bnagy>
johnjohn1011: if you don't really have to, installing rubies as a user account is much less likely to lead to pain
<johnjohn1011>
i really like the ruby language but after i did my 5 or so ironruby utilities, I never touched it again
KingofMars has left #ruby ["Leaving"]
<bnagy>
as opposed to systemwide
<bean>
*shudder* ironruby
<johnjohn1011>
so have different logins for each user acct
cyong has joined #ruby
<johnjohn1011>
bean: it wasn't that bad. a bit slow to start but usable
<bnagy>
no, one account can flip between rubies, that's the idea
<johnjohn1011>
ok
Rumsteak has joined #ruby
NiteRain has joined #ruby
sayan has joined #ruby
chrishough has joined #ruby
<bnagy>
johnjohn1011: if you want Windows support then you should probably check out jruby
<bnagy>
I mention this only because you said ironruby :P
<Rumsteak>
bradleyprice has joined #ruby
<johnjohn1011>
it had potential. not sure why the project ended
ixti has quit [Quit: WeeChat 0.4.0]
<bnagy>
I think some of the core guys were at MS and the got unfunded
<bnagy>
but that's just rumour
<johnjohn1011>
i had ideas of shipping a c# app and having screens as ironruby so that you ddin't have to compile the whole app to fix for a module
dhruvasagar has quit [Ping timeout: 256 seconds]
nezumi has joined #ruby
<johnjohn1011>
yeah defunded would kill any project.
beneggett has quit [Quit: Computer has gone to sleep.]
<bnagy>
anyway afaik jruby is the only real option on modern (x64) windows
robscomputer_ has joined #ruby
hassans has quit [Quit: hassans]
Rumsteak has quit [Client Quit]
newtonianb has quit []
<johnjohn1011>
any serious development in gtk or qt or wx? or is it all rails and sinatra
MissionCritical has quit [Ping timeout: 256 seconds]
robscomputer_ has quit [Remote host closed the connection]
<bnagy>
I think Hanmac1 does wx stuff
shevy has quit [Ping timeout: 245 seconds]
robscomputer_ has joined #ruby
<bnagy>
but it's c++ bindings, I think, ask him when he waked up
<bnagy>
*wakes
Rumsteak has joined #ruby
<bnagy>
and I don't know where Shoes is up to, but I hear it's still kicking, so to speak
radic has joined #ruby
<bean>
theres redshoes and greenshoes
<bean>
i think
<johnjohn1011>
seems to have a lot of user defined specs in the language ( can't remember what it's called)
<johnjohn1011>
seriously red and green shoes.
<bean>
ah
<bean>
blue_shoes
<bean>
not red
c0rn has quit [Quit: Computer has gone to sleep.]
<bean>
green shoes is a thing though
idkazuma has joined #ruby
<johnjohn1011>
ok DSL
gabrielrotbart has joined #ruby
<johnjohn1011>
love the story of blue shoes
chrishough has quit [Quit: chrishough]
Skofo has joined #ruby
tomzx_mac has quit [Ping timeout: 245 seconds]
celestius has joined #ruby
nomadicoder has quit [Quit: Leaving]
dhruvasagar has joined #ruby
wsterling has quit [Remote host closed the connection]
<bean>
re:ironruby: "In late 2010, Microsoft let go Jimmy Schementi, one of two remaining members of the core team and stopped funding the project." = The project was abandoned.
<johnjohn1011>
well it was on .net
sambio has quit []
cyberarm has quit [Quit: Bye]
emocakes has quit [Quit: emocakes]
emocakes has joined #ruby
emocakes has quit [Client Quit]
jnoob22_ has joined #ruby
wsterling has joined #ruby
Mission-Critical has joined #ruby
shevy has joined #ruby
jnoob22__ has joined #ruby
rupee has quit [Quit: Leaving]
<johnjohn1011>
i like the ruby world. lots of differnt tools and such
idkazuma has quit [Remote host closed the connection]
ckrailo has quit [Quit: Computer has gone to sleep.]
jnoob22 has quit [Ping timeout: 256 seconds]
pitzips has quit [Quit: Leaving]
jrajav has joined #ruby
jumpei has joined #ruby
end_guy has joined #ruby
jnoob22_ has quit [Ping timeout: 256 seconds]
jumpei has quit [Remote host closed the connection]
rdev5 has quit [Quit: Leaving...]
anonymuse has joined #ruby
jumpei has joined #ruby
JamieJ has joined #ruby
rickruby has joined #ruby
mattbl has joined #ruby
Michael__ has quit [Remote host closed the connection]
akam-it has joined #ruby
tommyvyo has quit [Quit:]
rdev has joined #ruby
Mission-Critical is now known as MissionCritical
Ontolog has joined #ruby
Guedes0 has quit [Read error: Connection reset by peer]
r0bby has quit [Ping timeout: 256 seconds]
dagnachew has joined #ruby
dagnachew has quit [Client Quit]
mithro-- has joined #ruby
tootooroo has quit [Read error: Connection reset by peer]
dagnachew has joined #ruby
bradleyprice has quit [Remote host closed the connection]
banister_ has joined #ruby
banisterfiend has quit [Read error: Connection reset by peer]
dagnachew has quit [Client Quit]
jeebster has quit [Quit: Leaving.]
ehellman has quit []
kofno has quit [Remote host closed the connection]
justsee has quit [Ping timeout: 256 seconds]
apok has quit [Quit: apok]
dallasm_ has quit [Ping timeout: 256 seconds]
c0rn has joined #ruby
banister_ has quit [Read error: Connection reset by peer]
banisterfiend has joined #ruby
chandankumar has joined #ruby
c0rn has quit [Client Quit]
kofno_ has joined #ruby
MehLaptop has quit [Remote host closed the connection]
baroquebobcat has joined #ruby
tootooroo has joined #ruby
rdev is now known as rdev5
jumpei has quit [Remote host closed the connection]
jonahR has quit [Quit: jonahR]
dagnachew has joined #ruby
jumpei has joined #ruby
ner0x has quit [Quit: Leaving]
chrishough has joined #ruby
tjohnson has quit [Ping timeout: 252 seconds]
tjohnson has joined #ruby
jeebster has joined #ruby
arya has quit [Ping timeout: 252 seconds]
sailias has quit [Quit: Leaving.]
jbueza has joined #ruby
chessguy has quit [Remote host closed the connection]
zeroeth has joined #ruby
mercwithamouth has quit [Ping timeout: 256 seconds]
akam-it has quit [Remote host closed the connection]
dagnachewa has joined #ruby
mercwithamouth has joined #ruby
etcetera has joined #ruby
arya has joined #ruby
dqminh has joined #ruby
dqminh has quit [Remote host closed the connection]
sayan has quit [Read error: Connection reset by peer]
v0n has joined #ruby
Ontolog has quit [Remote host closed the connection]
dhruvasagar has quit [Read error: Connection reset by peer]
RORgasm has joined #ruby
cuemin has quit [Quit: Leaving]
freeayu has quit [Ping timeout: 276 seconds]
arya has quit [Ping timeout: 245 seconds]
dhruvasagar has joined #ruby
etcetera has quit []
SCommette has joined #ruby
RORgasm has quit [Ping timeout: 240 seconds]
Beoran__ has joined #ruby
etcetera has joined #ruby
reset has quit [Ping timeout: 256 seconds]
arya has joined #ruby
<shevy>
guys
<shevy>
for your directories in bash, on linux, what colour do you use?
<shevy>
I am asking because I use ansi colour codes in ruby soon, and I want to have the same colours in my .rb script
<shevy>
I use blue right now...
d3 has joined #ruby
freeayu has joined #ruby
rippa has joined #ruby
wsterling has quit [Remote host closed the connection]
Beoran_ has quit [Ping timeout: 246 seconds]
jumpei has quit [Remote host closed the connection]
ghanima has quit [Quit: Leaving.]
jumpei has joined #ruby
crackfu has quit [Remote host closed the connection]
<DesertFoxATX>
that doesn't answer why you are asking.
crackfu has joined #ruby
<shevy>
DesertFoxATX let's say you have a directory like "/tmp/foo/"
<shevy>
and you want to display a message such as:
<shevy>
"Asking to confirm the removal of directory /tmp/foo: [y/n]"
<shevy>
hmm. if the user uses yellow for this... and I display green ... it's annoying for the user
dagnachew has quit [Read error: Connection reset by peer]
r0bby has joined #ruby
indyrl has quit [Quit: Leaving.]
<DesertFoxATX>
Thats a assumption.
crackfu has quit [Ping timeout: 256 seconds]
<DesertFoxATX>
And thiats not a programming question, more a design and marketing.
reset has joined #ruby
Hanmac has quit [Ping timeout: 248 seconds]
<JamieJ>
ugh (RAAAAAAAAAAAAAAAAAGE)
fridim has quit [Ping timeout: 246 seconds]
<bnagy>
shevy: get the users term colours :)
r0bby_ has joined #ruby
<bnagy>
I use no colours at all, and it irritates me when programs do ;)
r0bby has quit [Ping timeout: 256 seconds]
<RubyPanther>
shevy: I use term-ansicolor gem
<DesertFoxATX>
bnagy, ++
Fuzai has joined #ruby
Nisstyre-laptop has quit [Quit: Leaving]
hiyakashi has joined #ruby
<shevy>
bnagy oh? that is possible?
<RubyPanther>
I agree no colors in a cli, but colors are awesome in logs especially ones you keep open with tail -f
<shevy>
bnagy, yeah, I can totally understand that point of view
<shevy>
DesertFoxATX when uthers use my scripts then for sure it is an important question, but just for you I'd code in bright pink colours :P
<shevy>
oops. *others
<DesertFoxATX>
rainbow or gtfo
<DesertFoxATX>
i want my eyes to bleed when i read output.
<DesertFoxATX>
as neon as you can get them.
<shevy>
haha, if only I could blink you with it
sayan has joined #ruby
<shevy>
it was my favourite html tag
<RubyPanther>
I usually don't consume output, but when I do I like it rainbow or gtfo
<RubyPanther>
shevy, ansi colors do have blink
<DesertFoxATX>
RubyPanther, anything that has logs that i care about im probably going to have another system managing that
ngoldman has joined #ruby
<DesertFoxATX>
instead of trying to build up my own notificaiton/monitoring junk, reinventing the wheel and what not.
generali_ has joined #ruby
<RubyPanther>
I don't think some abstract "other system" being involved, if it is in management or implementation, is going to reduce the utility of tail -f or of shell colors there
jumpei has quit [Remote host closed the connection]
<RubyPanther>
I'd go the other way and say that using standard tools you can add color with ANSI codes specifically _without_ reinventing the wheel, and any extra other "system" managing logs is going to be the re-invention
<DesertFoxATX>
Sure, and it ultimiately will come down to the dev designing it, just stating my opinion and way of doing things.
<RubyPanther>
It keeps the colors just as part of the data that you choose to log
jumpei has joined #ruby
mattbl has quit [Quit: This computer has gone to sleep]
zeroeth has quit [Ping timeout: 264 seconds]
regedarek has quit [Ping timeout: 260 seconds]
dqminh has joined #ruby
io_syl has joined #ruby
jpfuentes2 has quit [Quit: Computer has gone to sleep.]
gabrielrotbart has quit [Read error: Connection reset by peer]
mattbl has joined #ruby
jumpei has joined #ruby
kofno_ has quit [Remote host closed the connection]
lewix_ has joined #ruby
justsee has joined #ruby
gabrielrotbart has joined #ruby
regedarek has joined #ruby
<lewix_>
xll11: gets.to_i is enought
kofno has joined #ruby
<lewix_>
enough* you don't need chomp
lewix has quit [Disconnected by services]
generali_ has quit [Remote host closed the connection]
lewix_ is now known as lewix
lewix has quit [Changing host]
lewix has joined #ruby
crackfu has quit [Remote host closed the connection]
crackfu has joined #ruby
a_a_g has quit [Quit: Leaving.]
<waxjar>
xll11: consider making a Movie object and setting options on that (let it do the validation for you), give it an export method that gives you an object that you can pass to CSV.
justsee has quit [Ping timeout: 240 seconds]
jrajav has quit [Quit: I tend to be neutral about apples]
kofno has quit [Ping timeout: 256 seconds]
<xll11>
like, movie add etc?
<xll11>
Movie.add
regedarek has quit [Ping timeout: 245 seconds]
jumpei has quit [Remote host closed the connection]
bonty_ssh has quit [Remote host closed the connection]
tootooroo has joined #ruby
arya has joined #ruby
<Hanmac1>
tent405: line 16, use .sort_by {|o| o[0].id}
<tent405>
thank you I will try that
ananthakumaran has joined #ruby
<Hanmac1>
tent405: but the error is in line 3, remove the " out" there
gabrielrotbart has quit [Remote host closed the connection]
<tent405>
yeah i don't know much about ruby but that looked quite weird
<tent405>
a semicolon? a variable init?
nadirvardar has joined #ruby
dqminh has quit [Ping timeout: 256 seconds]
<Hanmac1>
tent405: at this place its non of them, its invalid ruby
Mattykins has joined #ruby
rickruby has joined #ruby
aganov has joined #ruby
matayam has quit [Remote host closed the connection]
<lewix>
shevy: lol
etcetera has joined #ruby
Loaft has joined #ruby
<lewix>
shevy: i was saying that this is the worst time to learn rails; all the books are outdated and it's such a pain to keep up. I can only rely on the only doc
hamakn has quit [Remote host closed the connection]
<tent405>
hmm, Hanmac1 i'm still getting syntax error, unexpected tIDENTIFIER, expecting keyword_end [... ] 2013-04-05T05:49:54+00:00 app[web.1]: FCSV.generate(:encoding => 'u') out do |csv|
<tent405>
maybe there is an 'end' missing further on in the program?
perun_ has joined #ruby
<Hanmac1>
tent405: i said remove it, so "(:encoding => 'u') out do |csv|" into "(:encoding => 'u') do |csv|"
etcetera has quit [Client Quit]
<shevy>
lewix I always hated the rails book. and when I tried to install rails via bundler, bundler exploded into my face. since that day, I stopped caring about wanting to learn it
carraroj has joined #ruby
<lewix>
lol
<lewix>
shevy: so wait you dont know rails?
<tent405>
omg Hanmac1 thanks you very much lots, that was a silly error
<tent405>
i need to brush up on my intermediate syntax a bit more obviously
jurassic has quit [Quit: jurassic]
tagrudev has joined #ruby
pygmael has joined #ruby
RORgasm has joined #ruby
headius has joined #ruby
dmiller1 has quit [Ping timeout: 256 seconds]
thinkclay has quit [Quit: Leaving.]
tent405 has left #ruby [#ruby]
DesertFoxATX has quit [Read error: Connection reset by peer]
hemanth has quit [Read error: Connection reset by peer]
DesertFoxATX has joined #ruby
nyuszika7h has quit [Excess Flood]
hemanth has joined #ruby
aarkerio has quit [Quit: Leaving]
nadirvardar has quit [Quit: Computer has gone to sleep.]
cantonic is now known as cantonic|away
RORgasm has quit [Ping timeout: 255 seconds]
nyuszika7h_ has joined #ruby
yashshah has quit [Remote host closed the connection]
<shevy>
lewix I know a bit, I made a tutorial from one book, had things working back then in sqlite
<shevy>
made/worked through
yashshah has joined #ruby
shock_one has joined #ruby
perun_ has quit [Ping timeout: 276 seconds]
pygmael has quit [Quit: pygmael]
pygmael has joined #ruby
headius has quit [Quit: headius]
rosster has quit [Ping timeout: 248 seconds]
ElderFain has joined #ruby
<ElderFain>
I currently have two apps on the same server talking to each other via curb/curl bindings. I'm trying to read up on the difference between a request via curl, vs a socket connection to each other
<ElderFain>
but my google is failing me, or I'm not really thinking of the question properly
jdunck has joined #ruby
jurassic has joined #ruby
<Hanmac1>
ElderFain: #rubyonrails
<RubyPanther>
ElderFain: I would start at "OSI network model" (even if it is not strictly used)
<ElderFain>
these aren't rails apps =p
<shevy>
RubyPanther is finally back
<RubyPanther>
note that neither curl nor sockets have anything do with rails
<RubyPanther>
I was here the whole time :)
rosster has joined #ruby
<ElderFain>
nginix serves these two apps off different routes, /app1/ & /app2/
<ElderFain>
i just feel silly from app1 saying curl.get(127.0.0.1/app2/my_data)
brhelwig has quit [Remote host closed the connection]
brhelwig has joined #ruby
<ElderFain>
RubyPanther: okay, layer 5 vs layer 7
Pochacco has joined #ruby
<Hanmac1>
the most failures are in layer 8 and beyond
<ElderFain>
developer & user? =)
<RubyPanther>
I usually use the GET script that comes with Perl lwp-download instead of CURL
<RubyPanther>
ElderFain: what exactly about it seems silly?
<ElderFain>
so if I open a socket to 127.0.0.1:443 its not going to help me much, because the data I need is behind :443/app2/my_data and I cannot make a 'socket' connection to that
kaffepanna has quit [Quit: Changing server]
rickruby has quit [Remote host closed the connection]
tvw has joined #ruby
<RubyPanther>
ElderFain: yeah you'd have to implement HTTP. Or, you oculd require "open-uri" and then just pass the url to Ruby's open() and #read your data back. Or use Net::HTTP
kaffepanna has joined #ruby
<RubyPanther>
Personally I always prefer to use Ruby's stdlib to an external tool
i_s has joined #ruby
<ElderFain>
well Im already using curb
<ElderFain>
so I'm not sure in the value in going backwards to open-air or net::http
brhelwig has quit [Ping timeout: 245 seconds]
<ElderFain>
open-uri
yacks has joined #ruby
toekutr has joined #ruby
<ElderFain>
actually, i think it seems fine now
<ElderFain>
RubyPanther: well, in order to get rack to bypass auth for a local request
<ElderFain>
it checks to see if the request comes from its own IP address
<ElderFain>
which seems a bit eh
<RubyPanther>
Seems a reasonable default, the scenario where you have hostiles on the same host is very rare these days thanks to VMs
IceDragon has quit [Quit: Space~~~]
dankest has joined #ruby
Vainoharhainen has joined #ruby
<JamieJ>
hey ppl
<JamieJ>
ruby doesnt seem as bad....but as some of you all see i need some practice
<JamieJ>
any of you recommend any sites where i can do practice programs?
arya has quit [Ping timeout: 276 seconds]
mattbl has quit [Quit: This computer has gone to sleep]
<ElderFain>
JamieJ: the ruby quiz
<ElderFain>
has tons & tons of "practice" programs
<ElderFain>
its up to #234 so..
Elhu has joined #ruby
<ElderFain>
lots to start from =)
jumpei has quit [Remote host closed the connection]
grzywacz has joined #ruby
hamakn has joined #ruby
tomsthumb has quit [Quit: Leaving.]
arya has joined #ruby
angusiguess has quit [Ping timeout: 256 seconds]
saimaz has joined #ruby
pygmael has left #ruby [#ruby]
kofno has joined #ruby
dmiller1 has joined #ruby
zigomir has joined #ruby
markalanevans has quit [Quit: markalanevans]
HecAtic has joined #ruby
nomenkun has joined #ruby
rickruby has joined #ruby
arietis has joined #ruby
kofno has quit [Ping timeout: 256 seconds]
dmiller1 has quit [Ping timeout: 246 seconds]
arya_ has joined #ruby
Morkel has joined #ruby
brhelwig has joined #ruby
arya has quit [Ping timeout: 240 seconds]
sayan has joined #ruby
quazimodo has joined #ruby
Matt has joined #ruby
tsipanov has joined #ruby
Matt is now known as Guest41870
chandankumar has joined #ruby
nomenkun has quit [Remote host closed the connection]
JamieJ has quit [Quit: Page closed]
arturaz has joined #ruby
pduin has joined #ruby
tylersmith has quit [Quit: tylersmith]
arya_ has quit [Ping timeout: 264 seconds]
zeroeth has quit [Ping timeout: 252 seconds]
rosster has quit [Ping timeout: 256 seconds]
idkazuma has joined #ruby
puppeh has joined #ruby
tsipanov has quit [Remote host closed the connection]
tootooroo has quit [Read error: Connection reset by peer]
tsipanov has joined #ruby
haxrbyte has joined #ruby
arya has joined #ruby
rosster has joined #ruby
i_s has quit [Quit: i_s]
chandankumar has quit [Ping timeout: 240 seconds]
filipe has joined #ruby
chandankumar has joined #ruby
ElderFain has quit [Quit: ElderFain]
kemist has quit [Quit: Computer has gone to sleep.]
vlad_starkov has joined #ruby
Hanmac1 has quit [Ping timeout: 264 seconds]
vlad_starkov has quit [Remote host closed the connection]
Elhu has quit [Quit: Computer has gone to sleep.]
marcdel has quit []
quazimodo has quit [Ping timeout: 252 seconds]
vlad_starkov has joined #ruby
jnoob22__ has quit [Remote host closed the connection]
brhelwig has quit [Ping timeout: 255 seconds]
chandankumar has quit [Ping timeout: 245 seconds]
dhruvasagar has quit [Ping timeout: 264 seconds]
beiter has joined #ruby
rezzack1 has joined #ruby
dhruvasagar has joined #ruby
akemrir has joined #ruby
x0F has joined #ruby
<shevy>
dumdedum
<shevy>
bored bored bored
JohnBat26 has joined #ruby
<shevy>
I dont wanna code anymore
<shevy>
I just want to create
rezzack has quit [Ping timeout: 256 seconds]
quazimodo has joined #ruby
monkegjinni has joined #ruby
monkegjinni has quit [Remote host closed the connection]
monkegjinni has joined #ruby
Hanmac has joined #ruby
rickmasta has joined #ruby
monkegjinni has quit [Read error: No route to host]
monkegjinni has joined #ruby
monkegjinni has quit [Remote host closed the connection]
pupoque has quit [Quit: This computer has gone to sleep]
agarie has quit [Remote host closed the connection]
monkegjinni has joined #ruby
mafolz has joined #ruby
marcdel has joined #ruby
<Hanmac>
banisterfiend: thank you for your decorate function, it inspirate me for my own overwrite method ... do you want to see it? (shevy you too?)
<shevy>
yeah
haxrbyte_ has joined #ruby
francisfish has joined #ruby
mercwithamouth has quit [Ping timeout: 245 seconds]
camilasan has quit [Remote host closed the connection]
rippa has quit [Ping timeout: 240 seconds]
luckyruby has quit [Remote host closed the connection]
kofno has quit [Ping timeout: 256 seconds]
joshu has quit [Remote host closed the connection]
slainer68 has quit [Ping timeout: 256 seconds]
Michael__ has quit [Remote host closed the connection]
yshh has joined #ruby
luckyruby has joined #ruby
BSaboia has quit [Ping timeout: 256 seconds]
benlieb has joined #ruby
tsipanov has quit [Remote host closed the connection]
dhruvasagar has quit [Ping timeout: 256 seconds]
yshh has quit [Remote host closed the connection]
dhruvasagar has joined #ruby
spooner_ has joined #ruby
carraroj has joined #ruby
tsipanov has joined #ruby
drale2k has joined #ruby
<moshef>
I'm calling a file and getting classname is not a class (type error)
<moshef>
the file itself is a class but I used in the past the same file as module
<moshef>
is this the reason for conflict? when I open the file itself (where i see the error) i see the correct code and its indeed a class
monkegjinni has joined #ruby
havenwood has joined #ruby
ggVGc has joined #ruby
bonty_ssh has quit [Remote host closed the connection]
<lupine>
moshef, if you've previously done class ::Foo ; end you cannot reopen it by doing module ::Foo ; end
<lupine>
(and vice-versa)
<lupine>
the class / module keyword must be the same each time
<moshef>
so i have to use a different name?
<moshef>
its
<moshef>
i'm speaking about 1 day ago
<moshef>
not current
sepp2k has quit [Remote host closed the connection]
<lupine>
that would work too
<moshef>
meaning? i need to rename the new class?
Astralum is now known as __KGB__
<lupine>
class ::Foo ; end module ::Bar ; end won't conflict
<moshef>
but then ill have to call foo::bar all the time instead of bar
<moshef>
no?
<lupine>
anyway, it's too easy to screw things up if you start using ambiguous class names. I try to avoid it
br4ndon has joined #ruby
<moshef>
yeah, my thought too
<lupine>
moshef, no, in the example, you'd have a class classed ::Foo, and a separate module called ::Bar
<moshef>
yeah just saw that i was mistaken
<moshef>
whats the foo for?
<lupine>
if you have a module, module, module, class hierarchy, you can include the module to get unqualified access to the class, of course
<moshef>
i do need a class not a module
havenwood has quit [Ping timeout: 245 seconds]
<moshef>
no i just have a class and thats all
<lupine>
moshef, I was just trying to put together a minimal example that duplicates the problem you described
<moshef>
but then i end up with a module
<lupine>
"I used in the past the same file as module"
<moshef>
i'd expect to do the other way - class within module
<moshef>
no?
Ortuna has joined #ruby
<shevy>
moshef you can also put a class inside a class
<lupine>
or a module inside a class
<moshef>
I know
<shevy>
class Foo; class Bar
jnoob22 has joined #ruby
<shevy>
Foo::Bar.new
<moshef>
i've been told its not wise to have class within class
<lupine>
when you're using modules for namespacing, then you don't, because it's evil
<lupine>
but when you have an internal class, it makes perfect sense
<shevy>
moshef, it depends, if you need to do Foo.new, then this example is more useful
<shevy>
problem is in ruby, modules are crippled classes :(
<moshef>
yeah I'd have to do Foo.new
<shevy>
one advantage you have with a module is that you can include it
<shevy>
but personally, I think this distinction is really arbitrary, dunno why matz made it that way
[eDu] has quit [Quit: [eDu]]
<shevy>
it annoys me when people use a main class namespace :\
<shevy>
lupine, admit it... you are one of those evil guys who use classes as main namespace
<lupine>
shevy, nope, not me
<shevy>
hmm ok then it was apeiros hah!
soulofpeace has quit [Ping timeout: 256 seconds]
<lupine>
although I have a number of projects inherited from my boss that started off as a single class, ~2000 lines
<shevy>
in ruby?
<lupine>
yeah
<shevy>
that's a rather big class
<lupine>
what I've been doing is splitting them up into littler classes and having the main class construct object trees with them
Morkel has quit [Quit: Morkel]
davetherat has quit [Remote host closed the connection]
<lupine>
but you end up with Class MyMainClass ; include ModularMyMainClass ; end ; module MyMainClass ; class MyMainClassFunctionA ; end
<shevy>
my current record is a class with 2738 lines (but including empty lines and comments)
davetherat has joined #ruby
fixl has quit [Remote host closed the connection]
<shevy>
hehe yeah
brhelwig has joined #ruby
<lupine>
until you've completely decomposed the massive class, it's an awkward class-in-class hierarchy
<apeiros>
shevy: it wasn't me!</shaggy>
pi3r has quit [Ping timeout: 256 seconds]
<shevy>
yesterday I wrote a class called SetTerminalTitle
<shevy>
which... sets the title of a terminal
ggVGc has quit [Remote host closed the connection]
<shevy>
but it's annoying to type that
<shevy>
especially if you want to use it across many different .rb files, optionally right? hmm... set_title('hello world') would be nicer than SetTitle.new('hello world')
arya has joined #ruby
<lupine>
mm, that doesn't seem natural to me
<lupine>
Terminal.new( ... ).set_title is how I'd go
<lupine>
if there's only one terminal (hah!) then Terminal.set_title
dhruvasagar has quit [Ping timeout: 276 seconds]
<moshef>
i agree with set_title('hello') being easier
<shevy>
lupine well I dont really have a functional Terminal.new class
<apeiros>
set_title? in ruby? srsly?
<apeiros>
title=, come on…
<shevy>
apeiros but from within another class?
dhruvasagar has joined #ruby
<apeiros>
what's the issue?
pi3r has joined #ruby
<lupine>
Terminal/title = ... would be fine too
<lupine>
. *
<shevy>
looks like a local variable
<apeiros>
shevy: how long are you doing ruby now?
<shevy>
apeiros many years
<apeiros>
you really should be accustomed to attr_writers
brhelwig has quit [Ping timeout: 256 seconds]
<xll11>
attr_writers serve as getters/setters right?
<apeiros>
writers are only the setters
<injekt>
xll11: no, setters
<apeiros>
accessors are getter+setter
* lupine
whispers something about global variables
chussenot has quit [Quit: chussenot]
<apeiros>
i.e., `attr_accessor :foo` is equivalent to `attr_reader :foo; attr_writer :foo`
* apeiros
hits lupine over the head with an inflated $ sign
<xll11>
:D
<xll11>
and, outside the class, how do I set them?
<lupine>
there are worse places to put that kind of dirty hacky code
_bart has joined #ruby
<apeiros>
lupine: ew
<lupine>
I'd probably go for an interim module instead, myself
sonda has joined #ruby
arya has quit [Ping timeout: 245 seconds]
dmerrick has joined #ruby
[eDu] has joined #ruby
neredsenvy has joined #ruby
<moshef>
lupine: I created another gem with a diff file and its still expecting to be a module
<moshef>
wtf?
<moshef>
I'm missing something here
<neredsenvy>
How do I end a private visibility declaration for instance I write private def method1 end and then any other method I write after method1 is also private.
xll11 has quit [Ping timeout: 252 seconds]
<moshef>
oh
FLeiXiuS` has quit [Read error: Connection reset by peer]
<neredsenvy>
But I didn't find anything about ending private
<moshef>
gem is supposed to be a module
<moshef>
fucking shit
<injekt>
neredsenvy: use 'public' keyword
<injekt>
neredsenvy: you dont 'end' the scope, you change it
Macaveli has joined #ruby
<injekt>
the visibility*
<shevy>
moshef you mean a gem must be a module?
<neredsenvy>
injekt: Ah ok. Thanks.
arya has joined #ruby
<lupine>
moshef, different gems share a global namespace
<lupine>
when you require two different gems, they can trample all over each other. the only thing preventing them from doing so is convention
<moshef>
yes, as far as i remember
dmerrick has quit [Ping timeout: 256 seconds]
<lupine>
if gem1 has foo.rb that does Class ::Foo ; end and gem2 has bar.rb that does Module ::Foo ; end, requiring them both *will* break
<moshef>
so namespacing prevents that ?
slainer6_ has quit [Remote host closed the connection]
FLeiXiuS` has joined #ruby
Zai00 has quit [Quit: Zai00]
JonnieCache has joined #ruby
JonnieCache has quit [Client Quit]
pskosinski has joined #ruby
hiroyuki has joined #ruby
shock_one has joined #ruby
camilasan has joined #ruby
<moshef>
ok I have another problem. my gem has a settings.yml file but I'm not sure if that settings file location is always going to be in the same place (or well - don't think i want to force it to be)
<moshef>
how do I deal with that?
sayan has quit [Ping timeout: 260 seconds]
nari has quit [Ping timeout: 245 seconds]
<spooner_>
moshef, Use a relative path to it, not an absolute one (look at File.expand_path).
yoshie902a has joined #ruby
<moshef>
I'm using file.exapnd path
<moshef>
but its still relative to where I'm running the file
<visof_>
why this implementation of sieve algorithm so slow??
arya has quit []
dhruvasagar has joined #ruby
mljsimone has joined #ruby
jerius has joined #ruby
dmiller1 has joined #ruby
netto has joined #ruby
Macaveli has quit [Ping timeout: 264 seconds]
EPIK has quit [Ping timeout: 255 seconds]
<akemrir>
visof_: which version of ruby you are using?
Macaveli has joined #ruby
LennyLinux has quit [Remote host closed the connection]
Macaveli has left #ruby [#ruby]
anderse has quit [Quit: anderse]
gaahrdner has joined #ruby
MrZYX|off is now known as MrZYX
rosster has quit [Ping timeout: 256 seconds]
arya has joined #ruby
cmarques has joined #ruby
gristus has joined #ruby
Zai00 has quit [Ping timeout: 245 seconds]
<visof_>
akemrir, 2
Zai00 has joined #ruby
<akemrir>
use Prime class, this is ruby builtin and then list.select {|x| x % list.first == 0 and x != list.first}.map {|y| list.delete(y)}
<akemrir>
end
`p has quit [Remote host closed the connection]
<akemrir>
sorry
<akemrir>
use Prime class
<akemrir>
Prime.take_while { |p| p < 1000000 }
<visof_>
akemrir, i want to implement my own one
<akemrir>
In that case, this is so slow because you are doing loop on 1mln of elements and select on 1mln of elements. This generates 10^12 of operations
tmiller has quit [Remote host closed the connection]
<akemrir>
with delete of course
akashj87 has joined #ruby
JonnieCache has joined #ruby
newUser1234 has quit [Remote host closed the connection]
tmiller has joined #ruby
Coolhand has quit [Remote host closed the connection]
<kiwi_19935>
I have an issue with sockets in ruby quite funny
hmarr has joined #ruby
<kiwi_19935>
I have a proxy that relays to another proxy and as long as data is not modified it works fine
Ontolog has joined #ruby
<kiwi_19935>
but when I add 1 character in the first proxy and send it to the second proxy, even if the second proxy ignores the first character (the one added) and sends the rest, the connection fails
bradleyprice has joined #ruby
aero1 has left #ruby ["WeeChat 0.4.0"]
crassus is now known as duckstab
d2dchat has quit [Remote host closed the connection]
rdev is now known as rdev5
visof has quit [Remote host closed the connection]
niklasb has joined #ruby
Macaveli has joined #ruby
dqminh has joined #ruby
netto has quit [Read error: Connection reset by peer]
netto_ has joined #ruby
banisterfiend has joined #ruby
wolcanus has joined #ruby
gyre007 has quit [Ping timeout: 264 seconds]
graeme_ has joined #ruby
chrisnicola has joined #ruby
solidoodlesuppor has joined #ruby
gyre007 has joined #ruby
vlad_starkov has joined #ruby
binaryplease has quit [Ping timeout: 245 seconds]
graeme has quit [Ping timeout: 256 seconds]
graeme_ is now known as graeme
eibayan has joined #ruby
netto has joined #ruby
Pochacco has quit [Quit: Pochacco]
Hanmac has joined #ruby
Ontolog has quit [Remote host closed the connection]
GhettoCode has joined #ruby
<eibayan>
hi
<kiwi_19935>
hi
generalissimo has joined #ruby
braoru has quit [Quit: Leaving]
Macaveli has quit [Quit: Leaving]
netto_ has quit [Ping timeout: 264 seconds]
<gestahlt>
Hi, im iterating a hash, the thing is, i need to do it backwards.. or at least define somehow the order in which methods are executed
vlad_starkov has quit [Ping timeout: 252 seconds]
<MrZYX>
if you need order don't use a hash
yshh has joined #ruby
<gestahlt>
Lets say hash is 1 -> a, 2 -> b, 3 -> c and i need to perform like a method for 2 first then for 3 and last 1
netto_ has joined #ruby
<gestahlt>
Well, by the key value pairs i define the order
dqminh has quit [Remote host closed the connection]
mando has joined #ruby
apok has joined #ruby
<gestahlt>
They are my conditions
d2dchat has joined #ruby
<Hanmac>
gestahlt: an normal hash.each is not orderd
<gestahlt>
if the hash has key1 = a, key2 = b then do this but not before
ShellFu_AFK is now known as ShellFu
<gestahlt>
hash.each_key i did
<gestahlt>
and the hash is very nesteed
<gestahlt>
nested
daniel_- has quit [Ping timeout: 245 seconds]
acrussell has joined #ruby
kiwi_19935 is now known as mellow888
_maes_ has joined #ruby
eibayan has left #ruby [#ruby]
<kofno>
well, in 1.9 hashes are ordered in the order the keys were inserted
<gestahlt>
Hrm...
netto has quit [Ping timeout: 240 seconds]
<MrZYX>
that doesn't mean it's a good idea to rely on that
<gestahlt>
build a new hash based on the info? first and last is most important. Rest can be done whenever
<kofno>
uh, it is part of the hash definition in ruby that hashes will be ordered.
fermion has joined #ruby
<kofno>
it's not coincidental
whitedawg has quit [Ping timeout: 245 seconds]
<kofno>
that said, maybe you need a different datastructure
wallerdev has joined #ruby
<gestahlt>
maybe
<kofno>
or to create keys that can be sorted in the order you need
<gestahlt>
I could have added it on hash creation time.. that would have saved me the hassle
r126l has quit [Quit: leaving]
<gestahlt>
hmmm
sgkim126l has joined #ruby
netto_ has quit [Read error: Connection reset by peer]
mercwithamouth has joined #ruby
peterhellberg has quit [Remote host closed the connection]
<gestahlt>
i think i recreate the config file from where i create the hash and add a new key value with the order. I thought at first this was unecessary but seems like its more convienient that way
haxrbyte has joined #ruby
randomautomator has joined #ruby
Elhu has quit [Quit: Computer has gone to sleep.]
yshh has quit [Read error: Connection reset by peer]
yshh has joined #ruby
hashmal has quit [Quit: Computer has gone to sleep.]
havenwood has joined #ruby
alex__c2022 has joined #ruby
Elhu has joined #ruby
apok has quit [Quit: apok]
k610 has quit [Ping timeout: 264 seconds]
teddyp1cker has quit [Remote host closed the connection]
xyzodiac has joined #ruby
clocKwize has quit [Quit: clocKwize]
netto has joined #ruby
havenwood has quit [Ping timeout: 256 seconds]
dqminh has joined #ruby
enebo has joined #ruby
d2dchat has quit [Remote host closed the connection]
apeiros has quit [Remote host closed the connection]
haxrbyte_ has joined #ruby
mneorr has joined #ruby
LennyLinux has joined #ruby
whitedawg has joined #ruby
theRoUS has quit [Read error: Operation timed out]
rdark has quit [Ping timeout: 256 seconds]
netto has quit [Quit: netto]
haxrbyte has quit [Ping timeout: 256 seconds]
lewix has quit [Remote host closed the connection]
solars has left #ruby ["WeeChat 0.3.7"]
lewix has joined #ruby
alup has quit [Quit: Leaving]
jbueza has joined #ruby
jbueza has quit [Max SendQ exceeded]
jbueza has joined #ruby
rdark has joined #ruby
jbueza has quit [Client Quit]
zph has joined #ruby
jbueza has joined #ruby
markalanevans has joined #ruby
saimaz has quit [Remote host closed the connection]
hassans has quit [Quit: hassans]
MrZYX is now known as MrZYX|off
baroquebobcat has joined #ruby
francisfish has quit [Remote host closed the connection]
ckrailo has joined #ruby
lewix has quit [Ping timeout: 276 seconds]
francisfish has joined #ruby
nadirvardar has joined #ruby
dmerrick has joined #ruby
pi3r has quit [Quit: Leaving]
sk87 has quit [Read error: No route to host]
eldariof has joined #ruby
k610 has joined #ruby
frem has joined #ruby
pduin has quit [Remote host closed the connection]
dqminh has quit [Remote host closed the connection]
heliumsocket has joined #ruby
wsterling has joined #ruby
graspee has joined #ruby
Coolhand has quit [Ping timeout: 260 seconds]
mljsimone has quit [Remote host closed the connection]
graeme has quit [Quit: graeme]
Coolhand has joined #ruby
Andromeda has joined #ruby
strax has quit [Ping timeout: 248 seconds]
sk87 has joined #ruby
dmerrick has quit [Ping timeout: 256 seconds]
lupinstien has joined #ruby
jabbslad has quit [Quit: Leaving...]
baroquebobcat has quit [Quit: baroquebobcat]
arturaz has quit [Ping timeout: 276 seconds]
dankest has joined #ruby
Evixion` has joined #ruby
Neomex has quit [Quit: Neomex]
whitedawg has quit [Quit: Leaving.]
dankest has quit [Client Quit]
Evixion has quit [Ping timeout: 248 seconds]
jlast has quit [Remote host closed the connection]
tymat has joined #ruby
tymat is now known as starburst
zph has quit [Quit: Computer has gone to sleep.]
brennanMKE has joined #ruby
tevio has quit [Remote host closed the connection]
hashpuppy_ has joined #ruby
_maes_ has quit [Ping timeout: 256 seconds]
gestahlt has quit [Quit: ChatZilla 0.9.89 [Firefox 17.0.1/20121129151842]]
a_a_g has quit [Quit: Leaving.]
<hashpuppy_>
i wish ruby had something like scala's `object`
chrisnicola has quit [Quit: This computer has gone to sleep]
whitedawg has joined #ruby
<tos9>
singleton is an antipattern.
<hashpuppy_>
well, a lot of the time i only have one of something w/ no state
nomenkun_ has quit [Ping timeout: 256 seconds]
Astralum has joined #ruby
<hashpuppy_>
seems like an anti pattern to ask for a new one of that something
camilasan has joined #ruby
<tos9>
then you have a class and only make one instance of it, or you have some globals.
<tos9>
(usually the former)
chrishough has joined #ruby
<tos9>
since it's easier to test
bitZero__ has joined #ruby
camilasan has quit [Remote host closed the connection]
DrShoggoth has joined #ruby
__KGB__ has quit [Ping timeout: 245 seconds]
dmerrick has joined #ruby
brain_shim_ has quit [Ping timeout: 245 seconds]
<spooner_>
hashpuppy_, Then just have some methods on a module.
<waxjar>
couldn't you just use a module instead?
generalissimo has quit [Remote host closed the connection]
<hashpuppy_>
yeah, ok, so what's preferred here. a module or a class with class << self
brain_shim_ has joined #ruby
[eDu] has quit [Quit: [eDu]]
theRoUS has joined #ruby
theRoUS has joined #ruby
theRoUS has quit [Changing host]
<spooner_>
If you aren't instancing it, don't use a class.
nateberkopec has joined #ruby
hassans has joined #ruby
ananthakumaran has joined #ruby
apeiros has joined #ruby
Floydzy has quit [Quit: Floydzy]
mikepack has joined #ruby
<spooner_>
hashpuppy_, Can also consider using module_function (though not really sure why that exists, since we can just use class << self or def self.meth).
tootooroo has joined #ruby
logix812 has quit [Quit: Computer has gone to sleep.]
netto has joined #ruby
<apeiros>
Spooner_: module_function exists to create modules like Kernel or Math
<apeiros>
where the class method is public and the instance method is private
newUser1234 has joined #ruby
netto has quit [Client Quit]
Neomex has joined #ruby
Andromeda has quit [Remote host closed the connection]
newUser1234 has quit [Remote host closed the connection]
f0ster` has joined #ruby
swingha has joined #ruby
<f0ster`>
I have a function, that calls another function which is raising an exception.. however I have a begin/rescue in my outer function, but the inner exception isnt rescue'd in the outer function. is this typical ruby behaviour or is there something stranger going on? it is in a rails app and I have restarted multiple times so im not sure what is causing it
phite has joined #ruby
pskosinski has quit [Ping timeout: 264 seconds]
mafolz has quit [Remote host closed the connection]
<bean__>
probably a better question for #rubyonrails but unsure
* bean__
doesn't use exceptions except in rare cases
Eldariof-ru has joined #ruby
jurassic has joined #ruby
elaptics is now known as elaptics`away
newUser1234 has joined #ruby
<f0ster`>
seems more of a language question, bean__
Andromeda has joined #ruby
<MrZYX>
can you write a small reproducer?
IceDragon has quit [Ping timeout: 258 seconds]
slainer68 has quit [Remote host closed the connection]
jurassic has quit [Client Quit]
<quazimodo>
object.foo.bar <-- i want to write a method zed(n) that will string foo n times, sort of like object.zed(n).bar ---> object.foo.foo.foo n times.bar
<quazimodo>
is this insane?
<f0ster`>
hmm yeah i guess, not sure it would help my case, i can bubble the exception up manually, but i dont think thats how exceptions should work in most languages
<bean__>
quazimodo: that sounds silly.
hamush has left #ruby ["WeeChat 0.3.6"]
Evixion` has quit [Ping timeout: 264 seconds]
Evixion has joined #ruby
freeayu has quit [Remote host closed the connection]
eldariof has quit [Ping timeout: 252 seconds]
tootooroo has joined #ruby
indyrl has joined #ruby
phite has quit [Remote host closed the connection]
rdev has joined #ruby
<quazimodo>
bean__: it's for grabbing a parent in capybara. Currently it's find(:xpath, './/..') and i'd like to define parent(n) that will go back to the nth parent node
<quazimodo>
i suppose i can always modify the xpath string
<bean__>
./../../../
<bean__>
:P
jgrevich has joined #ruby
<quazimodo>
yeah seems more sensible. For the sake of education, though, howould you do this?
<jrhe>
Hi, I have a question regarding overriding methods in classes from different modules. I have tried searching but without avail. So a gem I was using overrode Object#try from actitve_support core by copying the definition inline in the gem. It did this not to change its functionality but to provide access to the method without having to require active_support. This led to the gem breaking other gems in rails 4 because the
<jrhe>
active_support definition of try had changed but was then being overwritten by the gems version. I moved the try method inside the class and added an extra 'object' argument. Is there a way of scoping method overrides so that I can still call object.try using the gems version but only inside that module.
t-mart_ has joined #ruby
jtperreault has left #ruby ["WeeChat 0.3.7"]
jtperreault has joined #ruby
IceDragon has joined #ruby
jdunck has joined #ruby
ToApolytoXaos has joined #ruby
grzywacz has quit [Ping timeout: 260 seconds]
<injekt>
quazimodo: n.times { foo }; self
<quazimodo>
oh
<quazimodo>
that's easy
bsaboia_ has quit [Ping timeout: 258 seconds]
catphish has quit [Quit: Leaving]
AndChat| has joined #ruby
phite has joined #ruby
niklasb has joined #ruby
baroquebobcat has joined #ruby
zigomir has quit [Quit: zigomir]
t-mart has quit [Ping timeout: 256 seconds]
_maes_ has joined #ruby
br4ndon has joined #ruby
t-mart_ has quit [Client Quit]
end_guy has quit [Remote host closed the connection]
t-mart has joined #ruby
end_guy has joined #ruby
lancepantz is now known as lancepantz_
tomzx_mac has joined #ruby
soulofpeace has quit [Ping timeout: 240 seconds]
jrhe has quit [Quit: jrhe]
stef_204 has joined #ruby
strax has joined #ruby
br4ndon_ has joined #ruby
yacks has joined #ruby
Al__ has quit [Ping timeout: 264 seconds]
maxmanders has quit [Quit: Computer has gone to sleep.]
Eldariof-ru has quit [Read error: Operation timed out]
haxrbyte_ has quit [Read error: Connection reset by peer]
<apeiros>
Hanmac: ubermeta
wolcanus has joined #ruby
Zhut has quit []
Ontolog_ has joined #ruby
<apeiros>
becom33: system is the wrong tool
<apeiros>
becom33: see Kernel#` and Kernel#spawn
olivier_bK has joined #ruby
dynetk has joined #ruby
<becom33>
apeiros, why ?
<olivier_bK>
hi
Asher has quit [Ping timeout: 276 seconds]
<injekt>
becom33: ri system
<jrhe>
Is there anyway of overwriting methods just for a particular module?
<apeiros>
becom33: I think you already noticed that it doesn't give you the output. that's why.
cobragoat has joined #ruby
<becom33>
apeiros, btw in here system is just a string
<apeiros>
jrhe: only in ruby 2.0
<becom33>
not a function
blaxter_ has joined #ruby
sayan has joined #ruby
<olivier_bK>
in my script i get this error uninitialized constant Fileutils and i added inside my script require 'fileutils'
<olivier_bK>
include FileUtils
<olivier_bK>
but i have again this error :(
<apeiros>
oh dear, what a misleading summary then
LennyLinux has quit [Remote host closed the connection]
<apeiros>
becom33: \' in gsub has a special meaning
<apeiros>
it needs 6 or 8 \ (I never remember right)
<injekt>
olivier_bK: you can't have
LennyLinux has joined #ruby
<olivier_bK>
do you know how i can resolve it
<jrhe>
apeiros: Is there some workaround for achieving similar in other rubies? A gem I use copied Object#try from active support but as it has changed in rails 4, it breaks other gems. I have just factored it out to take an extra arg for now which is the object itself.
<injekt>
olivier_bK: you said you have "FileUtils" and your error says you tried "Fileutils"
chrishough has joined #ruby
mneorr has joined #ruby
<olivier_bK>
injekt, yes
skattyadz has joined #ruby
<injekt>
olivier_bK: they're different
Ontolog has quit [Ping timeout: 258 seconds]
<apeiros>
jrhe: patch the gem, use the patched gem instead. file a bug report.
k610 has quit [Ping timeout: 260 seconds]
baroquebobcat has quit [Quit: baroquebobcat]
twoism has joined #ruby
pdswan has joined #ruby
<becom33>
is there a better way escape string ?
<becom33>
like addslash() in php ?
<olivier_bK>
injekt, it's true but when i write require 'fileutils'
<olivier_bK>
include Fileutils inside my file i have again the error
<injekt>
olivier_bK: that's because it's include FileUtils
<apeiros>
becom33: addslash in php is about the worst thing ever
stkowski has joined #ruby
<apeiros>
oh, wow, 895… just 5 more…
soulcake has joined #ruby
<injekt>
5 more what?
<jrhe>
apeiros: I have patched the gem and its been pulled. I just wondered if there was a better way to do it than the way I have done it. Out of curiosity, how does one do it in ruby 2.0.0?
<apeiros>
jrhe: the feature is called refinements. I'm not yet using ruby 2.0, so I mostly only know that it exists.
<olivier_bK>
injekt, i get this error now :( no such file to load -- Fileutils (LoadError)
failshell has quit [Remote host closed the connection]
Davey has quit [Quit: Computer has gone to sleep.]
ToApolytoXaos has quit [Quit: Leaving]
* apeiros
is back down to 4 installed versions of ruby
<injekt>
3 for me!
<apeiros>
well, I have 3 + system ruby
<injekt>
oh
<injekt>
4 for me!
<apeiros>
^^
* apeiros
goes to get himself some drugs
<Xeago>
:o
<injekt>
durgs
<Hanmac>
apeiros: did you look at my gist?
<apeiros>
Hanmac: yes, I said "ubermeta" :)
<Xeago>
gstl gives way more adrenaline yo
<Hanmac>
:P
<Hanmac>
ping banisterfiend
pygmael has joined #ruby
<apeiros>
Xeago: than my especially sugary milk? NEVER! :D
<banisterfiend>
Hanmac: gutan tag, how are you Meneer? goed?
<Xeago>
german and then dutch
brhelwig has joined #ruby
<Xeago>
shame on you
failshell has joined #ruby
<olivier_bK>
i looking on ruby-doc.org for FileUtils.mkdir_p because when i execute the script he tell me 23: uninitialized constant Fileutils (NameError)
<olivier_bK>
my ligne 23 => FileUtils.mkdir_p "#{Directory}#{NameVhost}"
<Xeago>
Goeden dag, hoe bent u, meneer? Goed?
whitedawg has quit [Quit: Leaving.]
<injekt>
wow
akemrir has quit [Quit: WeeChat 0.4.0]
<banisterfiend>
Xeago: you're right, dutch shouldn't be spoken at all
Zai00 has quit [Quit: Zai00]
<injekt>
honestly
<banisterfiend>
:P
<injekt>
olivier_bK: you're still using Fileutils
blaxter_ has quit [Quit: foo]
lkba has joined #ruby
<injekt>
olivier_bK: fix the case, it'll work
<banisterfiend>
Hanmac: sup?
* apeiros
wonders what's worse - him being a troll or him not being a troll
<injekt>
aye
<injekt>
I think him not being a troll is worse
johnmlocklear_ has quit [Read error: Operation timed out]
<MrZYX>
olivier_bK: yes, now read the error you get
<MrZYX>
which version is mentioned in it?
sonda has quit [Remote host closed the connection]
pen has quit [Ping timeout: 258 seconds]
pen has joined #ruby
thinkclay has joined #ruby
Ontolog has joined #ruby
<olivier_bK>
i going to be crazy there is just 3 minute i write the same line and i get an error but now it's working
aantix has joined #ruby
anderse has joined #ruby
<olivier_bK>
grr...
whitedawg has quit [Quit: Leaving.]
pioz has joined #ruby
mahmoudimus has joined #ruby
chrisnicola has quit [Quit: This computer has gone to sleep]
pioz has quit [Client Quit]
chimkan_ has quit [Read error: Connection reset by peer]
anderse has quit [Client Quit]
chimkan has joined #ruby
markalanevans has joined #ruby
mahmoudimus has quit [Client Quit]
chrisnicola has joined #ruby
mrsolo has joined #ruby
indyrl has quit [Quit: Leaving.]
Ontolog_ has quit [Ping timeout: 245 seconds]
stef_204 has quit [Quit: quitting]
psyprus has quit [Ping timeout: 258 seconds]
swingha has quit [Quit: WeeChat 0.4.0]
momomomomo has quit [Quit: momomomomo]
mahmoudimus has joined #ruby
Ontolog has quit [Ping timeout: 248 seconds]
carloslopes has quit [Remote host closed the connection]
<apeiros>
olivier_bK: the point is, you did NOT write the same line. Fileutils and FileUtils is NOT the same.
noop has joined #ruby
maycon_ has quit [Read error: Connection reset by peer]
d2dchat has quit [Remote host closed the connection]
br4ndon_ has quit [Quit: Lorem ipsum dolor sit amet]
marcdel has joined #ruby
mahmoudimus has quit [Ping timeout: 258 seconds]
chandankumar has joined #ruby
buibex has joined #ruby
Ontolog has joined #ruby
atmosx has joined #ruby
k611 has quit [Ping timeout: 256 seconds]
cmarques has quit [Ping timeout: 258 seconds]
psyprus has joined #ruby
ariedler has joined #ruby
<wyattg>
Ok. So I have a ruby app that runs as a daemon. I am supposed to make another script that controls the daemon while it is running (eg, sets a variable). How could I achieve that?
interactionjaxsn has quit [Remote host closed the connection]
rippa has joined #ruby
mahmoudimus has joined #ruby
pen has quit [Ping timeout: 258 seconds]
<apeiros>
wyattg: e.g. via a socket, or a slower but manually reproducable way via a file + sending a signal
etcetera has quit []
thinkclay has quit [Quit: Leaving.]
<apeiros>
(Process.kill - despite its name it only sends a signal, it doesn't really kill anything)
dmiller1 has quit [Ping timeout: 245 seconds]
kiri has quit [Ping timeout: 240 seconds]
pen has joined #ruby
<apeiros>
there are also a couple of very high level IPC libs around. like Drb which is part of rubys stdlib.
etcetera has joined #ruby
<MrZYX>
you can't trap on kill though ;)
pencilcheck has joined #ruby
<wyattg>
you can trap other signals tho!
<wyattg>
thanks apeiros
<apeiros>
MrZYX: you can
<apeiros>
ah well, kill == 9?
<MrZYX>
yup
<apeiros>
thought kill == sigint
Morkel has quit [Quit: Morkel]
<MrZYX>
hm
<MrZYX>
not sure about Process.kill
<apeiros>
not sure, though
<apeiros>
Process.kill is like the command line utility
<MrZYX>
but sigkill == 9
<apeiros>
you can send whatever signal you want with it
<MrZYX>
oh then it's likely sigterm
Morkel has joined #ruby
Davey has joined #ruby
binaryplease has joined #ruby
cantonic has joined #ruby
br4ndon has joined #ruby
<MrZYX>
by default
hiroyuki has joined #ruby
<apeiros>
that of course, yes
theRoUS has quit [Ping timeout: 240 seconds]
generalissimo has quit [Read error: Connection reset by peer]
pen has quit [Ping timeout: 258 seconds]
generalissimo has joined #ruby
ryanh has quit [Quit: Computer has gone to sleep.]
robscomputer_ has joined #ruby
hiroyuki_ has quit [Ping timeout: 255 seconds]
casheew has quit [Read error: Connection reset by peer]
ukd1 has joined #ruby
cobragoat has quit [Remote host closed the connection]
casheew has joined #ruby
thinkdevcode has joined #ruby
yacks has joined #ruby
biz has joined #ruby
BizarreCake has quit [Ping timeout: 276 seconds]
cobragoa_ has joined #ruby
interactionjaxsn has joined #ruby
yacks has quit [Max SendQ exceeded]
grzywacz has joined #ruby
<apeiros>
900! :D
wolcanus_ has joined #ruby
<MrZYX>
and 2 ;D
<MrZYX>
is that channel record?
drago777- has left #ruby [#ruby]
blaxter has quit [Quit: KTHXBYE]
Morkel has quit [Quit: Morkel]
vetsin has quit [Ping timeout: 240 seconds]
<apeiros>
possibly
carloslopes has joined #ruby
Hanmac has quit [Read error: Connection reset by peer]
sayan has quit [Quit: Leaving]
<apeiros>
I don't always look at the numbers. but the last few weeks it was around 700-800 usually
<apeiros>
and it was around 300 when I first joined
Hanmac has joined #ruby
Morkel has joined #ruby
swingha has joined #ruby
hassans has joined #ruby
wolcanus has quit [Read error: Operation timed out]
robscomputer has quit [Read error: Connection reset by peer]
Ontolog has quit [Ping timeout: 252 seconds]
tmiller has quit [Remote host closed the connection]
mneorr has quit [Remote host closed the connection]
zph has joined #ruby
ukd1 has quit [Remote host closed the connection]
mattbl has joined #ruby
davetherat has quit [Remote host closed the connection]
davetherat has joined #ruby
ph^ has quit [Ping timeout: 255 seconds]
k610 has joined #ruby
mneorr has joined #ruby
xaq has joined #ruby
shock_one has quit [Ping timeout: 248 seconds]
pothibo has quit [Quit: pothibo]
MetaCosm has quit [Excess Flood]
k610 has quit [Client Quit]
hamakn has quit [Ping timeout: 248 seconds]
a_a_g has joined #ruby
a_a_g has quit [Client Quit]
MetaCosm has joined #ruby
gyre007 has quit [Remote host closed the connection]
pencilcheck has quit [Remote host closed the connection]
jonathanwallace has joined #ruby
jrajav has joined #ruby
mattbl has quit [Quit: This computer has gone to sleep]
bean__ has joined #ruby
bean__ has quit [Max SendQ exceeded]
timonv has joined #ruby
bean__ has joined #ruby
generalissimo has quit [Remote host closed the connection]
mattbl has joined #ruby
sambio has quit []
yacks has joined #ruby
Guedes has joined #ruby
d2dchat has joined #ruby
<hashpuppy_>
which do you guys prefer for initializing a hash of keys all to []: Hash[FIELDS.zip(Array.new(FIELDS.length) { [] })] or FIELDS.reduce({}){|o, p| o[p] = []; o}
<MrZYX>
Hash.new([])
<bean__>
Hash.new([]) def.
maxmanders has joined #ruby
<hashpuppy_>
but then i iterate over some data and populate that hash and if there is nothing to iterate over i still want {field1: [], field2: []}
aapzak_ has quit [Ping timeout: 252 seconds]
ph^ has joined #ruby
pygmael has quit [Quit: pygmael]
pygmael has joined #ruby
altamic has quit [Quit: altamic]
xaq_ has joined #ruby
mattbl has quit [Quit: This computer has gone to sleep]
anderse has joined #ruby
jeebster has joined #ruby
<Hanmac>
when you do Hash.new([]) remember that you cant use <<, so you must use +=
maxmanders has quit [Read error: Connection reset by peer]
maxmanders has joined #ruby
ebobby has left #ruby [#ruby]
jrhe has quit [Quit: jrhe]
d3 has quit [Quit: Ухожу я от вас (xchat 2.4.5 или старше)]
martinklepsch has quit [Ping timeout: 245 seconds]
jrhe has joined #ruby
xaq has quit [Ping timeout: 258 seconds]
chussenot has quit [Quit: chussenot]
xaq_ has quit [Remote host closed the connection]
pygmael has quit [Quit: pygmael]
chrishough has quit [Quit: chrishough]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
chris_qwer has joined #ruby
chris_qwer has left #ruby [#ruby]
mneorr has quit [Remote host closed the connection]
aaaaa has joined #ruby
beneggett has quit [Ping timeout: 246 seconds]
davetherat has quit [Remote host closed the connection]
davetherat has joined #ruby
Eldariof93-ru has joined #ruby
davetherat has quit [Remote host closed the connection]
davetherat has joined #ruby
tmiller has joined #ruby
cmarques has joined #ruby
hakunin_ has joined #ruby
zph has quit [Quit: Computer has gone to sleep.]
jlast has quit [Remote host closed the connection]
echobinary has joined #ruby
<codezombie>
is anyone aware of a tool similar to codeclimate that can be run locally? Doesn't have to have a fancy ui, just need to give code analysis reports for ruby/rails projects.
tmiller has quit [Remote host closed the connection]
maxmanders has quit [Quit: Computer has gone to sleep.]
slainer68 has joined #ruby
drale2k has quit [Quit: Leaving...]
c0rn has quit [Quit: Computer has gone to sleep.]
araujo has joined #ruby
axxT has quit [Ping timeout: 256 seconds]
BSaboia__ has quit [Client Quit]
BSaboia has quit [Ping timeout: 256 seconds]
Ontolog has joined #ruby
bronson has joined #ruby
skum has joined #ruby
bronson has quit [Client Quit]
indyrl has joined #ruby
drago777- has joined #ruby
bronson has joined #ruby
babinho has quit [Quit: leaving]
babinho has joined #ruby
maxmanders has joined #ruby
Banistergalaxy has joined #ruby
Eldariof93-ru has quit [Read error: Operation timed out]
nricciar has quit [Ping timeout: 246 seconds]
Vainoharhainen has quit [Ping timeout: 264 seconds]
Michael__ has joined #ruby
Ontolog_ has quit [Ping timeout: 256 seconds]
kiri has joined #ruby
r0bby_ has joined #ruby
AndChat| has quit [Ping timeout: 258 seconds]
kirun has joined #ruby
atmosx has quit [Quit: And so the story goes…]
mercwithamouth has quit [Ping timeout: 240 seconds]
atno has quit [Read error: No route to host]
cmarques has quit [Ping timeout: 245 seconds]
Eldariof93-ru has joined #ruby
biz has quit [Ping timeout: 264 seconds]
jlast has quit [Remote host closed the connection]
gaahrdner has joined #ruby
aytch has quit [Remote host closed the connection]
jlast has joined #ruby
jlast has quit [Remote host closed the connection]
akashj87__ has joined #ruby
jlast has joined #ruby
Matt has joined #ruby
Matt is now known as Guest52362
cr3 has joined #ruby
<cr3>
is there a nice way to merge an array of hashes?
becom33 has quit [Quit: Leaving]
<yxhuvud>
arr.inject &:merge ?
mercwithamouth has joined #ruby
akashj87 has quit [Ping timeout: 245 seconds]
pdtpatrick has quit [Remote host closed the connection]
wyattg has quit [Quit: Konversation terminated!]
headius has joined #ruby
benweint has joined #ruby
<cr3>
yxhuvud: inject?
Rumsteak has joined #ruby
<yxhuvud>
yes?
<cr3>
yxhuvud: I was looking in the Array doc but I found it in the Enumeration doc, I'll read more
louism2_ has joined #ruby
<louism2_>
hey all
<yxhuvud>
you may not need the &.
Rumsteak has quit [Client Quit]
<louism2_>
what does the =~ operand do?
AndChat| has joined #ruby
mahmoudimus has quit [Remote host closed the connection]
<yxhuvud>
due to inject being special.
wgosling has joined #ruby
<C0deMaver1ck>
louism2_: matches a regex
wgosling has quit [Client Quit]
<C0deMaver1ck>
I tend to use =~ /something/ more than .match /something/
cnrk has joined #ruby
<louism2_>
<C0deMaver1ck> Thanks
<C0deMaver1ck>
np
wyattg has joined #ruby
beneggett has joined #ruby
tobor_one has quit [Quit: tobor_one]
Banistergalaxy has quit [Ping timeout: 276 seconds]
pangur has joined #ruby
<apeiros>
louism2_: actually =~ is a method
<apeiros>
so what it does depends on the receiver
theRoUS has quit [Ping timeout: 245 seconds]
fmendez has joined #ruby
<apeiros>
usually you'll call it on String or Regexp, though, and then it's what C0deMaver1ck said
divout has quit [Remote host closed the connection]
astegman has joined #ruby
Michael__ has quit [Remote host closed the connection]
maxmanders has quit [Quit: Computer has gone to sleep.]
baroquebobcat has joined #ruby
jonathanwallace has quit [Ping timeout: 256 seconds]
beneggett has quit [Ping timeout: 258 seconds]
mando has quit [Remote host closed the connection]
<xll11>
Anyone got some interesting ruby project to show me?
zph has joined #ruby
<xll11>
I wanna read some code and pick up habits of good programemrs
<pangur>
I have a file of questions and answers. The questions begin with Q. and the answers with A. Each question is a line. However, a couple of the answers consist of more than one line. These additional lines begin with a number (1 .. 6, let's say). I show my code at https://gist.github.com/anonymous/5321997. How do I add the lines that begin with a number?
skattyadz has quit [Quit: skattyadz]
maycon has joined #ruby
zph has quit [Client Quit]
preyalone has joined #ruby
adkron has joined #ruby
<preyalone>
How do I turn on line numbers in my default.reek?
echobinary has quit [Read error: Connection reset by peer]
echobinary has joined #ruby
zph has joined #ruby
<havenwood>
xll11: Github has tons of great Ruby projects.
dynetk has quit []
baroquebobcat has quit [Quit: baroquebobcat]
<pangur>
Is there a way for Ruby to look ahead to see whether the next line begins with a number?
preyalone has quit [Client Quit]
<havenwood>
pangur: line.next[0] =~ /\d/
<pangur>
Thanks havenwood :)
baroquebobcat has joined #ruby
jrajav has quit [Quit: phunq, sandwich store loop, WHAT NO UNIVERSE]
dankest has quit [Quit: Leaving...]
whitedawg has joined #ruby
graeme has joined #ruby
c0rn has joined #ruby
<havenwood>
pangur: err, actually my code is fail, sec
theRoUS has joined #ruby
hamakn has joined #ruby
dankest has joined #ruby
Fuzai has quit [Ping timeout: 260 seconds]
<havenwood>
pangur: Are you iterating over the lines, or at one line and want to peek at next?
marr has joined #ruby
jrhe has quit [Quit: jrhe]
hamakn has quit [Ping timeout: 246 seconds]
<pangur>
I have 196 questions. Just two of them have multi-line answer. After the first line of the answer, the lines that follow it are numbered. I want to look ahead to see if the next line is a numbered line. If so, I want to add it to concatenate it to the answer.
dmiller1 has joined #ruby
monkegjinni has joined #ruby
<apeiros>
pangur: care to show a reduced input file? i.e. 2 normal Q&A, and a third, the middle one, being a multiline?
graeme has quit [Read error: Connection reset by peer]
<apeiros>
because you can probably just use scan on the whole input
<pangur>
OK, I shall try that.
sambio has joined #ruby
<Gate>
So is anyone using amazon simpledb that has a solution for test/development environments?
<bean__>
xll11: httparty is pretty simple and pretty good.
graeme has joined #ruby
graeme has quit [Read error: Connection reset by peer]
graeme has joined #ruby
sepp2k has quit [Remote host closed the connection]
<denstark>
Anyone have a recommendation for a ruby lame library? I'm looking to play streamed mp3s. I saw lamer but it lacks documentation so wanted to see if there were preferred alternatives
i_s has quit [Quit: i_s]
johnmlocklear_ has quit [Ping timeout: 245 seconds]
nazty has joined #ruby
<pangur>
I am sorry that the text of the data file is of a religious nature. However, that is the data with which I am dealing. https://gist.github.com/anonymous/5322138 .
Michael__ has joined #ruby
lupinstien has quit [Ping timeout: 240 seconds]
brennanMKE has quit [Remote host closed the connection]
<MrZYX>
pangur: split at \n\n, first line is question, rest is answer
jrajav has joined #ruby
benlieb has joined #ruby
<pangur>
Thanks Mr ZYX. I want to take the number of the question and index the question and the answer together as it were.
benlieb has quit [Client Quit]
<pangur>
Sorry to take the number off the question.
osvico has quit [Ping timeout: 256 seconds]
<apeiros>
ugh, pastie broken?
<pangur>
What you say MrZYX is helpful for I had an extra blank line where I did not want it at the end of each question.
timonv has quit [Remote host closed the connection]
<pangur>
I really will have to learn about scan and regex.
banjara has quit [Client Quit]
banjara has joined #ruby
baroquebobcat has joined #ruby
<pangur>
puts "Question #{num} - #{question}", answer is giving me output like: Question 144 - 144. What are the duties ...? and then the Answer too. How are the num and the question coming up as if they were the same?
grn_ is now known as grn
nricciar has joined #ruby
sailias has quit [Read error: Operation timed out]
* pangur
hopes that the answer does not make pangur look exceptionally foolish.
whitenoise has quit [Quit: This computer has gone to sleep]
wchun has quit [Quit: Leaving]
banjara has quit [Client Quit]
banjara has joined #ruby
keymone_ has joined #ruby
<apeiros>
ah well, you have the question number in your questions file too. I understood you that those weren't actually there as in your example
<apeiros>
in that case, the code can be reduced even further
<denstark>
either way shthat person has a mazzssive mouth
banjara has quit [Client Quit]
<injekt>
because for good code constructs, `== true` should be completely pointless
banjara has joined #ruby
wmoxam has joined #ruby
tootooroo has quit [Quit: Brain.sys has encountered a problem and needs to close. We are sorry for the inconvenience.]
<denstark>
Erm.. sorry. Lag spike + irssi + wrong window = the above messages
baroquebobcat has joined #ruby
wmoxam has quit [Client Quit]
tootooroo has joined #ruby
EzeQL has joined #ruby
astegman has quit [Quit: Out of time]
banjara has quit [Client Quit]
jon_w has quit [Quit: Occifer, take me drunk, I'm home [www.t7ds.com.br]]
zastern has joined #ruby
banjara has joined #ruby
<zastern>
When I do this - https://gist.github.com/zacharyalexstern/5322558 - Why is foo in the last line automatically the key? Is there a way to make it the value, other than doing what I do on line 9, and just only "puts"ing one of them? (not a programmer [yet] )
memristor has quit [Read error: Connection reset by peer]
hiroyuki_ has quit [Read error: Connection reset by peer]
graeme has quit [Client Quit]
<shevy>
gmm
logix812 has joined #ruby
logix812 has quit [Max SendQ exceeded]
<shevy>
I mean
<shevy>
hmm
<shevy>
my keyboard is off today :\
<shevy>
ok so basically
macabhaird has quit [Quit: Leaving.]
<shevy>
.blank? is like .empty? but also for nil, right?
brennanMKE has quit [Remote host closed the connection]
<MrZYX>
" ".empty? is false, " ".blank? is true
logix812 has joined #ruby
jeebster has joined #ruby
logix812 has left #ruby [#ruby]
<shevy>
ohhhh
<shevy>
I see now, thanks
danman has joined #ruby
<hadees>
So basically I have a hash, using Hashie::Dash, where a couple variables are empty arrays and the rest of the variables are nil but blank is returning false, i'm guessing because of the arrays.
carlyle has quit [Ping timeout: 245 seconds]
<hadees>
So I just want to make blank? for my class return true in that setup
<hadees>
i think it's kosher but I couldn't really find anyone doing it
Es0teric has quit [Quit: Computer has gone to sleep.]
slainer68 has joined #ruby
Arzaga has quit [Quit: Computer has gone to sleep.]
Ontolog_ has joined #ruby
etcetera has joined #ruby
chrishough has quit [Quit: chrishough]
mockra has quit [Ping timeout: 258 seconds]
mando has quit [Remote host closed the connection]
newUser1234 has quit [Remote host closed the connection]
pioz has joined #ruby
<Rym>
what's peoples feelings around open source etiquette? e.g. a cool project, with bad code, relatively short (1k code max)… hack a feature onto the mess, or rewrite it?
Ontolog has quit [Ping timeout: 248 seconds]
ToApolytoXaos has quit [Quit: Leaving]
chrishough has joined #ruby
chrisnicola has joined #ruby
Guedes has quit [Remote host closed the connection]
benlieb has joined #ruby
atno has joined #ruby
headius has joined #ruby
xyzodiac has quit [Quit: Computer has gone to sleep.]
Sicp has joined #ruby
pyx has joined #ruby
pyx has quit [Client Quit]
d2dchat has quit [Remote host closed the connection]
Sicp has quit [Read error: Connection reset by peer]
<netto>
I'm start my server with 'thin' server, and I'm getting this error: .rvm/gems/ree-1.8.7-2012.02/gems/thin-1.5.1/lib/thin/backends/tcp_server.rb:16:in `connect': no such file to load -- thin/connection (MissingSourceFile)
jcheng has joined #ruby
xargoon has quit [Quit: .]
aarush has joined #ruby
headius has quit [Quit: headius]
mikepack has quit [Remote host closed the connection]
aarush has left #ruby [#ruby]
arya has joined #ruby
<netto>
can someone help me?
timmow has quit [Remote host closed the connection]
timmow has joined #ruby
monkegjinni has quit [Remote host closed the connection]
atno has quit [Remote host closed the connection]
xyzodiac has quit [Quit: Computer has gone to sleep.]
cbot_ has joined #ruby
brennanMKE has joined #ruby
<Rym>
netto: does bundler exec thin … help?
<netto>
no
<netto>
thin --prefix /portal start
<netto>
Rym:
cbot_ has quit [Max SendQ exceeded]
AlSquire has joined #ruby
cbot_ has joined #ruby
chrisnicola has joined #ruby
jrhe has joined #ruby
arya has quit [Ping timeout: 248 seconds]
whitenoise has joined #ruby
<Rym>
netto: but are you using a gemfile and does it have gem 'thin' in it?
<netto>
Rym: no… my Gemfile doesnt have thin. But its installed.
threesome has quit [Ping timeout: 264 seconds]
Michael__ has joined #ruby
yfeldblum has joined #ruby
<netto>
Rym: I have 'thin'' in my gem list
agarie has quit [Remote host closed the connection]
<Rym>
I'd give it a test if I were you :) and then try using bundle exec
danneu has joined #ruby
louism2_ has quit [Quit: This computer has gone to sleep]
Michael__ has quit [Ping timeout: 257 seconds]
SCommette has quit [Quit: SCommette]
wsterling has quit [Remote host closed the connection]
bigoldrock has quit [Ping timeout: 264 seconds]
brhelwig has quit [Remote host closed the connection]
threesome has joined #ruby
artofraw has quit [Ping timeout: 252 seconds]
artofraw has joined #ruby
phasma_ has joined #ruby
welandC has joined #ruby
danman has quit [Quit: danman]
Derander_ has joined #ruby
JaTochNietDan_ has joined #ruby
ty-mat has joined #ruby
Blue_Ice_ has joined #ruby
z_ has joined #ruby
ixti_ has joined #ruby
mnaser_ has joined #ruby
SegFaultAX_ has joined #ruby
brianpWins_ has joined #ruby
dagnachew has quit [Quit: WeeChat 0.4.0]
statarb3 has joined #ruby
sepp2k has quit [Remote host closed the connection]
zastern has joined #ruby
<zastern>
So, conceptually, what makes a hash better than a 2-dimensional array?
Rix_ has joined #ruby
<MrZYX>
hash[key] # => value
<zastern>
oh so its just easier to reference values?
<MrZYX>
also way faster than array.find {|e| e.first == key }
tubbo`work has joined #ruby
<MrZYX>
.last
thisirs has joined #ruby
<MrZYX>
I mean they are really different things
lupine_85 has joined #ruby
tvw has quit []
twoism has quit [Remote host closed the connection]
whitenoise has left #ruby ["Leaving"]
pioz has quit [Quit: This computer has gone to sleep]
gaahrdne_ has joined #ruby
artofraw has quit [Remote host closed the connection]
<netto>
.../.rvm/gems/ree-1.8.7-2012.02/gems/bundler-1.3.5/lib/bundler/rubygems_integration.rb:214:in `gem': thin is not part of the bundle. Add it to Gemfile. (Gem::LoadError)
<Rym>
and after you add it to the gem file, how does it look?