rubyracer has quit [Quit: Konversation terminated!]
<platzhirsch>
gumba
maletor has joined #ruby
Txandy|away is now known as Txandy
g0bl1n has joined #ruby
xcv_ has joined #ruby
cj3kim has quit [Ping timeout: 252 seconds]
rezzack has joined #ruby
IceyEC has joined #ruby
aspires has quit [Remote host closed the connection]
pel_daniel has left #ruby [#ruby]
aspires has joined #ruby
xcv_ has quit [Remote host closed the connection]
Chioque has quit [Ping timeout: 272 seconds]
xcv_ has joined #ruby
xcv has quit [Ping timeout: 240 seconds]
skyjumper has joined #ruby
Baluse has quit [Ping timeout: 265 seconds]
<skyjumper>
a weird issue just started showing up in irb
Baluse has joined #ruby
ndrei has quit [Read error: Operation timed out]
<skyjumper>
if i Ctrl-R to search for something, then Ctrl-C to cancel, arrow keys are then broken
habanany has joined #ruby
<skyjumper>
ruby 2.0.0p247
<skyjumper>
seems ok in other libreadline stuff - gdb, python
nateberkopec has joined #ruby
<skyjumper>
also this is on debian-testing
<skyjumper>
sound familiar to anyone?
nanoyak has quit [Quit: Computer has gone to sleep.]
DrShoggoth has joined #ruby
sdwrage has joined #ruby
VTLob has quit [Quit: VTLob]
IceyEC has quit [Quit: IceyEC]
DrShoggoth has quit [Max SendQ exceeded]
<platzhirsch>
skyjumper: cannot reproduce, I guess it's a shell/bash/terminal issue?
<skyjumper>
dunno, just started happening
DrShoggoth has joined #ruby
|RicharD| has quit [Quit: Sto andando via]
habanany has quit [Ping timeout: 252 seconds]
relix has joined #ruby
<platzhirsch>
It's scary
davy_ has joined #ruby
<skyjumper>
scary when things break when nothing changes
ohwhoa has quit [Quit: woah!]
relix has quit [Read error: Connection reset by peer]
nanoyak has joined #ruby
apeiros has quit [Remote host closed the connection]
relix has joined #ruby
apeiros has joined #ruby
DrShoggoth has quit [Read error: No route to host]
nateberkopec has quit [Quit: Leaving...]
predator217 has joined #ruby
g0bl1n has quit [Ping timeout: 240 seconds]
xcv_ has quit [Ping timeout: 248 seconds]
zz_karupanerura is now known as karupanerura
apeiros has quit [Remote host closed the connection]
Txandy is now known as Txandy|away
apeiros has joined #ruby
slowcon has quit [Read error: Connection reset by peer]
predator117 has quit [Ping timeout: 245 seconds]
relix has quit [Ping timeout: 272 seconds]
slowcon has joined #ruby
ElComradio has joined #ruby
carif has quit [Quit: Ex-Chat]
carif has joined #ruby
[gmi] has quit [Read error: Connection reset by peer]
fedesilva has quit [Remote host closed the connection]
carif has quit [Read error: Connection reset by peer]
carif has joined #ruby
Megtastique has joined #ruby
Es0teric_ has joined #ruby
<platzhirsch>
skyjumper: I just ate some mushrooms to calm down
figgleberry has quit [Ping timeout: 260 seconds]
oso96_2000 is now known as oso|away
x77686d has joined #ruby
Es0teric has quit [Ping timeout: 265 seconds]
<waxjar>
chestnut mushrooms with shallots and bacon. om nom nom :D
mocfive has joined #ruby
<platzhirsch>
right on
dik_dak has joined #ruby
<platzhirsch>
I am taking a break of Ruby but at some point in the near future I have to return, otherwise I will get sick
dawkirst has quit [Ping timeout: 252 seconds]
srji_ has joined #ruby
[krisbulman] is now known as krisbulman
srji has quit [Ping timeout: 252 seconds]
Asher has quit [Remote host closed the connection]
pkondzior___ has joined #ruby
Asher has joined #ruby
i_s has joined #ruby
Bowser_jr has joined #ruby
Bowser_jr has left #ruby [#ruby]
oso|away is now known as oso96_2000
Kricir has quit [Ping timeout: 264 seconds]
dx7 has joined #ruby
Amart41 has joined #ruby
davy_ has quit [Remote host closed the connection]
chomskiii has quit [Read error: Connection reset by peer]
chomskiii has joined #ruby
Synthead has joined #ruby
wynyard has joined #ruby
oso96_2000 is now known as oso|away
Es0teric_ has quit [Ping timeout: 252 seconds]
yarou has joined #ruby
dx7 has quit [Ping timeout: 245 seconds]
Amart41 has quit [Ping timeout: 265 seconds]
saarinen has quit [Quit: saarinen]
shinobi_one has joined #ruby
Shidash has quit [Quit: Leaving.]
dawkirst has joined #ruby
<lamba>
i'm struggling to do a put request with httparty module, i've got response = apiobj.put("/api/alt/#{altnum}", :query => { :thold => 92 }) but it dosent seem to alter the value thold. i've tried :data and :body also, and giving 92 as '92' also. the debug output shows the call being made but no luck. - i've managed to alter the value with wget -X PUT using -d 'thold=92' though. any ideas ? not seems many examples for httparty put requests (like, one)
<lamba>
seen*
Solnse has quit [Ping timeout: 252 seconds]
davy_ has joined #ruby
davy_ has quit [Read error: Connection reset by peer]
gja has joined #ruby
<skyjumper>
platzhirsch: special mushrooms?
Synthead has quit [Ping timeout: 240 seconds]
<skyjumper>
not sure if that'd calm me down
<lamba>
as i understand it, for a put request i should be using :data => { :thold = 92 } ? didnt work though
cj3kim has quit [Remote host closed the connection]
maletor has joined #ruby
AlSquire has quit [Quit: This computer has gone to sleep]
tauebel1 has joined #ruby
relix has quit [Ping timeout: 248 seconds]
rootshift has quit [Quit: My MacBook has decided to go to sleep. Zzzz..]
tauebel has quit [Ping timeout: 240 seconds]
dawkirst has joined #ruby
mocfive has quit [Remote host closed the connection]
mary5030 has quit [Remote host closed the connection]
top4o has joined #ruby
kpshek has joined #ruby
guyz has quit [Quit: quit]
subbyyy has quit [Ping timeout: 245 seconds]
andredieb has quit [Remote host closed the connection]
senayar__ has quit [Remote host closed the connection]
Jdubs has quit [Remote host closed the connection]
mocfive has joined #ruby
mocfive has quit [Remote host closed the connection]
Virtualize|away has joined #ruby
mocfive has joined #ruby
havenwood has joined #ruby
SCommette has joined #ruby
mocfive has quit [Remote host closed the connection]
angusigu1ss has quit [Ping timeout: 240 seconds]
Jdubs has joined #ruby
ce_afk is now known as cescalante
mikesplain has joined #ruby
troyready has quit [Ping timeout: 272 seconds]
agent_white has quit [Quit: gnight]
wiku5__ has joined #ruby
sdwrage has quit [Quit: This computer has gone to sleep]
64MABFPD1 has joined #ruby
64MABFPD1 has quit [Quit: WeeChat 0.4.1]
maletor has quit [Quit: Computer has gone to sleep.]
snath has quit [Read error: Connection reset by peer]
Kricir has quit [Remote host closed the connection]
tylersmith has quit [Remote host closed the connection]
qpls has quit [Changing host]
qpls has joined #ruby
bklane has joined #ruby
rljohnsn has quit [Quit: Leaving.]
mikesplain has quit [Ping timeout: 245 seconds]
decoponio has joined #ruby
x77686d has quit [Quit: x77686d]
mlpinit has joined #ruby
andredieb has joined #ruby
ElComradio has joined #ruby
cj3kim has joined #ruby
cj3kim has quit [Remote host closed the connection]
sambao21 has quit [Ping timeout: 272 seconds]
Xeago has quit [Remote host closed the connection]
lukec has quit [Quit: lukec]
<wiku5__>
/wc
wiku5__ has left #ruby ["WeeChat 0.4.1"]
SCommette has quit [Quit: SCommette]
benzrf has left #ruby [#ruby]
richaroo has joined #ruby
george2 has quit [Remote host closed the connection]
<bklane>
I have a model that has attributes for every day of the calander that differ randomly. What would be the best way to set up such type of relationship. Give each model many dates and have a date object for each day for each property or a hash attribute for the property which will just be rather large (365+ days per property)
sambao21 has joined #ruby
<centrx>
bklane, Try #rubyonrails
richaroo has quit [Remote host closed the connection]
michael_lee has joined #ruby
bcz1 has joined #ruby
dawkirst has quit [Ping timeout: 245 seconds]
Xuisce has joined #ruby
REdOG has left #ruby [#ruby]
bcz has quit [Ping timeout: 252 seconds]
snath has joined #ruby
Viridisignis_ has quit [Read error: Connection reset by peer]
RoxasShadowRS has quit [Read error: Connection reset by peer]
kpshek has quit []
Viridisignis_ has joined #ruby
jpstokes has quit [Remote host closed the connection]
axl_ has joined #ruby
angusigu1ss has joined #ruby
freerobby has quit [Quit: Leaving.]
mocfive has joined #ruby
aryaching has quit [Quit: sayonara! ^_^]
freerobby has joined #ruby
yfeldblum has quit [Remote host closed the connection]
cashnguns has quit [Ping timeout: 260 seconds]
link151 has left #ruby [#ruby]
aryaching has joined #ruby
angusigu1ss has quit [Ping timeout: 264 seconds]
nycjv321 has joined #ruby
atraylen has joined #ruby
acl_ has joined #ruby
[krisbulman] is now known as krisbulman
mikepack has joined #ruby
maletor has joined #ruby
nari has joined #ruby
krisbulman is now known as [krisbulman]
davy_ has joined #ruby
dawkirst has joined #ruby
<acl_>
is the MRI interpreter the default when you install Ruby for either Linux or Mac OS?
Hanmac1 has joined #ruby
mikesplain has joined #ruby
mikesplain has quit [Client Quit]
mikepack has quit [Ping timeout: 264 seconds]
davy_ has quit [Ping timeout: 240 seconds]
Hanmac2 has joined #ruby
Hobogrammer has joined #ruby
Hanmac has quit [Ping timeout: 272 seconds]
Jdubs has quit [Remote host closed the connection]
<havenwood>
acl_: MRI is the reference implementation that comes preinstalled on OS X an many Linux/BSD distros
cescalante is now known as ce_afk
blaz3rz has joined #ruby
figgleberry has quit [Ping timeout: 252 seconds]
<acl_>
havenwood: thanks! I'm still learning the language, but when do you generally consider using other implementations?
Hanmac1 has quit [Ping timeout: 265 seconds]
thesheff17 has joined #ruby
thesheff17 has quit [Client Quit]
thesheff17 has joined #ruby
sdwrage has joined #ruby
<havenwood>
acl_: JRuby and Rubinius have done away with the Global VM Lock, so they are the goto for parallel threading.
JGreG has joined #ruby
kenneth has joined #ruby
<havenwood>
acl_: If you need JVM access, JRuby is great.
<havenwood>
acl_: Ruby is the most-used implementation.
felixjet_ has quit [Quit: Leaving]
<acl_>
havenwood: you mean MRI?
felixjet_ has joined #ruby
<havenwood>
mruby, topaz and maglev are honorable mentions
<havenwood>
acl_: yes
aspires has quit []
<havenwood>
mruby is going to be a big thing, maglev and topaz are neat but have yet to prove themselves
dorei has quit []
cashnguns has joined #ruby
mary5030 has joined #ruby
cashnguns has quit [Read error: Connection reset by peer]
<acl_>
what are the benefits with mruby, compared to jruby/rubinius?
blaz3rz has quit [Ping timeout: 264 seconds]
<havenwood>
acl_: mruby can be embedded without an os, or can be embedded in another lang
Voodoofish430 has quit [Quit: Leaving.]
pietr0 has quit [Quit: pietr0]
JGreG has quit [Client Quit]
<havenwood>
acl_: your toaster can run mruby, and it can compete with lua for embedded gaming lang
Kricir has joined #ruby
Spleeze has quit [Ping timeout: 272 seconds]
relix has joined #ruby
<havenwood>
mruby in bios
<havenwood>
etc
<acl_>
that does sound good
<acl_>
well, i probably don't have to think about these too much at the moment
<havenwood>
it is what Matz (creator of Ruby) is spending his time on
fedesilva has joined #ruby
mikepack_ has quit [Remote host closed the connection]
<acl_>
since i'm still learning, i just needed to know what the equivalent of cpython was in ruby. figured it was MRI, but it's better to confirm.
<havenwood>
acl_: Learn Ruby proper, and you're in good shape. You can switch to JRuby when the libs demand it.
<acl_>
that won't require me to write some java, i hope? i get enough trouble dealing with c# at work
relix has quit [Ping timeout: 248 seconds]
ckinni has joined #ruby
<havenwood>
Just focus on MRI 2.0 or 2.1 and you're in good shape.
<acl_>
good to know. thanks, havenwood!
Spleeze has joined #ruby
<havenwood>
np
Hobogrammer_ has joined #ruby
<havenwood>
acl_: What os/distro are you on?
Hobogrammer has quit [Ping timeout: 265 seconds]
<havenwood>
acl_: My primary system is OS X with ruby-install/chruby and ruby-2.1.0 (except where bugs make me 2.0 or patch).
<acl_>
at work (where i use ruby/python for smallish scripts): Win7 x64; at home: Lubuntu 12.10
alvaro_o has quit [Quit: Ex-Chat]
tauebel1 has quit [Quit: Leaving.]
mikepack has joined #ruby
i_s has quit [Remote host closed the connection]
mary5030 has quit [Remote host closed the connection]
<havenwood>
acl_: some folks manage to beat Debian Ruby into shape
<acl_>
right now, i'm using ruby as a sort of pseudo-code to prototype things i have to write in c#
dx7 has joined #ruby
<havenwood>
if you run into ubuntu ruby-selection probs: update-alternatives --config ruby
<havenwood>
or bite the bullet and chruby
wallerdev has quit [Quit: wallerdev]
axl_ has quit [Quit: axl_]
heidi has quit [Quit: Leaving.]
Kricir_ has joined #ruby
<acl_>
chruby's for switching between implementations, right?
mary5030 has quit [Remote host closed the connection]
george2 has joined #ruby
Jetchisel has quit [Quit: "Unfortunately time is always against us" -- *Morpheus*]
wtfitsme has quit [Ping timeout: 264 seconds]
phipes has quit [Client Quit]
phipes has joined #ruby
marr has quit []
binaryhat has joined #ruby
iMe has joined #ruby
shinobi_one has quit [Quit: shinobi_one]
angusigu1ss has joined #ruby
shinobi_one has joined #ruby
Jetchisel has joined #ruby
eka has quit [Quit: Computer has gone to sleep.]
i_s has joined #ruby
petey has quit [Remote host closed the connection]
danshultz has joined #ruby
petey has joined #ruby
<pragmatism>
Unrelated to Ruby, but how are peole running email on sites without a google apps account?
davy_ has joined #ruby
fedesilva has quit [Remote host closed the connection]
jaybe has joined #ruby
carif has quit [Ping timeout: 264 seconds]
angusigu1ss has quit [Ping timeout: 252 seconds]
<jaybe>
hi. i have a `rake` task which requires a gem. that gem is installed. i install gems with "--user-install --bindir=~/bin". when i execute my rake task... it fails with: cannot load such file -- my-gem
blaz3rz has joined #ruby
<nycjv321>
Hi I have a file in my load path but when including the module in that file. Ruby says its an unknown constant
yfeldblum has joined #ruby
<havenwood>
nycjv321: have you required it?
davy_ has quit [Ping timeout: 240 seconds]
seich- is now known as seich
<havenwood>
jaybe: is ~/bin in your load path?
<havenwood>
pragmatism: dovecot, exim and courier are the ones most common to me
i_s has quit [Ping timeout: 245 seconds]
Evenix has joined #ruby
fedesilva has joined #ruby
<nycjv321>
havenwood: thank you for pointing out how much of a noob I am :)
<nycjv321>
havenwood: thank you that fixed it :)
<jaybe>
havenwood, i do not believe so. i am unaware of that. odd thing is - this same rake task was working last month. unmodified since. can/should i specify a load path within my ~/.gemrc?
<havenwood>
nycjv321: :)
Jonah11_ has joined #ruby
<nycjv321>
anyone here familiar with Sinatra? Can you terminate it programmatically?
blaz3rz has quit [Ping timeout: 252 seconds]
<Jonah11_>
what are the reasons, if any, to prefer module over class when creating a container namespace for utility functions? https://eval.in/96292
<Jonah11_>
nycjv321, do you mean terminate the web server or the request?
<nycjv321>
the web server
<nycjv321>
so I am using it for testing and after I'm finished testing I want to terminate it.
<havenwood>
nycjv321: send a unix signal
estebistec has joined #ruby
<Jonah11_>
nycjv321, you can accomplish havenwood's suggestion with the system() command
<havenwood>
nycjv321: one nice thing about using Ruby webservers like Unicorn is being able to send standard unix signals
<nycjv321>
since the server is in the same process wouldn't that kill the entire process?
<nycjv321>
hmmm I guess I can just late the process terminate
<nycjv321>
doesn't feel clean though :(
LexicalScope has joined #ruby
LexicalScope has joined #ruby
LexicalScope has quit [Changing host]
michael_lee has quit [Ping timeout: 240 seconds]
robbyoconnor has joined #ruby
<Jonah11_>
nycjv321, you could send the system comman to stop the server with "thin stop" or similar
havenwood has quit []
Jdubs has joined #ruby
w4pm has joined #ruby
doodlehaus has quit []
kate_r has joined #ruby
mansi has joined #ruby
ixti has quit [Ping timeout: 240 seconds]
binaryhat has quit [Quit: Leaving]
iliketur_ has quit [Quit: zzzzz…..]
wiku5_ has quit [Quit: WeeChat 0.3.8]
wiku5_ has joined #ruby
mansi has quit [Ping timeout: 252 seconds]
v0n has joined #ruby
relix has joined #ruby
Virtualize|away has quit [Quit: Leaving...]
relix has quit [Ping timeout: 252 seconds]
Virtualize|away has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
lpvb is now known as Nyyx
michael_lee has joined #ruby
Lewix has joined #ruby
iliketurtles has joined #ruby
iliketurtles has quit [Excess Flood]
mikepack has quit [Remote host closed the connection]
mikepack has joined #ruby
bklane has quit [Quit: Leaving...]
m104 has joined #ruby
Wulf has quit [Ping timeout: 252 seconds]
mikepack has quit [Ping timeout: 264 seconds]
Wulf has joined #ruby
Mattx has quit [Ping timeout: 260 seconds]
pskosinski has joined #ruby
dik_dak has quit [Quit: Leaving]
Txandy|away has quit [Read error: Connection reset by peer]
Txandy has joined #ruby
dik_dak has joined #ruby
mikepack has joined #ruby
yacks has joined #ruby
<ElComradio>
What’s the current received wisdon for the ‘I need to redefine this constant X for testing purposes’ problem?
fedesilva has quit [Remote host closed the connection]
lukec has joined #ruby
Shidash has joined #ruby
v0n has quit [Ping timeout: 272 seconds]
Davey has quit [Quit: Computer has gone to sleep.]
yfeldblum has quit [Remote host closed the connection]
Megtastique has quit []
yfeldblum has joined #ruby
cj3kim has joined #ruby
gener1c has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
yfeldblum has quit [Read error: Connection reset by peer]
Noldorin has quit []
Mattx has joined #ruby
Mattx has joined #ruby
Mattx has quit [Changing host]
yfeldblum has joined #ruby
gener1c_ has quit [Ping timeout: 265 seconds]
cj3kim has quit [Ping timeout: 272 seconds]
SCommette has joined #ruby
kenneth has quit [Quit: kenneth]
krz has joined #ruby
mocfive has quit [Remote host closed the connection]
Fezzler has joined #ruby
duggiefresh has joined #ruby
braincrash has quit [Quit: bye bye]
vpretzel has quit [Remote host closed the connection]
Fezzler has quit [Client Quit]
shinobi_one has quit [Quit: shinobi_one]
mocfive has joined #ruby
mocfive has quit [Remote host closed the connection]
vpretzel has joined #ruby
mikepack has quit [Remote host closed the connection]
vpretzel has quit [Read error: Connection reset by peer]
kevinykchan has quit [Quit: Computer has gone to sleep.]
braincrash has joined #ruby
rickruby has joined #ruby
m104 has quit [Quit: brb]
gja has joined #ruby
slowcon has quit [Quit: slowcon]
axl_ has joined #ruby
tyl has joined #ruby
angusigu1ss has joined #ruby
vpretzel has joined #ruby
<bricker`LA>
ElComradio: rspec has stub_const
freezey has joined #ruby
<ElComradio>
Mm minitest :) thx though
duggiefresh has quit [Remote host closed the connection]
freezey has quit [Read error: Connection reset by peer]
freezey has joined #ruby
slowcon has joined #ruby
figglebe_ has joined #ruby
Evenix has quit [Remote host closed the connection]
Evenix has joined #ruby
angusigu1ss has quit [Ping timeout: 252 seconds]
vpretzel has quit [Ping timeout: 245 seconds]
aspires has joined #ruby
mercwithamouth has quit [Ping timeout: 252 seconds]
axl_ has quit [Quit: axl_]
blaz3rz has joined #ruby
figgleberry has quit [Ping timeout: 248 seconds]
Parker0 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mikepack has joined #ruby
figglebe_ has quit [Ping timeout: 252 seconds]
ewnd9_ has joined #ruby
gja has quit [Quit: This computer has gone to sleep]
Evenix has quit [Ping timeout: 272 seconds]
axl_ has joined #ruby
standyro2 has joined #ruby
mikepack has quit [Ping timeout: 252 seconds]
iamsean has joined #ruby
mary5030 has joined #ruby
phipes has quit [Remote host closed the connection]
pietr0 has joined #ruby
Evenix has joined #ruby
zz_anildigital is now known as anildigital
m104 has joined #ruby
LexicalScope has quit [Ping timeout: 252 seconds]
axl_ has quit [Quit: axl_]
yasushi has joined #ruby
Amart41 has joined #ruby
minion- has joined #ruby
dx7 has joined #ruby
bricker`LA has quit [Ping timeout: 241 seconds]
anildigital is now known as zz_anildigital
relix has joined #ruby
rickruby has quit [Remote host closed the connection]
vpretzel has joined #ruby
Amart41 has quit [Ping timeout: 272 seconds]
dx7 has quit [Ping timeout: 264 seconds]
slowcon has quit [Quit: slowcon]
freerobby has quit [Quit: Leaving.]
shadoi has quit [Quit: Leaving.]
relix has quit [Ping timeout: 260 seconds]
phipes has joined #ruby
minion- is now known as ciwolsey
pskosinski has quit [Remote host closed the connection]
CaptainJet has quit []
Deele has joined #ruby
danshultz has quit [Remote host closed the connection]
fgo has joined #ruby
TripTastic has joined #ruby
yfeldblum has quit [Remote host closed the connection]
rickruby has joined #ruby
JBreit has quit [Ping timeout: 252 seconds]
yfeldblum has joined #ruby
ElComradio has quit [Quit: ElComradio]
TripTastic is now known as JBreit
pietr0 has quit [Quit: pietr0]
yfeldblum has quit [Ping timeout: 248 seconds]
mocfive has joined #ruby
thesheff17 has quit [Ping timeout: 245 seconds]
vpretzel has quit [Ping timeout: 252 seconds]
gja has joined #ruby
yarou has quit [Remote host closed the connection]
KevinSjoberg has quit [Ping timeout: 252 seconds]
mnemon has quit [Quit: No Ping reply in 180 seconds.]
mnemon has joined #ruby
mnemon has quit [Changing host]
mnemon has joined #ruby
KevinSjoberg has joined #ruby
Virtualize|away has quit [Quit: Leaving...]
bluepojo_ has joined #ruby
rezzack has quit [Ping timeout: 248 seconds]
m104 has quit [Quit: brb]
bluepojo has quit [Ping timeout: 272 seconds]
m104 has joined #ruby
rickruby has quit [Remote host closed the connection]
hobodave has quit [Quit: Computer has gone to sleep.]
rickruby has joined #ruby
lfox has quit [Quit: ZZZzzz…]
baggypants has joined #ruby
browndawg has quit [Quit: Leaving.]
fedesilva has joined #ruby
mocfive has quit [Remote host closed the connection]
binw has quit [Read error: Connection reset by peer]
mocfive has joined #ruby
rickruby has quit [Ping timeout: 240 seconds]
CJD14 has joined #ruby
Virtualize|away has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
w4pm has quit [Ping timeout: 245 seconds]
slowcon has joined #ruby
gregf has quit [Quit: WeeChat 0.4.2]
fedesilva has quit [Ping timeout: 248 seconds]
mocfive has quit [Ping timeout: 260 seconds]
IceDragon has quit [Quit: Space~~~]
binw has joined #ruby
pietr0 has joined #ruby
ewnd9_ has quit [Ping timeout: 245 seconds]
bluepojo_ has quit [Remote host closed the connection]
angusigu1ss has joined #ruby
noop has joined #ruby
robbyoconnor has quit [Excess Flood]
robbyoconnor has joined #ruby
angusigu1ss has quit [Ping timeout: 252 seconds]
standyro2 has quit [Ping timeout: 245 seconds]
tylersmith has joined #ruby
mikepack has joined #ruby
noop has quit [Ping timeout: 260 seconds]
Vivekananda has quit [Remote host closed the connection]
mikepack has quit [Ping timeout: 272 seconds]
yfeldblum has joined #ruby
tonni has quit [Remote host closed the connection]
Es0teric has quit [Quit: Computer has gone to sleep.]
sparrovv has joined #ruby
LexicalScope has joined #ruby
LexicalScope has quit [Changing host]
LexicalScope has joined #ruby
robbyoconnor has quit [Excess Flood]
robbyoconnor has joined #ruby
robbyoconnor has quit [Changing host]
robbyoconnor has joined #ruby
yasushi has quit [Remote host closed the connection]
deric_skibotn has quit [Ping timeout: 240 seconds]
mary5030 has quit [Remote host closed the connection]
sdwrage has quit [Quit: This computer has gone to sleep]
speakingcode has joined #ruby
sparrovv has quit [Ping timeout: 252 seconds]
pietr0 has quit [Quit: pietr0]
relix has joined #ruby
fgo has quit [Remote host closed the connection]
blaz3rz has quit [Remote host closed the connection]
blaz3rz has joined #ruby
zz_jrhorn424 is now known as jrhorn424
aspires has quit []
phansch has joined #ruby
relix has quit [Ping timeout: 248 seconds]
lukec has quit [Quit: lukec]
<lethjakman>
hmmm, what does it mean when I make a class like this: class part1::part2 ?
standyro2 has joined #ruby
octoberry has joined #ruby
chippie has joined #ruby
fgo has joined #ruby
chippie has left #ruby [#ruby]
Jdubs has quit [Remote host closed the connection]
petey has quit [Remote host closed the connection]
petey has joined #ruby
_maes_ has joined #ruby
vpretzel has joined #ruby
Guest12576 has quit [Ping timeout: 264 seconds]
Jdubs has joined #ruby
octoberry has quit [Ping timeout: 272 seconds]
<bnagy>
syntax error?
petey has quit [Ping timeout: 272 seconds]
<bnagy>
but assuming the names were constants, it would be namespacing
browndawg has joined #ruby
vpretzel has quit [Ping timeout: 264 seconds]
dseitz has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
danshultz has joined #ruby
mikepack has joined #ruby
JasmeetQA has joined #ruby
<shevy>
lethjakman you scope to something nested somewhere else. module Foo; class Bar -> Foo::Bar
JasmeetQA has quit [Client Quit]
hetre85 has joined #ruby
sdwrage has joined #ruby
icantbecool has joined #ruby
Evenix has quit [Remote host closed the connection]
shadoi has joined #ruby
danshultz has quit [Ping timeout: 264 seconds]
Evenix has joined #ruby
mikepack has quit [Ping timeout: 260 seconds]
cj3kim has joined #ruby
sethen has quit [Remote host closed the connection]
shadoi has quit [Ping timeout: 245 seconds]
Evenix has quit [Ping timeout: 260 seconds]
cj3kim has quit [Ping timeout: 264 seconds]
freezey has quit [Remote host closed the connection]
PPH has joined #ruby
<PPH>
heya
<PPH>
what's the difference between proc and lambda?
<PPH>
and is it a bad Idea to create one if it's gonna be called only once?
slowcon has quit [Quit: slowcon]
fgo has quit [Remote host closed the connection]
<PPH>
I have a huge line of code and I'd like to make it shorter with a lambda but i'm not sure it's a good Idea
<centrx>
PPH, There is probably a better way
iamsean has quit [Quit: iamsean]
timonv has joined #ruby
<bnagy>
there are a few differences between proc block and lambda, but they're very, very seldom important
<bnagy>
not sure I've ever seen one make code shorter though :)
<PPH>
lol ok
<PPH>
here's the line expect{ public_send(method, action, id: FactoryGirl.create(:product)) }.to raise_error(CanCan::AccessDenied)
<PPH>
I feel it's too long but I might be wrong :P
<PPH>
I read lines shouldn't be more that 80 characters long lol
<bnagy>
looks ok to me?
<bnagy>
why not just add some linebreaks?
robbyoconnor has quit [Ping timeout: 272 seconds]
<PPH>
bleh you are right and I'm stupid
speakingcode has quit [Quit: leaving]
<PPH>
:P
<PPH>
lol
Virtualize|away has quit [Quit: Leaving...]
<centrx>
no don't add line breaks!!
snuffeluffegus has joined #ruby
<PPH>
centrx, huh? lol
Virtualize|away has joined #ruby
robbyoconnor has joined #ruby
<Senjai>
PPH: Thats kind of messy
<PPH>
I feel it's not an important matter, but I still feel it's wrong to keep it on one line... lol
<Senjai>
Readability trumps all
sergicles has joined #ruby
<Senjai>
when you have to maintain 50k lines of code every day that someone else wrote you'll understand
Kricir_ has quit [Remote host closed the connection]
<Senjai>
if your instinct says split it up, its best to do that
ace_striker has joined #ruby
m104 has quit [Quit: brb]
phipes has quit [Remote host closed the connection]
<PPH>
that's not my instinct, that's the 80 characters max rule:P
<bnagy>
nah no such rule
ace_striker is now known as Guest78426
<bnagy>
although I try really hard to not go > 100, but I won't contort code just to make 80
<bnagy>
but I don't see how splitting that makes it less readable, looks _more_ readable, to me
<bnagy>
*shrug*
<bnagy>
some people don't like method chaining on multi-line blocks
Kricir has joined #ruby
Virtualize|away has quit [Ping timeout: 245 seconds]
<centrx>
There is usually no need
phipes has joined #ruby
<PPH>
well I kinda agree it's more readable on 1 line, since it's how rspec is builded...
icantbecool has quit [Quit: Computer has gone to sleep.]
<centrx>
109 characters is not horribly bad
ktosiek_ has joined #ruby
mikepack has joined #ruby
snuffeluffegus has quit [Read error: Connection reset by peer]
<PPH>
aight I'll try to make the lines stay in the left half of my screen and remove vim's highlight when lines are larger than 80 char, it's making me crazy... lol
ktosiek has quit [Ping timeout: 264 seconds]
standyro2 has quit [Ping timeout: 240 seconds]
lxsameer has joined #ruby
lxsameer has joined #ruby
zipper has joined #ruby
dx7 has joined #ruby
GAurav- has joined #ruby
<PPH>
It's making me waste precious time, and by precious time i mean yours... not mine... lol
mikepack has quit [Ping timeout: 248 seconds]
<centrx>
Thanks a LOT
Guest78426 has quit [Ping timeout: 245 seconds]
<Senjai>
PPH: TBH, 80 characters is a dying breed. That was when terminals were only 80 characters wide by 24.
ce_afk is now known as cescalante
senayar has joined #ruby
<Senjai>
PPH: Readability should trump your desire to keep it to 80 characters, we all have bigger screens now.
Gaurav__ has joined #ruby
<PPH>
So I guess I only go with my feeling and it's gonna be ok
dx7 has quit [Ping timeout: 252 seconds]
nathancahill has quit [Quit: nathancahill]
GAurav- has quit [Ping timeout: 245 seconds]
cescalante is now known as ce_afk
saarinen has joined #ruby
nathancahill has joined #ruby
speakingcode has joined #ruby
vlad_starkov has joined #ruby
phipes has quit [Remote host closed the connection]
<Senjai>
PPH: if you think its odd, someone else will
phansch has quit [Quit: Leaving]
<Senjai>
most likely
<Senjai>
more than not
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<PPH>
k
relix has joined #ruby
saarinen has quit [Quit: saarinen]
makara has joined #ruby
m104 has joined #ruby
heftig has quit [Quit: Quitting]
zipper_ has joined #ruby
zipper_ is now known as zipper{-_-}
francisfish has joined #ruby
zipper has quit [Quit: leaving]
relix has quit [Ping timeout: 264 seconds]
gja has quit [Quit: This computer has gone to sleep]
dawkirst has quit [Read error: Operation timed out]
standyro2 has joined #ruby
SCommette has quit [Quit: SCommette]
Macaveli has joined #ruby
bluOxigen has joined #ruby
lethjakman has quit [Ping timeout: 245 seconds]
vpretzel has joined #ruby
saarinen has joined #ruby
kemmotar has joined #ruby
noop has joined #ruby
standyro2 has quit [Ping timeout: 272 seconds]
vpretzel has quit [Ping timeout: 252 seconds]
halida_ has joined #ruby
JBreit has quit [Read error: Connection reset by peer]
yacks has quit [Quit: Leaving]
dawkirst has joined #ruby
nism has joined #ruby
OdNairy has joined #ruby
senayar has quit [Remote host closed the connection]
w4pm has joined #ruby
saarinen has quit [Quit: saarinen]
francisfish has quit [Remote host closed the connection]
cj3kim has joined #ruby
Txandy is now known as Txandy|away
JBreit has joined #ruby
kemmotar has left #ruby [#ruby]
yfeldblum has quit [Ping timeout: 245 seconds]
yfeldblu_ has joined #ruby
francisfish has joined #ruby
standyro2 has joined #ruby
mengu has joined #ruby
mengu has joined #ruby
mengu has quit [Changing host]
w4pm has quit [Ping timeout: 264 seconds]
DanBoy has quit [Ping timeout: 240 seconds]
kenneth has joined #ruby
<nycjv321>
Why can I run this via ruby and it will create an instance of the Sinatra server but when I try requiring the file in another file Ruby doesn't load sinatra? https://gist.github.com/nycjv321/8703905
<centrx>
nycjv321, Probably require does not run any statements, it may only load classes and modules
<nycjv321>
I've tried creating an instance of the class and that doesn't work either.
<nycjv321>
I've tried changing the scope of the variables, making the class into a factory and nothing works
<centrx>
What do you mean "doesn't load Sinatra"?
<centrx>
It should load that class and the require 'sinatra'
<nycjv321>
create an instance of the Sinatra server.
phipes has joined #ruby
<centrx>
nycjv321, Try using load
<nycjv321>
If I run the file I provide in ruby even without the object instantiation it creates an instance of the server.
<nycjv321>
okay I'll try
<centrx>
nycjv321, I think require won't run any statement in the class
<centrx>
in the file rather
phipes has quit [Read error: Connection reset by peer]
goganchic has joined #ruby
<nycjv321>
yea it just exits
<nycjv321>
"Process finished with exit code 0"
<nycjv321>
this defies all my understanding of programming and OO
* nycjv321
brain explodes
wallerdev has quit [Quit: wallerdev]
<nycjv321>
centrx: are you taking a look at it?
<centrx>
What are you trying to do exactly, just run Sinatra?
<centrx>
What are you running require for?
<nycjv321>
centrx: basically
<nycjv321>
I am doing some testing and want a mock server running
<nycjv321>
so I want to spawn an instance of Sinatra from another class
<centrx>
Whichever file is calling require, it needs to either spawn the Sinatra instance itself
browndawg has quit [Quit: Leaving.]
<centrx>
Or call a class or module that does it
<centrx>
Not just require a file with a dangling Sinatra.new
<nycjv321>
lol
<nycjv321>
I've already tried that
slowcon has joined #ruby
<nycjv321>
in the other file I do require_relative ... and then SinatraServer.new
<nycjv321>
and it terminates anyway
lyanchih_ has joined #ruby
francisfish has quit [Remote host closed the connection]
<nycjv321>
i've made a method that encapsulates the logic of the server and I've tried invoking that and it doesn't do anything
* nycjv321
thought he understood OO. what I am observing here tells me I must not know what I am doing..
bsdguru has joined #ruby
Gaurav__ has quit [Ping timeout: 245 seconds]
dik_dak has quit [Remote host closed the connection]
Kricir has quit [Remote host closed the connection]
ace_striker has joined #ruby
nathancahill has quit [Quit: nathancahill]
ace_striker is now known as Guest41076
Guest41076 is now known as ace_striker__
wildroman2 has joined #ruby
m104 has quit [Quit: brb]
<centrx>
nycjv321, I haven't used Sinatra, but all the docs seem to show no classes or setting up Sinatra::Base..
ndrei has joined #ruby
browndawg has joined #ruby
apeiros has quit [Read error: Connection reset by peer]
<PPH>
Since a lot of elements in my interface are not displayed when the user isn't an admin, I have a lot of scenario testing that these elements are not displayed...
hukl has joined #ruby
apeiros has joined #ruby
<PPH>
Is there an easy way to manage that?
<centrx>
nycjv321, Hey here is the problem
<centrx>
nycjv321, All that code in SinatraServer needs to be in a def initialize method
yacks has joined #ruby
<centrx>
nycjv321, SinatraServer.new is doing nothing
<eval-in>
workmad3 => bad URI(absolute but no path): foo: (URI::InvalidURIError) ... (https://eval.in/96334)
DouweM has quit [Client Quit]
<workmad3>
:)
<jokke>
is there a workaround for "foo:" not to be matched?
<jokke>
:)
standyro2 has quit [Ping timeout: 245 seconds]
<jokke>
check the size of the match?
<jokke>
here's what i want to do: i want to parse a string for URLs (not URIs in general), extract them and replace them with an index (0 for first URL, 1 for second etc.) and store the URLs in an array in the found order.
<DaniG2k>
apeiros: and that is_relative? method only needs to work on the urls that the Crawler class finds
<DaniG2k>
apeiros: should the is_relative? method still go inside the string class? I think it makes more sense for it to be a property of Crawler, no?
bigkevmcd has quit [Ping timeout: 240 seconds]
<workmad3>
DaniG2k: yes, but it means that you wouldn't call it on a string
ohwhoa has joined #ruby
shadoi has quit [Ping timeout: 245 seconds]
<DaniG2k>
workmad3: is it common to extend the string class with all sorts of junk like this?
<workmad3>
DaniG2k: no
<DaniG2k>
right
<workmad3>
DaniG2k: if it's specific to a certain thing in your system, make a class for that thing
<workmad3>
DaniG2k: and the method goes on that
<DaniG2k>
workmad3: thats what im trying to do. But I think the problem is that I'm calling the method with self
<workmad3>
DaniG2k: e.g. a Crawler::URL class that gets initialized with a string, then you call is_relative? on instances of Crawler::URL
TejasDinkar has quit [Quit: This computer has gone to sleep]
<workmad3>
DaniG2k: and then your method becomes '@url =~ '
<DaniG2k>
wow I suck at ruby
<DaniG2k>
ok ok
<DaniG2k>
practice makes perfect :P
<workmad3>
(assuming you're storing the url in @url inside this fictional Crawler::URL class :) )
<DaniG2k>
workmad3: I just have a simple Crawler class for now
monkegji_ has joined #ruby
monkegjinni has quit [Ping timeout: 272 seconds]
francisfish has quit [Ping timeout: 264 seconds]
D4v33 has left #ruby ["Leaving"]
forger has quit [Ping timeout: 245 seconds]
tvw has joined #ruby
visof has joined #ruby
atraylen has quit [Read error: Connection reset by peer]
dawkirst has joined #ruby
monkegji_ has quit [Client Quit]
petey has joined #ruby
<workmad3>
DaniG2k: right, so you need to decide if it's worth introducing another class for this ;)
<DaniG2k>
workmad3: preferably not
<DaniG2k>
workmad3: I think it's overkill
<DaniG2k>
workmad3: so instead of calling self it's better to just pass it in as an argument, which would solve the issue I suppose
<workmad3>
DaniG2k: it would solve the issue, but would look ugly :)
<DaniG2k>
workmad3: what is more elegant?
<workmad3>
DaniG2k: creating a class
<DaniG2k>
workmad3: create a URL struct?
<workmad3>
crawler.is_relative?("some_string") vs crawler_url.is_relative?
nism has quit [Quit: This computer has gone to sleep]
vpretzel has joined #ruby
x77686d has joined #ruby
<workmad3>
DaniG2k: you may also want to consider SOLID principles for OO :)
<DaniG2k>
workmad3: so the second is the better option
mikecmpbll has joined #ruby
<DaniG2k>
workmad3: is it cleaner to create a struct or a whole class?
<workmad3>
a struct is a class in ruby, just helps with the accessors and initializer
<DaniG2k>
workmad3: ok
petey has quit [Ping timeout: 260 seconds]
dawkirst has quit [Ping timeout: 272 seconds]
<workmad3>
time for coffee :)
<DaniG2k>
workmad3: enjoy!
dawkirst has joined #ruby
lyanchih has joined #ruby
nism has joined #ruby
vpretzel has quit [Ping timeout: 252 seconds]
x77686d has quit [Ping timeout: 253 seconds]
Amart41 has joined #ruby
klaut has joined #ruby
dawkirst has quit [Ping timeout: 252 seconds]
shvelo has quit [Ping timeout: 252 seconds]
shaunbaker has quit [Remote host closed the connection]
dx7 has joined #ruby
nism_ has joined #ruby
nism has quit [Ping timeout: 245 seconds]
Amart41 has quit [Ping timeout: 240 seconds]
wildroman2 has quit [Remote host closed the connection]
<DaniG2k>
workmad3: so class Crawler needs to inherit from class URL?
<DaniG2k>
workmad3: or are they separate entities
mojjojo has joined #ruby
francisfish has joined #ruby
shaunbaker has joined #ruby
kenneth has quit [Quit: kenneth]
enzo has joined #ruby
<enzo>
hello
dx7 has quit [Ping timeout: 252 seconds]
daharon has joined #ruby
<enzo>
I've installed ruby and rubygems thanks to apt-get on my Ubuntu, is it safe to autoupdate afterwards gem with gem update --system ? (I need to get a clean ubuntu install)
mojjojo has quit [Client Quit]
shvelo has joined #ruby
echevemaster has quit [Ping timeout: 240 seconds]
urtokk has joined #ruby
mojjojo has joined #ruby
<workmad3>
DaniG2k: consider SRP ;)
goganchic1 has joined #ruby
echevemaster has joined #ruby
nism_ has quit [Ping timeout: 272 seconds]
<DaniG2k>
workmad3: whats that
<workmad3>
DaniG2k: one of the SOLID principles
<workmad3>
(the S to be precise)
dawkirst has joined #ruby
phansch has quit [Quit: Leaving]
aep has quit [Ping timeout: 240 seconds]
shvelo has quit [Ping timeout: 245 seconds]
zeeraw has joined #ruby
goganchic has quit [Ping timeout: 272 seconds]
dawkirst_ has joined #ruby
aep has joined #ruby
ndrei has quit [Quit: Lost terminal]
ndrei has joined #ruby
cjsarette has quit [Ping timeout: 245 seconds]
fella6s has quit [Remote host closed the connection]
dawkirst has quit [Ping timeout: 248 seconds]
nism has joined #ruby
zeeraw has quit [Client Quit]
banister has joined #ruby
amrit_ has quit [Quit: Leaving]
Al__ has joined #ruby
<DaniG2k>
workmad3: when you wrote Crawler::URL does that mean Crawler inherits from URL? or URL is a module of Crawler?
<workmad3>
DaniG2k: I was just using Crawler as a namespace in that situation
_Andres has quit [Read error: Connection reset by peer]
lyanchih has quit [Quit: lyanchih]
<DaniG2k>
workmad3: aha
<DaniG2k>
workmad3: i need to invest in a ruby programming book
dawkirst_ has quit [Ping timeout: 265 seconds]
fella5s has joined #ruby
lyanchih_ has joined #ruby
lyanchih_ has quit [Client Quit]
nari has quit [Ping timeout: 245 seconds]
cjsarette has joined #ruby
Industrial has joined #ruby
Txandy is now known as Txandy|away
Txandy|away is now known as Txandy
mojjojo has quit [Quit: mojjojo]
_Andres has joined #ruby
RubyPanther has quit [Ping timeout: 260 seconds]
mojjojo has joined #ruby
wildroman2 has joined #ruby
wildroman2 has quit [Remote host closed the connection]
eka has joined #ruby
wildroman2 has joined #ruby
zeeraw has joined #ruby
daharon has quit [Quit: Leaving]
[gmi] has joined #ruby
gja has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<tasty>
Hello. I'm trying to write a client/server in ruby with command execution support for *nix shell. Anyone knows a code that I could start from ?
<e-dard>
Hi, we need to use pg, and some raw SQL queries. Is it still worth using Active Record, for its connection pool, or are there alternatives?
Txandy is now known as Txandy|away
bubbajones has joined #ruby
<pontiki>
e-dard: you could look at Sequel
<e-dard>
does Sequel have a connection pool?
Elhu has joined #ruby
<pontiki>
not 100% sure, but i think so
<e-dard>
ah so it does. Great!
Mekkis has joined #ruby
<pontiki>
isn't the connection pooling actully part of the adapter anyway?
<apeiros>
tasty: Kernel#spawn for shell exec, TCPServer/TCPSocket for server/client
<e-dard>
pontiki: wasn't sure.
<pontiki>
e-dard: i'm not either :$
dangerousdave has joined #ruby
<pontiki>
e-dard: still, even if it is in the adaptor, the wrapper would have to support it
<tasty>
apeiros, thanks, its a combination of each ?
<e-dard>
pontiki: I'm not sure it would be in the adapter. I mean, seems like it would be an extra layer
craigp has joined #ruby
<apeiros>
tasty: what?
jackneill has joined #ruby
<tasty>
apeiros, nothing, doing research thanks for the hint
asmodlol has quit [Remote host closed the connection]
<|RicharD|>
how I can improve for avoid that crash ?(the file is around 50mb)
max96at has joined #ruby
ace_striker has joined #ruby
shaunbaker has joined #ruby
ace_striker has quit [Changing host]
ace_striker has joined #ruby
ace_striker has quit [Changing host]
ace_striker has joined #ruby
gja has quit [Quit: This computer has gone to sleep]
jlebrech has joined #ruby
postmodern has quit [Quit: Leaving]
SiliconG has joined #ruby
Mekkis has joined #ruby
futureshocked has joined #ruby
rylev_ has quit [Remote host closed the connection]
rylev has joined #ruby
peterd has joined #ruby
gja has joined #ruby
gja has quit [Changing host]
gja has joined #ruby
Squarepy has joined #ruby
shredding has quit [Quit: shredding]
amritanshu_RnD has joined #ruby
shredding has joined #ruby
amritanshu_RnD is now known as Guest45771
Beoran has quit [Ping timeout: 272 seconds]
peterd has quit [Client Quit]
SiliconG has quit [Ping timeout: 272 seconds]
rylev has quit [Ping timeout: 252 seconds]
<dseitz>
`line.gsub!('\', '')` <- find the bug
zoscoy has joined #ruby
<workmad3>
dseitz: \'
<|RicharD|>
yes
<|RicharD|>
I put \\
<|RicharD|>
should works now(i'm testing)
mercwithamouth has joined #ruby
<Nowaker>
why does sinatra or rails on mri perform so weak in this benchmark? it's slower even than symfony php crap. that's unbelievable. http://www.techempower.com/benchmarks/#section=data-r8&hw=i7&test=query
Thanatermesis has joined #ruby
<dseitz>
If this code becomes important; you should do some more error handling [file IO is... ick, as we know]
<Nowaker>
maybe someone has a time to dig into it, and fix it eventually...
wildroman2 has joined #ruby
wildroman2 has quit [Remote host closed the connection]
wildroman2 has joined #ruby
<dseitz>
where do they keep the source again?
<|RicharD|>
I have done
<|RicharD|>
I have put the script on digital ocean
<dseitz>
I mean look at the 'error count' on the tests
drumusician has quit [Ping timeout: 252 seconds]
<|RicharD|>
with 12gb of ram :)
<dseitz>
The run-time is basically worthless with those many exceptions, that would be the root of the performance failure there
futureshocked has quit [Remote host closed the connection]
<DaniG2k>
workmad3: but im still having a hard time wrapping my head around this....the base_url is returning a string as opposed to the modified url
<DaniG2k>
workmad3: so then if absolute is called, it messes up
maasha has joined #ruby
Evenix has joined #ruby
<maasha>
If I add a task in a Rakefile, how do I make it show up with rake -T ?
RaCx has quit [Ping timeout: 245 seconds]
<dseitz>
DaniG2k: That is what you are returning from base_url
<workmad3>
^^
<DaniG2k>
dseitz: yes
<workmad3>
DaniG2k: which means that you messed up what I originally gave you
<DaniG2k>
@_@
<DaniG2k>
OO programming is so damn hard
Jdubs has quit [Remote host closed the connection]
tvw has quit [Ping timeout: 245 seconds]
<workmad3>
DaniG2k: also, that has the original problem from your older code still
rylev has joined #ruby
marr123 has joined #ruby
<workmad3>
DaniG2k: namely that if the url is relative, you're trying to get a host and scheme from it to make it absolute... the exact things that are lacking that make it relative in the first place
<DaniG2k>
right
RaCx has joined #ruby
marr has quit [Ping timeout: 264 seconds]
<workmad3>
DaniG2k: I'd defined a + method so you could add two URL objects sensibly
Evenix has quit [Ping timeout: 264 seconds]
<workmad3>
DaniG2k: and then made sure that things were always dealing with URL objects by wrapping where necessary
<workmad3>
DaniG2k: your base_url returns a string... which means you lose that and would need to do something like 'URL.new(base_url + to_s)' in order to recover that in your 'absolute' method
x77686d has joined #ruby
x77686d has quit [Client Quit]
diegoviola has joined #ruby
banister has joined #ruby
<workmad3>
DaniG2k: oh, I'd also made a mistake in my original gist for you... I'd left 'absolute' trying to add to @base_url rather than using the 'base' parameter
<maasha>
Gotit, desc was missing.
Thanatermesis has joined #ruby
Thanatermesis has quit [Changing host]
Thanatermesis has joined #ruby
fedesilva has joined #ruby
<workmad3>
DaniG2k: the general idea of introducing something like that URL class (a value object) is that once you've wrapped a primitive in it, you then only ever deal with the value object
nari has joined #ruby
<workmad3>
DaniG2k: which is why in the example I gave, I'd introduced a + method, so that you didn't need to write code that uses URLs that looked like 'URL.new(base_url.to_s + path_url.to_s)' ;)
<DaniG2k>
workmad3: aaah i see
wildroman2 has quit [Remote host closed the connection]
RaCx has quit [Quit: Computer has gone to sleep.]
ohwhoa has quit [Quit: woah!]
RaCx has joined #ruby
<workmad3>
DaniG2k: doing stuff like that also means you get to keep your code encapsulated and hide the implementation... so you could, for example, change your URL class to store @url = URI.parse(url) internally, rewrite things like to_s, + and == to work, and the change should be invisible outside of the URL class
<DaniG2k>
workmad3: but then a new URL object gets created anyway
michael_lee has quit [Ping timeout: 252 seconds]
<workmad3>
DaniG2k: yes, I treated it as a value object, which means it's immutable once created
<workmad3>
DaniG2k: just leads to easier to understand code, I tend to find ;)
RaCx has quit [Client Quit]
michael_lee has joined #ruby
Mekkis has joined #ruby
IceyEC has joined #ruby
<workmad3>
DaniG2k: so yes, url1 + url2 does mean you get a new URL object... in the same way that str1 + str2 ends up with a new string object... but you don't need to worry about the specifics of that when using URLs
intuxicated has joined #ruby
DouweM has joined #ruby
<DaniG2k>
workmad3: I see
mojjojo has joined #ruby
<DaniG2k>
workmad3: wouldnt it be better ot modify the URL object directly?
<DaniG2k>
workmad3: the original one
<workmad3>
DaniG2k: not normally, no
vlad_starkov has quit [Remote host closed the connection]
<workmad3>
DaniG2k: makes it much harder to pass the original around your system and have it behave sensibly
intuxicated has quit [Read error: No route to host]
SiliconG has quit [Ping timeout: 248 seconds]
bsdguru has joined #ruby
rylev has quit [Remote host closed the connection]
tyl has quit [Quit: Computer has gone to sleep.]
xcv has joined #ruby
ohwhoa has joined #ruby
mojjojo has quit [Quit: mojjojo]
rylev has joined #ruby
teddyp1cker has quit [Remote host closed the connection]
ohwhoa has quit [Client Quit]
francisfish has quit [Remote host closed the connection]
e^0 has joined #ruby
RaCx has joined #ruby
banister has joined #ruby
ndrei has quit [Ping timeout: 264 seconds]
Kricir has joined #ruby
RaCx has quit [Client Quit]
nateberkopec has joined #ruby
ndrei has joined #ruby
nszceta has joined #ruby
dx7 has joined #ruby
Industrial has left #ruby ["WeeChat 0.4.0"]
Kricir has quit [Ping timeout: 245 seconds]
LadyRainicorn has joined #ruby
RaCx has joined #ruby
teddyp1cker has joined #ruby
alex88 has quit [Quit: Leaving...]
ewnd9_ has quit [Ping timeout: 260 seconds]
Amart41 has joined #ruby
drumusician has joined #ruby
ma4rco has joined #ruby
<ma4rco>
hello
<ma4rco>
if i go per http.get method of angular to a .html file, it works - but if i jump to a sinatra/webrick url i get status 404, but i see on webrick, that the javarequest was there, why is that?
IceyEC has joined #ruby
parzo has quit [Remote host closed the connection]
DouweM has quit [Read error: Connection reset by peer]
gja has quit [Quit: This computer has gone to sleep]
_Andres has quit [Read error: Connection reset by peer]
browndawg has quit [Quit: Leaving.]
ckinni has joined #ruby
nszceta has joined #ruby
<shevy>
hmmm
<shevy>
I have lots of small .rb files that may or may not exist on a target computer
bleak2 has quit [Ping timeout: 245 seconds]
<shevy>
they are spread out over different .rb files as well
parzo has quit [Ping timeout: 240 seconds]
<shevy>
do I really have to do begin;rescue LoadError; end over all of them, just to ensure that the larger main program can still run and function? (all these .rb files are optional and only enhance the project with certain functionality)
gja has joined #ruby
SHyx0rmZ has joined #ruby
teddyp1cker has quit [Remote host closed the connection]
mojjojo has joined #ruby
figgleberry has joined #ruby
RaCx has joined #ruby
Sleepee has joined #ruby
francisfish has joined #ruby
freerobby has quit [Quit: Leaving.]
tonni has joined #ruby
RaCx has quit [Client Quit]
bigkevmcd has quit [Ping timeout: 252 seconds]
mikepack has joined #ruby
jmurray has joined #ruby
chopmo has joined #ruby
shadoi has joined #ruby
MrZYX|off is now known as MrZYX
clamstar has joined #ruby
shredding has joined #ruby
mikepack has quit [Ping timeout: 265 seconds]
bigkevmcd has joined #ruby
caustic has joined #ruby
<Nowaker>
shevy: traverse the directory and require files that exist?
yasushi has joined #ruby
shadoi has quit [Ping timeout: 264 seconds]
yacks has quit [Quit: Leaving]
user258467 has joined #ruby
ace_striker has quit [Ping timeout: 245 seconds]
<shevy>
hmm
<shevy>
perhaps I could use a custom require
lkba has joined #ruby
mikepack has joined #ruby
jamto11 has joined #ruby
Mon_Ouie has joined #ruby
Mon_Ouie has quit [Changing host]
Mon_Ouie has joined #ruby
<mikecmpbll>
..
mikepack has quit [Ping timeout: 245 seconds]
TheLarkInn has joined #ruby
<TheLarkInn>
Good morning Rubyists
jamto11 has quit [Ping timeout: 252 seconds]
mark_locklear has joined #ruby
<TheLarkInn>
I have 3 objects which could all be a key to different values, is it appropriate to make an array a key for a hash
<TheLarkInn>
I was leaning towards no
phansch has quit [Quit: Leaving]
<banister>
TheLarkInn depends on the use-case, for memoization sure
Columcille has quit [Read error: Operation timed out]
<apeiros>
TheLarkInn: (almost) every object can serve as a hash key
phansch has joined #ruby
<apeiros>
requirement is a proper implementation of the methods #hash and #eql?, Array provides them
<TheLarkInn>
okay, so I have a list of South Carolina cities, and they map to some counties, and a county code,
tt1187 has joined #ruby
<TheLarkInn>
I'd prefer to have the Cities the key because I'm wanting to return the county/county code
visof has quit [Quit: Lost terminal]
<TheLarkInn>
in the case that a city can have two counties
v0n has joined #ruby
<TheLarkInn>
what would be the recommendation, should it be an array as the key?
<apeiros>
eh?
<apeiros>
you look up by city, right?
<TheLarkInn>
I want to look up counties by city
<TheLarkInn>
but sometimes a city can have two counties
<MrZYX>
what about city.country_code ?
<MrZYX>
or city.country.code
<apeiros>
TheLarkInn: unclear answer, I try again
yfeldblum has joined #ruby
<TheLarkInn>
okay I'll just give you an example
<TheLarkInn>
sec
<apeiros>
TheLarkInn: you want to input a city and get one or more counties as answer?
<TheLarkInn>
yes potentially
<apeiros>
elaborate "potentially"
<TheLarkInn>
yes
<TheLarkInn>
lol
parzo has joined #ruby
<TheLarkInn>
yeah thats good enough for me is "potentially"
<apeiros>
great. be precise. it matters.
<apeiros>
in that case, it makes no sense to have the county as part of the key
<apeiros>
you lose the ability to look up by city if you do that
<TheLarkInn>
yeah, city would be the key, and then if the city has two county it would return an array as the value
<apeiros>
you should always return an array
<apeiros>
even if it's only one
<apeiros>
normalize your output. otherwise you have to check whether you got an array or not all the time.
<TheLarkInn>
I see what you are saying
<TheLarkInn>
more sanitary and normal
<apeiros>
also an unsuspecting user will try a couple, notice he gets a county back and wonder when stuff suddenly breaks when he gets an array instead
ewnd9_ has joined #ruby
linojon has joined #ruby
nszceta has quit [Quit: out]
danshultz has joined #ruby
ckinni has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ewnd9_ has quit [Max SendQ exceeded]
yfeldblum has quit [Ping timeout: 260 seconds]
clamstar has quit [Quit: Computer has gone to sleep.]
ewnd9_ has joined #ruby
tvw has joined #ruby
avril14th has joined #ruby
nszceta has joined #ruby
parzo has quit [Ping timeout: 245 seconds]
<avril14th>
Hello, what's the rspec matcher to check that two classes are equal?
SiliconG has joined #ruby
<MrZYX>
equal on what level?
Guest36874 has quit [Ping timeout: 272 seconds]
<MrZYX>
that an object is a class? that they contain the same methods? ...?
<banister>
avril14th .should == ?
RaCx has joined #ruby
* apeiros
wonders about the point of equal classes…
<MrZYX>
exactly
teddyp1cker has joined #ruby
<apeiros>
if two classes are equal, why not have just one?
<MrZYX>
avril14th: so what you really testing here?
gja has quit [Quit: This computer has gone to sleep]
<avril14th>
I have a factory method that spits classes
<avril14th>
so I check what it returns
DPRK_Kim_Jong_Un has joined #ruby
<MrZYX>
what can be different about those classes?
RealMarc has joined #ruby
<avril14th>
the factory could spit the wrong class
<apeiros>
avril14th: then define what makes a class "wrong"
<avril14th>
its name
<apeiros>
and define what makes a class "right"
<apeiros>
and test against those
<avril14th>
same name
<avril14th>
got it
zegerjan has joined #ruby
freerobby has joined #ruby
<MrZYX>
so you don't build classes in your factory? you just select them? that's not a factory for classes then
<tobiasvl>
obj1.class == obj2.class
<avril14th>
MrZYX: true
<avril14th>
tobiasvl: I have no instance
octoberry has joined #ruby
DPRK_Kim_Jong_Un has left #ruby [#ruby]
ewnd9_ has quit [Ping timeout: 272 seconds]
<tobiasvl>
okay, then class1 == class2 then
<tobiasvl>
or class1.name == class2.name
SiliconG has quit [Ping timeout: 245 seconds]
<MrZYX>
avril14th: realize that classes are just obects, in most cases assigned to a constant.
<avril14th>
tried
<tobiasvl>
avril14th: and?
<tobiasvl>
perhaps you can provide us with an actual use case
<apeiros>
I think Class#== is just Class#equal?
<apeiros>
i.e., object identity
wildroman2 has quit [Read error: Connection reset by peer]
<avril14th>
expect(TestFactoryClass.send(:factory, 'SomeClass', organization, Date.today)).to eq(c) returns expected: SomeClass_FR_2014_1_1 got: SomeClass_FR_2014_1_1 when the test runs
<apeiros>
send?
RaCx has quit [Quit: Computer has gone to sleep.]
<avril14th>
yes
Fire-Dragon-DoL has joined #ruby
<MrZYX>
tbh. that looks like a horrible design
wildroman2 has joined #ruby
<avril14th>
MrZYX: I'm all ears
<MrZYX>
why do you need new versions of SomeClass, why don't instances with the attributes set suffice?
<avril14th>
cause they have different implementations
<MrZYX>
and those implementations are completely dynamic? what's so different about them?
ndrei has quit [Read error: Operation timed out]
<avril14th>
everything
<avril14th>
they could have complete different logic
<MrZYX>
how does a date and a "organization" define a whole class implementation?
rmorello has joined #ruby
<avril14th>
organization contains a country
<avril14th>
so I get the implementation i need
<avril14th>
for fiscal taxes
<avril14th>
at a given time
<avril14th>
in a given country
ffranz has joined #ruby
<avril14th>
and this changes all the time :)
RaCx has joined #ruby
tonni has quit [Read error: Connection reset by peer]
<avril14th>
and you can't just overwrite values since you need past calculations to remain true
mlpinit has quit [Remote host closed the connection]
skaflem has quit [Quit: Leaving]
mlpinit has joined #ruby
<tobiasvl>
and why are you using a factory to create classes, instead of objects?
<tobiasvl>
i suppose the classes are singleton?
<avril14th>
teh factory spits a class
nateberkopec has quit [Quit: Leaving...]
caustic has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
<avril14th>
then I instantiate it
<maasha>
what is the most efficient way of converting all hash keys to from strings to symbols for a given hash?
<apeiros>
dunno, I'd use Hash[hash.map { |k,v| [k.to_sym, v] }]
<apeiros>
@ maasha
<apeiros>
check AS' Hash#symbolize
<MrZYX>
avril14th: how many times do you instantiate it?
Hanmac1 has joined #ruby
<apeiros>
symbolize_keys ?
<tobiasvl>
avril14th: I realize that, but why do you need a class at all?
<tobiasvl>
why not fr_2014_1_1 = Country_Date.new(Date.today) or something more complex
<avril14th>
replace to_i with to_sym
<apeiros>
maasha: AS = activesupport. part of rails. it provides that functionality.
jerius has joined #ruby
<apeiros>
avril14th: inject with `; expr` at the end is misused inject
<avril14th>
tobiasvl: cause I can't override new since they are AR objects
marr has joined #ruby
Hamburglr has joined #ruby
nszceta has quit [Read error: Connection reset by peer]
mojjojo has quit [Quit: mojjojo]
Hanmac has quit [Ping timeout: 260 seconds]
<MrZYX>
avril14th: isn't your problem the classic example for the strategy pattern?
nszceta has joined #ruby
mojjojo has joined #ruby
<maasha>
apeiros: ah, but no rails here.
<avril14th>
MrZYX: looks like it, so?
parzo has joined #ruby
SHyx0rmZ has quit [Ping timeout: 265 seconds]
<apeiros>
maasha: I told you to check the source. not to use it.
<MrZYX>
avril14th: use it? ;)
<apeiros>
maasha: you know github, right?
<maasha>
apeiros: sure
<apeiros>
though, if you don't know your way around rails' source, it's probably easier to just install it, start a console in pry and do `$ Hash#symbolize_keys`
<avril14th>
MrZYX: choosing strategy at runtime is one thing, storing which is used in a db is another
<MrZYX>
I bet some in AS' do :D
<avril14th>
(I guess)
ndrei has joined #ruby
kaldrenon has joined #ruby
mary5030 has joined #ruby
jerius has quit []
<MrZYX>
avril14th: so your country defines your strategy, right? and your Whatever has an organization which has a country? right? if you fetch all the associations you can just access the strategy through that, no?
fedesilva has quit [Remote host closed the connection]
tonni has joined #ruby
mary5030 has quit [Remote host closed the connection]
SHyx0rmZ has joined #ruby
tesuji has quit [Read error: Connection reset by peer]
gregf has joined #ruby
<avril14th>
MrZYX: I don't store the creation time in the database
<avril14th>
so when I pull the class back from the db
<avril14th>
I can find the country through organization
clamstar has joined #ruby
<avril14th>
but not the rule that applies (the strategy)
g0bl1n has joined #ruby
ckinni has joined #ruby
<MrZYX>
so you infer the date from the class name...?
<apeiros>
MrZYX: aaaahaha
<MrZYX>
or where does it come from?
<apeiros>
4 classes define to_sym
v0n has quit [Ping timeout: 248 seconds]
<avril14th>
MrZYX: yes
<apeiros>
and one indeed can return nil - Mime::Type
vpretzel has quit [Ping timeout: 265 seconds]
cid404 has quit [Ping timeout: 252 seconds]
AlSquire has joined #ruby
<MrZYX>
avril14th: I'd rather store the date then (in a sane format)
sergicles has quit [Quit: sergicles]
vlad_starkov has joined #ruby
<avril14th>
and then switch the date?
<avril14th>
that's what I want to avoid
<avril14th>
having a code that goes if elsiif elsif elsif elsif
<avril14th>
for every method
<avril14th>
implemented by the class
<avril14th>
so th idea is yes
<avril14th>
define new class
<avril14th>
write it fully properly
<avril14th>
and that's all :)
<avril14th>
but I may not see the downside of it. any hint?
xcv has quit [Remote host closed the connection]
isec has joined #ruby
<MrZYX>
how do you recreate it after your program is restarted and you want to fetch a record using that class?
<avril14th>
Myclasses all inherit from a fixed one
octoberry has quit [Ping timeout: 240 seconds]
<avril14th>
so I just do Parent.all
<avril14th>
in my mongodb
<avril14th>
and I get them all
<avril14th>
whatever their types
<avril14th>
and then I can just call the interface
<MrZYX>
but if they are created at runtime, how do you recreate them in a second process?
<avril14th>
and each class with do its own stuff
<avril14th>
they are not created at runtime
<avril14th>
when you need to change, you write a new one, add it to the project
<avril14th>
and the factory (my code above) will pick it and start instantiating from it
<avril14th>
and storing
michael_lee has quit [Quit: Ex-Chat]
<avril14th>
it looks not so bad to me
<avril14th>
but again I may not see all the downsizes
<MrZYX>
so it's really not a factory but rather a ... complicated hash
<avril14th>
(yet)
<avril14th>
yes it's a hash
<avril14th>
that use Class.descendants
kpshek has joined #ruby
<avril14th>
to see what's available
<avril14th>
parse that
<avril14th>
and act
<avril14th>
no? :))
<MrZYX>
I guess I wouldn't name it factory then, but StrategyPicker or something and oh boom, you just need to store the date and pick the class when you need to run the algorithm instead of when you instantiate it
havenwood has joined #ruby
Kricir has joined #ruby
dideler_work has joined #ruby
rdark has quit [Ping timeout: 272 seconds]
<MrZYX>
but I guess we're drifting a bit into the philosophical debate
Kricir has quit [Remote host closed the connection]
tonni has quit [Read error: Connection reset by peer]
<MrZYX>
I got confused by you calling it a factory
<MrZYX>
it sounded a lot like you're dynamically _creating_ classes
eka has joined #ruby
<avril14th>
I need to store the instantiate time, not the runtime
<avril14th>
since the instantiate time
<avril14th>
is when the tax ruels change
<avril14th>
but the conversation was good
<avril14th>
thx
<avril14th>
and I still don't know how to write my rspec matcher :))
rdark has joined #ruby
<avril14th>
I do generate classes dynamically
<avril14th>
in my test
zz_anildigital is now known as anildigital
<MrZYX>
and your picker can catch that exact object?
<avril14th>
yes
g0bl1n has quit [Ping timeout: 245 seconds]
<MrZYX>
then .should == ThatClass should work
Advocation has quit [Quit: Advocation]
v0n has joined #ruby
<MrZYX>
if it doesn't they're just looking the same, but are different objects
<MrZYX>
if you have multiple tests make sure to either clean them up or create just one for the entire set of tests
LadyRainicorn has quit [Ping timeout: 245 seconds]
<MrZYX>
(15:19:49) MrZYX: And I don't think your cleanup code makes sure that your classes fall out of scope
<MrZYX>
(15:20:18) MrZYX: apeiros: do you know if Class objects fall out of scope at all? or are they like symbols?
<MrZYX>
(15:23:34) MrZYX: avril14th: I'd say don't bother about all that dynamic class creation, do a before(:all) on the top, define the half dozen classes you need for your tests and use them
Bish has joined #ruby
ww26 has joined #ruby
iaj has joined #ruby
<avril14th>
agreed
<avril14th>
and then ? :D
LastWhisper has quit [Ping timeout: 245 seconds]
CalimeroTeknik has joined #ruby
fedesilva has joined #ruby
LookingForMopman has joined #ruby
<MrZYX>
you don't have multiple classes with the same name ;)
<apeiros>
MrZYX: classes are ordinary objects
<apeiros>
(apart from the #allocate jizz)
<MrZYX>
symbols are too! :P
germanstudent has joined #ruby
<apeiros>
MrZYX: ok, granted
<MrZYX>
so they are GC'd?
phinfonet has joined #ruby
LookingForMopman has left #ruby [#ruby]
nomenkun has quit [Remote host closed the connection]
xcv has joined #ruby
<apeiros>
I'll put it another way: symbols are the only objects you can get the same object again without holding a reference to it
<apeiros>
(Ignoring ObjectSpace._id2ref, which is always a horrible idea)
torzech has joined #ruby
joelio has joined #ruby
parus has joined #ruby
Advocation has joined #ruby
LadyRainicorn has quit [Ping timeout: 272 seconds]
<apeiros>
also worth of note: what people generally understand as "the class" is actually "a constant with a name, happening to reference a class"
<MrZYX>
I know I know, just thought that Class object have the same exemption that Symbol object have might be possible
<MrZYX>
thanks
yfeldblum has joined #ruby
<apeiros>
nope
sethen has joined #ruby
SHyx0rmZ has quit [Quit: ネウロイを負かさなきゃならないね]
<avril14th>
MrZYX: agreed, I suspect the cleanup code is the problem
<apeiros>
I think 1.8 didn't GC code. i.e. generating classes with evaled code, and throwing them away would leak memory
<apeiros>
not sure whether that changed
<apeiros>
but that's unrelated to your problem (hence I hesitated to reply to "are classes GCed").
ckinni has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<apeiros>
They may or may not be GCed, but they become unreachable.
<avril14th>
MrZYX: I'm curious as what makes classes fall out of scope :)
<MrZYX>
avril14th: doing a GC.start in your cleanup code would probably work, but it just gets dirtier IMO :P
<Cork>
anyone know where to find configuration for the thin config file?
ckinni has joined #ruby
<apeiros>
avril14th: def foo; x = Class.new; nil; end
<Cork>
i can't find it anywhere...
gittish has joined #ruby
<apeiros>
that class is only available within the method foo
<apeiros>
running foo multiple times will create multiple classes
<avril14th>
:)
<apeiros>
just like any other object
<avril14th>
I like to be dirty in tests
<avril14th>
:D
petey has joined #ruby
figgleberry has quit [Ping timeout: 265 seconds]
caveat- has quit [Ping timeout: 264 seconds]
<apeiros>
and now we mix the question with a bit of closures and have fun figuring out what's never going to be GCed because some closure keeps a hold of it…
neru_ is now known as blaxter
sailias has joined #ruby
axl_ has joined #ruby
yfeldblum has quit [Ping timeout: 245 seconds]
tonni has quit [Remote host closed the connection]
sambao21 has joined #ruby
SiliconG has joined #ruby
noop has quit [Ping timeout: 260 seconds]
xcv has quit [Remote host closed the connection]
lukec has joined #ruby
xcv has joined #ruby
wildroman2 has quit [Remote host closed the connection]
andikr has quit [Read error: Connection reset by peer]
tjad has quit [Remote host closed the connection]
<havenwood>
sith!
patrickv has joined #ruby
nszceta has joined #ruby
<patrickv>
yo. I'm trying to figure some stuff out about EventMachine. I'd like it to stop when it has nothing left to do !
shadoi has quit [Ping timeout: 276 seconds]
<patrickv>
like nodejs
S0da has joined #ruby
jlebrech has joined #ruby
lukec has quit [Quit: lukec]
<shevy>
is the javascript this like self in ruby?
interactionjaxsn has joined #ruby
<apeiros>
shevy: yes
<apeiros>
but functions called on an object won't set `this`
shaunbaker has quit [Read error: Connection reset by peer]
rippa has joined #ruby
<apeiros>
e.g. obj.foo = function() { return this }; obj.foo !== this
shaunbaker has joined #ruby
<apeiros>
err, obj.foo() !== this
figgleberry has quit [Ping timeout: 252 seconds]
<apeiros>
required parens…
rubynab has joined #ruby
danshultz has quit [Remote host closed the connection]
<rubynab>
i have an array like ['a', 'b', 'c'] and want to turn it into a hash map like { 'a': true, 'b': true, 'c': true } – what’s the most elegant way to do this?
Xeago has quit [Remote host closed the connection]
brennanMKE has joined #ruby
<DaniG2k>
how can I rewrite with currying?
_maes_ has joined #ruby
noname001__ has quit [Ping timeout: 264 seconds]
<shevy>
DaniG2k can't you make one method instead
parzo has quit [Ping timeout: 265 seconds]
<shevy>
pass two arguments
lukec has joined #ruby
interactionjaxsn has joined #ruby
<MrZYX>
(I ignore the currying part because in ruby you can't curry methods, only lambda's (and maybe procs, I forgot)). IMO these are fine as they are, they are different enough and not complex enough to unify them
saarinen has joined #ruby
AxonetBE has quit [Quit: AxonetBE]
zachallett has joined #ruby
aryaching has joined #ruby
x77686d has joined #ruby
<DaniG2k>
yeah they arent complex but
<DaniG2k>
i suppose thats one really nice feature of functional languages
<DaniG2k>
1 method
<terrellt>
You could always make url_array an object, then write url_array.without_urls, with the default being including them.
<apeiros>
anildigital: why do you ask questions if you don't listen to the answers?
<MrZYX>
anildigital: we understood that it's not there. we explained you that it doesn't matter to be a singleton, what didn't you understand about that?
zachallett has quit [Remote host closed the connection]
daxroc has joined #ruby
lfox has quit [Quit: ZZZzzz…]
forced_request has joined #ruby
axl_ has joined #ruby
benlieb has joined #ruby
bleak2 has joined #ruby
avril14th has quit [Quit: Page closed]
timonv has quit [Remote host closed the connection]
canton7-mac has quit [Remote host closed the connection]
<shevy>
ewwww
nism has joined #ruby
<Sawbones>
Why do you guys hate non parends?
<shevy>
no
sepp2k has joined #ruby
parzo has quit [Ping timeout: 260 seconds]
Spami has joined #ruby
<shevy>
def foo bar, bla, ble, :lala => :hoho
alekst has joined #ruby
rootshift has joined #ruby
<shevy>
cat.meow()
<shevy>
cat.meow
<shevy>
cat.jump_to :tree
<shevy>
cat.jump_to(:tree)
bleak has quit [Ping timeout: 248 seconds]
<Morrolan>
I like leaving away parentheses, but within reason.
caustic has joined #ruby
olivier_bk has quit [Ping timeout: 252 seconds]
mocfive has joined #ruby
<shevy>
I always use parens for definitions
<Morrolan>
Which narrows down to "methods without arguments" and "DSL".
troyready has joined #ruby
blackmesa has quit [Ping timeout: 240 seconds]
<shevy>
define DSL :)
mikepack has quit [Remote host closed the connection]
<MrZYX>
so how much do you hate me for doing expect(some_method arg).to whatever ? :P
<Sawbones>
I like Object.task :run_file
Czupa has quit [Quit: Wychodzi]
<Morrolan>
RSpec, Sinatra, ...
<Morrolan>
Rake
Czupa has joined #ruby
<Morrolan>
MrZYX: I do that too.
lethjakman has quit [Ping timeout: 265 seconds]
bleak2 has quit [Ping timeout: 269 seconds]
<shevy>
MrZYX yeah that is quite awful
nomenkun has quit [Ping timeout: 245 seconds]
mark_locklear has quit [Ping timeout: 252 seconds]
<MrZYX>
shevy: how'd you write it?
<shevy>
I would not use expect()
<Morrolan>
But rather?
<MrZYX>
forget that it's rspec for a moment
<shevy>
I would not use rspec either
<Senjai>
shevy: why not?
<shevy>
Senjai dunno, never liked it
<Senjai>
shevy: fair enough :P
<MrZYX>
shevy: okay, how would you write foo(some_method arg).another_method another arg
chipotle has quit [Quit: cya]
<MrZYX>
s/another arg/another_arg/
<shevy>
foo.bla.should lalala(42)
<shevy>
MrZYX I don't approve of any of this
lukec has joined #ruby
blackmesa has joined #ruby
<shevy>
MrZYX in my latest attempts I am trying to use only [] class methods
rdark has quit [Quit: leaving]
noop has joined #ruby
<shevy>
Foo[]
<shevy>
Bar[]
ckinni has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jlast__ has quit [Remote host closed the connection]
<centrx>
I have replaced all of my variables with class variables? What now?
<shevy>
it frees me from having to give names to methods (these classes only have had one method, otherwise I would give proper names of course)
<shevy>
ack
<shevy>
class variables like @@foo ???
phansch has quit [Quit: Leaving]
akeem has joined #ruby
<shevy>
centrx!
<centrx>
Yes, now if you want to call a method on my class, all you have to do is: my_class.class_variable_get(:@@meth)
<shevy>
:(
<centrx>
This is new Ruby, no methods, no instance variables
<centrx>
We are the future
<shevy>
every time you use a @@var, a kitten dies
hobodave has quit [Quit: Computer has gone to sleep.]
<shevy>
no methods would be fun
nomenkun has joined #ruby
jack_rabbit has joined #ruby
<shevy>
centrx that is cumbersome syntax though
<shevy>
why not:
Txandy is now known as Txandy|away
<shevy>
class@@name
<shevy>
I mean that would be quite short
s2013 has joined #ruby
<shevy>
hmm
<centrx>
shevy, If it is too short, it is easy to make a mistake
<shevy>
object@var
wald0 has joined #ruby
<shevy>
that makes no sense
<s2013>
if i want to iterate through every file in a directory, what is the ideal way of doing it? use Dir.glob to get list of files and iterate through them or directly iterate through them by using Dir.foreach ?
<centrx>
While you are typing class_variable_get, you have the time to think about what you are doing
<shevy>
but foo@var would be nice
<shevy>
default readers for all ivars :)
<centrx>
s2013, Dir.glob is for regular expressions I believe
<MrZYX>
s2013: no sense in globbing if you don't cut down the list or go recursive, foreach is better here
standyro2 has joined #ruby
bleak has joined #ruby
<shevy>
s2013 use Dir['bla'].each {|entry| puts ' -> '+entry }
<centrx>
or "pattern, which is an Array of patterns or a pattern String"
<MrZYX>
centrx: no, for globbing syntax ;)
<shevy>
well I forgot a *
silentpost has joined #ruby
<s2013>
how do i get the filename then using dir.each/foreach ?
<shevy>
look! even ruby core uses the beautiful []!
<shevy>
what do you mean
<shevy>
it's an array
<s2013>
oh
<shevy>
Dir['/*']
<shevy>
try it!
<shevy>
and when you have an array, you can use .each
<shevy>
"/srv"
<shevy>
ewww
<shevy>
what stupid directory that is...
<s2013>
gotcha
ace_striker__ has joined #ruby
<s2013>
so i need to still do File.open right?
petey_ has quit [Remote host closed the connection]
rylev has quit [Remote host closed the connection]
<RubyPanther>
perl doesn't have the camel, Perl does
<shevy>
who writes Perl anyway
danshultz has quit [Ping timeout: 248 seconds]
<shevy>
that extra keystroke for P is so hard
<RubyPanther>
old linguists. oh yeah, the NSA.
Sawbones has quit []
octoberry has quit [Ping timeout: 240 seconds]
danshultz has joined #ruby
RaCx has quit [Quit: Computer has gone to sleep.]
Lewix has joined #ruby
apeiros has joined #ruby
pushpak has joined #ruby
interactionjaxsn has quit [Remote host closed the connection]
figgleberry has quit [Remote host closed the connection]
Txandy|away is now known as Txandy
kenneth has quit [Client Quit]
i_s has joined #ruby
tauebel has joined #ruby
RaCx has joined #ruby
rootshift has quit [Quit: My MacBook has decided to go to sleep. Zzzz..]
jlast has joined #ruby
sebouboubou has joined #ruby
ma4rco has joined #ruby
<ma4rco>
hello
<centrx>
Ahoy
<dx7>
olá
spider-mario has joined #ruby
<ma4rco>
i need help with sinatra and angular
shvelo has joined #ruby
<ma4rco>
i wanna read a sinatra site via http.get of angular, but its not working, getting 404
<ma4rco>
if i read a local html file it works, does someone know why this happens?
<dx7>
ma4rco: can you access your sinatra app via browser?
Bumptious has quit [Remote host closed the connection]
<ma4rco>
yeah sure
<ma4rco>
thats the problem that i dont understand
Bumptious has joined #ruby
Davey has quit [Quit: Computer has gone to sleep.]
gigetoo has quit [Remote host closed the connection]
<ma4rco>
and if i do a puts "teststring" in the / route
<dx7>
i cannot help you with angular. sorry.
<ma4rco>
i see that sinatra is doing something when i make the http java call
<ma4rco>
okay
gigetoo has joined #ruby
<sebouboubou>
hi folks. I started learning ruby a day ago, so just a beginner’s question: when declaring a var in a class or one of its methods, is it exactly the same to write @var=blabla and self.var=blabla? I find it confusing
tongcx has joined #ruby
<tongcx>
hi, guys, where do you keep web server script which is running?
<tongcx>
or /usr/local/bin?
<tongcx>
is it /var?
<tongcx>
or somewhere else
mikecmpbll has joined #ruby
standyro2 has quit [Ping timeout: 264 seconds]
breakingthings has quit []
davy_ has joined #ruby
kaldreno_ has joined #ruby
<centrx>
sebastianb, @var is an instance variable
breakingthings has joined #ruby
<dx7>
sebouboubou: @var=blablabla is a instace variable. self.var=blablabla is a method to acces that instance variable
kaldrenon has quit [Read error: Connection reset by peer]
<centrx>
sebastianb, self.var is a method call (def var=)
breakingthings has quit [Client Quit]
figgleberry has joined #ruby
zxq9 has joined #ruby
intuxicated has quit [Ping timeout: 264 seconds]
<dx7>
sebouboubou: self.var=blablabla works if you use attr_accessor or when you create a method called var= in your code
zeeraw has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
rickruby has joined #ruby
<sebouboubou>
oh, I get it, thanks. But in practise it’s usually almost the same, right?
<shevy>
tongcx for my local stuff, all my scripts are runnable everywhere
Rylee has joined #ruby
gnumarcelo has quit [Quit: gnumarcelo]
<sebouboubou>
yeah ok I understand
<sebouboubou>
Thanks!
nycjv321 has joined #ruby
zachallett has quit [Remote host closed the connection]
<nycjv321>
anyone ever run into a "undefined method `new' on an instance of SomeClass" ?
nonnatus has joined #ruby
<tongcx>
shevy: but for production sever?
<tongcx>
shevy: where do people usually put the running web sever?
<shevy>
tongcx dunno, I dont really use ruby much at all for a "production" server - all my things assume that they can run everywhere, all the time
<lagweezle>
What do you mean by web server script? The code that is run, or the thing that starts and stops the server?
adayzdone has quit [Quit: My Mac Pro has gone to sleep. ZZZzzz…]
akeem has quit [Quit: akeem]
<shevy>
tongcx on gobolinux, the schemata is /Programs/NAME_OF_PROGRAM/VERSION so if it would be apache's httpd, it would be /Programs/Apache/2.2.1/ and inside that the required subdir structure, like etc/ conf/ etc..
<lagweezle>
Right. Remind me to stay away from gobolinux ... Too much reminder of Windows. :/
SiliconG has joined #ruby
<shevy>
windows has no consistent naming scheme
<nycjv321>
lagweezle: "gobolinux"? sounds bad
<lagweezle>
The /Programs thing.
<shevy>
it is awesome
subbyyy_ has joined #ruby
<nycjv321>
dx7: this is the code " @test = Story.new(name, description, steps)
<lagweezle>
I'd like it more if it were named goblinlinux ;)
<shevy>
:\
<shevy>
you did not use it!
<nycjv321>
shevy: me?
centrx has quit [Quit: Leaving]
<dx7>
nycjv321: Story is a class or a module?
<shevy>
nah, lagweezle
anildigital is now known as zz_anildigital
<shevy>
but you probably didn't use it either nycjv321 :>
<nycjv321>
dx7: Story is a class and the issue does not occur if instantiated from within the same file.
zeeraw has joined #ruby
Asher has quit [Quit: Leaving.]
<nycjv321>
shevy: nope. I don't use distros that do severe modification of the Linux file system standard ;)
<lagweezle>
/usr/local/www or something like that is where I'd expect to have non-system stuff.
jlebrech has quit [Quit: Konversation terminated!]
subbyyy has quit [Ping timeout: 264 seconds]
<shevy>
nycjv321 oh so you are saying that other distributions like debian adhere to the FHS
<nycjv321>
dx7: I'm using cucumber.
yfeldblum has joined #ruby
<nycjv321>
shevy: lol atleast alot more ;)
<shevy>
nycjv321 just shows that you are clueless
heidi has joined #ruby
zxq9 has quit [Read error: Connection reset by peer]
<shevy>
nycjv321 else why does "stat /var/lib" work on gobolinux?
<nycjv321>
woah
<lagweezle>
O.o
<lagweezle>
I'm confused as to what you're implying, shevy.
<nycjv321>
shevy: no need for the slap in the face
carraroj has joined #ruby
<shevy>
lagweezle what part? he claimed "severe modifications". If these would be "severe modifications" as he implied, why does it all work?
iamsean has joined #ruby
DrShoggoth has joined #ruby
arvorie has quit [Remote host closed the connection]
wgosling has left #ruby ["Konversation terminated!"]
<nycjv321>
shevy: wikipedia must be lying then
gittish has joined #ruby
<shevy>
nycjv321 what part
SiliconG has quit [Ping timeout: 252 seconds]
<lagweezle>
shevy can't help it. He hails from tribe slapaho. He just slaps things al ot. ;)
<lagweezle>
shevy: OH! Gotcha. More the /Programs isn't something that 'should' exist.
<dx7>
nycjv321: strange
<lagweezle>
Still keeping dirs that are necessary isn't really the opposite. :/
<nycjv321>
lagweezle: exactly
<shevy>
lagweezle well it is one additional layer compared to FHS layouts
Txandy is now known as Txandy|away
RaCx has quit [Quit: Computer has gone to sleep.]
<nycjv321>
I don't use distro's that promote fragmentation
<shevy>
nycjv321 what distribution do you use?
<nycjv321>
anyways I am noticing that 'Story' isn't in the $LOAD_PATH. Is it possible that another instance of Story exists natively in Ruby?
rljohnsn has joined #ruby
<lagweezle>
I think nycjv321 and I would rather it just stick with the standards rather than adding things not necessary.
<nycjv321>
shevy: Slackware (l33t), Archlinux (Too unstable), and Fedora (Awesomesause)
<shevy>
3 all in one?! :D
nszceta has quit [Remote host closed the connection]
<nycjv321>
Those are the ones I switch between. I have been using fedora lately.
rljohnsn has quit [Client Quit]
<dx7>
nycjv321: No, it isn't. Ruby have no Story class natively.
freezey has quit [Remote host closed the connection]
cyrus_mc has left #ruby [#ruby]
workmad3 has quit [Ping timeout: 252 seconds]
<nycjv321>
hmmm maybe Cucumber does
<nycjv321>
time for a module
gja has quit [Quit: This computer has gone to sleep]
RaCx has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
gja has joined #ruby
<dx7>
nycjv321: but if you try call Story.new and Story doesn't exists you have a uninitialized constant error.
<lagweezle>
Ubuntu/Devian and CentOS/RHEL here.
<nycjv321>
its a no Method error.
<nycjv321>
so I'm guessing Cucumber has a story class somewhere.
hobodave has joined #ruby
<dx7>
nycjv321: maybe
zachallett has joined #ruby
danman has joined #ruby
shadoi has joined #ruby
shadoi has quit [Client Quit]
shadoi has joined #ruby
<Hanmac>
shevy: sorry i was away reading ... and about SWIG ... not even its own creator likes it
<shevy>
haha
tongcx has left #ruby [#ruby]
xcv_ has quit [Remote host closed the connection]
rljohnsn has joined #ruby
xcv has joined #ruby
devinus has joined #ruby
danshultz has quit [Read error: Connection reset by peer]
nomenkun has quit [Remote host closed the connection]
danshultz has joined #ruby
obs_ has quit [Quit: Konversation terminated!]
nomenkun has joined #ruby
havenwood has quit []
freezey has joined #ruby
lethjakman has joined #ruby
<RubyPanther>
"why are you writing bindings by hand? why don't you just use swig?" "0.o"
browndawg has quit [Quit: Leaving.]
rootshift has joined #ruby
asmodlol has quit [Remote host closed the connection]
<Hanmac>
Senjai: i am binding c++ against ruby since years without problem
<RubyPanther>
it is worth the 1000 hours, just to not have to look at the ugly
jso has joined #ruby
RaCx has quit [Quit: Computer has gone to sleep.]
Celm has joined #ruby
nomenkun has quit [Ping timeout: 245 seconds]
sparrovv has joined #ruby
rylev has joined #ruby
<Pixels>
How would I break from a do end block?
bleak has quit [Ping timeout: 245 seconds]
ndrei has joined #ruby
parzo has joined #ruby
<nycjv321>
still isn't working wow
<lagweezle>
'break'
<nycjv321>
Pixels: break?
sparrovv has quit [Remote host closed the connection]
<nycjv321>
or exit? :P
<Pixels>
tried break, gave me Error: break from proc-closure
kenneth has joined #ruby
<Pixels>
wait, nvm, i got it
<Pixels>
thanks though
<nycjv321>
Pixels: what worked?
phipes has quit [Remote host closed the connection]
gja has quit [Quit: This computer has gone to sleep]
zxq9 has joined #ruby
fedesilv_ has joined #ruby
<banister>
Pixels "next"
<nycjv321>
omg I am soo stupid
<Pixels>
yeah, that
<banister>
"break" is slightly more intense, and wont just break from teh block, it'll break from the called method
fedesilva has quit [Ping timeout: 252 seconds]
<nycjv321>
dx7: your were right :) I was calling .new twice
* nycjv321
is stupid
OdNairy has joined #ruby
<dx7>
nycjv321: :)
aryaching_ has joined #ruby
<apeiros>
I suggest ruby adds a keyword, `voodoo`. whenever you don't know how to do something, you use that keyword and ruby will automagically do "the right thing!"
RaCx has joined #ruby
<dx7>
mykeus: problem solved! cool.
parzo has quit [Ping timeout: 265 seconds]
magoo_ has joined #ruby
<Pixels>
Just make a program with the only word being voodoo
nanoyak has joined #ruby
<dx7>
mykeus: wrong recipient. sorry.
<dx7>
nycjv321: problem solved! cool.
<lagweezle>
next? isn't that 'end this cycle and jump to the next'?
<shevy>
voodoo sounds awesome
<nycjv321>
lagweezle: makes sense as there is only one iteration?
aryaching has quit [Ping timeout: 260 seconds]
senj has quit [Quit: Sleep Now]
Kilo`byte has quit [Ping timeout: 264 seconds]
maletor has joined #ruby
nobitanobi has joined #ruby
<lagweezle>
Oh. If there is only one iteration, then yeah ...
<RubyPanther>
apeiros: doing "the right thing" isn't at all what I would expect voodoo to do! http://www.retrologic.com/jargon/V/voodoo-programming.html "The implication is that the technique may not work, and if it doesn't, one will never know why. Almost synonymous with black magic, except that black magic typically isn't documented and nobody understands it."
Al__ has quit [Quit: Al__]
<nycjv321>
Hanmac: hehehe
maletor has quit [Read error: Connection reset by peer]
phansch has joined #ruby
maletor has joined #ruby
philsturgeon has joined #ruby
<apeiros>
RubyPanther: ok, rename it to fairy_grandparents?
<RubyPanther>
I guess the black magic becomes voodoo when it is semi-documented on a wiki
<apeiros>
oh, fairly_oddparents
adayzdone has joined #ruby
<philsturgeon>
How can I split rake tasks into multiple files, just using plain old ruby? If I push to heroku without a Rakefile then heroku complains, but i dont want all jobs in the same file
mojjojo has joined #ruby
craigp has quit []
duggiefresh has quit [Read error: Connection reset by peer]
Celm has joined #ruby
duggiefresh has joined #ruby
<apeiros>
philsturgeon: you can use require in Rakefile just fine
<philsturgeon>
Dir.glob('tasks/*.rake').each { |r| import r }
<philsturgeon>
durp
<philsturgeon>
thanks
Virtualize|away has joined #ruby
philsturgeon has left #ruby [#ruby]
<RubyPanther>
apeiros: how about lemonaid! or lazy! Gnome.new.lemonaid! "project finished"
<apeiros>
koolaid?
<apeiros>
I don't really care, it can have umphteen aliases
<RubyPanther>
koolaid you only think it worked until you get the code review back
chipotle has joined #ruby
freezey has quit [Remote host closed the connection]
davy_ has joined #ruby
nism has quit [Quit: Leaving]
<terrellt>
Gnome.new.koolaid.drink! #=> SIGTERM.
decoponio has quit [Quit: Leaving...]
heftig has joined #ruby
<RubyPanther>
It might have been the first Pragmatic book that talked about building things so that they can easily be extended to add expected future features, so that instead of a big rewrite, you can just tack on the new feature and be drinking lemonade in the shade
jmurray has quit [Quit: jmurray]
CaptainJet has joined #ruby
<RubyPanther>
Their future books take a different tack, of course
jmurray has joined #ruby
freezey has joined #ruby
jmurray has quit [Client Quit]
maletor_ has joined #ruby
jmurray has joined #ruby
<shevy>
RubyPanther writes epically long sentences
Wolland has joined #ruby
IceDragon has quit [Ping timeout: 252 seconds]
jmurray has quit [Client Quit]
<LadyRainicorn>
Bet
<LadyRainicorn>
ter to write short.
dangerousdave has joined #ruby
xcv has quit [Read error: Connection reset by peer]
<LadyRainicorn>
Too many words. No periods.
jlast has quit [Remote host closed the connection]
<LadyRainicorn>
Small is beautiful.
Asher has joined #ruby
<LadyRainicorn>
Brevity is bold.
jmurray has joined #ruby
jmurray has quit [Client Quit]
jlast has joined #ruby
maletor has quit [Ping timeout: 260 seconds]
jmurray has joined #ruby
<shevy>
Ponicorns are drunk!
benlieb has quit [Quit: benlieb]
<RubyPanther>
99th percentile in comprehension, only 62nd in writing. I can parse it, why can't anybody else?!
jmurray has quit [Client Quit]
<shevy>
laziness
<shevy>
or an increase of processing cost
<RubyPanther>
what do you mean a sentence can't have 12 commas?!
caustic has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
Davey has joined #ruby
stkowski has joined #ruby
<shevy>
sentences should not even have a .
<shevy>
look at IRC!
<shevy>
there are some people who punctuate and some who don't
sambao21 has quit [Quit: Computer has gone to sleep.]
<RubyPanther>
I dated an English major, we'd chat online... I'd write 300 words, and she'd say, "you mean ____ ____?" "yeah"
<shevy>
very understandable actually ;)
<RubyPanther>
hers usually had more content, somehow
<shevy>
hehe
jlast has quit [Read error: Connection reset by peer]
mikepack has joined #ruby
mocfive has quit [Remote host closed the connection]
<banister>
RubyPanther you recently married a chinese right?
jlast has joined #ruby
IceDragon has joined #ruby
mocfive has joined #ruby
Azure has quit [Ping timeout: 260 seconds]
mocfive has quit [Remote host closed the connection]
mocfive has joined #ruby
devinus_ has joined #ruby
Nyyx has quit [Ping timeout: 272 seconds]
devinus has quit [Ping timeout: 245 seconds]
sambao21 has joined #ruby
mark_locklear has joined #ruby
<lagweezle>
Hanmac: Where can I acquire such 'monsters'?
Azure has joined #ruby
petey has joined #ruby
interactionjaxsn has joined #ruby
devinus_ is now known as devinus
benlieb has joined #ruby
tonni has joined #ruby
mikepack has quit [Remote host closed the connection]
jack_rabbit has quit [Ping timeout: 248 seconds]
dkamioka has quit [Remote host closed the connection]
intuxicated has joined #ruby
caustic has joined #ruby
standyro2 has joined #ruby
senj has joined #ruby
Jdubs has joined #ruby
lfox has joined #ruby
benlieb has quit [Quit: benlieb]
agjacome has joined #ruby
duggiefr_ has joined #ruby
duggiefresh has quit [Read error: Connection reset by peer]
tonni has quit [Remote host closed the connection]
dkamioka has joined #ruby
tonni has joined #ruby
yarou has joined #ruby
dkamioka has quit [Remote host closed the connection]
tyl has quit [Quit: Computer has gone to sleep.]
dkamioka has joined #ruby
<snkcld>
is it possible to have multiple types of data in one csv file? like, if i exported 3 different types of data, is there any way i can just place them all in the same csv file, and have ruby CSV recognize it?
<lagweezle>
CSV is only text.
<shevy>
I could embed dancing pigs in a CSV file!
<lagweezle>
So there is no actual data type other than strings, sort of.
<snkcld>
i realize that
<lagweezle>
So long as you handle conversion, yes, you can put anything in it.
rezzack has joined #ruby
<shevy>
even dancing pigs?!
shadoi has quit [Quit: Leaving.]
ElComradio has quit [Quit: ElComradio]
g0bl1n has quit [Quit: Ex-Chat]
<lagweezle>
I suppose so...
<apeiros>
snkcld: no, csv is single table in a file
<snkcld>
apeiros: thanks
<apeiros>
snkcld: you could wrap your csv data in some container format
<RubyPanther>
CSV isn't just a string, it has escaping conventions so you can stuff all sorts of data in there
<apeiros>
but then only you can parse it
Shidash has joined #ruby
<snkcld>
i realize i can use hacks to get it to work in this way, i was just curious if there was some elegant solution provided by CSV which allowed me to do have just one csv file
<RubyPanther>
of course, half the tools are not compliant and will break unless it is strings...
Advocation has quit [Quit: Advocation]
kirun has joined #ruby
dorei has joined #ruby
jack_rabbit has joined #ruby
Advocation has joined #ruby
<shevy>
somehow RubyPanther does not cheer people up :(
shadoi has joined #ruby
dkamioka has quit [Ping timeout: 265 seconds]
<RubyPanther>
snkcld: The first thing you do with a CSV file is convert it to some better format. You don't want to mix data types because CSV headers are only for giving field names, not types
jbueza has joined #ruby
xiphias_ has joined #ruby
xiphias has quit [Read error: Connection reset by peer]
Kricir has quit [Remote host closed the connection]
<RubyPanther>
shevy: if they're using CSV they need to be optimists! The glass isn't empty, it is over 2% full!
sparrovv has joined #ruby
ckinni has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<apeiros>
well, soon holidays… will take some time to work on it during those.
<shevy>
yeah, ever you went the rails route, you had less and less time apeiros
maletor_ has quit [Quit: Computer has gone to sleep.]
timonv has joined #ruby
<apeiros>
shevy: not rails route. working for corporate.
<shevy>
with rails!!!
<RubyPanther>
rails: a working blog in 14 minutes. Or a broken app in 3 years.
mojjojo has quit [Quit: mojjojo]
<shevy>
or "doing rails for the rest of my life"
<snkcld>
RubyPanther: what would you suggest other than csv?
<snkcld>
json?
Bira has quit [Remote host closed the connection]
<RubyPanther>
snkcld: I generally insist on keeping data in databases, and/or behind APIs
<snkcld>
oh yea yea, im exporting to be taken in by another database though. csv is working quite well for this actually
reset has joined #ruby
<RubyPanther>
but I'm probably just scarred from... weekly 200MB excel imports... via email
<snkcld>
oh ha. luckily i dont need to work with excelt
<RubyPanther>
snkcld: Just use postgres dblink!
<snkcld>
im exporting from postgres
<snkcld>
and importing to neo4j
<snkcld>
dblink?
<snkcld>
interesting
<RubyPanther>
dblink lets you make the foreign database a view, and you can move the data inside postgres
<snkcld>
whoa
momomomomo has joined #ruby
<RubyPanther>
there is a dbi-link (the original) in Perl which lets you connect any db with dbi support, and even lets you make custom data types for them
figgleberry has quit [Ping timeout: 248 seconds]
timonv has quit [Ping timeout: 265 seconds]
nari has quit [Read error: Operation timed out]
popl has joined #ruby
popl has joined #ruby
popl has quit [Changing host]
dkamioka has joined #ruby
Guest010011 has quit [Quit: Leaving]
ckinni has joined #ruby
<snkcld>
ah, so dbi is the interface by which the two databases would communicate?
drumusician has quit [Ping timeout: 265 seconds]
mojjojo has joined #ruby
parzo has joined #ruby
mikepack has joined #ruby
havenwood has joined #ruby
davy_ has quit [Remote host closed the connection]
mikepack has quit [Remote host closed the connection]
mikecmpbll has quit [Quit: i've nodded off.]
mikepack has joined #ruby
mikepack has quit [Remote host closed the connection]
rylev has quit []
aryaching_ has quit [Ping timeout: 240 seconds]
<RubyPanther>
snkcld: with dbi-link, yeah, dbi is the low level driver interface, so you can use any db that Perl can use. That's an addon, but the dblink version that is included I think has native support for a bunch. I'm not sure how many. I've used it with oracle and ODBC.
Yahkob has joined #ruby
_Andres has joined #ruby
<RubyPanther>
it is really great for taming legacy monsters, because you can leave the old stuff on the old db, and put the new stuff on postgres, and migrate in stages
axl_ has quit [Ping timeout: 260 seconds]
momomomomo has quit [Quit: momomomomo]
parzo has quit [Ping timeout: 272 seconds]
<shevy>
oh man
<shevy>
RubyPanther has had a painful life :(
<shevy>
snkcld but obviously the pain has built his character
fenicks has joined #ruby
<snkcld>
ha
<hfp>
Hey guys, I am going through the Ruby Koans and I was wondering if there were the answers anywhere to the "THINK ABOUT IT" questions from the comments? i.e. http://pastie.org/8683241
<RubyPanther>
lol your legacy nightmare is my weekend entertainment
<snkcld>
im coming from ruby, im not seeing a dbi link for neo4j. i guess the dbi link would implement logic to convert the postgres database tables and relationships to the foreign database's representation
<snkcld>
unfortunately im interfacing with the foreign db via an embedded mode, not over a network connection by which i could send queries
nycjv321 has quit [Read error: Operation timed out]
<snkcld>
ah, nice. thats pretty cool. unfortunately this would mean i would interface with the database over rest, as opposed to embedded mode, which would be much slower than exporting the postgres as csv and importing in embedded
teddyp1c_ has quit []
<shevy>
hfp perhaps other reasons, not sure. equality checks can be overriden I think
zeeraw has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
sparrovv has quit [Remote host closed the connection]
kedibasi has joined #ruby
<snkcld>
btw im using jruby to interface with the database in embedded mode (the database is written in java)
<shevy>
java!
<RubyPanther>
snkcld: in that case, JSON is probably your best bet
<RubyPanther>
but you'll have to write code that knows about your stuff
mikepack has joined #ruby
ckinni has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ckinni has joined #ruby
<snkcld>
RubyPanther: exactly. thats exactly what im doing
<RubyPanther>
or use one of these new open document formats, like the office packages use
<snkcld>
the logic about what the relationships are is in my importing code
Loaft has joined #ruby
<snkcld>
which is working great. why do you think json would be better ,though?
<RubyPanther>
it kinda sucks when there is data that can't describe itself
<snkcld>
csv is nice becuase postgres can export everything i need in a matter of ~15 sec
<snkcld>
(550k clients)
ElComradio has joined #ruby
<snkcld>
and a ton of products, etc
<snkcld>
i imagine that json is more to parse, too, though
dkamioka has quit [Remote host closed the connection]
<snkcld>
more clocks to parse it
<havenwood>
shevy: a method with an argument versus just a method
<RubyPanther>
json is better than CSV because it has less tricky escaping rules, tools are more compliant, and you can include metadata as needed
<shevy>
havenwood hmm
<snkcld>
RubyPanther: i agree that the json format is better, definitely
<shevy>
havenwood I like methods
<snkcld>
but does postgres export to json?
<RubyPanther>
snkcld: if you build it with PL/Ruby support, it would only be a few lines of code...
zigomir has joined #ruby
Advocation has quit [Quit: Advocation]
figgleberry has joined #ruby
<snkcld>
ah, actually it looks like postgres has a record to json function
<RubyPanther>
Of course, most people would NOT do that step in the database. But you can. I would.
<RubyPanther>
Like if you write a database function in SQL, it is usually really in the PL/SQL language
<RubyPanther>
I actually had to edit the source to get the current PL/Ruby working with the current Ruby and current Postgres, so using the built-in JSON conversion is highly recommended if it can do what you want
Hobogrammer has quit [Ping timeout: 265 seconds]
<snkcld>
RubyPanther: it sounds like a good idea and all, however, considering that my import script has all the logic for what format the fields are, etc, i dont think this would benefit me. though it does sound like an interesting project
<RubyPanther>
it does build with the right compile options if you want untrusted version (for single-developer use)
Bira has joined #ruby
<RubyPanther>
snkcld: Yeah, you're better off just leaving it brittle and documenting it
danman has quit [Ping timeout: 272 seconds]
adayzdone has quit [Quit: My Mac Pro has gone to sleep. ZZZzzz…]
<RubyPanther>
unless you can get away with billing a month of db programming ;)
<snkcld>
its definitely a million times better than what i was doing before... which was using ActiveRecord find_each to generate the csv manually...
Kricir has joined #ruby
Celm has quit [Remote host closed the connection]
<snkcld>
literally atleast a thousand times slower
<snkcld>
i was just being lazy, until i decided to figure out the SQL to get what i wanted exactly
danman has joined #ruby
kewjo has joined #ruby
CalimeroTeknik has joined #ruby
Jdubs has quit [Remote host closed the connection]
danman has quit [Client Quit]
drumusician has joined #ruby
Bira has quit [Ping timeout: 265 seconds]
davy__ has joined #ruby
asmodlol has joined #ruby
maletor has joined #ruby
v0n has quit [Read error: Operation timed out]
onewheelskyward has quit [Ping timeout: 245 seconds]
tongcx has joined #ruby
<tongcx>
hi guys, i'm trying to use sinatra to serve static file
duggiefr_ has quit [Remote host closed the connection]
maletor has quit [Read error: Connection reset by peer]
<tongcx>
there is one confusion
chuck54 has joined #ruby
maletor_ has joined #ruby
<tongcx>
so i use Rack::static for it
<tongcx>
but sinatra also set the default root as 'public'
<tongcx>
also, in ruby what does 'set :public true' come from
<tongcx>
is 'set' a keyword?
<dorei>
NameError: undefined local variable or method `set' for main:Object
<hfp>
shevy: Well I put that it's because nil is not a boolean in Ruby and so == nil will not evaluate as expected whereas object.nil? will evaluate to true or false. But I would like to check my answers to make sure I got it right.
<dorei>
nop, it's not a keyword :p
<shevy>
hfp yeah no idea. I go with .nil? always myself, it feels much better than == nil
<tongcx>
dorei: so it's a method of SinatraBase?
<dorei>
tongcx: no idea, maybe
havenwood has quit [Remote host closed the connection]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
zegerjan has quit [Ping timeout: 260 seconds]
<apeiros>
tongcx: depends on what `self` is where you have that line
RaCx_ has joined #ruby
caustic has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
<tongcx>
by default, does sinatra serve static file?
<apeiros>
though that line you just pasted is a syntax error
<apeiros>
I assume you miss a ","
caustic has joined #ruby
RaCx has quit [Read error: Connection reset by peer]
RaCx_ is now known as RaCx
mojjojo has quit [Quit: mojjojo]
<apeiros>
tongcx: `set :public, true` is (almost) the same as `self.set(:public, true)`
duggiefresh has joined #ruby
<apeiros>
only almost as it differs for private methods
adayzdone has joined #ruby
<tongcx>
apeiros: thanks
chrisseaton has quit []
Advocation has joined #ruby
wildroman2 has quit [Remote host closed the connection]
ma4rco has quit [Quit: Lost terminal]
maletor_ has quit [Ping timeout: 245 seconds]
venkat has joined #ruby
mojjojo has joined #ruby
wildroman2 has joined #ruby
wildroman2 has quit [Remote host closed the connection]
intuxicated has quit [Read error: No route to host]
wildroman2 has joined #ruby
wallerdev has quit [Ping timeout: 248 seconds]
Celm has joined #ruby
maletor has joined #ruby
venkat has quit [Remote host closed the connection]
Mon_Ouie has quit [Ping timeout: 252 seconds]
venkat has joined #ruby
venkat has quit [Read error: No route to host]
enebo has joined #ruby
dachi_ has left #ruby [#ruby]
dachi_ has joined #ruby
figgleberry has quit [Ping timeout: 272 seconds]
petey has quit [Remote host closed the connection]
Notte has joined #ruby
davy__ has quit [Read error: Connection reset by peer]
petey has joined #ruby
davy__ has joined #ruby
nonnatus has quit [Ping timeout: 264 seconds]
robbyoconnor has joined #ruby
caustic has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
banister is now known as banisterfiend
heidi is now known as heidi-ramen
<snkcld>
i notice that JavaUtilities.get_package_module_dot_format is taking a significant amount of time in my import script... if i dont use "dot format" when referencing java packages, would it be faster?
petey has quit [Ping timeout: 240 seconds]
Alina-malina has quit [Read error: Connection reset by peer]
<snkcld>
i figured itd be faster -with- dot format, since it doesnt need to convert the camel case format to dot format for java (since java packages are in dot format
<TTilus>
have you profiled?
adayzdone has quit [Quit: My Mac Pro has gone to sleep. ZZZzzz…]
phipes has quit [Remote host closed the connection]
mark_locklear has quit [Ping timeout: 248 seconds]
rickruby has quit [Remote host closed the connection]
chrisseaton has joined #ruby
<lmg_>
Hey there, stupid question: I can't remember nor find information about they way you configure apache to use ruby the way you would normally use php, so like with <% %> if my memory serves me well
Wolland has quit [Remote host closed the connection]
jack_rabbit has quit [Quit: SIGSEGV (core dumped)]
jack_rabbit has joined #ruby
<benzrf>
snkcld: because array to hash is O(n) average?
<RubyPanther>
There is a Ruby port of lucene called Ferret, but it is many many years old
<benzrf>
given O(1) insertion of n elements...
<snkcld>
RubyPanther: well, i am in jruby, and i actuially have lucene available to me
<DouweM>
If you want to use Lucene, there's libraries for both elasticsearch and solr
jack_rabbit has quit [Client Quit]
notjohn has quit [Quit: notjohn]
senayar_ has joined #ruby
<snkcld>
im doing the hashing in ruby-space though so that i dont have to enter into java code and convert objects back and forth
<RubyPanther>
snkcld: If you only need the features that hashes have, they're faster
jack_rabbit has joined #ruby
<snkcld>
yea, im using it very basically
<snkcld>
i have the key for each lookup
lethjakman has quit [Quit: WeeChat 0.4.0]
<snkcld>
i dont need ot do ranges or anything like that
Xuisce has left #ruby [#ruby]
wildroman2 has quit [Remote host closed the connection]
<RubyPanther>
I don't know about in JRuby, but in MRI the base types are in quality C, and just the time to interface with something else will make it slower
deric_skibotn has quit [Ping timeout: 240 seconds]
kpshek has quit []
pothibo has joined #ruby
<apeiros>
snkcld: log n search is used in scenarios where hard upper limits exist. e.g. where hash worst case is a no-go
<RubyPanther>
Presumably JRuby is similarly optimized for the base types
klaut has joined #ruby
<snkcld>
apeiros: not sure i understand, does hash have a worst case?
<apeiros>
alternatively in scenarios where the constant overhead of hash search is higher for the expected values of N than log N serach
<apeiros>
snkcld: collisions
<snkcld>
ahhhh
<snkcld>
OH
<benzrf>
snkcld: worst case lookup is O(n)
<apeiros>
hash is amortized O(1), not "true" O(1)
<benzrf>
definitely worse than O(log n) ;)
<snkcld>
didnt think about that. hashes are computationally expensive, and i guess if you have really large keys it may be quicker to just do a search
venkat_ has joined #ruby
isec has quit [Remote host closed the connection]
jlast has quit [Remote host closed the connection]
senayar has quit [Ping timeout: 252 seconds]
<snkcld>
is it possible to enable rubys hashes to use log(1) or log(n) ?
<benzrf>
apeiros: what exactly does amortized mean in that context?
Hobogrammer has joined #ruby
brian___ has joined #ruby
flori has quit [Ping timeout: 260 seconds]
<apeiros>
I'd refer you to WP, as that probably gives a more accurate description than I
wildroman2 has joined #ruby
wildroman2 has quit [Remote host closed the connection]
venkat has quit [Ping timeout: 272 seconds]
wildroman2 has joined #ruby
jlast has joined #ruby
oso|away is now known as oso96_2000
klaut has quit [Ping timeout: 264 seconds]
punkrawkR has quit [Quit: - nbs-irc 2.39 - www.nbs-irc.net -]
<snkcld>
apeiros: WP?
<apeiros>
wikipedia
<RubyPanther>
Ruby hashes are generally cheap though. The more common slow cases like dynamic resizing are partially mitigated, for example by pre-allocating extra buckets
Nyyx has joined #ruby
tauebel has joined #ruby
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
nobitanobi has quit [Read error: Connection reset by peer]
<RubyPanther>
I've never even heard of a real case where hashes are too slow, but Ruby is fast enough ;)
<apeiros>
allocating only happens on insertion, and we were discussing lookup ;-)
blackmesa has joined #ruby
fedesilv_ has quit [Remote host closed the connection]
<apeiros>
in ruby you'll hardly ever be in a situation where you have to choose between hash and a "faster" datastructure. simply because rubys own overheads usually offset any difference already.
<RubyPanther>
Right, lookup isn't where the common slow cases are clustered
<apeiros>
(can still happen, though)
fedesilva has joined #ruby
timonv has joined #ruby
relix has joined #ruby
<snkcld>
my usage of hashes are like this: indexes["indexname"]["string"][integer]
<snkcld>
so i may just be overthinking it, because the first 2 are cheap hashes and the 3rd a simple offset
<snkcld>
indexes["indexname"]["string"] would be an array actually...
<pontiki>
i'm looking for something that will properly case-fold strings with UTF-8 characters
mojjojo has quit [Quit: mojjojo]
sebouboubou has quit [Quit: ChatZilla 0.9.90.1 [Firefox 29.0a1/20140130030202]]
venkat_ has quit [Read error: Connection reset by peer]
<apeiros>
pontiki: use one of the unicode gems
burlyscudd has joined #ruby
<RubyPanther>
snkcld: in my experience, laying out the data in a logical way is more important than worrying about the underlying implementation, because a structured, OO-ish approach will be readily optimizable later
<DouweM>
snkcld: what range will that integer key be?
<apeiros>
pontiki: or activesupport - I think it has support for that
<snkcld>
well the key can be from 0 - anything ,really
<pontiki>
i can't find anything for that in AS
<snkcld>
RubyPanther: i feel you on that, but what im using this for is meant to be as quick as possible
<RubyPanther>
And the interface to Hash is very easy to drop into something else
<snkcld>
the project is laid out pretty nicely and OO, but as far as the indexing goes, im really trying to be fast
<RubyPanther>
snkcld: in my experience putting that cart in front of the horse slows things down more often than speeds things up
freezey has joined #ruby
<snkcld>
yea
<snkcld>
honestly, its mostly morbid curiousity.
<RubyPanther>
Especially where duck typing should let you drop in a replacement without changing your business logic
<snkcld>
ruby is working very well for me as it is
<snkcld>
RubyPanther: yea, thats exactly what im doing
wildroman2 has quit [Remote host closed the connection]
<snkcld>
its a drop in replacement to the lucene index
<snkcld>
;P
<snkcld>
kinda
<snkcld>
from my apps perspective atleast
<RubyPanther>
snkcld: Right, but instead you could wrap lucene to be the drop-in replacement for Hash :) You might even only need two methods #[] and #[]=
flori has joined #ruby
Bira has joined #ruby
kirun has quit [Quit: Client exiting]
Notte has quit [Remote host closed the connection]
<snkcld>
ha
brennanMKE has quit [Remote host closed the connection]
diegoviola has quit [Ping timeout: 245 seconds]
<snkcld>
honestly i think that rubys hashing may be better, unless doing the hashing in java is faster? because i imagine that all the stuff lucene would add may add extra logic where i dont need it
gittish has joined #ruby
<snkcld>
lucene is available to me by default, but with the way this database indexing is setup... i would need to flush every so often to make srue everything is consistent
blackmes1 has joined #ruby
<snkcld>
but with my simple jruby hash, i dont need to worry about htat at all. then, in the end, when my indexprovider is shutdown, i flush it all out to lucene
momomomomo has joined #ruby
momomomomo has quit [Client Quit]
burlyscudd has quit [Ping timeout: 264 seconds]
mojjojo has joined #ruby
blackmesa has quit [Ping timeout: 248 seconds]
adayzdone has joined #ruby
dangerousdave has quit [Quit: My Mac Pro has gone to sleep. ZZZzzz…]
chipotle has quit [Ping timeout: 272 seconds]
deric_skibotn has joined #ruby
notjohn has joined #ruby
chipotle has joined #ruby
nonnatus has joined #ruby
timonv has quit [Remote host closed the connection]
figgleberry has quit [Ping timeout: 252 seconds]
drumusician has joined #ruby
timonv has joined #ruby
agent_white has joined #ruby
centrx has joined #ruby
timonv_ has joined #ruby
timonv has quit [Read error: Connection reset by peer]
chrisseaton has quit []
heidi-ramen is now known as heidi
w4pm has joined #ruby
postmodern has joined #ruby
Evenix has quit [Remote host closed the connection]
rm__ has quit [Remote host closed the connection]
dkamioka has quit [Remote host closed the connection]
diegoviola has joined #ruby
chrisseaton has joined #ruby
F1skr has joined #ruby
rickruby has joined #ruby
Jdubs has quit [Remote host closed the connection]
tvw has quit []
Neomex1 has joined #ruby
rubynab has quit [Ping timeout: 245 seconds]
davy__ has joined #ruby
venkat has joined #ruby
agent_white has quit [Quit: brb]
venkat has quit [Read error: No route to host]
Azulinho has joined #ruby
phipes has quit [Remote host closed the connection]
davy__ has quit [Remote host closed the connection]
<Azulinho>
whats your favourite gem for command line parsing these days ? looking for lean and feature full
jenskarlsen has joined #ruby
rm_ has joined #ruby
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
chomskiii has quit [Read error: Connection reset by peer]
diegoviola has quit [Quit: WeeChat 0.4.2]
brunops has quit [Ping timeout: 245 seconds]
jenskarlsen has left #ruby [#ruby]
phipes has joined #ruby
<centrx>
Azulinho, I think OptionParser is the standard
<benzrf>
i kinda wanna write an obfuscated jarh
Oog has joined #ruby
<benzrf>
but my only real idea seems kinda infeasible
chomskiii has joined #ruby
Txandy|away is now known as Txandy
<Oog>
if my function does yield in a begin/rescue blog the rescue should capture an exception in the yield right?
agent_white has joined #ruby
breakingthings has quit []
<Azulinho>
yeah, I keep generating more lines of code with OptionParser than the app code itself.
<Azulinho>
that annoys me
chuck54 has quit [Remote host closed the connection]
tongcx has left #ruby [#ruby]
boboc has joined #ruby
F1skr has quit [Ping timeout: 248 seconds]
<bnagy>
Azulinho: I switched to trollop years ago and never switched off
vlad_starkov has quit [Remote host closed the connection]
RoxasShadowRS has quit [Read error: Connection reset by peer]
zachallett has quit [Remote host closed the connection]
linojon has quit [Quit: linojon]
SiliconG has joined #ruby
SiliconG has quit [Max SendQ exceeded]
krz has joined #ruby
SiliconG has joined #ruby
SiliconG has quit [Max SendQ exceeded]
shadoi has joined #ruby
jackneill has quit [Quit: WeeChat 0.4.1]
boboc has quit [Ping timeout: 252 seconds]
bricker_ has joined #ruby
RichardRaseley has joined #ruby
charliesome has joined #ruby
DaniG2k has joined #ruby
bricker_ has quit [Client Quit]
roolo has joined #ruby
bklane has joined #ruby
tauebel has joined #ruby
<RichardRaseley>
I downloaded and installed Ruby 1.9.3p484, but my system (CentOS 6.5 x86_64) already had Ruby 1.8.7 installed. The former is in /usr/local/bin while the later is in /usr/bin. When I sudo something it refers to the /usr/bin (old) version, but when I don't it doesn't. What is the proper way to remove the old Ruby version and remove all references to it?
alvaro_o has joined #ruby
<shevy>
RichardRaseley can you also do echo $PATH and show which one comes first
<DaniG2k>
RichardRaseley: you should install it with RVM or something
<RichardRaseley>
shevy: /usr/local/bin
bricker has quit [Ping timeout: 252 seconds]
<shevy>
RichardRaseley that one comes first?
<RichardRaseley>
shevy: Yes.
<shevy>
hmm
mojjojo has quit [Quit: mojjojo]
<shevy>
on my system /usr/bin is arranged before /usr/local/bin
Shidash has quit [Ping timeout: 245 seconds]
alvaro_o has quit [Read error: Connection reset by peer]
<shevy>
RichardRaseley you could try to reshuffle $PATH and run again, "ruby -v" should at least tell you that it changed. also run "gem env"
<shevy>
in both cases and compare the output
<shevy>
you can remove the old version and put a symlink to the removed bin/ruby to the still existing one btw
magoo_ has quit [Quit: WeeChat 0.4.2]
Jonah11_ has quit [Read error: Connection reset by peer]
<shevy>
some distributions are crazy though
F1skr has joined #ruby
alvaro_o has joined #ruby
<shevy>
like put stuff into /usr/lib/ruby, and /usr/local/bin/ruby (!!!)
venkat has joined #ruby
<RichardRaseley>
shevy: So, just modify my user's path to ensure that /usr/local/bin/ruby comes first (the new version)?
Jonah11_ has joined #ruby
<RichardRaseley>
Well, that seems to be the case here - on CentOS.
<bklane>
If I'm trying to store data where it each date has a unique value would a hash be alright? Just unsure how they deal at larger sizes, (hundreds of keys)?
<shevy>
RichardRaseley yes that should work from my experience
<RichardRaseley>
shevy: But /usr/local/bin already comes first. =X
Jdubs has joined #ruby
<shevy>
RichardRaseley why does sudo pick up /usr/bin first then?
<RichardRaseley>
Can I just delete the old version from /usr/bin and symlink to the new one like you suggested?
<bnagy>
RichardRaseley: user path is not the same as root path
Neomex1 has quit [Quit: Neomex1]
<RichardRaseley>
Yes - sudo echo $PATH shows the same layout
<shevy>
RichardRaseley yes, the symlink should work fine. you could make a directory /Backup/ and move the old ruby there
<shevy>
RichardRaseley perhaps the superuser has /usr/bin first
<bnagy>
anyway, you can symlink it in, but if you're going to do that why not just build from source and install with a --prefix
mikecmpbll has quit [Quit: i've nodded off.]
<RichardRaseley>
I did built it from source. I am not sure which --prefix you are referring to...
<bnagy>
with eg perl that would be horribly dangerous, but I doubt centos has any vital system scripts that require ruby, let alone ruby 1.8
<shevy>
there is always a --prefix. if you omit it, it simply defaults to --prefix=/usr/local
Davey_ is now known as Davey
<RichardRaseley>
Ah
<bnagy>
cause otherwise you risk getting mismatched versions of other stuff, like gem, and then you'll go crazy
<shevy>
you will go crazy RichardRaseley!!!
lkba has quit [Ping timeout: 245 seconds]
<RichardRaseley>
Not a long trip
<shevy>
RichardRaseley do "gem --version" too btw
<bnagy>
bklane: if you need fast lookup use a Hash, if you don't care then use an Array
<RichardRaseley>
It usr/local/lib/ruby/1.9.1/yaml.rb:84:in `<top (required)>': It seems your ruby installation is missing psych (for YAML output). To eliminate this warning, please install libyaml and reinstall your ruby. 1.8.23
<bklane>
bnagy: someone said to look into binery trees?
mikepack_ has quit [Remote host closed the connection]
<shevy>
Psych::VERSION # => "1.3.4"
<bklane>
or nodes? unsure exactly how to implement and why one or the other?
sdwrage has joined #ruby
du3nd3 has joined #ruby
robbyoconnor has quit [Ping timeout: 245 seconds]
figgleberry has joined #ruby
aryaching has quit [Ping timeout: 248 seconds]
blackmes1 has quit [Ping timeout: 245 seconds]
notjohn has quit [Quit: notjohn]
mojjojo has joined #ruby
burlyscudd has joined #ruby
<shevy>
RichardRaseley so if my theory is right, you would not have to recompile ruby. after you installed libyaml, you should be able to go into ext/psych and run the extconf.rb file there to generate the Makefile
Bira has quit [Remote host closed the connection]
fedesilva has quit [Remote host closed the connection]
<shevy>
where ext/psych should be in the extracted ruby tarball
<bnagy>
bklane: 80% of the use of btree I have seen was in CS assignments, and 15% was overkill
<bnagy>
what's the actual use case here?
<bklane>
I have properties that have a different rate/availability per date
mojjojo has quit [Client Quit]
<bklane>
and I track past dates so would break it down year/month/day maybe for a tree
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
spider-mario has quit [Ping timeout: 245 seconds]
<bnagy>
why not just have somedate => [property, property...
<bnagy>
dates aren't very big, and the properties would all presumably be refs to some property obj
mikecmpbll has joined #ruby
<RichardRaseley>
shevy: Here is what I did - removed the old ruby, symlinked to the new one installed libyaml-devel, redid the /.configure, make, make install. I still keep getting the error: It seems your ruby installation is missing psych (for YAML output).
<bnagy>
I don't see how a tree does anything but make it slower
<bklane>
bnagy: unsure how Hash's perform with hundreds of keys?
vlad_starkov has joined #ruby
<shevy>
RichardRaseley libyaml-devel is a package from your distro right? that's not what I recommended. :) anyway, if you are sure you have installed libyaml, go into ext/psych and run the extconf.rb there
<bnagy>
...
du3nd3 has quit [Ping timeout: 272 seconds]
<bnagy>
hundreds? Srsly. Lol.
<bklane>
oh I'm doing thousands of properties and each date for them
mojjojo has joined #ruby
mengu has quit [Remote host closed the connection]
<LadyRainicorn>
By hundreds, do you mean hundreds of millions?
<RichardRaseley>
shevy: Sorry, just wanted to use my package manager as much as possible. =X
<shevy>
a million rainbows LadyRainicorn, a million of them
<RichardRaseley>
shevy: OK, makefile created.
<shevy>
RichardRaseley right - why don't you let your package manager give you the latest ruby ;-)
<RichardRaseley>
shevy: It gives me 1.8.7
<shevy>
RichardRaseley yeah, your package manager sucks! try to run "make" now?
<RichardRaseley>
shevy: :: shrugs ::
<bnagy>
centos does actually have a package for nonretarded ruby
onewheelskyward has joined #ruby
<bklane>
LadyRainicorn: bnagy: so I guess just keep it simple and work with the Hash. Only 8 months into coding so still learning around
<bnagy>
it's just fiddly, afair
jkamenik has quit [Quit: Leaving.]
benzrf has left #ruby [#ruby]
<shevy>
and then "make install" and it should work
intuxicated has joined #ruby
<shevy>
do you guys prefer VERSION or Version?
<bnagy>
VERSION
<apeiros>
Version
<bnagy>
^5
<LadyRainicorn>
VERSION
<agent_white>
vERsIon
sparrovv has quit [Remote host closed the connection]
<apeiros>
^5
<centrx>
vErSiOn
<shevy>
hmmmmm
<shevy>
no please
blackmes1 has joined #ruby
<shevy>
centrx you are out!
<apeiros>
I never use FULL_CAP constant names
<RichardRaseley>
shevy: OK, the psych error is now gone. =]
vpretzel has quit [Quit: Adios!]
<LadyRainicorn>
Ruby uses RUBY_VERSION.
<centrx>
SERIOUS
<shevy>
RichardRaseley \o\
ElComradio has quit [Quit: ElComradio]
<agent_white>
centrx: i AgReE wItH yoU
<shevy>
psych uses VERSION
mojjojo has quit [Client Quit]
<bnagy>
constants should be SCREAMING_SNAKE, module names are Constants
<centrx>
agent_white, I aM gLaD! WE wiLL ShoW thEse FOoLs!
<shevy>
agent_white missed you before ... you are out together with centrx!
<RichardRaseley>
shevy: Now if I could remember what I was doing before getting detoured... =P
<bnagy>
so unless Version is a module, VERSION is the one true way and heretics will be burned
<LadyRainicorn>
SCREAMING_SNAKE is an awesome constant.
<agent_white>
centrx: :}
mojjojo has joined #ruby
<shevy>
RichardRaseley pfft ruby works now, you can go back to watching youtube or idle on IRC
avo has joined #ruby
<bnagy>
imvho
<LadyRainicorn>
def VeRsIoN() "1.2.3"; end
avo has quit [Client Quit]
<shevy>
apeiros, I found a dark secret! -> lib/butler/irc/socket.rb: VERSION = "1.0.0"
<shevy>
LadyRainicorn ok it hurts me :( ... but you are out as well now!
Oog has quit [Read error: Connection reset by peer]
nateberkopec has quit [Quit: Leaving...]
musl has quit [Quit: WeeChat 0.4.3-dev]
mansi has joined #ruby
Jetchisel has joined #ruby
Jdubs has quit [Remote host closed the connection]
Naoe-Kanno has joined #ruby
nobitanobi has quit [Ping timeout: 240 seconds]
yfeldblum has joined #ruby
mklappst_ has joined #ruby
iceden has joined #ruby
nobitanobi has joined #ruby
SHyx0rmZ has quit [Ping timeout: 272 seconds]
yfeldblu_ has joined #ruby
Jdubs has joined #ruby
petey_ has quit [Remote host closed the connection]
freerobby has quit [Ping timeout: 272 seconds]
petey has joined #ruby
[gmi] has quit [Read error: Connection reset by peer]
musl has joined #ruby
mansi has quit [Ping timeout: 252 seconds]
vlad_starkov has joined #ruby
cbetta_afk is now known as cbetta
Astralum has quit [Quit: Leaving]
pskosinski has joined #ruby
yfeldblum has quit [Ping timeout: 272 seconds]
Kricir_ has joined #ruby
zachallett has quit [Remote host closed the connection]
Kricir_ has quit [Remote host closed the connection]
rm_ has quit [Read error: Connection reset by peer]
Solnse has joined #ruby
rm_ has joined #ruby
petey has quit [Ping timeout: 252 seconds]
robbyoconnor has quit [Quit: Konversation terminated!]
jgrevich has joined #ruby
silentpost has joined #ruby
<nycjv321>
shevy: I switched to another library and it works
Kricir has quit [Ping timeout: 248 seconds]
<nycjv321>
shevy: funny enough is that other gem supposedly uses this library that I'm now using.. but it doesn't work.. :(
Eiam has quit [Ping timeout: 260 seconds]
daxroc has joined #ruby
duggiefresh has quit [Read error: Connection reset by peer]
zipper{-_-} has quit [Read error: Operation timed out]
joshu has joined #ruby
duggiefresh has joined #ruby
lkba has joined #ruby
duggiefr_ has joined #ruby
DaniG2k has joined #ruby
Pixels_ has joined #ruby
Pixels has quit [Quit: :tiuQ]
Pixels_ is now known as Pixels
<RichardRaseley>
I am writing a basic app with sinatra, when I run this code: https://gist.github.com/richardraseley/8722665 the server starts up and is queryable at the /images route, but the output I get is just a string, not the json that I am expecting. Am I not able to convert a hash to json in the way I am attempting?
mary5030 has joined #ruby
parzo has joined #ruby
Celm has quit [Remote host closed the connection]
<dorei>
json is string
<dorei>
what string does it output?
duggiefresh has quit [Ping timeout: 265 seconds]
<dorei>
hmm
<dorei>
and i dont think you should use print
<dorei>
u should return the whole string at the end of your method
DaniG2k has quit [Ping timeout: 252 seconds]
nobitanobi has quit [Read error: Connection reset by peer]
<RichardRaseley>
"/home/user/packer-resources/images/centos-65-minimal-x86_64.iso" is the string it returns, which is the one file in the directory. I am expecting {"images": "/home/user/packer-resources/images/centos-65-minimal-x86_64.iso"}
xcv has joined #ruby
blandflakes has quit [Quit: Page closed]
b00stfr3ak has quit [Quit: leaving]
zipper{-_-} has joined #ruby
<RichardRaseley>
Or "{"images": ["/home/user/packer-resources/images/centos-65-minimal-x86_64.iso" ] }" rather.
<havenwood>
RichardRaseley: puts `content_type :json` at the top of the method, and call #to_json on what you're returning from the method
<dorei>
RichardRaseley: okie, try returning the string you wish
<havenwood>
put*
Celm has joined #ruby
tauebel has quit [Quit: Leaving.]
<dorei>
RichardRaseley: i think print, puts, etc will print messages to your console/system, not on the web page