Topic for #ruby is now Ruby programming language || ruby-lang.org || RUBY SUMMER OF CODE! rubysoc.org/ || Paste >3 lines of text in http://pastie.org || Para a nossa audiencia em portugues http://ruby-br.org/
dcarper [dcarper!~Adium@c-76-125-233-64.hsd1.pa.comcast.net] has joined #ruby
ColinT [ColinT!~ColinT@69-11-97-130.regn.static.sasknet.sk.ca] has joined #ruby
tvw [tvw!~tv@e176006132.adsl.alicedsl.de] has joined #ruby
mmokrysz [mmokrysz!~mmokrysz@pdpc/supporter/student/mmokrysz] has joined #ruby
<heoa> how can I return many vals from checkbox? params['post']['issue'] does not work, l30: https://bitbucket.org/heoa/sinatra-testing/src/a290087045ec/app.rb
<heoa> it returns only one val
<apeiros_> heoa: the part that matters for that is your form
<apeiros_> or rather, the name of the field/fields
<apeiros_> should be probably be 'post[issue][]'
<apeiros_> also, "from checkbox"? *one* checkbox will at max return *one* value.
<apeiros_> also remember, unchecked checkboxes don't get transmitted at all.
<heoa> ? I want a checkbox that can return large number of vals...
<heoa> at the same time
<heoa> apeiros_: so you mean I should sanitise the thing?
<apeiros_> no, you want multiple checkboxes with the same name. that's what you've got too.
<apeiros_> and the solution is most likely what I already said.
mmokrysz [mmokrysz!~mmokrysz@pdpc/supporter/student/mmokrysz] has quit [#ruby]
ph^ [ph^!~ph^@cm-84.212.225.74.getinternet.no] has joined #ruby
vagabond007 [vagabond007!~vbond007@unaffiliated/vagabond007] has joined #ruby
<vagabond007> sup
<vagabond007> haven't coded ruby since 05, ruby 2 out yet? hehehe
<banisterfiend> vagabond007: ruby 1.9.3 is out and it's pretty sexy
<vagabond007> any of you guys have the campaign edition of Civ 5 from MAS?
tdubellz [tdubellz!~tdubellz@freenode/staff/tdubellz] has joined #ruby
<tdubellz> vagabond007: mind a pm?
<vagabond007> no
<vagabond007> pm away
Marco___ [Marco___!~marco@c-98-254-52-240.hsd1.fl.comcast.net] has joined #ruby
conor_ireland_ [conor_ireland_!~conor_ire@89.100.121.49] has joined #ruby
<heoa> apeiros_: wrong number of arguments (0 for 1)
<apeiros_> heoa: and by what kind of magic do you think I could/should infer where or what is happening?
mfridh [mfridh!~mikaelf@pdpc/supporter/active/roksteady] has joined #ruby
<heoa> post['toWhom'][] returns just one instead of many (even though selected many)
jimmy1980 [jimmy1980!~jimmy@112.224.2.116] has joined #ruby
<apeiros_> …
<apeiros_> heoa: as I said, what matters is *not the code* but the *form name*
vagabond007 [vagabond007!~vbond007@unaffiliated/vagabond007] has quit [#ruby]
<apeiros_> err, s/form/field/
<apeiros_> you have to change in the html, not in the ruby code.
mfridh [mfridh!~RokSteady@pdpc/supporter/active/roksteady] has joined #ruby
<apeiros_> heoa: also, there are paste services without ads, like gist or pastie
incorrect [incorrect!~francis@cpc7-cmbg14-2-0-cust43.5-4.cable.virginmedia.com] has quit ["Leaving"]
wmoxam [wmoxam!~wmoxam@69-196-129-140.dsl.teksavvy.com] has joined #ruby
wmoxam [wmoxam!~wmoxam@pdpc/supporter/active/wmoxam] has joined #ruby
jbw [jbw!~jbw@dsl-044-084.cust.imagine.ie] has joined #ruby
<shevy> pastebin is also visually displeasing. pastie.org is nicer on the eyes
countskm [countskm!~countskm@pool-108-9-189-75.tampfl.fios.verizon.net] has joined #ruby
Indian [Indian!~Indian@unaffiliated/londonmet050] has joined #ruby
andrewhl [andrewhl!~andrew@24-246-15-43.cable.teksavvy.com] has joined #ruby
Sailias [Sailias!~jonathan@CPE0018f85e576d-CM001bd7aaaf96.cpe.net.cable.rogers.com] has joined #ruby
<heoa> apeiros_: http://pastie.org/2998280 <-- returns none, meant this?
looopy [looopy!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby
<apeiros_> heoa: what do you mean, "returns none"?
jimmy1980 [jimmy1980!~jimmy@112.224.2.116] has joined #ruby
<heoa> apeiros_: good question, your suggestion does return as intended but the err is in handling, probably l30 https://bitbucket.org/heoa/sinatra-testing/src/a290087045ec/app.rb
<apeiros_> heoa: you speak in riddles
<heoa> the err is in types
<apeiros_> "the err"
<heoa> [params['post']['toWhom'], params['post']['issue']] <--- some structures, have to investigate the data types
berserkr [berserkr!~david@212.122.111.205.dyn.user.ono.com] has joined #ruby
<heoa> I checked with puts that it returns the correct but it apparently returns in wrong data type
<apeiros_> puts is not a suitable tool to inspect datastructures.
<apeiros_> also, you're horrible at describing both, your problem and what you want
<apeiros_> you did not answer my question ("returns none"), you did not state what "the err" is, you did not state what datastructure you got, you did not state what datastructure you expected, you did not state upon what input that happened
<apeiros_> that's quite a lot of gaping holes…
<heoa> apeiros_: 'returns none' was false statement
<heoa> err is
<heoa> checked it with puts
<apeiros_> "it"…
<heoa> ...now searching for command to check the data structures, new with ruby...
<apeiros_> p obj
<blueadept> what's a good way of cycling through two variables in a loop?
<apeiros_> or: puts obj.inspect
<blueadept> like pass 1 is var1, pass 2 is var2, pass3 is var1, pass4 is var2
<blueadept> set the variable again right before the loop ends?
<blueadept> hm, that wont work
<apeiros_> blueadept: what are you trying to achieve?
<blueadept> trying to set a class for a row
<blueadept> like row 1 is grey, row 2 is white, row 3 is grey, row 4 is white
<apeiros_> blueadept: rails?
<blueadept> wait i think i got it
<blueadept> % 2
_debo [_debo!~marco.deb@cpc18-enfi16-2-0-cust743.hari.cable.virginmedia.com] has joined #ruby
QaDeS [QaDeS!~mklaus@frbg-5d84f61c.pool.mediaWays.net] has joined #ruby
Sailias [Sailias!~jonathan@CPE0018f85e576d-CM001bd7aaaf96.cpe.net.cable.rogers.com] has joined #ruby
r0bby_ [r0bby_!~wakawaka@guifications/user/r0bby] has joined #ruby
jimmy1980 [jimmy1980!~jimmy@112.224.2.116] has joined #ruby
looopy [looopy!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby
vitoravelino [vitoravelino!~rockhampt@unaffiliated/vtr] has joined #ruby
akem [akem!~akem@156.236.84.79.rev.sfr.net] has joined #ruby
akem [akem!~akem@unaffiliated/akem] has joined #ruby
Pip [Pip!~Pip@host-85-156-66-217.spbmts.ru] has joined #ruby
Pip [Pip!~Pip@unaffiliated/pip] has joined #ruby
etdebruin [etdebruin!~luclouvre@ip68-101-242-65.sd.sd.cox.net] has joined #ruby
mickn [mickn!~mickn@unaffiliated/mickn] has joined #ruby
kaktus [kaktus!~kaktus@tyr.rstack.cc] has quit [#ruby]
jimmy1980 [jimmy1980!~jimmy@112.224.2.116] has joined #ruby
<heoa> puts("#tyhmaah"+params['post']['issue']) does not run when params returns nothing, why?
<heoa> "#tyhmaah"+[] <--- it works but the last one does not. So the last one must be something odd, investigating..
<apeiros_> heoa: puts prints, it doesn't return. also, as I said before, puts is a bad tool to inspect, use obj.inspect or p
<apeiros_> e.g.: p params['post']['issue']
<apeiros_> also, "#tyhmaah"+[] most certainly does *not* work.
<apeiros_> (unless you redefined String#+, which I hope you did not…)
ggtoo [ggtoo!~ggtoo@122.178.0.116] has joined #ruby
asdfgbdes [asdfgbdes!birds@151.83.73.83] has joined #ruby
_debo [_debo!~marco.deb@cpc18-enfi16-2-0-cust743.hari.cable.virginmedia.com] has joined #ruby
dagnachewa [dagnachewa!~dagnachew@modemcable142.238-179-173.mc.videotron.ca] has joined #ruby
apeiros_ [apeiros_!~apeiros@77-58-115-24.dclient.hispeed.ch] has joined #ruby
jetblack [jetblack!~jetblack@99-32-20-118.uvs.evtnil.sbcglobal.net] has joined #ruby
jbrokc [jbrokc!~jbrokc@c-98-228-139-230.hsd1.il.comcast.net] has joined #ruby
<jbrokc> is there a cool way to shorten var files = %w[app/modules/*.rb app/fixtures/*.rb app/helpers/*.rb] or that is, make the 'app/' part not repeat between each entry in the array (yet still be added as the value)
QaDeS_ [QaDeS_!~mklaus@frbg-5d84e0e6.pool.mediaWays.net] has joined #ruby
tvw [tvw!~tv@e176007247.adsl.alicedsl.de] has joined #ruby
Targen [Targen!~iguana@190.39.181.108] has joined #ruby
kennethreitz [kennethreitz!~kennethre@c-24-127-96-129.hsd1.va.comcast.net] has joined #ruby
jimmy1980 [jimmy1980!~jimmy@112.224.2.116] has joined #ruby
<WhiteHorse> does anyone have statistics about the usage of ruby vs python?
<DeeJayTwo> When we're talking about a ruby method...
<DeeJayTwo> I often see Class#method notation...
<DeeJayTwo> is it the standard way or is it possible to refer to it as Class.method ?
<DeeJayTwo> has the # a special meaning?
<samuelkadolph> DeeJayTwo: # usually means an instance method
<samuelkadolph> DeeJayTwo: So it would be Class.new.method and not Class.method
<DeeJayTwo> I see
<DeeJayTwo> class.method would be some kind of static method ?
<samuelkadolph> Class.method would be a class method on Class
<DeeJayTwo> ok
<DeeJayTwo> Thank you for the "clarification"
dbgster_ [dbgster_!~dbgster@CPE0013f7b7170c-CM0013f7b71708.cpe.net.cable.rogers.com] has joined #ruby
jbrokc [jbrokc!~jbrokc@c-98-228-139-230.hsd1.il.comcast.net] has quit [#ruby]
Taos [Taos!~jakob@host-92-20-152-142.as13285.net] has quit [#ruby]
JakeyChan [JakeyChan!~JakeyChan@ec2-175-41-238-53.ap-northeast-1.compute.amazonaws.com] has joined #ruby
<DeeJayTwo> Do I understand that when I can call a method ending with a ?, it means it returns a boolean?
jimmy1980 [jimmy1980!~jimmy@112.224.2.116] has joined #ruby
burgestrand [burgestrand!~burgestra@h-163-174.a155.priv.bahnhof.se] has joined #ruby
JakeyChan_ [JakeyChan_!~JakeyChan@114.92.5.127] has joined #ruby
dagnachewa [dagnachewa!~dagnachew@modemcable142.238-179-173.mc.videotron.ca] has joined #ruby
<dagnachewa> gem install sciruby
<dagnachewa> Building native extensions. This could take a while...
<dagnachewa> ERROR: Error installing sciruby:
Indian [Indian!~Indian@unaffiliated/londonmet050] has joined #ruby
<dagnachewa> ERROR: Failed to build gem native extension.
<WhiteHorse> after installing rubygems i do: gem -v I get this:
<WhiteHorse> F:\Ruby192\bin\ruby.exe: No such file or directory -- /f/Ruby192/bin/gem (LoadError)
techhelp [techhelp!~Dan@ip70-162-129-93.ph.ph.cox.net] has joined #ruby
<WhiteHorse> in cygwin
<WhiteHorse> any idea why?
<bratsche> which ruby
<WhiteHorse> $ ruby -v
<WhiteHorse> ruby 1.9.2p290 (2011-07-09) [i386-mingw32]
<WhiteHorse> inside cygwin
looopy [looopy!~looopy@pool-141-156-48-174.washdc.btas.verizon.net] has joined #ruby
<bratsche> Type "which ruby"
<WhiteHorse> \/f\/Ruby192\/bin\/ruby
<WhiteHorse> lol
<WhiteHorse> trying to scape those
<davidcelis> what..
<bratsche> It's been too long since I used cygwin. Once I learned how to cross-compile my shit from Linux, I dumped Cygwin as fast as I could.
raythecat [raythecat!~raythecat@cpe-66-27-147-33.socal.res.rr.com] has joined #ruby
<bratsche> I hates it, my precious.
<WhiteHorse> i think the problem is maybe cause i mess with the fstab file
<dagnachewa> gem install sciruby
<dagnachewa> Building native extensions. This could take a while...
<dagnachewa> ERROR: Error installing sciruby:
<dagnachewa> ERROR: Failed to build gem native extension.
<bratsche> dagnachewa: What platform?
<dagnachewa> linux
<dagnachewa> hello bratsche
<bratsche> Ubuntu or some other?
<dagnachewa> bratsche, some other "archlinux"
looopy [looopy!~looopy@pool-141-156-48-174.washdc.btas.verizon.net] has joined #ruby
jonathanrwallace [jonathanrwallace!~jonathanr@99-11-165-168.lightspeed.tukrga.sbcglobal.net] has joined #ruby
kartouch [kartouch!~kartouch@kartouch.ic-clear.eu] has joined #ruby
<bratsche> dagnachewa: Maybe silly question, but do you have basic developer tools packages installed?
<bratsche> I'm not familiar with archlinux, but basically the equivalent of Debian/Ubuntu's build-essential package?
<dagnachewa> yep
<dagnachewa> gsl installed but there are not gsl-devel in archlinux
<bratsche> Does the output say where the errors are logged to?
<bratsche> Usually it should say something like "results logged to" and give you a filename.
<dagnachewa> /usr/lib/ruby/gems/1.9.1/gems/gsl-1.14.7/ext/gem_make.out
<bratsche> Does that give you any hints about what failed to build or why?
<bratsche> Throw it up on pastebin if you'd like.
<bratsche> Kind of looks like maybe it's expecting a different version of gsl.
<bratsche> You may need to do some hacking on the source to this gem.
<bratsche> It looks like matrix_complex.c is using (or has defined) a different version of gsl_matrix_complex_equal
JakeyChan [JakeyChan!~JakeyChan@ec2-175-41-238-53.ap-northeast-1.compute.amazonaws.com] has joined #ruby
jamnew [jamnew!~jamnew@eth12849.sa.adsl.internode.on.net] has joined #ruby
<dagnachewa> ok
<dagnachewa> bratsche, thanks a lot for your time
looopy [looopy!~looopy@pool-141-156-48-174.washdc.btas.verizon.net] has joined #ruby
michael_mbp [michael_mbp!~Marin@112.134.194.187] has joined #ruby
Sailias [Sailias!~jonathan@CPE0018f85e576d-CM001bd7aaaf96.cpe.net.cable.rogers.com] has joined #ruby
techhelp [techhelp!~Dan@ip70-162-10-229.ph.ph.cox.net] has joined #ruby
looopy_ [looopy_!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby
LittleBill902 [LittleBill902!smith@c-71-197-103-184.hsd1.ca.comcast.net] has joined #ruby
radic [radic!~radic@dslb-094-216-229-166.pools.arcor-ip.net] has joined #ruby
bwlang [bwlang!~anonymous@static-71-245-233-146.bstnma.fios.verizon.net] has joined #ruby
Draco_ [Draco_!~draco@dsl-69-171-130-117.acanac.net] has joined #ruby
masom [masom!~masom@modemcable005.180-130-66.mc.videotron.ca] has joined #ruby
<masom> hello, is there a way to rescue mulitple exceptions on one rescue line?
nerdy_ [nerdy_!~textual@66-44-118-195.c3-0.grg-ubr1.lnh-grg.md.cable.rcn.com] has joined #ruby
<samuelkadolph> masom: You can rescue multiple types of exceptions: rescue A, B, C => e
<masom> samuelkadolph: awesome. Trying to find up to date docs on google about this is painful
nclx [nclx!~matt@208.88.124.211] has joined #ruby
jimmy1980 [jimmy1980!~jimmy@112.224.2.116] has joined #ruby
x0F_ [x0F_!~x0F@unaffiliated/x0f] has joined #ruby
nerdy_ [nerdy_!~textual@66-44-118-195.c3-0.grg-ubr1.lnh-grg.md.cable.rcn.com] has joined #ruby
<nclx> Can a module contain the definition for a class method?
JakeyChan [JakeyChan!~JakeyChan@114.92.5.127] has joined #ruby
esparkman [esparkman!~esparkman@unaffiliated/esparkman] has joined #ruby
JakeyChan_ [JakeyChan_!~JakeyChan@ec2-175-41-238-53.ap-northeast-1.compute.amazonaws.com] has joined #ruby
jimmy1980 [jimmy1980!~jimmy@112.224.2.116] has joined #ruby
brownies [brownies!~brownies@unaffiliated/brownies] has joined #ruby
<banisterfiend> nclx: Yes
Cervajz [Cervajz!~Cervajz@opensuse/member/Cervajz] has joined #ruby
<nclx> banisterfiend: what am I doing wrong, I can't seem to get the syntax correct: http://pastebin.com/PxVpTWzm
<banisterfiend> nclx: no, like this:
<banisterfiend> one sec
<nclx> banisterfiend: so include is for instance methods and extend is for class methods?
<banisterfiend> nclx: include brings the modules methods in as instance methods, yes, and extend brings the modules methods in as class method
<banisterfiend> however, the class methods defined on the module itself -- a la: module M; def self.hello; end; end are completely inaccessible to the class that includes/extends it
jonathanrwallace [jonathanrwallace!~jonathanr@99-11-165-168.lightspeed.tukrga.sbcglobal.net] has joined #ruby
p1d [p1d!~p1d@dslb-088-064-144-058.pools.arcor-ip.net] has joined #ruby
jimmy1980 [jimmy1980!~jimmy@112.224.2.9] has joined #ruby
kennethreitz [kennethreitz!~kennethre@c-24-127-96-129.hsd1.va.comcast.net] has joined #ruby
tyman [tyman!~tyman@173-12-219-189-Fresno.hfc.comcastbusiness.net] has joined #ruby
twogateproxy [twogateproxy!~twogatepr@173-228-28-38.dsl.dynamic.sonic.net] has joined #ruby
<twogateproxy> Hi, anybody know why this just hangs for me? imap = Net::IMAP.new('imap.gmail.com')
failshell [failshell!~failshell@modemcable237.159-58-74.mc.videotron.ca] has joined #ruby
nanoyak [nanoyak!~nanoyak@adsl-69-110-22-115.dsl.pltn13.pacbell.net] has joined #ruby
<failshell> Im using the following file in sinatra. but during the post, if the variable is empty, it goes straight to sleep, and never goes to the other view. any idea how to fix it? https://github.com/failshell/columbo/blob/master/app.rb
Sliker [Sliker!~ponies@117.163.pn.adsl.brightview.com] has joined #ruby
rvmeier [rvmeier!~rodrigo@pc-136-172-241-201.cm.vtr.net] has joined #ruby
brweber2 [brweber2!~brweber2@ip68-100-25-226.dc.dc.cox.net] has joined #ruby
Mohan [Mohan!~nixh0st@unaffiliated/mohan] has joined #ruby
CppIsWeird [CppIsWeird!~user@pool-96-248-209-239.nrflva.fios.verizon.net] has joined #ruby
NinoScript [NinoScript!~Adium@pc-55-124-83-200.cm.vtr.net] has joined #ruby
tyler [tyler!~tyman@173-12-219-189-Fresno.hfc.comcastbusiness.net] has joined #ruby
kennethreitz [kennethreitz!~kennethre@c-24-127-96-129.hsd1.va.comcast.net] has joined #ruby
h4mz1d [h4mz1d!~hamfz@c-69-244-5-169.hsd1.al.comcast.net] has joined #ruby
s14 [s14!~nick@ool-18b934ee.dyn.optonline.net] has joined #ruby
raythecat [raythecat!~raythecat@cpe-66-27-147-33.socal.res.rr.com] has joined #ruby
Targen [Targen!~iguana@190.39.181.108] has joined #ruby
failshell [failshell!~failshell@modemcable237.159-58-74.mc.videotron.ca] has quit ["Leaving"]
jimmy1980 [jimmy1980!~jimmy@112.224.2.9] has joined #ruby
samuelk|away [samuelk|away!~samuelkad@unaffiliated/samuelkadolph] has joined #ruby
perryh_ [perryh_!~root@far3567.urh.uiuc.edu] has joined #ruby
perryh_ [perryh_!~root@unaffiliated/perry753] has joined #ruby
mikepack [mikepack!~mikepack@c-174-51-77-22.hsd1.co.comcast.net] has joined #ruby
igotnolegs [igotnolegs!~igotnoleg@174-27-220-21.slkc.qwest.net] has joined #ruby
saschaheylik [saschaheylik!~sascha@80-121-34-26.adsl.highway.telekom.at] has joined #ruby
wmoxam_ [wmoxam_!~wmoxam@69-196-129-140.dsl.teksavvy.com] has joined #ruby
NinoScript [NinoScript!~Adium@pc-55-124-83-200.cm.vtr.net] has quit [#ruby]
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby
apucacao [apucacao!~apucacao@S0106602ad075859e.vc.shawcable.net] has joined #ruby
rpowell [rpowell!~rpowell@CPE-121-217-11-112.lnse1.cht.bigpond.net.au] has joined #ruby
Draco_ [Draco_!~draco@dsl-69-171-130-117.acanac.net] has joined #ruby
LittleBill902 [LittleBill902!smith@c-71-197-103-184.hsd1.ca.comcast.net] has joined #ruby
nanoyak [nanoyak!~nanoyak@173-228-119-246.dsl.dynamic.sonic.net] has joined #ruby
frogstarr78 [frogstarr78!~frogstarr@lan.viviotech.net] has joined #ruby
Cyrus [Cyrus!~Cyrus@cpe-173-173-106-235.satx.res.rr.com] has joined #ruby
Cyrus [Cyrus!~Cyrus@unaffiliated/cyrus] has joined #ruby
eldariof [eldariof!~CLD@81.200.24.179] has joined #ruby
jrist-afk [jrist-afk!~jrist@184-96-215-133.hlrn.qwest.net] has joined #ruby
ghosTM55 [ghosTM55!~user@li279-245.members.linode.com] has joined #ruby
wedgeV [wedgeV!~wedge@cpe-68-173-18-241.nyc.res.rr.com] has joined #ruby
raythecat [raythecat!~raythecat@cpe-66-27-147-33.socal.res.rr.com] has joined #ruby
Cyrus_ [Cyrus_!~Cyrus@cpe-173-173-106-235.satx.res.rr.com] has joined #ruby
Cyrus [Cyrus!~Cyrus@unaffiliated/cyrus] has joined #ruby
haiwu [haiwu!~haiwu@c-24-12-72-214.hsd1.il.comcast.net] has joined #ruby
Skaag [Skaag!~skaag@107.58.238.186] has joined #ruby
Guest84839 [Guest84839!~root@c-24-12-72-214.hsd1.il.comcast.net] has joined #ruby
rippa [rippa!~rippa@109-161-74-125.pppoe.yaroslavl.ru] has joined #ruby
qKer^ [qKer^!~qker@61.227.38.86.ip.erdves.lt] has joined #ruby
qKer^ [qKer^!~qker@61.227.38.86.ip.erdves.lt] has quit [#ruby]
PhilK [PhilK!~PhilK@2001:470:1f05:c99:21f:d0ff:fe84:e3ca] has joined #ruby
xpot [xpot!~xpot@166-70-100-198.ip.xmission.com] has joined #ruby
jimmy1980 [jimmy1980!~jimmy@112.224.2.9] has joined #ruby
maletor [maletor!~maletor@c-69-181-28-195.hsd1.ca.comcast.net] has joined #ruby
mxweas_ [mxweas_!~max@c-24-7-45-147.hsd1.ca.comcast.net] has joined #ruby
Amirh [Amirh!~amir@2.181.24.15] has joined #ruby
andrewhl [andrewhl!~andrew@24-246-15-43.cable.teksavvy.com] has quit [#ruby]
andrewhl [andrewhl!~andrew@24-246-15-43.cable.teksavvy.com] has joined #ruby
asQuirreL [asQuirreL!~amenon@93-96-10-147.zone4.bethere.co.uk] has joined #ruby
elliot98 [elliot98!~elliot@77.125.7.231] has joined #ruby
elliot98 [elliot98!~elliot@unaffiliated/elliot98] has joined #ruby
Tuxist [Tuxist!~quassel@host-091-097-109-095.ewe-ip-backbone.de] has joined #ruby
ggtoo [ggtoo!~ggtoo@122.164.89.24] has joined #ruby
Seisatsu [Seisatsu!~seisatsu@2001:5c0:1000:a::a1] has joined #ruby
manizzle [manizzle!~manizzle@adsl-99-102-133-31.dsl.pltn13.sbcglobal.net] has joined #ruby
Cervajz [Cervajz!~Cervajz@opensuse/member/Cervajz] has joined #ruby
Pip [Pip!~Pip@unaffiliated/pip] has joined #ruby
stayarrr [stayarrr!~olivererx@dslb-178-009-059-241.pools.arcor-ip.net] has joined #ruby
looopy [looopy!~looopy@pool-141-156-48-174.washdc.btas.verizon.net] has joined #ruby
looopy_ [looopy_!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby
Asher [Asher!~asher@98.158.127.150] has joined #ruby
smgt [smgt!~simon@76.156.216.81.static.m-dp.siw.siwnet.net] has joined #ruby
ph^ [ph^!~ph^@cm-84.212.225.74.getinternet.no] has joined #ruby
lkba [lkba!~AndChat@aaqo61.neoplus.adsl.tpnet.pl] has joined #ruby
mxweas_ [mxweas_!~max@c-24-7-45-147.hsd1.ca.comcast.net] has joined #ruby
altivec_ [altivec_!~altivec@46.191.235.89] has joined #ruby
yxhuvud [yxhuvud!mongo@h-17-224.a149.priv.bahnhof.se] has joined #ruby
ghosTM55 [ghosTM55!~user@li279-245.members.linode.com] has joined #ruby
NinoScript [NinoScript!~Adium@pc-55-124-83-200.cm.vtr.net] has joined #ruby
adambeynon [adambeynon!~adambeyno@82-69-1-211.dsl.in-addr.zen.co.uk] has joined #ruby
TheTFEF [TheTFEF!JS@cpe-173-88-110-115.columbus.res.rr.com] has joined #ruby
adambeynon [adambeynon!~adambeyno@82-69-1-211.dsl.in-addr.zen.co.uk] has joined #ruby
apok [apok!~apok@96.24.67.22] has joined #ruby
jimmy1980 [jimmy1980!~jimmy@112.224.2.9] has joined #ruby
bosphorus [bosphorus!~bosphorus@85.96.60.119] has joined #ruby
asQuirreL [asQuirreL!~amenon@93-96-10-147.zone4.bethere.co.uk] has joined #ruby
pantsman [pantsman!~pantsman@2.25.208.217] has joined #ruby
pantsman [pantsman!~pantsman@pdpc/supporter/active/pantsman] has joined #ruby
Indian [Indian!~Indian@unaffiliated/londonmet050] has joined #ruby
dr_bob [dr_bob!~dr_bob@p5DC4F7B7.dip.t-dialin.net] has joined #ruby
mxweas_ [mxweas_!~max@c-24-7-45-147.hsd1.ca.comcast.net] has joined #ruby
MrCheetoDust [MrCheetoDust!~farhankha@cpe-76-94-123-32.socal.res.rr.com] has joined #ruby
apeiros_ [apeiros_!~apeiros@77-58-115-24.dclient.hispeed.ch] has joined #ruby
<banisterfiend> lol http://www.ashleymadison.com/
RomD [RomD!~Roman@nrbg-d932340b.pool.mediaWays.net] has joined #ruby
frode15243 [frode15243!~frode1524@pdpc/supporter/active/frode15243] has joined #ruby
havenn [havenn!~skipper@pool-72-67-31-69.lsanca.fios.verizon.net] has joined #ruby
tvo [tvo!~tvo@5354CF57.cm-6-5d.dynamic.ziggo.nl] has joined #ruby
tvo [tvo!~tvo@katapult/developer/tvo] has joined #ruby
catphish [catphish!~charlie@2001:9d8:2005:12::3] has joined #ruby
<catphish> does #finalize get called automatically? and if so, when?
<apeiros_> catphish: automatically. undetermined.
<catphish> undetermined?
<apeiros_> it can be at any time or not at all.
<catphish> ok, not enormously useful then>
<catphish> *?
<catphish> what would cause it to get run? an instance being detected during a GC?
<apeiros_> I think using finalizers is generally discouraged for that reason
<apeiros_> theoretically they'd be invoked upon GC
<catphish> ok
jimmy1980 [jimmy1980!~jimmy@112.224.3.99] has joined #ruby
<catphish> someone's written one in a library to close a tcp connection, but it basically never gets called
<catphish> so using the code in a web app simply caused an increasing number of connections
<catphish> i'll rework it to do something sane
<apeiros_> hm, useless I think. afaik ruby closes connections on its own upon GC anyway.
<catphish> it's not a ruby socket connection, its in a FFI library, which is why they added
<catphish> it, but it doesn't work well
<apeiros_> ah
<catphish> will just rewrite my app to close it manually
<catphish> i tried making it persist, but thats not reliable enough
<catphish> and in this case the establishment time is negligible
<catphish> thanks :)
fermo [fermo!~fermo@ppp-94-29.26-151.libero.it] has joined #ruby
Amirh [Amirh!~amir@2.181.24.15] has joined #ruby
Cervajz [Cervajz!~Cervajz@opensuse/member/Cervajz] has joined #ruby
Jrz [Jrz!~jrz@d152222.upc-d.chello.nl] has joined #ruby
Marcio [Marcio!~Marcio@80.251.169.199] has joined #ruby
ph^ [ph^!~ph^@cm-84.212.225.74.getinternet.no] has joined #ruby
apok [apok!~apok@96.24.67.22] has joined #ruby
<shevy> dumdedum
looopy [looopy!~looopy@pool-141-156-48-174.washdc.btas.verizon.net] has joined #ruby
p0y [p0y!~p0y@121.97.59.227] has joined #ruby
Pip [Pip!~Pip@host-87-156-66-217.spbmts.ru] has joined #ruby
Pip [Pip!~Pip@unaffiliated/pip] has joined #ruby
Hellojere [Hellojere!~Hellojere@89.7.90.160] has joined #ruby
RichGuk [RichGuk!~RichGuk@carina.27smiles.com] has joined #ruby
ChampS_ [ChampS_!~ChampS@p57953654.dip.t-dialin.net] has joined #ruby
_debo [_debo!~marco.deb@cpc18-enfi16-2-0-cust743.hari.cable.virginmedia.com] has joined #ruby
looopy_ [looopy_!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby
Manhose [Manhose!~Manhose@bl18-45-1.dsl.telepac.pt] has joined #ruby
ikaros [ikaros!~ikaros@dslb-084-059-073-057.pools.arcor-ip.net] has joined #ruby
<shevy> ok so let's collect wisdom
<shevy> what are good ways to avoid bugs?
jgrimes [jgrimes!~jg@cpe-071-070-140-012.nc.res.rr.com] has joined #ruby
niklasb [niklasb!~codeslay0@p5B3115CA.dip0.t-ipconnect.de] has joined #ruby
<musee> don't write code
jgrimes [jgrimes!~jg@cpe-071-070-140-012.nc.res.rr.com] has joined #ruby
<apeiros_> pretend they're features (aka "the MS way")
<musee> lol
rushed [rushed!~rushed@cpe-70-116-11-35.austin.res.rr.com] has quit [#ruby]
jgrimes [jgrimes!~jg@cpe-071-070-140-012.nc.res.rr.com] has joined #ruby
jgrimes [jgrimes!~jg@cpe-071-070-140-012.nc.res.rr.com] has joined #ruby
<shevy> hmm
<shevy> no no no
<shevy> I need better ways
fridim_ [fridim_!~fridim@2a01:e35:2ece:f2d0:223:4eff:fe6c:c754] has joined #ruby
<Asher> use unit tests to do behavior-based development and ensure that your existing code works as expected
<Mon_Ouie> Assume you have a method def square(x); x + x; end — your test suite indicate this works: assert_equal square(2), 4
<shevy> hmm unit test
<shevy> that's the first suggestion I can see being potentially good
<Mon_Ouie> But you notice it fails in some special cases like x = 1, just do this: if x == 1; 1; else; x + x;end
<shevy> that sounds very bad
<shevy> that sounds like "add one bug to fix another bug"
<shevy> Asher, I am going to use unit tests from now on
mmokrysz [mmokrysz!~mmokrysz@pdpc/supporter/student/mmokrysz] has joined #ruby
<Asher> once you learn how to write tests as part of the process of development you will never turn back
<Asher> it reduces so much insanity by proving that your code still does what you think
<banisterfiend> Asher: do you write tests first
<shevy> yeah sometimes my code surprises me
<shevy> especially when I wrote it years ago
<Asher> banisterfiend - no i diagram and write descriptions of what i want to achieve, lay out the module/class hierarchy and interfaces, sketch out a basic implementation, then write tests to prove that my implementation does what i planned before i move on to other steps
<Asher> i find that writing tests first is too low-level to help me think about my implementation
looopy [looopy!~looopy@pool-141-156-48-174.washdc.btas.verizon.net] has joined #ruby
<Asher> but i think about design in terms of interface dynamics
<banisterfiend> i write a mixture of test first/test after
<Asher> so i lay out the interface dynamics first
<banisterfiend> i might implement some features first, then write tests for them, then in the process of writing the tests for the code that exists i may write a few other tests for code that i haven't yet written
<Asher> then i write tests per file outside of the context they're used
<Asher> and i often go back and rewrite the tests later
<banisterfiend> Asher: what testing lib do u use
Morkel [Morkel!~Morkel@xdsl-87-78-205-136.netcologne.de] has joined #ruby
<Asher> rspec but only b/c that's the only one i've seen a decent textmate bundle for
<Asher> eventually i will use something more appropriate than rspec
Clooth [Clooth!~Clooth@193-64-22-91-nat.elisa-mobile.fi] has joined #ruby
JakeyChan [JakeyChan!~JakeyChan@180.172.203.109] has joined #ruby
looopy_ [looopy_!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby
tvw [tvw!~tv@e176007247.adsl.alicedsl.de] has joined #ruby
<Asher> i tend to work on code in large strokes and then use the tests to hone in on details
p0y [p0y!~p0y@121.97.59.227] has joined #ruby
jgrimes [jgrimes!~jg@cpe-071-070-140-012.nc.res.rr.com] has joined #ruby
Telling [Telling!Telling@do.it.and.undo.it] has joined #ruby
jgrimes [jgrimes!~jg@cpe-071-070-140-012.nc.res.rr.com] has joined #ruby
<catphish> shevy: the best way to avoid bugs IMO is to try to think of bugs in every line you write and test them mentall
<Asher> that turns into spaghetti pretty quickly
apok [apok!~apok@96.24.67.22] has joined #ruby
<catphish> i think through everything before writing it
<Asher> eventually you will write an application big enough you can't think it all at once
<catphish> but if you can't do that, unit tests i guess
<Asher> i'm certainly not discouraging trying to think through all of it :)
<catphish> of course small methods are good
<catphish> everything can be tested individually
<Asher> small methods make testing easier too
Pip [Pip!~Pip@host-87-156-66-217.spbmts.ru] has joined #ruby
Pip [Pip!~Pip@unaffiliated/pip] has joined #ruby
<banisterfiend> small methods + small classes + a pure heart
<banisterfiend> but you want want everything too open and airy
<apeiros> KISS & normalization are a great way to keep bugs out too
<Asher> open and airy?
<banisterfiend> you want some nooks and crannies in your code, Mon_Ouie also keeps an area of his code particularly complicated and whenever he visits it it evokes feelings of a dusty hallway with an old fashioned green telephone
<Asher> hahah
iocor [iocor!~textual@unaffiliated/iocor] has joined #ruby
<shevy> I wanna see a screencast of Mon_Ouie coding
Hellojere [Hellojere!~Hellojere@89.7.90.160] has joined #ruby
chilversc [chilversc!~chris@about/csharp/regular/KeeperOfTheSoul] has joined #ruby
marvelous [marvelous!~batman@g224228038.adsl.alicedsl.de] has joined #ruby
Manhose_ [Manhose_!~Manhose@bl18-45-1.dsl.telepac.pt] has joined #ruby
<banisterfiend> using the new and fabulous 'gist -i' pry command ;)
<Asher> nice
<Asher> why would you want to return the method instance if no block is given?
<banisterfiend> so i can chain it with: a * b
<banisterfiend> without having to do shit like: method(:a) * method(:b)
<Asher> where does * come from for method instance
<banisterfiend> Asher: it's deifned in that gist
<banisterfiend> atth etop
<Asher> h i see
<Asher> oh i see
<Asher> nice
<banisterfiend> it's only useful for a certain kind of method, not a general solution
<Asher> it's neat i'm not sure it's useful
<banisterfiend> but it works for the kind of little wrapper methods i want to compose
<Asher> but you never know until you let it wreak havoc on your brain for a while
<banisterfiend> it's useful for me: cos i was doing a lot fo this crap: no_pager { no_color { ...code... } }
<Asher> cool
ognevsky [ognevsky!~ognevsky@27-214-94-178.pool.ukrtel.net] has joined #ruby
<banisterfiend> waht i really wanted was: (no_pager * no_color) { ...code... }
dbgster [dbgster!~dbgster@CPE0013f7b7170c-CM0013f7b71708.cpe.net.cable.rogers.com] has joined #ruby
<shevy> hmm banisterfiend why do you write "if !block_given?" and not "if ! block_given?". They are different? Or is that just stylistic.
<banisterfiend> i've never really seen anyone put a space after a bang
<catphish> i use spaces after bangs
<catphish> afaik it's just style
<shevy> ok
chouchen [chouchen!~chatzilla@125.115.169.251] has joined #ruby
<Asher> i always do as well
<banisterfiend> u r all weirdos
<banisterfiend> i love the theorizing at the end of that article too
<rippa> maybe you also put space after unary minus?
<banisterfiend> . "Young students tend to use it when they get together," Abdelli-Beruh says. "Maybe this is a social link between members of a group."
<Asher> no i hadn't heard of that
Russell^^ [Russell^^!~Russell^^@88.97.51.87] has joined #ruby
burgestrand [burgestrand!~burgestra@h-163-174.a155.priv.bahnhof.se] has joined #ruby
S2kx [S2kx!~S1kx@ip-95-223-80-198.unitymediagroup.de] has joined #ruby
johnduhart [johnduhart!~quassel@46.105.138.12] has joined #ruby
<chilversc> installing using rvm, why is it not compiling zlib support when I have zlib installed through yum?
jimmy1980 [jimmy1980!~jimmy@112.224.3.99] has joined #ruby
heoa [heoa!~xyz@fik5.kyla.fi] has joined #ruby
<shevy> hmm
<shevy> when I do
<shevy> MY_DATA = File.readlines('some/data.dat')
<shevy> it is read the moment when the parser sees it?
jensn [jensn!~Jens@206-244-96-87.cust.blixtvik.se] has joined #ruby
<shevy> or only when it is actually needed
<heoa> xtableWiseRuby2HTML(Dir.glob('*')) -- something like this aronud?
<shevy> right now I have it in a method, without constant, but I want to also shift that data around as string constant, so I am considering moving it to CONSTANTS instead. but those files can be fairly huge ...
bwlang [bwlang!~anonymous@static-71-245-233-146.bstnma.fios.verizon.net] has joined #ruby
johnduhart [johnduhart!~quassel@46.105.138.12] has joined #ruby
_debo [_debo!~marco.deb@cpc18-enfi16-2-0-cust743.hari.cable.virginmedia.com] has joined #ruby
<heoa> Is there something like R Sweave for ruby for creating dynamic content?
Morkel [Morkel!~Morkel@xdsl-87-78-205-136.netcologne.de] has joined #ruby
<apeiros> shevy: ruby is single pass, so yes, parsing and executing there are the same, unless it's within a method definition or a proc
<shevy> okies
<apeiros> chilversc: either because you don't have the zlib headers or the headers aren't anywhere where rvm looks for them
catphish [catphish!~charlie@2001:9d8:2005:12::3] has quit ["Leaving"]
<chilversc> ah yeah, seems zlib-devel isn't there
kirun [kirun!~kirun@78-86-154-194.zone2.bethere.co.uk] has joined #ruby
techhelp [techhelp!~Dan@ip70-162-10-229.ph.ph.cox.net] has joined #ruby
johnduhart [johnduhart!~quassel@46.105.138.12] has joined #ruby
araujo [araujo!~araujo@gentoo/developer/araujo] has joined #ruby
jensn_ [jensn_!~Jens@c-83-233-145-148.cust.bredband2.com] has joined #ruby
thoraxe [thoraxe!~thoraxe@50-73-95-6-static.hfc.comcastbusiness.net] has joined #ruby
Faris [Faris!~faris@41.140.27.158] has joined #ruby
timonv [timonv!~timonv@140pc227.sshunet.nl] has joined #ruby
ert1999 [ert1999!~mIRCita01@31.188.80.49] has joined #ruby
<ert1999> salve
<ert1999> !list
ert1999 [ert1999!~mIRCita01@31.188.80.49] has quit [#ruby]
jimmy1980 [jimmy1980!~jimmy@112.224.3.99] has joined #ruby
smgt [smgt!~simon@76.156.216.81.static.m-dp.siw.siwnet.net] has joined #ruby
jacobrelkin [jacobrelkin!~jacobrelk@c-98-248-93-35.hsd1.ca.comcast.net] has joined #ruby
jacobrelkin [jacobrelkin!~jacobrelk@c-98-248-93-35.hsd1.ca.comcast.net] has joined #ruby
dcarper [dcarper!~Adium@c-76-125-233-64.hsd1.pa.comcast.net] has joined #ruby
gayasentinel [gayasentinel!~gayasenti@de.real-vpn.com] has joined #ruby
sepp2k [sepp2k!~sexy@g224099114.adsl.alicedsl.de] has joined #ruby
idle` [idle`!~idle@jem75-5-82-244-52-176.fbx.proxad.net] has joined #ruby
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby
warris [warris!~warris@ACBB091B.ipt.aol.com] has joined #ruby
workmad3 [workmad3!~workmad3@cpc1-bagu10-2-0-cust81.1-3.cable.virginmedia.com] has joined #ruby
jimmy1980 [jimmy1980!~jimmy@112.224.3.99] has joined #ruby
IrishGringo [IrishGringo!~chatzilla@c-71-229-99-200.hsd1.fl.comcast.net] has joined #ruby
mickn [mickn!~mickn@unaffiliated/mickn] has joined #ruby
LBRapid [LBRapid!~LBRapid@66-44-32-34.c3-0.129-ubr1.lnh-129.md.cable.rcn.com] has joined #ruby
zxiest [zxiest!~zxiest@213.204.69.188] has joined #ruby
<zxiest> Hello everybody =)
<zxiest> Any recommendations on asynchronous calls?
warris [warris!~warris@ACBB091B.ipt.aol.com] has quit [#ruby]
eigar [eigar!~eigar@244.80-203-38.nextgentel.com] has joined #ruby
Adman65 [Adman65!~Adman65@d141221.adsl.hansenet.de] has joined #ruby
ghosTM55 [ghosTM55!~user@li279-245.members.linode.com] has joined #ruby
Faris [Faris!~faris@41.140.27.158] has joined #ruby
andrewhl [andrewhl!~andrew@24-246-15-43.cable.teksavvy.com] has joined #ruby
negaduck [negaduck!~negaduck@213.141.130.13] has joined #ruby
atmosx [atmosx!~atmosx@191.116.broadband5.iol.cz] has joined #ruby
gayasentinel [gayasentinel!~gayasenti@de.real-vpn.com] has joined #ruby
flip_digits [flip_digits!~textual@c-71-199-243-97.hsd1.fl.comcast.net] has joined #ruby
perlsyntax [perlsyntax!~perlsynta@unaffiliated/perlsyntax] has joined #ruby
fahadsadah [fahadsadah!fahad@unaffiliated/fahadsadah] has joined #ruby
Jrz [Jrz!~jrz@d152222.upc-d.chello.nl] has joined #ruby
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby
ggtoo [ggtoo!~ggtoo@122.164.89.24] has joined #ruby
<JakeyChan> what's "task" used for in ruby ?
<apeiros> JakeyChan: not a ruby core method
<apeiros> you're probably looking at a rakefile?
<JakeyChan> yeah
<JakeyChan> learning
<JakeyChan> task: test do
<apeiros> task :test do ;-)
<apeiros> defines a rake task
shevy [shevy!~shevy@178-191-240-112.adsl.highway.telekom.at] has joined #ruby
<JakeyChan> ok
<apeiros> (or adds dependencies to an existing task)
<JakeyChan> got it, sounds simple
Coty91 [Coty91!~coty@96-32-145-105.dhcp.gwnt.ga.charter.com] has joined #ruby
<JakeyChan> I am newer of ruby :)D
<JakeyChan> :)
ixti [ixti!~ixti@251.Red-88-25-53.staticIP.rima-tde.net] has joined #ruby
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby
<JakeyChan> ruby syntax looks not easy
<JakeyChan> like that
<JakeyChan> end or raise "Failures"
<apeiros> o0
adambeynon [adambeynon!~adambeyno@82-69-1-211.dsl.in-addr.zen.co.uk] has joined #ruby
<JakeyChan> there are three command
<JakeyChan> end
<JakeyChan> or
<JakeyChan> raise
<JakeyChan> complex ?
<apeiros> expression or expression
<JakeyChan> but how it works?
<apeiros> the `end` probably belongs to a block
<shevy> end closes your block
<shevy> raise raises an exception
<shevy> but you can live without exceptions for some time
<apeiros> if the block returns a falsish value (nil or false), raise "Failures" will be invoked
<shevy> but not without end!
<apeiros> I'd argue that you're looking at bad code, though
<JakeyChan> when raise the exception ? forever execute this block code ?
<shevy> when an error happens
<apeiros> false or raise "foo" # <-- raises
<shevy> begin
<shevy> 5 / 0
<JakeyChan> no, I am reading rails source
<shevy> rescue Exception => error
<apeiros> true or raise "foo" # <-- does not raise
<shevy> puts "Someone did something bad here."
<shevy> end
<apeiros> JakeyChan: assumption confirmed then :-p
<shevy> haha
dbgster [dbgster!~dbgster@CPE0013f7b7170c-CM0013f7b71708.cpe.net.cable.rogers.com] has joined #ruby
<apeiros> I would not consider rails source code to be an example of good coding practices (except for the vast test coverage)
<shevy> apeiros, didn't you want to write your own web framework once?
<shevy> or was that only manveru
<apeiros> shevy: I still want. but not enough time.
<apeiros> manveru did - ramaze is his
<shevy> I see
<shevy> yeah
<apeiros> now I'm doing stupid things like implementing prefix matching in C…
<JakeyChan> ;)
fritzthecat_ [fritzthecat_!~fritzthec@HSI-KBW-078-043-029-162.hsi4.kabel-badenwuerttemberg.de] has joined #ruby
<shevy> ewwww C
<Tasser> apeiros, no libs around?
negaduck_ [negaduck_!~negaduck@213.141.130.13] has joined #ruby
<apeiros> Tasser: didn't bother much to search
<apeiros> I still want to improve my C knowledge, so small projects like this are great
<Tasser> write python, compile to C ;-)
<apeiros> besides memory management, there's little I can do wrong
<apeiros> yeah, that helps a lot with learning C of course…
<apeiros> (writing python and compiling to C…)
joast [joast!~rick@76.178.187.164] has joined #ruby
<JakeyChan> I just need you, guys, to explain this code :)
<JakeyChan> root :to => 'home#index'
<JakeyChan> :to is method ?
<JakeyChan> => is method too ?
<apeiros> no
<JakeyChan> :O
<apeiros> `root :to => 'home#index'` is syntax sugar for `root({:to => 'home#index'})`
<apeiros> {:to => 'home#index'}.class # => Hash
<apeiros> :to.class # => Symbol
WhiteHorse [WhiteHorse!~WhiteHors@201.208.150.8] has joined #ruby
<apeiros> 'home#index'.class # => String
<JakeyChan> :D
<JakeyChan> understand :)
<JakeyChan> easy to see
<JakeyChan> I am a stupid guy
<shevy> many here are too
<shevy> rails kinda exposed ruby to many non-ruby guys
<JakeyChan> yeah yeah yeah :)
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby
<shevy> I think it is a curse and a blessing
altivec [altivec!~altivec@136.169.141.220] has joined #ruby
<apeiros> so is it a cursed blessing or a blessed curse?
<shevy> hmm
<shevy> more a cursed blessing :D
<shevy> blessed curse sounds kinda gayish
<shevy> rails attracted many new people to ruby, I guess many who would have never used ruby. some probably decided to use ruby too, a few perhaps even no longer use rails, but use ruby
<shevy> but it kinda generated a lot of background noise, rails overshadowing the rest of ruby... then there are so many newbies, which is both good and bad ....
Evixion [Evixion!Evixion@67.235.65.134] has joined #ruby
eldariof [eldariof!~CLD@81.200.24.180] has joined #ruby
cdepue [cdepue!~cdepue@200.117.80.85] has joined #ruby
jetblack [jetblack!~jetblack@99-32-20-118.lightspeed.elgnil.sbcglobal.net] has joined #ruby
Lord-Harlot [Lord-Harlot!Serenity@adsl-77-86-52-54.karoo.KCOM.COM] has joined #ruby
preller [preller!~preller@tapir.feralhosting.com] has joined #ruby
preller [preller!~preller@unaffiliated/preller] has joined #ruby
adambeynon [adambeynon!~adambeyno@82-69-1-211.dsl.in-addr.zen.co.uk] has joined #ruby
tomzx [tomzx!~tomzx@dsl-59-207.aei.ca] has joined #ruby
Draco_ [Draco_!~draco@W160.N181.queensu.ca] has joined #ruby
mickn [mickn!~mickn@unaffiliated/mickn] has joined #ruby
raythecat [raythecat!~raythecat@cpe-66-27-147-33.socal.res.rr.com] has joined #ruby
mickn [mickn!~mickn@unaffiliated/mickn] has joined #ruby
maletor [maletor!~maletor@c-69-181-28-195.hsd1.ca.comcast.net] has joined #ruby
NinoScript [NinoScript!~Adium@pc-55-124-83-200.cm.vtr.net] has joined #ruby
bewise [bewise!755d983d@gateway/web/freenode/ip.117.93.152.61] has joined #ruby
mengu [mengu!~mengu@unaffiliated/mengu] has joined #ruby
kennethreitz [kennethreitz!~kennethre@c-24-127-96-129.hsd1.va.comcast.net] has joined #ruby
hinogi [hinogi!~Stefan@mnsr-4db0b33b.pool.mediaWays.net] has joined #ruby
hinogi [hinogi!~Stefan@facade/contributor/hinogi] has joined #ruby
iamjarvo [iamjarvo!~Adium@pool-96-245-10-45.phlapa.fios.verizon.net] has joined #ruby
enikar [enikar!~gil@cl-140.mrs-01.fr.sixxs.net] has joined #ruby
RomD` [RomD`!~Roman@nrbg-d93233a7.pool.mediaWays.net] has joined #ruby
Marco_ [Marco_!~marco@c-98-254-52-240.hsd1.fl.comcast.net] has joined #ruby
jimmy1980 [jimmy1980!~jimmy@112.224.3.72] has joined #ruby
mmokrysz [mmokrysz!~mmokrysz@pdpc/supporter/student/mmokrysz] has joined #ruby
Newbs [Newbs!~textual@host-78-147-56-89.as13285.net] has joined #ruby
Geshpacky [Geshpacky!~textual@p5B390E43.dip0.t-ipconnect.de] has joined #ruby
philcrissman [philcrissman!~philcriss@c-174-53-217-149.hsd1.mn.comcast.net] has joined #ruby
bafilius [bafilius!~lee@ip68-6-93-133.sb.sd.cox.net] has joined #ruby
gayasentinel [gayasentinel!~gayasenti@de.real-vpn.com] has joined #ruby
ph^_ [ph^_!~ph^@cm-84.212.225.74.getinternet.no] has joined #ruby
lonny [lonny!~lonny@122.177.160.114] has joined #ruby
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby
trivol [trivol!~aurelien@ip-178.net-89-2-84.rev.numericable.fr] has joined #ruby
minijupe [minijupe!~benlieb@97-95-236-58.dhcp.sffl.va.charter.com] has joined #ruby
io_syl [io_syl!~io_syl@adsl-69-105-118-125.dsl.pltn13.pacbell.net] has joined #ruby
io_syl [io_syl!~io_syl@unaffiliated/steph021] has joined #ruby
kennethreitz [kennethreitz!~kennethre@c-24-127-96-129.hsd1.va.comcast.net] has joined #ruby
wmoxam_ [wmoxam_!~wmoxam@69-196-129-140.dsl.teksavvy.com] has joined #ruby
bier [bier!~bier@p57999B97.dip.t-dialin.net] has joined #ruby
mmokrysz [mmokrysz!~mmokrysz@pdpc/supporter/student/mmokrysz] has quit [#ruby]
dotnull [dotnull!~DotNull@173-31-158-182.client.mchsi.com] has joined #ruby
QaDeS [QaDeS!~mklaus@frbg-5d84e0e6.pool.mediaWays.net] has joined #ruby
S0lign0c [S0lign0c!~S0lign0c@jeproteste.info] has joined #ruby
<S0lign0c> hi
holybit [holybit!~alpine_st@c-75-71-177-16.hsd1.co.comcast.net] has joined #ruby
<S0lign0c> i've a strange think in Ruby with Array. exemple a = [0,0] b = a a[0] = 1 and b change too with [1,0] oO
<S0lign0c> Ah ok i have to make b = Array.new(a) to copy
<shevy> *thing, not think
<shevy> S0lign0c b = a.dup
RusAlex [RusAlex!~alex@184.82.79.106] has joined #ruby
<RusAlex> hi guys, please help with ruby to a starter
apeiros [apeiros!~apeiros@77-58-115-24.dclient.hispeed.ch] has joined #ruby
<shevy> S0lign0c http://pastie.org/3001052
<shevy> oops, one a too many. a moment
<RusAlex> in my haml next code:
<RusAlex> =tr.visitors
<RusAlex> prints "[84960976]"
<RusAlex> but when i try to convert it to an Array object a = JSON.parse tr.visitors
<RusAlex> error occurs
<RusAlex> "can't convert nil into String"
<RusAlex> im going to store an Array object in my sqlite row property
jimmy1980 [jimmy1980!~jimmy@112.224.3.72] has joined #ruby
<RusAlex> but error occurs when im trying to parse my json
_numbers [_numbers!~xxxxxx@unaffiliated/numbers/x-253875] has joined #ruby
_numbers [_numbers!~xxxxxx@unaffiliated/numbers/x-253875] has quit [#ruby]
thone [thone!~thone@g229077100.adsl.alicedsl.de] has joined #ruby
cafesofie [cafesofie!~user@ool-18b97779.dyn.optonline.net] has joined #ruby
<shevy> no idea about json
<shevy> but when you have an error message like that, you have a nil object somewhere
<shevy> "abc"+nil # => TypeError: can't convert nil into String
<QaDeS> anybody experiences with middleman? i'm running crazy here with setting/retrieving the environment it should run in
<shevy> perhaps JSON.parse returns garbage
awesome [awesome!~awesome@212.62.202.84.customer.cdi.no] has joined #ruby
<RusAlex> is datamapper support after get magic for records ?
rushed [rushed!~rushed@cpe-70-116-11-35.austin.res.rr.com] has joined #ruby
vitoravelino [vitoravelino!~rockhampt@187.86.5.112] has joined #ruby
vitoravelino [vitoravelino!~rockhampt@unaffiliated/vtr] has joined #ruby
<shevy> what
p0y [p0y!~p0y@121.97.59.227] has joined #ruby
<RusAlex> i want to init or change some datamapper model properties, after getting it via Model.get(id) , for example i want to parse my json encoded fields
<blueadept> what's the best way of looping through two different variables, one after another in ruby?
<blueadept> like an infinate loop that goes 0, 1, 0 , 1, 0...
<burgestrand> [0, 1].cycle
<blueadept> ah, cool, thanks!
<burgestrand> It’ll give you an enumerator infinitely going 0, 1, 0, 1…
philcrissman [philcrissman!~philcriss@c-174-53-217-149.hsd1.mn.comcast.net] has joined #ruby
<blueadept> hm, wait, what if you're a loop inside another loop though
<RusAlex> shevy: is datamapper can do that ?
<RusAlex> it's like a get'
<burgestrand> blueadept: what about it?
<RusAlex> it's like a 'get' hook
<blueadept> so cycle will work inside a loop as well?
<RusAlex> similar to create, update, delete hooks in datamapper
<burgestrand> blueadept: try it in IRB once
<blueadept> will do
<burgestrand> blueadept: just the thing I wrote
<rippa> I like enumerators
<rippa> a = [0,1]; a.next; a.next
<rippa> and stuff
<S0lign0c> shevy: thank you
jarjar_prime [jarjar_prime!~mjarjoura@50-76-61-133-ip-static.hfc.comcastbusiness.net] has joined #ruby
cdepue [cdepue!~cdepue@200.117.80.85] has joined #ruby
<blueadept> rippa, that's another cool way as well
<rippa> or stuff procs into the array and do a.next.call
<rippa> possibilities are endless
wedgeV [wedgeV!~wedge@cpe-68-173-18-241.nyc.res.rr.com] has joined #ruby
RusAlex [RusAlex!~alex@184.82.79.106] has joined #ruby
<S0lign0c> a last question for me, is there a better and comprehensive alternative to 0.upto(myArray.size-1) ?
rickmasta [rickmasta!~rickmasta@pool-108-21-213-102.nycmny.fios.verizon.net] has joined #ruby
<rippa> array[0..-2]
<S0lign0c> i've find i think is myArray.times
<rippa> or not
<S0lign0c> rippa: maybe i go trying
<rippa> it yields elements of array though
<rippa> not numbers
<rippa> you could to with_index but that's just perversion
<S0lign0c> rippa: ok
<S0lign0c> array.times is the best i thikn for a loop
earcar [earcar!~earcar@145.116.231.100] has joined #ruby
<rippa> wouldn't work though
<S0lign0c> array.size.times sorry
<rippa> array.size.times would
<S0lign0c> \o/ same time
<Mon_Ouie> array.each_index
<samuelkadolph> (0..array.size).each
mengu_ [mengu_!~mengu@88.233.4.192] has joined #ruby
mengu_ [mengu_!~mengu@unaffiliated/mengu] has joined #ruby
RusAlex [RusAlex!~alex@184.82.79.106] has joined #ruby
Sailias [Sailias!~jonathan@CPE0018f85e576d-CM001bd7aaaf96.cpe.net.cable.rogers.com] has joined #ruby
RusAlex [RusAlex!~alex@184.82.79.106] has quit [#ruby]
Cervajz [Cervajz!~Cervajz@opensuse/member/Cervajz] has joined #ruby
mengu_ [mengu_!~mengu@78.182.80.195] has joined #ruby
mengu_ [mengu_!~mengu@unaffiliated/mengu] has joined #ruby
christian__ [christian__!~christian@190.232.34.241] has joined #ruby
_|christian|_ [_|christian|_!~christian@190.232.34.241] has joined #ruby
me345 [me345!~me345@75.15.183.164] has joined #ruby
kakaskin [kakaskin!~kakaskin@87.252.227.117] has joined #ruby
apeiros [apeiros!~apeiros@77-58-115-24.dclient.hispeed.ch] has joined #ruby
rvmeier [rvmeier!~rodrigo@pc-136-172-241-201.cm.vtr.net] has joined #ruby
mengu_ [mengu_!~mengu@85.97.181.32] has joined #ruby
mengu_ [mengu_!~mengu@unaffiliated/mengu] has joined #ruby
adeponte [adeponte!~adeponte@pool-173-51-131-236.lsanca.fios.verizon.net] has joined #ruby
<kakaskin> hi
<kakaskin> i study examples from Rob Fulton`s book
<kakaskin> http://pastie.org/3001319 is about regular regexps
<kakaskin> ruby says ./regexp3.rb:20: undefined group option: /(?
<apeiros> kakaskin: seems like you omitted a : on line 7
wmoxam_ [wmoxam_!~wmoxam@69.196.129.140] has joined #ruby
<apeiros> (?:, not just (?
CannedCorn [CannedCorn!~CannedCor@cpe-66-65-102-78.nyc.res.rr.com] has joined #ruby
<chilversc> can I not have the controller named in the singular for a singular resource?
<apeiros> chilversc: ?
<chilversc> I tried resource :session; and it complains "uninitialized constant SessionsController"
<apeiros> I just joined. I don't know what you're talking about.
<chilversc> that was my entire question
<apeiros> …
quest88 [quest88!~quest88@c-98-207-205-137.hsd1.ca.comcast.net] has joined #ruby
<apeiros> you know you're in #ruby?
<apeiros> not in #whateveryourframeworkis
sbinetd [sbinetd!~sbinetd@94-193-244-239.zone7.bethere.co.uk] has joined #ruby
<kakaskin> ./regexp3.rb:18: warning: invalid subexp call
Skaag_ [Skaag_!~skaag@107.55.223.251] has joined #ruby
<apeiros> kakaskin: seems it doesn't like the \g
idoru [idoru!idoru@freenode/utility-bot/ex-server/idoru] has joined #ruby
<apeiros> I don't know what you intended to do with that \g, but \g in oniguruma (ruby 1.9's regex engine) is \g<name> to reference named captures.
<kakaskin> ok, thanks
<apeiros> kakaskin: ri Regexp
<apeiros> (assuming you have your docs installed/generated)
Skaag_ [Skaag_!~skaag@107.53.203.175] has joined #ruby
josemota [josemota!~josemota@bl20-145-223.dsl.telepac.pt] has joined #ruby
luis [luis!~luis@nhop.r42.eu] has joined #ruby
rubi [rubi!~hari@117.192.24.193] has joined #ruby
<shevy> hmm apeiros
<shevy> how many gemfiles (for your projects) have you written in total so far?
v0n [v0n!~v4n@modemcable144.68-81-70.mc.videotron.ca] has joined #ruby
<apeiros> shevy: bundler gemfiles?
<shevy> hmm good question
<apeiros> written: none. modified: no idea, couple of dozens perhaps.
spyvspy [spyvspy!~nonenone@108-82-153-117.lightspeed.stlsmo.sbcglobal.net] has joined #ruby
Morkel [Morkel!~Morkel@xdsl-87-78-205-136.netcologne.de] has joined #ruby
rubi [rubi!~hari@117.192.24.193] has joined #ruby
<minijupe> can someone please help me explain why the following model instance is showing that blank? is true ? http://pastie.org/3001412
<apeiros> minijupe: #rubyonrails
hadronzoo [hadronzoo!~user@99-126-226-10.lightspeed.dllstx.sbcglobal.net] has joined #ruby
<minijupe> apeiros: no luck there. thought it might be a ruby issue.
<apeiros> nope. blank? is a rails thing, so is AR.
MrPewPewPew [MrPewPewPew!~Meow@cpc8-acto4-2-0-cust884.4-2.cable.virginmedia.com] has joined #ruby
MrPewPewPew [MrPewPewPew!~Meow@cpc8-acto4-2-0-cust884.4-2.cable.virginmedia.com] has quit ["Leaving"]
workmad3 [workmad3!~workmad3@cpc1-bagu10-2-0-cust81.1-3.cable.virginmedia.com] has joined #ruby
<minijupe> apeiros: yeah, it was worth a shot : )
<shevy> rails is famous for spaghetti coding
looopy [looopy!~looopy@static-71-166-230-193.washdc.east.verizon.net] has joined #ruby
<apeiros> minijupe: you can try Business.find_by_slug('goofy-rooster-corn-maze').farm_store.method(:blank?) to see where its blank method comes from.
<hadronzoo> Can I define a new method to be an existing Proc?
<apeiros> hadronzoo: ri Module#define_method
rramsden [rramsden!~rramsden@s64-180-62-209.bc.hsia.telus.net] has joined #ruby
Hellojere [Hellojere!~Hellojere@89.7.90.160] has joined #ruby
<hadronzoo> apeiros: I'm getting an error when passing :define_method a Proc
<apeiros> hadronzoo: um… Module#define_method tells you it's an instance method of *Module*, not Proc
<apeiros> and given what you say I assume you did not read the docs on it (ri is the ruby doc reading tool in your shell)
<apeiros> so I suggest you start with reading the docs (using ri, or using something like rdoc.info)
<hadronzoo> apeiros: Never mind, I got it to work. I had to do "SomeClass.send :define_method, :a_method, &my_lambda"
Faris [Faris!~faris@41.140.27.158] has joined #ruby
jay_zawrotny [jay_zawrotny!~Jay@c-71-205-193-222.hsd1.mi.comcast.net] has joined #ruby
<hadronzoo> apeiros: (I had to use the & operator)
kirun [kirun!~kirun@78-86-154-194.zone2.bethere.co.uk] has joined #ruby
<apeiros> actually you don't have to use the &
<apeiros> and totally surprising, that's in the docs too…
Guest83872 [Guest83872!rambonas@70.32.34.103] has quit [#ruby]
<hadronzoo> apeiros: Thank you for your assistance
sepp2k [sepp2k!~sexy@g224101175.adsl.alicedsl.de] has joined #ruby
samxor [samxor!rambonas@70.32.34.103] has joined #ruby
<hadronzoo> apeiros: by the way, #define_method, being a non-public method, isn't showing up in the docs I'm reading: http://www.ruby-doc.org/core-1.9.3/Module.html
ciunix [ciunix!~ciunix@151.65.183.84] has joined #ruby
<apeiros> that'd be one reason more to use ri instead of web docs…
<apeiros> rdoc.info uses yard, which documents private methods too.
<hadronzoo> apeiros: right, duly noted. Thanks.
<minijupe> apeiros: the method(:blank?) seems not to give information that would lead me to where it's defined: http://pastie.org/3001494
robbyoconnor [robbyoconnor!~wakawaka@guifications/user/r0bby] has joined #ruby
<ciunix> I'm a newbie in ruby and sinatra, I'm trying to pass with an html form post a json data.. Could somebody explain me how can I parse that json in sinatra?
<apeiros> minijupe: it does. "#<Method: FarmStore(Object)#blank?>" <-- tells you that you have a FarmStore instance, which inherits the method from Object
<apeiros> and afaik, Object#blank? should always return false.
<minijupe> apeiros: ok, thanks. but why does it return true?
<apeiros> ciunix: install the json gem, require 'json', then use JSON.parse(string)
<apeiros> minijupe: no idea.
jtrudeau [jtrudeau!~jeff@c-76-127-237-194.hsd1.ma.comcast.net] has joined #ruby
<ciunix> apeiros coul I show the code? it's very very simple
<apeiros> ciunix: I suggest you try it yourself first, and when it doesn't work, I'll take a look…
<ciunix> I tried it before
<ciunix> for this reason I asked it
<ciunix> I'm using sinatra slim and json gem
<apeiros> ciunix: then paste the relevant code e.g. on pastie.org
<ciunix> ok
CannedCorn [CannedCorn!~CannedCor@cpe-66-65-102-78.nyc.res.rr.com] has joined #ruby
<ciunix> thanks apeiros
thepix [thepix!~pix@91.193.160.245] has joined #ruby
<blueadept> rippa, you here?
<rippa> yes
<blueadept> .next doesn't work in rails
<blueadept> giving me undefined method
ceej [ceej!~anonymous@cpe-72-190-40-203.tx.res.rr.com] has joined #ruby
<blueadept> but it should work right?
<rippa> it works on enumrators
<blueadept> oh
<rippa> what are you calling it on?
raythecat [raythecat!~raythecat@cpe-66-27-147-33.socal.res.rr.com] has joined #ruby
<rippa> i.e. a = [0,1].cycle; a.next
mikepack [mikepack!~mikepack@c-174-51-77-22.hsd1.co.comcast.net] has joined #ruby
<ciunix> this is the code: http://pastebin.com/KazhQM1z
<rippa> @row_color = ['oddrow', 'evenrow'].cycle
<blueadept> ahh
<ciunix> apeiros the are you still there?
cdepue [cdepue!~cdepue@host18.190-139-29.telecom.net.ar] has joined #ruby
<blueadept> rippa, damn, got a segmentation fault
chessguy [chessguy!~chessguy@pool-74-96-111-119.washdc.fios.verizon.net] has joined #ruby
perryh [perryh!~root@far3567.urh.uiuc.edu] has joined #ruby
perryh [perryh!~root@unaffiliated/perry753] has joined #ruby
<blueadept> weird, hm
<S0lign0c> is ruby expression if a == 4: a = 7 end is valid now ? (i've found this expression in wikibooks)
zul_ [zul_!~ciunix@151.65.170.183] has joined #ruby
Sailias [Sailias!~jonathan@CPE0018f85e576d-CM001bd7aaaf96.cpe.net.cable.rogers.com] has joined #ruby
<apeiros> ciunix: yes
<apeiros> was working on my stuff and didn't notice the highlight
zxiest [zxiest!~zxiest@213.204.69.188] has joined #ruby
jergason [jergason!~jergason@c-67-161-248-217.hsd1.ut.comcast.net] has joined #ruby
nmelo [nmelo!~nmelo@c-66-176-36-86.hsd1.fl.comcast.net] has joined #ruby
cdepue [cdepue!~cdepue@host18.190-139-29.telecom.net.ar] has joined #ruby
Tachyx [Tachyx!tach@tachnb.kolej.mff.cuni.cz] has joined #ruby
roadze [roadze!~roadze@119.224.137.97] has joined #ruby
<blueadept> rippa: thing is i'm working with ajax and using a logicless templating language
<blueadept> i have to generate these row cycles on the server side, not in the erb templates
<zul_> apeiros.. I'm ciunix.. I have some problem with my account..
<zul_> have you looked the code I sent you?
<apeiros> zul_: yes
<apeiros> JSON.parse(obj.to_json) is a no-op
<zul_> what ??
<apeiros> JSON.parse(obj.to_json) == obj
<apeiros> an expensive way to do nothing. it's like 12.to_s.to_i
<zul_> then?
<apeiros> line 9/10 of your paste
<apeiros> well, why do you call .to_json on line 9?
<apeiros> also, pastebin? seriously? there's ad-free paste services… like pastie.org or gist…
<rippa> pastebin has ads?
<zul_> sorry apeiros I really am a newbie
<rippa> internet has ads?
<rippa> good thing adblock was invented
bwlang [bwlang!~anonymous@static-71-245-233-146.bstnma.fios.verizon.net] has joined #ruby
<apeiros> rippa: if some service I enjoy uses ads to pay itself, I load them. if you don't like the ads, don't visit the website.
<apeiros> the other thing is parasitic behaviour IMO.
<rippa> like it's a bad thing
workmad3 [workmad3!~workmad3@cpc1-bagu10-2-0-cust81.1-3.cable.virginmedia.com] has joined #ruby
<apeiros> zul_: was "I'm a newbie" supposed to be the answer to my question?
<zul_> ah ok
<zul_> apeiros
<zul_> I did it
<zul_> for_json = JSON.parse(params[:mposition])
<zul_> but I get the same error.. for this reason before I converted a json data again in json..
mikepack [mikepack!~mikepack@c-174-51-77-22.hsd1.co.comcast.net] has joined #ruby
<apeiros> zul_: can you give the output of `puts params[:mposition]`?
looopy_ [looopy_!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby
<zul_> in the html text form I write:
<zul_> "{\"mobilePosition\":{\"user\":\"uuid\",\"password\":67,\"lat\":36.23232,\"long\":36.23232,\"altitude\":120.23232,\"accuracy\":5}}"
<zul_> maybe I wrong in this message?
<apeiros> that's what you get when you puts it?
<apeiros> or when you inspect it?
GoldenPie [GoldenPie!~user@host109-154-254-222.range109-154.btcentralplus.com] has joined #ruby
<zul_> what I get when I press sent button (form) is this:
<blueadept> rippa: one more thing and i wont bother you, i'm generating the array here, but the next isn't working, http://pastie.org/private/ftlhie1ihzfz0ukp3cgt8a
Vendethiel [Vendethiel!Vendethiel@229.190.140.88.rev.sfr.net] has joined #ruby
<GoldenPie> Does anyone know how to separate a DateTime object with just the date?
daniel_hinojosa1 [daniel_hinojosa1!~danno@c-68-35-182-153.hsd1.nm.comcast.net] has joined #ruby
<rippa> blueadept: arrays don't have #next
<blueadept> ah
<rippa> only enumerators
<rippa> you can do
<rippa> enum = array.each
<apeiros> GoldenPie: what do you mean, 'separate'? you mean you want the date part only?
<rippa> and the enum.next
<blueadept> ahh ok
<GoldenPie> apeiros: yeah, just the date
<apeiros> GoldenPie: Date.civil(yourdate.year, yourdate.month, yourdate.day)
maletor [maletor!~maletor@c-69-181-32-226.hsd1.ca.comcast.net] has joined #ruby
<apeiros> zul_: that's not valid json you get there
<zul_> no???
<zul_> just a moment
<apeiros> no. it looks like an inspect of a string that would be valid json.
<apeiros> how do you send the json?
<apeiros> or rather, generate it?
cdepue_ [cdepue_!~cdepue@host18.190-139-29.telecom.net.ar] has joined #ruby
<apeiros> what I find fascinating is that it doesn't error out on the first non-whitespace. that's already illegal. the root of json must always be an array or an object - that is [] or {}.
timonv [timonv!~timonv@140pc227.sshunet.nl] has joined #ruby
<apeiros> then again, that 743 probably isn't meant to be a position…
<zul_> look this
<apeiros> zul_: funny, so it was precisely what I said
<apeiros> zul_: `puts d`
<zul_> really?
<apeiros> paste that into your form
<zul_> ok
<apeiros> you took an inspect of a string containing valid json. but an inspect of a string != the string.
ziggles [ziggles!~ziggles@c-24-6-247-92.hsd1.ca.comcast.net] has joined #ruby
<apeiros> {a: 1} <-- valid json
<apeiros> "{a: 1}" <-- *not* valid json
friskd [friskd!~friskd@71-95-209-242.static.mtpk.ca.charter.com] has joined #ruby
<apeiros> if you do: x = "{a: 1}", x contains valid json. x' inspect is "{a: 1}" (including the quotes), which is NOT valid json. you want the output of `puts x`, which is {a: 1}, which is valid json.
<rippa> x.inspect is "\"{a: 1}\""
<apeiros> rippa: no, x.inspect.inspect is that.
<apeiros> which you're looking at if you do x.inspect in your irb.
<rippa> inspectception
<zul_> ok
<rippa> we need to go deeper
<GoldenPie> apeiros: Sorry, i'm pulling it form a database, and want to format it
<apeiros> GoldenPie: uh, strftime then
<apeiros> and/or whatever accessors you need. ri DateTime
Amirh [Amirh!~amir@2.181.24.15] has joined #ruby
cdepue [cdepue!~cdepue@200.117.90.63] has joined #ruby
<zul_> sorry apeiros now I get this
<zul_> (thanks a lot apeiros the help a newbie like me)
jbpros [jbpros!~jbpros@87.66.40.85] has joined #ruby
pabloh [pabloh!~pablo@186.22.82.39] has joined #ruby
josh_ [josh_!~josh@74-95-43-126-Oregon.hfc.comcastbusiness.net] has joined #ruby
<apeiros> zul_: wow, wtf?
<apeiros> that happens when you send the form?
<apeiros> as in, send the form from your browser, yes?
berserkr [berserkr!~david@212.122.111.205.dyn.user.ono.com] has joined #ruby
<zul_> yes
<apeiros> that's weird…
bwlang [bwlang!~anonymous@static-71-245-233-146.bstnma.fios.verizon.net] has joined #ruby
<apeiros> the exception happens in webrick… webrick shouldn't explode upon form-data…
<zul_> mmm and then?
<zul_> what could I do?
<apeiros> there's no 'and then', I have no idea why webrick would explode like that.
<zul_> oh sorry apeiros I just ask because I don't know what I do and you are helping me a lot, understaind me..
johnduhart [johnduhart!~quassel@46.105.138.12] has joined #ruby
<zul_> Please excuse myself in my bad english apeiros
<apeiros> zul_: well, I'm sorry, there's nothing I can do about that problem :-/
<zul_> apeiros well no problem I try to solve it with google :)
<zul_> where are you from apeiros.. I'm italian
<apeiros> northern neighbour…
eignerchris [eignerchris!~eignerchr@71-214-90-96.ptld.qwest.net] has joined #ruby
<zul_> USA?
<apeiros> sono della svizzera
<zul_> ahh
<zul_> italiana?
<apeiros> hope I got that righ. I sucked at italian :)
<zul_> canton ticino?
<apeiros> no, zurich
<zul_> you said exacty
Knodi [Knodi!~Knodi@c-68-43-246-216.hsd1.mi.comcast.net] has joined #ruby
Rayk [Rayk!~Rayk@pD9FB753B.dip.t-dialin.net] has joined #ruby
nmelo [nmelo!~nmelo@c-66-176-36-86.hsd1.fl.comcast.net] has quit [#ruby]
fantazo [fantazo!~fantazo@178-191-170-242.adsl.highway.telekom.at] has joined #ruby
smgt [smgt!~simon@76.156.216.81.static.m-dp.siw.siwnet.net] has joined #ruby
iocor [iocor!~textual@unaffiliated/iocor] has joined #ruby
<shevy> what
<shevy> apeiros speaks italian!!!
<apeiros> only little
<shevy> zul_ where do you live?
<zul_> yes he speaks italian with a nourthen accent :)
<shevy> haha
<shevy> you should see him when he starts to yodel in mid-sentence
<zul_> I'm near milan but I'm sicilian..
<shevy> like all people from italy lately seem to be near milano
<zul_> :)
<shevy> I mean, ruby-using people
<zul_> and you shevy?
<shevy> vienna
ph^ [ph^!~ph^@cm-84.212.225.74.getinternet.no] has joined #ruby
<zul_> all doich speakers :)
igotnolegs [igotnolegs!~igotnoleg@174-27-220-21.slkc.qwest.net] has joined #ruby
<shevy> yeah!
<zul_> I now only bad words in doich
<shevy> lol
<zul_> eheh
<shevy> I don't even know bad words in italian
<shevy> but
<zul_> no? do you want to learn?eehh I know a bad sentence in a munich dialect
<shevy> I can recite lyrics like here http://www.youtube.com/watch?v=Jg-DCIhnl8s ;D
<shevy> how does that sentence go?
<zul_> it's like: tu bist a mirst brichen
<zul_> or something like that
<shevy> lol
johnduhart [johnduhart!~quassel@46.105.138.12] has joined #ruby
<shevy> du bist = you are
<zul_> it means: you are a bitch of straws
<shevy> not sure about the other two... trying to find the bavarian dialect there...
<zul_> it's a very strong and offensive sentence that girls use to other girls.. ( I had a flirt with a girl of munich ehehe(
<zul_> )
DaZ [DaZ!~meh@77-255-43-86.adsl.inetia.pl] has joined #ruby
pantsman [pantsman!~pantsman@2.25.204.155] has joined #ruby
pantsman [pantsman!~pantsman@pdpc/supporter/active/pantsman] has joined #ruby
Indian_ [Indian_!~Indian@unaffiliated/londonmet050] has joined #ruby
<zul_> could you give me some link about json and sinatra?
<blueadept> would anyone know why ruby crashes on use of .next ?
armdale [armdale!~wizington@24.52.227.6] has joined #ruby
<shevy> I? Well zul_ I don't know sinatra... but here are some docs http://www.sinatrarb.com/documentation
<shevy> blueadept do you have small snippet of code you could upload to pastie
<zul_> shevy apeiros helped me but now I have this problem
<zul_> I send a json with a form html post
<zul_> to a server sinatra..
<zul_> after sinatra in the method receive the json and crash all (remember I'm a newbie)
<shevy> blueadept hmm .next works for me but I am u sing 1.8.x
<blueadept> *sigh*
<shevy> apeiros can try, he is a 1.9.x user :D
<blueadept> i guess i'll have to hardcore the css to integers then
<blueadept> 1 { color: grey }, 2 {color: white}, 3 { color: grey}
<blueadept> what a bug
Hellojere [Hellojere!~Hellojere@89.7.90.160] has joined #ruby
<blueadept> currently using mustache.js, so i have to generate all the code in my JSON response
<blueadept> erb templates work just fine for cycle()
<blueadept> but can't use that with mustache
maletor [maletor!~maletor@c-69-181-28-195.hsd1.ca.comcast.net] has joined #ruby
DaZ [DaZ!~meh@87.205.146.228] has joined #ruby
Pip [Pip!~Pip@host-86-156-66-217.spbmts.ru] has joined #ruby
Pip [Pip!~Pip@unaffiliated/pip] has joined #ruby
<blueadept> oh god
<blueadept> css spec says you can't start css classes with digits
maletor [maletor!~maletor@c-69-181-28-195.hsd1.ca.comcast.net] has joined #ruby
<blueadept> man wtf is going on today
apok [apok!~apok@96.24.67.22] has joined #ruby
<blueadept> wait i got a work around
minijupe [minijupe!~benlieb@adsl-98-94-144-217.ard.bellsouth.net] has joined #ruby
<shevy> lol
<blueadept> all done
johnduhart [johnduhart!~quassel@46.105.138.12] has joined #ruby
wedgeV [wedgeV!~wedge@cpe-68-173-18-241.nyc.res.rr.com] has joined #ruby
<blueadept> what a weekend
<blueadept> anyone know how i can file a bug with the next seg fault?
patant [patant!~patant@h-141-11.a176.priv.bahnhof.se] has joined #ruby
fantazo_ [fantazo_!~fantazo@178-191-171-6.adsl.highway.telekom.at] has joined #ruby
Marco [Marco!~marco@c-98-254-52-240.hsd1.fl.comcast.net] has joined #ruby
rubi [rubi!~hari@117.192.24.193] has quit [#ruby]
looopy [looopy!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby
jgrimes [jgrimes!~jg@cpe-071-070-140-012.nc.res.rr.com] has joined #ruby
h4mz1d [h4mz1d!~hamfz@130.160.182.52] has joined #ruby
jgrimes [jgrimes!~jg@cpe-071-070-140-012.nc.res.rr.com] has joined #ruby
malkomalko [malkomalko!~malkomalk@static-71-244-84-30.ny325.east.verizon.net] has joined #ruby
hadronzoo [hadronzoo!~user@99-126-226-10.lightspeed.dllstx.sbcglobal.net] has joined #ruby
<burgestrand> blueadept: are you using RVM?
hadronzo` [hadronzo`!~user@99-126-226-10.lightspeed.dllstx.sbcglobal.net] has joined #ruby
statbot2 [statbot2!~nodebot@68-190-59-142.dhcp.mtgm.al.charter.com] has joined #ruby
trend [trend!~trend@76.91.169.147] has joined #ruby
<trend> why does this: ["Lee", "James", "David"].each do |name| puts "user: {name}" end produce this: user: {name}^3
<blueadept> yeah
<trend> and not user: Lee, user: james, etc
<trend> the http://www.ruby-lang.org/en/documentation/quickstart/4/ seems to indicate I can use { } to signify a variable inside of quotes
cdepue [cdepue!~cdepue@200.117.90.63] has joined #ruby
Marco [Marco!~marco@c-98-254-52-240.hsd1.fl.comcast.net] has joined #ruby
<trend> was missing the #
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby
statbot2 [statbot2!~nodebot@68-190-59-142.dhcp.mtgm.al.charter.com] has joined #ruby
WhiteHorse [WhiteHorse!~WhiteHors@201.208.150.8] has joined #ruby
statbot2 [statbot2!~nodebot@68-190-59-142.dhcp.mtgm.al.charter.com] has joined #ruby
michael_mbp [michael_mbp!~Marin@112.134.198.67] has joined #ruby
statbot2 [statbot2!~nodebot@68-190-59-142.dhcp.mtgm.al.charter.com] has joined #ruby
eugynon [eugynon!~terje@236.80-202-126.nextgentel.com] has joined #ruby
statbot2 [statbot2!~nodebot@68-190-59-142.dhcp.mtgm.al.charter.com] has joined #ruby
fayimora [fayimora!~fayimora@95.175.159.40] has joined #ruby
elliot98 [elliot98!~elliot@77.125.7.231] has joined #ruby
elliot98 [elliot98!~elliot@unaffiliated/elliot98] has joined #ruby
ph^_ [ph^_!~ph^@cm-84.212.225.74.getinternet.no] has joined #ruby
grekko [grekko!~grekko@HSI-KBW-078-043-185-121.hsi4.kabel-badenwuerttemberg.de] has joined #ruby
Draco_ [Draco_!~draco@W160.N181.queensu.ca] has joined #ruby
awesome_ [awesome_!~awesome@212.62.202.84.customer.cdi.no] has joined #ruby
trend [trend!~trend@76.91.169.147] has quit [#ruby]
_debo [_debo!~marco.deb@cpc18-enfi16-2-0-cust743.hari.cable.virginmedia.com] has joined #ruby
hess [hess!~hess@unaffiliated/hess] has joined #ruby
_whitelogger [_whitelogger!~whitelogg@2a00:ab00:1::4464:5550] has joined #ruby
canton10 [canton10!~canton7@87-194-161-58.bethere.co.uk] has joined #ruby
mpun1 [mpun1!~user@pool-96-241-113-73.washdc.fios.verizon.net] has joined #ruby
IrishGringo [IrishGringo!~chatzilla@c-71-229-99-200.hsd1.fl.comcast.net] has joined #ruby
jetblack [jetblack!~jetblack@99-32-20-118.lightspeed.elgnil.sbcglobal.net] has joined #ruby
Axsuul [Axsuul!~Axsuul@75-140-75-52.dhcp.mtpk.ca.charter.com] has joined #ruby
sodani [sodani!~shig@user-387hpcb.cable.mindspring.com] has joined #ruby
Nanuq [Nanuq!~nanuq@cave45.ecks.ca] has joined #ruby
dagnachewa [dagnachewa!~dagnachew@modemcable142.238-179-173.mc.videotron.ca] has joined #ruby
jamnew [jamnew!~jamnew@eth12849.sa.adsl.internode.on.net] has joined #ruby
dagnachewa [dagnachewa!~dagnachew@modemcable142.238-179-173.mc.videotron.ca] has joined #ruby
atmosx [atmosx!~atmosx@191.116.broadband5.iol.cz] has joined #ruby
dbgster [dbgster!~dbgster@CPE0013f7b7170c-CM0013f7b71708.cpe.net.cable.rogers.com] has joined #ruby
looopy_ [looopy_!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby
brownies [brownies!~brownies@unaffiliated/brownies] has joined #ruby