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/
eywu1 [eywu1!~Adium@67-134-147-135.dia.static.qwest.net] has joined #ruby
austinbv [austinbv!~austinbv@2002:6160:bbeb:e472:b181:d9a:fe07:aaf] has joined #ruby
eywu1 [eywu1!~Adium@67-134-147-135.dia.static.qwest.net] has quit [#ruby]
Nss [Nss!~nss@2-227-0-69.ip183.fastwebnet.it] has joined #ruby
austinbv_ [austinbv_!~austinbv@29-133.127-70.tampabay.res.rr.com] has joined #ruby
ilyam_ [ilyam_!~ilyam@eng.nat.mtv.ooyala.com] has joined #ruby
deweysmith [deweysmith!u3113@gateway/web/irccloud.com/x-ledcyzfpmfbudrma] has joined #ruby
pootpoot [pootpoot!~pootpoot@38.108.250.130] has quit [#ruby]
jay_zawrotny [jay_zawrotny!~Jay@c-68-43-28-43.hsd1.mi.comcast.net] has joined #ruby
cooper [cooper!~mitchell@unaffiliated/furryfishy] has joined #ruby
kristopolous [kristopolous!~chris@204.154.109.20] has joined #ruby
<kristopolous>
so I have a class, and I want to compare an instance of it to a string, does ruby do type coercion to a string and if so, can I define how that type coercion would work?
roadze [roadze!~roadze@119.224.137.97] has joined #ruby
<tar_>
kristopolous: it uses the equality method defined on the left hand side ("asdf" == obj would use String#==) and I don't think String's coerces
<tar_>
kristopolous: "coercion" to String is calling to_s on an object, and you can override that method to do whatever
_kinderman [_kinderman!~kinderman@74.201.7.111] has joined #ruby
<Zal>
if I "require Math", for example, are the contents of the Math gem inserted into the global scope?
Behi [Behi!~Behi@203-206-227-95.perm.iinet.net.au] has joined #ruby
replore_ [replore_!~replore@203.152.213.161.static.zoot.jp] has joined #ruby
<banisterfiend>
Zal: yes of course
<banisterfiend>
but no modules are included by default
<Zal>
banisterfiend, ok, but I can still access modules using "Math::SomeModule" syntax?
<Zal>
just learning about scoping now
<banisterfiend>
Zal: Yeah
<Zal>
cool, thank you
<banisterfiend>
Zal: learn about modules
<Zal>
getting there ... :-)
<banisterfiend>
modules are probably not what u think they are ;)
<Zal>
seems like modules are sort of abstract superclasses
<banisterfiend>
Zal: except they're not abstract
<banisterfiend>
:P
<Zal>
banisterfiend, ok, but they can't be instantiated, right?
<banisterfiend>
Zal: yeah they cant be
<banisterfiend>
basically a module is quite different to anything in another language
<banisterfiend>
and they have many different use-cases in ruby too
dnjaramba_ [dnjaramba_!~dnjaramba@41.72.193.86] has joined #ruby
<banisterfiend>
they're kind of multipurpose but pretty powerful
<Zal>
very well, I will do my best to avoid making assumptions about them
looopy [looopy!~looopy@pool-141-156-47-88.washdc.btas.verizon.net] has joined #ruby
tomzx [tomzx!~tomzx@dsl-59-207.aei.ca] has joined #ruby
cooper [cooper!~mitchell@unaffiliated/furryfishy] has joined #ruby
skinnymuch [skinnymuch!~skinnymuc@c-68-36-123-133.hsd1.nj.comcast.net] has joined #ruby
bwlang [bwlang!~anonymous@static-71-245-233-146.bstnma.fios.verizon.net] has joined #ruby
VitaoDoidao [VitaoDoidao!vitao@66.197.174.10] has joined #ruby
wilmoore_ [wilmoore_!~wilmoore@70-89-165-49-ISTS-co.hfc.comcastbusiness.net] has joined #ruby
<shevy>
a module is basically a crippled class
Seisatsu [Seisatsu!~seisatsu@2001:c08:3700:ffff::53b] has joined #ruby
<shevy>
"Good design adds value faster than it adds cost." - Thomas C. Gale
_numbers [_numbers!~xxxxxx@unaffiliated/numbers/x-253875] has quit [#ruby]
dankest [dankest!~dankest@ip68-108-246-82.sb.sd.cox.net] has joined #ruby
chubba [chubba!~chubba@cpc5-dund11-2-0-cust410.sgyl.cable.virginmedia.com] has joined #ruby
WhiteHorse [WhiteHorse!~WhiteHors@201.208.150.8] has joined #ruby
<joallard>
My point was that a method that returns the block would be nice in Ruby
jonathan___ [jonathan___!~jonathan@121.33.101.79] has joined #ruby
<joallard>
send was a mere example
<joallard>
But great solution nevertheless
<jonathan___>
Hi all, new in Ruby and I've problems among my require ... The logic and tests with Rspec work fine and now I want just to write a small Ruby script to do some examples
drd2 [drd2!53a0482e@gateway/web/freenode/ip.83.160.72.46] has joined #ruby
waspyrr [waspyrr!~waspyrr@dyndsl-085-016-099-229.ewe-ip-backbone.de] has joined #ruby
ixti [ixti!~ixti@251.Red-88-25-53.staticIP.rima-tde.net] has joined #ruby
NinoScript [NinoScript!~Adium@pc-55-124-83-200.cm.vtr.net] has quit [#ruby]
bwlang [bwlang!~anonymous@static-71-245-233-146.bstnma.fios.verizon.net] has joined #ruby
ixti [ixti!~ixti@251.Red-88-25-53.staticIP.rima-tde.net] has joined #ruby
andysparsons [andysparsons!~andy@64.134.96.55] has joined #ruby
LittleBill902__ [LittleBill902__!smith@c-71-197-103-184.hsd1.ca.comcast.net] has joined #ruby
jbpros_ [jbpros_!~jbpros@180.59-66-87.adsl-dyn.isp.belgacom.be] has joined #ruby
Ch4rAzZz [Ch4rAzZz!~jiri@HSI-KBW-046-005-196-147.hsi8.kabel-badenwuerttemberg.de] has joined #ruby
codefriar [codefriar!~codefriar@ip-200.it.rdu.bandwidth.com] has joined #ruby
andysparsons_ [andysparsons_!~andy@64.134.70.225] has joined #ruby
ph^ [ph^!~ph^@cm-84.212.225.74.getinternet.no] has joined #ruby
andysparsons_ [andysparsons_!~andy@64.134.70.225] has quit [#ruby]
szallol [szallol!~quassel@94.52.237.103] has joined #ruby
closedbook [closedbook!~christono@cpe-098-027-049-159.nc.res.rr.com] has joined #ruby
Aaaarg [Aaaarg!~Arthur@121-74-32-101.telstraclear.net] has joined #ruby
<closedbook>
hi all, why does puts "hello" and "goodbye" return nil? shouldn't it return false since it's a boolean expression and nil evaluates to false anyway?
<Afal>
no
<rippa>
it's short-circuiting
<rippa>
nil evaluates to nil and second operand is not evaluated
<Afal>
puts always returns nil
<rippa>
nil and p 1
cousine [cousine!~cousine@196.218.42.9] has joined #ruby
<rippa>
I guess he meant that it prints nil
<rippa>
or maybe not
<rippa>
because it doesn't print anything
<closedbook>
ah, short circuiting.. ok
<Afal>
rippa: it prints "hello" and returns nil
RomD [RomD!~Roman@nrbg-4dbe3bd9.pool.mediaWays.net] has joined #ruby
<rippa>
then yes
<closedbook>
well, it prints "hello", but returns nil as well. So when nil is returned, the evaluation ends
<rippa>
it returns nil because it always returns nil
<rippa>
didn'l look at it closely
<rippa>
also it is evaluated as
rippa [rippa!~splitta@85.158.54.234] has quit ["herp derp"]
nanderoo [nanderoo!~nanders@38.124.137.226] has joined #ruby
Bottlecruiser [Bottlecruiser!~splitta@85.158.54.234] has joined #ruby
kennethreitz [kennethreitz!~kennethre@c-24-127-96-129.hsd1.va.comcast.net] has joined #ruby
krz [krz!~foobar@unaffiliated/krz] has joined #ruby
closedbook [closedbook!~christono@cpe-098-027-049-159.nc.res.rr.com] has quit [#ruby]
andrewpthorp [andrewpthorp!~andrewpth@c-98-244-88-92.hsd1.va.comcast.net] has joined #ruby
pusewicz_ [pusewicz_!u2036@gateway/web/irccloud.com/x-lextzzsqlovrimsa] has joined #ruby
wmoxam [wmoxam!~wmoxam@206-248-153-55.dsl.teksavvy.com] has joined #ruby
srid [srid!u3297@gateway/web/irccloud.com/x-swfgjfnsuxokgfub] has joined #ruby
crankycoder [crankycoder!~crankycod@24-246-44-226.cable.teksavvy.com] has joined #ruby
berserkr [berserkr!~david@212.122.111.205.dyn.user.ono.com] has joined #ruby
nonotza [nonotza!~nonotza@cpe-72-225-173-7.nyc.res.rr.com] has joined #ruby
tatsuya_o [tatsuya_o!~tatsuya_o@EM114-48-106-0.pool.e-mobile.ne.jp] has joined #ruby
TheShadowFog [TheShadowFog!~TheShadow@ool-1826fa3a.dyn.optonline.net] has joined #ruby
Manhose [Manhose!~Manhose@193.136.33.133] has joined #ruby
jredville [jredville!u3362@gateway/web/irccloud.com/x-ybogpgzefuoyosds] has joined #ruby
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby
dotemacs [dotemacs!u801@gateway/web/irccloud.com/x-hykadlxyfowakthr] has joined #ruby
TheShadowFog [TheShadowFog!~TheShadow@ool-1826fa3a.dyn.optonline.net] has joined #ruby
adac [adac!~adac@85-127-39-241.dynamic.xdsl-line.inode.at] has joined #ruby
<adac>
Hi guys. I currently do read out a file like this: <%= File.open(File.expand_path('~') + "/SomeLofFile.log") { |f| f.read } %> But unfotunately when I do this all the formatting seems to be lost. Any ides how to preserve the format?
Imistash [Imistash!~v@77.242.201.52] has joined #ruby
<workmad3>
adac: are you spitting it out into HTML?
Mohan [Mohan!~nixh0st@unaffiliated/mohan] has joined #ruby
MetaCosm [MetaCosm!u514@gateway/web/irccloud.com/x-sdnldqwafuzlfehi] has joined #ruby
<adac>
workmad3, yes this happens within an erb file
<workmad3>
adac: yeah... then the formatting isn't lost
<Imistash>
hello all, what is the best way to write a setup.rb file for a ruby application ? concretly I need something to install somes gem, create a conf file in /etc , ... :) Thanks for help :)
<workmad3>
adac: but you'd need to translate it to HTML... HTML rendering ignores things like newlines and whitespace stretches
theRoUS [theRoUS!KenCoar@nat/redhat/x-htleaxhrmmttjiae] has joined #ruby
theRoUS [theRoUS!KenCoar@apache/committer/coar] has joined #ruby
<workmad3>
adac: or you could spit it out into a <pre> block
<workmad3>
adac: which will preserve whitespace etc :)
<adac>
workmad3, ah pre that would work, yes
thoraxe [thoraxe!~thoraxe@50-73-95-6-static.hfc.comcastbusiness.net] has joined #ruby
<adac>
:)
Synthead [Synthead!~max@173-165-179-126-atlanta.hfc.comcastbusiness.net] has joined #ruby
<adac>
lets try this, because it sounds supereasy :)
lorenzo [lorenzo!~quassel@217.33.106.3] has joined #ruby
<workmad3>
adac: also, maybe do File.join(File.expand_path('~'), 'SomeLofFile.log") instead of string concating with the /
<workmad3>
adac: not to mention that ~ may not be what you expect if you're going to run this inside a webserver at some point ;)
<adac>
workmad3, ;)
<adac>
I always start it as the correct user :P
closedbracket [closedbracket!~closedbra@cpe-098-024-125-117.carolina.res.rr.com] has joined #ruby
GSpotAssassin [GSpotAssassin!u4086@gateway/web/irccloud.com/x-qarktvvoyswctpth] has joined #ruby
<workmad3>
adac: just warning :)
<adac>
:)
lorenzo_ [lorenzo_!~quassel@217.33.106.3] has joined #ruby
failshell [failshell!~failshell@li286-190.members.linode.com] has joined #ruby
Spockz` [Spockz`!~Spockz@21pc198.sshunet.nl] has joined #ruby
cousine_ [cousine_!~cousine@196.218.42.9] has joined #ruby
Targen [Targen!~iguana@190.39.181.108] has joined #ruby
kuadrosx [kuadrosx!~quassel@186.87.191.80] has joined #ruby
dkannan [dkannan!u480@gateway/web/irccloud.com/x-kotmemyffzbfphtw] has joined #ruby
cesario [cesario!u2444@gateway/web/irccloud.com/x-arpwgxdeqqojjrqh] has joined #ruby
tommyvyo [tommyvyo!~tommyvyo@38.123.129.115] has joined #ruby
jomz [jomz!~jomz@83.101.71.187] has joined #ruby
davidboy [davidboy!u3228@gateway/web/irccloud.com/x-nctgusbtlgkvpnpg] has joined #ruby
deweysmith [deweysmith!u3113@gateway/web/irccloud.com/x-pmthoxdeoauxllzr] has joined #ruby
ElitestFX [ElitestFX!~ElitestFX@unaffiliated/elitestfx] has joined #ruby
<jomz>
is there a variation on array.pop/shift that returns the array instead of the popped/shifted item?
bier|tp [bier|tp!~bier@p57999BC6.dip.t-dialin.net] has joined #ruby
<jomz>
nm, going with array[0..-2]
iocor [iocor!~textual@unaffiliated/iocor] has joined #ruby
tatsuya_o [tatsuya_o!~tatsuya_o@EM114-48-106-0.pool.e-mobile.ne.jp] has joined #ruby
evantravers [evantravers!~textual@fw.luckie.net] has joined #ruby
<shevy>
hehe
monkey13 [monkey13!~monkey13@38.98.137.29] has joined #ruby
patricksroberts [patricksroberts!u3278@gateway/web/irccloud.com/x-babimndtydgywvtr] has joined #ruby
kaneda_ [kaneda_!~kaneda@5ad75508.bb.sky.com] has joined #ruby
lorenzo_ [lorenzo_!~quassel@217.33.106.3] has joined #ruby
yekta [yekta!~yekta@r74-192-21-77.bcstcmta01.clsttx.tl.dh.suddenlink.net] has joined #ruby
cloudgeek [cloudgeek!~geekruby@59.177.56.225] has joined #ruby
Sailias [Sailias!~jonathan@99.234.118.225] has joined #ruby
otakutomo [otakutomo!~otakutomo@KD027083117212.ppp-bb.dion.ne.jp] has joined #ruby
iceduzi [iceduzi!~iceduzi@fat.tng-business.de] has joined #ruby
yfeldblum [yfeldblum!~Jay@pool-71-246-76-76.bltmmd.east.verizon.net] has joined #ruby
Cervajz [Cervajz!~Cervajz@opensuse/member/Cervajz] has joined #ruby
kapowaz [kapowaz!u546@gateway/web/irccloud.com/x-xswdzztbtviatckl] has joined #ruby
norex [norex!~quassel@41-133-239-177.dsl.mweb.co.za] has joined #ruby
pvh [pvh!u717@gateway/web/irccloud.com/x-vfmtfkcwqrlvstob] has joined #ruby
dazoakley [dazoakley!~dazoakley@hocuspokus.vm.bytemark.co.uk] has joined #ruby
pkondzior [pkondzior!u768@gateway/web/irccloud.com/x-vvgrfgdyxdbhfdkn] has joined #ruby
akem [akem!~akem@unaffiliated/akem] has joined #ruby
joast [joast!~rick@76.178.187.164] has joined #ruby
evantravers [evantravers!~textual@fw.luckie.net] has joined #ruby
jomz [jomz!~jomz@83.101.71.187] has quit [#ruby]
vjacob [vjacob!~vjacob@94-195-174-165.zone9.bethere.co.uk] has joined #ruby
bwlang [bwlang!~anonymous@70-91-134-14-ma-ne.hfc.comcastbusiness.net] has joined #ruby
fcoury [fcoury!u2238@gateway/web/irccloud.com/x-bapzrafxdgszpuux] has joined #ruby
srid [srid!u3297@gateway/web/irccloud.com/x-sfiacrwwmbcduvgh] has joined #ruby
srid [srid!u3297@unaffiliated/srid] has joined #ruby
srid [srid!u3297@gateway/web/irccloud.com/x-sfiacrwwmbcduvgh] has joined #ruby
heftig [heftig!jan@archlinux/developer/heftig] has joined #ruby
pen [pen!~pen@2001:288:1001:28:91a2:7458:f606:d265] has joined #ruby
kapowaz [kapowaz!u546@gateway/web/irccloud.com/x-adcqmiijhvnitczq] has joined #ruby
pkondzior [pkondzior!u768@gateway/web/irccloud.com/x-ujeyzfyqkodkpocc] has joined #ruby
TheShadowFog [TheShadowFog!~TheShadow@ool-1826fa3a.dyn.optonline.net] has joined #ruby
GSpotAssassin [GSpotAssassin!u4086@gateway/web/irccloud.com/x-hgzwiwqxchhkhftf] has joined #ruby
jredville [jredville!u3362@gateway/web/irccloud.com/x-bpwwxitxqrsymerp] has joined #ruby
dnyy [dnyy!u2106@gateway/web/irccloud.com/x-eaweeriprjcvqtid] has joined #ruby
trivol [trivol!~aurelien@gra94-1-81-57-175-179.fbx.proxad.net] has joined #ruby
cloudgeek [cloudgeek!~geekruby@59.177.56.225] has joined #ruby
bbttxu [bbttxu!~adam@nt8rsctf1.unt.ad.unt.edu] has joined #ruby
deweysmith [deweysmith!u3113@gateway/web/irccloud.com/x-cdkhzuhjrfpikmly] has joined #ruby
dotemacs [dotemacs!u801@gateway/web/irccloud.com/x-mrwgfmxsoqqhdihq] has joined #ruby
spyvsspy [spyvsspy!~nonenone@209.145.177.162] has joined #ruby
jgarvey [jgarvey!~jgarvey@cpe-174-097-248-211.nc.res.rr.com] has joined #ruby
abstrusenick [abstrusenick!~abstrusen@bb116-15-213-210.singnet.com.sg] has joined #ruby
enikar [enikar!~gil@cl-140.mrs-01.fr.sixxs.net] has joined #ruby
chesh [chesh!~mark@15.Red-81-38-77.dynamicIP.rima-tde.net] has joined #ruby
blischalk [blischalk!~brettlisc@173-165-48-46-Illinois.hfc.comcastbusiness.net] has joined #ruby
iocor_ [iocor_!~textual@eduroam-wireless-pat2.nomadic.bris.ac.uk] has joined #ruby
codefriar [codefriar!~codefriar@ip-200.it.rdu.bandwidth.com] has joined #ruby
jensn [jensn!~Jens@c-83-233-145-148.cust.bredband2.com] has joined #ruby
shevy [shevy!~shevy@178-191-179-93.adsl.highway.telekom.at] has joined #ruby
bbttxu [bbttxu!~adam@nt8rsctf1.unt.ad.unt.edu] has joined #ruby
tobiassvn [tobiassvn!u4832@gateway/web/irccloud.com/x-yzxfesxyjaphqyiv] has joined #ruby
asobrasil [asobrasil!~asantioli@palpatine.privatedns.com] has joined #ruby
nonotza [nonotza!~nonotza@66.246.94.130] has joined #ruby
tatsuya_o [tatsuya_o!~tatsuya_o@EM114-48-106-0.pool.e-mobile.ne.jp] has joined #ruby
Mohan [Mohan!~nixh0st@cpc1-slou1-2-0-cust65.haye.cable.virginmedia.com] has joined #ruby
Mohan [Mohan!~nixh0st@unaffiliated/mohan] has joined #ruby
dkannan [dkannan!u480@gateway/web/irccloud.com/x-bpsnvwfftfbtjtgo] has joined #ruby
denysonique__ [denysonique__!u484@gateway/web/irccloud.com/x-figgbcabhtugdgkm] has joined #ruby
albemuth [albemuth!~albemuth@201.198.78.18] has joined #ruby
relix [relix!u2146@gateway/web/irccloud.com/x-bbmqzglperhowebl] has joined #ruby
Spockz [Spockz!~Spockz@21pc198.sshunet.nl] has joined #ruby
rippa [rippa!~rippa@87-253-28-78.pppoe.yaroslavl.ru] has joined #ruby
ceej [ceej!~anonymous@cpe-72-190-40-203.tx.res.rr.com] has joined #ruby
karinsofia [karinsofia!~s@signo.lha.sgsnet.se] has joined #ruby
dotnull [dotnull!~DotNull@office.t8webware.com] has joined #ruby
blischalk [blischalk!~brettlisc@173-165-48-46-Illinois.hfc.comcastbusiness.net] has joined #ruby
<dr_bob>
jomz there's also slice
<dr_bob>
oh, too late
ryh [ryh!~ryh@host-174-45-115-181.bzm-mt.client.bresnan.net] has joined #ruby
Manhose [Manhose!~Manhose@193.136.33.133] has joined #ruby
axl_ [axl_!~axl@173-11-52-113-Minnesota.hfc.comcastbusiness.net] has joined #ruby
jwmann [jwmann!~Adium@modemcable032.85-202-24.mc.videotron.ca] has joined #ruby
fts [fts!~dz@cl-1278.cgn-01.de.sixxs.net] has joined #ruby
fts [fts!~dz@cl-1278.cgn-01.de.sixxs.net] has quit [#ruby]
<adac>
workmad3, hmm <%= File.open(File.expand_path('~') + "/SomeLogFile.log") { |f| f.read } %> doesn't seem to show me the whole log file, but only a part... do you may have an idea why this is so?
DrShoggoth [DrShoggoth!~prakwtf@68-188-73-250.static.stls.mo.charter.com] has joined #ruby
andrewhl [andrewhl!~andrew@24-246-15-43.cable.teksavvy.com] has joined #ruby
kennethreitz [kennethreitz!~kennethre@c-24-127-96-129.hsd1.va.comcast.net] has joined #ruby
wmoxam [wmoxam!~wmoxam@76.9.195.38] has joined #ruby
jbpros [jbpros!~jbpros@180.59-66-87.adsl-dyn.isp.belgacom.be] has joined #ruby
wilmoore [wilmoore!~wilmoore@c-67-190-17-108.hsd1.co.comcast.net] has joined #ruby
kennethreitz [kennethreitz!~kennethre@c-24-127-96-129.hsd1.va.comcast.net] has joined #ruby
azbarcea__ [azbarcea__!~quassel@79.118.7.231] has joined #ruby
emmanuel_ [emmanuel_!~emmanuel@2a01:e35:2e4d:9010:21d:60ff:fe0e:b818] has joined #ruby
Morkel [Morkel!~Morkel@xdsl-87-78-205-136.netcologne.de] has joined #ruby
<failshell>
i'm trying to use the following syntax: (1.."#{variable}").each
<failshell>
but im getting a bad value for range
<failshell>
what am i doing wrong?
<failshell>
damn, just found it
_debo [_debo!~marco.deb@cpc18-enfi16-2-0-cust743.hari.cable.virginmedia.com] has joined #ruby
S1kx [S1kx!~S1kx@ip-95-223-80-198.unitymediagroup.de] has joined #ruby
S1kx [S1kx!~S1kx@pdpc/supporter/monthlybyte/s1kx] has joined #ruby
mmokrysz [mmokrysz!~mmokrysz@pdpc/supporter/student/mmokrysz] has joined #ruby
<shevy>
failshell I guess "variable" was not an integer
Cervajz [Cervajz!~Cervajz@opensuse/member/Cervajz] has joined #ruby
<shevy>
1.."s" # ArgumentError: bad value for range
zerdman [zerdman!~zerdman@71.255.123.66] has joined #ruby
nonotza [nonotza!~nonotza@66.246.94.130] has joined #ruby
<dr_bob>
failshell: you have a range with mixed types Fixnum and String. Why the String interpolation?
<dr_bob>
why not jus (1..variable),each ...
<samuelkadolph>
shevy: You can't create a range with 2 different types
<failshell>
dr_bob: ya noob mistake :)
<failshell>
realised my error once i finished asking here
<dr_bob>
:-)
<shevy>
samuelkadolph why do you tell that to me? :-)
<samuelkadolph>
shevy: Because you didn't notice the actual problem
<shevy>
I did not?
<samuelkadolph>
[10:36:38] <shevy> failshell I guess "variable" was not an integer
<shevy>
and?
<samuelkadolph>
Even if variable was a number, it would still be trying to create a range between a number and a string.
<shevy>
hmm you are right
<failshell>
look at this, my noobness starting a mini flame hehe
Mohan [Mohan!~nixh0st@unaffiliated/mohan] has joined #ruby
<shevy>
no, that's ok, samuelkadolph is correct
<Zal>
if a function *might* mutate one of its arguments, is it conventional to name the function with a "!" ?
<samuelkadolph>
Zal: No
<Zal>
what is ! used for?
<Zal>
(as part of a function name)
<samuelkadolph>
ruby convention is to use ! when the method mutates it's receiver and there isn't a non mutating method
<samuelkadolph>
Such as String#gsub!
<Zal>
isn't, or is?
<Tasser>
samuelkadolph, beware of rails ^^
<dr_bob>
Zal: typically for methods which change the receiver. generally it just means "watch out!"
<samuelkadolph>
Active record's convention is that ! raises an exception instead of returning nil
<samuelkadolph>
dr_bob: No, ! does not mean watch out
<Zal>
hm, I think I do mean "change the receiver" when I say "mutates its arguments"
<samuelkadolph>
No
<samuelkadolph>
The receiver is self
<Zal>
oh, in-place
<dr_bob>
samuelkadolph: what then?
<Zal>
samuelkadolph, thank you
<samuelkadolph>
"abc".gsub!("b", "c") mutates the string
<Zal>
dr_bob, thanks
jbpros [jbpros!~jbpros@180.59-66-87.adsl-dyn.isp.belgacom.be] has joined #ruby
<samuelkadolph>
While gsub would return a new string that was mutated, preserving the original
iocor [iocor!~textual@unaffiliated/iocor] has joined #ruby
<Zal>
ok, got it
v4n_ [v4n_!~v4n@2607:fad8:4:0:224:d7ff:feb0:42e8] has joined #ruby
<dr_bob>
samuelkadolph: Matz said "!" means "dangerous method".
<samuelkadolph>
dr_bob: It depends on the author. The only well defined conventions are mutating vs non mutating and AR's exception raising
mmokrysz [mmokrysz!~mmokrysz@pdpc/supporter/student/mmokrysz] has quit [#ruby]
v0n [v0n!~v4n@2607:fad8:4:0:224:d7ff:feb0:42e8] has joined #ruby
* failshell
sits here pretending he understands all that mumbo jumbo!
<samuelkadolph>
dr_bob: There are lots of methods that are "dangerous" that don't have a bang.
<dr_bob>
samuelkadolph: you can dig up Matz's statement in ruby-talk archive. It just happens that often we have meth and meth! where meth! might mutate self.
<shevy>
whoa
<shevy>
a "dangerous" method
<shevy>
are there also cute and fluffy methods?
<samuelkadolph>
Person.new(shevy).kill!
<shevy>
:(
<dr_bob>
samuelkadolph: wrong logic, if ! means dangerous it does not mean that other methods are not dangerous
<shevy>
terrorist methods!!!
<dr_bob>
shevy: ? is for fluffy :-)
<shevy>
do not use them!!!
<v0n>
usually, if I need a new feature, is that better to extend an existing module, or should I better write a function in an Helpers module or something?
<samuelkadolph>
v0n: You can't subclass modules if that's what you are trying to do
<samuelkadolph>
dr_bob: That doesn't make sense.
Pip [Pip!~Pip@unaffiliated/pip] has joined #ruby
<dr_bob>
samuelkadolph: why?
<shevy>
v0n well you need the functionality, right? so you have to make either a change in an existing module, or in your code
<samuelkadolph>
There are 2 conventions for bang methods in ruby and that's all you can really say about bang methods
<v0n>
e.g. I need to convert a Time in seconds, so should I create a Helpers::time_to_sec(time) method or create Time.to_sec ?
<dr_bob>
v0n: Time has already such a method
<shevy>
v0n on a per-project basis, when I make modifications to ruby core classes, I bundle all those modifications into one file
<shevy>
the first variant would seem better I think v0n
g0bl1n [g0bl1n!~prokter@a213-22-27-14.cpe.netcabo.pt] has joined #ruby
g0bl1n [g0bl1n!~prokter@unaffiliated/g0bl1n] has joined #ruby
Pip [Pip!~Pip@host-90-156-66-217.spbmts.ru] has joined #ruby
Pip [Pip!~Pip@unaffiliated/pip] has joined #ruby
<samuelkadolph>
dr_bob: Read that blog post I linked and you'll see why ! doesn't mean dangerous method.
<v0n>
dr_bob, really? I you meant Time.to_i that's not exactly what I need
<dr_bob>
v0n: what DO you need?
airhorns [airhorns!~airhorns@76-10-166-126.dsl.teksavvy.com] has joined #ruby
<dr_bob>
samuelkadolph: "The ! in method names that end with ! means, “This method is dangerous”—or, more precisely, this method is the “dangerous” version of an otherwise equivalent method, with the same name minus the !"
<failshell>
anyone here using sinatra who would point me in the right direction. i'm trying to load a view, and then stream data to it. the streaming part i can handle fine, but it doesn't load my view :(
pen [pen!~pen@g1pc2n249.g1.ntu.edu.tw] has joined #ruby
Pip [Pip!~Pip@unaffiliated/pip] has joined #ruby
<dr_bob>
v0n: that's more like #seconds_since_midnight.
<DrShoggoth>
is there a way to turn an array into a hash? [ 1,2,3,4 ] to { 1=>2, 3=>4 } ?
<samuelkadolph>
DrShoggoth: Hash[1,2,3,4]
<dr_bob>
DrShoggoth: Hash[*arr]
<DrShoggoth>
oic, easy enough, thanks :D
dr_bob [dr_bob!c100f615@gateway/web/freenode/ip.193.0.246.21] has quit [#ruby]
ceej [ceej!~anonymous@cpe-72-190-40-203.tx.res.rr.com] has joined #ruby
looopy [looopy!~looopy@pool-151-200-236-181.washdc.btas.verizon.net] has joined #ruby
tomhsx [tomhsx!~tomhsx@c-76-109-169-195.hsd1.fl.comcast.net] has joined #ruby
<v0n>
#seconds_since_midnight is an active_record method... Do not mix Ruby and RoR...
<DrShoggoth>
another thing, is there a way to spit out mutiple values per iteration in a map? [ 1,2,3 ].map { |v| v, v*10 }
<DrShoggoth>
i know that doesn't work ^^^^
<samuelkadolph>
DrShoggoth: You can return an array and flatten at the end
DMKE [DMKE!~DMKE@pdpc/supporter/student/dmke] has joined #ruby
<DrShoggoth>
ah, yes that would be fine, thanks again
<Mon_Ouie>
flat_map
<Mon_Ouie>
(that's a method from Enumerable)
sorin [sorin!~sorin@66-168-187-62.dhcp.gwnt.ga.charter.com] has joined #ruby
<samuelkadolph>
Mon_Ouie: Interesting
tatsuya_o [tatsuya_o!~tatsuya_o@27-142-96-128.rev.home.ne.jp] has joined #ruby
dwebb [dwebb!~mars@e177102254.adsl.alicedsl.de] has joined #ruby
<dwebb>
hi
blueadept [blueadept!~blueadept@unaffiliated/blueadept] has joined #ruby
<dwebb>
is there a good ruby library that handles deb packages or acts a bit like apt?
<dwebb>
i want to be able to install certain packages and it would be great if i do not use the command line directly
eywu [eywu!~Adium@205-170-107-4.dia.static.qwest.net] has joined #ruby
<failshell>
dwebb: you should look into chef
<v0n>
shevy, how do you usually name that single file containing all modifications to Ruby core classes? :D
<dwebb>
failshell: ok thanks
<shevy>
v0n hmm
flip_digits [flip_digits!~textual@c-76-122-14-228.hsd1.fl.comcast.net] has joined #ruby
<shevy>
v0n core/extensions.rb
<shevy>
unfortunately...
<shevy>
it has another name in another project ... :\ :/
<shevy>
but I shall overcome this inconsistency eventually!
<shevy>
oh
rtsph [rtsph!rtsph@gateway/shell/xzibition.com/x-pormamcwmgsbmiki] has joined #ruby
<shevy>
the other file is called extensions.rb too but it resides in the directory extensions/
Cervajz_ [Cervajz_!~Cervajz@48.156.broadband12.iol.cz] has joined #ruby
dankest [dankest!~dankest@wsip-174-75-64-190.sb.sd.cox.net] has joined #ruby
omry_ [omry_!~omry@DSL212-235-83-63.bb.netvision.net.il] has joined #ruby
mikepack [mikepack!~mikepack@c-98-245-117-116.hsd1.co.comcast.net] has joined #ruby
wedgeV [wedgeV!~wedge@static-96-239-100-26.nycmny.fios.verizon.net] has joined #ruby
burgestrand [burgestrand!~burgestra@h-163-174.a155.priv.bahnhof.se] has joined #ruby
<berserkr>
failshell: mod_ruby is not a good choice for my purpose. I mean for a shared hosting
<berserkr>
i'm looking for a shared hosting configuration
looopy [looopy!~looopy@pool-151-200-236-181.washdc.btas.verizon.net] has joined #ruby
Sliker [Sliker!~ponies@117.163.pn.adsl.brightview.com] has joined #ruby
Manhose__ [Manhose__!~Manhose@193.136.33.133] has joined #ruby
looopy [looopy!~looopy@pool-151-200-236-181.washdc.btas.verizon.net] has joined #ruby
Guest76161 [Guest76161!~awesome@212.62.202.84.customer.cdi.no] has joined #ruby
jergason [jergason!~jergason@c-67-161-248-217.hsd1.ut.comcast.net] has joined #ruby
thatryan [thatryan!~thatryan@c-24-4-167-46.hsd1.ca.comcast.net] has joined #ruby
omry_ [omry_!~omry@DSL212-235-83-63.bb.netvision.net.il] has joined #ruby
gabrielcsf [gabrielcsf!~gabrielcs@200-225-197-223.static.ctbctelecom.com.br] has joined #ruby
jgrimes [jgrimes!~jg@cpe-071-070-140-012.nc.res.rr.com] has joined #ruby
bier [bier!~bier@p54A5BDAE.dip.t-dialin.net] has joined #ruby
iocor [iocor!~textual@cpc1-aztw25-2-0-cust6.aztw.cable.virginmedia.com] has joined #ruby
iocor [iocor!~textual@unaffiliated/iocor] has joined #ruby
bier|tp [bier|tp!~bier@p54A5BDAE.dip.t-dialin.net] has joined #ruby
abner_ [abner_!~abner@200-225-197-223.static.ctbctelecom.com.br] has joined #ruby
Hellojere [Hellojere!~Hellojere@89.7.90.160] has joined #ruby
blischalk_ [blischalk_!~brettlisc@173-165-48-46-Illinois.hfc.comcastbusiness.net] has joined #ruby
bluOxigen [bluOxigen!ssf@unaffiliated/bluOxigen] has joined #ruby
advorak [advorak!~advorak@216-15-23-116.c3-0.161-ubr1.lnh-161.md.cable.rcn.com] has joined #ruby
fr0gprince_ [fr0gprince_!Bart@178-85-90-223.dynamic.upc.nl] has joined #ruby
gabrielcsf [gabrielcsf!~gabrielcs@200-225-197-223.static.ctbctelecom.com.br] has quit ["Leaving"]
symb0l [symb0l!~symb0l@c-50-131-187-183.hsd1.ca.comcast.net] has joined #ruby
nowthatsamatt [nowthatsamatt!~nowthatsa@rrcs-71-43-23-18.se.biz.rr.com] has joined #ruby
michaelh [michaelh!~Michael@c-98-213-112-209.hsd1.il.comcast.net] has joined #ruby
Jrz [Jrz!~jrz@d152222.upc-d.chello.nl] has joined #ruby
thone_ [thone_!~thone@e179081037.adsl.alicedsl.de] has joined #ruby
mengu [mengu!~mengu@unaffiliated/mengu] has joined #ruby
craigglennie [craigglennie!~craigglen@173-167-99-61-sfba.hfc.comcastbusiness.net] has joined #ruby
adeponte [adeponte!~adeponte@67.110.253.162.ptr.us.xo.net] has joined #ruby
chaddow [chaddow!~chaddow@173-161-238-6-Philadelphia.hfc.comcastbusiness.net] has joined #ruby
chaddow [chaddow!~chaddow@173-161-238-6-Philadelphia.hfc.comcastbusiness.net] has quit [#ruby]
mafolz [mafolz!~mafolz@dhcp50-203.start.uni-saarland.de] has joined #ruby
<Zal>
do I need to escape {} characters inside a character class in a regex? Is [{}] ok to match '{' or '}' ?
chaddow [chaddow!~chaddow@173-161-238-6-Philadelphia.hfc.comcastbusiness.net] has joined #ruby
_md [_md!~mduarte@141.0.34.138] has joined #ruby
<rippa>
works fine
FlyingFoX [FlyingFoX!~quassel@sanktwendel.weh.RWTH-Aachen.DE] has joined #ruby
<Zal>
rippa, cool, thanks for the verification.
omry_ [omry_!~omry@DSL212-235-83-63.bb.netvision.net.il] has joined #ruby
bastilian [bastilian!~bastilian@chello062178156107.9.14.vie.surfer.at] has joined #ruby
ceej [ceej!~anonymous@cpe-72-190-40-203.tx.res.rr.com] has joined #ruby
pootpoot [pootpoot!~pootpoot@38.108.250.130] has joined #ruby
yxhuvud [yxhuvud!mongo@h-17-224.a149.priv.bahnhof.se] has joined #ruby
apeiros_ [apeiros_!~apeiros@77-58-115-24.dclient.hispeed.ch] has joined #ruby
Brozilla [Brozilla!~Brozilla@ip11-49-212-87.adsl2.static.versatel.nl] has joined #ruby
alfism [alfism!~alfism@2620:149:4:1201:88aa:d029:f458:921b] has joined #ruby
jergason [jergason!~jergason@c-67-161-248-217.hsd1.ut.comcast.net] has joined #ruby
Sailias [Sailias!~jonathan@99.234.118.225] has joined #ruby
DMKE [DMKE!~DMKE@pdpc/supporter/student/dmke] has joined #ruby
Araxia [Araxia!~Araxia@173-164-68-213-Oregon.hfc.comcastbusiness.net] has joined #ruby
eldariof [eldariof!~CLD@81.200.24.162] has joined #ruby
voodoofish430 [voodoofish430!~mtorres@NAT5.pas.idealab.com] has joined #ruby
headius [headius!~headius@71-210-151-185.mpls.qwest.net] has joined #ruby
maletor [maletor!~maletor@74.115.25.139] has joined #ruby
Tuxist [Tuxist!~quassel@dyndsl-091-096-126-113.ewe-ip-backbone.de] has joined #ruby
airhorns [airhorns!~airhorns@206-248-184-147.dsl.teksavvy.com] has joined #ruby
kenichi [kenichi!~kenichi@c-24-20-239-11.hsd1.or.comcast.net] has joined #ruby
Optimis [Optimis!~Optimis@cpe-98-149-171-51.socal.res.rr.com] has joined #ruby
josh_ [josh_!~josh@74-95-43-126-Oregon.hfc.comcastbusiness.net] has joined #ruby
d2dchat [d2dchat!~d2dchat@173-167-20-129-michigan.hfc.comcastbusiness.net] has joined #ruby
adamkittelson [adamkittelson!~adamkitte@c-24-23-252-19.hsd1.ca.comcast.net] has joined #ruby
<zykes->
what should one use over chili project or redmine ?
<shevy>
what
<shevy>
redmine is neat though
<zykes->
isn't chiliproject a "upgraded" redmine ?
altivec [altivec!~altivec@136.169.152.237] has joined #ruby
sarmiena_ [sarmiena_!~aldosarmi@2602:306:32e6:ab90:95d3:9cd:5683:fde7] has joined #ruby
BiHi [BiHi!~bihi@did75-17-88-165-129-29.fbx.proxad.net] has joined #ruby
mmokrysz [mmokrysz!~mmokrysz@pdpc/supporter/student/mmokrysz] has joined #ruby
stkowski [stkowski!~stkowski@ns25.8x8.com] has joined #ruby
eignerchris [eignerchris!~eignerchr@c-24-20-239-11.hsd1.or.comcast.net] has joined #ruby
rvmeier [rvmeier!~rodrigo@pc-136-172-241-201.cm.vtr.net] has joined #ruby
Russell^^ [Russell^^!~Russell^^@88.97.51.87] has joined #ruby
Tuxist64bit [Tuxist64bit!~quassel@dyndsl-031-150-001-129.ewe-ip-backbone.de] has joined #ruby
radic_ [radic_!~radic@dslb-178-002-234-050.pools.arcor-ip.net] has joined #ruby
cpruitt [cpruitt!~cpruitt@190-186.126-70.tampabay.res.rr.com] has joined #ruby
amerine [amerine!~mturner@208-100-137-147.bendbroadband.com] has joined #ruby
alfism [alfism!~alfism@2620:149:4:1201:5cc8:ffcf:ddbc:6ffa] has joined #ruby
Brozilla [Brozilla!~Brozilla@ip11-49-212-87.adsl2.static.versatel.nl] has joined #ruby
minijupe [minijupe!~benlieb@adsl-74-243-183-162.ard.bellsouth.net] has joined #ruby
fermo [fermo!~fermo@ppp-214-24.26-151.libero.it] has joined #ruby
PhilK [PhilK!~PhilK@2001:470:1f05:c99:21f:d0ff:fe84:e3ca] has joined #ruby
jensn [jensn!~Jens@c83-251-164-169.bredband.comhem.se] has joined #ruby
apok [apok!~apok@c-107-3-149-167.hsd1.ca.comcast.net] has joined #ruby
incluye [incluye!~incluye@216.48.138.26] has joined #ruby
Mohan [Mohan!~nixh0st@cpc1-slou1-2-0-cust65.haye.cable.virginmedia.com] has joined #ruby
Mohan [Mohan!~nixh0st@unaffiliated/mohan] has joined #ruby
Jay_Levitt [Jay_Levitt!~Jay_Levit@c-24-63-250-125.hsd1.ma.comcast.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
musl [musl!~mike@li44-23.members.linode.com] has joined #ruby
sorin [sorin!~sorin@66-168-187-62.dhcp.gwnt.ga.charter.com] has joined #ruby
milkpost_ [milkpost_!~dec@192.133.84.6] has joined #ruby
bluOxigen [bluOxigen!ssf@unaffiliated/bluOxigen] has joined #ruby
minijupe [minijupe!~benlieb@adsl-74-243-183-162.ard.bellsouth.net] has joined #ruby
seejohnrun [seejohnrun!~john@ip-160-79-101-2.autorev.intellispace.net] has joined #ruby
jamiemill [jamiemill!~jamiemill@109.204.34.154] has joined #ruby
Morkel [Morkel!~Morkel@xdsl-87-78-205-136.netcologne.de] has joined #ruby
GreaseMonkey [GreaseMonkey!~gm@121-74-67-43.telstraclear.net] has joined #ruby
GreaseMonkey [GreaseMonkey!~gm@unaffiliated/greasemonkey] has joined #ruby
ikaros [ikaros!~ikaros@dslb-084-059-073-057.pools.arcor-ip.net] has joined #ruby
DMKE [DMKE!~DMKE@pdpc/supporter/student/dmke] has joined #ruby
Helius [Helius!~Adium@93-35-209-14.ip56.fastwebnet.it] has joined #ruby
<shevy>
zykes- no idea, never heard it before
<shevy>
I heard a lot about redmine though and I think the ruby bugtracker is using it
<shevy>
and that is quite ok
<shevy>
I am a fan of github issue tracking though
<shevy>
it's such a breeze to use that, compared to i.e. bugzilla
<shevy>
I hate bugzilla!
<shevy>
trac is also annoying
bluOxigen [bluOxigen!~noreply@unaffiliated/bluOxigen] has joined #ruby
<shevy>
sourceforge reporting is ok, but sourceforge is ugly in design and has a strange usability
zommi [zommi!~quassel@HSI-KBW-078-042-009-093.hsi3.kabel-badenwuerttemberg.de] has joined #ruby
g0bl1n [g0bl1n!~prokter@a213-22-27-14.cpe.netcabo.pt] has joined #ruby
trivol [trivol!~aurelien@81.57.175.21] has joined #ruby
<zykes->
shevy: if you where to choose either redmine or chiliprojct then which
<shevy>
redmine
<shevy>
go with the mass
sepp2k [sepp2k!~sexy@g224101130.adsl.alicedsl.de] has joined #ruby
ascarter [ascarter!~ascarter@209.119.253.66] has joined #ruby
bf4648 [bf4648!~bf4648@206.248.207.14] has joined #ruby
<bf4648>
I've got some code that goes like this: $mp4_list[] = $filename;.....how do I read the contents in the array mp4_list[]?
<ReinH>
what does "read the contents" mean?
<ReinH>
and the array is $mp4_list, not mp4_list[]. mp4_list[] is calling the "[]" method on mp4_list
<bf4648>
I just want to print out the value of the array
<ReinH>
the array has multiple values
<bf4648>
yes
<ReinH>
maybe you want #inspect?
<ReinH>
it depends on what "print out the value" means to you
<bf4648>
I just want to see the values that it got
<ReinH>
ok, use inspect
joast [joast!~rick@76.178.187.164] has joined #ruby
apok_ [apok_!~apok@c-107-3-149-167.hsd1.ca.comcast.net] has joined #ruby
ryh [ryh!~ryh@host-174-45-115-181.bzm-mt.client.bresnan.net] has joined #ruby
daniel_hinojosa [daniel_hinojosa!~danno@c-68-35-182-153.hsd1.nm.comcast.net] has joined #ruby
davidcelis [davidcelis!~david@70-89-180-6-smc-or.hfc.comcastbusiness.net] has joined #ruby
sarkis_ [sarkis_!~sarkis@rrcs-173-196-183-162.west.biz.rr.com] has joined #ruby
bastilian [bastilian!~bastilian@chello062178156107.9.14.vie.surfer.at] has joined #ruby
amacgregor__ [amacgregor__!~amacgrego@CPE00222dcb0a53-CM00222dcb0a4f.cpe.net.cable.rogers.com] has joined #ruby
jwmann [jwmann!~Adium@modemcable032.85-202-24.mc.videotron.ca] has joined #ruby
mikeycgto [mikeycgto!~mikeycgto@ool-4571c9f5.dyn.optonline.net] has joined #ruby
mikeycgto [mikeycgto!~mikeycgto@pdpc/supporter/active/mikeycgto] has joined #ruby
Optimis [Optimis!~Optimis@cpe-98-149-171-51.socal.res.rr.com] has joined #ruby
Mohan [Mohan!~nixh0st@cpc1-slou1-2-0-cust65.haye.cable.virginmedia.com] has joined #ruby
looopy_ [looopy_!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby
Mohan [Mohan!~nixh0st@unaffiliated/mohan] has joined #ruby
roadze [roadze!~roadze@119.224.137.97] has joined #ruby
mikepack [mikepack!~mikepack@c-98-245-117-116.hsd1.co.comcast.net] has joined #ruby
mmokrysz [mmokrysz!~mmokrysz@pdpc/supporter/student/mmokrysz] has quit [#ruby]
Mahoek [Mahoek!~Mahoek@ip51ceb6d4.adsl-surfen.hetnet.nl] has joined #ruby
cousine [cousine!~cousine@196.218.42.9] has joined #ruby
ank [ank!~ank@c-67-172-16-188.hsd1.pa.comcast.net] has joined #ruby
nanoyak [nanoyak!~nanoyak@50-0-164-69.dsl.dynamic.sonic.net] has joined #ruby
swistak35 [swistak35!~rlasocha@s21.linuxpl.com] has joined #ruby
Squee-D [Squee-D!~Squee-D@static.visfleet.com] has joined #ruby
JonnieCache [JonnieCache!~jonnie@87.252.60.35] has joined #ruby
savage- [savage-!~savage-@209.118.197.220] has joined #ruby
tonini [tonini!~zastav@78-8.61-188.cust.bluewin.ch] has joined #ruby
elathan [elathan!~elathan@46.103.239.159] has joined #ruby
blischalk [blischalk!~brettlisc@173-165-48-46-Illinois.hfc.comcastbusiness.net] has joined #ruby
dyer [dyer!~dyer@unaffiliated/dyer] has joined #ruby
xissburg [xissburg!~xissburg@189.102.48.152] has joined #ruby
<elathan>
I have a C extension in mac os x. If compiled as .so, the interpreter is refusing to load it (the error is file not found), if I compile it as a bundle everything goes fine. Is this normal?
axl__ [axl__!~axl@173-11-52-113-Minnesota.hfc.comcastbusiness.net] has joined #ruby
apok [apok!~apok@c-107-3-149-167.hsd1.ca.comcast.net] has joined #ruby
<JonnieCache>
elathan: bundle is the standard filename for dynamic libraries in os x. so maybe that is normal behaviour
zykes- [zykes-!zykes@2001:470:28:3bc:beaf:da7e:1eaf:5af3] has joined #ruby
n8ji [n8ji!~n8ji@c-24-20-239-11.hsd1.or.comcast.net] has joined #ruby
macmartine [macmartine!~macmartin@069-064-227-254.pdx.net] has joined #ruby
<elathan>
Many extensions are built in Linux/Unix where .so is used and they can also compile in Mac OS X. However the Makefiles must be change, and this is not very convenient.
<JonnieCache>
yes i think they generally use the mkmkf.rb script to change the makefile depending on the platform
<JonnieCache>
but im not sure
jbw [jbw!~jbw@dsl-044-084.cust.imagine.ie] has joined #ruby
workmad3 [workmad3!~workmad3@cpc1-bagu10-2-0-cust81.1-3.cable.virginmedia.com] has joined #ruby
incluye [incluye!~incluye@LO1-ESR-74-215-187-208.fuse.net] has joined #ruby
incluye [incluye!~incluye@LO1-ESR-74-215-187-208.fuse.net] has joined #ruby
dotplus [dotplus!~dotplus@allgoodbits.com] has joined #ruby
friskd [friskd!~friskd@71-95-209-242.static.mtpk.ca.charter.com] has joined #ruby
<dotplus>
I want to test an erb template at the cli. I think I need to do something like erb -x <template> | ruby > output.txt but how do I pass in variables for interpolation?
iocor [iocor!~textual@unaffiliated/iocor] has joined #ruby
_md [_md!~mduarte@cpc4-finc13-2-0-cust568.4-2.cable.virginmedia.com] has joined #ruby
flip_digits [flip_digits!~textual@c-71-199-243-97.hsd1.fl.comcast.net] has joined #ruby
closedbracket [closedbracket!~closedbra@h135.39.189.173.dynamic.ip.windstream.net] has joined #ruby
pantsman [pantsman!~pantsman@2.25.203.162] has joined #ruby
pantsman [pantsman!~pantsman@pdpc/supporter/active/pantsman] has joined #ruby
colint_ [colint_!~ColinT@69-11-97-130.regn.static.sasknet.sk.ca] has joined #ruby
jbpros [jbpros!~jbpros@180.59-66-87.adsl-dyn.isp.belgacom.be] has joined #ruby
stephans [stephans!~stephans@209.66.114.6] has joined #ruby
bf4648 [bf4648!~bf4648@206.248.207.14] has quit ["Leaving"]
d-snp [d-snp!~d-snp@smurfer.student.utwente.nl] has joined #ruby
albemuth [albemuth!~albemuth@209.213.178.170] has joined #ruby
gearaholic [gearaholic!~gearaholi@c-71-238-98-243.hsd1.mi.comcast.net] has joined #ruby
looopy [looopy!~looopy@pool-151-200-236-181.washdc.btas.verizon.net] has joined #ruby
Jrz [Jrz!~jrz@d152222.upc-d.chello.nl] has joined #ruby
looopy_ [looopy_!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby
joallard [joallard!~jon@modemcable163.197-21-96.mc.videotron.ca] has joined #ruby
ChampS_ [ChampS_!~ChampS@p54B4CCDE.dip.t-dialin.net] has joined #ruby
chesh [chesh!~mark@168.Red-83-35-109.dynamicIP.rima-tde.net] has joined #ruby
kedare [kedare!~kedare@onyxia.netyxia.net] has joined #ruby
rickmasta [rickmasta!~rickmasta@pool-108-21-213-102.nycmny.fios.verizon.net] has joined #ruby
AzizLight [AzizLight!~AzizLight@85-168-220-242.rev.numericable.fr] has joined #ruby
shadoi [shadoi!~Adium@2001:5a8:4:68e1:ede2:5605:dd8a:41d2] has joined #ruby
guns [guns!~guns@c-98-228-72-208.hsd1.il.comcast.net] has joined #ruby
<DeeJayTwo>
I'm creating an instance "b" of class "Blah"
<DeeJayTwo>
I can do b.class and see it's a Blah class
<Creeture>
I'm cornfused. Any idea what would have changed my Gem::dir from last week 'til now?
<DeeJayTwo>
When I put b in a hash
<DeeJayTwo>
and read it from another method of the the same calling class
<DeeJayTwo>
I see NilClass
<DeeJayTwo>
why?
<davidcelis>
DeeJayTwo: give us a gist of exactly what you're doing
libertyprime [libertyprime!~libertypr@182.236.125.102] has joined #ruby
macmartine [macmartine!~macmartin@069-064-227-254.pdx.net] has joined #ruby
g0bl1n [g0bl1n!~prokter@a213-22-27-14.cpe.netcabo.pt] has joined #ruby
<ReinH>
havenn: if it's just nil that's unnevecessary
<ReinH>
"foo" if false #=> nil
<havenn>
ReinH: good point =P
adac [adac!~adac@85-127-39-241.dynamic.xdsl-line.inode.at] has joined #ruby
<djMax>
so this: "%.2f" % self[prop] if self[prop] #=> nil
<djMax>
?
<iamjarvo>
can i check if params is nil and use another value ? something like this params[:line_item][w.id.to_s.to_sym][:quantity] unless params[:line_item][w.id.to_s.to_sym][:quantity].nil?
<djMax>
sometimes I wonder how this syntax can bear to look itself in the mirror
<adac>
hi guys. is it possible to open and output a file like that: File.expand_path('~') + "/some.log") { |f| f.read } ...but output it from bottom up?
<havenn>
ReinH: Not just unnecessary, a horrid antipattern. I'll say some extra Hail Marys just to be safe!
Caius [Caius!~Caius@about/apple/macbookpro/Caius] has joined #ruby
QKO [QKO!~reaVer@banzai.speedxs.nl] has joined #ruby
adambeynon [adambeynon!~adambeyno@82-69-1-211.dsl.in-addr.zen.co.uk] has joined #ruby
jamiejackson [jamiejackson!~jamie@unaffiliated/jamiejackson] has joined #ruby
Aaaarg [Aaaarg!~Arthur@121-74-35-117.telstraclear.net] has joined #ruby
drd2 [drd2!53a0482e@gateway/web/freenode/ip.83.160.72.46] has joined #ruby
LittleBill902 [LittleBill902!~smith@c-76-114-25-2.hsd1.ca.comcast.net] has joined #ruby
<Creeture>
Wow…that was nice. Somebody ran gem update —system on me and it changed the Gem::dir from /usr/lib to /usr/lib64 on *one* of my build machines. What a pain in the n00ts.
gioele [gioele!~gioele@unaffiliated/gioele] has joined #ruby
spike2251 [spike2251!~user@c-76-24-24-228.hsd1.ma.comcast.net] has joined #ruby
gioele [gioele!~gioele@unaffiliated/gioele] has quit [#ruby]
billy_ran_away [billy_ran_away!~billy_ran@173-167-194-14-ip-static.hfc.comcastbusiness.net] has joined #ruby
robbkidd [robbkidd!896461f2@gateway/web/freenode/ip.137.100.97.242] has joined #ruby
Lord-Harlot [Lord-Harlot!~Serenity@adsl-87-102-126-62.karoo.KCOM.COM] has joined #ruby
Aaaarg [Aaaarg!~Arthur@121-74-38-253.telstraclear.net] has joined #ruby
mksm [mksm!mksm@pdpc/supporter/professional/mksm] has joined #ruby
minijupe [minijupe!~benlieb@adsl-74-243-183-162.ard.bellsouth.net] has joined #ruby
<billy_ran_away>
How come on rubular.com it shows 3 results for /\{([^}]*)\}/ for my string "{a}{b}{c}" but my irb console shows "{a}{b}{c}".match(/\{([^}]*)\}/).captures.count => 1
albemuth [albemuth!~albemuth@209.213.178.170] has joined #ruby
<shadoi>
rubular is 1.8, so possibly it's slightly different behavior.
<shadoi>
not sure though
<samuelkadolph>
It's not that
<samuelkadolph>
It's because it's the same capture that was matched 3 times
<shadoi>
ah
<samuelkadolph>
I can't remember how or if you can get all 3
minijupe_ [minijupe_!~benlieb@adsl-74-243-183-162.ard.bellsouth.net] has joined #ruby
<shadoi>
.match returns an array of them I thought
<samuelkadolph>
No it turns an instance of MatchData
<samuelkadolph>
returns*
<billy_ran_away>
shadoi: Well their captures, not matches...
<billy_ran_away>
samuelkadolph: I started playing with .scan and that kinda works after I .flatten it.
<billy_ran_away>
samuelkadolph: Which makes it look ugly...
skrewler [skrewler!~skrewler@209.213.206.58] has joined #ruby
minijupe [minijupe!~benlieb@adsl-74-243-183-162.ard.bellsouth.net] has joined #ruby
<samuelkadolph>
Yeah, you have to use String#scan
manizzle_ [manizzle_!~manizzle@dsl081-053-082.sfo1.dsl.speakeasy.net] has joined #ruby
<billy_ran_away>
samuelkadolph: Why is it doing an array of arrays?
flexd2 [flexd2!~flexd@dev.flexd.net] has joined #ruby
<samuelkadolph>
Because you have a capture in it
<samuelkadolph>
It's so you can get all of the captures of each match
<samuelkadolph>
Removing the capture makes it return just an array
andrewhl [andrewhl!~andrew@67.230.167.6] has joined #ruby
<billy_ran_away>
samuelkadolph: Okay cool, you know off hand how to get the {}'s as look ahead and look behinds?
<billy_ran_away>
samuelkadolph: I can look it up and figure it out myself, but if you know off the top of your head...
<samuelkadolph>
Nope, a regexp guru I am not
<billy_ran_away>
samuelkadolph: Okay well thanks for your help!
tar_ [tar_!~tar@d118-75-81-132.try.wideopenwest.com] has joined #ruby
<billy_ran_away>
shadoi: And you too shadoi!
<billy_ran_away>
Really appreciate it guy.
<billy_ran_away>
*guys
billy_ran_away [billy_ran_away!~billy_ran@173-167-194-14-ip-static.hfc.comcastbusiness.net] has quit [#ruby]
<shadoi>
meh, I just muddied the water. ;)
Aaaarg [Aaaarg!~Arthur@121-74-42-193.telstraclear.net] has joined #ruby
ElitestFX [ElitestFX!~ElitestFX@unaffiliated/elitestfx] has joined #ruby
zerdman [zerdman!~zerdman@71.255.123.66] has quit [#ruby]
Manhose [Manhose!~Manhose@bl6-36-103.dsl.telepac.pt] has joined #ruby
robbkidd [robbkidd!896461f2@gateway/web/freenode/ip.137.100.97.242] has joined #ruby
enikar [enikar!~gil@cl-140.mrs-01.fr.sixxs.net] has joined #ruby
Aaaarg [Aaaarg!~Arthur@121-74-46-193.telstraclear.net] has joined #ruby
<shevy>
GOOD!
techhelp [techhelp!~Dan@firebox.rsmart.com] has joined #ruby
<shevy>
CONFUSION IS THE VERY BASIS FOR LANGUAGE CREATION
<shevy>
LO AND BEHOLD, THERE WAS PERL AND GREAT CONFUSION AND THEN THERE WAS RUBY AND THE CONFUSION DECLINED
eko [eko!~eko@70-90-168-189-SFBACalifornia.hfc.comcastbusiness.net] has joined #ruby
eko [eko!~eko@unaffiliated/eko] has joined #ruby
albemuth [albemuth!~albemuth@209.213.178.170] has joined #ruby
kartouch [kartouch!~kartouch@kartouch.ic-clear.eu] has quit ["Quitte"]
v0id [v0id!~v0id@nat/hp/x-kkcledfgjdfmohnr] has joined #ruby
<shadoi>
And then there was python, and confusion was prohibited, so the people rebelled.
techhelp [techhelp!~Dan@firebox.rsmart.com] has quit [#ruby]
nikmus [nikmus!~nikmus@188.123.151.228] has joined #ruby
nikmus [nikmus!~nikmus@188.123.151.228] has quit [#ruby]
paissad [paissad!~paissad@89-92-16-151.hfc.dyn.abo.bbox.fr] has joined #ruby
Pip [Pip!~Pip@unaffiliated/pip] has joined #ruby
statarb3 [statarb3!~CoreD@546A56AA.cm-12-3b.dynamic.ziggo.nl] has joined #ruby
statarb3 [statarb3!~CoreD@unaffiliated/statarb3] has joined #ruby
<csmrfx>
THEN THERE WAS RUBY AND YOU COULD PROGRAM CONFUSION TO BECOME COHESION IF NOT DEFINED
spike2251 [spike2251!~user@c-76-24-24-228.hsd1.ma.comcast.net] has joined #ruby
<csmrfx>
*UNLESS
axl__ [axl__!~axl@173-11-52-113-Minnesota.hfc.comcastbusiness.net] has joined #ruby
workmad3 [workmad3!~workmad3@cpc1-bagu10-2-0-cust81.1-3.cable.virginmedia.com] has joined #ruby
kennethreitz [kennethreitz!~kennethre@c-24-127-96-129.hsd1.va.comcast.net] has joined #ruby
Aaaarg [Aaaarg!~Arthur@121-74-33-56.telstraclear.net] has joined #ruby
Jake232 [Jake232!~textual@5e0eb192.bb.sky.com] has joined #ruby
michael_mbp [michael_mbp!~Marin@112.134.196.79] has joined #ruby
billy_ran_away [billy_ran_away!~billy_ran@173-167-194-14-ip-static.hfc.comcastbusiness.net] has joined #ruby
<billy_ran_away>
Let's say I have two classes and those classes share some methods, I'd make a module right?
<Tasser>
shadoi, nah, python is explicit, no confusion ;-)
<samuelkadolph>
billy_ran_away: And include it in both classes
<billy_ran_away>
samuelkadolph: Yep, now what happens if this shared method needs to be called different things in each class?
<samuelkadolph>
billy_ran_away: alias
<billy_ran_away>
samuelkadolph: But it's otherwise the same...
<billy_ran_away>
samuelkadolph: In the classes?
<samuelkadolph>
billy_ran_away: Yes
<billy_ran_away>
Okay cool
<billy_ran_away>
samuelkadolph: Thanks again!
<shadoi>
Tasser: that was my point.
workmad3 [workmad3!~workmad3@cpc1-bagu10-2-0-cust81.1-3.cable.virginmedia.com] has joined #ruby
<shadoi>
or… lame joke.
Aaaarg [Aaaarg!~Arthur@121-74-35-148.telstraclear.net] has joined #ruby
cousine [cousine!~cousine@196.221.61.89] has joined #ruby
rramsden [rramsden!~rramsden@s64-180-62-209.bc.hsia.telus.net] has joined #ruby
<Tasser>
shadoi, oh, prohibited. I'm tired...
axl_ [axl_!~axl@173-11-52-113-Minnesota.hfc.comcastbusiness.net] has joined #ruby
fayimora [fayimora!~fayimora@2a01:388:201:3721:1c4a:926e:6409:20b4] has joined #ruby
mengu_ [mengu_!~mengu@78.184.201.123] has joined #ruby
mengu_ [mengu_!~mengu@unaffiliated/mengu] has joined #ruby
ianbrandt [ianbrandt!~ianbrandt@99-111-99-153.uvs.sndgca.sbcglobal.net] has joined #ruby
bingomanatee [bingomanatee!~bingomana@204.28.126.210] has joined #ruby
<bingomanatee>
Can you stream content through rack?
<shadoi>
Unicorn supports it, it's implemented outside of rack though.
<billy_ran_away>
I haven't even gotten to a point of testing yet...
<billy_ran_away>
I'm still grabbling with the design...
<csmrfx>
irb is your friend
libertyprime [libertyprime!~libertypr@182.236.125.102] has joined #ruby
luckyruby [luckyruby!~luckyruby@125-187.96-97.tampabay.res.rr.com] has joined #ruby
<csmrfx>
seems to me like you could do that simply by subclassing and (re)defining methods
<csmrfx>
but not really sure what it is you're doing
bier|tp [bier|tp!~bier@p54A5BDAE.dip.t-dialin.net] has joined #ruby
nanoyak [nanoyak!~nanoyak@50-0-164-69.dsl.dynamic.sonic.net] has joined #ruby
<billy_ran_away>
csmrfx: Possibly I could… I'm just trying to make "masks" which are really methods to be run on the ancestor of the MaskedAttribute class.
<billy_ran_away>
I need to be able access both the "unmasked" string, i.e. with what is to be run against the ancestor, the masked string, that is the string with methods already ran on the ancestor, and an array of the masks themselves.
tshauck [tshauck!~tshauck@129.237.222.1] has joined #ruby
vjacob [vjacob!~vjacob@94-195-174-165.zone9.bethere.co.uk] has joined #ruby
workmad3 [workmad3!~workmad3@cpc1-bagu10-2-0-cust81.1-3.cable.virginmedia.com] has joined #ruby
LiquidInsect [LiquidInsect!~billabney@173-228-63-32.dsl.static.sonic.net] has joined #ruby
mikepack [mikepack!~mikepack@c-174-51-77-22.hsd1.co.comcast.net] has joined #ruby
<csmrfx>
I guess I would simply make a String class that had accessor for the mask value and methods to mask the strings
<billy_ran_away>
csmrfx: The methods have to be run against the ancestor...
<csmrfx>
but you probably have a better idea what it is that needs to be done
* apeiros_
doesn't get what billy_ran_away tries to do…
<apeiros_>
got an example how that is used? o0
<billy_ran_away>
shadoi: Speaking of which, ancestor is returning undefined variable or method.
<apeiros_>
(only out of curiosity)
<csmrfx>
ancestor as a term refers to the class that another class inherits from
<shadoi>
billy_ran_away: run String.ancestors (plural) in irb.
<billy_ran_away>
apeiros_: def test; "123"; end; t = MaskedAttribute.new("test-{test}", :test)
<billy_ran_away>
t.to_s # => "test-123"
<billy_ran_away>
t.masks => [ :test ]
<csmrfx>
object instances dont have ancestors, but they might be able to run methods from the ancestor class
<billy_ran_away>
t.unmasked => "test-{test}"
<apeiros_>
so many times 'test' - I don't know what relates to what…
<csmrfx>
unless your design includes some other ancestor-descendant axle
robbyoconnor [robbyoconnor!~wakawaka@guifications/user/r0bby] has joined #ruby
<billy_ran_away>
csmrfx: It doesn't...
<apeiros_>
also, how can MaskedAttribute access that test method?
<billy_ran_away>
apeiros_: That's what I'm trying to figure out.
awesome_ [awesome_!~awesome@212.62.202.84.customer.cdi.no] has joined #ruby
<csmrfx>
billy_ran_away: so do you really mean that you want a subclass to inherit methods from its parent-class
<apeiros_>
billy_ran_away: why do you need that?
<apeiros_>
or what do you need that for?
<billy_ran_away>
apeiros_: Its for a Rails thing...
<billy_ran_away>
csmrfx: Maybe… I'm not sure to be honest.
<apeiros_>
that of course explains all… :) (seriously, still no idea why you try to do what you do - and still don't really get what you actually try to do)
<billy_ran_away>
apeiros_: We're like 1" from the ground, I could fly you up to like 1000ft if you want…
<apeiros_>
from the simple example, it looks a bit like you reinvent templating
<billy_ran_away>
apeiros_: Bingo!
<shadoi>
billy_ran_away: try to write some code that shows the way you want it to be used, that may clarify things a bit.
<csmrfx>
lol
<apeiros_>
billy_ran_away: the common way is to pass an object or a binding then
<csmrfx>
or just write a test first
mxweas_ [mxweas_!~max@c-71-226-112-145.hsd1.az.comcast.net] has joined #ruby
mmokrysz [mmokrysz!~mmokrysz@pdpc/supporter/student/mmokrysz] has joined #ruby
<apeiros_>
class Foo; def test; 123; end; end; foo = Foo.new; Template.new('my foo is: {foo}', foo).to_s # => "my foo is: 123"
<billy_ran_away>
Where is this template class?
nari [nari!~nari@p62e324.totrnt01.ap.so-net.ne.jp] has joined #ruby
<csmrfx>
yes
<apeiros_>
nowhere
<apeiros_>
but that'd be trivial to implement
<csmrfx>
next thing you know: he wants ancestors
<billy_ran_away>
I must be doing this wrong...
<billy_ran_away>
Imagine you're making an art museum layout web app...
<apeiros_>
billy_ran_away: what's the :bar for there?
<billy_ran_away>
apeiros_: Oh I need to be present all possible masks back to the user...
<apeiros_>
billy_ran_away: you can extract them from the string
randym [randym!~randym@EM111-191-5-133.pool.e-mobile.ne.jp] has joined #ruby
<billy_ran_away>
Here's an even easy thing to imagine....
<billy_ran_away>
Imagine an mp3 naming program....
<apeiros_>
.scan(/\{(\w+)\}/).flatten
<csmrfx>
well, now that thats taken care of...
<apeiros_>
billy_ran_away: also, what's so bad about having to pass in self there?
<billy_ran_away>
I would want to be able to offer the user a chance to structure how the mp3 will be displayed on an individual mp3 basis...
pietrodibello [pietrodibello!~pietrodib@93-50-51-86.ip151.fastwebnet.it] has quit [#ruby]
<billy_ran_away>
apeiros_: Nothing per say… just easy if I don't have to since I want to ActiveRecord's composed_of method.
<billy_ran_away>
apeiros_: Not all possible choices are going to be in the name the first time it's set...
<billy_ran_away>
Imagine I have an ActiveRecord with the following attributes, :display, :artist, :album, :track, :title, :year...
<LiquidInsect>
4
<billy_ran_away>
I want to be present to the user a way to set the display attribute and have it be composed of masks of the rest of the attributes.
fractastical [fractastical!~jdietz@ppp-88-217-21-93.dynamic.mnet-online.de] has joined #ruby
macmartine [macmartine!~macmartin@069-064-227-254.pdx.net] has joined #ruby
<shadoi>
2
<apeiros_>
"per say"? per se?
<billy_ran_away>
apeiros_: yes that too : )
<macmartine>
What's the best way to search a file for squiggly brackets, return what's inside them, then replace the brackets and everything inside? https://gist.github.com/1483389
_debo [_debo!~marco.deb@cpc18-enfi16-2-0-cust743.hari.cable.virginmedia.com] has joined #ruby
<shadoi>
or.. "please write my parser for me"
<macmartine>
oh, geez
<shadoi>
macmartine: scroll up, someone wrote something that will get you almost there about 15 lines up
<macmartine>
shadoi: i just logged on , so i don't have it
<billy_ran_away>
So in the ActiveRecord rb file I would want to do composed_of :display_title, :mapping => %w(value display), :constructor => Proc.new { |value| MaskedAttribute.new(value, :artist, :album, :year, :track, :title)}
<apeiros_>
oh dear, midnight
<apeiros_>
gtg
<apeiros_>
gn8
<billy_ran_away>
apeiros_: Thanks for your help
noobus [noobus!~noobus@137.229.18.180] has joined #ruby
thatryan [thatryan!~thatryan@c-24-4-167-46.hsd1.ca.comcast.net] has joined #ruby
<csmrfx>
macmartine: split into arr by bracket open? split each by bracket close and discard latter
noobus [noobus!~noobus@137.229.18.180] has quit [#ruby]
<apeiros_>
macmartine: funny enough, what I wrote for billy_ran_away does something along that…
<billy_ran_away>
apeiros_: I know right! : )
<billy_ran_away>
apeiros_: Thanks agian
<apeiros_>
macmartine: string.scan(/\{(\w+)}/).flatten # <-- get content in curly braces from string
<apeiros_>
macmartine: string.gsub(/\{(\w+)}/ …block or string here - depends on what you want to do…) # <-- replace them
<apeiros_>
depending on what can be within the curly braces, you'll have to adapt the \w+ term
<apeiros_>
e.g. [^}]* for anything but the closing brace.
<macmartine>
apeiros_: just a number. ok, i'll see what i can do with that.
<macmartine>
thanks!
<apeiros_>
\d+ then
* apeiros_
off
<csmrfx>
gn
benofsky [benofsky!~benofsky@rrcs-184-74-205-234.nyc.biz.rr.com] has joined #ruby
spike2251 [spike2251!~user@c-76-24-24-228.hsd1.ma.comcast.net] has joined #ruby
bwlang [bwlang!~anonymous@static-71-245-233-146.bstnma.fios.verizon.net] has joined #ruby
cjs226 [cjs226!~cjs226@99-61-65-242.lightspeed.austtx.sbcglobal.net] has joined #ruby
tar_ [tar_!~tar@d118-75-81-132.try.wideopenwest.com] has joined #ruby
jbpros [jbpros!~jbpros@185.55-66-87.adsl-dyn.isp.belgacom.be] has joined #ruby
catphish_ [catphish_!~charlie@2001:9d8:2005:12::3] has joined #ruby
<catphish_>
is it possible to override enough Kernel methods to make it relatively safe to eval untrusted code?
ceej [ceej!~anonymous@cpe-72-190-40-203.tx.res.rr.com] has joined #ruby
dagnachewa [dagnachewa!~dagnachew@modemcable142.238-179-173.mc.videotron.ca] has joined #ruby
<shevy>
catphish_ isn't there a sandbox feature or wasn't there once?
<shevy>
and there is BasicObject I think
rpowell [rpowell!~rpowell@CPE-58-168-99-83.lns7.ken.bigpond.net.au] has joined #ruby
<csmrfx>
simply override eval
rpowell [rpowell!~rpowell@CPE-58-168-99-83.lns7.ken.bigpond.net.au] has joined #ruby
<catphish_>
what will overriding eval do?
<csmrfx>
it will make Kernel safe from untrusted code
Indian [Indian!~Indian@unaffiliated/londonmet050] has joined #ruby
<nlew>
It depends how safe you're looking for
<catphish_>
csmrfx: how so?
<csmrfx>
:}
<catphish_>
there was a sandbox but afaik its an unmaintained 1.8
<nlew>
Setting $SAFE is a start
matti [matti!matti@acrux.romke.net] has joined #ruby
matti [matti!matti@madwifi/support/matti] has joined #ruby
<catphish_>
i basically want a 1.9.3 sandbox
roadze [roadze!~roadze@119.224.137.97] has joined #ruby
<catphish_>
it will have no filesystem write permissions or network access
Sigma00 [Sigma00!~freenode@thankyouforhelpingushelpyouhelpusall.net] has joined #ruby
<catphish_>
but i'm not sure what else i can do to improve on that
Samoi [Samoi!~Salmon-fr@cl-164.wlg-01.nz.sixxs.net] has joined #ruby
Samoi [Samoi!~Salmon-fr@unaffiliated/root-ninja/x-7047552] has joined #ruby
atmosx [atmosx!~atmosx@191.116.broadband5.iol.cz] has joined #ruby
<shevy>
the old sandbox was written by _why I think
<catphish_>
i can override a bunch of functions like ` Exec System require etc
<shevy>
it was said that it should be included into 1.9.x but I think we only have BasicObject
<catphish_>
shevy: yes it was
<catphish_>
how does BasicObject help?
<shevy>
I am not sure... there was a specific use case, which triggered its creation
<shevy>
lemme google
<catphish_>
ok
<shevy>
"BasicObject is the parent class of all classes in Ruby. It's an explicit blank class."
<shevy>
or perhaps it is just the tabula rasa object
<shevy>
"BasicObject can be used for creating object hierarchies independent of Ruby's object hierarchy, proxy objects like the Delegator class, or other uses where namespace pollution from Ruby's methods and classes must be avoided."
<shevy>
hmm
<shevy>
that description does not sound like sandboxed objects
looopy [looopy!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby
<looopy>
hi i'm having trouble getting printing json... what am i missing? http://pastie.org/3023626
<shevy>
"#__id__ moved from Object to BasicObject"
<shevy>
"BasicObject is the new grand-daddy of the inheritance tree in Ruby 1.9 and in 1.9.3 it gains access to the functionality of the object_id method by way of __id__ which has been moved into BasicObject from Object. This may help those of you using BasicObject for delegators, proxies, and the like."
<stpetersburg>
shevy: those bitches need to add a #inspect or #to_s to BasicObject too as it breaks in a REPL context
<shevy>
hehe
<csmrfx>
or, you need an irb wrapper for BasicObject
<shevy>
hmm
<shevy>
irb code is so messy
<macmartine>
How come 'puts (Date.today + 1).to_s' throws 'expected numeric' when in a rake file, but not in IRB?
Brozilla [Brozilla!~Brozilla@ip11-49-212-87.adsl2.static.versatel.nl] has joined #ruby
awesome__ [awesome__!~awesome@212.62.202.84.customer.cdi.no] has joined #ruby
<catphish_>
i can only assume that rake extends Date
<macmartine>
i have require 'date'
<shevy>
hmm or perhaps it tries to use the return value
<catphish_>
ah yes thats likely
<catphish_>
try returning 0
<shevy>
and since it returns nil, it could say that it expected something else
<shevy>
but I have to say, I find rake somewhat annoying :/
<macmartine>
how does it return nil?
<catphish_>
thats what puts returns
<shevy>
puts would always return nil afaik
<catphish_>
indeed
<shevy>
can you upload some larger context into a file macmartine ? so I could test
<macmartine>
ah, so how might i get around this?
<shevy>
or hmm lemme test here...
rramsden [rramsden!~rramsden@s64-180-62-209.bc.hsia.telus.net] has joined #ruby