x1337807x [x1337807x!~jonan@208-100-171-17.bendbroadband.com] has joined #ruby-lang
<x1337807x>
If I want my gem to store an API key locally where should I do it?
<x1337807x>
I want to prompt the user for their API key on first run and store it for later use.
<wmoxam>
x1337807x: in a config file?
lsegal [lsegal!jinx@modemcable249.109-177-173.mc.videotron.ca] has joined #ruby-lang
<x1337807x>
wmoxam: Yeah I guess I'm just asking where said file should be stored. This is my first gem. Just create a . file in their home directory?
<theconartist>
x1337807x: is it meant to be used as a library?
<theconartist>
if it's standalone them i'd make a dotfile
<x1337807x>
It's a guard extension to monitor Shopify templates and upload them if files are modified.
<x1337807x>
OK
<x1337807x>
thank you
<x1337807x>
Is there a way to ensure that the file is removed when the gem is uninstalled? I don't like the idea of leaving anything behind if they want to remove the gem.
mdel [mdel!~mdel@pool-71-175-17-16.phlapa.fios.verizon.net] has joined #ruby-lang
<ryanf>
x1337807x: you could create it inside your gem folder, I'm not sure if there's any way to avoid permissions issues if they aren't using rvm though
<ryanf>
since the user won't own the gem folder
<x1337807x>
Yeah that's the problem
<x1337807x>
ok, guess they get to keep a random dotfile
<ryanf>
yeah, they'll live
agib [agib!u781@gateway/web/irccloud.com/x-zqzfnnynxeyjgrkj] has joined #ruby-lang
tallship [tallship!~tallship@pool-71-189-131-153.lsanca.fios.verizon.net] has joined #ruby-lang
savage- [savage-!~savage-@c-67-180-11-89.hsd1.ca.comcast.net] has joined #ruby-lang
looopy_ [looopy_!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
infid [infid!~infid@rrcs-24-43-240-138.west.biz.rr.com] has joined #ruby-lang
priteshjain [priteshjain!~priteshja@113.193.43.127] has joined #ruby-lang
Banistergalaxy [Banistergalaxy!~AndChat@222.153.223.41] has joined #ruby-lang
vmatiyko [vmatiyko!~vmatiyko@178.120.60.40] has joined #ruby-lang
bglusman [bglusman!~bglusman@c-71-224-192-35.hsd1.pa.comcast.net] has joined #ruby-lang
savage- [savage-!~savage-@c-67-180-11-89.hsd1.ca.comcast.net] has joined #ruby-lang
savage- [savage-!~savage-@c-67-180-11-89.hsd1.ca.comcast.net] has joined #ruby-lang
diegovio1a [diegovio1a!~diego@host-1-211.b15.cvc.com.py] has joined #ruby-lang
thone_ [thone_!~thone@g225086243.adsl.alicedsl.de] has joined #ruby-lang
looopy [looopy!~looopy@pool-141-156-50-228.washdc.btas.verizon.net] has joined #ruby-lang
looopy_ [looopy_!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
setmeaway [setmeaway!setmeaway3@119.201.52.190] has joined #ruby-lang
dr0id [dr0id!~andy@unaffiliated/dr0id] has joined #ruby-lang
Marco [Marco!~marco@Marco-2.Kiewit.dartmouth.edu] has joined #ruby-lang
tychobrailleur [tychobrailleur!~sebastien@176.61.72.130] has joined #ruby-lang
wallerdev [wallerdev!~wallerdev@c-68-43-58-191.hsd1.mi.comcast.net] has joined #ruby-lang
krz [krz!~foobar@unaffiliated/krz] has joined #ruby-lang
flori [flori!flori@irc.ping.de] has joined #ruby-lang
igaiga [igaiga!~igaiga@w0109-49-134-239-21.uqwimax.jp] has joined #ruby-lang
krzkrzkrz [krzkrzkrz!~foobar@182.16.234.9] has joined #ruby-lang
krzkrzkrz [krzkrzkrz!~foobar@unaffiliated/krz] has joined #ruby-lang
yxhuvud [yxhuvud!mongo@h-209-13.a212.priv.bahnhof.se] has joined #ruby-lang
mark-ruby [mark-ruby!4b198a67@gateway/web/freenode/ip.75.25.138.103] has joined #ruby-lang
<mark-ruby>
Hi, everyone. I am a Ruby newbie and going through the Pickaxe 19.1. I'd like to test my knowledge with some easy to moderate exercises. Does anyone know where I could find some of these?
dous [dous!~dous@unaffiliated/dous] has joined #ruby-lang
dous_ [dous_!~dous@cm171.sigma67.maxonline.com.sg] has joined #ruby-lang
gnufied [gnufied!~gnufied@122.172.246.117] has joined #ruby-lang
fayimora [fayimora!~fayimora@109.175.187.177] has joined #ruby-lang
<andrewvos>
mark-ruby: Yes! Ruby Koans is a good place to learn.
<mark-ruby>
Hi andrewvos, thanks, I will check it out!
<andrewvos>
mark-ruby: The Koans are very complete.
<andrewvos>
mark-ruby: You will learn more from them than from those Katas.
<mark-ruby>
Heh, they look interesting.
<andrewvos>
mark-ruby: Quite fun too.
jensn [jensn!~Jens@c-83-233-145-148.cust.bredband2.com] has joined #ruby-lang
<andrewvos>
mark-ruby: They will teach you about all the little weird parts of ruby.
shevy [shevy!~shevy@178-191-189-9.adsl.highway.telekom.at] has joined #ruby-lang
<mark-ruby>
Ok, I am on the path to enlightenment. :)
<mark-ruby>
andrewvos: I guess you'll gain karma as I progress?
<zenspider>
eh. do both.
<mark-ruby>
Zenspider: Thanks, I'll try.
<zenspider>
the _only_ way to get good at coding (or anything, really) is to read & write tons of it
daglees [daglees!~belvedere@unaffiliated/daglees] has joined #ruby-lang
<mark-ruby>
I believe it. I know it's going to be a challenge because I work on a startup in a non-programming role, but I've loved the programming courses and small projects I've done before.
Guedes [Guedes!~guedes@unaffiliated/guedes] has joined #ruby-lang
tekin [tekin!~tekin@cpc8-with5-2-0-cust208.1-4.cable.virginmedia.com] has joined #ruby-lang
<andrewvos>
What role?
mytrile [mytrile!~mytrile@77.70.29.148] has joined #ruby-lang
Guest77199 [Guest77199!~davidw@adsl-ull-196-118.51-151.net24.it] has joined #ruby-lang
Asher [Asher!~asher@98.158.127.150] has joined #ruby-lang
cyri_ [cyri_!~cyri_@jem75-1-87-88-118-80.dsl.sta.abo.bbox.fr] has joined #ruby-lang
dous [dous!~dous@unaffiliated/dous] has joined #ruby-lang
alessio_rocco [alessio_rocco!~alessio@109.236.24.77] has joined #ruby-lang
adambeynon [adambeynon!~adambeyno@82-69-1-211.dsl.in-addr.zen.co.uk] has joined #ruby-lang
dous_ [dous_!~dous@cm171.sigma67.maxonline.com.sg] has joined #ruby-lang
alip [alip!~alip@exherbo/developer/alip] has joined #ruby-lang
whatasunnyday [whatasunnyday!~sunny@c-24-130-81-47.hsd1.ca.comcast.net] has joined #ruby-lang
adambeynon [adambeynon!~adambeyno@82-69-1-211.dsl.in-addr.zen.co.uk] has joined #ruby-lang
<erikh>
nah I'm proof that reading and writing tons of code doesn't make you any good
<mark-ruby>
andrewvos: CEO :)
<mark-ruby>
But I think I may enjoy programming more.
workmad3 [workmad3!~workmad3@cpc1-bagu10-2-0-cust81.1-3.cable.virginmedia.com] has joined #ruby-lang
<mark-ruby>
At the least, I think it will help me be a lot more effective as a founder.
jasox [jasox!~jasox@178.239.26.139] has joined #ruby-lang
ttilley [ttilley!~ttilley@unaffiliated/lv] has joined #ruby-lang
<erikh>
I wish mruby was here now
<erikh>
I'd much prefer to use it over lua for this
<andrewvos>
mark-ruby: Good.. Was about to say that almost every other position in a startup that is not the owner should be a developer.
<andrewvos>
erikh: What are you up to?
<erikh>
oh a thing
<erikh>
it's a service manager that leverages scripting languages instead of shell scripts (via callbacks)
<erikh>
think upstart or monit
<erikh>
I'm doing it in lua because of the footprint which is waaaaaay smaller than mri
kitallis-cloud [kitallis-cloud!u358@gateway/web/irccloud.com/x-frvifhlbsliaseno] has joined #ruby-lang
<erikh>
heh
<manveru>
not gonna replace our env with this shiny new stuff :)
<manveru>
does lua compile with dietlibc?
<erikh>
yeah; my end goal is to get better at C. bonus points if I can bring it into work
<erikh>
manveru: unsure
agib [agib!u781@gateway/web/irccloud.com/x-ynfhjxqcfrieqbnb] has joined #ruby-lang
danishman [danishman!~kvirc@0x5da0ec2a.cpe.ge-0-1-0-1104.ronnqu1.customer.tele.dk] has joined #ruby-lang
<mark-ruby>
andrewvos: I agree. I joke that if I could get receptionists who code, I would. :)
beawesomeinstead [beawesomeinstead!u1643@gateway/web/irccloud.com/x-irpsnzzqgacakskp] has joined #ruby-lang
dnyy [dnyy!u2106@gateway/web/irccloud.com/x-ccccgbkbrcbzvzqb] has joined #ruby-lang
cesario [cesario!u2444@gateway/web/irccloud.com/x-cynwwgfvcjojsjmu] has joined #ruby-lang
<andrewvos>
erikh: I didn't even know about upstart or monit. I could have user this information on Thursday :(
<andrewvos>
s/user/used
workmad3 [workmad3!~workmad3@cpc1-bagu10-2-0-cust81.1-3.cable.virginmedia.com] has joined #ruby-lang
stamina [stamina!~stamina@ip5452a9bc.speed.planet.nl] has joined #ruby-lang
timbleck [timbleck!u3835@gateway/web/irccloud.com/x-cgbtgebgsubwalhs] has joined #ruby-lang
necromancer [necromancer!u4538@gateway/web/irccloud.com/x-azznhdikkwkettmy] has joined #ruby-lang
<erikh>
andrewvos: monit is rather nice, I like it a lot but it doesn't address the issue of how programs are actually started
<erikh>
and it has monitoring features but they're pretty weak, really.
Carnage\ [Carnage\!~carnage@84-75-163-211.dclient.hispeed.ch] has joined #ruby-lang
charper [charper!u1691@gateway/web/irccloud.com/x-nymlaepwjrhlpfxl] has joined #ruby-lang
darkswoop [darkswoop!~darkswoop@31-19-44-89-dynip.superkabel.de] has joined #ruby-lang
fritzek [fritzek!~fritzek@p5DDB5730.dip.t-dialin.net] has joined #ruby-lang
<chris2>
bougyman: pong
ksinkar [ksinkar!~ksinkar@115.241.229.177] has joined #ruby-lang
<manveru>
chris2: he's asleep
<manveru>
might get up in 1-2 hours
benanne [benanne!~rijdier@234.141-241-81.adsl-dyn.isp.belgacom.be] has joined #ruby-lang
gnufied [gnufied!~gnufied@122.172.246.117] has joined #ruby-lang
saLOUt [saLOUt!~rriemann@91-65-223-29-dynip.superkabel.de] has joined #ruby-lang
<chris2>
dunno, he pinged me
Locke23rus [Locke23rus!~quassel@128-70-111-50.broadband.corbina.ru] has joined #ruby-lang
toretore [toretore!~toretore@crr06-3-82-231-12-81.fbx.proxad.net] has joined #ruby-lang
<rue>
FROM SLEEP
ksinkar [ksinkar!~ksinkar@115.241.229.177] has joined #ruby-lang
replore_ [replore_!~replore@ntkngw298122.kngw.nt.ftth.ppp.infoweb.ne.jp] has joined #ruby-lang
<chris2>
^^
stamina [stamina!~stamina@ip5452a9bc.speed.planet.nl] has joined #ruby-lang
thrcka [thrcka!~thrcka@ip-89-102-34-33.net.upcbroadband.cz] has joined #ruby-lang
Defusal [Defusal!DeFi@unaffiliated/ecnerifed] has joined #ruby-lang
robgleeson [robgleeson!~rob@subtle/contributor/robgleeson] has joined #ruby-lang
robotmay [robotmay!~robotmay@5ad8f1da.bb.sky.com] has joined #ruby-lang
jasox [jasox!~jasox@178.239.26.139] has joined #ruby-lang
Faris1 [Faris1!~amnay@41.249.12.105] has joined #ruby-lang
jensn [jensn!~Jens@c-83-233-145-148.cust.bredband2.com] has joined #ruby-lang
priteshjain [priteshjain!~priteshja@113.193.47.245] has joined #ruby-lang
Faris [Faris!~amnay@41.249.138.58] has joined #ruby-lang
dous [dous!~dous@unaffiliated/dous] has joined #ruby-lang
dous [dous!~dous@unaffiliated/dous] has joined #ruby-lang
empity [empity!~user@host86-169-141-32.range86-169.btcentralplus.com] has joined #ruby-lang
QaDeS [QaDeS!~mklaus@frbg-5f7326a2.pool.mediaWays.net] has joined #ruby-lang
uniqanomaly [uniqanomaly!~ua@dynamic-78-8-213-238.ssp.dialog.net.pl] has joined #ruby-lang
priteshjain [priteshjain!~priteshja@113.193.47.245] has joined #ruby-lang
Keva161 [Keva161!~Keva161@78.32.156.143] has joined #ruby-lang
Natch| [Natch|!~natch@178.73.216.32] has joined #ruby-lang
tbuehlmann [tbuehlmann!~Tobias@unaffiliated/tovias] has joined #ruby-lang
priteshjain [priteshjain!~priteshja@113.193.47.245] has joined #ruby-lang
tokumine [tokumine!~kunio@82-69-174-54.dsl.in-addr.zen.co.uk] has joined #ruby-lang
Briareos1_ [Briareos1_!~quassel@13-98-136-94.static.net4you.net] has joined #ruby-lang
niklasb [niklasb!~codeslay0@p5B311B2A.dip0.t-ipconnect.de] has joined #ruby-lang
dr0id [dr0id!~andy@unaffiliated/dr0id] has joined #ruby-lang
gnufied [gnufied!~gnufied@122.172.246.117] has joined #ruby-lang
tokumine [tokumine!~kunio@82-69-174-54.dsl.in-addr.zen.co.uk] has joined #ruby-lang
savage- [savage-!~savage-@c-67-180-11-89.hsd1.ca.comcast.net] has joined #ruby-lang
krz [krz!~foobar@unaffiliated/krz] has joined #ruby-lang
virunga [virunga!~virunga@151.64.47.191] has joined #ruby-lang
ajeis_ [ajeis_!~quassel@27.107.3.0] has joined #ruby-lang
uniqanomaly [uniqanomaly!~ua@dynamic-78-8-213-238.ssp.dialog.net.pl] has joined #ruby-lang
trunikov_ [trunikov_!~trunikov@footly-harmonica.volia.net] has joined #ruby-lang
vmatiyko [vmatiyko!~vmatiyko@178.120.60.40] has joined #ruby-lang
t4nk603 [t4nk603!51dcc5fc@gateway/web/freenode/ip.81.220.197.252] has joined #ruby-lang
tokumine [tokumine!~kunio@82-69-174-54.dsl.in-addr.zen.co.uk] has joined #ruby-lang
imperator [imperator!~Daniel@63-225-247-192.hlrn.qwest.net] has joined #ruby-lang
Carnage\ [Carnage\!~carnage@84-75-163-211.dclient.hispeed.ch] has joined #ruby-lang
jasox [jasox!~jasox@178.239.26.139] has joined #ruby-lang
* imperator
uses /= for the first time ever
<rue>
Writing your own base converter?
enebo [enebo!~enebo@75-168-50-253.mpls.qwest.net] has joined #ruby-lang
<imperator>
nah, have to modify a value after the fact on osx
ajeis [ajeis!~quassel@14.194.193.252] has joined #ruby-lang
<andrewvos>
What does that do?
alip [alip!~alip@exherbo/developer/alip] has joined #ruby-lang
<rue>
Diveq?
desireco_ [desireco_!~textual@108-217-153-195.lightspeed.cicril.sbcglobal.net] has joined #ruby-lang
<andrewvos>
Oh ok googled it sorry.
<whitequark>
impressive
<whitequark>
just got /home/grindars/.rvm/gems/ruby-1.9.3-p0/gems/bindata-1.4.3/lib/bindata/struct.rb:283:in `instantiate_obj_at': method `method_missing' called on hidden T_HASH object (0x886b0c0 flags=0x28 klass=0x0)
priteshjain [priteshjain!~priteshja@113.193.47.245] has joined #ruby-lang
<whitequark>
looks like I found a spurious bug in MRI.
<whitequark>
the offending statement: "if @field_objs[index].nil?"
publicvoid [publicvoid!~publicvoi@p5DC15594.dip.t-dialin.net] has joined #ruby-lang
<imperator>
whitequark, post it to ruby-core
<imperator>
(or maybe mention it in #ruby-core)
<rue>
Report it
<rue>
klass=0x0 >x<
<imperator>
so you might say it has....zero class?
<whitequark>
imperator: I cannot reproduce it on my machine...
<whitequark>
it only manifests itself on a particular setup
<whitequark>
it was compiled from the same 1.9.3p0 sources with the same rvm on debian wheezy setup (also same)
<whitequark>
also, looks like it does not exhibits itself on 1.9.2, even on that machine
<whitequark>
weird
<imperator>
what is bindata?
<whitequark>
a (very good) gem for working with binary data formats in a declarative style
<t4nk603>
Has someone already worked with Actor model ? I really need some help to understand its concept
<whitequark>
it's in pure Ruby
<whitequark>
zero class is very strange
<whitequark>
after I do a nonimportant change, it reports a missing method for a complete nonsense
<whitequark>
I'd say it is a memory corruption somewhere
tomzx [tomzx!~tomzx@70.52.27.16] has joined #ruby-lang
<rue>
t4nk603: What about it?
<rue>
Conceptually it's quite simple: you send messages to an actor, and at some point in the future it will (or won't) do something about it
burgestrand [burgestrand!~burgestra@h-45-63.a155.priv.bahnhof.se] has joined #ruby-lang
vmatiyko [vmatiyko!~vmatiyko@178.120.60.40] has joined #ruby-lang
RomD [RomD!~Roman@nrbg-4d076bd7.pool.mediaWays.net] has joined #ruby-lang
retro|cz [retro|cz!~retro@106.142.broadband6.iol.cz] has joined #ruby-lang
JosephRuby [JosephRuby!~joseph@46.33.39.205] has joined #ruby-lang
MrGando [MrGando!~MrGando@186.9.129.181] has joined #ruby-lang
<MrGando>
Hey guys, I'm having some trouble installing a gem… is this the right place to ask a question about it ?
<andrewvos>
MrGando: Yes.
<burgestrand>
MrGando: depends on the nature of your trouble. is your machine plugged in and turned on?
ajeis_ [ajeis_!~quassel@182.156.114.170] has joined #ruby-lang
gnufied [gnufied!~gnufied@122.172.246.117] has joined #ruby-lang
<andrewvos>
MrGando: Put the errors in gist.github.com and just ask the question. Don't ask to ask. People will whine enough if you ask the wrong wquestions.
<imperator>
MrGando, what platform are you on?
<burgestrand>
MrGando: it’s not meant for 1.9
<andrewvos>
MrGando: If it's windows you need to insall the Ruby devkit. If it's OS X you need xcode.
<MrGando>
andrewvos: -_- hahaha, well, I'm trying to run Teambox ( rails app ) , the thing is that when I do : bundle exec unicorn_rails -p 5000 -E production ( which works with 1.8.7 ) , I get: Could not find SystemTimer-1.2.1 in any of the sources
<MrGando>
,
<MrGando>
then I try to do bundle install… and the SystemTimer thing fails
<burgestrand>
MrGando: add :platform => :mri_18 to the line where it says gem 'SystemTimer'
<andrewvos>
MrGando: Is that another agile tool?
<burgestrand>
MrGando: in the Gemfile file
<MrGando>
andrewvos: It's actually quite good :), I'm loving it… it's just for project management, but it's quite simple
<MrGando>
burgestrand: ok , will try :)
<burgestrand>
MrGando: so, it’ll read gem 'SystemTimer', :platform => :mri_18
<andrewvos>
MrGando: You don't have a board to put cards on? :)
<MrGando>
andrewvos: We do ;) but it's still good hahaha
<MrGando>
The line now reads : gem 'SystemTimer', '~> 1.2.0', :require => 'system_timer' ,
<andrewvos>
burgestrand: What does that do exactly?
<burgestrand>
I’m not entirely sure the platform is :mri_18, but I’m fairly certain. bundlers’ website appears to be down and I can’t figure out how to reach the Gemfile manpage from the CLI
<andrewvos>
burgestrand: Force the platform for all gems?
<burgestrand>
andrewvos: just the gem you add the option to, fairly sure you can make it a scope as well somehow, and use a block
dfr|mac [dfr|mac!~dfr|work@ool-18baf7e7.dyn.optonline.net] has joined #ruby-lang
<burgestrand>
andrewvos: and if you run bundler on another platform it’ll simply skip that gem
<andrewvos>
burgestrand: It is mri_18
<burgestrand>
andrewvos: awesome; how’d you find it?
<andrewvos>
burgestrand: So now his code has to run under 18?
<MrGando>
burgestrand: worked… now I'll see if I can do bundle install
<burgestrand>
andrewvos: no, it can run on all platforms but for ruby 1.9 it won’t need to install systemtimer
<burgestrand>
andrewvos: heh, figures, I was on gembundler.org, instead of .com, should’ve googled ;)
<andrewvos>
burgestrand: Ohhh ok that's cool then.
<burgestrand>
andrewvos: so, you could say gem 'backports', :platform => :ruby_18 (for example)
<Tasser>
MrGando, file a request for a dummy for ruby 1.9
<MrGando>
Ok, this one is weird hahaha, It told me "gem X failed to install" ahhaha, then I installed the gem successfully and the error persists … weird… https://gist.github.com/01fcd6507334d81b68ae <-- weird
<MrGando>
Tasser: What is a dummy request ? I could file it If I knew what it was
<Tasser>
MrGando, a request for a dummy of SystemTimer for stupid gems that require it even if they're run in 1.9
<MrGando>
Where can I file that ?
<Tasser>
MrGando, at the systemtimer repo?
<burgestrand>
MrGando: this new issue is probably not part of the installation process, I believe it errors out when it reads information about the gem
<MrGando>
Tasser: Will do
<burgestrand>
MrGando: what version of bundler are you using? `bundle -v`
<MrGando>
Bundler version 1.0.21
<burgestrand>
MrGando: I’d give it a try with the prerelease version of bundler, `gem install bundler --pre`
<burgestrand>
MrGando: in case it does not work, you can always `gem uninstall bundler` and then remove the 1.1.rc.7 version you’ll have by then
<andrewvos>
burgestrand: If he's not doing active development just running some app then perhaps we should advocate running it under 1.8.7.
<MrGando>
burgestrand: I will try
<burgestrand>
andrewvos: sound idea, I’m just assuming he has a reason to go through this trouble trying to run it on 1.9 when he already has it running on 1.8 :p
<MrGando>
burgestrand: I think I may just say " screw 1.9"
Keva161 [Keva161!~Keva161@78.32.156.143] has joined #ruby-lang
<burgestrand>
MrGando: if it runs and if you don’t explicitly need 1.9, just stick with 1.8 for this one :)
<MrGando>
can I run this with 1.8 and have 1.9 for other things ? is that something that I should specify in the gemfile ?
<burgestrand>
MrGando: yes, no
<MrGando>
burgestrand: How should I do it ? :)
<burgestrand>
MrGando: well, all that matters is which version of ruby you use to boot the application; as for everything else, same thing there, which version of ruby you are using at that time is what matters
<burgestrand>
MrGando: so, if you want to use 1.8 and 1.9 alongside each other, you’ll want an installation of ruby 1.8, and an installation of ruby 1.9
<burgestrand>
MrGando: how’d you install the 1.9 you’re on right now?
<MrGando>
burgestrand: I'm using rvm, so I have 1.9.2 and 1.8.7
<burgestrand>
MrGando: awesome :)
bryanl [bryanl!~bryanl@li362-49.members.linode.com] has joined #ruby-lang
<MrGando>
burgestrand: I would really like to keep 1.9.2 as default, but would love to be able to run teambox with 1.8.7… dunno if it's possible though
<andrewvos>
WOOHOO RVM
<burgestrand>
MrGando: all you need to do is to use ruby 1.8.7 when you start the application and it’ll start in 1.8.7
<MrGando>
burgestrand: Could you elaborate ? :P I'm a ruby noooob
<burgestrand>
MrGando: for everything else, just use ruby 1.9 when you run that
<burgestrand>
MrGando: ”rvm use 1.8.7”, same thing you use for switching
<burgestrand>
MrGando: however, I guess you keep it deployed somewhere as an application that always runs?
<MrGando>
burgestrand: yeah,
<andrewvos>
MrGando: put a .rvmrc file with the contents "rvm 1.8.7" in the root directory of the project. cd out of the directory and back in and rvm will switch to 1.8.7
<burgestrand>
MrGando: nginx, apache, maybe on heroku?
<MrGando>
apache :( ( for now )
<andrewvos>
Ok Skyrim time
<andrewvos>
Peace
<burgestrand>
MrGando: using passenger?
<MrGando>
burgestrand: Unicorn
<t4nk603>
Anyone playing SWOTR btw ?
<andrewvos>
t4nk603: Wht's that?
<t4nk603>
Star Wars of the Old Republic
<andrewvos>
t4nk603: Is it new?
<t4nk603>
Yeah quite
<t4nk603>
like 3 weeks maybe
<andrewvos>
Ooh
<t4nk603>
MMORPG, but in SW universe
<burgestrand>
MrGando: I’d use “rvm wrapper” to create a wrapper-script for ruby 1.8, it’ll set-up the environment when run — I guess you point unicorn to which ruby it will use in some configuration file?
<burgestrand>
MrGando: I haven’t deployed with unicorn myself so I can’t provide any details
andrewhl [andrewhl!~andrew@24-246-15-43.cable.teksavvy.com] has joined #ruby-lang
<MrGando>
well , to run my Application I just do : bundle exec unicorn_rails -p 5000 -E production
<MrGando>
burgestrand: let me see if my virtualhost setup has more details
bryanl [bryanl!~bryanl@li362-49.members.linode.com] has joined #ruby-lang
t4nk603 [t4nk603!51dcc5fc@gateway/web/freenode/ip.81.220.197.252] has quit [#ruby-lang]
Spooner [Spooner!~Miranda@host-78-144-139-130.as13285.net] has joined #ruby-lang
<burgestrand>
MrGando: probably need a wrapper for unicorn_rails, and possibly bundler as well
dejongge [dejongge!~jonke@pD9E0CE96.dip0.t-ipconnect.de] has joined #ruby-lang
tychobrailleur [tychobrailleur!~sebastien@176.61.72.130] has joined #ruby-lang
virunga [virunga!~virunga@151.64.47.191] has quit ["Sto andando via"]
jasox [jasox!~jasox@178.239.26.139] has joined #ruby-lang
h4y4shi_ [h4y4shi_!~IceChat7@rrcs-67-79-54-130.sw.biz.rr.com] has joined #ruby-lang
<h4y4shi_>
Hello
<imperator>
why hello th....oh, left already
gnufied [gnufied!~gnufied@122.172.246.117] has joined #ruby-lang
ajeis [ajeis!~quassel@182.156.72.183] has joined #ruby-lang
wmoxam [wmoxam!~wmoxam@pdpc/supporter/active/wmoxam] has joined #ruby-lang
looopy_ [looopy_!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
<whitequark>
and I've found that class << self does not allow to pass locals as upvalues
<whitequark>
any ideas?
<whitequark>
define_singleton_method.
<Mon_Ouie>
singleton_class.class_eval
<whitequark>
nevermind
<Mon_Ouie>
Or that
savage- [savage-!~savage-@c-67-180-11-89.hsd1.ca.comcast.net] has joined #ruby-lang
<whitequark>
a friend has recently spent ~week implementing AVM2 file format reader/writer in C++
<whitequark>
today I showed him Ruby and bindata gem
<whitequark>
it's been roughly four hours, and we're almost reimplemented that.
<shevy>
whitequark cool
<shevy>
never heard about bindata gem before I think
ben [ben!~v@dslb-088-066-000-219.pools.arcor-ip.net] has joined #ruby-lang
<whitequark>
shevy: it's a _super cool_ gem for working with binary data formats made by some perverts like Adobe
<whitequark>
who look bit-stuffing and similar weirdness
<whitequark>
s,look,like,
<whitequark>
you can define practically everything humanity has invented in binary formats (optional fields, non-byte alignment, choices) in its DSL
thrcka [thrcka!~thrcka@ip-89-102-34-33.net.upcbroadband.cz] has joined #ruby-lang
workmad3 [workmad3!~workmad3@cpc1-bagu10-2-0-cust81.1-3.cable.virginmedia.com] has joined #ruby-lang
<burgestrand>
awesome
<whitequark>
indeed
<whitequark>
it also has tracing
<whitequark>
which allows you to find out where exactly you have missed a single bit
<whitequark>
I have some doubts on its performance, through. It's pure Ruby
<whitequark>
but I'm going to make some benchmarks
M4g1c5t0rM [M4g1c5t0rM!~M4g1c5t0r@201.22.190.116.dynamic.adsl.gvt.net.br] has joined #ruby-lang
confounds [confounds!~confounds@CPE78cd8e667600-CM78cd8e6675fd.cpe.net.cable.rogers.com] has joined #ruby-lang
Pip [Pip!~Pip@unaffiliated/pip] has joined #ruby-lang
MistyM [MistyM!~MistyM@50.72.70.192] has joined #ruby-lang
iande [iande!~ieccles@dynamic-acs-24-144-204-51.zoominternet.net] has joined #ruby-lang
M4g1c5t0rM [M4g1c5t0rM!~M4g1c5t0r@201.22.190.72.dynamic.adsl.gvt.net.br] has joined #ruby-lang
CCD [CCD!~ccd@pool-74-103-35-18.bltmmd.fios.verizon.net] has joined #ruby-lang
looopy [looopy!~looopy@pool-141-156-50-228.washdc.btas.verizon.net] has joined #ruby-lang
mdel [mdel!~mdel@pool-71-175-17-16.phlapa.fios.verizon.net] has joined #ruby-lang
<shevy>
hmm
gnufied [gnufied!~gnufied@122.172.246.117] has joined #ruby-lang
looopy_ [looopy_!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
halux [halux!~halux@114.79.0.231] has joined #ruby-lang
<halux>
hi all
<halux>
how i can learn ruby?
<yorickpeterse>
Depends, do you have any prior knowlege of programming?
<yorickpeterse>
I played with Rubymonk (http://rubymonk.com/) a while back and it seems like a nice way of learning it
<erikh>
!learntoprogram
<erikh>
bah
<erikh>
corundum: learn to program?
<corundum>
A good Ruby tutorial for newbies to programming: http://pine.fm/LearnToProgram/. NOTE: For linux installation section (in Chapter 0), the filename presented is just a example.
<halux>
from where to start?
<erikh>
look above!
<halux>
:(
<halux>
i have to buy
<erikh>
no, you have to click
<halux>
i've looked before
pipolo [pipolo!~pipolo@host7-171-dynamic.33-79-r.retail.telecomitalia.it] has joined #ruby-lang
pipolo [pipolo!~pipolo@host7-171-dynamic.33-79-r.retail.telecomitalia.it] has quit [#ruby-lang]
Guest77199 [Guest77199!~davidw@adsl-ull-196-118.51-151.net24.it] has joined #ruby-lang
<halux>
oke thanks
<halux>
erikh
<halux>
see u
<halux>
good night
<shevy>
lol
<shevy>
hilarious guy
solars [solars!~solars@194.208.132.118] has joined #ruby-lang
gnufied [gnufied!~gnufied@122.172.246.117] has joined #ruby-lang
darkf [darkf!~darkf_dix@unaffiliated/darkf] has joined #ruby-lang
Jake232 [Jake232!~textual@5e04f412.bb.sky.com] has joined #ruby-lang
<andrewvos>
WTF just happened.
Natch [Natch!~natch@178.73.216.135] has joined #ruby-lang
abuiles [abuiles!u1641@gateway/web/irccloud.com/x-awjlsgxugqkyfvqu] has joined #ruby-lang
Carmivore [Carmivore!~carmivmor@ec2-50-19-3-56.compute-1.amazonaws.com] has joined #ruby-lang
denysonique_ [denysonique_!u484@gateway/web/irccloud.com/x-adtnjypkefpgxjjo] has joined #ruby-lang
lsegal [lsegal!jinx@modemcable249.109-177-173.mc.videotron.ca] has joined #ruby-lang
spuk [spuk!~spuk@187.65.176.82] has joined #ruby-lang
ryanf [ryanf!~revfitz@adsl-67-122-210-85.dsl.pltn13.pacbell.net] has joined #ruby-lang
Indian [Indian!~Indian@unaffiliated/londonmet050] has joined #ruby-lang
enikar [enikar!~gil@cl-140.mrs-01.fr.sixxs.net] has joined #ruby-lang
workmad3 [workmad3!~workmad3@cpc1-bagu10-2-0-cust81.1-3.cable.virginmedia.com] has joined #ruby-lang
amerine [amerine!~mturner@bc171197.bendcable.com] has joined #ruby-lang
queequeg1 [queequeg1!~queequeg@c-71-202-152-67.hsd1.ca.comcast.net] has joined #ruby-lang
gnufied1 [gnufied1!~gnufied@122.172.246.117] has joined #ruby-lang
queequeg1 [queequeg1!~chatzilla@c-71-202-152-67.hsd1.ca.comcast.net] has joined #ruby-lang
ttilley [ttilley!~ttilley@c-98-217-122-24.hsd1.ma.comcast.net] has joined #ruby-lang
ttilley [ttilley!~ttilley@unaffiliated/lv] has joined #ruby-lang
saLOUt [saLOUt!~rriemann@91-65-223-29-dynip.superkabel.de] has joined #ruby-lang
voker57 [voker57!~voker57@128-70-15-152.broadband.corbina.ru] has joined #ruby-lang
voker57 [voker57!~voker57@kvirc/developer/Voker57] has joined #ruby-lang
davidw [davidw!~davidw@apache/committer/davidw] has joined #ruby-lang
nofxx_ [nofxx_!~nofxx@unaffiliated/nofxx] has joined #ruby-lang
fayimora [fayimora!~fayimora@109.175.187.177] has joined #ruby-lang
tomzx [tomzx!~tomzx@70.52.27.16] has joined #ruby-lang
queequeg1 [queequeg1!~chatzilla@c-71-202-152-67.hsd1.ca.comcast.net] has joined #ruby-lang
Lennier [Lennier!~joon_ch@217-162-147-86.dynamic.hispeed.ch] has joined #ruby-lang
kyrylo [kyrylo!~kyrylo@46.118.221.254] has joined #ruby-lang
<andrewvos>
So I have a bin/file and I want to execute it in cucumber. Rubygems automatically adds lib to the laod path.. How should I do it nicely when I run my tests?
skinnymuch [skinnymuch!~skinnymuc@c-68-36-123-133.hsd1.nj.comcast.net] has joined #ruby-lang
<andrewvos>
Hmmm. Adding "lib" to the loadpath in env.rb is what injekt mentioned.
<andrewvos>
I'll do that until someone says it's a bad idea.
<andrewvos>
Wait that won't work.
skinnymuch [skinnymuch!~skinnymuc@c-68-36-123-133.hsd1.nj.comcast.net] has quit [#ruby-lang]
<andrewvos>
Because I'm executing my bin file.
<andrewvos>
Shit
RomyEatsDrupal [RomyEatsDrupal!~stickycak@dyn-160-39-140-229.dyn.columbia.edu] has joined #ruby-lang
<whitequark>
all of the combinations are roughly equivalent..
Pip [Pip!~Pip@host-88-156-66-217.spbmts.ru] has joined #ruby-lang
Pip [Pip!~Pip@unaffiliated/pip] has joined #ruby-lang
mkscrg [mkscrg!~mkscrg@ool-18e4f9d6.dyn.optonline.net] has joined #ruby-lang
chessguy [chessguy!~chessguy@pool-96-231-167-66.washdc.fios.verizon.net] has joined #ruby-lang
anjen [anjen!~anjen@99-29-152-246.lightspeed.bcvloh.sbcglobal.net] has joined #ruby-lang
<andrewvos>
Programming is hard.
<whitequark>
thanks, Captain Obvious
<andrewvos>
Harsh.
<andrewvos>
Non mocking people please help me.
JosephRuby [JosephRuby!~joseph@46.33.39.205] has joined #ruby-lang
Carmivore [Carmivore!~carmivmor@ec2-174-129-189-6.compute-1.amazonaws.com] has joined #ruby-lang
voker57 [voker57!~voker57@128-70-15-152.broadband.corbina.ru] has joined #ruby-lang
voker57 [voker57!~voker57@kvirc/developer/Voker57] has joined #ruby-lang
<andrewvos>
I have a class that is my entry point for my binary.
<andrewvos>
It has a method called execute, which takes ARGV and "output" which is normally Kernel when not under test.
<drbrain>
andman: about the bin_path thing?
<andrewvos>
I want to test that my class is doing the right things
<drbrain>
oops, andrewvos ^^
<andrewvos>
So it's responsibility is to parse the ARGV bits and push them onto somewhere else.
<drbrain>
system Gem.ruby, Gem.bin_path(gem_name, exec_name), arg1, arg2, ...
<andrewvos>
Now do I test that this class is passing the right parameters to the other classes?
<andrewvos>
Or do I assert against what happens when this class calls the other classes?
<andrewvos>
The second case means I would only have unit tests for the entry point class
<andrewvos>
HAve I explained terribly?
<andrewvos>
drbrain: Nope moved on to next problem now.
Pip [Pip!~Pip@host-87-156-66-217.spbmts.ru] has joined #ruby-lang
Pip [Pip!~Pip@unaffiliated/pip] has joined #ruby-lang
<andrewvos>
Or maybe I have to just leave this to my integration tests?
<drbrain>
andrewvos: for my executable entry point I have one method that takes ARGV
<drbrain>
it calls process_args which uses optparse or whatever to get a Hash or whatever back
<drbrain>
which then calls a method to do the work
<drbrain>
the method that does the work is tested just like any other method
<drbrain>
the method that processes args is tested just like any other method, %w[--foo --bar=baz] goes in, {:foo => true, :bar=>'baz'} or whatever comes out
<drbrain>
so the usefulness of a test for it is limited
<drbrain>
andrewvos: is that helpful?
<andrewvos>
drbrain: Very.
<andrewvos>
Ok but I'm still kind of stuck on one point.
<andrewvos>
Ok wait I wrote out the question and the answer was obvious :)
<drbrain>
heh
skinnymuch [skinnymuch!~skinnymuc@c-68-36-123-133.hsd1.nj.comcast.net] has joined #ruby-lang
<andrewvos>
drbrain: Thanks you're pointed me in the right direction for now :)
Carmivore [Carmivore!~carmivmor@ec2-107-20-33-211.compute-1.amazonaws.com] has joined #ruby-lang
skinnymuch [skinnymuch!~skinnymuc@c-68-36-123-133.hsd1.nj.comcast.net] has quit [#ruby-lang]
<andrewvos>
I'm kind of lost on how to test that one class is calling another class with the correct methods.
<andrewvos>
Just in general.
<drbrain>
andrewvos: what I like about the way I do it is that it's really easy to use my executable entry point as API without needing system
<drbrain>
you just require and provide the options hash instead of the ARGV hash
<andrewvos>
I mean without class.should_receive(...)
<drbrain>
ARGV array
<drbrain>
andrewvos: I usually test that it does something trivial if the other class has something trivial to do
<drbrain>
if it's something big I write a stub
<drbrain>
dependency injection is useful for writing stubs
<drbrain>
you can replace the real behavior with a stub that says "yeah, I was called"
<drbrain>
real behavior => real class
<andrewvos>
drbrain: And how do you write these stubs? Just roll a class?
<drbrain>
yeah
<andrewvos>
Fair enough.
<andrewvos>
Ok feeling a bit better about this now.
<drbrain>
or stub = Object.new; def stub.some_method(*args); end
<drbrain>
Ruby is an adequate stubbing framework all by itself
<andrewvos>
Yeah
<drbrain>
I also find it useful to avoid classes that immediately do work in initialize
<drbrain>
separating setup from running helps write better tests
<andrewvos>
drbrain: Yeah I also try only set instance variables in initialize.
<andrewvos>
One thing I can take from statically typed languages that still applies.
<drbrain>
it also helps avoid needing stubs
<drbrain>
you can call a method on the object to indicate at least one thing you passed is set-up
<drbrain>
and trust the tests in the class to be comprehensive for all the behavior
<andrewvos>
drbrain: So you mean call initialize("hello") and then check that an attribtue on the class is equal to "hello"?
<drbrain>
andrewvos: or something more meaningful to the class
<andrewvos>
Fair enough
<drbrain>
if you were working with a job queue you might refute_empty the_queue
srbartlett [srbartlett!~srbartlet@202.146.7.239] has joined #ruby-lang
<andrewvos>
Don't get what you mean
<drbrain>
if you're testing a class that adds items to a job queue you would write:
<rue>
Almost universally, code that's easily testable is better
<erikh>
not that this helps much, but "avoid coupling" is the fundamental lesson
<drbrain>
def add_item(work_to_do) job = pre_process work_to_do; @job_queue.add_item job; end
<drbrain>
so if your job queue is empty to start you can add an assertion that it is not empty when the test is done
<drbrain>
no need to test that the job queue works, just that it got your message
<erikh>
it's like a jungle sometimes
<rue>
As a user, when I'm in the jungle
Carnage\ [Carnage\!~carnage@84-75-163-211.dclient.hispeed.ch] has joined #ruby-lang
looopy_ [looopy_!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
jasox [jasox!~jasox@178.239.26.139] has joined #ruby-lang
desireco_ [desireco_!~textual@108-217-153-195.lightspeed.cicril.sbcglobal.net] has joined #ruby-lang
<injekt>
manveru: huh?
<andrewvos>
I need to read a book
<andrewvos>
Or find someone to pair with who isn't a mockist
wallerdev [wallerdev!~wallerdev@c-68-43-58-191.hsd1.mi.comcast.net] has joined #ruby-lang
<erikh>
make a mockery of their test suite.
<erikh>
yuk yuk
<andrewvos>
heh
<injekt>
oh wow
<injekt>
you went low then
* injekt
pulls erikh back up
mkscrg [mkscrg!~mkscrg@ool-18e4f9d6.dyn.optonline.net] has joined #ruby-lang
<andrewvos>
Yea I just laughed to be nice
<andrewvos>
haha
<erikh>
yeah the humor valve is a bit leaky lately
<andrewvos>
erikh: Get drunk. At least it will be funny to you then?
<andrewvos>
drbrain: How did you learn to code like this?
<erikh>
hm
<erikh>
good idea
<andrewvos>
Wish I had a beer now actually
<drbrain>
lot's of practice
<drbrain>
-'
slaytanic [slaytanic!~slaytanic@host226.190-31-167.telecom.net.ar] has joined #ruby-lang
<rue>
^
iande [iande!~ieccles@dynamic-acs-24-144-204-51.zoominternet.net] has joined #ruby-lang
<rue>
Find out what doesn't work, and then do something else also works.
<epitron>
lol: <freedrull> i think of arrays as a really really long skinny waffle that is only one "waffle-hole" wide
<epitron>
that sounds delicious
<epitron>
a = []; 1000.times { a << :syrop }
<rue>
But waffles can't grow in size
<andrewvos>
I have an "executer" class which takes a hash of options now. I want it to use those options to decide what methods to call on another class.
<erikh>
leave them out for a few weeks
<epitron>
rue: unless you have a special waffle maker which can append a single waffle-hole to an existing one-dimensional waffle
<rue>
erikh: They'll turn into hash
Keva161 [Keva161!~Keva161@78.32.156.143] has joined #ruby-lang
<andrewvos>
Ok now I'm hungry
<erikh>
turing waffle-maker
Lennier [Lennier!~joon_ch@217-162-147-86.dynamic.hispeed.ch] has joined #ruby-lang
<andrewvos>
I have an "executer" class which takes a hash of options now. I want it to use those options to decide what methods to call on another class. How can I test that the executioner class is initializing another class with the correct parameters?
<andrewvos>
One option is to inject the class constant into the "executer"
<andrewvos>
But then how do I test that initialize is being called correctly?
<andrewvos>
Oh wait, I could just test an attribute like drbrain said. Hmm.
andrewhl [andrewhl!~andrew@69-165-217-17.dsl.teksavvy.com] has joined #ruby-lang
<erikh>
instance_variable_get
<erikh>
(if you don't expose it via attrs)
<andrewvos>
hmmm
<andrewvos>
better perhaps
<andrewvos>
Wait but if I'm passing in ClassName and the executer class calls new, how do I get the variable then? This feels wrong somehow.
<erikh>
what are you setting the ClassName instance to?
<andrewvos>
A fake
<erikh>
are you trying to test the type or some operation it performs?
<andrewvos>
erikh: Not really. The executer is calling an API class. I want to be sure it passes in the correct url when calling new.
<erikh>
ah, hrm. I guess I'd have to see code at this point.
<andrewvos>
Basically I just want to be sure that this class is newing up another class with the correct parameters. Also, I'm injecting the class name into the initializer.
<erikh>
well you could test the ivar, then test ivars on the ivar
<erikh>
this is entering the realm of silly though
<erikh>
I'd test the behavior
<andrewvos>
erikh: Exactly.
<erikh>
(which may be what you're trying to do; I missed the first part of the conversation)
<andrewvos>
What I just did was move that line of code out and ignore it.
<andrewvos>
erikh: I suppose that's what I have integration tests for.
<erikh>
I call those "tests"
<erikh>
dunno, never really understood the point of partitioning test suites
<erikh>
anyhow, I'll spare you the dogma. best of luck.
Jake232 [Jake232!~textual@5e04f412.bb.sky.com] has joined #ruby-lang
slaytanic [slaytanic!~slaytanic@host226.190-31-167.telecom.net.ar] has joined #ruby-lang
<andrewvos>
hehe
<andrewvos>
Thanks
tokumine [tokumine!~kunio@82-69-174-54.dsl.in-addr.zen.co.uk] has joined #ruby-lang
<drbrain>
andrewvos: don't be afraid to get your tests "wrong" the first time
<drbrain>
write enough tests so that you can safely refactor
<andrewvos>
drbrain: cool
<drbrain>
then, improve both your code and your tests by refactoring them together
<andrewvos>
It's tricky moving away from mocking.
<andrewvos>
But I can already see the benefit of less code.
<drbrain>
I don't think there's anything inherently wrong with mocking
<drbrain>
it's just not for me
<drbrain>
there was a really good talk on mocking at RubyConf this year, you should watch the video