<injekt>
try using an absolute path for your config/unicorn.rb and try it again
<djcercone>
tried that and tried specifying the full path with no luck
<injekt>
ok, what about forgetting the unicorn config and just trying bundle exec unicorn and letting it use the defaults?
<djcercone>
I'm kind of new to understanding Ruby environments so I'm wondering between rvm, bundler, gems ... if I have something out of whack
<injekt>
djcercone: can you gist your unicorn.rb?
<djcercone>
not familiar with gist
<injekt>
sorry, paste it, gist.github.com or pastie.org
<djcercone>
as for the 'bundle exec unicorn' you mentioned, if I have my couchdb instance and redis-server up, it starts no problem
<djcercone>
unicorn starts taht is
<djcercone>
...that is
<injekt>
heh
<injekt>
so start unicorn last?
RomyRomy [RomyRomy!~stickycak@dyn-160-39-33-144.dyn.columbia.edu] has joined #ruby-lang
<djcercone>
not sure how to specify that unicorn needs to start last?
<injekt>
put it at the end of your procfile?
<injekt>
after the other stuff starts up?
<djcercone>
I tried that
<djcercone>
but still same error
<djcercone>
I only have two lines in my Procfile
<injekt>
the unicorn line in your procfile, does that work if you just pull it out and use it directly?
<djcercone>
yeah, but I've already started couchdb and redis-server manually
<injekt>
djcercone: you just need to ensure couch and redis are running first
<injekt>
your app shouldn't have to worry about booting those services
seich_ [seich_!~seich@web192.webfaction.com] has joined #ruby-lang
<injekt>
that's what your init scripts are for
<djcercone>
I thought that foreman would take of orchestrating the startup of couchdb, redis-server, and resque for me
<injekt>
how? you haven't told it to
<djcercone>
makes sense
tomzx_ [tomzx_!~tomzx@dsl-199-102-157-102.aei.ca] has joined #ruby-lang
<injekt>
you've asked resque to start processing workers, but redis might not be running
<djcercone>
I'm trying to take something someone else put together and made the recommendation to use foreman
<injekt>
again though, that's like your app making sure mysql is running, your app shouldn't care about that, it should just fail when you try to boot it
<djcercone>
so I thought the config was all in place for me
dreinull [dreinull!~dreieins@217.18.70.225] has joined #ruby-lang
<djcercone>
like I said before, I'm slowly getting my head wrapped around a ruby environment, so I'm not always 100% sure I'm doing things right
<djcercone>
so foreman can manage all that for my local dev environment, I just need to learn what to specify in the Procfile
<injekt>
anything you run via bundle exec you should put in your procfile
<injekt>
anything you dont (ie booting redis/couch/etc) your procfile shouldn't care about
<djcercone>
ok, if I choose not to start things manually (i.e. couchdb, redis) then putting them in the Procfile would be acceptable?
<injekt>
no, these services should be running already using init scripts. You can also create rake tasts for booting redis/couch if you want, but I personally wouldn't
<injekt>
djcercone: lean on your operating system for booting services
<djcercone>
right now I don't have anything specified in my init to start those services
<injekt>
what os are you on?
<djcercone>
OS X Lion
<injekt>
how did you install redis/couch?
<djcercone>
redis I donwloaded and then navigate to the 'src' directory and just start ./redis-server
take_cheeze [take_cheeze!~Adium@pc06224.anc-tv.ne.jp] has joined #ruby-lang
<injekt>
i would recommend searching around for running services like redis on osx and using a launchmanager
<injekt>
think of it like this, unless your application kills a service once it's done with it, it shouldn't be booting that service
<djcercone>
makes sense
<injekt>
your app kills unicorn once it's done with it, so it also boots it. However it doesn't kill couch or redis, because it only cares about them being alive during the boot process
<injekt>
so you should leverage your OS for managing services like that, I would recommend googling around, I use homebrew on OSX and have helpful initscripts for this kind of thing
<djcercone>
I'm familiar with homebrew, I use it too
<djcercone>
that's how I installed couchdb
<injekt>
homebrew probably downloads the launch plist, which you can load with `sudo launchctl load -w /path/to/plist`
<bnagy>
also, pretty much everything to do with how to use git is contraversial
<bnagy>
s/av/ov/
<shevy>
when I have a conflict I always remove .git and start from 0
<bnagy>
hahaha
priteshjain [priteshjain!~priteshja@115.248.175.50] has joined #ruby-lang
skiz [skiz!~skiz@c-69-181-211-4.hsd1.ca.comcast.net] has joined #ruby-lang
<drbrain>
bnagy: nice troll
<bnagy>
GIT Y U NO MERGE! DIE!
<bnagy>
drbrain: wasn't supposed to be a troll
<drbrain>
if you need a diagram to figure out your workflow you're doing it worng
Rakko [Rakko!~rakko@96-42-31-132.dhcp.mdsn.wi.charter.com] has joined #ruby-lang
<bnagy>
I _said_ it was controversial
<bnagy>
the second link has the command he was asking for in it though
ilyam [ilyam!~ilyam@c-67-188-113-128.hsd1.ca.comcast.net] has joined #ruby-lang
<bnagy>
also those two articles don't really agree
<drbrain>
computers were invented to save me from bookkeeping, not to create more bookkeeping
<bnagy>
I am just a git gumby, I can branch, merge push and pull. For more advanced stuff I don't think I have ever heard two 'expert developers' agree on how to use git :)
<shevy>
they need linus to resolve such conflicts
<bnagy>
yes because what every heated debate needs is linux in it :|
<bnagy>
*linus
<bnagy>
+1 for the resolving conflicts pun though
gregf [gregf!~gregf@207.5.168.94] has joined #ruby-lang
<shevy>
since his rant I know that:
<shevy>
C++ sucks
<shevy>
Gnome sucks
<shevy>
And it all turned out to be true!
slimfit [slimfit!~slimfit@c-98-245-122-231.hsd1.co.comcast.net] has joined #ruby-lang
sdeobald [sdeobald!~steven@122.167.116.57] has joined #ruby-lang
setmeaway [setmeaway!setmeaway3@118.45.149.58] has joined #ruby-lang
joast [joast!~rick@98.145.65.117] has joined #ruby-lang
darkf [darkf!~darkf_dix@unaffiliated/darkf] has joined #ruby-lang
priteshjain [priteshjain!~priteshja@115.248.175.50] has joined #ruby-lang
livinded [livinded!~lolwut@pool-108-23-242-132.lsanca.fios.verizon.net] has joined #ruby-lang
[dmp] [[dmp]!~dennis@users.d75.net] has joined #ruby-lang
[dmp] [[dmp]!~dennis@unaffiliated/dmp/x-546784] has joined #ruby-lang
take_cheeze [take_cheeze!~Adium@pc06224.anc-tv.ne.jp] has joined #ruby-lang
darkf [darkf!~darkf_dix@unaffiliated/darkf] has joined #ruby-lang
Heimidal [Heimidal!~heimidal@c-67-165-197-126.hsd1.co.comcast.net] has joined #ruby-lang
bobbywilson0 [bobbywilson0!~bobbyw@c-67-190-166-159.hsd1.co.comcast.net] has joined #ruby-lang
macmartine [macmartine!~macmartin@c-24-21-112-60.hsd1.or.comcast.net] has joined #ruby-lang
mikeric [mikeric!~mike@96.49.104.11] has joined #ruby-lang
lordofthedance [lordofthedance!~daddycool@wnpgmb0909w-ad01-148-207.dynamic.mtsallstream.net] has joined #ruby-lang
srbartle_ [srbartle_!~srbartlet@202.146.7.239] has joined #ruby-lang
Indian [Indian!~Indian@unaffiliated/londonmet050] has joined #ruby-lang
<erikh>
my god
<erikh>
grado
<erikh>
makes the best fucking headphones
<erikh>
these are orgasmic
RomyRomy [RomyRomy!~stickycak@cpe-69-203-115-155.nyc.res.rr.com] has joined #ruby-lang
michael_mbp [michael_mbp!~Marin@149.147.240.209] has joined #ruby-lang
hagabaka [hagabaka!~quassel@cblmdm24-53-178-92.buckeyecom.net] has joined #ruby-lang
hagabaka [hagabaka!~quassel@unaffiliated/hagabaka] has joined #ruby-lang
gregmoreno [gregmoreno!~gregmoren@173-13-141-62-sfba.hfc.comcastbusiness.net] has joined #ruby-lang
<shevy>
kinky
robbyoconnor [robbyoconnor!~wakawaka@guifications/user/r0bby] has joined #ruby-lang
ilyam [ilyam!~ilyam@c-67-188-113-128.hsd1.ca.comcast.net] has joined #ruby-lang
michael_mbp [michael_mbp!~Marin@149.147.240.209] has joined #ruby-lang
yxhuvud [yxhuvud!mongo@h-225-165.a212.priv.bahnhof.se] has joined #ruby-lang
<muzone>
erikh: well u know what they say
<muzone>
the better the headphones the worse the tinnitus :/
<erikh>
hahah
kain [kain!~kain@151.64.232.240] has joined #ruby-lang
dc5ala [dc5ala!~dc5ala@stgt-5d84b45e.pool.mediaWays.net] has joined #ruby-lang
kitallis [kitallis!~kitallis@122.167.116.57] has joined #ruby-lang
savage- [savage-!~savage-@c-67-180-11-89.hsd1.ca.comcast.net] has joined #ruby-lang
rpowell [rpowell!~rpowell@CPE-60-229-153-8.lns9.ken.bigpond.net.au] has joined #ruby-lang
brianpWins [brianpWins!~brianpWin@S01060014bf8930ea.vc.shawcable.net] has joined #ruby-lang
fragmachine [fragmachine!~fragmachi@101.169.26.5] has joined #ruby-lang
daglees [daglees!~belvedere@92.62.115.195] has joined #ruby-lang
daglees [daglees!~belvedere@unaffiliated/daglees] has joined #ruby-lang
aakashvd [aakashvd!~aakashvd@122.167.116.57] has joined #ruby-lang
butchanton [butchanton!~butchanto@c-71-202-131-177.hsd1.ca.comcast.net] has joined #ruby-lang
looopy [looopy!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
JohnBat26 [JohnBat26!~Eugene@89.175.77.79] has joined #ruby-lang
Eising [Eising!~allan@0x52b41d06.static.bcbnet.dk] has joined #ruby-lang
gregmoreno [gregmoreno!~gregmoren@173-13-141-62-sfba.hfc.comcastbusiness.net] has joined #ruby-lang
Z2FyZA [Z2FyZA!~gard@cm-84.215.22.0.getinternet.no] has joined #ruby-lang
thone_ [thone_!~thone@g226050000.adsl.alicedsl.de] has joined #ruby-lang
|Vargas| [|Vargas|!~luke@host165-130-dynamic.244-95-r.retail.telecomitalia.it] has joined #ruby-lang
|Vargas| [|Vargas|!~luke@pdpc/supporter/profesional/vargas] has joined #ruby-lang
krz [krz!~foobar@58.69.201.60] has joined #ruby-lang
krz [krz!~foobar@unaffiliated/krz] has joined #ruby-lang
senthil [senthil!~senthil@99-51-1-6.lightspeed.snjsca.sbcglobal.net] has joined #ruby-lang
robglees_ [robglees_!~rob@87-198-38-218.ptr.magnet.ie] has joined #ruby-lang
<robglees_>
is popen3 working on Windows yet?
sdeobald [sdeobald!~steven@122.172.224.154] has joined #ruby-lang
roadkith [roadkith!~kith@unaffiliated/kith] has joined #ruby-lang
zmack [zmack!~zmack@109.99.235.103] has joined #ruby-lang
<bnagy>
not sure, I had too many fails with it and wrote my own
<shevy>
lol
<bnagy>
I believe it is supposed to work now on 1.9
solars [solars!~solars@clnet-kmu02-090.ikbnet.co.at] has joined #ruby-lang
roadkith [roadkith!~kith@unaffiliated/kith] has joined #ruby-lang
roadkith [roadkith!~kith@unaffiliated/kith] has joined #ruby-lang
roadkith [roadkith!~kith@unaffiliated/kith] has joined #ruby-lang
amerine [amerine!~mturner@bc171197.bendcable.com] has joined #ruby-lang
<robglees_>
bnagy: thanks
Xzyx987X [Xzyx987X!~Xzyx987X@c-75-72-121-187.hsd1.mn.comcast.net] has joined #ruby-lang
<rue>
robglees_: Dan Berger's got various Windows tools
<bnagy>
I am pretty sure that 1.9 on windows automatically gets the win32api version of popen etc
<rue>
win32-process, maybe?
<rue>
I dunno about 1.9.3 indeed
<bnagy>
you shouldn't have to install anything
<shevy>
WE WANT 2.0!
<shevy>
shout, come on, loudly!
<masterkorp>
Kinda offtopic, can anyone give me the hourly rate medium payment of a ruby developer in the US ?
<shevy>
10 Dollars
<masterkorp>
shevy: seriously ?
<rue>
No
<masterkorp>
that's low even in my country
<masterkorp>
so can anyone just give me a mildly idea?
<tdmackey>
masterkorp: depends on your expertise, location, and the project
<rue>
Contract or FT?
mytrile [mytrile!~mytrile@94.26.28.135] has joined #ruby-lang
<masterkorp>
tdmackey: the average coder
<masterkorp>
let's say
<rue>
There's no such thing
<masterkorp>
i just need an idea
<tdmackey>
masterkorp: there isn't really an "average"
<rue>
Lowest contract rates are probably $75
<masterkorp>
for a employed ?
<shevy>
12 Dollars
<masterkorp>
75 dollors yay more than a day's work here
<rue>
FT hourly rates work out to maybe something like $30 in the lower end?
<masterkorp>
sweet, i will ask that :D
<masterkorp>
rue: that's like good money in my country
<masterkorp>
actaully my actual daily salary O.o
<rue>
You could work just a single day, then
<rue>
It's an unfortunate problem in Eastern Europe, for example, that many developers work for foreign companies. Unfortunate in the sense that the internal market stays undeveloped
<masterkorp>
rue: i am from the wersten europe
<masterkorp>
Portugal
roadkith [roadkith!~kith@unaffiliated/kith] has joined #ruby-lang
<masterkorp>
if you watch the news is totally shit
logbot45638 [logbot45638!~cinch@boxand.lnk.telstra.net] has joined #ruby-lang
<masterkorp>
companies closing like hell
looopy [looopy!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
<rue>
MM
<rue>
masterkorp: Working in IT currently?
<masterkorp>
rue: yeah
roadkith [roadkith!~kith@unaffiliated/kith] has joined #ruby-lang
logbot63096 [logbot63096!~cinch@boxand.lnk.telstra.net] has joined #ruby-lang
tasiu [tasiu!~tas@static.168.64.40.188.clients.your-server.de] has joined #ruby-lang
kitallis [kitallis!~kitallis@122.172.224.154] has joined #ruby-lang
krz [krz!~foobar@58.69.201.60] has joined #ruby-lang
krz [krz!~foobar@unaffiliated/krz] has joined #ruby-lang
JohnBat26 [JohnBat26!~Eugene@89.175.77.79] has joined #ruby-lang
Stalkr_ [Stalkr_!~Stalkr@x1-6-e0-46-9a-1f-97-a2.k617.webspeed.dk] has joined #ruby-lang
fra000 [fra000!~franc@93-43-144-183.ip92.fastwebnet.it] has joined #ruby-lang
Xzyx987X [Xzyx987X!~Xzyx987X@c-75-72-121-187.hsd1.mn.comcast.net] has joined #ruby-lang
ksinkar [ksinkar!~ksinkar@117.195.104.73] has joined #ruby-lang
nofxx [nofxx!~nofxx@177.106.32.38] has joined #ruby-lang
nofxx [nofxx!~nofxx@unaffiliated/nofxx] has joined #ruby-lang
srbaker [srbaker!~srbaker@67.137.71.254] has joined #ruby-lang
<Defusal>
can anyone tell me why this doesn't work? '"foo" "bar"'.scan /(?=")[^"]+(?=")/
<bnagy>
augh my eyes
<Defusal>
do you have a better solution? I'm all ears...
<Defusal>
as far as i am aware, the only way to repeatedly match something in ruby is with scan
<bnagy>
do you want the quotes in the result?
<Defusal>
no...
<bnagy>
I guess not or you wouldn't be hurting my eyes with lookaheads
<Defusal>
but positive lookforwards do not work
<Defusal>
s/lookforwards/lookaheads
<Defusal>
(?: and (?= do not match with scan, so i have no idea how to make it work...
<bnagy>
'"foo" "bar"'.scan(/"([^"]*)"/).flatten
<bnagy>
=> ["foo", "bar"]
<Defusal>
is that really the best way
<Defusal>
i can hack it to work using many ways
<Defusal>
i am looking for the best
<bnagy>
compared to using assertions? Oh my lordy yes
<Defusal>
alright
<Defusal>
thanks
<bnagy>
no worries :)
<bnagy>
I'm probably wrong btw
<bnagy>
but rue / manveru don't seem to be awake XD
<Defusal>
hehe
csherin [csherin!~csherin@122.166.150.76] has joined #ruby-lang
fayimora [fayimora!~fayimora@lt38-201.eecs.qmul.ac.uk] has joined #ruby-lang
michael_mbp [michael_mbp!~Marin@62.215.214.4] has joined #ruby-lang
tekin [tekin!~tekin@cpc8-with5-2-0-cust208.1-4.cable.virginmedia.com] has joined #ruby-lang
niklasb [niklasb!~codeslay0@p5B310A76.dip0.t-ipconnect.de] has joined #ruby-lang
roolo [roolo!~roolo@customer-79-127-150-214.net.angelnet.cz] has joined #ruby-lang
context [context!context@november.xen.prgmr.com] has joined #ruby-lang
csherin [csherin!~csherin@122.166.150.76] has joined #ruby-lang
context [context!context@november.xen.prgmr.com] has quit [#ruby-lang]
aroop [aroop!~aroop@50.46.157.247] has joined #ruby-lang
csherin [csherin!~csherin@122.166.150.76] has joined #ruby-lang
priteshjain [priteshjain!~priteshja@115.248.175.50] has joined #ruby-lang
shevy [shevy!~shevy@178-190-203-159.adsl.highway.telekom.at] has joined #ruby-lang
x0F__ [x0F__!~x0F@unaffiliated/x0f] has joined #ruby-lang
futurechimp [futurechimp!~futurechi@109.239.86.106] has joined #ruby-lang
<hagabaka>
Defusal: it doesn't work because you're trying to find a sub string where 'the next character is ", but the next few characters are not ", and then a " follows them'. The first lookahead contradicts with [^"]
<Defusal>
hagabaka, so then its not possible to use a lookahead i guess
<hagabaka>
I think it should be a look behind for the opening quote, but ruby doesn't support it, and I don't know how to test it in python or perl. Anyway using capture bnagy showed you is better
robotmay [robotmay!~robotmay@94.30.13.228] has joined #ruby-lang
<Defusal>
yeah, alright cool
looopy [looopy!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
ovnimancer [ovnimancer!~anton@212.59.96.38] has joined #ruby-lang
nebbie [nebbie!Neb@c-65-96-71-27.hsd1.ma.comcast.net] has joined #ruby-lang
tharchangl [tharchangl!~arik@bzq-79-183-216-186.red.bezeqint.net] has joined #ruby-lang
michael_mbp_ [michael_mbp_!~Marin@62.215.214.4] has joined #ruby-lang
michael_mbp_ [michael_mbp_!~Marin@62.215.214.4] has joined #ruby-lang
workmad3 [workmad3!~workmad3@vpn27.its.manchester.ac.uk] has joined #ruby-lang
nofxx [nofxx!~nofxx@177.106.32.38] has joined #ruby-lang
nofxx [nofxx!~nofxx@unaffiliated/nofxx] has joined #ruby-lang
Perry81 [Perry81!~Perry@186.87.120.219] has joined #ruby-lang
Natch| [Natch|!~natch@178.73.218.99] has joined #ruby-lang
ylluminate [ylluminate!~ylluminat@rrcs-24-123-53-166.central.biz.rr.com] has joined #ruby-lang
<ylluminate>
i'd like to understand the flow from script to script better in rails and to this end i was about to place a print statement in each rails script in my application to get a snapshot of which files / scripts are being evaluated on server exec and then during each request, etc. is there a better way to do this or get this kind of output?
Keltia_ [Keltia_!roberto@aran.keltia.net] has joined #ruby-lang
jmeeuwen [jmeeuwen!~kanarip@white.kolabsys.com] has joined #ruby-lang
roadkith [roadkith!~kith@unaffiliated/kith] has joined #ruby-lang
rob____ [rob____!~rob@dust.cx] has joined #ruby-lang
<rob____>
hi
ksinkar [ksinkar!~ksinkar@117.195.104.73] has joined #ruby-lang
<rob____>
if i want a task to run continuously in my ruby app should i use threads or is there a nice library that could handle polling something?
ksinkar [ksinkar!~ksinkar@117.195.104.73] has quit [#ruby-lang]
<bnagy>
there are lots, depending on what you want to do
<bnagy>
EventMachine is pretty popular
<bnagy>
but you might be just as well off with IO#select in a thread, all depends
<rob____>
essentially my app sits between a php/ajax frontend and andother RESTful API so i want to pull that other restful api for changes and store them in an object which i can check and give responses back to my frontend with..
<rob____>
thanks for the advice :)
take_cheeze [take_cheeze!~Adium@pc06224.anc-tv.ne.jp] has joined #ruby-lang
<bnagy>
quick and dirty would probably have an upstream Thread with a Queue that loops q.push upstream.read and a downstream thread that loops q.pop; write_to_wherever
<bnagy>
Queue is threadsafe
fragmachine [fragmachine!~fragmachi@101.170.247.78] has joined #ruby-lang
toretore [toretore!~toretore@crr06-3-82-231-12-81.fbx.proxad.net] has joined #ruby-lang
amerine [amerine!~mturner@bc171197.bendcable.com] has joined #ruby-lang
Stalkr_ [Stalkr_!~Stalkr@x1-6-e0-46-9a-1f-97-a2.k617.webspeed.dk] has joined #ruby-lang
tjadc [tjadc!~quassel@41-133-59-28.dsl.mweb.co.za] has joined #ruby-lang
<bnagy>
so GzipReader sucks
<bnagy>
I want my day back :|
<shevy>
lol
gianlucadv [gianlucadv!~gianlucad@host78-84-dynamic.44-79-r.retail.telecomitalia.it] has joined #ruby-lang
molgrew [molgrew!~bozo20@85.182.139.18] has joined #ruby-lang
michael_mbp [michael_mbp!~Marin@62.215.214.4] has joined #ruby-lang
michael_mbp_ [michael_mbp_!~Marin@178.161.0.186] has joined #ruby-lang
amerine_ [amerine_!~mturner@bc171197.bendcable.com] has joined #ruby-lang
rob____ [rob____!~rob@dust.cx] has quit [#ruby-lang]
kitallis [kitallis!~kitallis@122.172.224.154] has joined #ruby-lang
kyrylo [kyrylo!~kyrylo@46.118.230.17] has joined #ruby-lang
kyrylo [kyrylo!~kyrylo@subtle/user/kyrylo] has joined #ruby-lang
|Vargas| [|Vargas|!~luke@host165-130-dynamic.244-95-r.retail.telecomitalia.it] has joined #ruby-lang
|Vargas| [|Vargas|!~luke@pdpc/supporter/profesional/vargas] has joined #ruby-lang
Fullmoon [Fullmoon!~Fullmoon@dsl-stat-43-17.mmc.at] has joined #ruby-lang
gix [gix!~gix@e180021220.adsl.alicedsl.de] has joined #ruby-lang
<fragmachine>
how would I remove all newline and tab characters from each element in an array? I tried a few things like "b.each { |it| it.delete("\n")} " but no joy.
<bnagy>
uh don't really need map for that cause it's inplace tr
gokul [gokul!~gokulnath@115.111.177.122] has joined #ruby-lang
<fragmachine>
delete! worked a treat
kitallis [kitallis!~kitallis@122.172.224.154] has joined #ruby-lang
voker57 [voker57!~voker57@128-70-63-249.broadband.corbina.ru] has joined #ruby-lang
voker57 [voker57!~voker57@kvirc/developer/Voker57] has joined #ruby-lang
jensn [jensn!~Jens@c-83-233-145-148.cust.bredband2.com] has joined #ruby-lang
roolo [roolo!~roolo@customer-79-127-150-214.net.angelnet.cz] has joined #ruby-lang
tla [tla!~tla@toelboell-lund.dk] has joined #ruby-lang
ryez [ryez!3dabf6b3@gateway/web/freenode/ip.61.171.246.179] has joined #ruby-lang
tla_ [tla_!~tla@toelboell-lund.dk] has joined #ruby-lang
tla [tla!~tla@toelboell-lund.dk] has joined #ruby-lang
voker57_ [voker57_!~voker57@128-70-63-249.broadband.corbina.ru] has joined #ruby-lang
zwevans [zwevans!~zwevans@99-127-40-79.lightspeed.rlghnc.sbcglobal.net] has joined #ruby-lang
<fragmachine>
I have an array of strings like this 'Sweden, HTTPS, High+KA, 8minutes, 213.239.197.104, 3128'. When I try arrar[0].split(', ').last(2).join(':'), I get the ip address at the end joined nicely like a want. But if I try 'arr.each {|it| new << (junk << it.split('. ').last(2))}' I get nothing. Why is that?
<fragmachine>
or sorry, not nothing
<fragmachine>
I get the origional string
heftig [heftig!jan@archlinux/developer/heftig] has joined #ruby-lang
<fragmachine>
lianj: that's an awesome one liner, I gotta figure out how it works
<fragmachine>
awesome
<fragmachine>
I wish I looked that up a long time ago
<ddfreyne>
also see #select, #reject, #find/#detect and #inject
<fragmachine>
ok cool, will do
<bnagy>
ddfreyne, the Dr Seuss of #ruby-lang
<fragmachine>
haha
<lianj>
map_select would sometimes be nice
znouza [znouza!~textual@p5DDB8C73.dip.t-dialin.net] has joined #ruby-lang
amerine [amerine!~mturner@bc171197.bendcable.com] has joined #ruby-lang
<ddfreyne>
lianj: you can do that with 1.8.7 and later where #map returns an enumerator
<ddfreyne>
although nm
<injekt>
lianj: meh, map + compact works okay
gokul [gokul!~gokulnath@115.111.177.122] has quit ["Leaving"]
<ddfreyne>
at work here (in smalltalk) we have methods such as select:collect: and so on
<ddfreyne>
somewhat more efficient
<injekt>
isn't that the same as .select { }.map {} ?
roolo [roolo!~mailo@customer-79-127-150-214.net.angelnet.cz] has joined #ruby-lang
<lianj>
[1,2,3].map.select{|i| i > 1 ? :foo : nil } == [:foo, :foo] is what i mean, without doing a select{}.map{} two rounds
<injekt>
ah
<ddfreyne>
injekt: same effect
<ddfreyne>
but efficiency is better
<injekt>
yeah I'd imagine so
<ddfreyne>
or we need lazy collections
cyri_ [cyri_!~cyri_@232.93.119.80.rev.sfr.net] has joined #ruby-lang
<lianj>
guess class Array; def map_select(&b); raise 'sorry, no enum' unless b; a=[]; each{|i| a << i if (i=yield(i)) }; a; end; end; [1,2,3].map_select{|i| i*2 if i > 1 } would work as a cheap hack
vereteran [vereteran!~vereteran@static.88-198-170-117.clients.your-server.de] has joined #ruby-lang
tla_ [tla_!~tla@toelboell-lund.dk] has joined #ruby-lang
vereteran [vereteran!~vereteran@static.88-198-170-117.clients.your-server.de] has joined #ruby-lang
znouza [znouza!~znouza@orin.meinlschmidt.org] has joined #ruby-lang
<ddfreyne>
lianj: put it on Enumerable and raise an argumenterror instead
<ddfreyne>
you don't need b anyway... just check block_given?
<lianj>
but i hate writing out block_give? :P
frangiz [frangiz!~frangiz@user26.77-105-206.netatonce.net] has joined #ruby-lang
frangiz_ [frangiz_!~frangiz@user26.77-105-206.netatonce.net] has joined #ruby-lang
<shevy>
hehe
workmad3 [workmad3!~workmad3@vpn27.its.manchester.ac.uk] has joined #ruby-lang
mkirillov [mkirillov!max@nat/nokia/x-lhqybgqzngnrkkhs] has joined #ruby-lang
mark_locklear [mark_locklear!~jlocklear@ab-tech-lan-to-ab-tech-gw.ncren.net] has joined #ruby-lang
<rue>
What?
S2kx [S2kx!~S1kx@ip-95-223-80-198.unitymediagroup.de] has joined #ruby-lang
daglees [daglees!~belvedere@92.62.115.195] has joined #ruby-lang
daglees [daglees!~belvedere@unaffiliated/daglees] has joined #ruby-lang
jensn [jensn!~Jens@ip236-59.wireless.lu.se] has joined #ruby-lang
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby-lang
fayimora_ [fayimora_!~fayimora@138.37.124.41] has joined #ruby-lang
frangiz [frangiz!~frangiz@user26.77-105-206.netatonce.net] has joined #ruby-lang
fayimora [fayimora!~fayimora@138.37.124.41] has joined #ruby-lang
fayimora [fayimora!~fayimora@138.37.124.41] has joined #ruby-lang
frangiz [frangiz!~frangiz@user26.77-105-206.netatonce.net] has joined #ruby-lang
malev [malev!~malev@190.210.138.237] has joined #ruby-lang
brownies [brownies!~brownies@unaffiliated/brownies] has joined #ruby-lang
denysonique_ [denysonique_!u484@gateway/web/irccloud.com/x-orpfwiphxvxrcvod] has joined #ruby-lang
stephenp [stephenp!~stephenp@gatepost.hos.net] has joined #ruby-lang
dreinull [dreinull!~dreieins@217.18.70.225] has joined #ruby-lang
frangiz [frangiz!~frangiz@user26.77-105-206.netatonce.net] has joined #ruby-lang
jasim [jasim!~jasim@122.172.224.154] has joined #ruby-lang
tommyvyo [tommyvyo!~tommyvyo@38.123.129.115] has joined #ruby-lang
ovnimancer [ovnimancer!~anton@212.59.96.38] has quit [#ruby-lang]
Sailias [Sailias!~jonathan@CPE0018f85e576d-CM001bd7aaaf96.cpe.net.cable.rogers.com] has joined #ruby-lang
nebbie [nebbie!Neb@c-65-96-71-27.hsd1.ma.comcast.net] has joined #ruby-lang
naquad [naquad!~vereteran@static.88-198-170-117.clients.your-server.de] has joined #ruby-lang
frangiz_ [frangiz_!~frangiz@user26.77-105-206.netatonce.net] has joined #ruby-lang
vereteran [vereteran!~vereteran@static.88-198-170-117.clients.your-server.de] has joined #ruby-lang
malev [malev!~malev@74.10.95.2] 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
andrewhl [andrewhl!~andrew@24-246-14-26.cable.teksavvy.com] has joined #ruby-lang
elux [elux!~peter@96.45.198.150] has joined #ruby-lang
elux [elux!~peter@96.45.198.150] has joined #ruby-lang
robbrit [robbrit!~rob@38.108.76.250] has joined #ruby-lang
yfeldblum [yfeldblum!~Jay@pool-71-246-76-76.bltmmd.east.verizon.net] has joined #ruby-lang
mssola [mssola!~mssola@31.Red-83-63-162.staticIP.rima-tde.net] has joined #ruby-lang
SkramX [SkramX!~SkramX@128.164.24.131] has joined #ruby-lang
fritzek [fritzek!~fritzek@178.19.209.38] has joined #ruby-lang
ryez [ryez!b49d0e23@gateway/web/freenode/ip.180.157.14.35] has joined #ruby-lang
JEG2 [JEG2!~JEG2@ip72-198-103-217.ok.ok.cox.net] has joined #ruby-lang
dv310p3r [dv310p3r!~dv310p3r@host-208-68-238-122.biznesshosting.net] has joined #ruby-lang
tla_ [tla_!~tla@toelboell-lund.dk] has joined #ruby-lang
bglusman [bglusman!~bglusman@c-68-80-200-61.hsd1.pa.comcast.net] has joined #ruby-lang
flexd [flexd!~flexd@dev.flexd.net] has joined #ruby-lang
tomzx [tomzx!~tomzx@dsl-60-24.aei.ca] has joined #ruby-lang
<andrewvos>
WAT?
jtbandes [jtbandes!~jtbandes_@unaffiliated/jtbandes] has joined #ruby-lang
looopy [looopy!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
<jtbandes>
I have a line of code with the form "puts (stuff here).join". When I run this I get the message "(...) interpreted as grouped expression".... I can see why, but my syntax is how I want it. How can I avoid the warning?
<shevy>
jtbandes you can use a variable
<shevy>
x = (stuff here)
<shevy>
puts x.join
<jtbandes>
:/
<jtbandes>
Any one-line options?
<jtbandes>
aside from actually using puts((stuff).join)
<shevy>
what is "stuff here" precisely?
<jtbandes>
It's (method call << method call)
<shevy>
hmm
workmad3 [workmad3!~workmad3@vpn9.its.manchester.ac.uk] has joined #ruby-lang
<shevy>
puts ( ["okok"] << ["ok"] ).join # does not give me an error
yalue [yalue!812131fb@gateway/web/freenode/ip.129.33.49.251] has joined #ruby-lang
Peg-Leg [Peg-Leg!Peg-Leg@79.119.173.3] has joined #ruby-lang
Spooner [Spooner!~Miranda@host-78-144-139-130.as13285.net] has joined #ruby-lang
<jtbandes>
huh. ok, interesting.. so I only get the error when running my script from inside TextMate
Sailias [Sailias!~jonathan@s72-38-77-178.static.comm.cgocable.net] has joined #ruby-lang
<jtbandes>
well I'll just use a variable then. thanks
Sailias [Sailias!~jonathan@s72-38-77-178.static.comm.cgocable.net] has joined #ruby-lang
<shevy>
yeah don't trust any editors more than ruby or irb :) (or rather ruby, irb has a few special cases compared to "ruby foo.rb")
judofyr [judofyr!~judofyr@195.159.219.65] has joined #ruby-lang
<judofyr>
RUBY!
rippa [rippa!~rippa@109-161-65-161.pppoe.yaroslavl.ru] has joined #ruby-lang
slyphon [slyphon!~weechat@unaffiliated/slyphon] has joined #ruby-lang
<ddfreyne>
YAAARRGH!!
rob____ [rob____!~rob@dust.cx] has joined #ruby-lang
<rob____>
hi
<judofyr>
hi rob____
<rob____>
hey judofyr :)
<judofyr>
how's it going?
<rob____>
all good thanks
<judofyr>
did I confuse you too much?
<rob____>
hey thanks for that advice last time
<rob____>
i had a look at those links and was going to send you an email
futurechimp [futurechimp!~futurechi@109.239.86.106] has joined #ruby-lang
<judofyr>
rob____: also, obj.to_s is considered better style than "#{obj}"
<judofyr>
at least, I think so
tekin_ [tekin_!~tekin@cpc8-with5-2-0-cust208.1-4.cable.virginmedia.com] has joined #ruby-lang
<rob____>
ahh cool
<rob____>
it is?
adgar [adgar!~adgar@carbonica.xen.prgmr.com] has joined #ruby-lang
<fragmachine>
if I have an array like this ["UnitedStates", "187.115.65.155:3128", "Brazil", "201.64.254.228:3128", "Brazil", "218.210.199.252:3128"], how can I turn it into a hash with country name as the key and ip as the value?
<fragmachine>
this has me stumped
<judofyr>
fragmachine: Hash[*arr]
<judofyr>
or maybe Hash[arr]
<judofyr>
depends on which version of Ruby
<fragmachine>
wow
<fragmachine>
haha
<fragmachine>
what does the '*' do?
<judofyr>
actually, Hash[arr] doesn't work at all
<judofyr>
fragmachine: it's called the "splat operator"
<heftig>
fragmachine: you can't have the key "Brazil" twice
<judofyr>
Hash[*[1, 2, 3]] == Hash[1, 2, 3]
<fragmachine>
damn
<judofyr>
oh, with duplicate keys you need to do some more stuff, yeah
<fragmachine>
will arr['Brazil'] only return the first key?
<judofyr>
I don't think it's specified
<judofyr>
but I think it's the last key
<fragmachine>
ok, well that's no good
<fragmachine>
I wanted to get all the values that match the one key
tla_ [tla_!~tla@toelboell-lund.dk] has joined #ruby-lang
<injekt>
khaase: where in the stack are you throwing it?
<khaase>
injekt: I set it up in the routes file with match 'geo_ip.json', to: GeoIP.new
<khaase>
injekt: trying to move it to config.ru now
<injekt>
and have you changed it about to see if it makes any difference? It's the only way I see that differing from using it standalone
<khaase>
nope, still the same
<injekt>
khaase: try inserting it as middleware so you avoid the entire rails stack?
<khaase>
injekt: I just moved it to config.ru with map
<khaase>
injekt: so there is no rails stack in front of it
<injekt>
hmm
<khaase>
it's nice tho that `rails s` picks up config.ru rather than doing something manually
<injekt>
yeah, you can always throw it in as middleware anyway using config.middleware.insert_before(index, 'GeoIP')
<injekt>
then check env['PATH_INFO'] for '/gep_ip.json' and interupt the call
<injekt>
that's how I'd do it, anyway
<khaase>
yeah, sure, I'll try that next
<khaase>
only rails thing on the stack is railties command handling
<khaase>
strange thing is that the HTTP response from the external resource seems to be empty... I'll need to do some tcp dumping or something
<khaase>
fun times!
<injekt>
yeah, but remember the routing middleware is never reached, so are you sure your middleware is being executed correctly? (ensuring the path requested is /geo_ip.json?)
<injekt>
very odd
<injekt>
especially it the response is fine stand-alone
<khaase>
the path doesn't matter (my endpoint doesn't care), and it is reached, definetly
<khaase>
yeah
<injekt>
ah
<khaase>
i've already used a debugger
<khaase>
the (external) response I get in rails seems to be proper, but empty
<khaase>
ah, I have an idea
<khaase>
maybe request.ip is messed up for some reason
<khaase>
nope
<khaase>
that's fine
<khaase>
:(
bglusman [bglusman!~bglusman@c-68-80-200-61.hsd1.pa.comcast.net] has joined #ruby-lang
ltd [ltd!~z@zx.io] has joined #ruby-lang
bglusman [bglusman!~bglusman@c-68-80-200-61.hsd1.pa.comcast.net] has joined #ruby-lang
bobbywilson0 [bobbywilson0!~bobbyw@c-174-51-106-107.hsd1.co.comcast.net] has joined #ruby-lang
jensn [jensn!~Jens@ip236-59.wireless.lu.se] has joined #ruby-lang
tbuehlmann [tbuehlmann!~tobias@unaffiliated/tovias] has joined #ruby-lang
<khaase>
injekt: it was a version issue... bundler picked up an old version of em-http-request because newer versions depend on an eventmachine pre-release
Natch| [Natch|!~natch@178.73.217.91] has joined #ruby-lang
<khaase>
injekt: thanks
skiz [skiz!~skiz@c-69-181-211-4.hsd1.ca.comcast.net] has joined #ruby-lang
slyphon [slyphon!~weechat@unaffiliated/slyphon] has joined #ruby-lang
<khaase>
sweet, rails 3.2 runs into a deadlock with throw :async (the async response works, the next non-async one not so much)
<kalleth>
'sweet'
<kalleth>
;\
monkeysmuggler [monkeysmuggler!~smuxi@209.136.144.7] has joined #ruby-lang
<monkeysmuggler>
Question. I've been using FileUtil.cp_r to copy the contents of a directory and its subdirectories. The problem is, I want to ask the user if it finds an existing file if they want to replace it or not (similar to the Rails generator behavior). Any suggestions for where to start?
<ddfreyne>
monkeysmuggler: there is the Find module which allows traversal over a directory tree, then you can copy it one by one... not sure if you want that
<Defusal>
DOes anyone know how I can have a has_one association using a string column in the foreign table instead of the primary id key using ActiveRecord?
Jay_Levitt [Jay_Levitt!~Jay_Levit@c-24-63-250-125.hsd1.ma.comcast.net] has joined #ruby-lang
<ddfreyne>
Defusal: this is a ruby channel, not a rails channel
Dreamer3 [Dreamer3!~Dreamer3@74-134-34-116.dhcp.insightbb.com] has joined #ruby-lang
<lianj>
maybe someone with rvm and 1.8 can test it
Luxx_ [Luxx_!~highoh@c-67-171-35-186.hsd1.wa.comcast.net] has joined #ruby-lang
<kfries6>
My work-around, though not very elegant was to declare "output = StringIO.new", then change all my puts to output.puts, then everything is cached. From there, I can output puts or redirect to another system based upon script parameters
tenderlove [tenderlove!~tenderlov@pdpc/supporter/active/tenderlove] has joined #ruby-lang
<lianj>
does the line above break for you?
daglees [daglees!~belvedere@91.186.226.125] has joined #ruby-lang
daglees [daglees!~belvedere@unaffiliated/daglees] has joined #ruby-lang
<lianj>
hehe, would be awesome if ideone supported more ruby versions :D http://ideone.com/8ocWH
savage- [savage-!~savage-@istep.static.monkeybrains.net] has joined #ruby-lang
ickmund [ickmund!~ickmund@cli-5b7e85fc.bcn.adamo.es] has joined #ruby-lang
daglees__ [daglees__!~belvedere@unaffiliated/daglees] has joined #ruby-lang
<kfries6>
lianj: That command seems to have worked
nofxx [nofxx!~nofxx@177.106.32.38] has joined #ruby-lang
nofxx [nofxx!~nofxx@unaffiliated/nofxx] has joined #ruby-lang
malev [malev!~malev@74.10.95.2] has joined #ruby-lang
skiz [skiz!~skiz@216-75-227-188.static.wiline.com] has joined #ruby-lang
skiz [skiz!~skiz@216-75-227-188.static.wiline.com] has joined #ruby-lang
Jake232 [Jake232!~textual@5e04bcd1.bb.sky.com] has joined #ruby-lang
rippa [rippa!~rippa@109-161-65-161.pppoe.yaroslavl.ru] has joined #ruby-lang
lordofthedance [lordofthedance!~daddycool@wnpgmb0911w-ad03-102-94.dynamic.mtsallstream.net] has joined #ruby-lang
Heimidal [Heimidal!~heimidal@factory-smtp.factorylabs.com] has joined #ruby-lang
SuperTaz_work [SuperTaz_work!~supertaz_@38.99.52.59] has joined #ruby-lang
<Mon_Ouie>
You can use $stdout.string instead of rewind and read
<Defusal>
Hmmm
<Defusal>
This is tricky, does anyone know if you can setup a has_many :through => :through => association with ActiveRecord?
<Defusal>
User belongs_to :user_account, UserAccount has_many :games, Game has_many :players -- I want to create a double through so I can use User.players
<Defusal>
Any ideas?
<robbrit>
Defusal: you might get better luck over in #rubyonrails
<Defusal>
yeah i just joined and pasted my question there.. but in my experience, 9 out of 10 times, i either don't get a response there, or no one knows what i need to know
<Defusal>
this channel is far better, even when appearing to be idle
Paoc_ [Paoc_!~paoc@pc-192-161-164-190.cm.vtr.net] has joined #ruby-lang
savage- [savage-!~savage_@istep.static.monkeybrains.net] has joined #ruby-lang
<ReinH>
drbrain: :(
<robbrit>
Defusal: ah, i gotcha. i'd say think specifically what User.players is supposed to do. does it grab all the players that are in games related to the user? in current games? etc. once you figure that out it shouldn't be too hard to write code for User.players
dreinull [dreinull!dreieins@217.18.70.225] has joined #ruby-lang
roolo [roolo!~mailo@customer-79-127-150-214.net.angelnet.cz] has joined #ruby-lang
<Defusal>
robbrit, yeah im looking for a full AR association, but im gonna test and see now, thanks
alexkane [alexkane!~alexkane@38.117.157.141] has joined #ruby-lang
Asher [Asher!~asher@res-105001.nat.emory.edu] has joined #ruby-lang
<robbrit>
Defusal: yeah i can't really give you a good AR anything, it's been a long long time since i touched rails
amerine [amerine!~mturner@67.204.184.82] has joined #ruby-lang
outoftime [outoftime!~mat@ip-160-79-101-2.autorev.intellispace.net] has joined #ruby-lang
<Defusal>
robbrit, yeah I learn't rails at the same time as ruby, but have only ever used it for one clients project.. I just use ActiveSupport core extensions and AR when I have to use MySQL
<Defusal>
*learnt
apeiros_ [apeiros_!~apeiros@77-58-113-31.dclient.hispeed.ch] has joined #ruby-lang
slimfit [slimfit!~slimfit@50-76-131-66-static.hfc.comcastbusiness.net] has joined #ruby-lang
Stalkr_ [Stalkr_!~Stalkr@x1-6-e0-46-9a-1f-97-a2.k617.webspeed.dk] has joined #ruby-lang
heppy [heppy!~heppy@fw.baysidebusinessplaza.com] has joined #ruby-lang
lightcap [lightcap!~lightcap@97-115-85-29.ptld.qwest.net] has joined #ruby-lang
probst [probst!~probst@global-1-92.nat.csx.cam.ac.uk] has joined #ruby-lang
jmontross [jmontross!~Adium@64.74.213.74] has joined #ruby-lang
Carnage\ [Carnage\!~carnage@84-75-163-211.dclient.hispeed.ch] has joined #ruby-lang
wallerdev [wallerdev!~wallerdev@72.44.102.30] has joined #ruby-lang
dejongge [dejongge!~jonke@pD9E0C516.dip0.t-ipconnect.de] has joined #ruby-lang
lightcap [lightcap!~lightcap@184-100-173-167.ptld.qwest.net] has joined #ruby-lang
<ylluminate>
i've been struggling a little in rails understanding what scripts are being accessed on each request, ie understanding request dependencies. anyone know the best way to approach getting a hierarchical print out of the dependent files/scripts in a stack for each request? would it be best to dump out a stacktrace or is there a better method for more clarity?
hagabaka [hagabaka!~quassel@cblmdm24-53-178-92.buckeyecom.net] has joined #ruby-lang
hagabaka [hagabaka!~quassel@unaffiliated/hagabaka] has joined #ruby-lang
michael_mbp [michael_mbp!~Marin@149.147.73.7] has joined #ruby-lang
Asher [Asher!~asher@98.158.127.150] has joined #ruby-lang
probst [probst!~probst@global-1-92.nat.csx.cam.ac.uk] has quit [#ruby-lang]
toertore [toertore!~toretore@li22-80.members.linode.com] has joined #ruby-lang
mrsolo [mrsolo!~mrsolo@64.125.181.73] has joined #ruby-lang
Jake232 [Jake232!~textual@5e0217b6.bb.sky.com] has joined #ruby-lang
michael_mbp_ [michael_mbp_!~Marin@31.203.170.171] has joined #ruby-lang
ppl2 [ppl2!~ppl@222.236.30.217] has joined #ruby-lang
<rue>
ylluminate: #rubyonrails
<ylluminate>
rue: yes, however i'm not getting quite enough input there. i was thinking that this is more of a ruby question than rails
<ylluminate>
i was trying to use `puts caller`, but that is too verbose and not "intra-app" per se
outoftime [outoftime!~mat@ip-160-79-101-2.autorev.intellispace.net] has joined #ruby-lang
<rue>
You can dump a backtrace, or explore with Pry. Other than that, you'd want to ask #ror
lsegal [lsegal!jinx@modemcable249.109-177-173.mc.videotron.ca] has joined #ruby-lang
michael_mbp_ [michael_mbp_!~Marin@149.147.146.48] has joined #ruby-lang
<ylluminate>
how would you dump a backtrace; i was initially under the impression that was what caller was, but that's obviously off
<rue>
That's exactly what it is
<ylluminate>
huh, well that's only giving rails framework vs the helpers, controller, views etc.
<ylluminate>
strange
<rue>
It gives you the stack at that point in execution
<rue>
If the process has popped into some helper and returned, it won't show.
cyndis [cyndis!cyndis@lakka.kapsi.fi] has joined #ruby-lang
cyndis [cyndis!cyndis@lakka.kapsi.fi] has joined #ruby-lang
mssola [mssola!~mssola@31.Red-83-63-162.staticIP.rima-tde.net] has joined #ruby-lang
srbaker [srbaker!~srbaker@198.134.95.85] has joined #ruby-lang
andrewhl [andrewhl!~andrew@24-246-14-26.cable.teksavvy.com] has joined #ruby-lang
qpingu [qpingu!~Adium@67.218.117.238] has quit [#ruby-lang]
perryh__ [perryh__!~root@unaffiliated/perry753] has joined #ruby-lang
ivanoats [ivanoats!~ivanoats@pdpc/supporter/active/ivanoats] has joined #ruby-lang
SkramX [SkramX!~SkramX@128.164.118.166] has joined #ruby-lang
codewrangler [codewrangler!~codewrang@pool-72-66-12-100.washdc.fios.verizon.net] has joined #ruby-lang
gregmoreno [gregmoreno!~gregmoren@c-98-234-78-95.hsd1.ca.comcast.net] has joined #ruby-lang
wallerdev [wallerdev!~wallerdev@72.44.102.30] has joined #ruby-lang
slyphon [slyphon!~weechat@unaffiliated/slyphon] has joined #ruby-lang
jagan120 [jagan120!~jagan120@117.193.160.173] has joined #ruby-lang
<Defusal>
If anyone happens to be very familar with ActiveRecord associations, please let me know... :(
<rue>
I bet someone on #ror is.
<Defusal>
no one was for the past hour
<Defusal>
but someone just told me i can use manual joins
jagan120 [jagan120!~jagan120@117.193.160.173] has quit [#ruby-lang]
workmad3 [workmad3!~workmad3@cpc1-bagu10-2-0-cust81.1-3.cable.virginmedia.com] has joined #ruby-lang
Axsuul [Axsuul!~Axsuul@75-140-75-52.dhcp.mtpk.ca.charter.com] has joined #ruby-lang
frangiz [frangiz!~frangiz@user26.77-105-206.netatonce.net] has joined #ruby-lang
michael_mbp_ [michael_mbp_!~Marin@149.147.172.146] has joined #ruby-lang
jmontross [jmontross!~Adium@64.74.213.74] has quit [#ruby-lang]
optikalmouse [optikalmouse!~user@CPE002369def1ec-CM000e5c6dba64.cpe.net.cable.rogers.com] has joined #ruby-lang
<optikalmouse>
has anyone made a Ruby class/module browser that's similar to Smalltalk?
michael_mbp_ [michael_mbp_!~Marin@178.161.14.49] has joined #ruby-lang
<rue>
optikalmouse: I don't think there's anything current, but I might be wrong.
michael_mbp_ [michael_mbp_!~Marin@149.147.169.18] has joined #ruby-lang
publicvoid [publicvoid!~publicvoi@p4FCAE876.dip.t-dialin.net] has joined #ruby-lang
<rue>
Could search gems, maybe.
<rue>
Pry gives you a slightly nicer way of inspecting live code
JoelMcCracken [JoelMcCracken!~user@c-71-60-19-216.hsd1.pa.comcast.net] has joined #ruby-lang
<optikalmouse>
rue: I'm looking to get as close to Smalltalk as possible ;/
<optikalmouse>
can it give me rdoc or ri info too?
<rue>
Sure
michael_mbp_ [michael_mbp_!~Marin@31.203.246.58] has joined #ruby-lang
solars [solars!~solars@194.208.132.118] has joined #ruby-lang
qpingu [qpingu!~Adium@67.218.117.238] has joined #ruby-lang
indstry [indstry!~apple@c-71-238-98-243.hsd1.mi.comcast.net] has joined #ruby-lang
zzak_ [zzak_!a6f80f38@gateway/web/freenode/ip.166.248.15.56] has joined #ruby-lang
bitrot [bitrot!~smd@rrcs-50-84-14-82.sw.biz.rr.com] has joined #ruby-lang
<optikalmouse>
what do I need to be able to make GTK apps in Ruby?
<Mon_Ouie>
I think banister does like the idea of adding a GUI to Pry
<optikalmouse>
I just installed gtk2 gem and it doesnt seem like it does much? :S
lsegal [lsegal!jinx@modemcable249.109-177-173.mc.videotron.ca] has joined #ruby-lang
curtism [curtism!~curtis@bas11-montreal02-1128531121.dsl.bell.ca] has joined #ruby-lang
jmontross [jmontross!~Adium@64.74.213.74] has joined #ruby-lang
DEac- [DEac-!~deac@81.16.104.86] has joined #ruby-lang
jmontross [jmontross!~Adium@64.74.213.74] has quit [#ruby-lang]
postmodern [postmodern!~postmoder@c-71-237-178-98.hsd1.or.comcast.net] has joined #ruby-lang
djcercon_ [djcercon_!~djcercone@cpe-184-57-48-50.columbus.res.rr.com] has joined #ruby-lang
jamescotterill [jamescotterill!~james@94-192-130-249.zone6.bethere.co.uk] has joined #ruby-lang
SkramX [SkramX!~SkramX@128.164.27.115] has joined #ruby-lang
headius [headius!~headius@71-37-230-236.mpls.qwest.net] has joined #ruby-lang
benanne [benanne!~rijdier@ip-213-49-105-166.dsl.scarlet.be] has joined #ruby-lang
publicvoid [publicvoid!~publicvoi@p4FCAE876.dip.t-dialin.net] has joined #ruby-lang
slimfit [slimfit!~slimfit@173-8-242-217-Colorado.hfc.comcastbusiness.net] has joined #ruby-lang
Dreamer3__ [Dreamer3__!~Dreamer3@74-134-34-116.dhcp.insightbb.com] has joined #ruby-lang
jredville [jredville!~james.dev@173-160-211-253-Washington.hfc.comcastbusiness.net] has joined #ruby-lang
Austin__ [Austin__!~austin@96.45.197.22] has joined #ruby-lang
csherin [csherin!~csherin@61.11.125.236] has joined #ruby-lang
jensn [jensn!~Jens@c-83-233-145-148.cust.bredband2.com] has joined #ruby-lang
retro|cz [retro|cz!~retro@106.142.broadband6.iol.cz] has joined #ruby-lang
bradly [bradly!u5445@gateway/web/irccloud.com/x-kaomuyinggaidovc] has joined #ruby-lang
twittard [twittard!~twittard@wc.lax.truecarcorp.com] has joined #ruby-lang
twittard_ [twittard_!~twittard@wc.lax.truecarcorp.com] has joined #ruby-lang
scampbell [scampbell!~scampbell@mail.scampbell.net] has joined #ruby-lang
benanne [benanne!~rijdier@ip-213-49-105-218.dsl.scarlet.be] has joined #ruby-lang
robbrit [robbrit!~rob@38.108.76.250] has quit [#ruby-lang]
Heimidal_ [Heimidal_!~heimidal@factory-smtp.factorylabs.com] has joined #ruby-lang
lordofthedance [lordofthedance!~daddycool@wnpgmb0911w-ad03-102-94.dynamic.mtsallstream.net] has joined #ruby-lang
workmad3 [workmad3!~workmad3@cpc1-bagu10-2-0-cust81.1-3.cable.virginmedia.com] has joined #ruby-lang
malev_ [malev_!~malev@190.210.138.237] has joined #ruby-lang
s0ber_ [s0ber_!~s0ber@114-36-241-131.dynamic.hinet.net] has joined #ruby-lang
enebo [enebo!~enebo@75-168-50-253.mpls.qwest.net] has joined #ruby-lang
y3llow [y3llow!~y3llow@114-36-241-131.dynamic.hinet.net] has joined #ruby-lang
codewrangler [codewrangler!~codewrang@pool-72-66-12-100.washdc.fios.verizon.net] has joined #ruby-lang
y3llow [y3llow!~y3llow@114-36-241-131.dynamic.hinet.net] has joined #ruby-lang
y3llow [y3llow!~y3llow@114-36-241-131.dynamic.hinet.net] has joined #ruby-lang
toertore [toertore!~toretore@li22-80.members.linode.com] has joined #ruby-lang
y3llow [y3llow!~y3llow@114-36-241-131.dynamic.hinet.net] has joined #ruby-lang
TvL2386 [TvL2386!~tom@ip5452a95e.adsl-surfen.hetnet.nl] has joined #ruby-lang
y3llow [y3llow!~y3llow@114-36-241-131.dynamic.hinet.net] has joined #ruby-lang
perryh__ [perryh__!~root@mobile-109-233.near.uiuc.edu] has joined #ruby-lang
perryh__ [perryh__!~root@unaffiliated/perry753] has joined #ruby-lang
y3llow [y3llow!~y3llow@114-36-241-131.dynamic.hinet.net] has joined #ruby-lang
Paoc__ [Paoc__!~paoc@pc-192-161-164-190.cm.vtr.net] has joined #ruby-lang
y3llow [y3llow!~y3llow@114-36-241-131.dynamic.hinet.net] has joined #ruby-lang
y3llow [y3llow!~y3llow@114-36-241-131.dynamic.hinet.net] has joined #ruby-lang
Paoc__ [Paoc__!~paoc@pc-192-161-164-190.cm.vtr.net] has joined #ruby-lang
Paoc_ [Paoc_!~paoc@pc-192-161-164-190.cm.vtr.net] has quit [#ruby-lang]
srbartlett [srbartlett!~srbartlet@202.146.7.239] has joined #ruby-lang
y3llow [y3llow!~y3llow@114-36-241-131.dynamic.hinet.net] has joined #ruby-lang
workmad3 [workmad3!~workmad3@cpc1-bagu10-2-0-cust81.1-3.cable.virginmedia.com] has joined #ruby-lang
Paoc__ [Paoc__!~paoc@pc-192-161-164-190.cm.vtr.net] has joined #ruby-lang
Ashkin [Ashkin!601aee4d@gateway/web/freenode/ip.96.26.238.77] has joined #ruby-lang
<ylluminate>
i've managed to override Kernel::load for a rails app in the config/environment.rb so that it will print out the filenames of each load it does. it seems, however, once i get into the helpers, controllers, views that Kernel::load is not being used as nothing is being printed out on the console for those. Any ideas of what may be going on here in ruby to load those other aspects of a rails app?
<erikh>
maybe it uses require
michael_mbp_ [michael_mbp_!~Marin@149.147.66.245] has joined #ruby-lang
mssola [mssola!~mssola@31.Red-83-63-162.staticIP.rima-tde.net] has joined #ruby-lang
<ylluminate>
erikh: good idea. i'll give that a shot
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby-lang
tenderlove [tenderlove!~tenderlov@pdpc/supporter/active/tenderlove] has joined #ruby-lang
daglees [daglees!~belvedere@178.238.189.164] has joined #ruby-lang
daglees [daglees!~belvedere@unaffiliated/daglees] has joined #ruby-lang
echoprinter [echoprinter!~j3@unaffiliated/echoprinter] has joined #ruby-lang
Ashkin [Ashkin!~go@96.26.238.77] has joined #ruby-lang
<Ashkin>
.
<Ashkin>
finally, i can bloody talk
<injekt>
oO
<injekt>
hey erikh
<erikh>
injekt: hi
<injekt>
erikh: not sure if you got my message, but that code looks great
<erikh>
raggi gave me a laundry list of improvements to make
<injekt>
I have a couple, not quite as many as that it seems
<erikh>
can you email them to me?
<injekt>
yup, give me some time but I'll get that to you later
<erikh>
no rush
<erikh>
thanks for looking at it!
Heimidal [Heimidal!~heimidal@factory-smtp.factorylabs.com] has joined #ruby-lang
<injekt>
anytime
<Ashkin>
fairly new to ruby. anyway: i'm trying to make a template class which i can use to create several similar classes, each containing different values, an altered routine or two, etc, so i don't need to duplicate code every time. i've googled inheritance and extend/inclue in ruby, but i haven't found a way to do this. am i missing something simple?
<drbrain>
class GenericName; …; end
<drbrain>
class SpecificName < GenericName; …; end
<workmad3>
Ashkin: tbh, that sounds like a design smell to me
<drbrain>
never name your class Base unless you're making a baseball or calvinball simulation
<Ashkin>
that doesn't seem to allow me to call the routines in the base class from the specific one
<erikh>
calvin ball
<erikh>
haha
<workmad3>
Ashkin: inheritance does let you call base-class methods from the derived-class
<ylluminate>
what's the proper way to monkey-patch IO:read?
rpowell [rpowell!~rpowell@CPE-60-229-153-8.lns9.ken.bigpond.net.au] has joined #ruby-lang
<ylluminate>
sorry, :: but yeah, was hoping to find an example
fragmachine [fragmachine!~fragmachi@101.169.141.4] has joined #ruby-lang
<drbrain>
ylluminate: don't?
looopy [looopy!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
<ylluminate>
lol
<drbrain>
ylluminate: why do you think you need to do that?
<ylluminate>
i'm working on forcing rails to print files out that it accesses in order on requests
<ylluminate>
seems that the cleanest method for doing this is to add a print to the methods by overriding them in the environment.rb
<drbrain>
like from app/views or ?
<ylluminate>
worked very well so far for kernel::load and require
<ylluminate>
right
<ylluminate>
i want to get the full stack of files that are accessed in order when a request is made
<drbrain>
you can alias the old read aside then redefine read
<ylluminate>
right
<ylluminate>
doing that so far
<drbrain>
however, I think files are only loaded from disk once in production mode
<drbrain>
and probably only when they've changed in development mode
<ylluminate>
drbrain: this is working so far and i'd like to do likewise for File::read and IO::read to see if those are being used: http://pastebin.com/aqMSPFRe
<drbrain>
ylluminate: this won't capture use of open, though
<ylluminate>
and this is working amazingly well for me, but not giving me a complete picture
<ylluminate>
okay, right. so i'm trying to catch them all or do that as well
<ylluminate>
effectively i'd like to get each that could be possibly used within rails to access the app files
<ylluminate>
would open, for example, be base enough that it would be called as well from the reads?
Sailias [Sailias!~jonathan@CPE0018f85e576d-CM001bd7aaaf96.cpe.net.cable.rogers.com] has joined #ruby-lang
<drbrain>
nope
<ylluminate>
the lower i can go vs redoing a bunch of them, the better
<zenspider>
bglusman: just catching up... why just a tokenizer?
<ylluminate>
alright, so it seems that instead of module Kernel as above, i have to use class File and class IO for the reads there
Confiscative [Confiscative!~con@vps1031.directvps.nl] has joined #ruby-lang
<ylluminate>
but i can't follow the exact same template as the others so i was hoping that someone could clarify how to do it similarly for those and as you say, open as well
<manveru>
ylluminate: uhm
<manveru>
you ever heard of set_trace_func ?
<Confiscative>
Hi. When writing Ruby C extensions, when defining a module 'mFoo = rb_define_module("Foo")', then defining a class 'cBar = rb_define_class_under(mFoo, "Bar", rb_cObject)', then a method 'rb_define_method(cFoo, "hello", hello_func, 0)', should I be able to call Foo::Bar.new.hello?
<injekt>
Confiscative: did you try it?
valeri_uF0 [valeri_uF0!~valeri_uf@deadlink.in] has joined #ruby-lang
<Confiscative>
injekt: Of course. I assumed it to be implicit that it didn't.
<zenspider>
why?
<zenspider>
oh.... because you defined the method in Foo?
<Confiscative>
No, sorry. I expect it to work. But it doesn't. Forget about implicitness :)
<zenspider>
why do you think it should work?
<drbrain>
Confiscative: it should work, how doesn't it work?
<zenspider>
module Foo; def hello; end; class Bar; end; end; Foo::Bar.new.hello -- doesn't make sense to me
<Confiscative>
Sorry, I meant to say: rb_define_method(cBar, "hello", hello_func, 0)
Telmo [Telmo!~telmo@c-68-44-135-81.hsd1.pa.comcast.net] has joined #ruby-lang
<ylluminate>
manveru: no i've not. interesting
<zenspider>
Confiscative: 1) just paste the fucking code instead of leading us through proof reading your typos
<Confiscative>
So module Foo; class Bar; def hello; end; end; end; Foo::Bar.new.hello
<zenspider>
2) why are you doing this in C at all?
<bglusman>
zenspider: sorry, I'm using Ripper's tokenizer in outlaw in a way that could possibly make you cry :-) but basically to have individual tokens to pass to lexer in some cases and handle special cases in other places
<zenspider>
bglusman: haha
<zenspider>
I don't think I've seen outlaw yet
<zenspider>
unfortunately, ruby_parser is a full parser, not just a lexer
companybot [companybot!martins@login1.powertech.no] has joined #ruby-lang
<zenspider>
you can't really lex ruby w/o also parsing
<zenspider>
unfortunately
<bglusman>
nod, the lexer form ripper is actually working fine i think, or maybe i'm confusing myself
<zenspider>
the rubylexer project attempts to... but it is a fucking horrendous mess and I doubt it is all that correct
<ylluminate>
manveru: do you know of or can you shoot me an example of using that in this context?
<bglusman>
but one of them is selectively and seemingly randomly not generating newline tokens
<bglusman>
trying to allow whitespace sensitive and vertical_whitespace sensitive rules
<manveru>
set_trace_func(lambda{|*a| p a })
<optikalmouse>
I mean, if I inspect a method can I get the documentation about it?
<manveru>
ylluminate: something like that
<bglusman>
zenspider: not sure if I know what you mean, i know it has ignored_nl tokens and nl tokens
<zenspider>
Confiscative: that seems fine to me... still not sure why you're writing C
<manveru>
from there you're a regex away from what you need
<bglusman>
and thats fine, but i want to see them :-)
<bglusman>
or maybe you can help me rethink the current approach if you're interested in the project :-)
<Confiscative>
zenspider: This is obviously a very first step in the domain of C extensions for performance
<zenspider>
bglusman: my expertise is in the 1.8 parser, so there could be changes I'm not familiar with... but in 1.8 newline nodes are only generated "once in a while"... it isn't terribly consistent... just at the beginning of things that are statement like
<injekt>
Confiscative: paste ALL of the code
<bglusman>
I can push up what i have now, I think if ripper were passing more consistently it'd probably work now, but it'd probably seem very hacky to you
<zenspider>
Confiscative: I have doubts
<bglusman>
hmm
<zenspider>
bglusman: yes, ripper is hacky to me :)
<zenspider>
but... so is ruby_parser and ruby's parse.y... to be fair
<zenspider>
the grammar is a fucking mess
<injekt>
^
<WillMarshall>
Hey guys! Doing some clever trickery, trying to work out how I can set up a Module so that any Class that included said module will run a little include that looks something like "include "Pipes::#{self.class_name}Pipe".constantize"
<zenspider>
but if you only want a tokenizer, unfortunately ruby_parser is prolly not what you want
<injekt>
WillMarshall: what?
<bglusman>
yeah, didnt look right
<zenspider>
it's spelled "clevar"
<WillMarshall>
Basically, I want the module to automatically include another module by naming convention, but the naming convention is pulled from the Class the module is included in, not the Module itself
<injekt>
WillMarshall: sounds like a job for the included hook
<WillMarshall>
Some sort of after_include hook?
<zenspider>
WillMarshall: have you looked at the included hook?
<zenspider>
hee
<WillMarshall>
Thanks guys!
* injekt
wins
<bglusman>
I need to head out in a minute, but i just pushed up failing test and proposed solution to github, if you or anyone else wants to take a look or offer suggestions
<bglusman>
i'd lvoe to have some othr more experienced heads involved :-)
<zenspider>
unfortunately I'm backlogged for the week... send me a url tho ryand-ruby@zenspider.com
leafac [leafac!~leafac@187.64.232.134] has joined #ruby-lang
<optikalmouse>
zenspider: so if I want to look up docs for core classes, I would use....what? (please don't say web browser please don't say web browser...)
<Confiscative>
If I make a module method, that works, so the building process seems alright.
<zenspider>
bglusman: hahaha... I think I'm in love
<zenspider>
optikalmouse: ri String or ri String.split
<zenspider>
etc
<Confiscative>
I'm getting a "NameError: uninitialized constant Ceaming::Foo"
<zenspider>
optikalmouse: make sure you install the rdoc gem to have the latest version
<WillMarshall>
injekt: A followup question. self.included(base), base is referring to the parent class rather than the class I want to modify directly
<WillMarshall>
Is there a way around this?
<optikalmouse>
zenspider: you sure? it's only showing me methods and stuff added on by other gems and not core docs :S
darkf_ [darkf_!~darkf_dix@unaffiliated/darkf] has joined #ruby-lang
<WillMarshall>
I'm trying to do some introspection and writes of dynamic methods via inheritance from a specific class, but it's tricky
<injekt>
WillMarshall: class you want to modify directly? I'm nto sure I follow, can you paste a use case?
<injekt>
Confiscative: at first glace I can't see anything wrong with that code
<zenspider>
bglusman: the idea at least. I haven't read the code yet
<bglusman>
heh, that'll break your heart :-)
<WillMarshall>
injekt: The problem is, "base" in my self.included method near the bottom has a reference to Product, not HealthProduct
<zenspider>
haha
<bglusman>
but appreciate the interest either way :-)
<bglusman>
and that's somewhere you can help :-)
<WillMarshall>
injekt: So I'm wondering whether there's a cleaner way to set up automatic includes like this?
<Confiscative>
zenspider: That looks very shiny.
<fragmachine>
How can I confirm a string contains digits?
<fragmachine>
I tried a bunch of these sorts of things - "12.4324.23.543.4:32".include?(/0-9/)
<bglusman>
I'll give you commit priveleges now if you want :-)
<zenspider>
fragmachine: have you bothered to look at ANY reference before asking here?
<fragmachine>
yes
<fragmachine>
I'm noob
<fragmachine>
I tried
<fragmachine>
map
<fragmachine>
select
<zenspider>
ri String
<bglusman>
i gotta run, thanks ryan!
<zenspider>
bglusman: my pleasure
<injekt>
WillMarshall: ahh, you can't do that
<WillMarshall>
injekt: Can you think of a tidier way to achieve this sort of thing?
<zenspider>
WillMarshall: you write code like yoda speaks
<WillMarshall>
zenspider: It makes a lot more sense in context
<zenspider>
it's backwards! :P
<injekt>
^
<injekt>
Pipes::Pipe should be first, then Product, then HealthProduct
<zenspider>
basically, you want an included not on Pipe, but on Product
<injekt>
but nonetheless
<injekt>
WillMarshall: there's self.inherited you could use on Product
scampbell [scampbell!~scampbell@mail.scampbell.net] has joined #ruby-lang
slyphon [slyphon!~weechat@unaffiliated/slyphon] has joined #ruby-lang
<WillMarshall>
The reason why the include is pushed to Pipes::Pipe is that I'll have another family of generated stuff living in Foo::Bar as well
<zenspider>
so you could define AutoPipe that defines an inherited INSTANCE method, and then _extend_ the Product class with that, so it has an inherited CLASS method
<WillMarshall>
So all that is automatically pulled in from the Product superclass, and I'm trying to make sure each module takes care of its own
<Confiscative>
zenspider: I don't see any converting of Ruby VALUE's with your inline gem. How is shared memory handled between C and Ruby?
<zenspider>
but I wouldn't bother with such clever for now... I'd throw in the included as-is in Product and refactor later after the proof of concept shows it is worth it
<zenspider>
Confiscative: my code is fucking magic
<Confiscative>
zenspider: A, I see the map in Inline::C now.
<injekt>
said like a true rubyist
<optikalmouse>
zenspider: which platform are you on?
<zenspider>
optikalmouse: osx
stepnem [stepnem!~stepnem@176.119.broadband10.iol.cz] has joined #ruby-lang
<optikalmouse>
zenspider: ok, now I know why ri String doesn't gimme core docs, I'm using Ubuntu and probably to generate the rdocs and point ri to them myself? ;p
<zenspider>
optikalmouse: what ruby version are you using?
alexeyKolosov [alexeyKolosov!~quassel@mail.zbku.ru] has joined #ruby-lang
<andrewvos>
OH: "my code is fucking magic"
<zenspider>
ubuntu has fucked up so much stuff with ruby it isn't funny. you may want to seriously consider rolling back any and all ruby packages and starting over with rvm
<optikalmouse>
zenspider: 1.9.3
<zenspider>
that _should_ have rdoc data just fine