Topic for #ruby-lang is now Ruby 1.9.3p0: http://ruby-lang.org | Paste >3 Lines of Text on http://pastie.org
thrcka__ [thrcka__!~thrcka@ip-89-102-34-33.net.upcbroadband.cz] has joined #ruby-lang
ilyam_ [ilyam_!~ilyam@eng.nat.mtv.ooyala.com] has joined #ruby-lang
cschneid [cschneid!~cschneid@72.1.92.57] has joined #ruby-lang
DorMido [DorMido!~DorMido@190.56.253.84] has joined #ruby-lang
<DorMido> holassss
DorMido [DorMido!~DorMido@190.56.253.84] has quit [#ruby-lang]
brianpWins [brianpWins!~brianpwin@74.198.150.153] has joined #ruby-lang
Heimidal [Heimidal!~heimidal@factory-smtp.factorylabs.com] has joined #ruby-lang
reasonedink [reasonedink!~donnie@adsl-067-034-186-046.sip.mco.bellsouth.net] has quit [#ruby-lang]
Adrien_ [Adrien_!~adam@S010600238b791368.cg.shawcable.net] has joined #ruby-lang
<postmodern> what is a elegant way to determine if an object is a kind of Class, and if a Class inherits from another Class?
<shevy> postmodern not sure about elegant
<Adrien_> can some one tell me why this module just does not work? I mean if you create a clas and extend it, then that class should be using the singleton pattern. How ever this module when extended and the class klass.instance the error is that instance doesnt exist https://github.com/AdamKyle/RGSSDeveloperTools/blob/master/SingletonModule.rb
<postmodern> shevy, best i can think of is (other.kind_of?(Test)) || (other.kind_of?(Class) && (other < Test))
<shevy> hmm
<shevy> the last part?
<shevy> that is indeed not elegant
<shevy> but perhaps there is no elegant way here
<shevy> though that would make me sad
adrienk [adrienk!~adam@S010600238b791368.cg.shawcable.net] has joined #ruby-lang
replore_ [replore_!~replore@203.152.213.161.static.zoot.jp] has joined #ruby-lang
thegeekinside [thegeekinside!~thegeekin@200-52-45-239.dynamic.axtel.net] has joined #ruby-lang
voker57 [voker57!~voker57@kvirc/developer/Voker57] has joined #ruby-lang
twittard [twittard!~twittard@vpn.lax.truecarcorp.com] has joined #ruby-lang
dnjaramba_ [dnjaramba_!~dnjaramba@41.72.193.86] has joined #ruby-lang
looopy [looopy!~looopy@pool-141-156-47-88.washdc.btas.verizon.net] has joined #ruby-lang
tomzx [tomzx!~tomzx@dsl-59-207.aei.ca] has joined #ruby-lang
takaokouji [takaokouji!~takaokouj@2001:268:306:3:226:8ff:fedd:31a3] has joined #ruby-lang
takaokouji [takaokouji!~takaokouj@2001:268:306:1:225:bcff:fedc:e1fe] has joined #ruby-lang
WhiteHorse [WhiteHorse!~WhiteHors@201.208.150.8] has joined #ruby-lang
looopy [looopy!~looopy@pool-141-156-47-88.washdc.btas.verizon.net] has joined #ruby-lang
eban [eban!~eban@www2371u.sakura.ne.jp] has joined #ruby-lang
snuxoll [snuxoll!~stefan@63.227.129.124] has joined #ruby-lang
outoftime [outoftime!~mat@ip-160-79-101-2.autorev.intellispace.net] has joined #ruby-lang
looopy_ [looopy_!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
igotnolegs [igotnolegs!~igotnoleg@174-27-214-73.slkc.qwest.net] has joined #ruby-lang
sj26 [sj26!sj26@sj26.com] has joined #ruby-lang
mkscrg [mkscrg!~mkscrg@ool-18e4f9d6.dyn.optonline.net] has joined #ruby-lang
wmoxam [wmoxam!~wmoxam@206-248-153-55.dsl.teksavvy.com] has joined #ruby-lang
looopy [looopy!~looopy@pool-141-156-47-88.washdc.btas.verizon.net] has joined #ruby-lang
snuxoll [snuxoll!~stefan@63.227.129.124] has quit [#ruby-lang]
flip_digits [flip_digits!~textual@c-76-122-14-228.hsd1.fl.comcast.net] has joined #ruby-lang
Austin__ [Austin__!~halostatu@CPE0016cbc30e9c-CM001ceacff6ba.cpe.net.cable.rogers.com] has joined #ruby-lang
livinded [livinded!~lolwut@pool-108-23-242-132.lsanca.fios.verizon.net] has joined #ruby-lang
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby-lang
igotnolegs [igotnolegs!~igotnoleg@174-27-214-73.slkc.qwest.net] has joined #ruby-lang
looopy [looopy!~looopy@pool-141-156-47-88.washdc.btas.verizon.net] has joined #ruby-lang
MistyM [MistyM!~MistyM@50.72.70.192] has joined #ruby-lang
neoesque [neoesque!~neoesque@210.59.147.232] has joined #ruby-lang
igotnolegs [igotnolegs!~igotnoleg@174-27-214-73.slkc.qwest.net] has joined #ruby-lang
yfeldblum [yfeldblum!~Jay@c-71-206-30-119.hsd1.md.comcast.net] has joined #ruby-lang
QaDeS_ [QaDeS_!~mklaus@frbg-4d028956.pool.mediaWays.net] has joined #ruby-lang
looopy_ [looopy_!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
<MistyM> Is there a good guide anywhere on integrating C++ code into gems?
<drbrain> extern "C" { … } is your friend
michael_mbp [michael_mbp!~Marin@112.134.194.132] has joined #ruby-lang
<MistyM> "Integrate" was probably a bad term.
<MistyM> I want to extract a set of functions from a C++ program which is already written.
<MistyM> The original program doesn't divide its functionality enough that I can just link to it as a dynamic library with FFI, so I figured integrating the C++ straight into the gem was the best approach. But I could be wrong!
ilyam [ilyam!~ilyam@eng.nat.mtv.ooyala.com] has joined #ruby-lang
<MistyM> (E.g., the original program has a wx-based GUI and SDL audio, and appears to be relying on wx for some really simple stuff like loading files from the disk, etc. So dumping the GUI doesn't dump the wx dependency without some tweaks to the code.)
heppy_ [heppy_!~heppy@fw.baysidebusinessplaza.com] has joined #ruby-lang
<rue> That sounds like quite likely more trouble than it's worth
codefriar [codefriar!~codefriar@cpe-098-026-012-134.nc.res.rr.com] has joined #ruby-lang
<rue> The intimated alternative to FFI is a C(++) extension
<rue> You could possibly use Rice (if that's still alive) or then indeed just extern some wrapper functions
<MistyM> Looks like rice is active, or at least has an active fork. I'll take a peek, thanks.
<codefriar> Is it possible to tell a gem to build it's .bundle native extention statically ?
<rue> codefriar: How would you link it?
<codefriar> In this case I need it statically linked.
<rue> To what?
<codefriar> I'm building a .bundle of mysql2
<codefriar> and it links to a mysql library
<codefriar> i need to have a stand alone mysql2 library
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby-lang
amerine [amerine!~mturner@67.204.184.82] has joined #ruby-lang
<zenspider> yay! rdoc_osx_dictionary rises from the ashes!
<samuelkadolph> zenspider: Shoot it in the head to kill it for sure.
<zenspider> dude... this thing is sweet. you've never had better doco
<amerine> zenspider: Link?
<samuelkadolph> I've never had doco before so I can't compare
<amerine> zenspider: I haven't heard someone bring that up in ages
<rue> Man, Street Hawk would kick these guys' asses
<zenspider> no link yet... still polishing it up
<zenspider> tho maybe I should just fucking release
<codefriar> zenspider: what're you working on ?
<zenspider> rdoc_osx_dictionary
<zenspider> I was thinking the next step is to extend it to work on multiple languages in a pluggable manner and then put a macruby gui on the front.
<zenspider> I could make MILLIONS on the appstore
<zenspider> or... tens... at least
<codefriar> love macruby.
<zenspider> foods
<zenspider> then release... maybe
srbartlett [srbartlett!~srbartlet@202.146.7.239] has joined #ruby-lang
looopy [looopy!~looopy@pool-151-200-236-181.washdc.btas.verizon.net] has joined #ruby-lang
<MistyM> http://pastie.org/private/szulujk1x96fjflgfjx3fq - How would I call this class after doing the eval?
Aaaarg [Aaaarg!~Arthur@121-74-39-170.telstraclear.net] has joined #ruby-lang
crudson [crudson!~doug@static-96-227-79-15.phlapa.fios.verizon.net] has joined #ruby-lang
31NAAF8RG [31NAAF8RG!~replore@203.152.213.161.static.zoot.jp] has joined #ruby-lang
NinoScript [NinoScript!~Adium@pc-55-124-83-200.cm.vtr.net] has joined #ruby-lang
<MistyM> Aha, got it.
NinoScript [NinoScript!~Adium@pc-55-124-83-200.cm.vtr.net] has quit [#ruby-lang]
looopy_ [looopy_!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
crudson [crudson!~doug@static-96-227-79-15.phlapa.fios.verizon.net] has quit [#ruby-lang]
Austin__ [Austin__!~halostatu@CPE0016cbc30e9c-CM001ceacff6ba.cpe.net.cable.rogers.com] has quit [#ruby-lang]
livinded [livinded!~lolwut@pool-108-23-242-132.lsanca.fios.verizon.net] has joined #ruby-lang
Spooner [Spooner!~Miranda@host-92-23-158-179.as13285.net] has joined #ruby-lang
mkscrg [mkscrg!~mkscrg@ool-18e4f9d6.dyn.optonline.net] has joined #ruby-lang
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby-lang
dfr|mac [dfr|mac!~dfr|work@ool-18baf7e7.dyn.optonline.net] has joined #ruby-lang
andrewhl [andrewhl!~andrew@24-246-15-43.cable.teksavvy.com] has joined #ruby-lang
Banistergalaxy [Banistergalaxy!~AndChat@222.153.223.41] has joined #ruby-lang
<Banistergalaxy> Hi
<Banistergalaxy> Talk
<rue> Talk fail
Heimidal [Heimidal!~heimidal@c-67-165-197-126.hsd1.co.comcast.net] has joined #ruby-lang
dfr|mac_ [dfr|mac_!dfr|work@nat/google/x-vjzyfxuomoozypfp] has joined #ruby-lang
<Banistergalaxy> R u shameless
r0bby [r0bby!~wakawaka@guifications/user/r0bby] has joined #ruby-lang
x0F_ [x0F_!~x0F@unaffiliated/x0f] has joined #ruby-lang
eydaimon [eydaimon!~eydaimon@unaffiliated/anywho] has quit ["WeeChat 0.3.6"]
ttilley [ttilley!~ttilley@unaffiliated/lv] has joined #ruby-lang
igotnolegs [igotnolegs!~igotnoleg@174-27-214-73.slkc.qwest.net] has joined #ruby-lang
wmoxam [wmoxam!~wmoxam@206-248-153-55.dsl.teksavvy.com] has joined #ruby-lang
Aaaarg [Aaaarg!~Arthur@121-74-35-43.telstraclear.net] has joined #ruby-lang
nofxx [nofxx!~nofxx@unaffiliated/nofxx] has joined #ruby-lang
<necromancer> so check this out
<necromancer> why don't my requires work? i always get "no such file to load" unless i declare it explicitly with require './lib/overcast/actions'...
Aaaarg_ [Aaaarg_!~Arthur@121-74-35-43.telstraclear.net] has joined #ruby-lang
rippa [rippa!~splitta@85.158.54.234] has joined #ruby-lang
nicknovitski [nicknovitski!~nicknovit@114.241.253.244] has joined #ruby-lang
<rue> necromancer: require only looks at library- or absolute paths
<rue> So you need to either use -I, or #require_relative
towski [towski!~towski@173-13-170-161-sfba.hfc.comcastbusiness.net] has joined #ruby-lang
<necromancer> rue: "-l"?
<rue> -I
dfr|mac [dfr|mac!~dfr|work@ool-18baf7e7.dyn.optonline.net] has joined #ruby-lang
jbsan [jbsan!~jbsan@c80-216-213-130.bredband.comhem.se] has joined #ruby-lang
<necromancer> what does that mean? require -l?
<rippa> ruby -l
<necromancer> oh ok
<necromancer> why does it work for the jekyll code though?
naz [naz!~n@70.44.2.190.res-cmts.bus.ptd.net] has joined #ruby-lang
JosephRuby [JosephRuby!~joseph@46.33.34.34] has joined #ruby-lang
Aaaarg [Aaaarg!~Arthur@121-74-36-0.telstraclear.net] has joined #ruby-lang
<amh345> i'm thinking i'd like to write a app that doesn't involve rails. just a pure ruby app. the only thing is i dont really know where to begin. what kind of stuff do you guys build in ruby? services?? full programs? I've never went outside of web before so i really dont even know where to start.
<necromancer> amh345: anything from shell scripts to binary programs
<amh345> when i say dont know where to start. i dont mean 'help me build something'. more just like what to do?
jkyle [jkyle!~krunk-@unaffiliated/krunk-] has joined #ruby-lang
<theconartist> what do you want to make amh345
<amh345> oh, i see. so one wouldnt say… build a calculator in rails with a gui?
<theconartist> that's step 1
<amh345> theconartist: i have no ideas really. something small just to see what it's about. lets say a very simple calculator
<amh345> say someone wanted to make a word processing program.. or something like open office (i dont want this, but just as an example). would that sort of thing be achievable, or even wise in ruby?
<theconartist> anything
<amh345> i guess what i was thinking was a little front end to control some automation in my home. lights on/off that sort of thing. i know there are apps out there that do this. but iim curious more for a learning excerise.
<theconartist> pick a gui toolkit of your choice
<theconartist> that has ruby bindings for it
io_syl [io_syl!~io_syl@adsl-69-105-118-125.dsl.pltn13.pacbell.net] has joined #ruby-lang
io_syl [io_syl!~io_syl@unaffiliated/steph021] has joined #ruby-lang
<amh345> ah, i didnt even know about gui tool kits. heh. thanks
<amh345> a quick google shows a lot of people on stack voted for Ruby Shoes
brianpWins [brianpWins!~brianpWin@S010600212986cc6c.va.shawcable.net] has joined #ruby-lang
<theconartist> its nice and quick/easy for personal projects
<amh345> perfect. that might be a decent place to cut my teeth.
<theconartist> but unless you already have some sort of central console for your house with a remote API you are going to have to do a bit more than just ruby
<amh345> i've got jack all.
<theconartist> you would want to do what that guy is doing
<amh345> i've been reading up on Arduino
<theconartist> but you are going to have to learn electronics
<amh345> heh. yeah. i know a bit already.
Weems [Weems!~the@68-117-153-32.dhcp.unas.al.charter.com] has joined #ruby-lang
Weems [Weems!~the@unaffiliated/weems] has joined #ruby-lang
jstemmer [jstemmer!~cheetah@mrpwn.stemmertech.com] has joined #ruby-lang
tomzx_ [tomzx_!~tomzx@dsl-216-221-32-204.aei.ca] has joined #ruby-lang
csherin [csherin!~csherin@115.111.177.122] has joined #ruby-lang
singpoly1a [singpoly1a!~singpolym@69.171.154.34] has joined #ruby-lang
kitallis [kitallis!~kitallis@122.172.243.203] has joined #ruby-lang
heppy [heppy!~heppy@75-101-31-55.dsl.dynamic.sonic.net] has joined #ruby-lang
gregmoreno [gregmoreno!~gregmoren@S0106001e58eab184.vc.shawcable.net] has joined #ruby-lang
Rakko [Rakko!~rakko@96-42-31-132.dhcp.mdsn.wi.charter.com] has joined #ruby-lang
rhizmoe [rhizmoe!~eric@slider.synthesizer.org] has joined #ruby-lang
igotnolegs [igotnolegs!~igotnoleg@174-27-214-73.slkc.qwest.net] has joined #ruby-lang
srbaker [srbaker!~srbaker@184.66.82.213] has joined #ruby-lang
Defusal [Defusal!DeFi@unaffiliated/ecnerifed] has joined #ruby-lang
aleksi [aleksi!~aleksi@85.235.191.82] has joined #ruby-lang
srbaker [srbaker!~srbaker@184.66.82.213] has joined #ruby-lang
Aaaarg [Aaaarg!~Arthur@121-74-47-149.telstraclear.net] has joined #ruby-lang
burgestrand [burgestrand!~burgestra@h-163-174.a155.priv.bahnhof.se] has joined #ruby-lang
amerine [amerine!~mturner@bc171197.bendcable.com] has joined #ruby-lang
yxhuvud [yxhuvud!mongo@h-17-224.a149.priv.bahnhof.se] has joined #ruby-lang
<rue> I think I got a book about applying Arduinos to household stuff
<erikh> light switches for hipsters: volume 2
nuclearsandwich [nuclearsandwich!~nuclearsa@74-93-3-241-SFBA.hfc.comcastbusiness.net] has joined #ruby-lang
<bnagy> {ON, OFF, ON_BUT_IRONICALLY}
<Rakko> we're all about anger and fashion
<erikh> bnagy: ha!
<rue> erikh is just filled with hipster self-loathing
Aaaarg [Aaaarg!~Arthur@121-74-32-22.telstraclear.net] has joined #ruby-lang
<erikh> pretty much
<erikh> I'm wearing a correlation ≠ causation shirt
<erikh> I think that makes me hip
nuclearsandwich [nuclearsandwich!~nuclearsa@74-93-3-241-SFBA.hfc.comcastbusiness.net] has joined #ruby-lang
<bnagy> uh
<bnagy> itym 'geeky'
<bnagy> based on my observations of people who wear such shirts XD
<bnagy> but major style points if you actually meant that joke you just made
toretore [toretore!~toretore@195.204.240.108] has joined #ruby-lang
gix [gix!~gix@e180008044.adsl.alicedsl.de] has joined #ruby-lang
DEac- [DEac-!~deac@81.16.104.86] has joined #ruby-lang
nofxx [nofxx!~nofxx@unaffiliated/nofxx] has joined #ruby-lang
Aaaarg [Aaaarg!~Arthur@121-74-40-144.telstraclear.net] has joined #ruby-lang
frangiz [frangiz!~frangiz@user26.77-105-206.netatonce.net] has joined #ruby-lang
igotnolegs [igotnolegs!~igotnoleg@174-27-214-73.slkc.qwest.net] has joined #ruby-lang
<TTilus> lights remind me of https://github.com/epeli/effectserver
Pip [Pip!~Pip@unaffiliated/pip] has joined #ruby-lang
igotnolegs [igotnolegs!~igotnoleg@174-27-214-73.slkc.qwest.net] has joined #ruby-lang
woollyams [woollyams!~woollyams@124-168-81-150.dyn.iinet.net.au] has joined #ruby-lang
Aaaarg [Aaaarg!~Arthur@121-74-45-228.telstraclear.net] has joined #ruby-lang
woollyams [woollyams!~woollyams@124-168-81-150.dyn.iinet.net.au] has joined #ruby-lang
Aaaarg [Aaaarg!~Arthur@121-74-33-77.telstraclear.net] has joined #ruby-lang
dnjaramba [dnjaramba!~dnjaramba@41.72.193.86] has joined #ruby-lang
Neil__ [Neil__!~neil@194.42.230.106] has joined #ruby-lang
Aaaarg [Aaaarg!~Arthur@121-74-33-77.telstraclear.net] has joined #ruby-lang
igotnolegs [igotnolegs!~igotnoleg@174-27-214-73.slkc.qwest.net] has joined #ruby-lang
Pip [Pip!~Pip@host-192-146-66-217.spbmts.ru] has joined #ruby-lang
Pip [Pip!~Pip@unaffiliated/pip] has joined #ruby-lang
Aaaarg [Aaaarg!~Arthur@121-74-41-38.telstraclear.net] has joined #ruby-lang
jbsan [jbsan!~jbsan@c80-216-213-130.bredband.comhem.se] has joined #ruby-lang
solars [solars!~solars@clnet-kmu02-090.ikbnet.co.at] has joined #ruby-lang
heftig [heftig!~Jan@archlinux/developer/heftig] has joined #ruby-lang
denysonique [denysonique!~foobar@static.88-198-98-195.clients.your-server.de] has joined #ruby-lang
denysonique [denysonique!~foobar@unaffiliated/dennisonicc] has joined #ruby-lang
daglees [daglees!~belvedere@unaffiliated/daglees] has joined #ruby-lang
Aaaarg [Aaaarg!~Arthur@121-74-47-9.telstraclear.net] has joined #ruby-lang
Aaaarg_ [Aaaarg_!~Arthur@121-74-35-149.telstraclear.net] has joined #ruby-lang
madsheep [madsheep!~madsheep@87-205-55-138.adsl.inetia.pl] has joined #ruby-lang
gnufied [gnufied!~gnufied@122.172.245.79] has joined #ruby-lang
igotnolegs [igotnolegs!~igotnoleg@174-27-214-73.slkc.qwest.net] has joined #ruby-lang
yorickpeterse [yorickpeterse!~yorickpet@pdpc/supporter/professional/yorickpeterse] has joined #ruby-lang
thrcka [thrcka!~thrcka@ip-89-102-34-33.net.upcbroadband.cz] has joined #ruby-lang
looopy [looopy!~looopy@pool-151-200-236-181.washdc.btas.verizon.net] has joined #ruby-lang
molgrew [molgrew!~bozo20@85.182.139.18] has joined #ruby-lang
zmack [zmack!~zmack@78.97.129.175] has joined #ruby-lang
Aaaarg [Aaaarg!~Arthur@121-74-39-246.telstraclear.net] has joined #ruby-lang
csherin [csherin!~csherin@115.111.177.122] has joined #ruby-lang
<rue> What is, I don't
salamanderw [salamanderw!~Elisa@host249-161-dynamic.13-79-r.retail.telecomitalia.it] has joined #ruby-lang
brianpWins [brianpWins!~brianpWin@207.6.118.71] has joined #ruby-lang
<salamanderw> Hi peoples, ruby newbie here. Quick question. How can I send an object through a TCPServer? Is there a method that does this automatically or do I have to do something fancy?
<erikh> Marshal
burgestrand [burgestrand!~burgestra@62.65.124.23] has joined #ruby-lang
<erikh> core library. note that you can't marshal code (even in proc or lambda form)
<salamanderw> cool, I'll read up on it. Thx!
krz [krz!~foobar@unaffiliated/krz] has joined #ruby-lang
Aaaarg [Aaaarg!~Arthur@121-74-47-124.telstraclear.net] has joined #ruby-lang
srbartlett [srbartlett!~srbartlet@124-170-47-158.dyn.iinet.net.au] has joined #ruby-lang
looopy [looopy!~looopy@pool-151-200-236-181.washdc.btas.verizon.net] has joined #ruby-lang
bjensen [bjensen!~brianj@2.106.18.170] has joined #ruby-lang
looopy_ [looopy_!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
Manhose [Manhose!~Manhose@2001:690:2200:9a77:7c6b:3fbf:8113:82e7] has joined #ruby-lang
<rue> salamanderw: Also, you might do better with DRb or other distribution mechanisms, depending on your scenario
<bnagy> DRb is my favourite by a long way
<bnagy> xmlrpc msgpack-rpc etc you need to maintain shims for the remote methods etc
Aaaarg [Aaaarg!~Arthur@121-74-33-243.telstraclear.net] has joined #ruby-lang
temp [temp!zarubin@94.27.70.227] has joined #ruby-lang
<bnagy> I also did a lot of speed testing, and DRb is within a few pips of msgpack-rpc which is the fastest I tested
<bnagy> Marshal is very fast
KU0N [KU0N!~KU0N@213-193-112-54.static.cablecom.ch] has joined #ruby-lang
adambeynon [adambeynon!~adambeyno@82-69-1-211.dsl.in-addr.zen.co.uk] has joined #ruby-lang
<salamanderw> OK now I have a marshal question. So I do mythingie = Thingieclass.new, right? Then I do s = Marshal.dump(mythingie) and send it over the TCPSocket, so far so good... Now on the receive side, how do I rebuild the mythingie so that I can access its variables? I did a Marshal.load(rvdtxt) but it didn't like it...
<bnagy> have you roundtripped the object locally?
<salamanderw> NOt yet, will try. But ok, maybe I'm sending it wrong? Do I puts the serialized data? Or do I have to send it in some other way?
Aaaarg [Aaaarg!~Arthur@121-74-37-133.telstraclear.net] has joined #ruby-lang
<bnagy> I dunno until you find out if it roundtrips correctly locally :)
<bnagy> I'm guessing not, btw
<salamanderw> Well, you're right, it isn't doing it correctly locally. Let me fix that first before I come up with more questions...
Pip [Pip!~Pip@unaffiliated/pip] has joined #ruby-lang
<bnagy> if you're wanting to save complex objects, read the Marshal docs, you might need to write a custom serializer
<rue> And if you just need some data, maybe it'd be most future-proofey to just send some JSON over the wire
<bnagy> personally I tend to work with the core classes for DRb stuff, you can usually get everything to work without sending whole custom objects
<bnagy> but I have a hatred of json :)
Aaaarg [Aaaarg!~Arthur@121-74-40-158.telstraclear.net] has joined #ruby-lang
ioga_wrk [ioga_wrk!~ioga@92.255.125.251] has joined #ruby-lang
gnufied [gnufied!~gnufied@122.167.243.43] has joined #ruby-lang
dc5ala [dc5ala!~dc5ala@stgt-4d03bada.pool.mediaWays.net] has joined #ruby-lang
thrcka [thrcka!thrcka@nat/redhat/x-hualcyfxnzsalvkg] has joined #ruby-lang
<salamanderw> OK, I got it working correctly locally (it is a simple class, Thingieclass only has an ID and that's it, no methods (other than accessor), it is just for my own simple educational purposes). Now when I send it off via the TCP port the receiver says "Incompatible marshal file format." Am I correct in sending my serialized data through the port using puts?
geoffw8_ [geoffw8_!~geoffw8_@host86-135-7-118.range86-135.btcentralplus.com] has joined #ruby-lang
jxie [jxie!~jxie@115.197.87.78] has joined #ruby-lang
<bnagy> is the class defined on the remote end?
<heftig> salamanderw: use print
<heftig> puts appends linebreaks
<heftig> ah right, that too
Manhose_ [Manhose_!~Manhose@193.136.33.133] has joined #ruby-lang
<bnagy> trailing linebreak shouldn't worry Marshal
<bnagy> at least in my test
<rue> There was a format change between 1.9.1 and .2, wasn't there?
<rue> Or something
<salamanderw> hmmm....right, class was not defined in remote end...let me fix that...
mytrile [mytrile!~mytrile@94.26.28.135] has joined #ruby-lang
niklasb [niklasb!~codeslay0@p5B3109DE.dip0.t-ipconnect.de] has joined #ruby-lang
<bnagy> I don't think that error should be related to that but it's a common error so I thought I'd mention it
<heftig> maybe rubinius could improve marshaling
<heftig> marshal classes, procs and all that
<bnagy> I don't understand how?
<salamanderw> Ha ha, alright, that did it! Thanks guys, you're fantastic!!
<salamanderw> One last question....
<bnagy> like to marshal a proc you need to marhsal its binding and stuff, right? which could be all of the process memory
<rue> bnagy: Technically only the parts referenced by the closure
<heftig> bnagy: AFAIK rubinius handles bindings as objects too
<heftig> StaticBinding et cetera
<salamanderw> Let's say I have a class: class Thingie; @ID; attr_accessor :ID; end
<bnagy> ah ok... that sounds interesting
<bnagy> I really need to marshal procs for some stuff I do
<rue> I think wycats almost succeeded marshalling procs in rbx
<bnagy> but tbf I don't want the binding
<heftig> er, StaticScope i think
<rue> salamanderw: class T; @id; end @id is an instance variable of the class
<salamanderw> sorry let me rephrase, let's say I have a class: class Thingie; @ID=3; attr_accessor :ID; end
<salamanderw> then I do: mythingie = Thingie.new
<salamanderw> Why when I then do mythingie.ID I get nil??
<bnagy> as rue said that won't do what you think
<bnagy> heftig: thanks
<salamanderw> Shouldn't I be getting mythingie.ID to be 3?
<rue> salamanderw: Nope
<rue> Class instance variable
<bnagy> def initialize;@id=3 #don't use upcase for ivars pls;end
<bnagy> then try
<rue> salamanderw: Thingie = Class.new; Thingie.instance_variables # => [:@ID]
<salamanderw> OK let me look up "instance variables". So they can't be defaulted unless I explicitly initialize them?
<rue> salamanderw: It's not that
<rue> The class *is an object*
<rue> It can have its own ivars. The instances of the class have their individual ones
<rue> For the latter, you need to assign them inside an instance method
<salamanderw> well, ok but what if I want to have all instances of a certain class default to a certain value of an instance variable initially? Why do I need to write an explicit method for that instead of just declaring the instance variable equal to something?
<bnagy> also attr_* are shortcuts for exposing object instance vars, not class ones
<salamanderw> yes yes, ok with the instance variables, I think I understand the concept. My question is, why can't I just initialize them to some default value for all objects of the class?
<rue> salamanderw: Just assign in #initialize, that's called when creating the object
<bnagy> you can
<bnagy> in initialize :D
<salamanderw> Blech. I think C# does it by defaulting them/declaring them in one line. Ha ha. OK, I guess that's just a Ruby quirk then.
<salamanderw> So I guess good practice would have you write an initalize method for every class then? Otherwise all instance variables default to nil, right?
<bnagy> all instance vars always default to nil, that's one of the good things about them
csherin [csherin!~csherin@115.111.177.122] has joined #ruby-lang
<salamanderw> And just to be clear...class variables CAN be initialized in that one line, right?
<rue> Class instance vars, yeah. And class vars (@@var)
<bnagy> well yeah but there would be no easy way to get at them
<salamanderw> well you'd explicitly write a method to access and modify them, I guess. I think I've learned that part.
<bnagy> IRL you will probably want an initialize for most classes anyway
<salamanderw> OK guys, thanks a lot for your help and sorry for my stupid questions.
<bnagy> btw the way you had it, you could still set the id on the object
<bnagy> that's what attr_accessor does for you
<salamanderw> Yes, after creating the object I would just do mythingie.ID = 3 or whatever.
<salamanderw> I get it.
<salamanderw> I was just annoyed that you couldn't initialize instance variables without an initialize method.
<salamanderw> Oh yeah, one last question. Someone said that I shouldn't use all caps for instance variables.
<salamanderw> Is that just a convention or what's the reason?
<bnagy> convention
<salamanderw> OK cool. Thanks again to everyone!
Aaaarg [Aaaarg!~Arthur@121-74-46-181.telstraclear.net] has joined #ruby-lang
<bnagy> afaik anyway, I've never tried because it's ugly
<rue> Convention, yes
<rue> If you used caps, you'd have people trying to figure out why
<rue> I.e., wasted time
geoffw8 [geoffw8!~geoffw8_@host81-159-63-214.range81-159.btcentralplus.com] has joined #ruby-lang
salamanderw [salamanderw!~Elisa@host249-161-dynamic.13-79-r.retail.telecomitalia.it] has quit [#ruby-lang]
geoffw8 [geoffw8!~geoffw8_@host81-159-63-214.range81-159.btcentralplus.com] has joined #ruby-lang
workmad3 [workmad3!~workmad3@vpn153.its.manchester.ac.uk] has joined #ruby-lang
salamanderw [salamanderw!~Elisa@host249-161-dynamic.13-79-r.retail.telecomitalia.it] has joined #ruby-lang
<salamanderw> OK I have yet one more question. Suppose my TCPserver is sending out text and also marshalled data. At the receiver end, how do I know which is which? Like, how do I know which data to unmarshal and which to display as just text?
<bnagy> don't do it that way
<bnagy> use DRb
<bnagy> otherwise I guess you could try Marshal.load( recv_data ) rescue # it must just be text
Aaaarg_ [Aaaarg_!~Arthur@121-74-47-111.telstraclear.net] has joined #ruby-lang
<bnagy> but it's wrong and 'I'm just learning' is insufficient excuse for doing it wrong
<kalleth> bnagy: never, ever, ever, ever, ever, ever use DRb
<kalleth> EVER
<kalleth> _EVER_
* kalleth shuders
<kalleth> EVER EVER EVER NEVER NEVER NEVER EVER use DRB
<bnagy> whatever you say, crzy person
<kalleth> srsly
<kalleth> if you ever code something with drb in it
<kalleth> it will end up down the line as an unsupportable, slow, unmaintainable mess
<kalleth> in other news, guess what my day to day job is :(
<salamanderw> Let me guess...using drb?
<bnagy> I've been using it in prod for about 3 years, and it is within a whisker of everything else I benchmarked, so frankly either supply some cogent argument or stfu
<bnagy> I suspect anything can be a slow unmaintainable mess if you can't code in the first place
saLOUt [saLOUt!~rriemann@77.245.32.179] has joined #ruby-lang
<kalleth> salamanderw: it leads to bad architectures unless you're very, very specific about what you want
<kalleth> we used it initially to "modularize" our rails 2.0.2 application
<kalleth> when we started we thought AMAZING, DRB, we can have NINE SEPERATE RAILS APPLICATIONS that can talk to each other on the occasional time they need to talk to each other!
<kalleth> (intending for them to be orthoganol to each other)
<kalleth> (hint: in bidness, it never ends up that way)
<heftig> so rather, be sane and serialize into something like yaml/json to send around?
<kalleth> so now we have a horrific spidery mess where every call to the ui app runs through about 15 drb calls
<bnagy> webdevs are teaching us about distributed system design now (*rolls eyes*)
<kalleth> 'webdevs'
<kalleth> lal
<kalleth> yes, i work on a simple website, guyz
<rue> kalleth: I'm sorry the hammer didn't work out for your gardening
<salamanderw> OK, so back to my question. Suppose you're using marshal. And you're sending both text and object (marshallized) data over the port. How does the receiver know which is which? Is there any way to tell which data has been marshallized at the receiver end?
<kalleth> meh, it wasn't my architectural decision
<rue> salamanderw: You need a protocol
<kalleth> i only started ~18months ago after it was already fucked
<rue> Ha
<kalleth> i just hate drb ;p
<rue> Message queues <3
<bnagy> kalleth: sorry, but when you enter with ridiculous statements like that you get treated as less than competant
<kalleth> competent
<kalleth> 8)
csherin [csherin!~csherin@115.111.177.122] has joined #ruby-lang
<bnagy> indeed :)
<rue> salamanderw: I mean, A) you still probably shouldn't do it but B), you need to have a header or something in the message
<rue> Or use separate channels
<kalleth> bnagy: you mean you don't have any completely irrational frameworks/libraries that you hate?
<kalleth> ps. i work on a hardened linux appliance for the hpc sector
<kalleth> so not just a webdev ;p
<rue> Irrational hatreds or irrational libraries?
<kalleth> sometimes irrational hatred of an irrational library
<Asher1> windows?
<salamanderw> @rue "separate channels" means "separate ports"? Or can you have two channels on the same port?
<bnagy> I don't like json much, but I wouldn't tell people to never ever use it
<bnagy> in caps
<kalleth> bnagy: surely the over-exaggeration emphasises the irrationality of it? :p
<kalleth> that was the intention at least
<Asher> you can't get more irrational than windows...
<kalleth> my argument would be to be very careful of the scope of what you use drb for
<kalleth> because it's much, much slower than true in-thread stuff
<rue> salamanderw: Yes, a separate connection
<ddfreyne> 'complex' is my favourite irrational library
<bnagy> *rimshot*
<kalleth> math joke
* kalleth cries
<salamanderw> OK, one last question. Why is everyone saying "don't use marshal" or "you shouldn't do it"?
<salamanderw> What are the drawbacks of doing it this way? (I'm not looking for "you should use drb because" but rather why not to use marshal"
benanne [benanne!~sander@b252h039.ugent.be] has joined #ruby-lang
<bnagy> I'm saying don't reinvent the wheel by trying to write something that sends serialized objects over tcp
<rue> Not Marshal in particular, but ^
<salamanderw> Aha, I see.
<bnagy> cause there are like4 or 5 already
<salamanderw> OK, I guess i simply don't want to install a whole big library that does a whole bunch of things that I don't want or need when all I want to do is pass objects around between connections.
<salamanderw> But I'll look into drb and then decide.
<bnagy> it's built in :)
<kalleth> drb is ok for that
firetonton [firetonton!~firetonto@163.5.131.104] has joined #ruby-lang
geoffw8_ [geoffw8_!~geoffw8_@host81-159-63-214.range81-159.btcentralplus.com] has joined #ruby-lang
<salamanderw> How is DRB different from EventMachine?
<bnagy> but tbh I have no idea what you're doing, if you just want to pass objects around you might be better off with a work queue, amqp / zmq etc etc
<salamanderw> I'm looking at the intro and they appear similar--they both communicate between other processes and programs...
IoGA [IoGA!~ioga@91.191.181.77] has joined #ruby-lang
<bnagy> DRb is _kind of_ a way to do RPC without too much fuss
<bnagy> EM is good for writing services etc, IF the Reactor pattern doesn't twist your melon
<salamanderw> What I am doing is very simple. I have a website that generates a configuration for an object. Let's say my class Thingie has several instance variables. My website fills them in given user input. Then, my website calls up a server (possibly elsewhere), passes it in the data, and the server elsewhere then puts that data into a database. That's it. all I'm trying to do is send data organized as a class. Nothing more
<bnagy> yeah I wouldn't do it that way :)
<bnagy> classes are for doing stuff, not for holding data, that's what Hashes etc are for
<bnagy> or ActiveRecord or whatever that damn thing is called
<salamanderw> Classes have methods AND variables. If they didn't have both then you wouldn't be using OO in the first place, you'd be using a procedural language.
<erikh> use a Struct
<erikh> which is a class really, but that's not important
<rue> Eh, no
<rue> If it's just data, hash it and send it over
<salamanderw> OK, let's say Thingie also has methods then.
<salamanderw> Then it is a proper class.
bjensen [bjensen!~brianj@2.106.18.170] has joined #ruby-lang
<erikh> rue: yeah, I should have read first
<erikh> I concur
<bnagy> salamanderw: so if you use DRb for that concept you have an inherent scalability issue
<erikh> use a hash or a Delegate of a Hash
<rue> There's no point mirroring objects in this scenario
<bnagy> I would probably look at some kind of work queue, but I use them a LOT so I have a one track mind sometimes
<bnagy> background tasks for web apps has been explored in some depth
csherin [csherin!~csherin@115.111.177.122] has joined #ruby-lang
<salamanderw> OK. Let's say I have a hash Thingie.
<rue> A queue'd work, but so would just feeding it directly to the DB. It depends on whether there's any data massaging to do, or concurrency issues &c.
<salamanderw> Do I still have to use Marshal to send it over a TCP connection?
<Asher> drb uses marshal internally
<Asher> you don't see it
<bnagy> you would just do @db.insert( this_hsh )
<bnagy> which would make a remote call to the DRb peer, which would do the work
<Asher> the drb object looks more or less like the object it is controlling remotely
Pip_ [Pip_!~Pip@unaffiliated/pip] has joined #ruby-lang
<rue> Something like resque would probaly be quite fitting
<erikh> ugh
<salamanderw> Yes but again do I need to use drb if I'm not going to be using most of drb? What is the simplest thing I can use? I guess since I'm learning Ruby I'd like to use the least mysterious methodology as possible.
<bnagy> yeah I was about to suggest reading about resque
<salamanderw> But if everyone is saying "use DRB" I guess that's what I would use.
<bnagy> I'm not
aleksi [aleksi!~aleksi@85.235.191.82] has quit [#ruby-lang]
<rue> If your problem was “must mirror objects in to remote locations”, then a solution would be DRb, but for this use case, probably not
<bnagy> I think you should have something that can do background work cause DB inserts are slower than serving webpages
<salamanderw> Good lord this conversation is a bit like playing that game, where everyone passes the ball to each other, and you're in the middle of the circle trying to intercept it! Ha ha.
<rue> Heh
<erikh> let's establish why you need RPC
<erikh> maybe I missed something
<salamanderw> OK at any rate I think I have some ideas.
<rue> salamanderw: This illustrates why it's crucial to know the problem space
<molgrew> salamanderw: have you heard about the XY problem?
<rue> ^
<salamanderw> nope. That's the male problem? (I'm an XX, if it matters)
<erikh> hah
<molgrew> "You want to do X, and you think Y is the best way of doing so. Instead of asking about X, you ask about Y."
<salamanderw> OK. Here's the problem. I want to pass long streams of data over a TCP network. The data is organized as a class.
<rue> If you want to 1. receive some data via the web and then 2. send it somewhere else to be (possibly transformed somehow and then) stored in a DB, the solution is typically to do the bare minimum in the frontend
Wardrop [Wardrop!~tomwardro@86.46.96.58.static.exetel.com.au] has joined #ruby-lang
<salamanderw> See my problem statement above.
<bnagy> actually that's NOT the problem, that's your proposed approach to it
<rue> Then send the data to a background work queue to be processed for storage
woollyams [woollyams!~woollyams@203-217-64-103.dyn.iinet.net.au] has joined #ruby-lang
<salamanderw> The question is: how do I send something that is not text (because it is data) over a TCP network? How it gets processed (queue or not) at the receiving end is irrelevant.
<erikh> marshal it.
kitallis [kitallis!~kitallis@122.178.250.229] has joined #ruby-lang
<erikh> now, if you choose to use Marshal or JSON or YAML, that's really up to you and they have good and bad use-cases
<salamanderw> OK.
Spooner [Spooner!~Miranda@host-92-23-158-179.as13285.net] has joined #ruby-lang
<bnagy> be aware that if some of your data is binary then JSON etc will probably not work
<erikh> YAML too for that matter
<salamanderw> Now, if I need to do something special to process the data, receive it in the background or whatever, THEN I'll look into DRB or whatever. I just wanted to know that there was *something* that could take data and do something to it so that it could be transported. Looks like marshal is indeed it. For more higher level uses, I'll look at the other drb stuff (which as you said it uses marshal anyway).
<erikh> well there's a number of ways you can do it. how much data are we talking here?
<rue> JSON, YAML and XML are all data serialization formats (for this purpose)
<erikh> and do you really need to transport /objects/ or just /data/ ?
<erikh> DRb is for transporting objects; it's an important distinction
<erikh> technically the other formats are for transporting data (unless otherwise specialized, e.g. SOAP)
<salamanderw> @erikh: not sure yet. Ha ha.
<erikh> that's fair. just ... be critical of your use case
<erikh> you can thank me later :)
<salamanderw> OK guys. I have to run now. Thanks for all your help though. I'll just start with the simplest case (mashal) and as I need more firepower and functionality I'll start looking at other things (and will probably be back moaning about it!)
<erikh> have fun!
<rue> salamanderw: The reason we bring up a queue is that it's in most cases wasteful to write that code yourself (which seems to be what you want to do via TCP)
davidsantoro [davidsantoro!c1230b71@gateway/web/freenode/ip.193.35.11.113] has joined #ruby-lang
<erikh> I wish I could share a work project with you, but I can't
<salamanderw> @rue: got it. But I also want to learn how things work at a fundamental level, and I also don't want to waste time learning stuff that does stuff I don't need (like big libraries of which I'll use only a small part). Don't worry, I'll drop by again for sure. Take care!
<rue> *wave
salamanderw [salamanderw!~Elisa@host249-161-dynamic.13-79-r.retail.telecomitalia.it] has quit [#ruby-lang]
yvon [yvon!~yvon@nor75-20-82-247-155-250.fbx.proxad.net] has joined #ruby-lang
comboy [comboy!~quassel@static.7.66.9.176.clients.your-server.de] has joined #ruby-lang
srbartlett [srbartlett!~srbartlet@124-170-47-158.dyn.iinet.net.au] has joined #ruby-lang
gnufied1 [gnufied1!~gnufied@122.167.241.63] has joined #ruby-lang
alindeman [alindeman!~adml@freenode/senior-staff-emeritus/alindeman] has joined #ruby-lang
gnufied [gnufied!~gnufied@122.172.244.191] has joined #ruby-lang
|Vargas| [|Vargas|!~vargas@pdpc/supporter/profesional/vargas] has joined #ruby-lang
<shevy> *storm
gnufied1 [gnufied1!~gnufied@122.172.244.191] has joined #ruby-lang
<rue> *fail
<shevy> :(
<shevy> *icestorm over Helsinki!!!!!!
<rue> Failstorm
Manhose [Manhose!~Manhose@193.136.33.133] has joined #ruby-lang
chrismcg [chrismcg!~chrismcg@pdpc/supporter/active/chrismcg] has joined #ruby-lang
bjensen [bjensen!~brianj@2.106.18.170] has joined #ruby-lang
bjensen [bjensen!~brianj@2.106.18.170] has joined #ruby-lang
bjensen [bjensen!~brianj@2.106.18.170] has joined #ruby-lang
bjensen_ [bjensen_!~brianj@2.106.18.170] has joined #ruby-lang
alindeman [alindeman!~adml@freenode/senior-staff-emeritus/alindeman] has joined #ruby-lang
bjensen [bjensen!~brianj@2.106.18.170] has joined #ruby-lang
srbartlett [srbartlett!~srbartlet@124-170-47-158.dyn.iinet.net.au] has joined #ruby-lang
bjensen [bjensen!~brianj@2.106.18.170] has joined #ruby-lang
bjensen [bjensen!~brianj@2.106.18.170] has joined #ruby-lang
bjensen [bjensen!~brianj@2.106.18.170] has joined #ruby-lang
bjensen [bjensen!~brianj@2.106.18.170] has joined #ruby-lang
NinoScript [NinoScript!~Adium@pc-55-124-83-200.cm.vtr.net] has joined #ruby-lang
bjensen [bjensen!~brianj@2.106.18.170] has joined #ruby-lang
mksm [mksm!mksm@201.20.236.65.user.ajato.com.br] has joined #ruby-lang
WhiteHorse [WhiteHorse!~WhiteHors@201.208.150.8] has joined #ruby-lang
bjensen_ [bjensen_!~brianj@2.106.18.170] has joined #ruby-lang
bjensen [bjensen!~brianj@2.106.18.170] has joined #ruby-lang
tobiassvn [tobiassvn!u4832@gateway/web/irccloud.com/x-cyfflvqqphilamio] has joined #ruby-lang
bjensen [bjensen!~brianj@2.106.18.170] has joined #ruby-lang
bjensen [bjensen!~brianj@2.106.18.170] has joined #ruby-lang
codefriar [codefriar!~codefriar@cpe-098-026-012-134.nc.res.rr.com] has joined #ruby-lang
roha [roha!~phelot@dhcp-wlan-uzh-89-206-64-195.uzh.ch] has joined #ruby-lang
stamina [stamina!~stamina@ip5452a9bc.speed.planet.nl] has joined #ruby-lang
conor___ [conor___!~conor@88-97-244-230.dsl.zen.co.uk] has joined #ruby-lang
csherin [csherin!~csherin@115.111.177.122] has joined #ruby-lang
conor___ [conor___!~conor@88-97-244-230.dsl.zen.co.uk] has joined #ruby-lang
michael_mbp [michael_mbp!~Marin@112.134.195.218] has joined #ruby-lang
sepp2k [sepp2k!~sexy@g224097220.adsl.alicedsl.de] has joined #ruby-lang
saLOUt [saLOUt!~rriemann@77.245.32.179] has joined #ruby-lang
kedare [kedare!~kedare@scuderia.internet-fr.net] has joined #ruby-lang
dinesh_ [dinesh_!~dinesh@14.139.82.6] has joined #ruby-lang
mytrile [mytrile!~mytrile@94.26.28.135] has joined #ruby-lang
<shevy> Use ex to remove the first line of a file:
<shevy> ex -c d -c w -c q file.txt
<chris2> ex -c '1d|wq'
<chris2> sure a plain d works?
<shevy> no idea, I was just amazed at the bundling of -c's
DMKE [DMKE!~DMKE@pdpc/supporter/student/dmke] has joined #ruby-lang
geoffw8 [geoffw8!~geoffw8_@host86-135-7-118.range86-135.btcentralplus.com] has joined #ruby-lang
<chris2> echo '1d\nwq' | ed file.txt
Squarepy [Squarepy!~Squarepy@wcw-staff-214-112.wireless.uva.nl] has joined #ruby-lang
Squarepy [Squarepy!~Squarepy@unaffiliated/squarepy] has joined #ruby-lang
Squarepy [Squarepy!~Squarepy@unaffiliated/squarepy] has quit [#ruby-lang]
geoffw8_ [geoffw8_!~geoffw8_@host86-135-7-118.range86-135.btcentralplus.com] has joined #ruby-lang
roha [roha!~phelot@dhcp-wlan-uzh-89-206-64-195.uzh.ch] has joined #ruby-lang
Manhose [Manhose!~Manhose@193.136.33.133] has joined #ruby-lang
<shevy> Hmm. Question... say, I do "cat foobar.rb" ... I display the content of a ruby file on the commandline.
<shevy> Now I want to combine this... pipe this into another program...
<shevy> "cat foobar.rb | colourize"
Aaaarg [Aaaarg!~Arthur@121-74-46-152.telstraclear.net] has joined #ruby-lang
<Tasser> shevy, IO.popen3
<shevy> Is there a good way to colourize this code? Like that all "end" keywords are displayed in red, all classes yellow, and so on
<shevy> hmmmm
<shevy> "syntax" gem seems to convert to HTML/CSS
cyri_ [cyri_!~cyri_@236.200.72.86.rev.sfr.net] has joined #ruby-lang
jensn [jensn!~Jens@c-83-233-145-148.cust.bredband2.com] has joined #ruby-lang
yfeldblum [yfeldblum!~Jay@c-68-34-107-252.hsd1.md.comcast.net] has joined #ruby-lang
cjs226 [cjs226!~cjs226@rrcs-71-40-79-154.sw.biz.rr.com] has joined #ruby-lang
<Tasser> monkey-patch it to ansi color codes
<shevy> hehe
<Mon_Ouie> shevy: coderay has a binary to do that
<shevy> cool
<shevy> thanks
<Mon_Ouie> I have this in my zshrc: cr() { coderay $1 -term | less -r }
Aaaarg [Aaaarg!~Arthur@121-74-47-17.telstraclear.net] has joined #ruby-lang
tooky [tooky!~tooky@cpc5-sotn11-2-0-cust194.15-1.cable.virginmedia.com] has joined #ruby-lang
csherin [csherin!~csherin@115.111.177.122] has joined #ruby-lang
lsegal [lsegal!jinx@modemcable249.109-177-173.mc.videotron.ca] has joined #ruby-lang
NinoScript [NinoScript!~Adium@pc-55-124-83-200.cm.vtr.net] has quit [#ruby-lang]
firetonton [firetonton!~firetonto@163.5.131.104] has joined #ruby-lang
codefriar [codefriar!~codefriar@ip-200.it.rdu.bandwidth.com] has joined #ruby-lang
<shevy> cat foo.rb | coderay -ruby
<shevy> works nicely
<shevy> though I'll have to adapt the colours a little bit
<shevy> darkblue on black background is hard to read :/
Aaaarg [Aaaarg!~Arthur@121-74-32-101.telstraclear.net] has joined #ruby-lang
RomD [RomD!~Roman@nrbg-4dbe3bd9.pool.mediaWays.net] has joined #ruby-lang
rippa [rippa!~splitta@85.158.54.234] has quit ["herp derp"]
roha [roha!~phelot@dhcp-wlan-uzh-89-206-64-195.uzh.ch] has joined #ruby-lang
<chris2> lol
timbleck [timbleck!u3835@gateway/web/irccloud.com/x-cpxlixjzhybmbvot] has joined #ruby-lang
Bottlecruiser [Bottlecruiser!~splitta@85.158.54.234] has joined #ruby-lang
mccraig [mccraig!u574@gateway/web/irccloud.com/x-wbfwhryvpkpzfdsa] has joined #ruby-lang
krz [krz!~foobar@unaffiliated/krz] has joined #ruby-lang
dejongge [dejongge!~jonke@pD9E0E1DE.dip0.t-ipconnect.de] has joined #ruby-lang
wmoxam [wmoxam!~wmoxam@206-248-153-55.dsl.teksavvy.com] has joined #ruby-lang
beawesomeinstead [beawesomeinstead!u1643@gateway/web/irccloud.com/x-booqkincvnatovnj] has joined #ruby-lang
abuiles [abuiles!u1641@gateway/web/irccloud.com/x-znajtwylustqxvbb] has joined #ruby-lang
<shevy> vim has quite nice colouring
<shevy> hmm going to ask there I guess
locks [locks!u130@gateway/web/irccloud.com/x-eubtccaizqinknha] has joined #ruby-lang
Manhose [Manhose!~Manhose@193.136.33.133] has joined #ruby-lang
jredville [jredville!u3362@gateway/web/irccloud.com/x-ybogpgzefuoyosds] has joined #ruby-lang
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby-lang
<workmad3> shevy: I'm a fan of the dark-solarized theme
<shevy> hmm
<workmad3> I've got it set up for all my terminal colours :)
cldwalker [cldwalker!u2984@gateway/web/irccloud.com/x-ecjuiqqwbodkqkil] has joined #ruby-lang
<workmad3> looks like it
whoops [whoops!u549@gateway/web/irccloud.com/x-ywpdgfjinebkusre] has joined #ruby-lang
<manveru> yeah, i even got that for weechat :)
lorenzo [lorenzo!~quassel@217.33.106.3] has joined #ruby-lang
br1an [br1an!u440@gateway/web/irccloud.com/x-pifxzepkprztlihn] has joined #ruby-lang
<workmad3> manveru: I set it up for irssi here :)
bryanl [bryanl!u1690@gateway/web/irccloud.com/x-ddxloyhwzapoenin] has joined #ruby-lang
akahn [akahn!u2243@gateway/web/irccloud.com/x-xaunucdasbmnbggf] has joined #ruby-lang
mrchrisadams [mrchrisadams!u1367@gateway/web/irccloud.com/x-utrwhcwqmihruilg] has joined #ruby-lang
lorenzo_ [lorenzo_!~quassel@217.33.106.3] has joined #ruby-lang
levifig [levifig!~levifig@levifig.com] has joined #ruby-lang
dkannan [dkannan!u480@gateway/web/irccloud.com/x-kotmemyffzbfphtw] has joined #ruby-lang
cesario [cesario!u2444@gateway/web/irccloud.com/x-arpwgxdeqqojjrqh] has joined #ruby-lang
tommyvyo [tommyvyo!~tommyvyo@38.123.129.115] has joined #ruby-lang
tylergillies [tylergillies!u3033@gateway/web/irccloud.com/x-bhixnpvmbrrbghzg] has joined #ruby-lang
roha [roha!~phelot@dhcp-wlan-uzh-89-206-64-195.uzh.ch] has joined #ruby-lang
imperator [imperator!~Daniel@63-225-247-192.hlrn.qwest.net] has joined #ruby-lang
robbrit [robbrit!~rob@38.108.76.250] has joined #ruby-lang
lorenzo_ [lorenzo_!~quassel@217.33.106.3] has joined #ruby-lang
Sailias [Sailias!~jonathan@99.234.118.225] has joined #ruby-lang
yfeldblum [yfeldblum!~Jay@pool-71-246-76-76.bltmmd.east.verizon.net] has joined #ruby-lang
pvh [pvh!u717@gateway/web/irccloud.com/x-vfmtfkcwqrlvstob] has joined #ruby-lang
xjonc [xjonc!~xjonc@aerw140.neoplus.adsl.tpnet.pl] has joined #ruby-lang
<kalleth> workmad3: it's too light for me..... i prefer jellybeans
<kalleth> looks better in liberation mono 9
<kalleth> :)
<shevy> my bad eyes like black backgrounds
<lianj> and window shadows on screenshots ;)
joast [joast!~rick@76.178.187.164] has joined #ruby-lang
udzinari [udzinari!~user@27.25.broadband12.iol.cz] has joined #ruby-lang
beawesomeinstead [beawesomeinstead!u1643@gateway/web/irccloud.com/x-lznsngdjygzqcdof] has joined #ruby-lang
User [User!~User@204.2.180.250] has joined #ruby-lang
User1234 [User1234!~User1234@12.237.177.158] has joined #ruby-lang
tylergillies [tylergillies!u3033@gateway/web/irccloud.com/x-ktnctoqpmaitwcix] has joined #ruby-lang
agib [agib!u781@gateway/web/irccloud.com/x-awxudpdwvtuxxzhl] has joined #ruby-lang
cldwalker [cldwalker!u2984@gateway/web/irccloud.com/x-lboqsrmokhlkiuxt] has joined #ruby-lang
abuiles [abuiles!u1641@gateway/web/irccloud.com/x-osfvzxkiepjaycgn] has joined #ruby-lang
levifig [levifig!~levifig@levifig.com] has joined #ruby-lang
heftig [heftig!jan@archlinux/developer/heftig] has joined #ruby-lang
whoops [whoops!u549@gateway/web/irccloud.com/x-qrbnawmsphqeljtb] has joined #ruby-lang
jredville [jredville!u3362@gateway/web/irccloud.com/x-bpwwxitxqrsymerp] has joined #ruby-lang
dnyy [dnyy!u2106@gateway/web/irccloud.com/x-eaweeriprjcvqtid] has joined #ruby-lang
gnufied [gnufied!~gnufied@122.172.244.191] has joined #ruby-lang
<rue> There's only a solarized-light for limechat. Though it is just CSS
slyphon [slyphon!~weechat@unaffiliated/slyphon] has joined #ruby-lang
slyphon_ [slyphon_!~weechat@unaffiliated/slyphon] has joined #ruby-lang
codefriar [codefriar!~codefriar@ip-200.it.rdu.bandwidth.com] has joined #ruby-lang
jensn [jensn!~Jens@c-83-233-145-148.cust.bredband2.com] has joined #ruby-lang
shevy [shevy!~shevy@178-191-179-93.adsl.highway.telekom.at] has joined #ruby-lang
thrcka [thrcka!~thrcka@p96.fei.wifi.vutbr.cz] has joined #ruby-lang
t4nkd [t4nkd!~t4nkd@pool-72-64-157-228.tampfl.fios.verizon.net] has joined #ruby-lang
MistyM [MistyM!~mistym@50.museumforhumanrights.com] has joined #ruby-lang
tobiassvn [tobiassvn!u4832@gateway/web/irccloud.com/x-yzxfesxyjaphqyiv] has joined #ruby-lang
davehimself [davehimself!~davehimse@c-98-200-201-146.hsd1.tx.comcast.net] has joined #ruby-lang
dkannan [dkannan!u480@gateway/web/irccloud.com/x-bpsnvwfftfbtjtgo] has joined #ruby-lang
gregmoreno [gregmoreno!~gregmoren@S0106001e58eab184.vc.shawcable.net] has joined #ruby-lang
denysonique__ [denysonique__!u484@gateway/web/irccloud.com/x-figgbcabhtugdgkm] has joined #ruby-lang
outoftime [outoftime!~mat@50.57.10.189] has joined #ruby-lang
rippa [rippa!~rippa@87-253-28-78.pppoe.yaroslavl.ru] has joined #ruby-lang
Pupeno [Pupeno!~pupeno@pdpc/supporter/active/pupeno] has joined #ruby-lang
mccraig [mccraig!u574@gateway/web/irccloud.com/x-cmthnjnftwmlyeqk] has joined #ruby-lang
Manhose [Manhose!~Manhose@193.136.33.133] has joined #ruby-lang
gnufied1 [gnufied1!~gnufied@122.167.254.70] has joined #ruby-lang
andrewhl [andrewhl!~andrew@24-246-15-43.cable.teksavvy.com] has joined #ruby-lang
necromancer [necromancer!u4538@gateway/web/irccloud.com/x-bwbpjetufjwrzyiv] has joined #ruby-lang
gnufied1 [gnufied1!~gnufied@122.167.254.70] has joined #ruby-lang
wmoxam [wmoxam!~wmoxam@76.9.195.38] has joined #ruby-lang
vikoren [vikoren!~Adium@24-176-191-118.static.reno.nv.charter.com] has joined #ruby-lang
S1kx [S1kx!~S1kx@ip-95-223-80-198.unitymediagroup.de] has joined #ruby-lang
S1kx [S1kx!~S1kx@pdpc/supporter/monthlybyte/s1kx] has joined #ruby-lang
kennyp [kennyp!~kennyp@fedora/kennyp] has joined #ruby-lang
outoftime [outoftime!~mat@50.57.10.189] has joined #ruby-lang
kennyp [kennyp!~kennyp@fedora/kennyp] has quit [#ruby-lang]
kmeehl [kmeehl!~keith@c-66-31-31-71.hsd1.ma.comcast.net] has joined #ruby-lang
cschneid [cschneid!~cschneid@72.1.92.57] has joined #ruby-lang
tbuehlmann [tbuehlmann!~Tobias@unaffiliated/tovias] has joined #ruby-lang
nofxx [nofxx!~nofxx@unaffiliated/nofxx] has joined #ruby-lang
Pip [Pip!~Pip@unaffiliated/pip] has joined #ruby-lang
Pip [Pip!~Pip@host-90-156-66-217.spbmts.ru] has joined #ruby-lang
Pip [Pip!~Pip@unaffiliated/pip] has joined #ruby-lang
rayners [rayners!~rayners@38.102.22.194] has joined #ruby-lang
Pip [Pip!~Pip@unaffiliated/pip] has joined #ruby-lang
looopy [looopy!~looopy@pool-151-200-236-181.washdc.btas.verizon.net] has joined #ruby-lang
DMKE [DMKE!~DMKE@pdpc/supporter/student/dmke] has joined #ruby-lang
bitrot [bitrot!~smd@rrcs-50-84-14-82.sw.biz.rr.com] has joined #ruby-lang
salamanderw [salamanderw!~Elisa@host117-175-dynamic.12-79-r.retail.telecomitalia.it] has joined #ruby-lang
tomzx [tomzx!~tomzx@dsl-216-221-32-204.aei.ca] has joined #ruby-lang
outoftime [outoftime!~mat@ip-160-79-101-2.autorev.intellispace.net] has joined #ruby-lang
<salamanderw> Hey peoplez I'm back. Newbie here. Here's a question. When to use struct vs hash vs class? I mean you can put methods in a struct (so why not use class?) and you can write a hash using struct (so why not use hash)? Does it matter? Do they behave differently? Is one more expansive than the other? Thx...
<salamanderw> I meant expensive not expansive.
<salamanderw> Performancewise.
<samuelkadolph> salamanderw: Would depend on what the code is for. If it's a quite throwaway sample, doesn't matter. But I wouldn't use a struct to simulate a full fledged class
<samuelkadolph> In actual code
<salamanderw> OK so if it is just a table of keys and values, mostly (i.e. like a hash), but one of my items has to be an array. So one key indexes an array, can I do that with a hash or do I need a struct/class and which is better? If I just use a class am I wasting resources? I guess if I declare it as a class I have the advantage of I can add methods to it later, I guess.
<samuelkadolph> You can use anything as a key in a hash
<salamanderw> Yes but can a key index anything in a hash?
<molgrew> what do you mean?
<MistyM> Yeah, and they can be heterogeneous. So you can do { :a => [1,2], :b => 'foo' }
slyphon [slyphon!~weechat@unaffiliated/slyphon] has joined #ruby-lang
<shevy> a salamander!
<shevy> kill it!
RickHull [RickHull!~rhull@209.119.14.25] has joined #ruby-lang
<salamanderw> @MistyM ok so forinstance say I have grades = {'Bob' =>82, 'Jim'= [76, 95, 88]}, how do I access Jim's 2nd grade?
<samuelkadolph> grades["Jim"][1]
<salamanderw> grades = {'Bob' =>82, 'Jim'=> [76, 95, 88]}
<salamanderw> OK, so basically it is like a 2d array.
<salamanderw> Like in C.
<salamanderw> OK, so I guess that's not too bad then.
<samuelkadolph> Kinda
<MistyM> Well, it's method chaining. The return value of grades["Jim"] is [76, 95, 88].
looopy [looopy!~looopy@pool-151-200-236-181.washdc.btas.verizon.net] has joined #ruby-lang
<MistyM> So when you add [1] on to the end of grades["Jim"], it uses the [1] on the array you fetched.
<MistyM> You could also do grades["Jim"].include? 95, or any other methods you'd use on the object you're getting out of it.
<salamanderw> Got it. OK so in my particular application let's say I have an object gamedata with fields gameid, gamename, and somesuch (which are simple integer variables) and another field with playerlist (which is an array of strings). Is it best to make gamedata a hash, or a struct, or a class? (assuming no methods for now)
<RickHull> start with a class
<RickHull> ruby is good for object oriented programming
Manhose_ [Manhose_!~Manhose@2001:690:2200:9a77:2554:ed4d:3f14:a8f9] has joined #ruby-lang
<tobiasvl> yeah, make it a class
jkyle [jkyle!~krunk-@unaffiliated/krunk-] has joined #ruby-lang
<tobiasvl> and call the class Game (not GameData)
<tobiasvl> and start thinking object-oriented right away!
<salamanderw> OK, question variation. Suppose I want to send my gamedata object around through the network to other ruby programs running elsewhere. Is there a performance issue or any other gotchas why I shouldn't use a class?
<RickHull> it's a question of serialization. IO objects cannot be serialized
krz [krz!~foobar@unaffiliated/krz] has joined #ruby-lang
<salamanderw> but my class is not an IO object, right?
<RickHull> if your ivars are things like strings, ints, or floats, no issue
<salamanderw> OK. Cool. I'll use a class then.
<salamanderw> Here's another question. What's the quickest way to say, read all (or a subset of) ivars from a class and copy them elsewhere (like, for instance, a database)?
Heimidal [Heimidal!~heimidal@c-67-165-197-126.hsd1.co.comcast.net] has joined #ruby-lang
diegoviola [diegoviola!~diego@host-1-211.b15.cvc.com.py] has joined #ruby-lang
<RickHull> i find myself disagreeing with your premise, in a sense
<RickHull> it sounds like you are thinking of objects/classes as gussied-up records
<RickHull> if that's the case, you might want to consider ActiveRecord
<RickHull> which handles the DB mapping for you
RomD` [RomD`!~Roman@nrbg-4dbe092a.pool.mediaWays.net] has joined #ruby-lang
<JosephRuby> within a module class << self does what? makes a new class w/ the name of the module or...?
<RickHull> it opens the scope for the singleton class, i believe. someone correct me, please :)
<salamanderw> @RickHull OK here's what I'm trying to do. One program, in one computer, matches keys and records. Then it sends this instance of keys and records over the net to another computer. Another computer runs a program that, after checking some rules and permissions, copies these keys and records into its database. I thought of using DBI, can DBI do the copying and putting in the database? Or do I need ActiveRecord for t
<RickHull> JosephRuby: i've never found it intuitive. but it allows metaprogramming to have the effect of 'def self.meth' rather than 'def meth'
<JosephRuby> rickhull: ty
outoftime [outoftime!~mat@50.57.10.189] has joined #ruby-lang
<RickHull> salamanderw: DBI is sufficient
<salamanderw> OK, so again, how do I copy n ivars from a class that I just passed in to this program?
<RickHull> obj.foo #=> 'asdf'
<RickHull> INSERT INTO blah VALUES(#{obj.foo})
<RickHull> or whatever
<RickHull> this is terrible advice to take literally, btw
<salamanderw> Ah, so I bury the copying into a class method then?
<RickHull> you can do it from outside the class
<diegoviola> Ruby DBI is similar to Perl DBI?
<RickHull> if your ivars are accessible (e.g. attr_reader, attr_accessor)
<salamanderw> so does #=> access variables a, s, d and f?
<RickHull> salamanderw: hm, no
<RickHull> that was my notation
<salamanderw> Like I want to access them all at once instead of one by one, they are many.
<manveru> diegoviola: it's not really much used or maintained
<TTilus> salamanderw: # is comment delimiter
flip_digits [flip_digits!~textual@c-76-122-14-228.hsd1.fl.comcast.net] has joined #ruby-lang
<diegoviola> manveru: i see
<RickHull> 'asdf' is a string
<salamanderw> I don't want to have to do myinstance.variable1, myinstance.variable2, myinstance.variable3 . Is there a way to do: "copy all variables 1, 2, and 3"?
<RickHull> #=> is a notation that indicates the value of the preceding expression
<TTilus> salamanderw: obj.foo #=> 'asdf' means obj.foo evaluates to 'asdf'
<salamanderw> ok. Got it.
<RickHull> salamanderw: sounds like you want an array
<RickHull> or other Enumerable
<RickHull> salamanderw: you should really work your way through a tutorial. perhaps in parallel with your project
<TTilus> salamanderw: just see Objects.new.methods.grep /instance_variable/
<TTilus> salamanderw: but piercing the by-convention encapsulation is imo a code smell
<salamanderw> I can use grep on a class?? Cool!
<TTilus> salamanderw: what are you actually doing?
<RickHull> salamanderw: grep is actually being called on an array, there
<TTilus> salamanderw: not on a class, but on an array of method names, yes
<RickHull> Object.new.methods.is_a?(Array) #=> true
<salamanderw> What am I doing? See above. Let me copy it: OK so in my particular application let's say I have an object gamedata with fields gameid, gamename, and somesuch (which are simple integer variables) and another field with playerlist (which is an array of strings). Is it best to make gamedata a hash, or a struct, or a class? (assuming no methods for now).
<TTilus> salamanderw: ruby has this thing called reflection, ya know :)
<salamanderw> And then: ne program, in one computer, matches keys and records. Then it sends this instance of keys and records over the net to another computer. Another computer runs a program that, after checking some rules and permissions, copies these keys and records into its database.
<TTilus> salamanderw: i cant see any need for ivar inspection
<salamanderw> OK then tell me how you'd do it because this feels a little bit like guessing. Is it this? Is it that? I'm a noob and I am lost, pls help?
<TTilus> salamanderw: simply class per concept and plain responsibility decisions
burgestrand [burgestrand!~burgestra@h-163-174.a155.priv.bahnhof.se] has joined #ruby-lang
<TTilus> salamanderw: do you know oo design?
<salamanderw> Yes but Ruby screwed up everything I knew about OO.
<TTilus> salamanderw: from what i see, apparently no :)
<RickHull> salamanderw: http://pine.fm/LearnToProgram/
<salamanderw> Well Ruby's brand of OO is different from what I learned.
<RickHull> it's a good tutorial, and it will help you
<TTilus> salamanderw: so what brand have you learned?
looopy [looopy!~looopy@pool-151-200-236-181.washdc.btas.verizon.net] has joined #ruby-lang
<salamanderw> C#
<TTilus> salamanderw: id take RickHull's advice
<RickHull> don't be put off by the title. sure, you already know "how to program"
<TTilus> salamanderw: oh well, that aint _that_ different
<TTilus> salamanderw: just focus first on mapping concepts to classes, decide on responsibilities and think of the thing in terms of onjects sending messages to each other
<salamanderw> Look, guys, I'm getting very confused here, because when I asked: do I make my data a class, a struct, or a hash, you said: a class. OK, so far so good. When I then asked, how to copy members of a class into a database without me having to access them one by one, you then said: don't use a class. So when I asked what would you use instead, I got told: "learn to program" So I feel like I'm a dog chasing its tail her
<TTilus> s/onj/obj/
<RickHull> please don't be put off by the title. that's not what i was telling you
<TTilus> salamanderw: you got to decide whos reponsible of talking to db
<shevy> salamanderw you should strive for simplicity
Manhose__ [Manhose__!~Manhose@193.136.33.133] has joined #ruby-lang
<TTilus> salamanderw: u migth very well decide its The Class
<salamanderw> and round and round we go.
erics [erics!~Skif@72.1.92.57] has joined #ruby-lang
<RickHull> salamanderw: I am painting a picture of my dog. should I include the grass?
looopy [looopy!~looopy@pool-151-200-236-181.washdc.btas.verizon.net] has joined #ruby-lang
<shevy> YES
<shevy> and then SHOW US YOUR PICTURE PLEASE
<TTilus> salamanderw: in that case you'd prolly want to use an orm
<salamanderw> Let me simplify: What's the simplest way to access multiple ivars from a class instance?
<RickHull> maybe you want 1 ivar that is an array
<RickHull> attr_reader :my_ivar
<shevy> salamanderw, iterate through instance_variables
<TTilus> salamanderw: dont think avout ivars
<TTilus> salamanderw: think about state they represent
<TTilus> salamanderw: should it be exposed outside at all
<shevy> salamanderw or even easier, collect them into an array
<salamanderw> Rrrrgh. OK. Sorry, but again I feel like I'm playing a guessing game here. Oh well. I'll sort it out. Thx.
<TTilus> salamanderw: if class handles its persistence itself (orm style for example) you dont need to access the state from outside of the object at all
<RickHull> salamanderw: the distress you feel is temporary. it's a new way of thinking in a lot of ways.
<RickHull> the questions you are asking don't have good answers
rubyplusplus [rubyplusplus!~quassel@cpe-74-75-153-107.maine.res.rr.com] has joined #ruby-lang
<shevy> only because he is trying to make them complicated
<TTilus> salamanderw: just go write a short skeleton of what you are afte
<TTilus> salamanderw: then show it
salamanderw [salamanderw!~Elisa@host117-175-dynamic.12-79-r.retail.telecomitalia.it] has quit [#ruby-lang]
<lianj> Struct.new(:a,:b).new(1,2).values
<shevy> cool
<shevy> never seen two .new before in one line yet
Skif [Skif!~Skif@72.1.92.57] has joined #ruby-lang
rubyplusplus [rubyplusplus!~quassel@cpe-74-75-153-107.maine.res.rr.com] has joined #ruby-lang
<TTilus> lianj: \o/
<shevy> Foo.new.old.new.old.new.old!
<TTilus> Tech.no.yes.no.yes.no.yes.perhaps!
<TTilus> reminds me of an artist who once defined his genre as "techperhaps"
gnufied [gnufied!~gnufied@122.167.254.70] has joined #ruby-lang
outoftime [outoftime!~mat@ip-160-79-101-2.autorev.intellispace.net] has joined #ruby-lang
thone_ [thone_!~thone@e179081037.adsl.alicedsl.de] has joined #ruby-lang
arooni-mobile [arooni-mobile!~arooni-mo@187.153.79.230] has joined #ruby-lang
saLOUt_ [saLOUt_!~rriemann@77.245.32.179] has joined #ruby-lang
jkyle_ [jkyle_!~krunk-@unaffiliated/krunk-] has joined #ruby-lang
nuclearsandwich [nuclearsandwich!~nuclearsa@65.50.203.171] has joined #ruby-lang
butchanton [butchanton!~butchanto@vpn-sanfran.exacttarget.com] has joined #ruby-lang
nuclearsandwich [nuclearsandwich!~nuclearsa@173.sub-166-250-40.myvzw.com] has joined #ruby-lang
wi43 [wi43!81a2012a@gateway/web/freenode/ip.129.162.1.42] has joined #ruby-lang
yxhuvud [yxhuvud!mongo@h-17-224.a149.priv.bahnhof.se] has joined #ruby-lang
Austin__ [Austin__!~austin@96.45.197.22] has joined #ruby-lang
jbwiv [jbwiv!~wellsj@world.timcogso.com] has joined #ruby-lang
<shevy> hmmm
apeiros_ [apeiros_!~apeiros@77-58-115-24.dclient.hispeed.ch] has joined #ruby-lang
<shevy> .perhaps! is a nice name for a method
adam_ [adam_!~adam@S010600238b791368.cg.shawcable.net] has joined #ruby-lang
<shevy> Orc.new.kill(:ogre).perhaps!
<rippa> Orc.new.kill(:ogre).perhaps!(:d6)
<MistyM> If you roll a 1, it instead kills the process that called the method.
<apeiros_> if you roll a 0, it shuts down the computer
<apeiros_> (luckily, rolling a 0 on a d6 is a very unlikely event…)
Sailias [Sailias!~jonathan@99.234.118.225] has joined #ruby-lang
<rippa> unless it's 0-based d6
DMKE [DMKE!~DMKE@pdpc/supporter/student/dmke] has joined #ruby-lang
thrcka [thrcka!thrcka@nat/redhat/x-meigfbioanenbrbu] has joined #ruby-lang
<adam_> could some one please tell me why this module isn't working? every time i do something like class Sample extends RGSSSingleton end and then do Sample.instance it tells me instance cannot be found (essentially a no method error)
rhizmoe [rhizmoe!~eric@slider.synthesizer.org] has joined #ruby-lang
Carnage\ [Carnage\!~carnage@84-75-168-154.dclient.hispeed.ch] has joined #ruby-lang
headius [headius!~headius@71-210-151-185.mpls.qwest.net] has joined #ruby-lang
rhizmoe [rhizmoe!~eric@slider.synthesizer.org] has joined #ruby-lang
<shevy> hmm when I have an array, with arrays inside x = [ ["abc","d"], ["efg","h"]] what would be a concise way to return an array of ["abc","efgh"]? I could use .each to iterate through and collect
<shevy> but that's longer
yorickpeterse [yorickpeterse!~yorickpet@pdpc/supporter/professional/yorickpeterse] has joined #ruby-lang
<rippa> x.map(&:join)
<MistyM> rippa: Wow, that's nifty.
<rippa> yeah
<rippa> check out Symbol#to_proc
geoffw8_ [geoffw8_!~geoffw8_@cpc10-heme11-2-0-cust101.9-1.cable.virginmedia.com] has joined #ruby-lang
<adam_> I take it no one knows why I am getting a no method error
towski [towski!~towski@204-15-1-114-static.ipnetworksinc.net] has joined #ruby-lang
<burgestrand> adam_: no method error means the method you tried to call does not exist
<burgestrand> adam_: do show the code you get the error from, it’d be easier to help that way
singpolyma [singpolyma!~singpolym@69.171.154.34] has joined #ruby-lang
<MistyM> adam_: I copy/pasted your code, then did `class Foo; extend RGSSSingleton; end`. Foo.instance/dup/clone work.
<adam_> burgerstrand, I cant because its not something I can show with out you havind downloaded and installed RG maker VX onto windows.
<adam_> dup and clone should throw errors MistyM
<MistyM> adam_: Yes, and they threw the errors you defined.
<adam_> googd
<adam_> it works I wa using extended instead of extend
Oloryn_lt2 [Oloryn_lt2!~Oloryn@96-25-160-157.gar.clearwire-wmx.net] has joined #ruby-lang
srbaker [srbaker!~srbaker@68.71.200.170] has joined #ruby-lang
rubyplusplus [rubyplusplus!~quassel@cpe-74-75-153-107.maine.res.rr.com] has joined #ruby-lang
hebz0rl [hebz0rl!~hebz0rl@95.130.165.85] has joined #ruby-lang
amerine [amerine!~mturner@208-100-137-147.bendbroadband.com] has joined #ruby-lang
geoffw8_ [geoffw8_!~geoffw8_@cpc10-heme11-2-0-cust101.9-1.cable.virginmedia.com] has joined #ruby-lang
thrcka [thrcka!thrcka@nat/redhat/x-iolalpoaoojeffjn] has joined #ruby-lang
solars [solars!~solars@mk089144206053.a1.net] has joined #ruby-lang
jensn [jensn!~Jens@c83-251-164-169.bredband.comhem.se] has joined #ruby-lang
musl [musl!~mike@li44-23.members.linode.com] has joined #ruby-lang
thrcka [thrcka!thrcka@nat/redhat/x-ddkjcrvrtajzdfaw] has joined #ruby-lang
Austin__1 [Austin__1!~austin@96.45.197.22] has joined #ruby-lang
darkf [darkf!~darkf_dix@unaffiliated/darkf] has joined #ruby-lang
thrcka_ [thrcka_!thrcka@nat/redhat/x-hgxtrieuoqbqtzjq] has joined #ruby-lang
thrcka [thrcka!thrcka@nat/redhat/x-ofgfkxkpmiavwrns] has joined #ruby-lang
nuclearsandwich [nuclearsandwich!~nuclearsa@173.247.193.198] has joined #ruby-lang
DMKE [DMKE!~DMKE@pdpc/supporter/student/dmke] has joined #ruby-lang
<shevy> hehe
geoffw8_ [geoffw8_!~geoffw8_@cpc10-heme11-2-0-cust101.9-1.cable.virginmedia.com] has joined #ruby-lang
butchanton [butchanton!~butchanto@vpn-sanfran.exacttarget.com] has joined #ruby-lang
sepp2k [sepp2k!~sexy@g224101130.adsl.alicedsl.de] has joined #ruby-lang
ascarter [ascarter!~ascarter@209.119.253.66] has joined #ruby-lang
joast [joast!~rick@76.178.187.164] has joined #ruby-lang
Oloryn_lt2 [Oloryn_lt2!~Oloryn@96-25-160-157.gar.clearwire-wmx.net] has joined #ruby-lang
Defusal [Defusal!DeFi@196-209-55-209.dynamic.isadsl.co.za] has joined #ruby-lang
Defusal [Defusal!DeFi@unaffiliated/ecnerifed] has joined #ruby-lang
scampbell [scampbell!~scampbell@c-98-224-240-62.hsd1.mi.comcast.net] has joined #ruby-lang
brianpWins [brianpWins!~brianpWin@S01060024369f54ba.vn.shawcable.net] has joined #ruby-lang
looopy_ [looopy_!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
hagabaka [hagabaka!~hagabaka@unaffiliated/hagabaka] has joined #ruby-lang
towski [towski!~towski@204-15-1-114-static.ipnetworksinc.net] has joined #ruby-lang
arooni-mobile [arooni-mobile!~arooni-mo@187.153.79.230] has joined #ruby-lang
voker57 [voker57!~voker57@2.93.236.37] has joined #ruby-lang
voker57 [voker57!~voker57@kvirc/developer/Voker57] has joined #ruby-lang
savage- [savage-!~savage-@209.118.197.220] has joined #ruby-lang
geoffw8_ [geoffw8_!~geoffw8_@cpc10-heme11-2-0-cust101.9-1.cable.virginmedia.com] has joined #ruby-lang
scottschecter [scottschecter!~scott@c-98-252-167-171.hsd1.ga.comcast.net] has joined #ruby-lang
macmartine [macmartine!~macmartin@069-064-227-254.pdx.net] has joined #ruby-lang
postmodern [postmodern!~postmoder@c-71-237-178-98.hsd1.or.comcast.net] has joined #ruby-lang
JosephRuby [JosephRuby!~joseph@46.33.34.34] has joined #ruby-lang
workmad3 [workmad3!~workmad3@cpc1-bagu10-2-0-cust81.1-3.cable.virginmedia.com] has joined #ruby-lang
flip_digits [flip_digits!~textual@c-71-199-243-97.hsd1.fl.comcast.net] has joined #ruby-lang
Oloryn_lt2 [Oloryn_lt2!~Oloryn@96-25-160-157.gar.clearwire-wmx.net] has joined #ruby-lang
kmeehl [kmeehl!~keith@c-66-31-31-71.hsd1.ma.comcast.net] has joined #ruby-lang
gearaholic [gearaholic!~gearaholi@c-71-238-98-243.hsd1.mi.comcast.net] has joined #ruby-lang
looopy [looopy!~looopy@pool-151-200-236-181.washdc.btas.verizon.net] has joined #ruby-lang
looopy_ [looopy_!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
kedare [kedare!~kedare@onyxia.netyxia.net] has joined #ruby-lang
csherin [csherin!~csherin@61.17.18.22] has joined #ruby-lang
guns [guns!~guns@c-98-228-72-208.hsd1.il.comcast.net] has joined #ruby-lang
twittard [twittard!~twittard@wc.lax.truecarcorp.com] has joined #ruby-lang
macmartine [macmartine!~macmartin@069-064-227-254.pdx.net] has joined #ruby-lang
s0ber_ [s0ber_!~s0ber@114-36-229-85.dynamic.hinet.net] has joined #ruby-lang
y3llow_ [y3llow_!~y3llow@114-36-229-85.dynamic.hinet.net] has joined #ruby-lang
y3llow [y3llow!~y3llow@114-36-229-85.dynamic.hinet.net] has joined #ruby-lang
y3llow [y3llow!~y3llow@114-36-229-85.dynamic.hinet.net] has joined #ruby-lang
y3llow [y3llow!~y3llow@114-36-229-85.dynamic.hinet.net] has joined #ruby-lang
fahadsadah [fahadsadah!fahad@unaffiliated/fahadsadah] has joined #ruby-lang
nofxx [nofxx!~nofxx@unaffiliated/nofxx] has joined #ruby-lang
saLOUt [saLOUt!~rriemann@91-65-223-29-dynip.superkabel.de] has joined #ruby-lang
workmad3 [workmad3!~workmad3@cpc1-bagu10-2-0-cust81.1-3.cable.virginmedia.com] has joined #ruby-lang
gnufied [gnufied!~gnufied@122.167.254.70] has joined #ruby-lang
alexkane [alexkane!~alexkane@38.117.157.141] has joined #ruby-lang
gix [gix!~gix@e180020139.adsl.alicedsl.de] has joined #ruby-lang
robbrit [robbrit!~rob@38.108.76.250] has quit [#ruby-lang]
jensn [jensn!~Jens@c-83-233-145-148.cust.bredband2.com] has joined #ruby-lang
outoftime [outoftime!~mat@ip-160-79-101-2.autorev.intellispace.net] has joined #ruby-lang
uniqanomaly [uniqanomaly!~ua@dynamic-78-8-214-151.ssp.dialog.net.pl] has joined #ruby-lang
Oloryn_lt21 [Oloryn_lt21!~Oloryn@96-25-160-157.gar.clearwire-wmx.net] has joined #ruby-lang
havenn [havenn!~skipper@pool-72-67-31-69.lsanca.fios.verizon.net] has joined #ruby-lang
Spooner [Spooner!~Miranda@host-92-23-158-179.as13285.net] has joined #ruby-lang
Caius [Caius!~Caius@about/apple/macbookpro/Caius] has joined #ruby-lang
Aaaarg [Aaaarg!~Arthur@121-74-35-117.telstraclear.net] has joined #ruby-lang
<levifig> guys: what changed in 1.9.3-rc1 that I'm getting a "unexpected tLBRACE" in this line: Entity.updated_since(time).all.{ |d| _format_entity d }
<levifig> :S
<erikh> remove the . between all and the brace
<levifig> with the error arrow pointed at the space
<levifig> oh
<levifig> dang :S
<levifig> erikh, thanks :)
<erikh> enjoy
<apeiros_> levifig: why still using rc1?
<apeiros_> 1.9.3-p0 is out
tocaferro [tocaferro!~tocaferro@90.162.13.225] has joined #ruby-lang
<levifig> is it more recent? :o
<samuelkadolph> I would hope so
<apeiros_> (p0 > rc1 - rc means release *candidate*, whereas p's are actual releases)
<erikh> correct
<samuelkadolph> Since that's a release
<erikh> p means "patchlevel". usually indicates a release
<erikh> rc means "release candidate"
<erikh> which is a fancy way of saying, "we're not sure if this sucks or not so tell us what sucks"
<samuelkadolph> lol
<apeiros_> banana-software
flexd [flexd!~flexd@dev.flexd.net] has joined #ruby-lang
<levifig> apeiros_, good to know :)
<levifig> thanks guys :)
<shevy> I want ruby 2.0
<drbrain> shevy: ruby 2.0.0dev (2011-11-02 trunk 33610) [x86_64-darwin11.2.0]
<lianj> shevy: oO
<drbrain> I've had ruby 2.0 for over a month
Aaaarg [Aaaarg!~Arthur@121-74-38-253.telstraclear.net] has joined #ruby-lang
mksm [mksm!mksm@pdpc/supporter/professional/mksm] has joined #ruby-lang
<shevy> hmmm
twittard [twittard!~twittard@wc.lax.truecarcorp.com] has joined #ruby-lang
flexd2 [flexd2!~flexd@dev.flexd.net] has joined #ruby-lang
vicegrip [vicegrip!~jrpetit@206-248-134-115.dsl.teksavvy.com] has joined #ruby-lang
woollyams [woollyams!~woollyams@124-170-57-72.dyn.iinet.net.au] has joined #ruby-lang
andrewhl [andrewhl!~andrew@67.230.167.6] has joined #ruby-lang
Aaaarg [Aaaarg!~Arthur@121-74-42-193.telstraclear.net] has joined #ruby-lang
Manhose [Manhose!~Manhose@bl6-36-103.dsl.telepac.pt] has joined #ruby-lang
flexd [flexd!~flexd@dev.flexd.net] has joined #ruby-lang
ttilley [ttilley!~ttilley@unaffiliated/lv] has joined #ruby-lang
benanne [benanne!~rijdier@ip-213-49-105-229.dsl.scarlet.be] has joined #ruby-lang
Aaaarg [Aaaarg!~Arthur@121-74-46-193.telstraclear.net] has joined #ruby-lang
kyrylo [kyrylo!~kyrylo@46.118.220.205] has joined #ruby-lang
<erikh> heh
srbartlett [srbartlett!~srbartlet@202.146.7.239] has joined #ruby-lang
flexd [flexd!~flexd@dev.flexd.net] has joined #ruby-lang
Pip [Pip!~Pip@unaffiliated/pip] has joined #ruby-lang
woollyams [woollyams!~woollyams@124-170-59-47.dyn.iinet.net.au] has joined #ruby-lang
Heimidal [Heimidal!~heimidal@c-67-165-197-126.hsd1.co.comcast.net] has joined #ruby-lang
firetonton [firetonton!~firetonto@163.5.131.104] has joined #ruby-lang
RomyEatsDrupal [RomyEatsDrupal!~stickycak@cpe-74-64-122-182.nyc.res.rr.com] has joined #ruby-lang
Carnage\ [Carnage\!~carnage@84-75-168-154.dclient.hispeed.ch] has joined #ruby-lang
workmad3 [workmad3!~workmad3@cpc1-bagu10-2-0-cust81.1-3.cable.virginmedia.com] has joined #ruby-lang
curtism [curtism!~curtis@bas11-montreal02-1128531355.dsl.bell.ca] has joined #ruby-lang
Aaaarg [Aaaarg!~Arthur@121-74-33-56.telstraclear.net] has joined #ruby-lang
Oloryn_lt2 [Oloryn_lt2!~Oloryn@96-25-160-157.gar.clearwire-wmx.net] has joined #ruby-lang
Jake232 [Jake232!~textual@5e0eb192.bb.sky.com] has joined #ruby-lang
michael_mbp [michael_mbp!~Marin@112.134.196.79] has joined #ruby-lang
workmad3 [workmad3!~workmad3@cpc1-bagu10-2-0-cust81.1-3.cable.virginmedia.com] has joined #ruby-lang
Aaaarg [Aaaarg!~Arthur@121-74-35-148.telstraclear.net] has joined #ruby-lang
<dreinull> factory girl users here?
<dreinull> not sure how to set up many or belong_to associations
fayimora [fayimora!~fayimora@2a01:388:201:3721:1c4a:926e:6409:20b4] has joined #ruby-lang
<drbrain> dreinull: maybe #ror?
<dreinull> drbrain: good idea, thanks
<dreinull> not a ror user myself though...
<mksm> i'm a user of beach girl. :D
crudson [crudson!~doug@static-96-227-79-15.phlapa.fios.verizon.net] has joined #ruby-lang
flexd [flexd!~flexd@dev.flexd.net] has joined #ruby-lang
brushbox [brushbox!~brushbox@174.24.233.220.static.exetel.com.au] has joined #ruby-lang
shapeshed [shapeshed!~shapeshed@host-84-9-125-3.dslgb.com] has joined #ruby-lang
shapeshed_ [shapeshed_!~shapeshed@82.132.248.27] has joined #ruby-lang
Oloryn_lt2 [Oloryn_lt2!~Oloryn@96-25-160-157.gar.clearwire-wmx.net] has joined #ruby-lang
thrcka [thrcka!~thrcka@ip-89-102-34-33.net.upcbroadband.cz] has joined #ruby-lang
outoftime [outoftime!~mat@50.57.10.189] has joined #ruby-lang
RickHull [RickHull!~rhull@209.119.14.25] has joined #ruby-lang
<shevy> what
<manveru> why're you using AR then?
saLOUt [saLOUt!~rriemann@91-65-223-29-dynip.superkabel.de] has joined #ruby-lang
kyrylo [kyrylo!~kyrylo@46.118.221.156] has joined #ruby-lang
workmad3 [workmad3!~workmad3@cpc1-bagu10-2-0-cust81.1-3.cable.virginmedia.com] has joined #ruby-lang
outoftime [outoftime!~mat@ip-160-79-101-2.autorev.intellispace.net] has joined #ruby-lang
<zenspider> rails is not a requirement for using AR... it's an OK library standalone
robbyoconnor [robbyoconnor!~wakawaka@guifications/user/r0bby] has joined #ruby-lang
Heimidal [Heimidal!~heimidal@c-67-165-197-126.hsd1.co.comcast.net] has joined #ruby-lang
RickHull [RickHull!~rhull@209.119.14.25] has quit [#ruby-lang]
IoGA [IoGA!~ioga@91.191.181.77] has joined #ruby-lang
Defusal [Defusal!DeFi@unaffiliated/ecnerifed] has joined #ruby-lang
nofxx [nofxx!~nofxx@unaffiliated/nofxx] has joined #ruby-lang
macmartine [macmartine!~macmartin@069-064-227-254.pdx.net] has joined #ruby-lang
cjs226 [cjs226!~cjs226@99-61-65-242.lightspeed.austtx.sbcglobal.net] has joined #ruby-lang
jmontross [jmontross!~Adium@static-96-236-65-137.snfcca.dsl-w.verizon.net] has joined #ruby-lang
<jmontross> working on a gem that hooks into another gem and adds a bunch of observers automatically
<jmontross> wondering best way to copy files out of the gem's directory into this other location… should File.link work? or do I actually need to move file....
<drbrain> wait, you're editing the files in gem b from gem a?
<zenspider> jmontross: why would you copy the files??
<drbrain> jmontross: sounds like monkey patching but with heavy, dull swords
Defusal [Defusal!DeFi@unaffiliated/ecnerifed] has joined #ruby-lang
<zenspider> monkey PATCHing... not monkey bludgeoning :P
<erikh> monkey spanking
<shevy> poor monkeys :(
<drbrain> erikh: too tame
<erikh> ha
<drbrain> I couldn't come up with a clever zinger for (if I understand this correctly) OVERWRITING FILES YOU DON'T OWN
<erikh> yeah that won't ever go wrong
Indian [Indian!~Indian@unaffiliated/londonmet050] has joined #ruby-lang
matti [matti!matti@acrux.romke.net] has joined #ruby-lang
matti [matti!matti@madwifi/support/matti] has joined #ruby-lang
petercooper [petercooper!~petercoop@82.144.254.2] has joined #ruby-lang
<erikh> wasn't there a gem ratings site now/
<erikh> integrating that @ rubygems.org might not be a bad idea to prevent some of these, eh "gems"
<erikh> (I punned. I apologize.)
looopy [looopy!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
Oloryn_lt21 [Oloryn_lt21!~Oloryn@96-25-160-157.gar.clearwire-wmx.net] has joined #ruby-lang
<manveru> erikh: you mean https://www.ruby-toolbox.com/ ?
<lzhz> manveru: nice, but very limited scope.
<zenspider> has anyone released a gem in the last ... hour?
<erikh> manveru: yeah I think that's it.
<lzhz> would have loved to be able to search for gems by tags, preferrably from command line.
wmoxam_ [wmoxam_!~wmoxam@69-196-139-164.dsl.teksavvy.com] has joined #ruby-lang
slyphon [slyphon!~weechat@unaffiliated/slyphon] has joined #ruby-lang
Oloryn_lt2 [Oloryn_lt2!~Oloryn@96-25-160-157.gar.clearwire-wmx.net] has joined #ruby-lang
<jmontross> zenspider: well - it's a bunch of observer files that reside in the gem directory… and the gem is run via command line to pull these files and add them into observer of the other rails app that is not a gem (just resides on server somewhere)
zmack [zmack!~zmack@78.97.129.175] has joined #ruby-lang
<zenspider> jmontross: ... you DO know that ruby is a dynamic language, right?
<jmontross> zen: yes… but how would I automatically pull in observers into a rails app without manually modifiying this rails app every time I pull in the code?
<jmontross> the rails app is maintained by third party, and we update their code every so often
<jmontross> and I want this to be handled by hudson, which is limited to shell scripts
outoftime [outoftime!~mat@50.57.10.189] has joined #ruby-lang
<petercooper> shevy: Thanks
<jmontross> drbrain: Not overwriting any files… adding observers and modifying environment.rb in a rails app
<drbrain> jmontross: ok, you scared me there!
Steppenwolf [Steppenwolf!~maus@86-45-26-32-dynamic.b-ras1.wtd.waterford.eircom.net] has joined #ruby-lang
<drbrain> I would copy files into the rails app, not link
<jmontross> I want a rails app to have observers, the rails app is maintained by someone else and i git clone every so often… File class does not seem to have a copy method
<jmontross> I'll just shell out I imagine
<zenspider> rdoc_osx_dictionary 2.0.0 released
<drbrain> FileUtils