havenn has quit [Remote host closed the connection]
jamescarr has quit [Client Quit]
arya has joined #ruby
noodletraveler has quit [Ping timeout: 248 seconds]
josh_keith has quit [Ping timeout: 245 seconds]
jimeh has joined #ruby
havenn has joined #ruby
MattRB has joined #ruby
arya has quit [Ping timeout: 256 seconds]
carloslopes has quit [Remote host closed the connection]
hydrozen has joined #ruby
yshh has quit [Remote host closed the connection]
c0rn has quit [Ping timeout: 244 seconds]
bjeanes- has joined #ruby
bjeanes has quit [Ping timeout: 248 seconds]
samuel02 has joined #ruby
jamescarr has joined #ruby
grzywacz has quit [Ping timeout: 255 seconds]
Vert has quit [Ping timeout: 252 seconds]
c0rn has joined #ruby
ner0x has joined #ruby
jamescarr has quit [Client Quit]
onemanjujitsu has joined #ruby
jamescarr has joined #ruby
punkrawkR^Home has joined #ruby
<pskosinski>
I want to send something to a server using UDP. And then server is sending something to me. And… how can I know on which port is server sending…? I don't get it
Targen has joined #ruby
josh_keith has joined #ruby
punkrawkR has quit [Ping timeout: 248 seconds]
punkrawkR^Home is now known as punkrawkR
dougireton has quit [Quit: Leaving.]
Ortuna has joined #ruby
x82_nicole has quit [Quit: Computer has gone to sleep.]
noodletraveler_ has quit [Quit: leaving]
drago757 has joined #ruby
parkinson2013 has quit [Quit: Ex-Chat]
mneorr has quit [Remote host closed the connection]
kmurph has joined #ruby
samuel02 has quit [Remote host closed the connection]
samuel02 has joined #ruby
iamjarvo has joined #ruby
iambic has quit [Quit: leaving]
samuel02 has quit [Read error: Operation timed out]
Cymurai has joined #ruby
Cymurai has quit [Client Quit]
<havenn>
pskosinski: Can you just use one socket to send/receive on the same port (do you need it to be asynchronous)?
Cymurai has joined #ruby
karupanerura has quit [Excess Flood]
<pskosinski>
havenn: I think that I need to use one socket but I am really not sure ^^ I try to find how it works in Google can't can't understand too much :|
spaceships has quit [Ping timeout: 256 seconds]
<swarley>
Is there a real documentation for the yarv ir?
xyzodiac has quit [Quit: Computer has gone to sleep.]
<pskosinski>
havenn: Something similar. There is a game server, client can ask it for some info. I want to make script asking for those info, to not use client. When client is connecting to server everything is asynchronous.
jblack has quit [Remote host closed the connection]
<aedornm>
pskosinski: generally UDP packet responses should come back to the same port the request was sent. However, that's entirely up to the server side because UDP is stateless.
jblack has joined #ruby
thams has quit [Quit: thams]
<aedornm>
So in general, if you don't know someone that can tell you exactly where you will get a response and how, then you have to send a packet and use a packet capture to figure it out
<aedornm>
Everything else is dependent on what information the server can possibly receive from the client.
<pskosinski>
hm, ok, thanks :)
jamescarr has quit [Quit: jamescarr]
Kingy has quit [Quit: Leaving]
thams has joined #ruby
horofox has quit [Quit: horofox]
wyhaines has quit [Remote host closed the connection]
mrsolo has quit [Quit: Leaving]
samphippen has quit [Quit: Computer has gone to sleep.]
cardoni has joined #ruby
mneorr has joined #ruby
Konboi has joined #ruby
freakazoid0223 has quit [Quit: Leaving]
dmiller has joined #ruby
cardoni has quit [Ping timeout: 245 seconds]
tommyvyo has joined #ruby
Ortuna has quit [Quit: Computer has gone to sleep.]
MattRB has quit [Quit: This computer has gone to sleep]
elaptics is now known as elaptics`away
sarkis has joined #ruby
sarkis has quit [Client Quit]
MattRB has joined #ruby
MattRB has quit [Client Quit]
zlangley_ has joined #ruby
Cymurai has quit [Ping timeout: 244 seconds]
<graft>
what's the good way to make a hook that runs before a method in a class?
xyzodiac has joined #ruby
Hanmac1 has quit [Quit: Leaving.]
Hanmac1 has joined #ruby
kmurph has quit [Quit: kmurph]
hydrozen has quit [Quit: Computer has gone to sleep.]
aantix has quit [Ping timeout: 248 seconds]
<Gate>
graft: do you have the cooperation of the method, or are you monkeypatching someone else's code?
<graft>
i don't have the cooperation of the method
yxhuvud2 has joined #ruby
<graft>
i'm contemplating overriding send
<Gate>
graft: then your option is aliasing
<graft>
but that seems like a bad idea
<Gate>
yeah, probably is :)
<graft>
well, basically i just want a gatekeeper function
<Gate>
you can alias the method to something lile old_mymethod, then redefine mymethod to call your hook then call old_mymethod
yxhuvud has quit [Ping timeout: 256 seconds]
<graft>
that just checks to see if the arguments to a set of functions are well-formed
Konboi_ has joined #ruby
<graft>
so i figure, i can override send, see if i'm supposed to check this method, validate, then do super.send and i'm good
Jedi_SCT1 has quit [Quit: See ya]
<Gate>
graft: alternatively, define each of those methods in a module that performs the check, then calls super. Include that module at the end of the class/after it is defined. (I'm only 80% sure this will work)
<graft>
i can't do this with alias if i want it to work on more than one method
awarner_ has joined #ruby
<Gate>
graft: you can metaprogram to override each method you want to target, unless you want it to hit *every* method
<graft>
i want it to hit every method
ilyam has quit [Remote host closed the connection]
<Gate>
wow
punkrawkR has quit [Ping timeout: 252 seconds]
<Gate>
that's.... agressive.
Cymurai has joined #ruby
ilyam has joined #ruby
zeropx has joined #ruby
Konboi has quit [Ping timeout: 248 seconds]
Jedi_SCT1 has joined #ruby
<graft>
well, actually i want to check the class's public methods only, but i don't want to have to register them anywhere or anything
zeropx has left #ruby [#ruby]
<mercwith1mouth>
can someone tell me what .mark does or even where to look it up in the api?
<graft>
mercwith1mouth: example?
mmitchell has quit [Remote host closed the connection]
kmurph has joined #ruby
<Gate>
graft: I'm thinking. But with a use-case that agressive it gives me pause.
techhelp has joined #ruby
Doyley has joined #ruby
awarner has quit [Ping timeout: 264 seconds]
yshh has joined #ruby
<mercwith1mouth>
graft: one sec
<Gate>
graft: well, I've never overridden :send, and that sounds like an bad plan, so I would use `.public_methods` to get a list of all the methods, alias them all and overrite them with a hook
<aaronmacy>
Is there some trick to nested .each blocks that I'm overlooking? I'm trying to mix to arrays into a third array but only the outer array is being added to the new array
<aaronmacy>
two*
fyolnish has left #ruby [#ruby]
<aaronmacy>
array1.each { |x| array2.each { |y| array3 << x + y }}
shirokuro11 has quit [Remote host closed the connection]
havenn has joined #ruby
cjs226 has joined #ruby
<aaronmacy>
argh there must have been a typo somewhere - got it working
lupinstien has joined #ruby
chussenot has quit [Quit: chussenot]
lupinstien is now known as lupinstein
s1n4 has quit [Quit: leaving]
megha has joined #ruby
gift has joined #ruby
toekutr has joined #ruby
tommyvyo[cloud]_ has quit []
the_jeebster has quit [Quit: Leaving.]
<tetley>
hey all, trying RoR on windows, should expect any difference from using it on unix
<tetley>
?
<jonahR>
big time
stkowski has quit [Quit: stkowski]
Pufferfood has quit [Read error: Connection reset by peer]
Pufferfo_ has joined #ruby
<gift>
i'm using 'dl' and DL::Importer to call a method from a shared library i've written. one of my C functions takes an argument which is a pointer to a pointer to type struct and populates it. how can i achieve that with dlload/extern?
<jonahR>
it is slower on windows
<tetley>
yeah ok
<tetley>
im just trying out a small app
chrishough has quit [Quit: chrishough]
<jonahR>
:)
cardoni has joined #ruby
<tetley>
yeah my little poker app is gonna be cool
openstandards has quit [Ping timeout: 276 seconds]
<tetley>
Installing RDoc documentation for rails-3.2.11...
<tetley>
file 'lib' not found
<gift>
;(
<tetley>
yeah im going for it anyways
<tetley>
expecting issues
<tetley>
it was after it installed the dox
yacks has joined #ruby
onemanjujitsu has joined #ruby
jonahR has quit [Quit: jonahR]
meoblast001 has joined #ruby
MattRB has quit [Quit: This computer has gone to sleep]
pdamer has joined #ruby
rakl has quit [Quit: sleeping]
Hanmac2 has joined #ruby
hadees has joined #ruby
kmurph has joined #ruby
nanothief has joined #ruby
moos3 has joined #ruby
adkron has joined #ruby
megha has quit [Quit: WeeChat 0.4.0]
Hanmac1 has quit [Ping timeout: 264 seconds]
peteyg has quit [Ping timeout: 248 seconds]
MattRB has joined #ruby
eka has quit [Quit: Computer has gone to sleep.]
reppard has joined #ruby
openstandards has joined #ruby
mockra has quit [Remote host closed the connection]
mhf has quit [Remote host closed the connection]
mhf has joined #ruby
icole has quit [Remote host closed the connection]
v0n has joined #ruby
f0ster has quit [Ping timeout: 240 seconds]
ilyam has quit [Quit: ilyam]
zenloop has joined #ruby
pdamer has quit [Quit: pdamer]
mercwith1mouth has quit [Quit: Lost terminal]
mercwithamouth has quit [Remote host closed the connection]
zenloop has quit [Client Quit]
rburton- has joined #ruby
ffranz has quit [Quit: Leaving]
bricker has quit [Read error: Connection reset by peer]
bricker_ has joined #ruby
kmurph has quit [Quit: kmurph]
quest88 has joined #ruby
pdamer has joined #ruby
Jon30 has joined #ruby
stormetrooper has joined #ruby
<Jon30>
what's the most preferred gui dev kit for ruby? by most preferred i mean: most commonly used, most supported etc...
elico has joined #ruby
nfk has quit [Quit: yawn]
recycle has joined #ruby
pskosinski has quit [Quit: Drama: Copyright infringement according to Quinton Reeves, Red Eclipse developer: http://pawelk.pl/quinton-reeves]
freakazoid0223 has joined #ruby
reppard has quit [Quit: leaving]
niklasb has quit [Ping timeout: 264 seconds]
jpfuentes2 has quit [Quit: Computer has gone to sleep.]
daniel_- has quit [Ping timeout: 264 seconds]
jpfuentes2 has joined #ruby
yojimbo_ has joined #ruby
<yojimbo_>
hey
recycle has quit [Ping timeout: 248 seconds]
ilyam has joined #ruby
ilyam has quit [Client Quit]
pnkbst` has quit [Read error: Connection reset by peer]
<yojimbo_>
question on installing 1.9.3 with dvm on Mac OSX 10.8.2
Gues_____ has quit [Quit: Computer has gone to sleep.]
<yojimbo_>
I understand that you need to install Xcode and the command line tools, which is done
vinax has quit [Ping timeout: 252 seconds]
<yojimbo_>
but when I do rvm install 1.9.3 it still gives me an error on 'make'
krz has joined #ruby
<yojimbo_>
and the logs only tells me:
<yojimbo_>
collect2: ld terminated with signal 11 [Segmentation fault: 11]
<havenn>
yojimbo_: brew install chruby; then run chruby's setup.sh to get latest Ruby, JRuby and RBX - or chruby has simple install instructions to build them yourself.
<yojimbo_>
but rvm makes your life so much easier (when it works)
krz has quit [Ping timeout: 264 seconds]
krzkrzkrz is now known as krz
<havenn>
yojimbo_: Before you tear down Homebrew, might try: brew install chruby openssl readline libyaml gdbm libffi
<havenn>
yojimbo_: chruby makes your life easy as well :P Just a different easy.
<havenn>
yojimbo_: Both are really nice.
<yojimbo_>
but now homebrew gives me a warning (probably because I installed macports)
alvaro_o has quit [Quit: Ex-Chat]
<havenn>
yojimbo_: Kill macports.
<havenn>
yojimbo_: Just delete the cruft that `brew doctor` warns you about.
emmanuelux has quit [Read error: Connection reset by peer]
<havenn>
yojimbo_: If you want to tear down rvm and start again: rvm implode
<yojimbo_>
We found the following "config" scripts:
stormetrooper has quit [Quit: LFD (Looking for Droids)]
jonathanwallace3 has quit [Quit: WeeChat 0.3.9.2]
<havenn>
yojimbo_: You could select a static build of Ruby with RVM (I *think* 1.9.3-p362 has a static build through Tokaido?) or build one with Tokaido: https://github.com/tokaido/tokaido-build
<havenn>
yojimbo_: Tokaido isn't ready yet as a .app install, but the static build of Ruby works great.
<havenn>
yojimbo_: I'd say `rvm implode` or see real quick if you like chruby for a quick install.
<yojimbo_>
reinstalling rvm now
moos3 has quit [Quit: Computer has gone to sleep.]
<yojimbo_>
if that failed again, I'll try chruby I guess
<yojimbo_>
I guess I had missed a step when installing dvm and it screwed me for days ...
<yojimbo_>
rvm*
mhf has joined #ruby
zenloop has joined #ruby
<havenn>
yojimbo_: Nice!
pnkbst has joined #ruby
<yojimbo_>
yeah, thanks for the help :-)
<havenn>
yojimbo_: happy hacking!
<yojimbo_>
I def will :-)
joeycarmello has quit [Remote host closed the connection]
gabrielrotbart has quit [Remote host closed the connection]
joofsh has joined #ruby
jamescarr has joined #ruby
zlangley has joined #ruby
gabrielrotbart has joined #ruby
Gu_______ has joined #ruby
f0ster has joined #ruby
techhelp has joined #ruby
squidBits has quit [Quit: whoops]
cardoni has quit [Quit: cardoni]
havenn is now known as havenwood
<RubyPanther>
"--enable-pthread obsolete, and ignored" does anybody know the correct way to turn off pthreads? (I'm trying to cross-compile for android)
mikepack has joined #ruby
<nazty>
how do i get a list of directories?
Doyley has joined #ruby
elico has quit [Quit: elico]
dallasm has quit [Remote host closed the connection]
moos3 has joined #ruby
<havenwood>
nazty: Dir['*']
<nazty>
haven say i mp3_dir = 'k:/musics/'
<nazty>
and want to get a list of all the directories in the directory in mp3_dir
jaygen has quit [Remote host closed the connection]
<havenwood>
nazty: Ah, dirs only not files?
<nazty>
yes
cardoni has joined #ruby
<nazty>
im trying to write a app that write a list of all the movies and music i have to a file... using the directory names
twoism has quit [Remote host closed the connection]
roadt__ has joined #ruby
huoxito has quit [Ping timeout: 252 seconds]
mockra has joined #ruby
niklasb has quit [Ping timeout: 240 seconds]
gabrielrotbart has quit [Read error: Connection reset by peer]
<havenwood>
nazty: The interpolation was actually unnecessary in my example. I was gunna interpolate self + */ but then switched to File#join: https://gist.github.com/havenwood/4711907
tcstar has joined #ruby
ahokaomaeha has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
gabrielrotbart has joined #ruby
mockra has quit [Ping timeout: 245 seconds]
mhf has quit [Read error: Connection reset by peer]
mhf has joined #ruby
<havenwood>
nazty: If you really wanted to be cross-platform compatible, would need to use $FILE_SEPARATOR (or whatever the global actually is?) instead of '/'.
<nazty>
havenwood, where does it pull all the directories from?
adeponte has quit [Read error: Connection reset by peer]
ahokaomaeha has joined #ruby
MattRB has quit [Quit: This computer has gone to sleep]
<nazty>
i dont see a loop
<havenwood>
nazty: The * is globbing
<havenwood>
nazty: basically asking for files of any name (*) that end in / (dirs).
dustint has quit [Quit: Leaving]
<havenwood>
nazty: Like in bash you'd do: ls -d */
<nazty>
why Dir[File.join(self, '*/')]
<nazty>
instead of
gwillickers has quit [Quit: leaving]
<nazty>
whats the File.join
chrishough has joined #ruby
<havenwood>
Would be fine to do (except if you want to support OSes where the file separator is \ instead of /: Dir["#{self}*/"]
<nazty>
i need to read how this works
<havenwood>
nazty: If you're just supporting Posix systems, no need.
<nazty>
i use win/linux
<nazty>
i wonder if they have ruby for qnx
<havenwood>
nazty: Yeah, so File.join for Win cause you can't join dirs with /.
<havenwood>
nazty: Then iterating over it and puts'ing should work!
havenwood has quit [Remote host closed the connection]
rupee has quit [Ping timeout: 255 seconds]
cardoni has quit [Ping timeout: 244 seconds]
r0bby_ is now known as robbyoconnor
xyzodiac has quit [Quit: Computer has gone to sleep.]
JumpMast3r has quit [Quit: JumpMast3r]
JumpMast3r has joined #ruby
yfeldblum has joined #ruby
rboyd has joined #ruby
drago757 has quit [Quit: drago757]
JumpMast3r has quit [Client Quit]
<Ortuna>
How would I test JSON rendered string in 1.8.7 ? testing for something like "{\"first\":1,\"second\":\"2\",\"third\":3}" doesn't work because of the ordering
balr0g has quit [Read error: Connection reset by peer]
ahokaomaeha has joined #ruby
Demux has joined #ruby
crackfu has quit [Remote host closed the connection]
crackfu has joined #ruby
icole has joined #ruby
cardoni has quit [Ping timeout: 248 seconds]
radic_ has quit [Ping timeout: 246 seconds]
spaceships has quit [Quit: leaving]
razieliyo has joined #ruby
<razieliyo>
hi
<Demux>
:-)
johndouthat has quit [Remote host closed the connection]
<razieliyo>
I'm trying to load a file A with the path included in another file B
<razieliyo>
I use file.gets to get each line from B, and I've checked that when I try to load the file A, what is inside the line is just the name of the file A
crackfu has quit [Ping timeout: 260 seconds]
<razieliyo>
does this makes sense?
<razieliyo>
it just says, unknown error
doctorbh has joined #ruby
earthquake has quit [Read error: Connection reset by peer]
chrishough has quit [Read error: Connection reset by peer]
chrishough has joined #ruby
<Demux>
have you tried something like file.open("filename.rb", "r"); contents = file.read
<Demux>
?
thufir_ has joined #ruby
<razieliyo>
Demux: no
earthquake has joined #ruby
<razieliyo>
not with file.read
<razieliyo>
but... should it matter?
pyreal has quit [Ping timeout: 252 seconds]
doctorbh is now known as pyreal
a_a_g has joined #ruby
<Demux>
not sure, but that's what I would try. I'm guessing that file.gets is returning the filename and not the contents
<Demux>
I could be wrong
mockra has quit [Remote host closed the connection]
<razieliyo>
err.. well, I've got to a strange solution
<razieliyo>
I think I wasn't getting something
<razieliyo>
file.gets doesn't work, but file.gets.split.collect! { |x| String(x) } [0] <---- this does
mephux has quit [Excess Flood]
ner0x has quit [Quit: Leaving]
chimmy has joined #ruby
mephux has joined #ruby
philcrissman has quit [Remote host closed the connection]
radic has joined #ruby
arya has joined #ruby
pcarrier has quit []
<Demux>
@razieliyo: odd
chrishunt has quit [Quit: Leaving...]
balr0g has joined #ruby
<razieliyo>
Demux: lots...
ananthakumaran has joined #ruby
<razieliyo>
Demux: I'm trying to get rid of every method but can't do with any
c0rn has quit [Quit: Computer has gone to sleep.]
<Demux>
File.readlines("path/to/file") do anything different?
reuven` has quit [Ping timeout: 256 seconds]
angusiguess has joined #ruby
c0rn has joined #ruby
<razieliyo>
Demux: file.gets.split() [0] this works
Cork has quit [Quit: .]
<razieliyo>
Demux: I have to say that I'm not trying to open that file normally
<razieliyo>
I'm trying to load it for the load_tiles method of Gosu lib
<razieliyo>
but, I suppose that it just makes some kind of open that is the same as opening a file in ruby
ogamita has quit [Ping timeout: 276 seconds]
c0rn has quit [Client Quit]
Cork has joined #ruby
v0n has quit [Ping timeout: 246 seconds]
<razieliyo>
Demux: that works normally when I try to load it directly with the string
<razieliyo>
lol
<razieliyo>
with File.readlines(file.gets) I get a No such file or directory error
<razieliyo>
of course, the correct name is displayed
angusiguess has quit [Ping timeout: 256 seconds]
mahmoudimus has joined #ruby
Al__ has joined #ruby
<razieliyo>
I think I'll leave it like file.gets.split()[0] and that's all
Edward_ has joined #ruby
ogamita has joined #ruby
Edward_ has quit [Client Quit]
Asher has quit [Quit: Leaving.]
MattRB has quit [Read error: Connection reset by peer]
MattRB has joined #ruby
gosshedd has joined #ruby
Asher has joined #ruby
girija_ has joined #ruby
mfridh has quit [Read error: Operation timed out]
BizarreCake has joined #ruby
nmeum has quit [Ping timeout: 276 seconds]
techhelp has quit [Quit: This computer has gone to sleep]
<derick_skibotn>
How do I configure ruby (1.9.3-p327) to not build missing/crypt.c ? I'm on a fedora system, that has crypt
<derick_skibotn>
I'm getting compile errors due to conflict with the name 'encrypt'
hamed_r has joined #ruby
vlad_starkov has joined #ruby
Morkel_ has joined #ruby
generalissimo has quit [Remote host closed the connection]
reuven` has joined #ruby
Morkel has quit [Ping timeout: 264 seconds]
Morkel_ is now known as Morkel
reuven` has left #ruby [#ruby]
reuven has quit [Ping timeout: 276 seconds]
cardoni has joined #ruby
vlad_starkov has quit [Ping timeout: 248 seconds]
skcin7 has joined #ruby
eldariof has joined #ruby
wallerdev has quit [Quit: wallerdev]
ahokaomaeha has quit [Ping timeout: 246 seconds]
<cmyers>
activerecord scopes - I set a default_scope but then I set a differnt scope and when I call that method, it merges the default scope and the other one. Is there a way to define a scope which ignores the default scope?
<shevy>
derick_skibotn perhaps you could rename the directory temporarily, or edit the Makefile there to not compile anything, and let recursive make continue without it
<RomainT>
Could someone help me to implement that?
Konboi_ has joined #ruby
aaronmacy has quit [Quit: Leaving.]
end_guy has joined #ruby
Konboi_ has quit [Read error: Connection reset by peer]
<hoelzro>
this might be a silly question, but is there any reason you're using strings for keys rather than symbols?
Konboi_ has joined #ruby
<RomainT>
The hash come from a JSON file
<hoelzro>
also, you should probably test what happens if a key is in keys_to_keep and not in hash
DuoSRX has joined #ruby
horofox has quit [Quit: horofox]
Konboi has quit [Ping timeout: 248 seconds]
<RomainT>
It should not happen (it's a very specific business use)
mercwithamouth has quit [Ping timeout: 255 seconds]
Elhu has quit [Ping timeout: 252 seconds]
<RomainT>
I really want to just pass the test case but the recursive part is... troubling me
<hoelzro>
oh, ok
<hoelzro>
romaint: well, want do you have so far?
browndawg has quit [Ping timeout: 248 seconds]
Elhu has joined #ruby
Konboi_ has quit [Read error: Connection reset by peer]
gabrielrotbart has joined #ruby
Konboi has joined #ruby
<RomainT>
I remove keys for only one level
gabrielrotbart has quit [Remote host closed the connection]
yacks has quit [Ping timeout: 240 seconds]
<Xeago>
banister`sleep: ?
<banister`sleep>
Xeago: <Xeago> oh deer, it is one of these days again.. :)
<banister`sleep>
"dear" :D
freeayu has joined #ruby
<Xeago>
aww crap
<Xeago>
but!
<Xeago>
I was actually petting the deer next to me
<Xeago>
!
luckyruby has quit [Remote host closed the connection]
rakl has quit [Quit: sleeping]
kmurph has joined #ruby
<hoelzro>
romaint: care to show the code you have so far?
DrCode has joined #ruby
ozgura has joined #ruby
<RomainT>
Sure
browndawg has joined #ruby
browndawg has quit [Max SendQ exceeded]
<RomainT>
I post it in minutes
DamienCassou has joined #ruby
<DamienCassou>
hi.
browndawg has joined #ruby
buibex has joined #ruby
<hoelzro>
DamienCassou: hello
<DamienCassou>
I'm interested in understand how 'private' is used in Ruby. For that, I would like to parse Ruby code and only get information about the methods' modifiers. What is the easiest starting point (I'm not a Ruby developer, but I can find my way)
vincentpaca1 has quit [Ping timeout: 248 seconds]
adeponte has joined #ruby
<hoelzro>
DamienCassou: so you want to actually parse Ruby code? or you want to inspect the objects in Ruby?
stat1x has quit [Read error: Connection reset by peer]
po_ has quit [Quit: ChatZilla 0.9.89 [Firefox 18.0.1/20130116073211]]
<DamienCassou>
hoelzro: I would like to write a program that takes ruby source code as input and generates some model of the code. The model would only contain information about method signatures
megha has joined #ruby
<hoelzro>
romaint: what you can do is recurse in your each block in remove_useless_keys
<hoelzro>
if the value is a hash
<Xeago>
DamienCassou: might be easier to load the files, and inspect the objects it creates
<hoelzro>
I agree with Xeago
<RomainT>
hoelzro: My problem is to fetch the proper (nested) key of keys_to_keep
gosshedd has quit [Quit: Lost terminal]
<RomainT>
I have an idea
<DamienCassou>
Xeago: hoelzro: what is the easiest way to do that?
<hoelzro>
recurse by calling remove_useless_keys(values, keys_to_keep[key])
SolidResolve has joined #ruby
SolidResolve has quit [Max SendQ exceeded]
timeout has joined #ruby
tvw has joined #ruby
SolidResolve has joined #ruby
SolidResolve has quit [Max SendQ exceeded]
adambeynon has joined #ruby
yacks has joined #ruby
<RomainT>
hoelzro: What is values ?
<hoelzro>
sorry, I mean value
chussenot has quit [Quit: chussenot]
<hoelzro>
value is the other parameter that .each gives you
yojimbo__ has quit [Quit: This computer has gone to sleep]
<charliesome>
seba4: i have mri installed on my ipod touch if that counts
<seba4>
mri?
noop has joined #ruby
<charliesome>
matz's ruby interpreter
Loaft has joined #ruby
<charliesome>
basically the main ruby implementation
mosez has quit [Ping timeout: 264 seconds]
<seba4>
and what do u think for using ruby on phones... good or some languages are better 2 use
<hoelzro>
seba4: it's probably better to use the "native" language for the phone in question, but using Ruby is doable
<seba4>
oh
<banister`sleep>
hoelzro: rubymotion ecosystem seems pretty developed at this stage though
ephemerian has joined #ruby
<banister`sleep>
hoelzro: i think you might be faster at developing in rubymotion thatn obj-c, even. At least i wouldn't be surprised :)
<hoelzro>
I haven't checked it out myself
d2dchat has joined #ruby
templaedhel has joined #ruby
d2dchat has quit [Remote host closed the connection]
perun_ has quit [Read error: Operation timed out]
<hoelzro>
I just think that if you're developing in a non-native langauge for iOS or Android, you'll be able to do 95% of what you want/need, and then you'll probably hit a roadblock
BizarreCake has quit [Read error: Connection reset by peer]
<hoelzro>
but, having no experience with that, that's really just a guess
<banister`sleep>
hoelzro: well i think with rubymotion, you can easily call into obj-c if you need to
Hecatic has quit [Quit: Àá¼ö]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
nkr has joined #ruby
<banister`sleep>
but i dont even think you need to at this point, even in the final 5%
gyre007 has joined #ruby
divout has joined #ruby
mosez has joined #ruby
<clocKwize>
hmmm, 1 month contract with possibility of more on £400/d at an awesome company for people I know and live in an easy to reach area… or 1 year contract with some people I don't know, in a place that is hard to get to and further away, for the same money...
aaronmcadam has joined #ruby
yojimbo_ has joined #ruby
<ogamita>
clocKwize: choice should be easy then.
<workmad3>
clocKwize: anything else in the work pipeline?
<ogamita>
clocKwize: remove work.
<ogamita>
remote
emergion has joined #ruby
<clocKwize>
workmad3: well, I have people calling me every day pretty much… so I'm not hugely worried about the 1 month, which might be extended.. but its just hassle of finding something else in a month
renanoronfle has joined #ruby
<workmad3>
clocKwize: is finding work again in a month more hassle than the extra travel for a year? :)
atno has quit [Remote host closed the connection]
templaedhel has quit [Ping timeout: 248 seconds]
hakunin_ has joined #ruby
hakunin has quit [Read error: Connection reset by peer]
<clocKwize>
workmad3: probably not… also, I don't know if I like this other company - the first company are where I used to be a perm, and it was awesome.
<workmad3>
clocKwize: if you're not worried about finding work, I'd go with the one I'd enjoy more personally
<workmad3>
clocKwize: or the one I know I'd enjoy :)
<clocKwize>
yeah :)
<clocKwize>
all my old friends are there too
<workmad3>
sounds like a good chance for repeat or extensions too then ;)
<clocKwize>
yeah
atno has joined #ruby
<clocKwize>
like I don't need an interview, they know me and know what I can do, so are just saying we need you asap
<clocKwize>
so if there is more work, they'll keep me
<clocKwize>
or maybe move me to something else within the same area if they can
<clocKwize>
hmm, ok, I'll probably take that one :)
Spami has joined #ruby
<Spami>
hello
arturaz has joined #ruby
perun_ has joined #ruby
Jamone has quit [Read error: Connection reset by peer]
Jamone has joined #ruby
Guedes0 is now known as Guedes
Guedes has quit [Changing host]
Guedes has joined #ruby
Teduardo has quit [Ping timeout: 240 seconds]
Teduardo has joined #ruby
Guest85414 has joined #ruby
alx- has joined #ruby
bluOxigen has joined #ruby
chussenot has joined #ruby
niklasb has joined #ruby
horofox has joined #ruby
JohnBat26 has quit [Remote host closed the connection]
Elhu has joined #ruby
Cymurai has quit [Ping timeout: 276 seconds]
moshee has quit [Ping timeout: 252 seconds]
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
mailo has joined #ruby
samphippen has quit [Quit: Computer has gone to sleep.]
browndawg has left #ruby [#ruby]
browndawg has joined #ruby
browndawg has quit [Client Quit]
tvw has quit [Remote host closed the connection]
tvw has joined #ruby
_bart has joined #ruby
Spami has quit [Ping timeout: 276 seconds]
arya has joined #ruby
jfl0wers has quit [Quit: jfl0wers]
samphippen has joined #ruby
pcarrier has quit []
Spami has joined #ruby
Spami has quit [Changing host]
Spami has joined #ruby
ogamita has quit [Remote host closed the connection]
megha has quit [Quit: WeeChat 0.4.0]
arya has quit [Ping timeout: 264 seconds]
fphilipe has quit [Remote host closed the connection]
Richmond has quit [Quit: Leaving]
fgro has joined #ruby
arya has joined #ruby
cardoni has joined #ruby
ogamita has joined #ruby
berserkr has joined #ruby
horofox has quit [Quit: horofox]
mhf has joined #ruby
lkba has joined #ruby
<shevy>
hey Spami do you spam
cardoni has quit [Ping timeout: 245 seconds]
horofox has joined #ruby
<shevy>
pdf has all sorts of "/Foo" strings?
<shevy>
stream (binary data here) endstream
Kar- has joined #ruby
aknagi has joined #ruby
Vektur has quit [Remote host closed the connection]
Vektur has joined #ruby
krz has quit [Quit: krz]
nari has quit [Ping timeout: 255 seconds]
beiter has left #ruby [#ruby]
bl3k has quit [Remote host closed the connection]
hamed_r has quit [Quit: Leaving]
mhf has quit [Remote host closed the connection]
mhf has joined #ruby
browndawg has joined #ruby
browndawg has quit [Max SendQ exceeded]
browndawg has joined #ruby
browndawg has quit [Max SendQ exceeded]
mhf has quit [Remote host closed the connection]
arya has quit [Ping timeout: 248 seconds]
browndawg has joined #ruby
neurotech has quit [Remote host closed the connection]
huoxito has joined #ruby
<robert_>
shevy: I spam. ;p
<robert_>
:p
codespectator has joined #ruby
arya has joined #ruby
jfl0wers has joined #ruby
beaky has joined #ruby
<beaky>
hello
<ogamita>
shevy: that's the syntax for Postscript symbols.
fir_ed has joined #ruby
<beaky>
is it possible to set attributes to functions?
<beaky>
or blocks?
<ogamita>
Sure, since they're object.
<beaky>
ah
<beaky>
nice to see that 'everything is an object' is true in Ruby :D
<beaky>
unlike some other languages... *cough*Java*cough*
philcrissman has joined #ruby
<gestahlt>
Hi
<beaky>
gestahlt: hello
<gestahlt>
How do i quit a ruby program / script after an if statement is unsuccsesful?
<whitequark>
gestahlt: `exit'
buscon has joined #ruby
<gestahlt>
lol okay thanks. Simple as that...
<gestahlt>
Ah another thing
<gestahlt>
im probing for a server (if its alive)
<heftig>
ogamita: is pdf a superset of ps?
<gestahlt>
is it better to mute the system call (system "ping 111.111.111.111") or directly the ping with parameter?
Al__ has joined #ruby
<beaky>
does Ruby have goto?
<heftig>
beaky: it's a joke option when you compile it
<heftig>
generally, no.
<gestahlt>
beaky: goto is afaik a bad concept. Dont u usually use functions and loops?
cdt has joined #ruby
<gestahlt>
I remember my goto madness back in DOS days for batch scripts..
carloslopes has joined #ruby
Axsuul has quit [Ping timeout: 240 seconds]
<heftig>
beaky: a = proc { puts "foo" } and b = lambda { puts "foo" }
<heftig>
both create a closure object and assign it to a variable
cha1tanya has quit [Quit: Leaving]
<ogamita>
heftig: no, rather a subset.
<heftig>
search the web for the exact differences in how procs and lambdas behave
<ogamita>
A non-Turing-complete subset.
razibog has joined #ruby
<heftig>
ogamita: though it also does stuff that PS (to my knowledge) doesn't do on its own
maxmanders has quit [Quit: Computer has gone to sleep.]
wreckimnaked has quit [Ping timeout: 252 seconds]
stormetrooper has joined #ruby
<heftig>
embedded fonts, images, hyperlinks and stuff
fgro has quit [Ping timeout: 264 seconds]
Mon_Ouie has quit [Ping timeout: 255 seconds]
<Kar->
main diff between procs nad lambdas is how it handles the return statement
F1skr has joined #ruby
* apeiros_
thinks the diff in handling args is more important
<banister`sleep>
agree
<banister`sleep>
i never really use return inside lambdas/procs
fir_ed has quit [Ping timeout: 252 seconds]
bluOxigen has quit [Read error: Connection reset by peer]
pcarrier has joined #ruby
samphippen has quit [Quit: Computer has gone to sleep.]
bluOxigen has joined #ruby
zigomir has quit [Quit: zigomir]
blueOxigen has joined #ruby
baphled has joined #ruby
arya has quit [Ping timeout: 248 seconds]
bluOxigen has quit [Ping timeout: 256 seconds]
jfl0wers has quit [Quit: jfl0wers]
angusiguess has joined #ruby
<beaky>
ah
kmurph has quit [Quit: kmurph]
horofox has quit [Quit: horofox]
<beaky>
ah
<shevy>
goto beaky
arya has joined #ruby
<whitequark>
apeiros_, banister`sleep: you do
<whitequark>
[1].each { |i| return i }
<banister`sleep>
whitequark: i meant explicit procs and lambdas :)
jfl0wers has joined #ruby
<banister`sleep>
i use them in block context
<whitequark>
banister`sleep: it doesn't matter. a block is still a proc, with all the implications
samphippen has joined #ruby
hal52 has joined #ruby
<hal52>
hello
<hal52>
i want to write a gui application in ruby and wondered which framework is most active developed/stable/feature rich.
<hal52>
it seemed that people seem to like wxWidgets
dpg has joined #ruby
rmartin has joined #ruby
<dpg>
What's the best/easiest way to find out where exactly some code is puking and not returning data to a client
RurouniJones has joined #ruby
<banister`sleep>
dpg: you mean 'throwing exeption' ?
<dpg>
it's not throwing anything.
<dpg>
it just times out.
<dpg>
nothing in logs/development.log
<dpg>
so I don't know where it's crapping out.
atno has quit [Read error: No route to host]
chussenot has quit [Quit: chussenot]
<hal52>
when i look at an wxRuby example i got this " Frame.new(nil, -1, "The Bare Minimum").show()" and it looks very c++ish to me. is there something more ruby-like? because i want to get used to ruby
atno has joined #ruby
<apeiros_>
whitequark: you won't find much code where I have an explicit return at all
<apeiros_>
whitequark: you'll find much more code where it'd matter when blocks suddenly did arg-count checking
s1n4 has joined #ruby
guilleiguaran has joined #ruby
kapowaz has joined #ruby
<tobiasvl>
hal52: well you can do Frame.new(nil, -1, 'The Bare Minimum').show but what exactly is non-ruby about that?
<apeiros_>
whitequark: so I stand by my claim that arg-handling diff is more important than how return works
browndawg has quit [Ping timeout: 248 seconds]
<tobiasvl>
empty parentheses are usually dropped in ruby
<hal52>
it just looked c++ish to me :) if you say it looks rubyish, then okay. i am just starting out :)
<hal52>
so which gui framework is a good one in ruby?
<tobiasvl>
i dunno. the first nil argument could possibly have been optional
josh_keith has quit [Ping timeout: 248 seconds]
<tobiasvl>
but that's the API
<whitequark>
apeiros_: if only importance of PL features could be derived from the frequency of usage
<apeiros_>
I'd say it's one of the defining factors
NimeshNeema has joined #ruby
blueOxigen has quit [Ping timeout: 245 seconds]
dpg has left #ruby [#ruby]
chussenot has joined #ruby
<whitequark>
apeiros_: it is a defining factor for an interface for such a feature, indeed
<apeiros_>
frequency of use is a defining factor of importance
vlad_starkov has quit [Remote host closed the connection]
<whitequark>
but not for importance. presence or absence of a single minor feature can have very wide effect
<whitequark>
for example, I dunno, proc{}.binding
<whitequark>
bbl
RomainT has left #ruby [#ruby]
zigomir has joined #ruby
cjs226 has quit []
yacks has quit [Remote host closed the connection]
fir_ed has joined #ruby
Konboi has quit [Remote host closed the connection]
yshh has quit [Remote host closed the connection]
browndawg has joined #ruby
browndawg has quit [Max SendQ exceeded]
josh_keith has joined #ruby
browndawg has joined #ruby
templaedhel has joined #ruby
<whitequark>
apeiros_: actually I can demonstrate that being able to return is far more important than the minor quirk with the argument handling
<apeiros_>
eiffel's reason to not have return is "because it's spaghetti"
<apeiros_>
i.e., eiffels creator has a dislike for explicit return
fir_ed has quit [Ping timeout: 248 seconds]
<whitequark>
apeiros_: weird reason, but OK. I don't quite see how is this relevant.
<hoelzro>
I think it's Matlab
<apeiros_>
whitequark: from your statement "I can demonstrate that being able to return is far more important", I conclude that you find it generally important to be able to return, not just in comparison with feature X
<hoelzro>
but I already pointed that out in #perl =P
<apeiros_>
whitequark: for that reason I thought you might find a language which can't do any explicit return interesting
<whitequark>
apeiros_: well, the article does list examples from both camps, i.e. with and without nonlocal returns
<whitequark>
local return isn't that interesting, as it can be trivially emulated if needed
<whitequark>
apeiros_: FWIW, there is quite a lot of languages without explicit return
<whitequark>
ML, Haskell, Scheme
backjlack has joined #ruby
hadees has quit [Ping timeout: 256 seconds]
<atmosx>
Hello, what's the best DB for storing large number of tweets and blog posts?
dr_bob has joined #ruby
<tobiasvl>
return IS kind of a goto. i'm not a big fan of explicit return
<atmosx>
I'm looking at Tokyo Cabinet
<Xeago>
atmosx: how do you retrieve them?
<atmosx>
I'ts not gonna be embedded db, but choices like Redis or MongoDB require too much ram to run. I don't wanna use them.
<whitequark>
tobiasvl: indeed it is. local return is a goto, nonlocal return is stack unwinding/exception/setjmp-longjmp
<atmosx>
Xeago: the blog posts via RSS the tweets via twitter API.
<atmosx>
Xeago: I will put limits on the twitter API retrieval.
<Xeago>
how do you retrieve it from the datastore?
<whitequark>
atmosx: postgresql
<Xeago>
id?
<atmosx>
Xeago: aaah no idea :-(
<Xeago>
first 10?
clooth has joined #ruby
<Xeago>
all?
<atmosx>
Xeago: uh, I don't know nothing about DB's I use sqlite3 for everything
<atmosx>
and works fien
<atmosx>
fine
<atmosx>
but I have really small amounts of data
angusiguess has quit [Ping timeout: 264 seconds]
<heftig>
if you use an abstraction like activerecord, it doesn't matter
<heftig>
postgresql will handle like sqlite
hal52 has quit [Quit: Page closed]
<atmosx>
heftig: I used datamapper last time, just becaused I liked the website and philosophy...
<atmosx>
heftig: so you think I should just go with dm then
<Xeago>
elkng: looks a bit like scheme
<heftig>
atmosx: datamapper hasn't had a release since 2011
malkomalko has joined #ruby
baphled has quit [Ping timeout: 256 seconds]
<Xeago>
or else, some form of pascal..
yacks has joined #ruby
aaronmcadam has quit [Quit: aaronmcadam]
gokul has joined #ruby
dr_bob has quit [Read error: Connection reset by peer]
hybris has joined #ruby
philcrissman has quit [Remote host closed the connection]
<gokul>
is rubygems down or something ? my bundle install is stuck!
JohnBat26 has joined #ruby
beiter has joined #ruby
DrCode has joined #ruby
<kaichanvong>
gokul: wrong room to ask, try #rubygems
<gokul>
just did
xemu has joined #ruby
buscon has joined #ruby
malkomalko has quit [Remote host closed the connection]
baphled has joined #ruby
m3pow has joined #ruby
Spami has quit [Ping timeout: 245 seconds]
wf2f has quit []
cjs226 has joined #ruby
beaky has quit [Quit: leaving]
allaire has joined #ruby
Elhu has joined #ruby
samphippen has quit [Quit: Computer has gone to sleep.]
Gadgetoid has quit [Ping timeout: 248 seconds]
cheekee has joined #ruby
crackfu has joined #ruby
crackfu has quit [Remote host closed the connection]
wreckimnaked has joined #ruby
s1n4 has quit [Quit: leaving]
baphled has quit [Ping timeout: 264 seconds]
fphilipe has joined #ruby
Spami has joined #ruby
angusiguess has joined #ruby
horofox has joined #ruby
gokul has quit [Quit: Leaving]
Guest___ has joined #ruby
samphippen has joined #ruby
cardoni has joined #ruby
idkazuma has joined #ruby
mark_locklear has joined #ruby
arya has quit [Ping timeout: 248 seconds]
Retistic has joined #ruby
horofox has quit [Quit: horofox]
postmodern has quit [Quit: Leaving]
divout has quit [Remote host closed the connection]
allaire has quit []
cardoni has quit [Ping timeout: 256 seconds]
arya has joined #ruby
Spami has quit [Ping timeout: 255 seconds]
baphled has joined #ruby
pcarrier has quit []
fphilipe has quit [Remote host closed the connection]
dhruvasagar has quit [Ping timeout: 252 seconds]
taoru has quit [Remote host closed the connection]
renanoronfle has quit [Ping timeout: 252 seconds]
pu22l3r has joined #ruby
razibog has quit [Ping timeout: 244 seconds]
pu22l3r has quit [Remote host closed the connection]
pu22l3r has joined #ruby
mmitchel_ has quit [Remote host closed the connection]
marr has quit [Read error: Connection reset by peer]
<sjk>
Hi!
nanothief has quit [Ping timeout: 264 seconds]
krawchyk has joined #ruby
dcorking has joined #ruby
vlad_starkov has joined #ruby
<sjk>
I /think/ I am having some trouble with my ruby and gems on OS X 10.8.2. I installed ruby with homebrew. I installed nokogiri (via gem), but 'require nokogiri' gives: https://gist.github.com/sjktje/4714405
parkinson2013 has joined #ruby
<sjk>
I'm thinking that perhaps the standard OS X ruby setup is conflicting with my homebrew ruby 1.9.3p374 setup?
iamjarvo has joined #ruby
aaronmcadam has joined #ruby
alx- has quit [Ping timeout: 252 seconds]
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
F1skr has quit [Quit: WeeChat 0.4.0]
konrad-k has joined #ruby
x0F_ is now known as x0F
<sjk>
Jekyll doesn't seem to be able to find nokogiri, but it does exist in /usr/local/Cellar/ruby/1.9.3-p374/lib/ruby/gems/1.9.1/gems/nokogiri-1.5.6.
<sjk>
(And that directory is in my gem path, according to irb Gem.path)
samuel02 has quit [Remote host closed the connection]
yshh has quit [Ping timeout: 272 seconds]
<dcorking>
tobiasvl, GUI programming is an awesome way to learn Smalltalk (I better it is even better for learning Self, but I don't know Self.)
krawchyk has quit [Ping timeout: 252 seconds]
samuel02 has joined #ruby
pskosinski has joined #ruby
<hal52>
thank you shevy. i will check it out
<hal52>
unfortunately my company blocks the link to that url ...
<hal52>
i really have to say..this blocking stuff is quite good for productivity -.-
krawchyk_ has quit [Remote host closed the connection]
Virunga has joined #ruby
<dcorking>
he - they block the web but leave IRC wide open :D
<hal52>
indeed
razibog has quit [Ping timeout: 246 seconds]
krawchyk has joined #ruby
<hal52>
but its over http ;)
<hal52>
webchat.freenode.net
mjs2600 has quit [Ping timeout: 256 seconds]
fbernier has joined #ruby
samuel02 has quit [Ping timeout: 272 seconds]
<sjk>
dcorking, no, I don't have a gemfile. *blush*. I am a beginner :-/
hoelzro is now known as hoelzro|away
Spami has quit [Ping timeout: 240 seconds]
pdamer has joined #ruby
<hal52>
i have to go
hal52 has quit []
<sjk>
dcorking, I thought that the Gemfile was required for bundling my app, making installation easier
<enroxorz-work>
what's the fastest way to create a custom error class without having to put it in a new file?
kpshek has joined #ruby
<tobiasvl>
enroxorz-work: well you can just put it wherever?
<tobiasvl>
but if you're making a gem or something
<dcorking>
sjk, the beginning is the place to start. welcome :) Make a Gemfile then run bundle install. It might not fix your problem, but it is a common way to install gems so if I was you I'd give it a try (I guess I should undertand rubygems a bit better before I open my mouth.)
<tobiasvl>
it should probably be in its own file (exceptions.rb?)
<shevy>
enroxorz-work the only true way is to THINK it in your brain and never let it out
<enroxorz-work>
its just a quick WATIR script that has to error out based on certain stuff on the page.
<enroxorz-work>
shevy: i try to think, but nothing happens
<tobiasvl>
shevy: gaha
<tobiasvl>
enroxorz-work: well, you can just put the exception class wherever. ruby doesn't mind
<enroxorz-work>
k
browndawg has quit [Quit: Leaving.]
<enroxorz-work>
im gonna try something. if i fail, i will return!
<sjk>
dcorking, thanks! I gave that a try, but I am getting the same LoadError -- it cannot find nokogiri :-/
<shevy>
you could use __END__ and then write the error class into that, and then use BEGIN { eval(DATA.read) } to load the class :D
Skelz0r has quit [Ping timeout: 244 seconds]
<tobiasvl>
shevy: oh my god
Spami has joined #ruby
Spami has quit [Changing host]
Spami has joined #ruby
dustint has joined #ruby
<shevy>
haha
<shevy>
is there something in front of __END__ too? other than BEGIN {}
<dcorking>
:( sjk, you have exhausted my meagre knowledge of rubygems. Did bundle install install anything, and if so, where did it put it?
nari has joined #ruby
<shevy>
then I could put some kind of image in front of a .rb file
Skelz0r has joined #ruby
razibog has joined #ruby
<shevy>
actually
<shevy>
one could then use a .png file to put ruby code inside
<shevy>
and people would only have to download images from this point on! :)
hydrozen has joined #ruby
<shevy>
bundle install "hey why does it download this porn collection... " -"that is valid ruby code man...."
joofsh has joined #ruby
parkinson2013 has quit [Quit: Ex-Chat]
fedza has joined #ruby
dr_bob has joined #ruby
workmad3 has quit [Ping timeout: 248 seconds]
geekbri has joined #ruby
zenloop has joined #ruby
<sjk>
dcorking, no, it just said that it'll use nokogiri. gim show nokogiri --> /usr/local/Cellar/ruby/1.9.3-p374/lib/ruby/gems/1.9.1/gems/nokogiri-1.5.6
<seba4>
meybe someone knows how to install subl-handler on linux? ...
buibex has quit [Remote host closed the connection]
angusiguess has joined #ruby
<sjk>
dcorking, yeah, I read those stackoverflow posts earlier. I have '/usr/local/opt/ruby/bin' in my PATH. That's a symlink pointing to /usr/local/Cellar/ruby/1.9.3-p374/bin. gem environment tells me that its 'EXECUTABLE DIRECTORY' is /usr/local/Cellar/ruby/1.9.3-p374/bin. I'm thinking it /should/ be working
yshh has joined #ruby
alx- has joined #ruby
<dcorking>
sjk, does 'which ruby' return what you expect it to ?
<sjk>
gem environment's 'GEM PATHS' lists /usr/local/Cellar/ruby/1.9.3-p374/lib/ruby/gems/1.9.1 and /Users/sjk/.gem/ruby/1.9.1, yet when I run jekyll it seems to be looking in /Library/Ruby/Gems/1.8/...
<dcorking>
gnarmis, do you mean an expectation for the http header that is returned?
marr has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
rmartin has quit [Ping timeout: 272 seconds]
<gnarmis>
dcorking: no I mean something to the effect of get('/',nil,'Referer'=>'blah'), but in such a way that I can use `route_to`
b1rkh0ff has quit [Ping timeout: 264 seconds]
cardoni has joined #ruby
elkng has joined #ruby
aquaranto has joined #ruby
<Kar->
with bundler, if i use a git source is there anything special i would need to do to have it available to require?
<gnarmis>
dcorking: basically, I want to make a get request with the referer set, and then check which controller and action is fired
<Kar->
i'm finding the rubygem gems work fine and i can require them in my code, but the git sourced ones get installed in a different location and i can't require them
v0n has quit [Ping timeout: 240 seconds]
alx- has quit [Ping timeout: 276 seconds]
EvanR has quit [Ping timeout: 276 seconds]
workmad3 has joined #ruby
<sjk>
dcorking, I think I'm onto something now -- the error message indicates that jekyll was installed in /Library/Ruby/Gems/1.8/gems/jekyll-0.12.0/bin/jekyll
cardoni has quit [Ping timeout: 245 seconds]
<dcorking>
gnarmis - that is probably a job for your controller spec
<sjk>
dcorking, 'gem uninstall jekyll' says that jekyll isn't installed
nari has quit [Ping timeout: 272 seconds]
<dcorking>
sjk - does require nokogiri work from a plain ruby file (without jekyll)? just for troubleshooting I would take jekyll out of the equation for a while.
inokenty has joined #ruby
berserkr has quit [Quit: Leaving.]
rmartin has joined #ruby
<sjk>
dcorking, so, I am thinking that the 1.8 and 1.9 rubygems are seperated. I should probably get rid of the old jekyll gem and install it again with the 'new' gem setup
ttt has quit [Remote host closed the connection]
<dcorking>
sjk, as long as it isn't a valuable server you are tinkering with :)
gyre007 has quit [Ping timeout: 248 seconds]
a_a_g1 has quit [Quit: Leaving.]
blaxter has quit [Quit: foo]
gyre007 has joined #ruby
<sjk>
dcorking, that did it, actually. Hm, I should try to figure out how to nuke the old gem stuff completely
<dcorking>
sjk - cool. so jekyll was the problem, not your new gem :) . I can't help with the nuking part.
pdamer has quit [Quit: pdamer]
mjolk has joined #ruby
idkazuma has quit [Remote host closed the connection]
b1rkh0ff has joined #ruby
spaceships has joined #ruby
TomyLobo has quit [Read error: Connection reset by peer]
daniel_- has joined #ruby
TomyLobo has joined #ruby
dmiller has joined #ruby
<dcorking>
gnarmis, I guess I don't know if you plan to customize the route with customized routing code, or redirect the request in the controller - that would make a difference to your unit test
filipe has quit [Ping timeout: 264 seconds]
iamjarvo has quit [Quit: Leaving.]
arya has quit [Ping timeout: 248 seconds]
jrist-afk is now known as jrist
iambic has joined #ruby
Retistic has quit [Quit: Retistic]
kpshek has quit []
<gnarmis>
dcorking: actually I'm trying to test a constraint on a route. Playing around with the controller spec and right now it can't find the route for some reason
Dreamer3 has quit [Quit: Computer has gone to sleep.]
bluOxigen has joined #ruby
uris has joined #ruby
Guest___ is now known as Guest123
cheekee has quit [Ping timeout: 240 seconds]
arya has joined #ruby
<dcorking>
gnarmis, sounds more complicated than I can help with :(
xyzodiac has joined #ruby
crazed has quit [Ping timeout: 245 seconds]
cheekee has joined #ruby
<gnarmis>
dcorking: :( thanks though! I haven't done this stuff before...
Spooner_ has joined #ruby
shock_one has joined #ruby
<gift>
i'm using 'dl' and DL::Importer to call a method from a shared library i've written. one of my C functions takes an argument which is a pointer to a pointer to type struct and populates it. how can i achieve that with dlload/extern?
<gift>
i'd be satisifed with returning type struct (currently the function is type int), i just need some guidance on communicating between ruby and C with DL* using structs in general
shock_one has quit [Remote host closed the connection]
<dcorking>
gnarmis - there are rspec and rails channels if that helps. In the meantime, do you like using mocks? If you make a request in your controller spec, I guess you could mock the controller with s should_receive to see that it gets the right action.
xyzodiac has quit [Client Quit]
fphilipe has joined #ruby
kpshek has joined #ruby
neku has joined #ruby
shock_one has joined #ruby
arya has quit [Ping timeout: 248 seconds]
* dcorking
is not loving rspec atm
theRoUS has joined #ruby
<shock_one>
Is there an easy way to get all the files in the directory in some data structure, nested array, for example?
razibog has quit [Ping timeout: 276 seconds]
<gnarmis>
dcorking: yeah, I'll check out those channels. Thing is, I'm also working with a gem which generates a bunch of routes, and I'm prepending my route onto that
<Muz>
shock_one: Dir.glob?
<shock_one>
Muz, it returns flat array
<Muz>
You said "some data structure". ;)
mmitchell has joined #ruby
Neomex has joined #ruby
jlussier has joined #ruby
templaedhel has joined #ruby
casheew has quit [Read error: Connection reset by peer]
<dcorking>
gnarmis, I sympathize. I am not sure if my idea helps, as I am not sure if posting from the controller spec bypasses the route. I have a feeling it does which makes my suggestion junk :(
jlussier is now known as t4nkd
casheew has joined #ruby
<gnarmis>
dcorking: in any case, thanks for the help!
Neomex has quit [Client Quit]
Neomex has joined #ruby
Neomex has quit [Client Quit]
<Muz>
shock_one: if you wanted a nested array, you could Dir::glob with '*' as an argument ; and iterate over the results, using File.directory? to determine if it should loop back and re Glob
<Muz>
Rather simple to knock something together that'd do that; so I'll leave it to you to do that.
kritztopf has joined #ruby
EPIK has quit [Ping timeout: 256 seconds]
tcstar has quit [Ping timeout: 245 seconds]
<dcorking>
not a problem - I like challenges. btw gnarmis it would be nice if your app would let you divide and conquer by writing and passing your spec _without_ the clever routing gem installed, but if not, I guess you could generate a throwaway app to play with.
dmiller has quit [Ping timeout: 244 seconds]
<shock_one>
Muz, thank you, but it's the hard way. I thought there is a method or something that I'm not aware of.
codecop has quit [Read error: Connection reset by peer]
jamescarr has joined #ruby
<dcorking>
s/installed/loaded
yojimbo_ has quit [Quit: This computer has gone to sleep]
adeponte has joined #ruby
arya has joined #ruby
osaut has joined #ruby
Doyley has joined #ruby
otters has joined #ruby
adeponte has quit [Remote host closed the connection]
dmiller has joined #ruby
nari has joined #ruby
rismoney has joined #ruby
templaedhel has quit [Ping timeout: 245 seconds]
zastern has joined #ruby
jamf has joined #ruby
Virunga has quit [Remote host closed the connection]
mikeycgto has quit [Remote host closed the connection]
calmyournerves has joined #ruby
casheew has quit [Read error: Connection reset by peer]
casheew has joined #ruby
asteve has joined #ruby
hashpuppy has quit [Quit: hashpuppy]
nanothief has joined #ruby
pdamer has quit [Quit: pdamer]
Skelz0r has quit [Ping timeout: 248 seconds]
pdamer has joined #ruby
Skelz0r has joined #ruby
s1n4 has joined #ruby
ttt has joined #ruby
nanothief has quit [Ping timeout: 240 seconds]
danielpcox has joined #ruby
_br_ has quit [Excess Flood]
_br_ has joined #ruby
_nitti has joined #ruby
russt has joined #ruby
nateberkopec has joined #ruby
zenloop has quit [Quit: zenloop]
arkiver has quit [Ping timeout: 248 seconds]
ttt has quit [Ping timeout: 276 seconds]
rakun has joined #ruby
JonnieCache has joined #ruby
amcsi_work has joined #ruby
<amcsi_work>
hi
_br_ has quit [Excess Flood]
crank_ has joined #ruby
gosshedd has joined #ruby
<amcsi_work>
I'm very new to ruby. Isn't it confusing that people like to call a function without arguments without using parentheses? You wouldn't be able to tell right away whether a function call is being made are a variable's value is being referenced, unless you know about said function
_br_ has joined #ruby
<heftig>
amcsi_work: when is it ambiguous?
krz has joined #ruby
<Xeago>
amcsi_work: as long as it is clear what the operation would return it does not pose a problem for me
zenloop has joined #ruby
<Xeago>
all that matters is that in case of assigning another value, that that value gets assigned with whatever the righthand is
<invisime>
if you feel the need for parentheses, just add them. no harm, no foul.
<invisime>
...it's just not as pretty. ;-)
zenloop has quit [Client Quit]
<amcsi_work>
but you know... good practise and all
Jamone has quit [Quit: Quit]
generalizzimo has quit [Remote host closed the connection]
<amcsi_work>
in PHP, you can do an if statement without curly brackets if you want to do exactly one statement. But you still should add curly braces even so.
<amcsi_work>
it's good practise
<dn2k>
actually without a @ you always pass trough a method to access a value
<hoelzro>
I tend to omit parens when all the arguments are "simple" (literals or variables)
codezombie has joined #ruby
<workmad3>
dn2k: not quite
angusiguess has joined #ruby
<workmad3>
dn2k: local variables accesses aren't method calls
Xeago has quit [Remote host closed the connection]
<dn2k>
workmad3: you're right..
<amcsi_work>
also, using parentheses would clearly show that that referenced function is something that is read-only
<heftig>
amcsi_work: when is it ambiguous? the only case i can think of right now is a = b, and b is only a local variable when it has been assigned to before
<heftig>
amcsi_work: that shouldn't be a problem at all
<amcsi_work>
in case you would be thinking of writing back to it, if you that that it was a variable, not a function
<heftig>
what?
dhruvasagar has quit [Ping timeout: 240 seconds]
casheew has quit [Read error: Connection reset by peer]
<amcsi_work>
so let's say someObj.something is a function
<amcsi_work>
that you didn't write
<heftig>
it's always a method
<heftig>
always.
bd0 has joined #ruby
<amcsi_work>
and you see someone else doing this: something = someObj.something
<workmad3>
amcsi_work: right, that sets the local variable 'something' to the result of calling someObj.something
casheew has joined #ruby
mockra has quit [Remote host closed the connection]
<amcsi_work>
and you may think that the person is trying to shorten that "property" so you'd have to do less typing to do stuff with it
the_mentat has joined #ruby
<workmad3>
amcsi_work: no, you wouldn't
<amcsi_work>
yes, but you don't know that
<workmad3>
amcsi_work: because ruby doesn't work like that
<amcsi_work>
you think it's most likely a variable
dhruvasagar has joined #ruby
uris has quit [Ping timeout: 255 seconds]
<heftig>
no, it's not
<heftig>
it can't be
<amcsi_work>
ooh
<amcsi_work>
so
FloatingWeed has quit [Remote host closed the connection]
<amcsi_work>
in ruby, you can't directly access properties?
<heftig>
you can't
<workmad3>
amcsi_work: that will *always* call a method 'something' on the object 'someObj'
<heftig>
there are no properties
philcrissman has quit [Remote host closed the connection]
<amcsi_work>
okay, I see now. This answers everything
<workmad3>
amcsi_work: the same way that 'someObj.something = "foo" ' would always call a method 'something=' on 'someObj'
bd0 has quit [Client Quit]
nobuoka has joined #ruby
chrishunt has joined #ruby
<dn2k>
amcsi_work: that's encapsulation
<amcsi_work>
because in other languages you can access properties directly, and I'd be worried to not use parentheses if you wouldn't have to, as it can be ambiguous there, but here apparently it's never ambiguous
casheew has quit [Read error: Connection reset by peer]
FloatingWeed has joined #ruby
<workmad3>
amcsi_work: you'd technically be more correct to say 'in other languages you can access instance variables directly'
drago757 has joined #ruby
imami|afk is now known as banseljaj
sayan has joined #ruby
sayan has quit [Changing host]
sayan has joined #ruby
<dn2k>
you can access only to local variable (and obj variables with the '@' , and if you hate yourself global variables with '$')
binw has quit [Ping timeout: 245 seconds]
unsay has joined #ruby
<workmad3>
amcsi_work: 'property' is a somewhat overloaded term in OO coding, it sometimes gets used to mean 'instance variable', and sometimes gets used (like in C#) to mean 'getter/setter that hides away whether this is a direct instance variable access or calling a method'
<heftig>
and @@foo and CONSTANTS
<dn2k>
right
jfl0wers has joined #ruby
<workmad3>
dn2k: and self ;)
<amcsi_work>
so if something would be an instance variable, you'd take it with: something = someObj.@something ?
roadt__ has quit [Ping timeout: 248 seconds]
<workmad3>
amcsi_work: no, that's not valid syntax
Targen has quit [Ping timeout: 245 seconds]
<hoelzro>
you can't directly access another object's instance variables
casheew has joined #ruby
<amcsi_work>
but what about that @ sign dn2k was talking about?
<heftig>
no. you could do something = someObj.instance_variable_get :@something, but that smells
<workmad3>
amcsi_work: that would be '@something' with no object target
<shevy>
amcsi_work @ can work only within a class man
<shevy>
foo.@bla is never legal syntax
<workmad3>
amcsi_work: and that would access the @something instance variable on the current 'self' object
blaxter has quit [Quit: KTHXBYE]
<amcsi_work>
I am confused. This seems to contradict what dn2k was saying
<amcsi_work>
or I am misinterpreting something
kritztopf has quit [Quit: WeeChat 0.4.0]
philcrissman has joined #ruby
<shevy>
what did dn2k say, amcsi_work
<hoelzro>
@foo is the 'foo' field in self
puppeh has joined #ruby
<hoelzro>
@foo *always* refers to self
hybris has quit [Quit: Leaving]
<workmad3>
amcsi_work: main rule - the only thing you can do with another object is send messages to it (a.k.a. call methods)
<workmad3>
amcsi_work: you cannot access instance variables on it directly, you can only do it through a message
<hoelzro>
the first rule of Ruby is everything is an object
<hoelzro>
the second rule is that all interaction with objects is via methods
MattRB has joined #ruby
eldariof has quit [Ping timeout: 264 seconds]
<hoelzro>
the third rule oddly is "Do not talk about Ruby"
<hoelzro>
but everyone seems to break that one.
<workmad3>
hoelzro: I thought the second rule was: no really, *everything* is an object
_nitti has quit [Remote host closed the connection]
jamescarr has quit [Quit: jamescarr]
<workmad3>
hoelzro: and the third rule was: ssh, stop talking about blocks ;)
<hoelzro>
haha
dallasm has joined #ruby
mephux has quit [Excess Flood]
drago757_ has joined #ruby
<amcsi_work>
I see
generalissimo has joined #ruby
<amcsi_work>
cool
mephux has joined #ruby
tcstar has joined #ruby
<hoelzro>
very cool =)
cardoni has joined #ruby
cardoni has quit [Remote host closed the connection]
chrishunt has quit [Ping timeout: 260 seconds]
a_a_g has joined #ruby
drago757 has quit [Ping timeout: 276 seconds]
drago757_ is now known as drago757
Cymurai has joined #ruby
<shevy>
question
<shevy>
is def foo; @bla; end the same as: def foo; @bla = nil; end ?
<workmad3>
shevy: no ;)
carloslopes has quit [Remote host closed the connection]
osaut has quit [Quit: osaut]
gkunno has joined #ruby
gkunno has quit [Excess Flood]
<tobiasvl>
lol
blaxter has joined #ruby
<shevy>
hmm how was it that ruby just has to see an @ivar to know that it is there again?
<hoelzro>
shevy: do you mean like @bar = 17 if false?
<workmad3>
shevy: well, you never hit an exception from an ivar not being defined
Doyley has quit [Quit: Doyley]
renanoronfle has joined #ruby
<shevy>
hoelzro hmmm I am not sure, I can not even remember... but I think I remember people doing things like:
<tobiasvl>
@foo ||= nil ?
<shevy>
class Foo; @bla
<workmad3>
shevy: but there is a detectable difference between an ivar that has been assign nil, and an undefined ivar
casheew has quit [Read error: Connection reset by peer]
sayan has quit [Read error: Connection reset by peer]
<shevy>
hmm
bluOxigen has quit [Ping timeout: 246 seconds]
casheew has joined #ruby
guns has joined #ruby
crank__ has joined #ruby
osaut has joined #ruby
SCommette has joined #ruby
crank__ has quit [Remote host closed the connection]
Vert has joined #ruby
arya_ has joined #ruby
hmarr has joined #ruby
arya has quit [Ping timeout: 248 seconds]
crank_ has quit [Ping timeout: 252 seconds]
Doyley has joined #ruby
jfl0wers has quit [Ping timeout: 272 seconds]
krz has quit [Quit: krz]
FloatingWeed has quit [Remote host closed the connection]
jfl0wers has joined #ruby
pcarrier has quit []
NsOmNiAc has joined #ruby
filipe has joined #ruby
arya_ has quit [Ping timeout: 255 seconds]
arya has joined #ruby
FloatingWeed has joined #ruby
drago757 has quit [Quit: drago757]
binaryplease has quit [Quit: WeeChat 0.4.0]
[eDu] has joined #ruby
greenysan has joined #ruby
jprovazn is now known as jprovazn_away
_bart has quit [Ping timeout: 252 seconds]
gestahlt has quit [Read error: Connection reset by peer]
filipe has quit [Ping timeout: 272 seconds]
andreaslundahl has quit [Ping timeout: 255 seconds]
Umren has joined #ruby
atno has quit [Ping timeout: 244 seconds]
nari has quit [Ping timeout: 272 seconds]
gkunno has joined #ruby
gkunno has quit [Excess Flood]
techhelp has joined #ruby
jblack has joined #ruby
russt has quit [Quit: russt]
mjolk has quit [Quit: Leaving]
<chiel>
any of you ever used the rerun gem?
emergion has quit [Quit: Computer has gone to sleep.]
generalissimo has quit [Remote host closed the connection]
<JonnieCache>
chiel: guard is better
aganov has quit [Remote host closed the connection]
<JonnieCache>
i had problems with rerun
daniel_- has joined #ruby
gkunno has joined #ruby
gkunno has quit [Excess Flood]
<v0n>
hi
Stilo has joined #ruby
<v0n>
what the best way to define a singleton module? include Singleton or extend self?
tcstar has quit [Ping timeout: 272 seconds]
carloslopes has joined #ruby
<apeiros_>
include Singleton makes no sense, that's about instantiation - and you can't instantiate a module
<apeiros_>
you may want to take a look at Module#module_function
dmiller has quit [Ping timeout: 264 seconds]
<a_a_g>
how do i retrieve the block object passed to a method if I am not explicitly taking one in the arguments?
bradleyprice has joined #ruby
<hoelzro>
a_a_g: you can't
maxmanders has joined #ruby
<apeiros_>
Proc.new
<hoelzro>
you may yield to it
<hoelzro>
and detect its presence
dougireton has joined #ruby
brad[] has quit [Remote host closed the connection]
<v0n>
apeiros_: ho ok, so include Singleton would be to turn a class in a singleton while extend self is to keep a module self-extended (so turned into a singleton)
<hoelzro>
but unless you have a block parameter, you may not manipulate it otherwise
<a_a_g>
i want to instance_eval it if it is given
<apeiros_>
a_a_g: plain Proc.new returns the block passed to the method
<apeiros_>
a_a_g: but seriously, just use &block arg
<chiel>
JonnieCache: ah ok thanks, i'll look into it. basically i want to be able to run 3 apps side by side
jlast_ has quit [Remote host closed the connection]
jlast has quit [Read error: Connection reset by peer]
<Muz>
elplatt: the default gemset is the gemset that's used by default when switching to that interpreter without an explicitly declared gemset option.
<Muz>
elplatt: the global gemset is a set of gems that's in all gemsets for that ruby interpreter.
jlast has joined #ruby
<Muz>
s/in all/available to/
vlad_starkov has quit [Remote host closed the connection]
mneorr has joined #ruby
<chiel>
daemonised, if possible, perhaps spitting output to a logfile
jgrevich has joined #ruby
<elplatt>
I see. Is "default" an actual gemset that gets created for each intepreter, or is it just a reference to another gemset?
<Muz>
AIUI, it's a reference to another already existing gemset.
<elplatt>
cool, thanks!
rakun has quit [Quit: Saliendo]
nga4 has quit []
jonathanwallace has quit [Ping timeout: 245 seconds]
mneorr has quit [Remote host closed the connection]
dhruvasagar has quit [Ping timeout: 272 seconds]
jfl0wers has quit [Quit: jfl0wers]
theRoUS has joined #ruby
xAndy has joined #ruby
mephux has quit [Excess Flood]
elplatt has quit [Ping timeout: 248 seconds]
filipe has quit [Ping timeout: 264 seconds]
techhelp has quit [Quit: Leaving]
mephux has joined #ruby
unsay has quit [Quit: Lost terminal]
pyro111 has quit [Quit: Leaving]
jonahR has joined #ruby
DaltonUS has quit [Quit: DaltonUS]
girija_ has left #ruby ["Ex-Chat"]
JumpMast3r has joined #ruby
peteyg has joined #ruby
Kuifje has joined #ruby
nomenkun has quit [Remote host closed the connection]
puppeh has quit [Remote host closed the connection]
Doyley has quit [Quit: Doyley]
hoelzro is now known as hoelzro|away
breakingthings has joined #ruby
BRMatt has joined #ruby
tvw has quit [Remote host closed the connection]
bricker has quit [Ping timeout: 276 seconds]
ahokaomaeha has joined #ruby
alvaro_o has joined #ruby
michagogo has joined #ruby
jeffreybaird has joined #ruby
bricker has joined #ruby
joeycarmello has joined #ruby
haxrbyte has joined #ruby
haxrbyt__ has quit [Read error: Connection reset by peer]
<michagogo>
I have a question... I have ruby 1.9.3p327 installed on Windows, using RubyInstaller. Should I be upgrading to p374? How would I go about doing that?
xAndy has left #ruby ["Leaving"]
gosshedd has joined #ruby
Catbuntu has joined #ruby
dougireton has quit [Read error: Connection reset by peer]
<Catbuntu>
Hi
mneorr has joined #ruby
yacks has quit [Read error: Connection reset by peer]
carraroj has joined #ruby
jgrevich_ has joined #ruby
filipe has joined #ruby
<nfk>
%w{...} is a neat way to write string arrays but is there something comparable to symbols? %s{...} seems to allow only one symbol
<michagogo>
Gate: So just download the installer and run it? Will it correctly overwrite the right things and all that
<michagogo>
?
dougireton has quit [Client Quit]
buscon has quit [Quit: Leaving]
<Gate>
I would expect. I don't use windows for any development, ever, but I expect you *might* need to update your $PATH variable
<Gate>
I don't know if the installer will do that for you
kerframil has joined #ruby
_br_ has quit [Excess Flood]
<Gate>
nfk: %w{...}.map(&:to_sym)
filipe has quit [Remote host closed the connection]
jonathanwallace has joined #ruby
<Gate>
only way I know of :(
rakl has joined #ruby
shock_one has quit [Ping timeout: 248 seconds]
filipe has joined #ruby
slainer68 has quit [Remote host closed the connection]
F1skr has quit [Quit: WeeChat 0.4.0]
<nfk>
Gate, inefficient
_br_ has joined #ruby
<nfk>
but thanks for trying
Mohan has joined #ruby
Al___ has joined #ruby
wyhaines has joined #ruby
_br_ has quit [Excess Flood]
kpshek has joined #ruby
hackerdude has joined #ruby
s1n4 has quit [Quit: leaving]
Al___ has quit [Read error: Connection reset by peer]
Catbuntu has quit [Quit: Auf wiedersehen]
Al___ has joined #ruby
slainer68 has joined #ruby
bricker has quit [Ping timeout: 276 seconds]
<Gate>
nfk: yeah, 2n instead of n ;) I don't think your going to get anything better than manually creating the array in full sytax [:a, :b...]
Al__ has quit [Ping timeout: 244 seconds]
_br_ has joined #ruby
<Gate>
suppose the memory consumption is the read bad part there, storing the strings, then the syms
<nfk>
Gate, i was just looking for something easier to type
rippa has joined #ruby
tenmilestereo has joined #ruby
<Gate>
understood
<Gate>
nfk: editor macro!
<Gate>
:D
<nfk>
my editor foo is weak
slainer68 has quit [Remote host closed the connection]
<Gate>
nfk: you could always type it as a normal string, run it through a regexp in irb to produce the array of symbols :) #=> metaprogramming solution
Pip has joined #ruby
<Pip>
When will Ruby 2.0 out?
<havenwood>
Pip: Feb 24
<Gate>
sometime this month, I hear
<Pip>
Alright
the_mentat has quit [Quit: Computer has gone to sleep.]
<Gate>
yay!
_br_ has quit [Excess Flood]
<havenwood>
Pip: 19 days and counting!
_br_ has joined #ruby
_br_ has quit [Excess Flood]
<Gate>
hm, I wonder how many of my projects I will be able to upgrade by the end of the month :D
_br_ has joined #ruby
cparen has quit [Quit: cparen]
ozgura has quit [Remote host closed the connection]
chussenot has joined #ruby
<shevy>
Gate zero
<shevy>
:(
odyssey4me has quit []
Mon_Ouie has joined #ruby
aaronmcadam has quit [Quit: aaronmcadam]
rodj has joined #ruby
bawigga has joined #ruby
sayan has joined #ruby
codespectator has quit [Ping timeout: 264 seconds]
sayan has joined #ruby
sayan has quit [Changing host]
art_man1 has joined #ruby
delinquentme has joined #ruby
buibex has quit [Ping timeout: 256 seconds]
Al___ has quit [Read error: Connection reset by peer]
<delinquentme>
OK so I've got a ajax call returning a big nasty hash
<delinquentme>
and I want to store that hash in a .txt file ... and then open it up again .. as a hash
<delinquentme>
( I need to do this because I'm running crazy gems and processing to extract data from silly files )
io_syl has joined #ruby
<Gate>
shevy: you might be right, given how blocky it is to change ruby versions with our chef setup :(
<philcrissman>
delinquentme: save as JSON and then read the file, parsing JSON back into a hash?
cardoni has joined #ruby
<delinquentme>
anyways! I've use ruby to write out a file with the expected hash obj ... and then I read it back in
jrajav has quit [Quit: phunq, sandwich store loop, WHAT NO UNIVERSE]
<steveki>
Hello. I'm from a Java background. Am I right in thinking that a def self.foo() method, in a class, which I would call a static method, is a method in the metaclass of the class it is in?
<julian-dephiki>
jokke, because q and g are not the same char.
<jokke>
julian-dephiki: lol
<jokke>
thanks
<jokke>
:D
arturaz has quit [Ping timeout: 260 seconds]
thams has quit [Quit: thams]
benlieb has quit [Quit: benlieb]
<apeiros_>
steveki: yes, though seems ruby devs have settled on the term singleton_class
<jokke>
my terminal underlines links so it was impossible for me to tell the difference
<philcrissman>
steveki: it's a method on the class; I don't know that I'd say it's a method in the metaclass...
moted has quit [Remote host closed the connection]
X-Jester has quit [Ping timeout: 276 seconds]
<apeiros_>
jokke: um, you wield a programming language, capable of string manipulation…
<Mon_Ouie>
It's an instance method of said singleton class (meta class)
<apeiros_>
it's not that difficult to get it to tell you where a string differs
chrishunt has joined #ruby
<steveki>
philcrissman: i say metaclass, because if it's defined in the class itself, then it's an instance method
thams has joined #ruby
andrewh has quit [Quit: leaving]
<apeiros_>
there are technically only instance methods
julian-dephiki is now known as bean|work
<apeiros_>
a class method is an instance method of the singleton_class
codespectator has joined #ruby
megha has joined #ruby
X-Jester has joined #ruby
chussenot has quit [Quit: chussenot]
asteve has joined #ruby
steventux has quit [Ping timeout: 248 seconds]
[eDu] has quit [Quit: [eDu]]
sayan has quit [Read error: Connection reset by peer]
jrist is now known as jrist-afk
wreckimnaked has quit [Ping timeout: 252 seconds]
<steveki>
apeiros_: yeah, but instance methods of the class are different to instance methods of the metaclass
<apeiros_>
steveki: nope
<michagogo>
What's the difference between this channel and #ruby-lang
<michagogo>
?
thams has quit [Client Quit]
pdamer has joined #ruby
philcrissman has quit [Ping timeout: 256 seconds]
_br_ has quit [Excess Flood]
<steveki>
apeiros_: sure they are. you use them for different purposes and they live in different namespaces
<apeiros_>
steveki: you could say the same about any method in a different class
maxmanders has quit [Quit: Computer has gone to sleep.]
_br_ has joined #ruby
elaptics is now known as elaptics`away
josh_keith has quit [Read error: Operation timed out]
steveki has quit [Quit: Page closed]
Doyley has joined #ruby
jblack has joined #ruby
moted has joined #ruby
stkowski has joined #ruby
Al__ has quit [Quit: Al__]
zenloop has joined #ruby
<nfk>
<Gate> nfk: you could always type it as a normal string, run it through a regexp in irb to produce the array of symbols :) #=> metaprogramming solution // and what's the complexity of that?
breakingthings has quit []
philcrissman has joined #ruby
<philcrissman>
d'oh. Disconnected.
Doyley has quit [Client Quit]
delinquentme has quit [Quit: Leaving]
theRoUS has quit [Ping timeout: 272 seconds]
LucidDreamZzZ has quit [Remote host closed the connection]
aaronmacy has joined #ruby
thufir_ has quit [Quit: Leaving.]
jrajav has joined #ruby
LucidDreamZzZ has joined #ruby
the_mentat has joined #ruby
c0rn has joined #ruby
_br_ has quit [Excess Flood]
aaronmcadam has joined #ruby
pdamer has quit [Quit: pdamer]
picca has joined #ruby
cableray has joined #ruby
picca has quit [Remote host closed the connection]
matti has quit [Ping timeout: 240 seconds]
aaronmcadam has quit [Client Quit]
samuel02 has joined #ruby
pdamer has joined #ruby
razibog has joined #ruby
nobuoka has quit [Quit: Leaving...]
samuel02 has quit [Remote host closed the connection]
<nfk>
<Gate> nfk: you could always type it as a normal string, run it through a regexp in irb to produce the array of symbols :) #=> metaprogramming solution // and what's the complexity of that?
elico has joined #ruby
pcarrier_ has quit []
alvaro_o has quit [Read error: Connection reset by peer]
alvaro_o has joined #ruby
Monie has joined #ruby
chrishunt has quit [Quit: Leaving...]
freakazoid0223 has joined #ruby
ananthakumaran has quit [Ping timeout: 252 seconds]
theRoUS has joined #ruby
_br_ has quit [Excess Flood]
<Gate>
nfk: "[:#{%w(...).join(', :')}]" and pase the code into your source file :D
chrishunt has joined #ruby
bawigga has quit [Ping timeout: 255 seconds]
spinagon has joined #ruby
pcarrier has joined #ruby
sayan has quit [Ping timeout: 272 seconds]
gosshedd has quit [Ping timeout: 252 seconds]
arietis has joined #ruby
_nitti has quit [Remote host closed the connection]
MattRB has quit [Quit: This computer has gone to sleep]
spinagon has quit [Read error: Connection reset by peer]
jblack has joined #ruby
rodj has joined #ruby
bawigga has joined #ruby
icole has joined #ruby
jtharris has joined #ruby
johndouthat has joined #ruby
<nmeum>
is there any builtin method for ["foo", "bar"].map { |e| "surround#{e}surround" } ?
cardoni has joined #ruby
<rodj>
hello
jhiggins has joined #ruby
pdamer has quit [Quit: pdamer]
chrishunt has quit [Quit: Leaving...]
<rodj>
I am newer to ruby and need some guidance on passing optional arguments to a method. it may not be obvious from the gist, so I will probably need to explain futher, here is the gist: https://gist.github.com/scriptmonkey/4716621
chrishunt has joined #ruby
clooth has quit [Quit: clooth]
s__dana has quit [Ping timeout: 245 seconds]
s__dana_ is now known as s__dana
decoponio has quit [Quit: Japan will have been end of midnight(3:50 am jst now)]
tylersmith has joined #ruby
RagingDave has joined #ruby
<GeekOnCoffee>
rodj: you're trying to access a nested hash key that doesn't exist in the last example
<rodj>
correct. they proxy info is optional. I get that. so do I just put some if statements and ensure there are nill s where they need to be?
<rodj>
that seems un ruby like to me.
moted has joined #ruby
cardoni has quit [Ping timeout: 255 seconds]
<icole>
radj: or you could set default values
<Mon_Ouie>
You can use Hash#fetch for that
Cymurai has quit [Quit: Leaving]
<Mon_Ouie>
hash.fetch(key, val) returns hash[key] if that key is set, and val otherwise
<v1n>
I don't get the cannot infer basepath (LoadError) from relative_path
pcarrier has quit []
<v1n>
can someone explain what this means?
<Mon_Ouie>
v1n: require_relative only works when you called from a file that's been loaded with load/require
Richmond has joined #ruby
<Mon_Ouie>
If the code is being eval'd, it won't work
<v1n>
Mon_Ouie: ho ok, it makes sense. I using it in a config.ru
bawigga has quit [Quit: Computer has gone to sleep.]
<v1n>
so I should go with the classic $: << Dir.pwd; require 'file'
<Mon_Ouie>
Not Dir.pwd, File.dirname(__FILE__) (or expanding that path)
<Mon_Ouie>
Otherwise, running your program from another directory will fail
hmarr has quit [Quit: Computer has gone to sleep.]
<v1n>
you're right, thanks
jfl0wers has quit [Quit: jfl0wers]
rodj_ has joined #ruby
<banister`sleep>
apeiros_: can you look at my weird capybara issue?
<rodj_>
sorry, I lost my connection
rodj has quit [Ping timeout: 245 seconds]
_br_ has quit [Excess Flood]
hmarr has joined #ruby
<banister`sleep>
or anyone here who knows capybara ?
Richmond has quit [Read error: Connection reset by peer]
<Mon_Ouie>
rodj_: Did you see my mention of Hash#fetch?
beiter has quit [Quit: beiter]
<rodj_>
yes
_br_ has joined #ruby
Richmond has joined #ruby
<rodj_>
I am looking at it now.
jeer has quit []
jeer has joined #ruby
uris has quit [Ping timeout: 245 seconds]
evilsushi has joined #ruby
evilsushi is now known as awkwords
<rodj_>
so I could do: @http_proxy = args[:http].fetch(:proxy_host,nill) ?
<rodj_>
that may not the correct syntax
<rodj_>
but is that the idea?
philcrissman has quit [Remote host closed the connection]
ryannielson has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
_br_ has quit [Excess Flood]
billyoc has joined #ruby
_br_ has joined #ruby
jfl0wers has joined #ruby
bdesham has joined #ruby
slainer68 has joined #ruby
bricker has joined #ruby
sayan has joined #ruby
jlast has quit [Ping timeout: 264 seconds]
greenysan has joined #ruby
<Mon_Ouie>
No, because args[:http] is the key that might be nil when you want a hash no matter what happens
jhiggins has left #ruby [#ruby]
Spami has joined #ruby
Spami has quit [Changing host]
Spami has joined #ruby
<Mon_Ouie>
(well, :http is the key)
jlast has joined #ruby
<Mon_Ouie>
So you want args.fetch(:http, {}) -- then you can lookup your keys in that hash
<rodj_>
ahhh
<rodj_>
I think I get it.
bricker_ has quit [Ping timeout: 244 seconds]
<bdesham>
hi all! I'm using Homebrew and Ruby/RVM on OS X. when I do "gem update" I'm running into the problem that "make" is looking for the "install" command in /usr/local/Cellar/coreutils/8.17/libexec/gnubin/, while it's actually in .../8.20/libexec/gnubin. how can I get gem to rebuild its makefiles?
rdark has quit [Ping timeout: 276 seconds]
fgro has joined #ruby
pavilionXP has quit [Ping timeout: 248 seconds]
arturaz has joined #ruby
<Jeaye>
File:///
<havenwood>
bdesham: Any errors with?: brew doctor
<havenwood>
Jeaye: >.>
<bdesham>
Jeaye: hope that wasn't directed at anyone in particular ;-)
<Jeaye>
hehh
osaut has joined #ruby
_br_ has quit [Excess Flood]
<bdesham>
havenwood: yes, brew doctor reports some problems, but nothing related to coreutils that I can see
<havenwood>
bdesham: XCode and command-line-tools are okay?
philcrissman has joined #ruby
andreaslundahl has quit [Ping timeout: 255 seconds]
<bdesham>
havenwood: they should be, although I'll double check. this problem has been going on through a couple versions of xcode, actually
fourq has quit [Quit: Lost terminal]
<havenwood>
bdesham: Might double-check that all brew packages from `rvm requirements` are installed as well.
_br_ has joined #ruby
<bdesham>
havenwood: hmm, that gave no output, just a blank line
<bdesham>
so I guess that's good?
<havenwood>
bdesham: Trouble with just one gem, or every gem that wants to build C-ext?
<havenwood>
bdesham: Whaaa? No output from?: rvm requirements
<bdesham>
just some. I'm not a ruby expert, but it looks like jekyll and nokogiri have problems, but not aws-sdk or mime-types
<havenwood>
bdesham: Maybe try `rvm get stable` then `rvm requirements` again? Shouldn't be empty.
buibex has joined #ruby
jlast has quit [Remote host closed the connection]
<havenwood>
bdesham: Yeah, Nokogiri is what I usually use to check if C-ext are building.
v1n has quit [Ping timeout: 245 seconds]
ahokaomaeha has quit [Ping timeout: 276 seconds]
<havenwood>
bdesham: I'd recommend starting with resolving the `brew doctor` issues and getting rvm working with `rvm requirements`.
jlast has joined #ruby
timmow has quit [Ping timeout: 252 seconds]
<bdesham>
havenwood: ok, thanks for the advice!
shock_one has joined #ruby
uris has joined #ruby
<havenwood>
bdesham: Double-check you've got command-line-tools up-to-date and installed! That is the likely culprit methinks.
etcetera has joined #ruby
jonahR has joined #ruby
<rodj_>
so this: args[:http] = args.fetch(:http,{})
<blf>
Actually, I don't think I need the mutex, but without the mutex results contains only a couple values for i rather than each of the values.
_nitti_ has quit [Ping timeout: 252 seconds]
pettsson has joined #ruby
Kar- has quit [Quit: leaving]
<Spooner_>
blf, Because the #each loop completes before any of the threads are scheduled. You should use Thread.new(i) do |i| so that you pass the current value of i in.
sepp2k has quit [Read error: Connection reset by peer]
braoru has joined #ruby
<blf>
Spooner_: Ah... thanks indeed :) I'll give that a shot.
<Spooner_>
blf you should also use tasks.each.with_index do |task, i| to save incrementing it yourself.
<bean|work>
yeah, incrementing yourself in ruby is gross.
<bean|work>
rarely will you need that
cheekee has quit [Ping timeout: 252 seconds]
c0rn has quit [Ping timeout: 272 seconds]
osaut has quit [Quit: osaut]
arya has quit [Ping timeout: 264 seconds]
pcarrier has quit []
Kingy has joined #ruby
clooth has joined #ruby
<Spooner_>
blf And finally, the synchronize and sleep do nothing ;)
otters has quit [Ping timeout: 272 seconds]
Nisstyre-laptop has joined #ruby
arya has joined #ruby
c0rn has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
i_s has joined #ruby
kpshek has quit []
<shevy>
hmm guys
<Spooner_>
The problem will be that accessing results needs to be synchonised, otherwise the results won't be in the expected order. I'd recommend result = start_download(...); mutex.synchronize { results[i] = result } and joining all the threads, of course.
<blf>
Spooner_: Yep, I figured the synchronize didn't do anything. As for the sleep, I was just testing some things.
<shevy>
should I make this a hash argument instead?
<blf>
In any event, this is fantastic. What would have taken 3 minutes is not down to 2 tenths of a minute :)
<blf>
Thanks guys!
<Spooner_>
blf, Or more sensibly, use something else than threads to manage it.
zerba has quit [Remote host closed the connection]
<blf>
s/not/now
<havenwood>
shevy: Or even make a new Struct or Class with attrs to store the attributes.
sayan has quit [Read error: Connection reset by peer]
<Spooner_>
shevy, Yeah, hash args are for replacing those horrid optional params.
<havenwood>
shevy: And pass the method an instance of the attr class.
<blf>
Spooner_: not sure what else to use. I'm limited by the number of request which I can post to a web service. So I'm trying to query the posts as quickly as possible (3 per second) while downloading the data in the background.
carraroj has quit [Quit: Konversation terminated!]
tylersmith has joined #ruby
nomenkun has quit [Remote host closed the connection]
rockets has joined #ruby
<Spooner_>
havenwood, You are not using default params any more, which was sort of the point (or the original might as well have had non-optional params).
seagreen1 has joined #ruby
Spami has joined #ruby
Spami has quit [Changing host]
Spami has joined #ruby
zastern has quit [Ping timeout: 276 seconds]
<havenwood>
Spooner_: I'm not awake yet, uhg. Yeah, Hash makes sense for default params....
<Spooner_>
Really don't see that as better than just using 6 params (optional or not) for the method.
sn0wb1rd__ has joined #ruby
sn0wb1rd has quit [Ping timeout: 264 seconds]
sn0wb1rd__ is now known as sn0wb1rd
VooDooNOFX has quit [Remote host closed the connection]
<seagreen1>
I've got a markdown file with a few lines of yaml at the top of it. Anyone got advice on an elegant way to edit the yaml with ruby? I was hoping there'd be a simpler way than regexing but I can't find one.
<Spooner_>
havenwood, Though most of those params shouldn't be optional anyway ;)
blaxter has quit [Quit: foo]
Schmidt has quit [Ping timeout: 276 seconds]
sn0wb1rd has quit [Client Quit]
<havenwood>
Spooner_: Nice to have a struct/class i think if you're gunna pre-process any of it. Like capitalize adventure.name or whatev. Hrm.
Neomex has quit [Quit: Neomex]
* havenwood
goes in search of coffee.
<Spooner_>
seagreen1, Isn't it separated by -- which is the document separator for YAML?
Schmidt has joined #ruby
<swarley>
---
<seagreen1>
spooner_: Yeah, it's acually ---
sn0wb1rd_ has quit [Ping timeout: 256 seconds]
<Spooner_>
Oh yeah.
<rismoney>
can someone assist with http://pastie.org/6073888 - i am drying to dry this up a bit. i have been looking at lambdas or procs, and cant seem to wrap my head around it yet
<Xeago>
rismoney: do you know what is being returned from gw and ip?
<chrisan>
Should "xmlrpc/client" send "text/xml" as the default? if not how can I force it? a php server is claiming it is getting "text/html"
Crunchcat has quit [Quit: SuperAPTCOW!]
<Xeago>
what you could do is make a executionblock for that differ only in the things you now pass to array .each
<rismoney>
nothing yet. enablestatic and setgateways are methods that make ole api calls
<Spooner_>
rismoney, Yeah, yield netconnectionid to a block. You don't need to use explicit lambdas.
lancepantz_ is now known as lancepantz
fgro has quit [Ping timeout: 252 seconds]
<rismoney>
- not really sure how... hmm
<rismoney>
i just started reading blocks,procs and lambdas...lol
huoxito has quit [Quit: Leaving]
ahokaomaeha has joined #ruby
jlast has quit [Remote host closed the connection]
jimeh has quit [Quit: Computer has gone to sleep.]
<rismoney>
let me check it out
tjbiddle has joined #ruby
hadees has quit [Quit: hadees]
<Spooner_>
rismoney, Updated with the second example.
reset has quit [Ping timeout: 260 seconds]
<Spooner_>
rismoney, Though in this trivial example, DRYing isn't that critical.
jlast has quit [Ping timeout: 255 seconds]
<bdesham>
havenwood: I got my setup working! I *think* the critical part was "rvm reinstall 1.9.2", although I also updated the command-line tools and futzed around with homebrew. thanks again!
<havenwood>
bdesham: Nice, happy hacking!
<rismoney>
spooner- right - it was a subsection of a much larger code set anyhow, but i wanted to understand how it might look. i think the yield was something i was after.
<Spooner_>
rismoney, And yes, the & means treat it as a block (specifically, it calls Symbol#to_proc on :deviceid which makes that little block for you).
sepp2k has joined #ruby
<rismoney>
makes sense actually
Virunga_ is now known as Virunga
Virunga has quit [Remote host closed the connection]
jfl0wers has quit [Quit: jfl0wers]
matti__ has joined #ruby
mxweas has joined #ruby
DrCode has quit [Remote host closed the connection]
<bean|work>
aces1up: then why does it have a question mark :( question mark methods should return true / false in "good code"
<unstable>
aces1up: WHere is the image_exists? method? or the ele_exists? method?
<aces1up>
yeh, lol.. suppose it should.
cdt has joined #ruby
dr_neek has quit [Quit: dr_neek]
elico1 has quit [Remote host closed the connection]
elico has joined #ruby
otters has quit [Ping timeout: 252 seconds]
thams has joined #ruby
Banistergalaxy has joined #ruby
mhf has joined #ruby
elico has quit [Remote host closed the connection]
s1n4 has joined #ruby
elico has joined #ruby
elico has quit [Remote host closed the connection]
s1n4 has quit [Changing host]
s1n4 has joined #ruby
elico has joined #ruby
bawigga has joined #ruby
vlad_starkov has joined #ruby
thams has quit [Client Quit]
<bean|work>
aces1up: you may want to provide more code
segv-_ has joined #ruby
segv- has quit [Read error: Connection reset by peer]
segv-_ is now known as segv-
rodj_ has quit [Ping timeout: 245 seconds]
<s1n4>
any wikipedia wrapper?
<bean|work>
s1n4: as in, a gem to query wikipedia?
kmurph has joined #ruby
Morkel_ has joined #ruby
<unstable>
wikipedia-api-fork, wikipedia-client, and poundie-wikipedia are all gems with the word 'wikipedia' in them.
<unstable>
I used the command 'gem search wikipedia --remote' to find those.
<s1n4>
bean|work: yes
<s1n4>
unstable: those gems suck
brianpWins has joined #ruby
<unstable>
s1n4: It seems like that's all there is. You could write your own.
Morkel has quit [Ping timeout: 252 seconds]
Morkel_ is now known as Morkel
c0rn has quit [Quit: Computer has gone to sleep.]
carloslopes has quit [Remote host closed the connection]
workmad3 has joined #ruby
SQLDarkly has joined #ruby
mjs2600 has quit [Ping timeout: 256 seconds]
chrishough has quit [Quit: chrishough]
jfl0wers has joined #ruby
<s1n4>
I found one that seems much better than those gems
tjbiddle_ has joined #ruby
kmurph has quit [Ping timeout: 244 seconds]
vlad_starkov has quit [Ping timeout: 240 seconds]
<SQLDarkly>
Hey all. I have several nest ifs like this >http://pastebin.com/zxbKYF3V< My question is if this is the "best ruby way" of doing it. My background is shell scripting for unix administration, but im trying to get a good handle on ruby just because i want to :)
mercwithamouth has quit [Ping timeout: 256 seconds]
melty has joined #ruby
melty has quit [Remote host closed the connection]
mjs2600 has joined #ruby
tjbiddle has quit [Ping timeout: 272 seconds]
m8 has quit [Read error: Connection reset by peer]
<Spooner_>
SQLDarkly, The first else/if can be an elsif. That saves an indent.
tjbiddle has joined #ruby
clooth_ has joined #ruby
zigomir has joined #ruby
<Spooner_>
SQLDarkly, _person['data']['classes'] == nil should be .nil?
m8 has joined #ruby
<kapowaz>
what's a good, terse way of testing if a hash has a key with an empty value where that key might not always exist?
<kapowaz>
since foo[key].empty? will die nastily if foo.key? key == false
<SQLDarkly>
im checking if its empty as in "" or nil/null trying to capture if a user inputs no data into my db
<Spooner_>
SQLDarkly, Yes, but you should .nil? not == nil
<SQLDarkly>
AH gotcha :)
russt has joined #ruby
<Spooner_>
And the == "" can be .empty?
<Xeago>
also, your else statements or nondestructive
<Xeago>
they can be done before any if statements
<Xeago>
and then the if statements can run
<SQLDarkly>
What about ternary operator? Ive been reading a few posts who say to use them instead of if/else, but not in nested scenarios. Would that be an accurate statement?
pavilionXP has quit [Read error: Operation timed out]
<Xeago>
removing most of the else clauses
arturaz has joined #ruby
clooth has quit [Ping timeout: 276 seconds]
clooth_ is now known as clooth
<Spooner_>
SQLDarkly, Yes, I wouldn't use them there. at all. Just for one-liners (and by one liners I mean < 60 characters total, not just on one line :D).
<SQLDarkly>
ok good to know. Ill keep that in mind.
tjbiddle_ has quit [Ping timeout: 255 seconds]
<Xeago>
also, don't use or please
<Xeago>
use ||
thams has joined #ruby
elkng has quit [Ping timeout: 252 seconds]
<SQLDarkly>
What is the caveat of doing so Xeago ?
<Xeago>
or has an unexpected, different precedence
pavilionXP has joined #ruby
<Xeago>
sooner or later you will run into an error with or, and if not properly taught, you will be flabbergasted :)
<Xeago>
or has lower precedence than || has
doodlehaus has joined #ruby
dougireton has quit [Quit: Leaving.]
<Spooner_>
Xeago, It isn't unexpected or surprising for me. Actually, I find it easier than the very strong precedence of || to manage.
pavilionXP has quit [Max SendQ exceeded]
freakazoid0223 has quit [Quit: Leaving]
tylersmith has joined #ruby
pavilionXP has joined #ruby
<Spooner_>
I would argue that you can get into trouble with either if you don't know how they work. You are assuming that everyone knows exactly how || works and haven't aclue about or.
<Xeago>
Spooner_: I am assuming that because most other languages, including shell scripting, have that behaviour
<Xeago>
but yes, it is an assumption :)
<SQLDarkly>
yeah || is what i typically use in shell scripts for >or<
<SQLDarkly>
This is good stuff I appreciate the input at this point in my ruby learning.
<Spooner_>
Xeago, Python has or/and but not &&/|| ;)
fourq has quit [Ping timeout: 260 seconds]
blf has quit [Ping timeout: 245 seconds]
<Xeago>
I bet their precedence is similar if not equal to ||/&&
mjs2600 has quit [Quit: Bye]
<Spooner_>
SQLDarkly, I'd make the whole thing an expression too. Every path just sets _classes, so put _classes = if update.classes?
dougireton has joined #ruby
mjs2600 has joined #ruby
workmad3 has quit [Ping timeout: 264 seconds]
fourq has joined #ruby
<Spooner_>
SQLDarkly, And I've never seen leading underscores in Ruby before. Don't use them ;)
<SQLDarkly>
ah. I typically use them to denote private variables vs ones outside the class im working in..... no good?
beaky has joined #ruby
<beaky>
hello
<Spooner_>
SQLDarkly, Those are local variables. @ivar are naturally not public, so they don't need additional decoration.
eldariof has quit []
<beaky>
how does ruby OOP differ from Java/C#-style OOP?
<SQLDarkly>
so i should be using @ instead of _ in that case?
rmartin has quit [Remote host closed the connection]
adambeynon has joined #ruby
dougireton has quit [Client Quit]
<Spooner_>
SQLDarkly, I don't know what you are doing with the variables. If they are local variables, then you don't use @ivar for them. I'm not sure of the whole context...
stormetrooper has quit [Ping timeout: 246 seconds]
<SQLDarkly>
hmmm ok ill keep that in mind as I flesh this out
<Spooner_>
SQLDarkly, Line 9 can be simplified to: classes |= c ( | is union; & is intersection for arrays).
<Mon_Ouie>
beaky: First because it doesn't need anything like interfaces to do duck typing
otters has joined #ruby
<Spooner_>
SQLDarkly, Sorry, ignore me. You already used uniq. I misread the code.
<Mon_Ouie>
So it can use message-passing as a means of controlling flow (specifically, branching) to a much greater extent
<SQLDarkly>
man that is much cleaner. I got a ways heh
arya has quit [Ping timeout: 244 seconds]
mockra has quit [Remote host closed the connection]
dougireton1 has joined #ruby
arya has joined #ruby
andreaslundahl has left #ruby ["ruby"]
maxmanders has joined #ruby
io_syl has quit [Ping timeout: 252 seconds]
<beaky>
ah
havenwood has joined #ruby
jimeh has joined #ruby
cdt has quit [Quit: Ex-Chat]
havenwood has quit [Remote host closed the connection]
io_syl has joined #ruby
<Spooner_>
SQLDarkly, And I was bored, so I gave you a super-condensed version (though whether it is as readable in terms of what it is doing is questionable)
zigomir has quit [Quit: zigomir]
<Spooner_>
I don't think I like it.
sayan has joined #ruby
<SQLDarkly>
Seems straight forward enough. Im not looking for the most amount of shorthand, but I would like a nice balance between shorthand and readability.
krawchyk has quit [Remote host closed the connection]
sayan has quit [Read error: Connection reset by peer]
<Spooner_>
SQLDarkly, I've just been doing a lot of Python recently, so I needed to do some Ruby to keep sane :)
<SQLDarkly>
the amount of ifs im using didnt feel very rubyee. Felt more like a shell script, but i guess that makes sense since im most comfortable with them heh
jtharris has quit [Quit: WeeChat 0.4.0]
<SQLDarkly>
(person['data']['classes'] | update[:classes]).sort is the >|< a concat?
<Spooner_>
| is union (that is, concat + uniq).
<Spooner_>
As in set union.
<tjbiddle>
Hi guys. Getting a 'no checksum for … (ruby-1.9.3)…' error when install ruby-1.9.3 via RVM. Anyone run into this before? Just a bit skeptical due to the security issues recently. (I am on a company VPN so I would assume my network is secure)
<Mon_Ouie>
(Looking at the implementation, it doesn't anticipate the growth of the hash, only for the new array)
lifestream has left #ruby ["Bye Bye!"]
<Mon_Ouie>
Oh actually, it might do it for both, can't see it from the code of uniq alone though
mneorr has quit [Read error: Connection reset by peer]
mockra has joined #ruby
lancepantz is now known as lancepantz_
zigomir has quit [Quit: zigomir]
mneorr has joined #ruby
mockra has quit [Remote host closed the connection]
mockra has joined #ruby
samphippen has quit [Quit: Computer has gone to sleep.]
dougireton has joined #ruby
Limca has quit []
fphilipe has quit [Remote host closed the connection]
Spami has quit [Quit: This computer has gone to sleep]
jrajav has quit [Quit: I tend to be neutral about apples]
<a_a_g>
is there a way to dynamically define a private method?
Tuxist has joined #ruby
rdark has joined #ruby
<arturaz>
a_a_g, yes
<arturaz>
private :method_name
baphled has quit [Ping timeout: 245 seconds]
<a_a_g>
ah. so just define_method :method_name followed by private :method_name?
kmurph has joined #ruby
<davidcelis>
if you're within the class, yes
lancepantz_ is now known as lancepantz
Tarential has quit [Excess Flood]
<a_a_g>
within class_exec
Tarential has joined #ruby
anderse has joined #ruby
iamjarvo has quit [Quit: Leaving.]
<tjbiddle>
Getting "….rubygems/dependency.rb:247:in `to_specs': Could not find rubygems-bundler (>= 0) amongst [] (Gem::LoadError)" as an error every time I try to `gem install [anything]`. Any ideas? Tried pretty much everything that pops up on Google. (Imploded and re-installed rvm, ensured I'm sourcing the rvm path (which ruby and gem shows it pointing there), re-installed ruby on a system level, removed all system level gems, removed all
<tjbiddle>
rvm level gems, i'm out of ideas.
elico has quit [Remote host closed the connection]
mark_locklear has quit [Ping timeout: 264 seconds]
reppard has joined #ruby
matchaw has joined #ruby
<tjbiddle>
Got it. I had a ~/.gemrc file that was breaking things.
jokke has joined #ruby
emergion has joined #ruby
Neomex has joined #ruby
sabooky has joined #ruby
<jokke>
t
<sabooky>
Hi, I have a quick question: What is a good templating language that supports inheritance? (I'm templating json files)
Cymurai has joined #ruby
<Gate>
sabooky: rabl
<sabooky>
Wnat to have "building block" json files and be able to join them and do substitutions on them
asdfqwer has joined #ruby
<sabooky>
Gate: Thank you sir, I'll take a look at it (Haven't done any ruby templating beyond erb)
<Gate>
sabooky: I haven't used rabl's inheritance, but it supports it, and its a reasonably good json view generator
Neomex has quit [Client Quit]
jwang has quit [Read error: Connection reset by peer]
greenysan has quit [Ping timeout: 260 seconds]
eliasp has joined #ruby
wmoxam has quit [Quit: leaving]
<sabooky>
Gate: Quickly glancing at the docs.. this might be perfect.. Thanks again :p
matchaw has quit [Ping timeout: 256 seconds]
<sabooky>
:)
<Gate>
yep, GL
jwang has joined #ruby
buibex has quit [Remote host closed the connection]
<jokke>
hey! i'm debugging my code here and i'm very new to ruby so bear with me again.. i have a class foo that has attr :bar. Now i have another class foobar < fuu which uses bar = 'bar' in initialize. this however doesn't set @bar accordingly
matchaw__ has joined #ruby
s__dana has quit [Quit: s__dana]
zigomir has joined #ruby
<Mon_Ouie>
Because bar = 'bar' sets a *local* variable bar to 'bar'
carloslopes has joined #ruby
ada2358_ has quit [Ping timeout: 244 seconds]
<Mon_Ouie>
To call a setter method you always need an explicit receiver, so in this case self.bar = 'bar'
<jokke>
Mon_Ouie: ah okay cool
thone has joined #ruby
<jokke>
thanks
a_a_g has quit [Quit: Leaving.]
_carloslopes has joined #ruby
carloslopes has quit [Read error: Connection reset by peer]
tylersmith has quit [Quit: tylersmith]
Spami has joined #ruby
fmcgeough has quit [Quit: fmcgeough]
m8 has quit [Read error: Connection reset by peer]
thone_ has quit [Ping timeout: 264 seconds]
matchaw__ has quit [Ping timeout: 264 seconds]
m8 has joined #ruby
Tuxist has quit [Remote host closed the connection]
grzywacz has joined #ruby
grzywacz has quit [Changing host]
grzywacz has joined #ruby
nomenkun has quit [Remote host closed the connection]
toekutr has joined #ruby
noxoc has joined #ruby
matchaw_ has joined #ruby
agarie has joined #ruby
Kuifje has quit [Read error: Connection reset by peer]
matchaw_ has quit [Read error: Connection reset by peer]
Kuifje has joined #ruby
Kuifje has quit [Changing host]
Kuifje has joined #ruby
gosshedd has quit [Ping timeout: 255 seconds]
baphled has quit [Ping timeout: 272 seconds]
DaZ has quit [Ping timeout: 252 seconds]
parallel21 has left #ruby [#ruby]
fgro has joined #ruby
Kingy has quit [Ping timeout: 272 seconds]
FloatingWeed has joined #ruby
blacktulip has quit [Remote host closed the connection]
Lubinski has quit [Read error: Connection reset by peer]
jeffreybaird has quit [Quit: jeffreybaird]
emergion has quit [Quit: Computer has gone to sleep.]
mhf has quit [Remote host closed the connection]
freeayu has quit [Read error: Connection timed out]
Guest91507 has joined #ruby
wyhaines has quit [Remote host closed the connection]
MattRB has quit [Quit: This computer has gone to sleep]
Retistic has quit [Quit: Retistic]
<unstable>
What is the proper way to do a new line on a puts statement?
cjs226 has quit []
russt has quit [Quit: russt]
<unstable>
At the end of line 0, I do '\' at the end.. then on the second line do I add spaces so my words don't indent less than the line -1?
66MAACSS8 has joined #ruby
voodoofish has quit [Ping timeout: 255 seconds]
FloatingWeed has quit [Ping timeout: 264 seconds]
codecop has quit [Quit: Išeinu]
<Spooner_>
unstable: Use heredoc for multiline text. puts <<END_OF_TEXT
deed02392 has quit [Read error: Operation timed out]
Spami has quit [Quit: This computer has gone to sleep]
spider-mario has quit [Remote host closed the connection]
Guest123 has joined #ruby
workmad3 has quit [Ping timeout: 264 seconds]
macclearich_ has joined #ruby
<havenwood>
If anyone with Windows Ruby install available would mind testing this, I'd love to know if it works on Windows??: https://gist.github.com/havenwood/4718244
<havenwood>
from irb, or whatever
Mon_Ouie has quit [Quit: WeeChat 0.4.0]
<Spooner_>
havenwood, Rather depends how you installed Ruby.
<havenwood>
Spooner_: How so?
pavilionXP has quit [Ping timeout: 252 seconds]
<macclearich_>
has anyone got time to help me hash out an inheritance / namespacing issue?
<havenwood>
Spooner_: Searches each directory listed in PATH for the Ruby executable.
deed02392 has joined #ruby
<Spooner_>
Ruby installer is C:/Ruby193/bin, but pik is like rvm (C:/users/spooner/.pik/rubies/193p999 or similar).
<havenwood>
Spooner_: Should get those, at least I was trying to... :O
<Spooner_>
havenwood, You could just use "where" which is the Windows version of "which" ;)
MattRB has joined #ruby
Pip has left #ruby ["Leaving"]
<havenwood>
Spooner_: That would make sense. But I'm trying to find multiple ruby installs that might conflict in the PATH. (I didn't explain my purpose well.) https://github.com/rubygems/rubygems/issues/184
banjara1 has quit [Quit: Leaving.]
<Spooner_>
havenwood, Or just use RbConfig.ruby
banjara has joined #ruby
templaedhel has quit [Quit: Leaving...]
<Spooner_>
Ah, I see. I'm not on Windows right now, but I do use Ruby on Windows.
<Spooner_>
Or do you want to create a new token inside User?
<havenwood>
billiam: No, you can't. I'm having one of those days... :(
asdfqwer has quit []
<Spooner_>
macclearich_, Oops, token is a module. I can't read. Not sure what you mean again. Sorry!
<macclearich_>
that's more the idea, Spooner - calling User.new.Token should result in (at least) a token generated from the User's guid, if not (even better) having the token be stored in User.
pierre1 has joined #ruby
<macclearich_>
(and I confess that I'm probably not explaining that well)
justsee has joined #ruby
justsee has quit [Changing host]
justsee has joined #ruby
ephemerian has joined #ruby
<billiam>
havenwood, how about (paths.to_s & ['ruby', 'ruby.exe']).empty?
iamjarvo has joined #ruby
<Spooner_>
macclearich_, Updated that gist with another idea...
<macclearich_>
right
<Spooner_>
macclearich_, I'm really struggling without more context though. Sorry.
<macclearich_>
that was a place I went to
Kuifje has quit [Ping timeout: 246 seconds]
phantasm66 has quit [Quit: *sleeeep….]
<piukeman>
hi :-) I am working on a project for college!!! I did this http://pastebin.com/BKCqAng1 to insert to a sqlite database, now I would like to retrieve or list that information in a table...
<macclearich_>
it's ok, I'm gonna generate another gist with (hopefully) a better explanation
<piukeman>
it is very simple the program…
<macclearich_>
but the reason for this is to maintain syntactical parity -as much as possible- with a library that's written in another language
<piukeman>
What I did 1) create the database 2) Insert in the database information
<Spooner_>
macclearich_, It is usually simpler to explain your intention, not show your code, since your incorrect attempt can be more confusing than helpful ;)
<piukeman>
what I would like to do, list the information in a table …
PragCypher has quit [Quit: Leaving]
eliasp has joined #ruby
<Spooner_>
piukeman, is this a #rubyonrails question?
the_mentat has quit [Quit: Computer has gone to sleep.]
<macclearich_>
most things I 've done on this project are more confusing than helpful
philcrissman has quit [Remote host closed the connection]
<macclearich_>
but: calling create in the DeleteToken module which is set up as an instance variable of user
emmanuelux has joined #ruby
<macclearich_>
should set another instance variable *in* user
psyprus has quit [Ping timeout: 248 seconds]
<piukeman>
Spooner_: no sorry I did no tell in wich framework I am working !!! shoes
thams has joined #ruby
philcrissman has joined #ruby
FloatingWeed has quit [Remote host closed the connection]
<Spooner_>
piukeman, That matters a lot ;)
kiwnix has joined #ruby
<piukeman>
yes I know …really sorry
WhereIsMySpoon has quit [Changing host]
WhereIsMySpoon has joined #ruby
pu22l3r_ has joined #ruby
emmanuelux has quit [Read error: Connection reset by peer]
kristofers has quit []
<havenwood>
billiam: ya, that would make sense - remove by elimination (i do need to check against the files in the path dir, not path itself though). Mind trying one more?? https://gist.github.com/havenwood/4718244
Xeago has quit [Remote host closed the connection]
<Spooner_>
Or regexp /^ruby(?:\.exe)?$/
eliasp has quit [Remote host closed the connection]
philcrissman has quit [Ping timeout: 248 seconds]
cheese1756 has joined #ruby
cheese1756 has quit [Changing host]
cheese1756 has joined #ruby
pu22l3r has quit [Ping timeout: 264 seconds]
joshman_ has quit [Ping timeout: 276 seconds]
moted has joined #ruby
<havenwood>
Spooner_: Would /^ruby(\.exe)$/ suffice/
__BigO__ has quit [Remote host closed the connection]
<havenwood>
?
Umren has quit [Read error: Connection reset by peer]
eliasp has joined #ruby
<Spooner_>
havenwood, It would, but it would capture ".exe" or nil into $1
<havenwood>
Spooner_: ahhhhh
<Spooner_>
Oh and you do need the ? or you are forced to have the .exe. The (?:) is just like () but doesn't capture.
noxoc has quit [Quit: noxoc]
cheese1756 has quit [Client Quit]
<havenwood>
Spooner_: kk, so? /^ruby(.exe)?$/
nari has joined #ruby
<Spooner_>
Nope, because then you are matching rubyZexe too ;) Remember the \
pavilionXP has joined #ruby
<piukeman>
how I list the information of a table (sqlite) in ruby…I do not know how to start . A clue please :-)
<havenwood>
Spooner_: Gah! Right.
angusiguess has quit [Ping timeout: 256 seconds]
hadees has quit [Read error: Connection reset by peer]
meoblast001 has joined #ruby
<Spooner_>
piukeman, It is likely that you won't find someone who both knows Shoes and sqlite and also is awake and in channel ;) We aren't ignoring you. Just don't know.
jtharris has quit [Ping timeout: 246 seconds]
arturaz has quit [Ping timeout: 245 seconds]
<piukeman>
Spooner_: :-) thanks :-)
hadees has joined #ruby
rdark has quit [Ping timeout: 246 seconds]
<havenwood>
And then of course 1.8 doesn't have #keep_if... 1.8 and windows are conspiring against me!
<Spooner_>
havenwood, #select or #filter
pasties has quit [Ping timeout: 256 seconds]
arturaz has joined #ruby
baphled has quit [Ping timeout: 255 seconds]
melty has joined #ruby
melty has quit [Remote host closed the connection]
<havenwood>
Spooner_: Nice, thanks again!
dr_neek has quit [Quit: dr_neek]
pasties has joined #ruby
m8 has quit [Quit: Sto andando via]
MattRB has left #ruby ["Leaving"]
mattbl has joined #ruby
josh_keith has quit [Read error: Connection reset by peer]
melty has joined #ruby
melty has quit [Remote host closed the connection]
jpfuentes2 has joined #ruby
<Spooner_>
havenwood, Ah, keep_if == select!, not select
v0n is now known as viviez
jfl0wers has quit [Quit: jfl0wers]
<havenwood>
Spooner_: Was trying to think if I want to modify the receiver or use the return value, hrm
ner0x has quit [Quit: Leaving]
halogenandtoast has joined #ruby
<halogenandtoast>
Does anybody happen to know where in the source ruby handles string interpolation?
arturaz has quit [Remote host closed the connection]
main has quit [Ping timeout: 248 seconds]
emmanuelux has joined #ruby
<havenwood>
halogenandtoast: #{}?
Norrin has left #ruby [#ruby]
jfl0wers has joined #ruby
<havenwood>
halogenandtoast: CRuby?
rezzack has quit [Quit: Leaving.]
<halogenandtoast>
Yes and yes.
anderse has quit [Quit: anderse]
alanp has joined #ruby
alanp has quit [Read error: Connection reset by peer]
jerius has quit []
alanp has joined #ruby
alanp_ has quit [Read error: Connection reset by peer]
pavilionXP has quit [Read error: Connection timed out]
tvw has quit [Remote host closed the connection]
<banister`sleep>
davidcelis: that was it...thanks! you're the man!
RagingDave has quit [Quit: Ex-Chat]
<banister`sleep>
:))
timmow has joined #ruby
<otay>
Hi! I want to install something called "fpm" (if anybody has used this, reviews are appreciated). I haven't used Ruby but apparently all I need to do is `gem install fpm`. The output I'm getting (errors) is: http://codepad.org/PGesUnt0. What do I do?
<davidcelis>
glad i could... uh.... help
zenspider has joined #ruby
jrafanie has quit [Quit: jrafanie]
<timmow>
otay: you need to install the ruby header files, they are usually called something like ruby-dev
66MAACSS8 has quit [Ping timeout: 252 seconds]
<otay>
okay
* otay
goes 4 it
jjang has quit [Remote host closed the connection]
zenspider has left #ruby ["ERC Version 5.3 (IRC client for Emacs)"]
asteridz has joined #ruby
awkwords has quit [Quit: Lost terminal]
asteridz has left #ruby [#ruby]
kmurph has joined #ruby
<otay>
That did make a difference. Some progress happened.
<otay>
fetch error. Could be a proxy problem maybe
horofox has joined #ruby
* otay
googles it
horofox has quit [Client Quit]
horofox has joined #ruby
pewter_tao has left #ruby [#ruby]
jlast has quit [Remote host closed the connection]
moted has joined #ruby
<nate_h>
is there some way I can have match exceptions to raises
<nate_h>
I have a number of conditionals in a loop that can raise different exceptions, and I want a different rescue for each one.
Kingy has joined #ruby
vinax has joined #ruby
ahokaomaeha has quit [Ping timeout: 246 seconds]
<nate_h>
can the rescue detect the message, or some user defined string to determine what to do with each raise?
Retistic has joined #ruby
apok has joined #ruby
itsdavem has joined #ruby
<Gate>
nate_h: you can check on e.message, OR you can raise a different error for each situation
havenwood has joined #ruby
samlt has quit [Ping timeout: 264 seconds]
<Gate>
nate_h: so for instance class CampaignError < Exception; end; and class TemplateError < Exception; end; can each be caught by a different rescue
jeffreybaird has joined #ruby
jeffreybaird has quit [Client Quit]
cbnoonan has joined #ruby
<nate_h>
Gate, i see how I can reorder my statements in this case, but yeah I should learn that for the future.
ryanh has quit [Quit: Computer has gone to sleep.]
iamjarvo has quit [Ping timeout: 248 seconds]
<Gate>
davidcelis: weren't engines available <= 3? I thought the big thing about 3 and engines is that application started subclassing engine at 3.0
mengu has quit [Quit: This computer has gone to sleep]
horofox has joined #ruby
<nate_h>
gate, ah i gotcha, so you user define an exception then go rescue MyCustomExceptionClass
<Gate>
nate_h: yep!
<Gate>
nate_h: you'll see quite a few libs out there use that technique, that way they can be sure they are catching only exceptions they mean to, and they know exactly what they mean :)
<davidcelis>
Gate: not really
<davidcelis>
they weren't mountable plugins
Cymurai has joined #ruby
<davidcelis>
they were a hacky thing
<nate_h>
Gate, just a note, i was just reading that its bad form to inherit directly from Exception, and that StandardError is a better one to inherit.
<Gate>
gotcha
_nitti has joined #ruby
<davidcelis>
nate_h: yes
<Gate>
nate_h: I'll consider myself chastised and go read up on it
<chiel>
hi guys, has anyone here used guard in combination with thin?
<nate_h>
Gate, hehe. they just noted that Exception is a general type of exception and StandardError is an application space one
nari has quit [Ping timeout: 272 seconds]
<nate_h>
shrug
itsdavem has quit [Remote host closed the connection]
<nate_h>
and if you inherit from Exception you risk catching exceptions from general stuff, vs the one you actually raised.
<Gate>
nate_h: no problem, I just wrote that line offhand from memory, so I'm not surprised it wasn't perfect
<Gate>
wait, what/
<nate_h>
Gate, yeah, thanks much for the help.
<nate_h>
Update: Several people have pointed out, in the comments that inheriting from Exception directly is a big no-no when creating custom exceptions. You should instead inherit from StandardError. This is because exceptions that inherit from StandardError deal with application level errors, while if you inherit Exception directly you risk catching errors to do with the environment. Also the convention is to end your exceptions with the word Error rat
<nate_h>
her than exceptions e.g.:
<nate_h>
that's what I saw in a post on this exact topic.
<Gate>
will rescue catch the superclass of your exception?
<nate_h>
maybe it needs more research
<Gate>
I know that rescuing Exception is a no-no
<Gate>
odd
<nate_h>
it kind of implies that it will catch them
<nate_h>
anyone else know?
itsdavem has joined #ruby
slainer68 has quit [Remote host closed the connection]