bonty_ssh has quit [Remote host closed the connection]
twoism has quit [Remote host closed the connection]
chrisnicola has quit [Quit: This computer has gone to sleep]
timmow has quit [Ping timeout: 252 seconds]
Vivekananda has joined #ruby
<Vivekananda>
back to ruby land
<Vivekananda>
and doing the problems so hello again everyone
snorkdude has quit [Quit: snorkdude]
twoism has joined #ruby
anonymuse has joined #ruby
twoism has quit [Remote host closed the connection]
chrisnicola has joined #ruby
cloke has quit [Quit: cloke]
<Vivekananda>
I am using irb . When I define a couple of variables do they remain on the stack in irb if I dont delete them ?
angusiguess has joined #ruby
<Vivekananda>
also can I somehow find what variabels are still present ?
tootooroo has quit [Quit: Brain.sys has encountered a problem and needs to close. We are sorry for the inconvenience.]
Nisstyre has joined #ruby
<Vivekananda>
anyone here ?
<paper_>
Vivekananda: all the humans are dead
dhruvasagar has joined #ruby
robscomputer_ has quit [Remote host closed the connection]
Ontolog has quit [Remote host closed the connection]
kpshek has quit []
mattbl has joined #ruby
Domon has joined #ruby
tommyvyo has joined #ruby
zph has joined #ruby
<havenwood>
Vivekananda: When you leave irb, they disappear. Is that what you mean?
<Vivekananda>
aha it is paper again
brianpWins has quit [Quit: brianpWins]
<Vivekananda>
havenwood: yes but even if I dont leave it and like constantly testing things assigning variables and so on then I lost track of all arrays I have
<havenwood>
Vivekananda: If you want to persist Ruby objects between irb sessions, Drb is a nice way.
<havenwood>
Vivekananda: Pry gives you really nice options. I'd recommend just switching from irb to Pry.
<Vivekananda>
defined in tthere. I could use any one of the already defined ones for future test. so I just wannan know how to get to them
<Vivekananda>
havenwood yep I heard of pry and I will switch surely but a little laters perhaps. NOw I just wanna know if there is a way to list the variables that I have defined in there
<havenwood>
Ahh
tylersmith has joined #ruby
<havenwood>
In Pry, easy. I don't know in irb.
<Vivekananda>
also yesterday someone helped me install rbevn and now I have that
<havenwood>
Vivekananda: Pry: ls
<Vivekananda>
but how do I use it ?
<havenwood>
Vivekananda: gem install pry; pry
<havenwood>
Vivekananda: Then type 'help' to see Pry commands.
NiteRain has joined #ruby
etcetera has quit []
<havenwood>
Vivekananda: I like chruby, but rbenv works too!
<Vivekananda>
havenwood: one thing is that I dislike to keep two things for the same purpose and if I am going to get pry
<Vivekananda>
then I will unistall the irb . Will that be okay ?
<havenwood>
Vivekananda: irb ships with Ruby
bonty_ssh has joined #ruby
<Vivekananda>
oo so no way to unistall then ?
<Vivekananda>
also how do I use the rbenv ?
<Vivekananda>
I have it installed now wht ?
<Vivekananda>
paper_: hello btw
<havenwood>
Vivekananda: What do you want to do with rbenv?
<Vivekananda>
I just lost you in the middle of scissors and stone
<havenwood>
Vivekananda: Do nothing with it unless you want to switch Rubies. :P
i_s has quit [Quit: i_s]
<Vivekananda>
havenwood: :) I have no clue what it does . I am a newbie on ruby
kofno has joined #ruby
Inside has joined #ruby
<havenwood>
Vivekananda: rbenv is one option for switching between Ruby versions/implementations.
ritek has joined #ruby
<Inside>
what's the difference between puts(2,3) and puts (2,3)? :<
<havenwood>
Vivekananda: If you are using the Ruby you want, just ignore it.
<Vivekananda>
oo ok. I thought it is in enviroment to log into and then perhpas do stuff or open it up incase I install something via it
<havenwood>
Inside: Nothing.
<Vivekananda>
like say pry
<havenwood>
Inside: A space.
<csmrfx>
you dont, you rvm?
<Inside>
havenwood: hrm, for some reason irb is complaining about it.
<nEmiSH_>
but with "yes | BEFORE > /dev/null" or however I can do that same idea in ruby
Hanmac2 has joined #ruby
<Vivekananda>
havenwood: if I can just type from the cli then what do I use the exec $SHELL -l command for ? I had to do that to enter the rbenv or something as suggested in the rbevn readme
<havenwood>
Vivekananda: Forget about rbenv. If you type `ruby -v` from the command line, what do you get?
tootooroo has joined #ruby
Hanmac1 has quit [Ping timeout: 260 seconds]
<havenwood>
Vivekananda: rbenv is just a tool to set the Ruby you are using (it uses shims to do so, while other options like rvm and chruby do it differently)
marcdel has joined #ruby
<Vivekananda>
O lovely I like pry already
<Vivekananda>
:)
<Vivekananda>
a ls for all the variables
<havenwood>
Vivekananda: Yeah, it is really nice.
<Vivekananda>
dont have to redefine and forget and create a log for
<Vivekananda>
okay so on to the problem
<havenwood>
nEmiSH_: Do you really need /dev/null, or you just don't want the command output going to stdout?
tylersmith has quit [Quit: tylersmith]
brennanMKE has quit [Remote host closed the connection]
pilojo has joined #ruby
<nEmiSH_>
doesn't need to be /dev/null problem is it needs to go somewhere otherwise it pages
waxjar has quit [Remote host closed the connection]
<nEmiSH_>
so IO::Null or Bundler::NULL would work i guess
<pilojo>
I find that classes get huge... is there any way to split functions into separate files?
<Vivekananda>
havenwood: I am trying to solve something. I am not asking for a solution but trying to get new or better ideas of solving. the problem is of course paper scissors and rock. when I get two values
<Vivekananda>
like p and s I have to say if person1 is p and person2 is s then 1 wins
<havenwood>
pilojo: Sure, you can just open the class up in another_file.rb, then `require 'another_file'`.
<havenwood>
pilojo: **reopen the class
baroquebobcat has joined #ruby
waxjar has joined #ruby
<Vivekananda>
I was thninking that if I can somehow say P >R >S>P
<pilojo>
havenwood: thanks
LennyLinux has quit [Remote host closed the connection]
<nEmiSH_>
havenwood: anyway to not have it go to stdout should be fine I would guess
<Vivekananda>
I knwo that I can do it in an inelegant way
<nEmiSH_>
havenwood: but I also need yes to be piped before it
soulofpeace has joined #ruby
<Vivekananda>
hmm actually let me do it like that then I will ask for an elegant way
mois3x has joined #ruby
<havenwood>
pilojo: It can be a bit tricky with $LOAD_PATH. You can either add the current dir to $LOAD_PATH, use #require_relative, or require './another_file'.
<nEmiSH_>
havenwood: so the command in the end would be something like "yes | hdiutil mount package.dmg > /dev/null" or the dev/null equivalent
cbot_ has quit [Ping timeout: 240 seconds]
callmeivan has joined #ruby
<havenwood>
nEmiSH_: A common way if you are running a system command is to pipe to /dev/null and just not do it in Ruby. But yeah, sending it to IO::Null with Ruby works as well!
jeebster has quit [Quit: Leaving.]
marcdel has quit [Ping timeout: 245 seconds]
<nEmiSH_>
havenwood: so would the command need to be done here? yes | entity['mount-point'] IO::Null
<kenneth>
paper_: is there a reason that you say "kind of?" caveats?
<paper_>
kenneth: because it's not actually including class methods :)
<paper_>
it's including instance methods defined on a nested module
<kenneth>
right, okay
timmow has joined #ruby
quazimodo has quit [Ping timeout: 256 seconds]
Heero` has quit [Read error: Connection reset by peer]
Elico has left #ruby [#ruby]
cobragoat has quit [Remote host closed the connection]
nalaginrut has joined #ruby
anonymuse has joined #ruby
endzyme has joined #ruby
timmow has quit [Ping timeout: 252 seconds]
BaconRose has quit [Ping timeout: 252 seconds]
peta_ has quit [Quit: peta_]
wsterling has joined #ruby
radic has quit [Disconnected by services]
radic_ has joined #ruby
Ontolog has joined #ruby
mois3x has quit []
mois3x has joined #ruby
bttf has joined #ruby
<bttf>
i've got an interesting problem
skroon_ has joined #ruby
shevy has joined #ruby
<bttf>
i'm using rbenv, and am trying to install passenger with my nginx set up. since i'm using rbenv, i run all my commands as local user .. but the passenger-nginx installer needs to be root in order to make changes to /opt , but when i run as sudo it has no ruby commands accessible to it
matayam has joined #ruby
banjara has quit [Quit: Leaving.]
therrell has quit [Quit: therrell]
snorkdude has quit [Quit: snorkdude]
kenneth has quit [Quit: kenneth]
skroon has quit [Ping timeout: 245 seconds]
therrell has joined #ruby
jpfuentes2 has quit [Quit: Computer has gone to sleep.]
Tectonic has joined #ruby
therrell has quit [Client Quit]
aytch has joined #ruby
mois3x has quit [Ping timeout: 252 seconds]
<bttf>
not sure how to approach this problem
alex2 has joined #ruby
psyprus has quit [Ping timeout: 258 seconds]
<fryguy>
bttf: init rbenv as root user
nezumi has joined #ruby
psyprus has joined #ruby
mercwithamouth has quit [Ping timeout: 256 seconds]
akashj87 has joined #ruby
etcetera has joined #ruby
mercwithamouth has joined #ruby
chrisnicola has quit [Quit: This computer has gone to sleep]
blahwoop has joined #ruby
marienz has quit [Read error: Operation timed out]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
alex2 has quit [Quit: WeeChat 0.4.0]
endzyme has quit [Remote host closed the connection]
divout has joined #ruby
callmeivan has quit [Ping timeout: 252 seconds]
callmeivan has joined #ruby
bluOxigen has joined #ruby
freeayu has quit [Ping timeout: 256 seconds]
cbot_ has joined #ruby
cobragoat has joined #ruby
anonymuse has quit [Quit: Leaving...]
zastern has joined #ruby
<zastern>
In this code - https://gist.github.com/5343052 - why is the "value" variable necessary in the "do" section? It seems to me that it isn't really used.
kuzushi has quit [Ping timeout: 256 seconds]
SeySayux has quit [Read error: Operation timed out]
chrisnicola has joined #ruby
<zastern>
It makes spaces between the lines since it does nothing for the values, I guess.
Villadelfia has quit [Ping timeout: 245 seconds]
dougireton has quit [Quit: Leaving.]
<bean>
if you dont care about the values
<bean>
you can do
<zastern>
bean: I do care about the values, but it's already printing them
BadQuanta has quit [Quit: Leaving]
Huntertusk has quit [Quit: Leaving]
<zastern>
because of the matz[key] bit
<bean>
oh, the matz[key], thing is sort of inefficient
<bean>
you should just do value instead of that
dougireton has joined #ruby
bluOxigen has quit [Ping timeout: 245 seconds]
<zastern>
Sure, fine, I'm just trying to understand the example code and why it is the way it is
kuzushi has joined #ruby
Villadelfia has joined #ruby
freeayu has joined #ruby
dougireton has quit [Read error: Connection reset by peer]
<zastern>
bean: sure that makes a lot more sense now, thanks.
cha1tanya has joined #ruby
<bean>
np
cha1tanya has quit [Changing host]
cha1tanya has joined #ruby
callmeivan has quit [Read error: No route to host]
SeySayux has joined #ruby
callmeivan has joined #ruby
carlyle has quit [Remote host closed the connection]
mockra has quit [Remote host closed the connection]
atno has quit [Ping timeout: 245 seconds]
Domon has joined #ruby
brianpWins has joined #ruby
chxane has quit [Quit: Leaving]
rdev has joined #ruby
cbot_ has quit [Ping timeout: 248 seconds]
sambio has quit []
ctp has joined #ruby
codecop has joined #ruby
rippa has joined #ruby
<Vivekananda>
hey everyone . I am trying to solve a problem. I am getting the correct result in the pry but when I try it in the actual online site I get it is incorrect. why would that be the case. Please look -- https://gist.github.com/anonymous/2c6bbc97031c1a9cf519
philcrissman has quit [Remote host closed the connection]
<Vivekananda>
hi bean
ctp has quit [Ping timeout: 245 seconds]
Burgestrand has joined #ruby
chrisnicola has quit [Quit: This computer has gone to sleep]
robbyoconnor has joined #ruby
chxane has joined #ruby
<mose>
Vivekananda: hi
kuzushi has quit [Ping timeout: 245 seconds]
chandankumar has quit [Ping timeout: 256 seconds]
robbyoconnor has quit [Read error: Connection reset by peer]
thebastl has joined #ruby
<mose>
isn't your [0] in the test causing the test error ?
robbyoconnor has joined #ruby
cha1tanya has quit [Ping timeout: 256 seconds]
aytch has joined #ruby
freakazoid0223 has quit [Ping timeout: 256 seconds]
chrisnicola has joined #ruby
ehaliewicz has quit [Remote host closed the connection]
<Vivekananda>
mose howdy
<Vivekananda>
I am not sure what that is doing there :). Am I required to say something like [0] somewhere or delete it ?
<mose>
I mean rps_game_winner returns a string visibly not an array
<mose>
for teh test to pass the "Armondo" should be ["Armando"]
girija has joined #ruby
<mose>
unless you just remove the [0] from the test
agarie has joined #ruby
angusiguess has joined #ruby
ananthakumaran has joined #ruby
<Vivekananda>
mose I have to make the code conform to the test
<Vivekananda>
how do you know that the test returns and array btw ?
wreckimnaked has quit [Ping timeout: 248 seconds]
agarie_ has quit [Ping timeout: 255 seconds]
angusiguess has quit [Ping timeout: 264 seconds]
tonini has joined #ruby
hamakn_ has joined #ruby
hamakn has quit [Read error: Connection reset by peer]
pyrac has joined #ruby
mockra has joined #ruby
chrisnicola has quit [Quit: This computer has gone to sleep]
ph^ has joined #ruby
aganov has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
djwonk has quit []
<Vivekananda>
mose: are ou ther e?
baroquebobcat has joined #ruby
Morkel has joined #ruby
braoru has joined #ruby
Ng|Adonixx4798 has joined #ruby
Ng|Adonixx4798 has quit [Changing host]
Ng|Adonixx4798 has joined #ruby
tagrudev has joined #ruby
<mose>
sorry I'm working at same time :)
DuncanNZ has joined #ruby
<mose>
then if the test is the boss, you should return an array from the method
<mose>
game[1] and not game[1][0]
miso1337 has joined #ruby
ph^ has quit [Ping timeout: 245 seconds]
axxT has quit [Ping timeout: 240 seconds]
Dreamer3 has quit [Quit: Leaving...]
chandankumar has joined #ruby
baroquebobcat has quit [Client Quit]
gener1c has quit [Remote host closed the connection]
akashj87 has joined #ruby
etcetera has quit []
DuncanNZ has left #ruby ["Leaving"]
i_s has quit [Quit: i_s]
thebastl_ has joined #ruby
Hanmac has quit [Quit: Leaving.]
axxT has joined #ruby
axxT has quit [Changing host]
axxT has joined #ruby
therrell has joined #ruby
kenneth has joined #ruby
chandankumar has quit [Ping timeout: 260 seconds]
BizarreCake has joined #ruby
mnaser has quit [Ping timeout: 256 seconds]
thebastl has quit [Ping timeout: 252 seconds]
v0n has quit [Ping timeout: 240 seconds]
robscomputer_ has joined #ruby
Ng|Adonixx4798 has quit [Ping timeout: 264 seconds]
<Vivekananda>
hmm
<Vivekananda>
okay lemmee try
ckrailo has quit [Quit: Computer has gone to sleep.]
Morkel has quit [Quit: Morkel]
puppeh has joined #ruby
carraroj has joined #ruby
dyeske has joined #ruby
robbyoconnor has quit [Remote host closed the connection]
nomenkun has joined #ruby
_whitelogger has joined #ruby
Apocalypse has quit [Ping timeout: 264 seconds]
kiri has quit [Quit: Leaving]
thebastl_ has quit [Ping timeout: 264 seconds]
rickruby has joined #ruby
chandankumar has joined #ruby
chendo_ has quit [Ping timeout: 245 seconds]
pitzips has quit [Ping timeout: 276 seconds]
freeayu__ has joined #ruby
chendo_ has joined #ruby
freeayu has quit [Ping timeout: 264 seconds]
PanPan has joined #ruby
shevy has quit [Ping timeout: 255 seconds]
cha1tanya has joined #ruby
Apocalypse has joined #ruby
mockra has quit [Remote host closed the connection]
mercwithamouth has quit [Ping timeout: 240 seconds]
workmad3 has joined #ruby
jekotia has quit [Quit: ChatZilla 0.9.90-rdmsoft [XULRunner 18.0.2/20130201065344]]
kiri has joined #ruby
robscomputer_ has quit [Remote host closed the connection]
soulofpeace has quit [Ping timeout: 240 seconds]
robscomputer_ has joined #ruby
anderse has joined #ruby
Pochacco has joined #ruby
Hanmac has joined #ruby
soulofpeace has joined #ruby
bigmac has quit [Quit: Leaving]
Gues_____ has joined #ruby
workmad3 has quit [Ping timeout: 256 seconds]
ananthakumaran1 has joined #ruby
vlad_starkov has joined #ruby
skroon_ has quit [Ping timeout: 245 seconds]
_whitelogger has joined #ruby
_whitelogger has joined #ruby
ananthakumaran has quit [Ping timeout: 252 seconds]
mnaser has joined #ruby
mnaser has quit [Remote host closed the connection]
Pochacco has quit [Ping timeout: 245 seconds]
reset has quit [Quit: Leaving...]
pyrac has quit [Quit: pyrac]
baroquebobcat has joined #ruby
chandankumar is now known as chandankumar|afk
vlad_starkov has quit [Ping timeout: 256 seconds]
monkegjinni has joined #ruby
shock_one has quit [Ping timeout: 256 seconds]
shevy has joined #ruby
angusiguess has joined #ruby
thebastl has joined #ruby
seoaqua has joined #ruby
reset has joined #ruby
Gues_____ is now known as shellox_
Vainoharhainen has joined #ruby
shock_one has joined #ruby
rickruby has quit [Remote host closed the connection]
<Rumsteak>
if I do /bin/my_script.rb, is it possible to get "/bin/my_script.rb" inside the ruby script ?
pyrac has joined #ruby
anderse has quit [Quit: anderse]
<Hanmac>
Rumsteak: did you try $0 and __FILE__ ?
angusiguess has quit [Ping timeout: 255 seconds]
andikr has joined #ruby
<Rumsteak>
Thanks Hanmac, $0 did the trick
dr_bob has joined #ruby
<Rumsteak>
__FILE__ didn't work because I was in a module with his own file, but with $0 I get the original file, so all is good
pyrac has quit [Client Quit]
<Hanmac>
okay i was not sure wich do you want thats why i gave you both
shock_one has quit [Ping timeout: 276 seconds]
Elhu has joined #ruby
ph^ has joined #ruby
ph^ has quit [Read error: Connection reset by peer]
akashj87__ has joined #ruby
aytch has quit [Remote host closed the connection]
oponder has quit [Remote host closed the connection]
Tectonic has quit []
pduin has joined #ruby
akashj87 has quit [Ping timeout: 240 seconds]
baroquebobcat has quit [Quit: baroquebobcat]
ephemerian has joined #ruby
ph^ has joined #ruby
mnaser has joined #ruby
eladmeidar has joined #ruby
wilee-nilee has joined #ruby
wilee-nilee has left #ruby ["Leaving"]
akashj87__ has quit [Quit: Leaving]
tomsthumb has quit [Quit: Leaving.]
Xeago has joined #ruby
<rvchangue>
I'm trying to call super() inside a block passed to Fiber.new, in a method overriden using 'define_method
knapper_tech has quit [Ping timeout: 240 seconds]
<rvchangue>
But ruby throws a NoMethodError. When I override the method normally with def, it works as expected.
greenarrow has quit [Quit: IRC is just multiplayer notepad]
dmerrick has joined #ruby
Xeago has quit [Remote host closed the connection]
greenarrow has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
mulinux has joined #ruby
angusiguess has joined #ruby
JohnBat26 has joined #ruby
wreckimnaked has joined #ruby
JohnBat26 has quit [Client Quit]
dmerrick has quit [Ping timeout: 252 seconds]
alex88 has joined #ruby
JohnBat26 has joined #ruby
mulinux has quit [Remote host closed the connection]
mulinux has joined #ruby
KazW is now known as KazW_away
pyrac has joined #ruby
emergion has joined #ruby
mneorr has joined #ruby
filipe has quit [Ping timeout: 256 seconds]
angusiguess has quit [Ping timeout: 252 seconds]
postmodern has quit [Quit: Leaving]
mneorr has quit [Remote host closed the connection]
jmeeuwen has joined #ruby
wreckimnaked has quit [Ping timeout: 245 seconds]
tootooroo has quit [Quit: Brain.sys has encountered a problem and needs to close. We are sorry for the inconvenience.]
KazW_away is now known as KazW
Vivekananda has quit [Remote host closed the connection]
decentrality has quit [Ping timeout: 246 seconds]
lmf40 has joined #ruby
nplusp has quit [Read error: Connection reset by peer]
Ontolog has quit [Remote host closed the connection]
apeiros has joined #ruby
dagobah has joined #ruby
ritek has quit [Quit: leaving]
tish has quit [Quit: Leaving.]
emergion has quit [Quit: Computer has gone to sleep.]
skroon has joined #ruby
decentrality has joined #ruby
answer_42 has joined #ruby
akashj87 has joined #ruby
filipe has joined #ruby
yann_ck has joined #ruby
DrCode has joined #ruby
nickbuff has joined #ruby
predator117 has quit [Ping timeout: 276 seconds]
beneggett has quit [Quit: Computer has gone to sleep.]
predator117 has joined #ruby
doritostains has joined #ruby
mulinux has quit [Quit: mulinux]
rezzack has joined #ruby
maxmanders has joined #ruby
backjlack has joined #ruby
marr has joined #ruby
Al__ has joined #ruby
beneggett has joined #ruby
hmarr has joined #ruby
samuel02 has joined #ruby
nickbuff has quit [Quit: Leaving...]
elaptics`away is now known as elaptics
KazW is now known as KazW_away
pyrac has quit [Quit: pyrac]
KazW_away is now known as KazW
rdark has joined #ruby
Zeev has joined #ruby
alup has joined #ruby
MrZYX|off is now known as MrZYX
reset has quit [Read error: Operation timed out]
hamakn_ has quit [Read error: Connection reset by peer]
hamakn has joined #ruby
DaDaDOSPrompt has joined #ruby
freeayu__ has quit [Ping timeout: 256 seconds]
chussenot has joined #ruby
Akuma has quit [Ping timeout: 264 seconds]
Es0teric has quit [Quit: Computer has gone to sleep.]
Elhu has joined #ruby
predator117 has quit [Ping timeout: 252 seconds]
aytch has joined #ruby
yashshah has joined #ruby
oponder has joined #ruby
predator117 has joined #ruby
tjbiddle has quit [Quit: tjbiddle]
Amnesthesia has joined #ruby
Elhu has quit [Client Quit]
Elhu has joined #ruby
ephemerian has quit [Quit: Leaving.]
mneorr has joined #ruby
enriclluelles has joined #ruby
pi3r has joined #ruby
<jsaak>
any eventmachine users? how is it possible that my eventmachine is using ppoll accordong to strace, instead of epoll?
<hoelzro>
jsaak: my guess is you don't have a binding to epoll installed?
timmow has joined #ruby
<jsaak>
what is that? :)
* hoelzro
shrugs
<hoelzro>
check the EM source and try to figure out how it determines which event mechanism to use
<jsaak>
have_func: checking for epoll_create() in sys/epoll.h... -------------------- yes
lmf40 has quit [Read error: Connection reset by peer]
lmf40 has joined #ruby
<jsaak>
i havent found any reference to ppoll at all in the source
daniel_- has joined #ruby
freeayu__ has joined #ruby
<hoelzro>
that's in the EM configuration?
<hoelzro>
perhaps EM is using libev or something
<jsaak>
yes
KazW is now known as KazW_away
KazW_away is now known as KazW
kenneth has quit [Read error: Connection reset by peer]
right1 has joined #ruby
bw_ has joined #ruby
predator117 has quit [Ping timeout: 264 seconds]
generalissimo has quit [Remote host closed the connection]
predator117 has joined #ruby
MrZYX is now known as MrZYX|off
swex_ has joined #ruby
MrZYX|off is now known as MrZYX
swex has quit [Ping timeout: 245 seconds]
brianpWins has quit [Quit: brianpWins]
pyrac has joined #ruby
lmx has quit [Quit: lmx]
adac has joined #ruby
Akuma has joined #ruby
bricker`LA has joined #ruby
answer_42 has quit [Quit: WeeChat 0.4.0]
<bricker`LA>
Isn't there something that lets you iterate over an array, grouped by n elements at a time? [1, 2, 3, 4, 5, 6].each(3) { |group| group.each { |n| p n } }
<bricker`LA>
or something like that
monkegjinni has quit [Read error: Connection reset by peer]
answer_42 has joined #ruby
monkegjinni has joined #ruby
<MrZYX>
bricker`LA: #each_cons
<MrZYX>
or #each_slice
<MrZYX>
depending on what you want exactly
keymone_ has joined #ruby
tonini has joined #ruby
samuel02 has quit [Remote host closed the connection]
danslo has joined #ruby
<bricker`LA>
MrZYX: that's it! Thanks
<MrZYX>
I'd recommend you to read through Enumerable so got an idea what's available
monkegji_ has quit [Remote host closed the connection]
hmarr has quit [Ping timeout: 252 seconds]
noahsussman has left #ruby [#ruby]
<troessner>
bguery, IF i remember correctly capistrano sets up a `stage` variable which you can refer to in your scripts
hmarr has joined #ruby
gaahrdner has joined #ruby
jonathanwallace has joined #ruby
<apeiros>
awesome workflows for the win - fix gem on work desktop, push to company git server, pull to work laptop, push to github, pull on private laptop, push to rubygems, bundle update on work desktop
<bguery>
troessner, ok, I'm not a ruby developer, so I'm not aware on how I could get it from a custom task, I tried task :something do puts stage; end but it looks like the 'stage' symbol is not found
<troessner>
bguery, afraid i can't help you there further, this is like 5 years ago, sorry
yshh has quit [Remote host closed the connection]
nyuszika7h has quit [Remote host closed the connection]
girija has joined #ruby
arya has joined #ruby
nyuszika7h has joined #ruby
endzyme has joined #ruby
io_syl has quit [Quit: Computer has gone to sleep.]
Macaveli has left #ruby ["Leaving"]
endzyme has quit [Read error: Connection reset by peer]
endzyme has joined #ruby
jtharris has joined #ruby
interactionjaxsn has joined #ruby
dustint has joined #ruby
pioz has joined #ruby
LennyLinux has quit [Read error: Connection reset by peer]
LennyLinux has joined #ruby
KazW is now known as KazW_away
camilasan has quit [Remote host closed the connection]
dhruvasagar has quit [Ping timeout: 260 seconds]
KazW_away is now known as KazW
jerius_ has joined #ruby
[eDu] has joined #ruby
monkegjinni has joined #ruby
tealmage has joined #ruby
bean__ has quit [Quit: Computer has gone to sleep.]
camilasan has joined #ruby
jerius has quit [Ping timeout: 245 seconds]
jerius_ is now known as jerius
nyuszika7h has quit [Read error: Connection reset by peer]
chrisnicola has joined #ruby
tommyvyo has joined #ruby
nyuszika7h has joined #ruby
<bguery>
troessner, too bad, thanks anyway
failshell has joined #ruby
<Hanmac>
apeiros: i think i need to drop my plans with instance_method and instance_exec ... i think they are too meta and too difficult to debug ... currently i am back again to my private *_cs_* methods ... :/
voodoofish has joined #ruby
aganov has quit [Quit: aganov]
a_a_g has quit [Quit: Leaving.]
rdark has quit [Ping timeout: 248 seconds]
jgarvey has joined #ruby
codecop has quit [Remote host closed the connection]
jprovazn has quit [Quit: Leaving]
wolcanus has quit [Read error: Connection reset by peer]
ph^ has quit [Ping timeout: 256 seconds]
wolcanus has joined #ruby
rdark has joined #ruby
pioz has quit [Quit: This computer has gone to sleep]
<ij>
Is a singleton class always created when creating an object or only when there's a neccessity?
momomomomo has joined #ruby
<paper_>
ij: for objects they're created lazily, for classes they're created when the class is defined
sleetdrop has joined #ruby
<ij>
cool, thanks
tagrudev has quit [Quit: Me = Awesome]
robscomputer_ has joined #ruby
akemrir has quit [Quit: WeeChat 0.4.0]
t_p has joined #ruby
atyz has quit [Quit: Leaving...]
<paper_>
ij: for modules they're created lazily too
aytch has quit [Ping timeout: 245 seconds]
monkegjinni has quit [Read error: Connection reset by peer]
atyz has joined #ruby
monkegjinni has joined #ruby
<Hanmac>
for false, true and nil, there is no real singleton_class, but the normal Class acts like one
<ij>
Same for numbers?
DrShoggoth has quit [Quit: Leaving]
<ij>
Oh, wait, you can't define singleton on those.
<Hanmac>
yeah, true, false and nil are a bit different
cbot_ has joined #ruby
chrisnicola has quit [Quit: This computer has gone to sleep]
atyz has quit [Client Quit]
jbueza has joined #ruby
v0n has joined #ruby
aytch has joined #ruby
davetherat has quit [Remote host closed the connection]
davetherat has joined #ruby
[eDu] has quit [Quit: [eDu]]
davetherat has quit [Remote host closed the connection]
niklasb has quit [Ping timeout: 245 seconds]
davetherat has joined #ruby
<apeiros>
Hanmac: :-/
jpcamara has joined #ruby
keyvan has quit [Remote host closed the connection]
tevio has joined #ruby
monkegjinni has quit [Read error: Connection reset by peer]
monkegjinni has joined #ruby
<Hanmac>
apeiros: what is the smilie about? about that this three are different or about my _cs_ methods?
keej has joined #ruby
atyz has joined #ruby
v0n has quit [Client Quit]
v0n has joined #ruby
ctp has joined #ruby
_maes_ has joined #ruby
yann_ck has joined #ruby
jeffreybaird has joined #ruby
noos has joined #ruby
jtharris has quit [Quit: WeeChat 0.4.0]
aytch has quit [Ping timeout: 240 seconds]
Lockzi has joined #ruby
pitzips has joined #ruby
wesside_ has joined #ruby
hogeo has quit [Remote host closed the connection]
nateberkopec has joined #ruby
yshh has joined #ruby
yshh has quit [Remote host closed the connection]
yshh has joined #ruby
ZachBeta has quit [Quit: Computer has gone to sleep.]
monkegjinni has quit [Remote host closed the connection]
zwevans has joined #ruby
ParanoidSP has joined #ruby
yshh has quit [Read error: Connection reset by peer]
yshh has joined #ruby
geekbri has joined #ruby
jeffreybaird has left #ruby [#ruby]
LaPetiteFromage has joined #ruby
bean__ has joined #ruby
filipe has quit [Ping timeout: 245 seconds]
nezumi has joined #ruby
b0oh1 has joined #ruby
b0oh1 has quit [Client Quit]
Burgestrand has quit [Quit: Burgestrand]
tevio has quit [Remote host closed the connection]
puppeh has quit [Remote host closed the connection]
monkegjinni has joined #ruby
jlast has joined #ruby
jtharris has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
wsterling has joined #ruby
wsterling has quit [Remote host closed the connection]
DrShoggoth has joined #ruby
wsterling has joined #ruby
monkegjinni has quit [Remote host closed the connection]
monkegjinni has joined #ruby
jekotia has joined #ruby
drale2k has joined #ruby
wesside_ has quit [Quit: Ice cream truck!]
niceguyjames has quit [Quit: Computer has gone to sleep.]
wesside_ has joined #ruby
MarioEIU has joined #ruby
Lockzi has quit [Ping timeout: 245 seconds]
MarioEIU has left #ruby [#ruby]
Burgestrand has joined #ruby
GhettoCode has joined #ruby
wolcanus has quit [Remote host closed the connection]
enebo has joined #ruby
niceguyjames has joined #ruby
wargasm has joined #ruby
RORgasm has joined #ruby
wargasm1 has quit [Ping timeout: 252 seconds]
workmad3 has joined #ruby
braoru has quit [Quit: Leaving]
baroquebobcat has joined #ruby
mando has joined #ruby
dylan` has joined #ruby
wolcanus has joined #ruby
wesside has quit [Quit: Computer has gone to sleep.]
ningu has joined #ruby
tevio has joined #ruby
Lockzi has joined #ruby
<ningu>
hey n00b question here... gem list shows a gem but requre <gem> doesn't work, any idea why?
<MrZYX>
ruby -v?
<ningu>
require, even.
<ningu>
1.8.7
dylan has quit [Ping timeout: 245 seconds]
vlad_starkov has quit [Remote host closed the connection]
<ningu>
OS X stock
<Hanmac>
ningu require "rubygems" first
<ericwood>
1.8.7 :(
<ningu>
ah ok :)
* ericwood
shakes his head
ttt has joined #ruby
<ningu>
what would a more sensible stock version be?
<ningu>
I can always install a newer one, this is just a one-off thing
<MrZYX>
ningu: be aware the the current release is 2.0 and support for 1.8 will end soon
<ericwood>
2.0.0
filipe has joined #ruby
<ericwood>
OS X just won't update their stuff because they're mean
dhruvasagar has joined #ruby
<ningu>
yeah, looks like I need a newer version anyway since this thing uses require_relative
* MrZYX
just hopes for a sec vuln. in 1.8 only after the support ended :P
<ningu>
ah well I'll just brew install ruby
<ericwood>
I'd recommend installing rvm and doing "rvm install 2.0.0"
<ningu>
how come?
* ericwood
shrugs
Burgestrand has quit [Quit: Burgestrand]
DefV_ is now known as DefV
elux has joined #ruby
rdark has quit [Ping timeout: 276 seconds]
<ij>
Is there a method that prints the default error message from an exception?
ningu has quit [Quit: leaving]
Macaveli has joined #ruby
k610 has quit [Ping timeout: 264 seconds]
<ericwood>
the exception object should have a message method
dylan_ has quit [Read error: Connection reset by peer]
huntertusk has quit [Remote host closed the connection]
dylan_ has joined #ruby
<danneu>
ianbishop: ever try weechat? (brew install weechat, etc). it's like irssi with some better defaults
<e-dard>
Hi, I'm currently experimenting between writing a CSV writing part of our system in Ruby or some faster language (currently Go).
jonathanwallace has quit [Quit: WeeChat 0.3.9.2]
<e-dard>
Go is about 8 times faster than 1.9.3 for writing (and quoting) data to a csv file. Ruby is using FasterCSV ASFAIK, which is written in C. Where is the gap coming from?
<danneu>
e-dard: i'd check out the source for what's actually happening in `csv << row` magic.
greenarrow has joined #ruby
dsdeiz has joined #ruby
<JonnieCache>
e-dard: avoid making any objects you dont need
tootubular has quit [Quit: tootubular]
TooTubular_ is now known as TooTubular
<JonnieCache>
e-dard: the really slow part of ruby is keeping track of the object model
mikepack has joined #ruby
<e-dard>
OK, so append would be faster?
<dsdeiz>
heya, anyone using rbenv? what's the common way of adding the path to installed gems? say i did 'gem install compass' and the binary is in ~/.rbenv/versions/some-version/bin/compass?
TooTubular is now known as tootubular
<JonnieCache>
dsdeiz: you need to run rbenv rehash probably
jerius has quit []
sayan has joined #ruby
<e-dard>
dang.. Turns out Go is 8 times faster at writing *and* generating the data (bug in my Go code)
<dsdeiz>
ohhh
rippa has joined #ruby
<dsdeiz>
awesome, thx!
<Hanmac>
paper_: so you named after paper-pete? ;P
soulofpeace has joined #ruby
tomsthumb has joined #ruby
alup has quit [Quit: Leaving]
<tubbo>
e-dard: hmm, good to know
<e-dard>
JonnieCache: so what quick improvements could I make to the Ruby code? I realise Ruby will always be slower, but unless I can seriously speed it up gonna have to ditch it :(
martinklepsch has quit [Ping timeout: 264 seconds]
<peta_>
hi guys
codecop has joined #ruby
NiteRain has joined #ruby
sayan has quit [Ping timeout: 245 seconds]
cha1tanya has quit [Ping timeout: 245 seconds]
<danneu>
e-dard: try returning 'nil'. after the DATA.each is finished (before you leave the `time` block)
<nezumi>
e-dard, maybe look at JRuby? It has some pretty good optimizations in the JVM
<Hanmac>
but beware, jruby is not the solution for everything
<danneu>
e-dard: if DATA.each is buffering output for display, then that would also take time.
<peta_>
When I have class method xyz, how can I refer from within that class method to the class it is called on? Say that the class method xyz is defined in MySuperclass and I call it on MySubclass it will refer to MySubclass?
BadLarry has quit [Quit: quitting]
<Hanmac>
peta_ you can use self
Corey has quit [Read error: Connection reset by peer]
<JonnieCache>
e-dard: if youve written one in go that works and is 350% faster i would just use that one and get on with your life
Neomex has joined #ruby
<e-dard>
JonnieCache: :-)
evenix has joined #ruby
cha1tanya has joined #ruby
BadLarry has joined #ruby
<peta_>
Hanmac: ah right
mando has quit [Remote host closed the connection]
<peta_>
thx
sayan has joined #ruby
ARCADIVS has quit [Quit: WeeChat 0.3.8]
mando has joined #ruby
Neomex has quit [Client Quit]
sambio has joined #ruby
sambio has quit [Changing host]
sambio has joined #ruby
Neomex has joined #ruby
Neomex has quit [Client Quit]
tiripamwe has quit [Ping timeout: 264 seconds]
Al__ has quit [Ping timeout: 240 seconds]
jasona has joined #ruby
nobuoka has quit [Quit: Leaving...]
sambio has quit [Client Quit]
CaTeGoRe has joined #ruby
Morkel has quit [Quit: Morkel]
bluOxigen has joined #ruby
maletor has joined #ruby
Czupa has quit [Remote host closed the connection]
baroquebobcat has quit [Quit: baroquebobcat]
jon_w has quit [Ping timeout: 245 seconds]
brennanMKE has joined #ruby
wolcanus has quit [Remote host closed the connection]
jon_w has joined #ruby
jon_w has quit [Max SendQ exceeded]
ckrailo has joined #ruby
jon_w has joined #ruby
jon_w has quit [Max SendQ exceeded]
jon_w has joined #ruby
jon_w has quit [Max SendQ exceeded]
jon_w has joined #ruby
jon_w has quit [Max SendQ exceeded]
jon_w has joined #ruby
jon_w has quit [Max SendQ exceeded]
CaTeGoRe has left #ruby ["Leaving"]
jon_w has joined #ruby
atmosx has joined #ruby
maletor has quit [Ping timeout: 256 seconds]
volte_ has joined #ruby
tiripamwe has joined #ruby
Zolo has joined #ruby
volte has quit [Ping timeout: 256 seconds]
marcgg has joined #ruby
<ericwood>
I keep using "this" instead of "self" because apparently I can't switch between ruby and JS easily >.<
marcgg_ has quit [Ping timeout: 240 seconds]
<danneu>
ericwood: now's a great time to start coffeescript then where "@" is shorthand for this!
<danneu>
always good to throw your brain some obstacles to keep it sharp
Zolo has quit [Remote host closed the connection]
<danneu>
this.color vs @color
Kruppe has quit [Remote host closed the connection]
nomenkun_ has quit [Read error: Operation timed out]
keyword has joined #ruby
vlad_starkov has quit [Ping timeout: 240 seconds]
wolcanus has joined #ruby
generalissimo has joined #ruby
Al__ has joined #ruby
tevio has quit [Remote host closed the connection]
x0F has quit [Ping timeout: 246 seconds]
veinofstars has joined #ruby
<keyword>
hi guys I have a problem with delayed job I want to enqueue one process in the after_save but I always get error http://pastie.org/private/ccnrbcvqvoobosz2xwe0w anyone can helpme?
finnnnnnnnnnn has joined #ruby
skroon has quit [Ping timeout: 256 seconds]
sleetdrop has joined #ruby
<Hanmac>
keyword: try at #rubyonrails
guns has quit [Quit: guns]
<ericwood>
#railsonruby
keyword has left #ruby [#ruby]
<ericwood>
#railsonruby is where people go to rail on ruby ;)
<troessner>
mocfive, you're referring to "method chaining" i assume
<finnnnnnnnnnn>
silly question - I want to move all files and folders to their parent folder then delete the original folder - FileUtils.mv 'release/child_folder/*', 'release/'
ariedler has quit [Remote host closed the connection]
sambio has quit []
<finnnnnnnnnnn>
I have the incorrect syntax
ninegrid has joined #ruby
a_a_g has quit [Read error: Connection reset by peer]
<troessner>
mocfive, class C; def first; self; end; def second; self; end; end -> then you can do: c = C.new; c.first.second
<atmosx>
seriously, I love it. It kept me company so many times and also gave me solutions that I'd never imagine, so it's more than okay. Fb and twitter are okay too as long as you use for what they are: hook-up / news.
<reactormonk>
ericwood, and help other people do something ;-)
<marwinism>
julian-delphiki and paper_ thanks alot! I'll look into that!
<billiam>
I've stumbled on a gem that does something like system("open path/to/generated/file"). Is there a more generic way of doing that that will be more cross-platform friendly?
slainer68 has quit [Ping timeout: 256 seconds]
<billiam>
ex: system("start path/to/file") would be the equivalent in windows...
momomomomo has quit [Ping timeout: 248 seconds]
mootpointer has joined #ruby
danneu has quit [Quit: WeeChat 0.3.8]
momomomomo has joined #ruby
mneorr has joined #ruby
BizarreCake has quit [Remote host closed the connection]
thetristan has quit [Quit: thetristan]
dmerrick has joined #ruby
mpereira has quit [Ping timeout: 276 seconds]
whowantstolivef1 has joined #ruby
shock_one has joined #ruby
tjbiddle_ has joined #ruby
<Hanmac>
paper_ the last AT episode was totaly "Alphanumeric!" ;P
<e-dard>
If you know that once you are done, your process will end, and you see massive improvements in disabling the GC for the duration of the process, are there any downsides?
endzyme has quit [Remote host closed the connection]
supergiantrobot_ has quit [Quit: supergiantrobot_]
_nitti has quit [Remote host closed the connection]
<Hanmac>
paper_ i like the Billy Song ;P
Whoop has quit [Quit: Gone]
<swarley>
billiam, there isn't a very cross platform way to do it built in. You would just check the platform you're on and execute the command that matches the platform
<billiam>
swarley, yeah, looks that way. Thanks :)
<paper_>
Hanmac: i dont recognize half those songs, i guess i missed a lot of episodes :/
<e-dard>
paper_: so you mean, instead of disabling GC, use that to free MASSIVE_DATA_STRUCTURE after I'm done with it?
<paper_>
e-dard: yes, but HEHE dont use 'free', it makes jesus cry
<apeiros>
mechcozmo: note though that "statically" doesn't really make sense in ruby. classes are objects. when you call File.directory?, you are effectively calling an instance method.
anderse has quit [Quit: anderse]
dhruvasagar has joined #ruby
<mechcozmo>
Right.
anderse has joined #ruby
hydrozen has joined #ruby
<mechcozmo>
Is there another option? . and .. are correctly being reported as directories, but the other directories are not
tootooroo has joined #ruby
tenmilestereo has quit [Quit: Leaving]
freezey has quit [Remote host closed the connection]
zph has quit [Client Quit]
mando has joined #ruby
F1skr has joined #ruby
frem has joined #ruby
<apeiros>
mechcozmo: unlikely. paste the code please.
<apeiros>
(gist.github.com or pastie.org)
Burgestrand has joined #ruby
axl__ has joined #ruby
tangledhelix has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
LaPetiteFromage has quit [Ping timeout: 252 seconds]
LaPetiteFromage_ is now known as LaPetiteFromage
guns has joined #ruby
<Hanmac>
hm no, it the problem that chdir is not called, so the File.directory? does not know about
rizzatti has quit [Quit: Leaving...]
zph has joined #ruby
Rumsteak has joined #ruby
LaPetiteFromage_ has joined #ruby
julian-delphiki has quit [Quit: Computer has gone to sleep.]
LaPetiteFromage has quit [Ping timeout: 245 seconds]
LaPetiteFromage_ is now known as LaPetiteFromage
mootpointer has quit [Quit: Computer has gone to sleep.]
<mechcozmo>
Hanmac: What should I call chdir on? I can't find a chdir method for the File class
<Hanmac>
its in the Dir class ... but its a bit anoying that the Dir class cant do it yourself ;/
sonda has quit [Remote host closed the connection]
<apeiros>
Hanmac: d'oh. Dir#each lists the names only
maxmanders has joined #ruby
huoxito has quit [Quit: Leaving]
<apeiros>
mechcozmo: use Dir.glob instead of Dir.new. easier to handle. includes the complete path.
<mechcozmo>
Ok
<apeiros>
the problem is that you test 'foo' whether it's a dir/file, but you really want to test ~/Desktop/rubytest/oldweb/foo
Skylab has quit [Quit: Skylab]
<apeiros>
and the two are not the same
<apeiros>
well spotted Hanmac
zastern has quit [Ping timeout: 256 seconds]
<mechcozmo>
And it looks like I don't need to use Dir.new anymore
<mechcozmo>
For what that's worth
jtharris has joined #ruby
arusso_znc is now known as arusso_
julian-delphiki has joined #ruby
pkrnj has joined #ruby
freakazoid0223 has quit [Read error: Connection reset by peer]
Elhu has joined #ruby
<mechcozmo>
ah-ha, it works
<mechcozmo>
now to add recursion
Nisstyre-laptop has quit [Ping timeout: 240 seconds]
rippa has quit [Ping timeout: 240 seconds]
Joel has joined #ruby
blaines has joined #ruby
<Hanmac>
use something like **/**/**/** :P
<mechcozmo>
:-P
<Joel>
I'm running into an issue that I think is related to changes in ruby past 1.8.7. I can no longer use american dates, 'mm/dd/yyyy', can anyone confirm/deny this? know of any work arounds?
<Hanmac>
since 1.9 american does not exist anymore ;P
araujo has joined #ruby
araujo has quit [Changing host]
araujo has joined #ruby
chrisnicola has quit [Quit: This computer has gone to sleep]
<Joel>
great, but, what work arounds are there?
<Joel>
my_date_formats = { :default => '%d/%m/%Y' }; Time::DATE_FORMATS.merge!(my_date_formats); Date::DATE_FORMATS.merge!(my_date_formats) # Doesn't appear to work for me.
lmf40 has joined #ruby
brennanMKE has quit [Remote host closed the connection]
guns has quit [Remote host closed the connection]
monkegjinni has joined #ruby
csaunders has quit [Quit: Computer has gone to sleep.]
chrisnicola has joined #ruby
<Hanmac>
Joel use strptime
answer_42 has quit [Ping timeout: 276 seconds]
lmf40 has quit [Remote host closed the connection]
<Joel>
Hanmac: I'm trying to get this to work with activerecord in rails.
connor_goodwolf has quit [Ping timeout: 240 seconds]
jpfuentes2 has joined #ruby
chandankumar has quit [Quit: Leaving]
connor_goodwolf has joined #ruby
<Hanmac>
Joel than you are in the wrong channel: #rubyonrails
<Joel>
forgive me for starting here wondering why functionality was removed.
mpereira has joined #ruby
DrCode has quit [Remote host closed the connection]
<Hanmac>
paper_ did you look over my code? maybe you allready have ideas to make it better
jpcamara has quit [Quit: jpcamara]
xardas has quit [Read error: Connection reset by peer]
<paper_>
Hanmac: too many files :P can you link a specific file?
thone has joined #ruby
bruschill has joined #ruby
<Hanmac>
paper_: you can begin in the new_rpg_data folder with the battler ones
slainer68 has joined #ruby
brennanMKE has joined #ruby
bruschill has quit [Client Quit]
FrostyAcres has joined #ruby
buibex has joined #ruby
`p has joined #ruby
<paper_>
Hanmac: why dont you use 2 spaces ? :)
Vivekananda has joined #ruby
<Hanmac>
paper because its easier for me, and you can teach your browser to show it as 2 spaces
rickmasta has quit [Quit: Leaving...]
lmf40 has quit [Read error: Connection reset by peer]
io_syl has quit [Quit: Computer has gone to sleep.]
lmf40 has joined #ruby
<paper_>
Hanmac: why is it easier for u?
razibog has joined #ruby
ToApolytoXaos has quit [Quit: Leaving]
justsee has joined #ruby
justsee has quit [Changing host]
justsee has joined #ruby
divout has quit [Quit: Leaving.]
<Hanmac>
because curently i use gedit for this files
internetishard has joined #ruby
<paper_>
Hanmac: i'm surprised you use such a (relatively) primitive editor :)
<paper_>
i expected emacs or at least vim
<internetishard>
I've a bunch of stuff that I want to loop until the exit code of each is 0
<internetishard>
How would you do this?
kenneth has quit [Quit: kenneth]
<internetishard>
Is there a 'while exit code = 0' in ruby do; ?
kenneth has joined #ruby
<ericwood>
system() returns the exit code
jkamenik has joined #ruby
slainer68 has quit [Ping timeout: 252 seconds]
jnoob22 has quit [Remote host closed the connection]
<internetishard>
ok, so I'd put each of these functions inside system(), and I do while systems(some return value == 0)?
<internetishard>
ericwood: is that what you're saying?
pioz has joined #ruby
<ericwood>
system('bash crap') will execute the shell code and return the return value
<MrZYX>
internetishard: you want to run all again if one is nonzero?
majikbytes has joined #ruby
x0F has quit [Ping timeout: 255 seconds]
<ericwood>
begin; val = system('rm -rf /'); end while val == 0
rotham has joined #ruby
TheMoonMaster has quit [Quit: Later!]
<internetishard>
MrZYX: yep
<MrZYX>
begin; codes = system(..); codes += system(..); ... end while !codes.zero?
Neandre has quit [Read error: Operation timed out]
<internetishard>
well let's assume each function is a ruby function, and I want to keep going if there is a exit code != 0
tevio has joined #ruby
nfk has quit [Quit: yawn]
<ericwood>
begin; val = your_ruby_thingamajig; end while val == 0
<rotham>
how do I make a method a class method instead of an instance method?
<ericwood>
rotham: self.method_name
<ericwood>
def self.foobar
Neandre has joined #ruby
benweint has joined #ruby
sailias has quit [Ping timeout: 246 seconds]
<internetishard>
MrZYX: I don't really get your code, but ericwood's sounds like I'm doing begin; val = function_with_sometimes_working_functions; end while val == 0
rizzatti has joined #ruby
<ericwood>
our code is almost identical :P
wmoxam has quit [Ping timeout: 264 seconds]
<ericwood>
but mine is totally better because I wrote it :D
mando has quit [Remote host closed the connection]
<MrZYX>
except that I got the requirement that it should run while the sum is nonzero :P
al3xnull has joined #ruby
<MrZYX>
and that you got multiple functions
<ericwood>
pffft
forrest has quit [Quit: Leaving]
geekbri has quit [Remote host closed the connection]
wyattg has quit [Remote host closed the connection]
<MrZYX>
so begin; val = meth1; val += meth2; val += meth3; ... end while !val.zero?
<ericwood>
^^^^^ that's the best way
kpshek has quit []
<MrZYX>
internetishard: you confused us because we call return value what you called exit code ;)
<ericwood>
yep
<MrZYX>
processes have exit codes, ruby functions have return values
<MrZYX>
internetishard: sure, how would you track it if you don't capture it?
<internetishard>
There's no way to say "anything that doesn't return a zero will affect the eventual return value of the function and cause it to run again"
brad[] has quit [Read error: Connection reset by peer]
<Hanmac>
Xeago its called engine but currenlty i am working on the scripting part
veinofstars has quit [Ping timeout: 255 seconds]
veinofstars_ is now known as veinofstars
samuel02 has quit [Remote host closed the connection]
Davey has quit [Quit: Computer has gone to sleep.]
therrell has joined #ruby
Rym has quit [Quit: Rym]
etcetera has quit []
samuel02 has joined #ruby
havenwood has joined #ruby
s00pcan_ has joined #ruby
samuel02 has quit [Remote host closed the connection]
samuel02_ has joined #ruby
fcoury- has joined #ruby
<internetishard>
MrZYX: Ruby tracks them, right? So the return value of the whole function will be non-zero if any function inside is...
drago777 has joined #ruby
<MrZYX>
nope
<MrZYX>
unless you use the return statement the last expression will be returned
crazysim_ has joined #ruby
sirecote_ has joined #ruby
havenwood has quit [Remote host closed the connection]
<MrZYX>
and only the last expression
<paper_>
Hanmac: i dont see anything obviously wrong with it, but it's not that idiomatic :P
kirun has quit [Ping timeout: 248 seconds]
Kov|sumika has joined #ruby
tr4656_ has joined #ruby
Spitfire- has joined #ruby
plaisn has joined #ruby
sambao21 has joined #ruby
jso_ has joined #ruby
adamjleonard has joined #ruby
Mohan_ has quit [*.net *.split]
Kovensky has quit [*.net *.split]
zodiak has quit [*.net *.split]
sirecote has quit [*.net *.split]
fcoury has quit [*.net *.split]
drago777- has quit [*.net *.split]
crazysim has quit [*.net *.split]
daed has quit [*.net *.split]
hakunin has quit [*.net *.split]
xybre has quit [*.net *.split]
s00pcan has quit [*.net *.split]
plains has quit [*.net *.split]
emptymag00 has quit [*.net *.split]
Johbe has quit [*.net *.split]
mtlatif has quit [*.net *.split]
karnowski has quit [*.net *.split]
deavid has quit [*.net *.split]
tr4656 has quit [*.net *.split]
rking has quit [*.net *.split]
thibauts has quit [*.net *.split]
beasty has quit [*.net *.split]
uxp has quit [*.net *.split]
jso has quit [*.net *.split]
pcarrier has quit [*.net *.split]
Spitfire has quit [*.net *.split]
kalleth has quit [*.net *.split]
mose has quit [*.net *.split]
Kov|sumika is now known as Kovensky
crazysim_ is now known as crazysim
sirecote_ is now known as sirecote
fcoury- is now known as fcoury
slainer68 has joined #ruby
apeiros has quit [Remote host closed the connection]
brennanMKE has quit [Remote host closed the connection]
qohelet_ has quit [Quit: qohelet_]
pioz has quit [Quit: This computer has gone to sleep]
Spitfire- has quit [Changing host]
Spitfire- has joined #ruby
<paper_>
like, you're using {} for multiline blocks, you're using tabs for indent, you're defining more than one class/module per file, you're using explicit 'return's, you're not putting white space between successive method definitions, etc
<paper_>
but aside that it's fine Hanmac
Spitfire- is now known as Spitfire
tijmencc has joined #ruby
samuel02_ has quit [Remote host closed the connection]
<Hanmac>
i do because mostly its made of an RPG and an Game part (for newbs: an Database and an Runtime part)
Rym has joined #ruby
tijmencc has quit [Client Quit]
techlife has quit [Ping timeout: 252 seconds]
daniel_- has joined #ruby
daniel_- is now known as Guest31579
danslo has joined #ruby
etcetera has joined #ruby
Nisstyre has joined #ruby
freerobby has quit [Quit: Leaving.]
adamholt has joined #ruby
jso_ is now known as jso
mattbl has joined #ruby
anderse has quit [Quit: anderse]
buibex has quit [Remote host closed the connection]
matled- has joined #ruby
phantasm66 has quit [Quit: *sleeeep….]
xybre has joined #ruby
xybre has quit [Changing host]
xybre has joined #ruby
zodiak has joined #ruby
sailias has joined #ruby
emptymag00 has joined #ruby
samuel02 has quit [Ping timeout: 264 seconds]
rking has joined #ruby
carlyle has quit [Remote host closed the connection]
<Hanmac>
paper_: do you like my cs_ methods? and do you understand how they works?
<paper_>
Hanmac: explain to me
jkamenik has quit [Quit: Leaving.]
codecop has quit [Remote host closed the connection]
Bish_ has joined #ruby
matled has quit [Remote host closed the connection]
randym_ has quit [Ping timeout: 240 seconds]
[Neurotic] has quit [Ping timeout: 240 seconds]
Demux has quit [Ping timeout: 240 seconds]
kaichanvong has quit [Ping timeout: 240 seconds]
Bish has quit [Ping timeout: 240 seconds]
matled- is now known as matled
<e-dard>
Anyone know what's up with perftools? It's giving me output like this http://dpaste.com/1052823/ ?
<Hanmac>
paper_: for sample you call cs_init, but it does not exist but a_cs_init,b_cs_init,c_cs_init exist, so when you call cs_init it returns [a_cs_init,b_cs_init,c_cs_init]
<e-dard>
^ with my perftool settings, obviously :-P
Demux has joined #ruby
<paper_>
Hanmac: clever :)
slainer68 has quit [Ping timeout: 260 seconds]
sleetdrop has quit [Quit: Computer has gone to sleep.]
<Hanmac>
paper_: its more flexable than using alias ...
failshell has quit [Remote host closed the connection]
k611 has joined #ruby
<kenneth>
hey so if i have a data structure like this: {args: [one, two, three], stuff: :stuff}, what's the easiest way to turn it into this: [{args: one, stuff: :stuff}, {args: two, stuff: :stuff}, {args: three, stuff: :stuff}]
techlife has joined #ruby
techlife has quit [Max SendQ exceeded]
GhettoCode has quit [Ping timeout: 276 seconds]
evenix has joined #ruby
<kenneth>
i know it should be easy but it's escaping me right now
Guest31579 has quit [Remote host closed the connection]
havenwood has joined #ruby
techlife has joined #ruby
techlife has quit [Max SendQ exceeded]
techlife has joined #ruby
techlife has quit [Max SendQ exceeded]
phasma has quit [Ping timeout: 264 seconds]
<csmrfx>
is your data structure a ruby hash?
techlife has joined #ruby
techlife has quit [Max SendQ exceeded]
memristor has quit [Read error: Connection reset by peer]
dmerrick has quit [Remote host closed the connection]
baroquebobcat has quit [Quit: baroquebobcat]
caveat- has quit [Remote host closed the connection]
k610 has quit [Ping timeout: 264 seconds]
tealmage has quit [Remote host closed the connection]
evenix has quit [Remote host closed the connection]
k611 has quit [Ping timeout: 264 seconds]
alvaro_o has joined #ruby
geggam has joined #ruby
monkegji_ has quit [Remote host closed the connection]
<alvaro_o>
Guys, does anyone of you know how to get Twitter's rate limit using the "Twitter" gem ?
nfisher has quit [Quit: Good-bye all!]
jlast has quit [Remote host closed the connection]
julian-delphiki has quit [Quit: Computer has gone to sleep.]
hiroyuki has joined #ruby
EPIK has joined #ruby
caveat- has joined #ruby
jtharris has quit [Quit: WeeChat 0.4.0]
spider-mario has quit [Read error: Connection reset by peer]
idkazuma has joined #ruby
Es0teric has joined #ruby
Neomex has joined #ruby
aytch has quit [Remote host closed the connection]
blacktulip has quit [Remote host closed the connection]
bluOxigen has quit [Ping timeout: 245 seconds]
matayam has quit [Remote host closed the connection]
supki has quit [Ping timeout: 264 seconds]
Neomex has quit [Client Quit]
Nisstyre-laptop has quit [Quit: Leaving]
axl_ has quit [Quit: axl_]
jbueza has quit [Quit: Leaving.]
supergiantrobot_ has quit [Quit: supergiantrobot_]
mattbl has quit [Quit: This computer has gone to sleep]
<Vivekananda>
anyone here
<Vivekananda>
I have a question a general one actually
bguery has quit [Read error: Connection reset by peer]
<Vivekananda>
what kind of data structure would be best when I am getting in a array of strings and I have to store and compare each string to each other
rockets has joined #ruby
v0n has quit [Read error: Operation timed out]
LaPetiteFromage has joined #ruby
ariedler has quit [Remote host closed the connection]
mikepack has joined #ruby
_nitti has joined #ruby
baphled has quit [Ping timeout: 240 seconds]
error_code has quit [Ping timeout: 260 seconds]
hydrozen has quit [Quit: Computer has gone to sleep.]
etcetera has joined #ruby
error_code has joined #ruby
bttf has joined #ruby
_nitti has quit [Ping timeout: 246 seconds]
alx- has quit [Quit: alx-]
Davey has quit [Quit: Computer has gone to sleep.]
<swarley>
Vivekananda, each string is being compared to another string?
apeiros has joined #ruby
jbueza has joined #ruby
Bofu2U has quit [Ping timeout: 240 seconds]
<Vivekananda>
swarley: each string is being compared to each other only once
pioz has quit [Quit: This computer has gone to sleep]
Davey has joined #ruby
<Vivekananda>
so basically there has to be n C 2 combinations to compares
<swarley>
Oh boy, does the data set have replacement?
busybox42 has quit [Quit: leaving]
pilojo has joined #ruby
busybox42 has joined #ruby
<pilojo>
How would I go about making an asynchronous timer that waits 2 mins while still performing actions within those two mins?
Vivekananda has quit [Read error: Connection reset by peer]
chrisnicola has quit [Quit: This computer has gone to sleep]
<swarley>
if each string is being compared to every other string I would honestly do a combination on the array
snorkdude has joined #ruby
LaPetiteFromage has quit [Quit: LaPetiteFromage]
cbot__ has quit [Read error: Operation timed out]
<snorkdude>
Can anyone help me get started writing a ruby wrapper for an oauth protected api?
<swarley>
pilojo, t = Thread.new { sleep 120 }; do_something while t.alive?
slainer68 has joined #ruby
alx- has joined #ruby
twoism has quit [Read error: Connection reset by peer]
twoism_ has joined #ruby
newUser1234 has quit [Remote host closed the connection]
<swarley>
You would probably want to have something happen after the sleep in the thread
apeiros has quit [Ping timeout: 240 seconds]
<swarley>
like killing the process that is running whatever you want to go on for two minutes
generalissimo has quit [Remote host closed the connection]
<pilojo>
swarley: Oh, I'm making a game that has a 2 min timer, so i just want it to perform actions but only within 2 mins, then move on to the next bit
breakingthings has joined #ruby
paper_ has quit [Remote host closed the connection]
<alvaro_o>
Guys, does anyone of you know how to get Twitter's rate limit using the "Twitter" gem ?
paper_ has joined #ruby
<waxjar>
pilojo, you could maybe wrap things in a block on Timeout::timeout
<waxjar>
it's part of the stdlib
brennanMKE has quit [Remote host closed the connection]
mattbl has joined #ruby
<swarley>
waxjar, ah, good suggestion. I forgot about that. It pretty much does what I suggested but in a better way I'm sure
<pilojo>
swarley: yeah, thread manipulation can get messy
momomomomo has quit [Quit: momomomomo]
<pilojo>
waxjar: i'll try that
<swarley>
It's not too bad when you're only dealing with two
<pilojo>
swarley: true, timeout just seems simpler
arya__ has quit [Ping timeout: 256 seconds]
<swarley>
Oh yeah, I would use Timeout
<swarley>
Just saying, it's not terrible as long as you're careful
Animawish has joined #ruby
<pilojo>
waxjar: how would i use timeout in a while loop? while !Timeout::timeout(120)
busybox42 has quit [Quit: leaving]
busybox42 has joined #ruby
<pilojo>
or does it need to have its own loop
<waxjar>
the timeout raises an exception when the 120 seconds are over and the block is still executing
hiroyuki has quit [Remote host closed the connection]
pettsson has quit [Remote host closed the connection]
robscomputer_ has quit [Remote host closed the connection]
datafirm has joined #ruby
passbe has quit [Quit: WeeChat 0.3.9.2]
mneorr has quit [Remote host closed the connection]
love_color_text has joined #ruby
hadees has quit [Quit: hadees]
havenwood has joined #ruby
pyx has quit [Quit: WeeChat 0.4.0]
pilojo has left #ruby ["Leaving"]
miso1337 has joined #ruby
geggam has quit [Quit: Leaving]
johnmilton has joined #ruby
Bosox20051 has joined #ruby
pioz has joined #ruby
<kenneth>
so i'm having a weird problem: i'm getting a SystemStackError when i run this example code:
<kenneth>
class Test; include Validations; validations { ::Kernel.p :hi; validates_presence_of :name; ::Kernel.p :fuck }; end
mikepack has quit [Remote host closed the connection]
jeebster1 has joined #ruby
jeebster has quit [Ping timeout: 256 seconds]
<Eiam>
I have an instance of a class and want to dump out 6 of its 10 attributes into a hash to spit out as json. is there something more canonical than "loop & return the 6 attributes per instance" ?
<kenneth>
oh wait… never mind. i figured it out. jesus. one hour of debugging a typo
lewis has quit [Remote host closed the connection]
<kenneth>
my version avoid mutating any objects
<kenneth>
i like to avoid mutating things as much as possible
mootpointer has joined #ruby
<paper_>
kenneth: yes but it also generates a bunch of objects that you dont need :P
<kenneth>
(i actually wish ruby had immutable collections by default)
<paper_>
kenneth: and in this situation mutability isn't a bad thing, you're just building up a hash
<paper_>
but whatevs
sepp2k has quit [Read error: Connection reset by peer]
gaahrdne_ has joined #ruby
<kenneth>
because 90% of my bugs are odd edge cases where i'm accidentally mutating nested data structures
<kenneth>
(and the rest are typos :p)
<Eiam>
thanks guys, just glad I'm not off in the weeds
<kenneth>
but you're right, yours is perfectly fine and saves a little memory, paper_
guns has quit [Quit: guns]
riffraff169_a has joined #ruby
tootubular has quit [Quit: tootubular]
miso1337 has quit [Quit: afk]
shadoi has joined #ruby
shadoi has left #ruby [#ruby]
gaahrdne_ has quit [Ping timeout: 248 seconds]
emptyflask has quit [Remote host closed the connection]
Guest17377 has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
elux has quit [Quit: Bye!]
forced_request has quit [Ping timeout: 256 seconds]
yours_truly has joined #ruby
Nisstyre-laptop has quit [Read error: Connection reset by peer]
yours_truly has quit [Read error: Connection reset by peer]
hmarr has joined #ruby
Nisstyre-laptop has joined #ruby
ariedler has joined #ruby
heph has joined #ruby
mando has quit [Remote host closed the connection]
danman has quit [Quit: danman]
karnowski has joined #ruby
mtlatif has joined #ruby
jgrevich has quit [Ping timeout: 252 seconds]
mando has joined #ruby
<heph>
i'm using rdoc 4.0.1 and trying to output an html table. I have the line in my ruby file: # <table><tr><td>test</td></tr></table>, but it's just printing out in the resulting html document, not formatting a table.
carloslopes has quit [Remote host closed the connection]
riffraff169_a has quit [Ping timeout: 246 seconds]
<vyrus001>
UGH, the one time i need to build a gem locally to try and apply a fix and rake is broken <_<
<vyrus001>
anybody know when rake 10.0.5 is getting pushed? apperantly they fixed what i need fixed in the new version 5 days ago but it isnt on rubygems yet <_<
mneorr has joined #ruby
bttf has quit [Ping timeout: 245 seconds]
mando has quit [Ping timeout: 260 seconds]
pothibo has quit [Quit: pothibo]
lewis has joined #ruby
Inside has joined #ruby
pioz has quit [Quit: This computer has gone to sleep]
Davey has quit [Quit: Computer has gone to sleep.]
arya has joined #ruby
wsterling has quit [Remote host closed the connection]
timmow has joined #ruby
pavilionXP has quit [Remote host closed the connection]
rawng has joined #ruby
wesside_ has quit [Quit: Computer has gone to sleep.]
[Neurotic] has joined #ruby
mneorr has quit [Ping timeout: 246 seconds]
NiteRain has quit [Read error: Operation timed out]
<kenneth>
ugh…
<kenneth>
is there a good way to take a method from a module, bind it to an object (that's *not* an instance of that module), and execute it, with arguments
<kenneth>
i'm running into trouble because bind expects an instance of the class of the unboundmethod
<paper_>
kenneth: you can do that in ruby 2.0
randym_ has joined #ruby
<paper_>
but not in ruby 1.9.*
kaichanvong has joined #ruby
<kenneth>
oh that's a bummer :(
t4c0c4t has quit [Quit: leaving]
<kenneth>
how about option #2: take the method, convert it to a proc somehow, and use it with instance_eval
veinofstars has quit [Quit: veinofstars]
<paper_>
kenneth: is the method a mutator?
<paper_>
or is it purely functional?
<kenneth>
purely functional
<paper_>
kenneth: do you own the module?
<kenneth>
yes
<paper_>
well then just make the method a module_function
<paper_>
so you can invoke it on the module directly or as an instance method on classes that include it
<paper_>
kenneth: then you can just invoke the method on the module :)
<kenneth>
hmm… well i don't want to extend the object though
<paper_>
kenneth: like i said
<paper_>
i was showing two ways to do it
<paper_>
you can also just call: MyModule.pig
randomautomator has quit [Ping timeout: 245 seconds]
Andromeda has joined #ruby
<paper_>
kenneth: it's the same way that you can go: Math.sin(1) and also object.extend(Math) and then invoke 'sin' inside the object as an instance method
<kenneth>
i guess i misspoke earlier when i said it was purely functional. it doesn't mutate, but it does access self
chrishough has quit [Quit: chrishough]
<paper_>
ah
billiam has quit [Quit: Leaving]
<paper_>
kenneth: you're screwed then :D
<kenneth>
lol
<kenneth>
fuck
<kenneth>
okay
Yakko has quit [Ping timeout: 245 seconds]
postmodern has joined #ruby
<kenneth>
i guess i'm gonna have to figure something else out
<paper_>
kenneth: cant you just include the module?
Andromed_ has joined #ruby
cantonic has quit [Ping timeout: 264 seconds]
cantonic_ is now known as cantonic
<snorkdude>
Anyone know about writing ruby wrappers for OAuth protected APIs?
<kenneth>
no, i don't want to modify the object (eg. add methods)
Andromed_ has quit [Read error: Connection reset by peer]
<kenneth>
but i can make my life a little less pleasant and write the module functions without using self
new299 has quit [Ping timeout: 240 seconds]
Jelco_ has quit [Ping timeout: 240 seconds]
new299 has joined #ruby
<kenneth>
rather taking the self as its first argument every time
Roa has quit [Ping timeout: 240 seconds]
Jelco_ has joined #ruby
<kenneth>
can you override "self"? is it a language keyword or a variable?
frem has quit [Ping timeout: 256 seconds]
<paper_>
kenneth: no way :D
<paper_>
you can't
NimeshNeema has joined #ruby
<kenneth>
bummer
Roa has joined #ruby
<kenneth>
in obj-c you can :) it's kind of neat
Andromed_ has joined #ruby
Andromeda has quit [Read error: Operation timed out]
<paper_>
kenneth: yeah obj-c is pretty cool
<paper_>
haven't coded in it for ages though, but i enjoyed it when i did
aaronmcadam has quit [Quit: Leaving...]
Andromeda has joined #ruby
dmerrick has joined #ruby
alexspeller has joined #ruby
mattbl has quit [Quit: This computer has gone to sleep]
backjlack has quit [Remote host closed the connection]
jonathanwallace has quit [Quit: WeeChat 0.3.9.2]
ckrailo has quit [Quit: Computer has gone to sleep.]
enebo has joined #ruby
enebo has quit [Client Quit]
Andromeda has quit [Remote host closed the connection]
Andromed_ has quit [Ping timeout: 248 seconds]
dmerrick has quit [Ping timeout: 248 seconds]
dawkirst has quit [Ping timeout: 256 seconds]
Xeago has quit [Remote host closed the connection]