Topic for #ruby is now Ruby programming language || ruby-lang.org || RUBY SUMMER OF CODE! rubysoc.org/ || Paste >3 lines of text in http://pastie.org || Para a nossa audiencia em portugues http://ruby-br.org/
adamkittelson has joined #ruby
conor_ireland has joined #ruby
vescestvo has quit [#ruby]
<virunga> i used a gems once time for translate rational numbers in fractions that is faster than the same in c
bbrandon has joined #ruby
<virunga> just ot say
<pcz> I just read, that most RSS-Readers demask the masked HTML special chars found in the feed, is that correct?
<dagnachewa> anyone here use rubyee ?
<virunga> bye bye
otakutomo has joined #ruby
<ryanf> pcz: that sounds likely, since otherwise the html might make the xml document invalid
<ryanf> so it makes sense that you'd escape it inside the item body
<pcz> ryanf: okay, thanks
dross has joined #ruby
krnlsndrs has joined #ruby
dmn001_ has joined #ruby
xsdg has joined #ruby
epochwolf|vps has joined #ruby
sixteneighty has joined #ruby
eko has joined #ruby
statonjr has joined #ruby
philips has joined #ruby
chimkan_ has joined #ruby
nricciar__ has joined #ruby
i8degrees has joined #ruby
tayy has joined #ruby
odinswand has joined #ruby
ontehfritz has joined #ruby
luckyruby has joined #ruby
samsonjs has joined #ruby
Ownatik has joined #ruby
colossal7 has joined #ruby
marknyc has joined #ruby
Karmaon has joined #ruby
colossal7_ has joined #ruby
adeponte has joined #ruby
pu22l3r has joined #ruby
IceD^ has joined #ruby
astrostl has joined #ruby
matthias3 has joined #ruby
<astrostl> if i want to make a ruby script which, for example, prints all passed arguments to the cli can i do that in a simpler way than iterating over the ARGV array?
<astrostl> looking for something like ARGV[*]
<IceD^> I have class Foo; def foo; end; end and local var x. I want that 'x' be available inside of inst methods of Foo. what's best way?
<astrostl> looks like .to_s did the trick
robbyoconnor has joined #ruby
<burgestrand> astrostl: depends on how you want it printed
ryanf has joined #ruby
<yoklov> until and while loops evaluate to nil?
<yoklov> strainge.
<yoklov> strange*
<yoklov> also strange that they can have a do-end block but not a {} block
Nathandim has joined #ruby
mxweas_ has joined #ruby
Karmaon has joined #ruby
odinswand has joined #ruby
drizz_ has joined #ruby
relix has joined #ruby
rdesfo has joined #ruby
kaichanvong has joined #ruby
robbyoconnor has joined #ruby
looopy has joined #ruby
akem has joined #ruby
akem has joined #ruby
CannedCorn has joined #ruby
josefig has joined #ruby
MasterIdler_ has joined #ruby
snip_it has joined #ruby
chimkan has joined #ruby
MasterIdler_ has joined #ruby
Brandonn has joined #ruby
julien- has joined #ruby
Nathandim has joined #ruby
<julien-> Hi. I'm developing a gem which override a part of the resque gem. I've got a problem of loading order, my code (which contains an alias_method) is loaded before the dependencies. Is there a way I can prevent that?
sythe_ has joined #ruby
azureye has joined #ruby
Ownatik has joined #ruby
jergason has joined #ruby
CannedCorn has joined #ruby
<hkhalid> bu
<tayy> anyone's used Shoes.app on Mac Lion?
<ryanf> julien-: can't you just require resque in your code to ensure that it's loaded?
fixl has joined #ruby
<julien-> ryanf: tried it but when I puts $: in my spec, I can see that my files are loaded before resque
<julien-> ryanf: here's the output https://gist.github.com/1805565
randym has joined #ruby
mztriz has joined #ruby
<ryanf> what do you mean? the order of $: doesn't have anything to do with the chronological order that code is loaded in
<ryanf> any more than the order of the directories in $PATH controls when programs run
<ryanf> unless you're saying that your file is, like, lib/resque.rb
bbrandon has joined #ruby
<julien-> yeah my file is lib/resque/job.rb
peroyvind has quit [#ruby]
dtaprl has joined #ruby
rdesfo has quit [#ruby]
jcromartie_ has joined #ruby
jcromartie has joined #ruby
<hkhalid> whitenet houston died
pu22l3r has joined #ruby
nyrb has joined #ruby
<mztriz> wtf wasnt' she like 40 something
<hkhalid> she was a cokehead...
berserkr has joined #ruby
<shevy> hmm
<shevy> she was 48
<shevy> stay away from drugs, kids
frishi has joined #ruby
<Axsuul> that sucks =( best star spangled banner ever http://www.youtube.com/watch?v=wupsPg5H6aE
jwmann has joined #ruby
<hkhalid> anyone here in dubai
<hkhalid> or UAE?
josefig1 has joined #ruby
Asebolka has joined #ruby
milkpost has joined #ruby
jwmann has joined #ruby
igotnolegs has joined #ruby
CannedCorn has joined #ruby
<ryannielson> Are there any equivalents to Python's Image Library for Ruby?
stringoO has joined #ruby
al3xnull has joined #ruby
Indian has joined #ruby
<yoklov> without knowing much about the Python Image Library, RMagick?
Sailias has joined #ruby
rdesfo has joined #ruby
thecreators has joined #ruby
dhodgkin has joined #ruby
<ryannielson> yoklov: I'll have a look at RMagick
mpabst has joined #ruby
csprite has joined #ruby
affix has joined #ruby
<dagnachewa> Time.now - 10 does not work am following Begigng ruby
tayy has joined #ruby
<davidcelis> yes it does
<davidcelis> Time.now irb(main):001:0> Time.now - 10 #=> 2012-02-11 18:24:39 -0800
<davidcelis> owned
<dagnachewa> sorry never mind it worked
pu22l3r has joined #ruby
phux has joined #ruby
mpabst has joined #ruby
<dagnachewa> what is Fixnum class ?
tmiller has joined #ruby
<dagnachewa> this does not work Time.local(year,month,day,hour,min,sec,msec)
<dagnachewa> NameError: undefined local variable or method `year' for main:Object
<dagnachewa> from (pry):24:in `<main>'
denom has joined #ruby
nerdy has joined #ruby
<dagnachewa> plz help
<dagnachewa> this does not work Time.local(year,month,day,hour,min,sec,msec)
<dagnachewa> undefined symbol year ?
<ryannielson> Because those need to be variables
<ryannielson> And you aren't declaring them anywhere?
<dagnachewa> nope
JonnieCache has joined #ruby
<ryannielson> Well if that's all you types in then there's no way it'll work.
<ryannielson> You need to set year, month, day, etc equal to something.
<dagnachewa> ryannielson, I am following Begining Ruby and I tought they were built in
<ryannielson> They're arguments to a function, you have to pass them along.
sdwrage has joined #ruby
<dagnachewa> ryannielson, here is the line in the book http://pastie.org/3364588
<ryannielson> Yes, he's just showing you what the function prototype looks like. You can't directly type that in.
<ryannielson> You need to replace year, month, day, etc with values.
<dagnachewa> I understand
yakko has joined #ruby
<ryannielson> Some examples there.
luke-- has joined #ruby
<rdesfo> when I run this https://gist.github.com/1805886 it returns the html but in poignant guide it shows it returning just text
<rdesfo> what am I doing wrong?
<luke--> can anyone tell me what's wrong with this simple if-construct? https://gist.github.com/43cd785996bf88e0ed8a I know I'm totally a noob. it triggers a syntax-error , unexpected tIDENTIFIER, expecting keyword_end
<ryannielson> Because year isn't a variable
<ryannielson> Oops didn't mean to type that haha
<luke--> line 4 and 6
<dagnachewa> ryannielson, am starting slowly ruby ... since I have decided to use this tool to build my future app ( rails sports betting app) and by the time I become proficient I hope ruby gets more faster :)
p0y has joined #ruby
<ryannielson> dagnachewa: Ya, Ruby's pretty nice.
alphabitcity has joined #ruby
<alphabitcity> is there a way to get all of the attr_accessor'd symbols for a class?
<ryannielson> luke--: I'm assuming it's becuase you're not separating your arguments to render. Put a , after :file and :text maybe
<luke--> i just saw it
<luke--> ryannielson: you were right
<luke--> there should be has-rockets
<luke--> thanks
<ryannielson> No problemo
jordanstephens has joined #ruby
<i8igmac> im trying to do some math... but i dont remember how to convert this string with pack/unpack "2a, 2b, 2c"
treyh0 has joined #ruby
gokul has joined #ruby
jacktrick has joined #ruby
<i8igmac> 2a, 2b, 2c
<i8igmac> im not sure if its hex or binary
<i8igmac> but those will convert... or something
<ryannielson> What exactly are you trying to accomplish
kmurph79 has joined #ruby
<dagnachewa> Bignum has changed ?
<dagnachewa> p 1073741823.class
<dagnachewa> Fixnum
<i8igmac> 2a is a number correct? like ["01"].unpack=>1
<dagnachewa> p 1073741824.class Fixnum
<dagnachewa> guys what the hell is going on
<dagnachewa> can;t follow a slightly older ruby book because ruby gets many changes everytime ?
<ryannielson> i8igmac: Isn't unpack a string method? I didn't know there was an unpack on array
<i8igmac> true,
<i8igmac> i cant explain this...
<ryannielson> dagnachewa: Depends on the version of ruby your book uses, and the version you're currently using.
<i8igmac> 01, 02, 03,04,05,06,07,08,09,a1,a2,a3,a4,a5
<dagnachewa> ryannielson, thanks
<ryannielson> i8igmac:Okay, so I'm assuming you have that as a string. What exactly are you trying to do with it?
<ryannielson> dagnachewa: Sure thing
<i8igmac> convert 2d into a number so i can do some math with it
<ryannielson> i8imac: So I'm assuming they're hex numbers?
<i8igmac> yes
sdwrage has joined #ruby
<ryannielson> something like "2d".to_i(16) should convert 2d to a number using base 16, which is hex
<dagnachewa> ryannielson, look at this exemple http://pastie.org/3364699
<i8igmac> thats it !
<dagnachewa> ryannielson, in the book it says "nNote Remember that as you
<dagnachewa> the same line, whereas puts starts a new line every time it
<i8igmac> thank you ,-)
<ryannielson> i8imac: WOO
<ryannielson> i8igmac: You're welcome. Good luck doing whatever the hell you're trying to do haha
<dagnachewa> ryannielson, can you sort it out for me please ?
<i8igmac> ,-)
<i8igmac> fun stuff i think
<ryannielson> :D
<i8igmac> creating a client for a online game warcraft3
<ryannielson> i8igmac: Oh, that's sounds awesome. I'd like to see the outcome of that.
<i8igmac> its working right now
<dagnachewa> ryannielson,
<ryannielson> dagnachewa: Ya, I'm looking at it now. One second
<dagnachewa> thanks
<ryannielson> dagnachewa: What's the problem, it looks fine.
<dagnachewa> ryannielson, on my machine it
<dagnachewa> ryannielson, on my machine it's printed on multiple lines
<ryannielson> No it's not, that's just irb output
<ryannielson> The ABCD stuff is what's being printed.
<ryannielson> the =>["A", ... stuff is what's being returned.
<dagnachewa> ryannielson, instead of ["A","B",C" ..."Z"] it's ["A", then second line "B" so on
<dagnachewa> ryannielson, oic sorry to have disturb you thanks
<ryannielson> dagnachewa: Like I said, the stuff being printed on multiple lines is the array being returned. the stuff before => is what's being printed in the each.
<ryannielson> dagnachewa: haha, no worries
eykosioux has joined #ruby
radic_ has joined #ruby
zakwilson has joined #ruby
<i8igmac> ryannielson, so... "2d".to_i(16) => 45... how would you turn 58 into=> "3a"
_obiJuan has joined #ruby
<ryannielson> Basically the reverse I believe.
<ryannielson> to 58.to_s(16)
<i8igmac> that simple
<ryannielson> Yep, just tested it and it works.
<ryannielson> Yep, that simple haha
<i8igmac> to s
Blaskow3 has joined #ruby
Yugo has joined #ruby
mikeric has joined #ruby
seanstickle has joined #ruby
csprite has joined #ruby
phantomfakeBNC has joined #ruby
<Blaskow3> Does anyone here run Linux and use RubyMine? I'm asking because I notice RubyMine tries to help you install gems etc, however since I've installed RubyGem and Ruby into /usr/local, it needs root access to install gems (I could run the IDE as root, which isn't ideal, since you shouldn't need to run an IDE as root). Can anyone recommend a better configuration?
rdesfo has quit [#ruby]
<ryannielson> Blaskow3: I use Rubymine, but I don't really use any of it's helper stuff. I do it all in command line. Can't really see anyway to fix your problem if you need root to install gems.
<ryannielson> Might be worth setting it up so you don't need root for gems. Look into RVM or something.
CannedCorn has joined #ruby
<td123> Blaskow3: does it use gem install?
<td123> if you do something like export GEM_HOME=~/.rubygems && gem install foo, it will install foo to ~/.rubygems
<td123> I'm just shooting in the dark though, you're going to have to read how rubymine actually does it
csmrfx has joined #ruby
<Blaskow3> Hmm, I did end up installing the gems it mentions from the CLI, but it just felt a little disjointed to have to do that (not that I'm afraid of the command line, I just like things to be streamlined). I'm not sure if it uses gem install.. I have a feeling it used bundler (?).. though the environmental variable you mentioned might be a good lead. I'll look into RVM also.
<csmrfx> Hey ppl
<td123> Blaskow3: gl :)
<td123> Blaskow3: I'm sure they also have a forum, might be worth searching/asking there
affix has joined #ruby
<csmrfx> Is there a ruby dsl for xml? Doesn't have to be fancy, as long as it makes writing xml as little verbose as possible.
matthias3 has joined #ruby
<csmrfx> if there isn't one, I will write one
<Blaskow3> Yup, though the issue was more to do with Ruby/RubyGem requiring root priviliges to do their thang.. which I wasn't sure if it was normal or not
maletor has joined #ruby
<td123> Blaskow3: requiring root is obviously not something you want :P unless you want to do a global install of the gem, which I doubt you need
mikepack has joined #ruby
peindt has joined #ruby
<Blaskow3> So you could perhaps have a separate install of Ruby for development (say, in $HOME), and another OS Ruby install for any software on your machine that depends on Ruby?
<csmrfx> yes
<csmrfx> could even have diff ones for each shell environ
<Blaskow3> Oh, that's a good idea
<csmrfx> I suppose you were talking about RVM?
<Blaskow3> Actually I just heard about RVM a few minutes ago, need to read about it
<csmrfx> It kinda automates that, and installing
<Blaskow3> I see
mikepack_ has joined #ruby
<ryannielson> Blaskow3: Ya I recommend you take some time and learn RVM. It'll make your life much easier, especially if you're working on multiple projects.
<Blaskow3> Awesome, I'll definitely check it out (now, actually!)
<csmrfx> I never learned it, but do read the docs before installing or you might get bitten
mxweas_ has joined #ruby
<ryannielson> Blaskow3: Yes, read the docs carefully while installing and follow step by step. When it says don't use sudo, don't use sudo :p
<Blaskow3> alias sudo="echo 'NO, BAD!'"
pu22l3r has joined #ruby
<ryannielson> Blaskow3: Haha,
popsch has joined #ruby
gokul has joined #ruby
maletor has joined #ruby
banisterfiend has joined #ruby
moshee has joined #ruby
moshee has joined #ruby
tk_ has joined #ruby
mefis has joined #ruby
Ownatik has joined #ruby
whereswaldo2 has joined #ruby
josefig has joined #ruby
[eko] has joined #ruby
drizz has joined #ruby
doomviki1g has joined #ruby
mrmist_ has joined #ruby
Sailias has joined #ruby
lottadot has joined #ruby
pvh has joined #ruby
ezra has joined #ruby
er1c_ has joined #ruby
ePirat has joined #ruby
ePirat has joined #ruby
vereteran has joined #ruby
guns has joined #ruby
y3llow has joined #ruby
17SAALGMA has joined #ruby
sythe has joined #ruby
sythe has joined #ruby
Tearan has joined #ruby
samsonjs has joined #ruby
<Tearan> can anyone tell me what this error means?
p0y has joined #ruby
nd___ has joined #ruby
mikepack has joined #ruby
<Tearan> I'm using rvm, and I just installed 1.9.2. Now I'm getting errors installing gems
tk__ has joined #ruby
<Tearan> I tried updating --system, and it's erroring the same way
danslo has joined #ruby
philips has joined #ruby
r126l has joined #ruby
Amirh has joined #ruby
codefriar has joined #ruby
<Amirh> I have a problem: require "../Drills/stacklike" works but require "stacklike" doesn't work. what could be the problem?
<codefriar> what could cause my class to not respond to #define_method?
mefis has joined #ruby
audy has joined #ruby
p0y has joined #ruby
Ownatik has joined #ruby
gvt has joined #ruby
yekta has joined #ruby
Asebolka has joined #ruby
November has joined #ruby
SeanTAllen has joined #ruby
randym has joined #ruby
Mohan has joined #ruby
<Amirh> I have a problem: require "../Drills/stacklike" works but require "stacklike" doesn't work. what could be the problem?
<codefriar> Amirh: your loadpath is set wrong.
Azure|dc has joined #ruby
Seisatsu has joined #ruby
Azure|netbook|dc has joined #ruby
sayakb has joined #ruby
sayakb has joined #ruby
<Amirh> codefriar: these 2 are just 2 .rb files. stack.rb and stacklike.rb
ePirat has joined #ruby
<Amirh> in the same folde.r
<Amirh> foder*
<Amirh> folder* !!!
kmurph79 has joined #ruby
tmiller has joined #ruby
tmiller has quit [#ruby]
<codefriar> doesn't matter. if the folder containing stacklike and stack is not in the load path it will not be searched for stacklike
<codefriar> quit
<codefriar> er ww
apucacao has joined #ruby
<Amirh> codefriar: how can I make it work?
<codefriar> put that directory in your load path. use require_relative, use "../path/to/file.rb"
<codefriar> any of those will work
tanto has joined #ruby
KiwlJazz has joined #ruby
<tanto> using rmagick, i'm getting "unable to open X server", shouldn't that not be happening from command line?
<KiwlJazz> What is it you can do with this Ruby?
<tanto> nm i was doing it wrong :(
banisterfiend has joined #ruby
mikeric has joined #ruby
KiwlJazz has quit [#ruby]
alindeman has joined #ruby
Mekkis has joined #ruby
orospakr has joined #ruby
maletor has joined #ruby
mxweas_ has joined #ruby
csavola has joined #ruby
mike has joined #ruby
telling has joined #ruby
mrmist_ has joined #ruby
igotnolegs has joined #ruby
dross has joined #ruby
Jay_Levitt has joined #ruby
res_ has joined #ruby
laen_ has joined #ruby
Soliah has joined #ruby
at5l has joined #ruby
opin_ has joined #ruby
t-mart has joined #ruby
<t-mart> im trying to override some methods of Matrix::EigenvalueDecomposition, but first I want to see how the original works. Where can I find this file? It's somehow not inside matrix.rb (in ruby's lib/). I've grep-ed the whole directory and found no mention of "eigenvalue"
treyh0 has joined #ruby
<t-mart> im thinking it's already-compiled C (i.e. binary), or something
maahes has joined #ruby
Eko has joined #ruby
<maahes> okay, I'm trying to do a gem update --sys, I've got rvm, jruby installed via rvm, and 1.9.2 installed normally (mac), I'm getting two different errors trying to do the update in either ruby, both undefined modules: http://pastie.org/private/5rpzp8ujtacmaizeyf5awq
<treyh0> is there a recommended gem to help facilitate setting daemons and forking multiple processes? i'm not feeling the ruby daemons gem too much
<maahes> er, undefined methods
pu22l3r has joined #ruby
Tearan has joined #ruby
nyuszika7h has joined #ruby
<t-mart> treyh0, have you seen god?
czn has joined #ruby
<treyh0> yeah, ruby replacement for monit, pretty nice, i hope to use it, but still trying to "daemonize" my scripts currently
geef has joined #ruby
ryannielson has joined #ruby
<treyh0> think i'm going to give daemon-kit a closer look
lewix has joined #ruby
nyrb has joined #ruby
MasterIdler_ has joined #ruby
randym has joined #ruby
popsch has quit ["Leaving"]
KhimBerLyNsVzla_ has joined #ruby
<KhimBerLyNsVzla_> :/
KhimBerLyNsVzla_ has quit [#ruby]
jordanstephens has joined #ruby
odinswand has joined #ruby
fenix457 has joined #ruby
IAD has joined #ruby
geofridh has joined #ruby
<yoklov> oh wow. i had no idea something like ->((a,(b,d)),c){puts a,b,c,d}.call([1,[2,4]],3) was valid.
<yoklov> that is _awesome_
<banisterfiend> yoklov: this is my fave trick: head, *tail = array
<banisterfiend> since we're talking about destructuring ;)
kinderman has joined #ruby
<yoklov> yeah, i was aware of that one
chimkan_ has joined #ruby
<yoklov> oh hm does the destructuring work in method argument lists
robert_ has joined #ruby
robert_ has joined #ruby
<yoklov> it seems like it does.
wilmoore has joined #ruby
<yoklov> i had no idea. time to start using that all the goddamn time.
randym_ has joined #ruby
krisfremen has joined #ruby
cobragoat has joined #ruby
tomzx has joined #ruby
gen0cide_ has joined #ruby
i8degrees has joined #ruby
hydraulix has joined #ruby
fenix457 has joined #ruby
pdtpatr1ck has joined #ruby
azureye has joined #ruby
fenix457 has joined #ruby
thats_my_hat has joined #ruby
mikepack has joined #ruby
dkr_ has joined #ruby
aces23up has joined #ruby
beilabs_ has joined #ruby
linopolus has joined #ruby
cobragoat has joined #ruby
fenix457 has joined #ruby
Jck_true has joined #ruby
kreantos has joined #ruby
conntrack has joined #ruby
savage- has joined #ruby
otakutomo has joined #ruby
conntrack has joined #ruby
flip_digits has joined #ruby
<yoklov> oh wow, i didn't realize that destructuring was so much like car/cdr
rippa has joined #ruby
thats_my_hat has joined #ruby
araujo has joined #ruby
araujo has joined #ruby
akem has joined #ruby
akem has joined #ruby
amerine_ has joined #ruby
snip_it has joined #ruby
nari has joined #ruby
jgrevich has joined #ruby
IAD1 has joined #ruby
fielding has joined #ruby
nowthatsamatt has joined #ruby
fielding has joined #ruby
jaywastaken has joined #ruby
nowthatsamatt has quit [#ruby]
amerine has joined #ruby
<Blaskow3> Well, RVM rocks
<thomasfedb> Blaskow3, this is true
* hkhalid slaps Blaskow3 around a bit with a large trout
ryanf has joined #ruby
* thomasfedb chases hkhalid around a bit with a large pitchfork
n3m has joined #ruby
<Blaskow3> Slap me harder! I ilke it
* Blaskow3 winks
CannedCorn has joined #ruby
trend has joined #ruby
maletor has joined #ruby
fallen has joined #ruby
TomJ has joined #ruby
moshee has joined #ruby
moshee has joined #ruby
otakutom_ has joined #ruby
thone has joined #ruby
Jarred has joined #ruby
<Jarred> How do I get the development tools for Ruby installed on Arch Linux?
<Jarred> I've already installed base-devel
mxweas_ has joined #ruby
gianlucadv has joined #ruby
jcromartie_ has joined #ruby
odinswand has joined #ruby
eldariof has joined #ruby
JStoker has joined #ruby
prtksxna has joined #ruby
<td123> Jarred: what do you need?
<td123> can you be more specific which development tools you're speaking of?
<td123> I consider vim a development tool for ruby also :)
<Jarred> Well, that's the thing. It's just the compiler I'm pretty sure
<Jarred> It's inspecific
<Jarred> I'm trying to install eventmachine
<Jarred> It complains about a lack of development tools
<Jarred> I looked at the makefile log
mikepack has joined #ruby
<Jarred> It said it couldn't find any compiler
<td123> Jarred: install ruby from archlinux and run sudo gem install eventmachine
<Jarred> I did that as root
<Jarred> and it had the same error
<td123> did you install base-devel?
kreantos has joined #ruby
otakutomo has joined #ruby
Liothen_ has joined #ruby
sdwrage has joined #ruby
<td123> nvm, I see you did..
<td123> Jarred: check what's getting run right before that message is called (exact command) and you will be better prepared to fix it :)
<td123> i g2g sleep
JohnBat26 has joined #ruby
fixl has joined #ruby
snearch has joined #ruby
gokul has joined #ruby
Guest343 has joined #ruby
bier_ has joined #ruby
daglees has joined #ruby
yxhuvud has joined #ruby
justinmcp has joined #ruby
mxweas_ has joined #ruby
nemesit has joined #ruby
plato has joined #ruby
plato has joined #ruby
savage- has joined #ruby
Sliker has joined #ruby
mikepack has joined #ruby
kawa_xxx has joined #ruby
kreantos_ has joined #ruby
azureye has joined #ruby
mikepack has joined #ruby
chaitanya has joined #ruby
mikepack_ has joined #ruby
stdcall has joined #ruby
visof has joined #ruby
nd_____ has joined #ruby
odinswand has joined #ruby
td123 has joined #ruby
csherin has joined #ruby
fielding has joined #ruby
ePirat has joined #ruby
robert_ has joined #ruby
robert_ has joined #ruby
<Guest343> i have a string, which looks like a hash. How can i convert it to hash?
fielding has joined #ruby
phrame has joined #ruby
looopy has joined #ruby
nfxgosu has joined #ruby
duey has joined #ruby
fielding has joined #ruby
banseljaj has joined #ruby
_srp has joined #ruby
nfxgosu has joined #ruby
Y_Ichiro has joined #ruby
Y_Ichiro has joined #ruby
vivep has joined #ruby
nfxgosu has joined #ruby
nfxgosu has quit [#ruby]
p0y has joined #ruby
zxiest has joined #ruby
<zxiest> Hello :-)
zjhui has joined #ruby
<zxiest> Is there a way to check for syntax errors with ruby prior to running the code?
<thomasfedb> yes
<thomasfedb> run the code
<thomasfedb> or use a syntax checker such as the ones built into some editors
<zjhui> I'm new to ruby on rails. When I use the command: rails console, it comes the problem: "no such file to load -- readline (LoadError)".
<zjhui> So I searched google, and followed this http://rails3blog.com/2010/09/error-no-such-file-to-load-readline-loaderror/, but it didn't work for me.
<zjhui> My OS is Ubuntu 11.10 with Ruby 1.9.2p290 and Rails 3.2.1
<zjhui> I have install the readline with the command: rvm --skip-autoreconf pkg install readline.
<zxiest> thomasfedb I love Ruby and I've been using it for almost a year now
<zjhui> can anyone help me ?
<thomasfedb> zxiest, good.
raingrove has joined #ruby
raingrove has joined #ruby
<zxiest> thomasfedb I miss certain things from my prior development languages when I'm working with big projects
<zxiest> thomasfedb sometimes compile time type checking saves me a lotta time
<zxiest> but then again, when I code with something other than Ruby, I miss Ruby's dynamicity
<thomasfedb> zxiest, sure. you should invest in a test suite
<thomasfedb> zxiest, there are trade-offs to be made
azureye has joined #ruby
<zxiest> thomasfedb I have been wanting to do Test Oriented Development but every time I start doing it, it looks very redundant
<thomasfedb> zxiest, sure, you write twice the code. i'd suggest that however you spend MUCH less time dealing with bugs
<thomasfedb> and it's a supprisingly fluid way to write once you get into it
<zxiest> thomasfedb okay... so I want to give testing oriented design a shot. What do you recommend?
<looopy> zjhui: i believe you have to uninstall ruby...install readline THEN install ruby.
<thomasfedb> zxiest, rspec
affix has joined #ruby
<thomasfedb> zxiest, and if you're doing rails then cucumber wont hurt either
<zxiest> thomasfedb cool! Thanks :-) Will take a look at both. I just need to start forcing myself to do this... Bugs have been KILLING me with ruby
<zxiest> I didn't really have this problem with compiled languages
SourJ has joined #ruby
<zxiest> Most of my bugs are stupid ones that can be caught by the compiler
stayarrr has joined #ruby
<thomasfedb> zxiest, then they'll be caught by good tests also
<zxiest> thomasfedb cool then! I'll start working on this good habit :-)
nyrb has joined #ruby
<banisterfiend> thomasfedb: hey friend, doy ou use rspec
karinsofia has joined #ruby
<thomasfedb> banisterfiend, yep.
<thomasfedb> banisterfiend, sure do
<banisterfiend> thomasfedb: what ruby version do you use
akem has joined #ruby
davidpk has joined #ruby
<thomasfedb> banisterfiend, 1.9.3-p0-falcon
<banisterfiend> thomasfedb: oh ok
<thomasfedb> banisterfiend, why?
<banisterfiend> thomasfedb: just i wrote a gem that might be very useful to people on pspec and ruby 1.9.2+
dzhulk has joined #ruby
jbw_ has joined #ruby
<thomasfedb> banisterfiend, do tell.
<banisterfiend> thomasfedb: https://github.com/banister/plymouth
Joost has joined #ruby
<banisterfiend> i would be interested if it runs ok on falcon as i hvaen't tested that b4
<thomasfedb> banisterfiend, falcon is basically just faster =P
<thomasfedb> banisterfiend, ooh. I know you love pry. I don't really. Cool idea though.
p0y has joined #ruby
<zjhui> looopy: you mean i should install readline before ruby?
<looopy> zjhui: yeah
<banisterfiend> thomasfedb: hehe how could oyu not love pry
<thomasfedb> banisterfiend, i feel at home when it says 'irb' on the left
<banisterfiend> thomasfedb: Pry.config.prompt = proc { "irb(main)> " } ;)
asteros has joined #ruby
<Joost> Hi guys!
<Boohbah> hi
i8degrees1 has joined #ruby
<Joost> I'm new to Ruby, and I'm running into a bit of a problem, perhaps you can have a look
<Joost> Im trying to extract png's from a binary file
<Joost> now I found a snippet online that does this for the _first_ png that occur
<Joost> occurs*
Favx has joined #ruby
<Joost> and I've been trying to edit it to loop through all PNG's (which shouldnt be so hard, I thought) but Im failing horribly
<Joost> http://pastebin.com/ssPr4dcG <-- original, http://pastebin.com/WiYnMdTw <-- my changed attempt
<Favx> Hi. Can someone recommend a good book for learning Ruby for someone with little programming experience?
emmanuelux has joined #ruby
i8degrees has joined #ruby
<Joost> uhh, http://pastebin.com/9Nsf6WpM <- my attempt (forgot an i = i+1 on the last one)
<zjhui> looopy: but it seems that i can install the readline as this blog says http://rails3blog.com/2010/09/error-no-such-file-to-load-readline-loaderror/
logbot52902 has joined #ruby
<zjhui> looopy: they seems have solved the problem, but i cannot...
<looopy> it looks like they're rebuilding ruby as well
<looopy> which in your case with rvm you aren't doing o_O;
MasterIdler_ has joined #ruby
sizz_ has joined #ruby
<zjhui> looopy: OK, now you men i should install the readline with the command: rvm --skip-autoreconf pkg install readline . And then reinstall the ruby?
<looopy> hmm i've never used --skip-autoreconf. unforunately my ubuntu days predate rvm. but I do remember that error and having to start from scratch
<banseljaj> zjhui: try installing all the software in "rvm requirements", and then just use "rvm reinstall 1.9.x"
<Guest343> i have an array [[a,b],[c,d]], i want to make hash {a => b, c => d}
<zjhui> banseljaj: now the problem is that i can't install the readline ...
<Joost> Anyone got any insights on my png problem? :O
<banseljaj> zjhui: which OS?
<zjhui> banseljaj: ubuntu 11.10
<Boohbah> hi, i am getting deck.rb:38:in `block (2 levels) in deal': undefined local variable or method `deck' for main:Object (NameError). How should i access the deck object from the deal method? http://pastie.org/3366039
_srp has joined #ruby
<banseljaj> zjhui: I am using the same. This is from my pc
shevy has joined #ruby
vivep has joined #ruby
_srp has joined #ruby
justinmcp has joined #ruby
odinswand has joined #ruby
Kambus has joined #ruby
AxonetBE has joined #ruby
<Boohbah> ok, i made deal a method in my Deck class, thanks!
i8degrees has joined #ruby
fielding has joined #ruby
Quadlex has joined #ruby
vraa has joined #ruby
HarimaKenji has joined #ruby
fielding has joined #ruby
i8degrees has joined #ruby
p0y_ has joined #ruby
jcromartie_ has joined #ruby
colossal7 has joined #ruby
i8degrees has joined #ruby
fielding has joined #ruby
senthil has joined #ruby
jbpros has joined #ruby
<senthil> calling return 2 methods deep just returns to the 1st method, how do I stop execution from 2nd method?
nari has joined #ruby
<thomasfedb> senthil, you cant.
<thomasfedb> senthil, unless you raise an excaption
mikeric has joined #ruby
<burgestrand> or throw
<burgestrand> senthil: look at throw/catch
<senthil> thomasfedb: ah damn
fayimora has joined #ruby
<senthil> i think if i use a block, then i can call return from second method and have it return everything
<senthil> burgestrand: never really did understand throw and catch
telling has joined #ruby
lorian has joined #ruby
<senthil> yep, if i wrap 1st method and return from 2nd method before yielding to 1st method, it returns everything
<banisterfiend> burgestrand: burgie have you seen 'kikis delivery service' ?
Morkel has joined #ruby
i8degrees has joined #ruby
fielding has joined #ruby
i8degrees1 has joined #ruby
<banisterfiend> senthil: throw/catch is the normal way to do it
snearch has joined #ruby
<banisterfiend> i use it a lot to break out to a certain stack level
<banisterfiend> def my_method1; catch(:baby_duck) { my_method2 }; end now any method called under my_method2 which throws :baby_duck will break out to the my_method1 method
<burgestrand> senthil: it’s like raise/rescue, but instead of throwing an error you just throw yourself to somewhere else
<banisterfiend> burgestrand: have you been to visby?
<burgestrand> banisterfiend: and no to delivery service and no to visby :)
<banisterfiend> burgestrand: ah too bad
<burgestrand> banisterfiend: why? :P
<banisterfiend> burgestrand: just that the town in studio ghibli film i discovered is based on visby, in fact i saw a photo of visby and it looks exactly the same, even the clock tower :)
<burgestrand> banisterfiend: hehe
<senthil> burgestrand: oh nice, think that's what I really wanted, thanks
<banisterfiend> burgestrand: i have a friend who is obsessed with that cartoon for about 3 years now, and when she learned she can actually visit the village, she was very excited :)
<banisterfiend> burgestrand: hey did u ever publish that blog post u were working on?
cableray has joined #ruby
<burgestrand> banisterfiend: yeah, it was the one about writing C extensions to handle asynchronous callbacks
<burgestrand> banisterfiend: haven’t written anything for about a year though
<banisterfiend> burgestrand: speaking of async, do uhave much experience with eventmachine?
<burgestrand> banisterfiend: a little bit but not extensively, wrote a web scraper/worker/queuer with it about a year ago
<banisterfiend> oh ok
<burgestrand> banisterfiend: why?
akem has joined #ruby
<banisterfiend> burgestrand: just getting into it :) particularly interested in Deferrables
<banisterfiend> burgestrand: sort of fun, i think
<burgestrand> banisterfiend: yeah, it is :d
<burgestrand> banisterfiend: the only thing that sucks with it (imo) is that exceptions just bork the whole shit out
Nathandim has joined #ruby
<burgestrand> instead of crashing the process
<banisterfiend> burgestrand: have you looked into the alternatives like cool.io?
<burgestrand> a little but but not very much
<burgestrand> but cool.io is what previously was called rev, isn’t it?
<senthil> burgestrand: doesn't error_handler catch them?
berserkr has joined #ruby
AxonetBE has joined #ruby
<burgestrand> senthil: where were you two years ago? :(
<burgestrand> or a year ago
<burgestrand> :
<burgestrand> :P
<senthil> two years ago i was learning rails
<senthil> a year ago i was unlearning rails
<senthil> :)
<burgestrand> ;)
Amirh has joined #ruby
<burgestrand> looks like something I should’ve used, in my defense the documentation was kind of hard to follow back then, still is
<burgestrand> wonder what the default way of handling errors is then…
ExtremeDevilz has joined #ruby
<ExtremeDevilz> Hello
<senthil> burgestrand: indeed, i found the lack of non-trivial examples infuriating
<ExtremeDevilz> is Ruby a good Programming languges for Beginners ?
phux has joined #ruby
<burgestrand> ExtremeDevilz: yes
<senthil> very!
<burgestrand> it’s fairly easy to get started and most of the time when you guess how something should be written it’s usually not that far from what it should be
<senthil> burgestrand: have you checked out the work ilya grigorik did with eventmachine?
<senthil> i've been meaning to sit down and take them apart one of these days
<burgestrand> senthil: I read pretty much all of his posts (more than once) when I was using eventmachine
<burgestrand> senthil: and yeah, I looked into em::synchrony source as well, awfully simple when you grok the idea
visof_ has joined #ruby
<senthil> burgestrand: me too! pretty informative; think i saw a screencast about goliath by him somewhere
<ExtremeDevilz> uh I mean compare to Java etc =\ ? Im actually kinda new to Computer Science.. my school teaches VB.Net and Java but I only Learned VB.Net.. I kinda lost Interest in Java..
<senthil> burgestrand: i never could understand em's implementation even now
<burgestrand> senthil: hehe
<senthil> burgestrand: synchrony is using fibers right?
<burgestrand> senthil: back when I read the source it was a tangled web of stuff
<burgestrand> senthil: yeah
bjensen has joined #ruby
<csherin> remember fibur ? ;-) https://gist.github.com/1498215
<burgestrand> too bad fibur won’t work with more than a few dozen callbacks active at the same time :o
<burgestrand> ExtremeDevilz: yes
<burgestrand> ExtremeDevilz: it’s a different mindset in ruby in comparison to java, and VB.net as well
<burgestrand> ExtremeDevilz: ruby itself was written to make programming more fun, java was written because nothing like it existed at the time
<senthil> csherin: is this an em-synchrony alternative?
<burgestrand> senthil: it’s threads
<burgestrand> senthil: or rather, a joke :)
<csherin> senthil: you should checkout the source ;-)
<senthil> hahahaha!
<senthil> Fibur = Thread
emocakes has joined #ruby
<senthil> need to sleep; later guys
<burgestrand> \o,
ephemerian has joined #ruby
alem0lars has joined #ruby
<alem0lars> I have defined this Treetop grammar: http://pastie.org/3366408 . When I try to match it against the string @tsr:full=asd&&@tsr:full=asd it doesn't match. I'm trying to figure out what fails but I didn't find the reson. Any ideas?
<banisterfiend> burgestrand: visby known for being a nice place?
lampe2 has joined #ruby
<burgestrand> banisterfiend: yeah, I guess, it’s considered more like a village and not a city
<ExtremeDevilz> uh guys can I use Ruby And WINAPI ?
AxonetBE has joined #ruby
<banisterfiend> burgestrand: does sweden still have many quaint and sweet places like that?
<burgestrand> banisterfiend: yeah a bunch, most of them are up north though (imo), I was raised on one but it’s turned sour the past few years when they built more houses on the island
<lampe2> hey iam a java dev. and now i wanne get into ruby. i got a problem. i wanne write a libary to parse xml files from the lom standard into a DB. what are good DB's for metadata in ruby ?
<burgestrand> banisterfiend: but yeah, you can definitely find those places around as long as you stay outside the big citiies; archipelagos are great places for finding them
<banisterfiend> burgestrand: they can speak english ok there too? it's good for tourist or will i struggle?
<burgestrand> banisterfiend: I’d say most swedes fare extremely well with english, you can get around pretty much anywhere except for perhaps very small and remote villages, but even there people understand and speak english well enough
<burgestrand> they will have a very funny accent though
<banisterfiend> cool:))
<burgestrand> I know first-hand because for some reason strangers speak english to me after they’ve said hello to me on the streets, I have no idea why
<ExtremeDevilz> anyone can answer my question ?
<burgestrand> ExtremeDevilz: you can use the windows api from ruby but I have not used it myself so I have no idea how it is to use it
MissionCritical has joined #ruby
<ExtremeDevilz> uh okay I think I will pick up Ruby then
<ExtremeDevilz> :)
jbpros has joined #ruby
jbpros_ has joined #ruby
fallen has joined #ruby
AxonetBE has joined #ruby
yxhuvud has joined #ruby
fixl has joined #ruby
Jackneill has joined #ruby
eeadc has joined #ruby
jamw has joined #ruby
_obiJuan has joined #ruby
eldariof has joined #ruby
ExtremeDevilz has joined #ruby
randym has joined #ruby
<HarimaKenji> hi, is there someone who knows about ruboto under ubuntu? I always get "ruboto: command not found"
zjhui has quit [#ruby]
trivol has joined #ruby
niklasb has joined #ruby
iocor has joined #ruby
visof has joined #ruby
kingo_of has joined #ruby
rootapex has joined #ruby
justfielding has joined #ruby
i8degrees has joined #ruby
zastaph has joined #ruby
notbrent has joined #ruby
otakutomo has joined #ruby
etehtsea has joined #ruby
bradly has joined #ruby
MetaCosm has joined #ruby
MoMo has joined #ruby
SeanTAllen has joined #ruby
canton7 has joined #ruby
moeSeth has joined #ruby
relix has joined #ruby
cek has joined #ruby
<cek> hi. how do I notify admins when a process restarted in God?
dkannan has joined #ruby
<cek> it doesn't have events enabled as i don't want to run it as root
QKO_ has joined #ruby
kapowaz has joined #ruby
kaichanvong has joined #ruby
senny has joined #ruby
davidboy has joined #ruby
jaywastaken has joined #ruby
king313 has joined #ruby
Faris has joined #ruby
AxonetBE has joined #ruby
thone_ has joined #ruby
davidpk has joined #ruby
statonjr has joined #ruby
eka has joined #ruby
cnf has joined #ruby
<cnf> hi, can anyone suggest a good markdown parser for octopress that supports markdown extras?
fallen has joined #ruby
timonv has joined #ruby
Keva161 has joined #ruby
__null has joined #ruby
y3llow has joined #ruby
TomJ has joined #ruby
TomJ has joined #ruby
jcromartie has joined #ruby
elliot_ has joined #ruby
Ferdev has joined #ruby
elliot98 has joined #ruby
gokul has joined #ruby
aeu has joined #ruby
mengu has joined #ruby
golberg has joined #ruby
<golberg> ciao
<golberg> !list
banseljaj has joined #ruby
maahes has joined #ruby
ChampS666 has joined #ruby
dyer has joined #ruby
dyer has joined #ruby
cnf has quit ["Linkinus - http://linkinus.com"]
trivol has joined #ruby
thecreators has joined #ruby
Indian has joined #ruby
gp5st has joined #ruby
jaywastaken has joined #ruby
vladyn has joined #ruby
<gp5st> sorry, wasn't sure if this should be here or in #ubuntu. I did an apt-get install ruby1.9, but I don't know how to install rubygems. apt-get install rubygems gives gems for 1.8
fr0gprince_mac has joined #ruby
Ownatik has joined #ruby
vladyn has quit [#ruby]
tuxaddicted has joined #ruby
fr0gprince_mac has joined #ruby
burgestrand has joined #ruby
lateau_ has joined #ruby
burgestrand has joined #ruby
porco has joined #ruby
jwmann has joined #ruby
waxjar has joined #ruby
rootapex has joined #ruby
bluenemo has joined #ruby
bluenemo has joined #ruby
rickmasta has joined #ruby
i8degrees has joined #ruby
<shevy> gp5st it is a debian issue, if you continue to use debian packages
<gp5st> any reason i shouldn't
wenbert has joined #ruby
<shevy> in general debian cripples and splits things a lot. It should be their responsibility to clean the shit up. Alternatively you could decide to not use the debian packages and use RVM http://beginrescueend.com/ - another way is to install rubygems directly from the source. http://rubyforge.org/frs/?group_id=126&release_id=23118
lae has joined #ruby
<shevy> gp5st, ruby 1.9.x has rubygems integrated though
fr0gprince_mac_ has joined #ruby
<gp5st> hmm, maybe i need to play and figure if it's sufixed like ruby (it's ruby1.9 not ruby:-\)
<shevy> try to install rubygems from rubyforge though
<shevy> yes, that is another debian shit
<shevy> the idiocy of versioned binaries
<shevy> it is just a symlink though
<shevy> ruby1.8 -> ruby or ruby1.9 -> ruby
<gp5st> there isn't a ruby though:-p
<shevy> normally there is
<gp5st> i use rvm locally and since this is a production box i thought it might be better to use the os binaries
<gp5st> i should just switch back to rvm:-\
<__null> or you can check out rbenv, whichever one seems more interesting to you
<shevy> when I install some debian-based distro, they usually have a symlink from ruby1.8 pointing to /usr/bin/ruby (or, if they are super-funny, into /etc/alternatives, which is another shit I can't find any word for...)
<shevy> yeah gp5st
ikaros has joined #ruby
<shevy> though rubygems is really a small addon
<gp5st> it's more that i want to keep everything coming from the same place and not me just installing and compiling things as a one-off
<shevy> yeah
<shevy> the prisoner begins to enjoy his prison ;)
<burgestrand> srsly, rvm, it was built for production systems
<gp5st> yeah, i don't have any problem with it, i just thought that if i could use the standard repos for the os, that would be a bit easier
<burgestrand> hehe, installing ruby through the package managers is just pain
<burgestrand> pain, death and despair
<shevy> heeh
<shevy> I am just amazed that ubuntu is unable to solve those problems
kurko_ has joined #ruby
hubub has joined #ruby
kreantos has joined #ruby
Jake232 has joined #ruby
<banisterfiend> anyone recommend any nice two player web games? where i can play against a friend
dinduks has joined #ruby
FlyingFoX has joined #ruby
mk03 has joined #ruby
gen0cide_ has joined #ruby
hubub has joined #ruby
jordanstephens has joined #ruby
colossal7_ has joined #ruby
p0y has joined #ruby
senny has joined #ruby
lewix has joined #ruby
lewix has joined #ruby
timonv has joined #ruby
tayy has joined #ruby
opin has joined #ruby
milkpost has joined #ruby
BrianE has joined #ruby
gianlucadv has joined #ruby
tayy has joined #ruby
Sivart has joined #ruby
trivol has joined #ruby
kirun has joined #ruby
kreantos has joined #ruby
jobicoppola has joined #ruby
frishi has joined #ruby
fr0gprince_mac has joined #ruby
BrianE has joined #ruby
S1kx has joined #ruby
S1kx has joined #ruby
gp5st has quit [#ruby]
ePirat has joined #ruby
lewix has joined #ruby
lewix has joined #ruby
rippa has joined #ruby
mjording has joined #ruby
yakko has joined #ruby
CannedCorn has joined #ruby
p0y has joined #ruby
ebanoid has joined #ruby
lkba has joined #ruby
TomJ has joined #ruby
TomJ has joined #ruby
savage- has joined #ruby
milkpost has joined #ruby
DFectuoso has joined #ruby
andrewhl has joined #ruby
td123 has joined #ruby
p0y_ has joined #ruby
wroathe has joined #ruby
mengu has joined #ruby
csprite has joined #ruby
lateau_ has joined #ruby
_|christian|_ has joined #ruby
DFectuoso has joined #ruby
demet8 has joined #ruby
waxjar has joined #ruby
<burgestrand> banisterfiend: browser-based?
<burgestrand> nvm, don’t know any myself anyway
bluOxigen has joined #ruby
BrianE has joined #ruby
Ownatik has joined #ruby
jcromartie_ has joined #ruby
neurodrone_ has joined #ruby
lateau_ has quit [#ruby]
jxpx777 has joined #ruby
<td123> is there a way to get the vender_ruby directory using ruby?
<td123> something like Gem.default_dir for gems
habermann24 has joined #ruby
demet8 has quit [#ruby]
<shevy> hmm perhaps the guys on #rubygems know
<burgestrand> td123: rbconfig might have something for you, $ RbConfig::CONFIG.keys.grep /vendor/ # =>
<burgestrand> => ["vendorhdrdir", "vendordir", "target_vendor", "host_vendor", "build_vendor", "vendorlibdir", "vendorarchdir"]
DFectuoso has joined #ruby
Morkel has joined #ruby
<habermann24> anybody know of a neat way to flatten an array or arrays of integers … in a way that i only get the "intersection". so [[1,2,3], [1,2]] ---> [1,2]
<td123> burgestrand: thanks
<habermann24> i know i can do [1,2,3]&[1,2] ...
<habermann24> but how do i apply this to all so i can flatten it that way
<td123> habermann24: one way I could think of is to use folding
<td123> forgot what it's called in ruby :P
<td123> injecting?
eldariof has joined #ruby
kpshek has joined #ruby
<habermann24> .inject(&:&) ??
yakko has joined #ruby
<habermann24> yea that works!!
<habermann24> thanks :)
wroathe has joined #ruby
<habermann24> that is so awesome :D
<habermann24> gotta love ruby
<burgestrand> reduce/inject
<burgestrand> :o
<habermann24> [[1,2,3], [1,2]].inject(&:&) => [1,2]
<habermann24> great :)
<kpshek> basic question for a ruby newb -- I'm trying to run the unit tests for a gem I've downloaded (source). Is 'rake test' the de-facto way to run test for a given project?
<shevy> omg
<shevy> never saw .inject(&:&) before
<shevy> that looks like a smiley
<habermann24> love it :D
<td123> now if only I could figure out how to install gems to vender_ruby :)
<burgestrand> kpshek: there is no standard, often it’s rake test or rake spec
<burgestrand> kpshek: it’s good practice to include a default task that runs the tests though, so just “rake” would run the tests as well
mefis has joined #ruby
rootapex has joined #ruby
<kpshek> thx -- I saw that this gem has that too
justfiel- has joined #ruby
<kpshek> I must not have things setup properly as I'm getting this error on 'rake test': http://pastebin.com/63S2CEvs
<kpshek> The gem I'm trying to run the tests on is github.com/jnunemaker/mongomapper (trying to contribute some bug fixes back to the author)
BrianE has joined #ruby
<burgestrand> kpshek: try running it in ruby 1.9.2 instead of 1.9.3
<kpshek> k
gen0cide_ has joined #ruby
<burgestrand> kpshek: or if that’s not an option, get rid of ruby-debug in the Gemfile for the time being
<kpshek> would that just be commenting those two gems out (ruby-debug & ruby-debug19) and then running 'bundle install' again?
<burgestrand> kpshek: yes, sorry :)
<kpshek> np
virunga has joined #ruby
heftig has joined #ruby
yoklov has joined #ruby
Sivart has joined #ruby
elliot_ has joined #ruby
<kpshek> burgestrand: removing the ruby-debug gems didn't work (another error about the perftools bundle). I'm going to install 1.9.2 and try that
habermann24 has quit [#ruby]
Administrateur has joined #ruby
saurb has joined #ruby
<burgestrand> kpshek: alright, should probably be alright to remove perftools as well though
justfielding has joined #ruby
berserkr has joined #ruby
emocakes has joined #ruby
<td123> anyone familiar with gem installation? I'm trying to figure a clean way to seperate gems installed through the distros package manager and gems installed through the user
<td123> by user, I mean a user running gem install foo
<td123> debian installs gems to vender_ruby, but they wrote a 3000 line program in ruby to package it for them :P
<burgestrand> could use rvm with user-managed gemsets
rootapex has joined #ruby
<kpshek> burgestrand: thanks for your help - removing ruby-debug & perftools I was able to 'rake test' with 1.9.3
<burgestrand> kpshek: :)
<td123> burgestrand: I do use rvm, I'm just looking for a distro-wide solution :P
alphabitcity has joined #ruby
saurb has quit [#ruby]
<alphabitcity> is it possible to get a list of instance variables declared using attr_accessor from the class object?
<burgestrand> td123: I mean, you can have each user have their own set of gems independent from the others, but still share available ruby versions, using rvm
symptom has joined #ruby
dagnachewa has joined #ruby
<dagnachewa> hello everyone
chimkan has joined #ruby
Ienpw_III has joined #ruby
<Ienpw_III> hey, would someone be able to help me with this: http://www.reddit.com/r/ruby/comments/phce8/regex_help_beginner_question/
<kpshek> alphabitcity: are you talk about something different than the instance_variables method?
<Ienpw_III> I've searched and searched but I can't find anything :(
csmrfx has quit [#ruby]
<alphabitcity> kpshek: yea, instance_variables works when you call it on an instance of the class..but i'd like to be able to inspect the class for the instance methods defined with attr_accessor
<td123> burgestrand: nah, that won't work, I'm trying to figure out a standard for a distro :P
fayimora has joined #ruby
<burgestrand> alphabitcity: attr_accessor is just a method that creates methods, and there’s nothing special about them methods
<burgestrand> (they’re actually optimized a little bit in C)
<burgestrand> but afaik you can’t distinguish them from the rest
<alphabitcity> burgestrand: okay, got it .. thanks for the help
krz has joined #ruby
kmurph79 has joined #ruby
kirun has joined #ruby
chaitanya has joined #ruby
<andrewhl> i'm trying to write a prime sifter. The idea is to take a range of numbers (e.g., 2..20), and check for the multiples of each number by incrementing by that number value. All multiples except the first number will be set to nil or something. When the range is exhausted, move on to the next prime number, increment that by its own value, and repeat. What's the best way to do this? Should I just inject?
<andrewhl> I'm not sure how to modify an array or a range that I am currently looping through
nemesit|osx has joined #ruby
FreschFN has joined #ruby
<yoklov> what's the popular opinion on modifying builtin types? always avoid?
any-key has joined #ruby
jordanstephens has joined #ruby
mikepack has joined #ruby
dagnachew_ has joined #ruby
<dagnachew_> hi all
<burgestrand> yoklov: avoid subclassing, adding behaviour should be avoided in libraries
akem has joined #ruby
<burgestrand> yoklov: or rather, in gems
moshee has joined #ruby
moshee has joined #ruby
<yoklov> is there any reason to avoid it in non-gem programs?
<dagnachew_> why is that ruby does not update my gems ? do I havcve to resintall manually each ?? for exemple on my laptop pry is at version 0.9.7 and I did gem update --system and after when I did pry --version it was still 0.9.7 instead of 0.9.8
nowthatsamatt has joined #ruby
Ownatik has joined #ruby
<dagnachew_> plz help gem update
<dagnachew_> hello burgestrand
<burgestrand> Hi
<burgestrand> yoklov: it can make code hard to follow if you add a bunch of custom things to core classes
<dagnachew_> burgestrand, gem update --system does not update my gems
<burgestrand> yoklov: but apart from that, not really
<burgestrand> dagnachew_: it updates your rubygems
<dagnachew_> burgestrand, oic
affix has joined #ruby
<dagnachew_> burgestrand, what is the method to update all the gems ?
<burgestrand> No idea, I never do such crazy things :P
<dagnachew_> burgestrand, by ruby gems you mean all gems beside pry and tools ?
nowthatsamatt has quit [#ruby]
<burgestrand> dagnachew_: gem help update
<Mon_Ouie> Just gem update
<burgestrand> dagnachew_: it contains details of the command
wyhaines has joined #ruby
<dagnachew_> burgestrand, how do you upgrade your gems ? for exemple let say capistrano and nokogiri have a new version ?
<burgestrand> dagnachew_: each of my projects have a Gemfile that says which version they use, if I want a project to use a new version I update it for that specific project
<dagnachew_> burgestrand, is it bad to update all the gems granting there are no bugs in new update ??
<burgestrand> it doesn’t matter if I update all gems because each project has its own gems locked
canton7 has joined #ruby
<burgestrand> but really, you have no idea if an update will break all of your stuff, which is why I stick to doing it on individual projects
<dagnachew_> burgestrand, you do it your way to prevent bugs ? for exemple if your project X uses nokogiri-1.2.3 and nokogiri-1.2.4 comes out you dont want to take a risk of
<dagnachew_> burgestrand, I was to say that
<dagnachew_> I understand know your way
<burgestrand> kind of, but my projects don’t use the system installation because of bundler
<dagnachew_> burgestrand, I am a bit far from using gems I am starting ruby
<dagnachew_> burgestrand, bundler is the tool to fetch the gems ?
mmokrysz has joined #ruby
rippa has joined #ruby
mmokrysz has quit [#ruby]
<dagnachew_> burgestrand, correct me if am wrong , you have this fantastic rails app X and you use gems a,b,c,d and bundler handels the gems ?
<burgestrand> dagnachew_: yes, http://gembundler.com/
thecreators has joined #ruby
lewix has joined #ruby
<dagnachew_> burgestrand, yesterday I learned about symbols
marcham93 has joined #ruby
gloomer has joined #ruby
maletor has joined #ruby
<marcham93> Hello. I was loking at ruby (which I have no experience in) and have a quick/simple question. What is the final file type of a compiled program?
<banseljaj> marcham93: ruby doesn't compile
<Mon_Ouie> It does
<banseljaj> Mon_Ouie: It does?
<Mon_Ouie> The standard implementation compiles Ruby code into bytecode and runs it on its VM
<Mon_Ouie> (that bytecode isn't saved on disk)
saurb has joined #ruby
hmans has joined #ruby
<Mon_Ouie> About every other implementation generates at least bytecode, some also have a JIT compiler to generate native code at runtime
<burgestrand> marcham93: so, in essence, you don’t compile ruby
<marcham93> I am a .NET developer and I am used to .exe and .msi files being produced. What does ruby produce and how would a user run it?
<burgestrand> marcham93: you run the scripts using a ruby interpreter
<burgestrand> marcham93: so to distribute ruby scripts, you must also make sure your target audience has a ruby interpreter to run the scripts on
<marcham93> That seems impractical? Ruby can not be used for general application development?
berserkr has joined #ruby
<Mon_Ouie> Or distribute the interpreter with your application
<burgestrand> there are some tools that can make, for example, .exe files of ruby scripts
<burgestrand> but as far as I know they distribute a ruby interpreter within the .exe
<burgestrand> pretty much all operating systems in use have a ruby interpreter installed by default, with the exception of windows of course
<burgestrand> or, that was a bit too much, I mean most *nix distributions and mac os
<yxhuvud> to assume 'general application' development requires software to run from a blank slate seems silly. desktop applications for end users? perhaps, but that is hardly very general
<rippa> ruby interpreter is not very big
<rippa> it's very much possible to distribute it with your application
<marcham93> What would you say most ruby developers use the language for? I'm used to using .NET for general desktop applications and was looking for a more cross platform language. That is when I stumbled upon Ruby.
<Mon_Ouie> Web development probably
<rippa> rails and stuff
<alphabitcity> is there an established comment convention i should use when documenting a gem that i'm writing?
<burgestrand> web development, system management (one-off scripts) and backend services such as workers and scheduled jobs
<marcham93> Okay I see.
<burgestrand> it’s also awfully fun to play with, but as far as desktop applications goes there’s not much
Sliker has joined #ruby
<burgestrand> Hoping MacRuby catches up and spreads to iOS, that would be fun.
robacarp has joined #ruby
<rippa> maybe i should learn Java
* rippa shoots himself
<marcham93> Okay thank you for the information.
<yxhuvud> burge: system management is getting a lot less one-off with puppet and chef though
tomku has joined #ruby
<marcham93> Rippa, Java is the language used in hell. >_< Hated it.
tomzx has joined #ruby
<burgestrand> yeah, and not to forget sprinkle
<rippa> marcham93: but it's popular
al3xnull has joined #ruby
<burgestrand> yxhuvud: ^
<marcham93> Okay thanks for all the help guys.
GiambalaGiambala has joined #ruby
KristianDK has joined #ruby
bozhidar has joined #ruby
<KristianDK> Sorry, this must be an often asked question, but google didn't help me - im probably asking the wrong quesiton, but - how do I install something like this? https://github.com/ripienaar/hiera-json
csherin has joined #ruby
JohnBat26 has joined #ruby
<KristianDK> The project has a Rakefile, but i cant seem to do anything with "rake" and "gem" - am im completely lost?
mxweas_ has joined #ruby
pdtpatr1ck has joined #ruby
dibri has joined #ruby
benregn has joined #ruby
Leave_This_Place has joined #ruby
<Leave_This_Place> hello, I'm doing a ruby tutorial, and it says to do "help String" in the irb to find all the available methods for the String class, but there are a lot of them missing.. where can i find the FULL list of them?
<rippa> Leave_This_Place: http://www.ruby-doc.org/core-1.9.3/
<Leave_This_Place> oh thanks rippa. is it not avaiable in the irb?
<rippa> dunno
<rippa> never used offline documentation
heftig has joined #ruby
medik has joined #ruby
dagnachewa has joined #ruby
gentz has joined #ruby
daglees has joined #ruby
gvt has joined #ruby
jwang has joined #ruby
<Mon_Ouie> ri SomeClass#some_method
<Mon_Ouie> From command line, not IRB
<Mon_Ouie> Pry has commands to look up documentation, etc.
milkpost has joined #ruby
<Leave_This_Place> hmmm Mon_Ouie, i tried to do ir String#upcase but it said "Nothing known about String#upcase"
<burgestrand> Leave_This_Place: using rvm?
<Leave_This_Place> i did that from bash Mon_Ouie
chimkan has joined #ruby
<Leave_This_Place> no burgestrand, not yet
<Leave_This_Place> should I be?
<Mon_Ouie> That's just to know how to install the documentation, as it depends on how you installed Ruby
<burgestrand> Leave_This_Place: what Mon_Ouie said :)
<Mon_Ouie> Package managers often have it in another package
fayimora has joined #ruby
<Leave_This_Place> well, that's creepy
mxweas_ has joined #ruby
HarimaKenji has joined #ruby
<Leave_This_Place> I just did the install of RVM and it said "thank you for using RVM" using my first and last name
<Leave_This_Place> strange
<Leave_This_Place> creepy, actually
savage- has joined #ruby
rushed has joined #ruby
<Leave_This_Place> hmm maybe it had to do with my git-hub profile?
waxjar has joined #ruby
<Mon_Ouie> Could be your git config
alphabitcity has joined #ruby
<Leave_This_Place> wow, I feel TOTALLY exposed running an installation process that can exploit my system through bash
<Leave_This_Place> i'm uninstalling it immediately
apucacao has joined #ruby
<Leave_This_Place> totally not cool guys
Morkel has joined #ruby
tvo has joined #ruby
<Ienpw_III> would someone be able to help me with a regex question?
gianlucadv has joined #ruby
<Ienpw_III> I have a file with a bunch of instances of "a DATE b" where date matches /(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (Jan|Feb|Mar|Oct|Nov|Dec) \d{1,2}, \d{4} at \d{1,2}:\d{2} (AM|PM)/
<Ienpw_III> I'd like to switch it to "a to b, DATE"
<Ienpw_III> *switch them
Azure has joined #ruby
Ownatik has joined #ruby
ceej has joined #ruby
waxjar has joined #ruby
rootapex has joined #ruby
lkba has joined #ruby
sterNiX has joined #ruby
alphabitcity has quit [#ruby]
Mchl has joined #ruby
<Mon_Ouie> gsub /a (date regexp) b/, 'a to b, \1'
<Mon_Ouie> Keeping the parens around the date regexp
<Mon_Ouie> And I'd even replace the groups inside it by non-matching groups as they are not needed
HarimaKenji has quit [#ruby]
kjpelton has joined #ruby
pdelgallego has joined #ruby
ryannielson has joined #ruby
<Ienpw_III> thanks Mon_Ouie
kjpelton has quit [#ruby]
Indian has joined #ruby
rootapex has joined #ruby
gavit has joined #ruby
kjpelton has joined #ruby
TomJ has joined #ruby
bluOxigen has joined #ruby
<td123> Hi, Gem.user_dir = "/home/tom/.gem/ruby/1.9.1" how could I install to this directory? it seems to be in my path
Jamoka has joined #ruby
mmokrysz has joined #ruby
mmokrysz has quit [#ruby]
rootapex_ has joined #ruby
kjpelton has quit [#ruby]
Jake232 has joined #ruby
Guest25507 has joined #ruby
Sailias has joined #ruby
stringoO has joined #ruby
<Ienpw_III> Mon_Ouie: One more question, sorry
<Ienpw_III> gsub /a (date regexp) b/, 'a to b, \1'
<Ienpw_III> when I do that, it just uses the day of the week for \1
<Ienpw_III> so I get "a to b, Sun"
user__ has joined #ruby
itstimetoleave has joined #ruby
<Mon_Ouie> Probably because you didn't wrote /a (Mon|…) … b/
<Mon_Ouie> Not /a ((Mon|…) …) b/
KristianDK has quit ["Linkinus - http://linkinus.com"]
<Mon_Ouie> Or better, /a ((?:Mon|…) …) b/
itstimetoleave has quit [#ruby]
<Ienpw_III> oh,I see
<Ienpw_III> I misunderstood
<Ienpw_III> what does (?:Mon|...) do differently than (Mon|...) ?
<Mon_Ouie> It makes the group non-capturing
bluOxigen has joined #ruby
EddieBluh has joined #ruby
<Mon_Ouie> i.e. you can't access it as the second capture group ($2, or \2 in gsub's replacement string)
<Ienpw_III> oh
syamajala has joined #ruby
<Ienpw_III> thanks, Mon_Ouie
davidpk has joined #ruby
samsonjs has joined #ruby
colossal7 has joined #ruby
AxonetBE has quit [#ruby]
<syamajala> i'm trying to do something weird
<syamajala> i want a user to enter a function of a single variable and then i need to evaluate that function
fallen has joined #ruby
senny has joined #ruby
n3m has joined #ruby
<syamajala> for example they enter x*2 i want to then evaluate that at some point
tayy has joined #ruby
<tshirtman> syamajala: eval()?
mmokrysz has joined #ruby
dagnachewa has joined #ruby
CannedCorn has joined #ruby
imami has joined #ruby
<shevy> syamajala store the input in a variable, then either use eval() or split up the input on your own
<shevy> @user_input = $stdin.gets.chomp
zakwilson_ has joined #ruby
jcromartie_ has joined #ruby
<syamajala> Math.module_eval does what i want
<syamajala> because i also need to be able to let the user enter trig functions
<shevy> cool
<shevy> indeed works
<shevy> Math.module_eval "5+5" # => 10
gavit has joined #ruby
<rippa> eval is dangerous though
ph^ has joined #ruby
<syamajala> this is just a homework assignment its not going to be released into the wild
jgrevich has joined #ruby
Minimalist has joined #ruby
<Minimalist> Hey
<Ienpw_III> what's wrong with eval
<Minimalist> What is the utility of the nested classes concept in Ruby ?
Chaazd has joined #ruby
<Chaazd> I am getting a private method ftp error here. http://pastebin.com/bjdJWw2b
waxjar has joined #ruby
punkrawkR has joined #ruby
<rippa> where?
jordanstephens has joined #ruby
<Chaazd> 32
<rippa> Chaazd: you have mismatched 'end'
<rippa> looking on indentation
<rippa> on line 17
<rippa> and missing end on line 23
<rippa> after 23
mrmist has joined #ruby
<Chaazd> Thank you very much
seanstickle has joined #ruby
Muon has joined #ruby
<Muon> hello
adamkittelson has joined #ruby
<Muon> does anyone know whether there are any good autocomplete algorithm implementations available?
<Muon> my Google-fu is failing me, and I need something that works with phrases
<seanstickle> Muon: autocompleting what?
<td123> Muon: you probably want to build a search tree
cek has joined #ruby
<td123> ok, I may be using the wrong terminology :P
<Muon> seanstickle: titles
<seanstickle> Book titles, job titles?
<seanstickle> From a database, out of the air?
<Muon> product titles
<seanstickle> Ah
<Muon> from a database
<seanstickle> Muon: and things like http://www.devbridge.com/projects/autocomplete/jquery/ won't work for you?
<td123> Muon: build a tree where the first level contains all the first letters of all your titles
<Muon> I'm doing that, but it doesn't sort it for you
<Muon> td123: a trie?
<td123> yes :)
<Muon> s/doing/using/
DFectuoso has joined #ruby
<Muon> yeeees, but I need it to be relatively order-independent
<Muon> relatively because I still think I want it to reward ordered input
<Muon> but anything that works okay would be fine
<Muon> (Levenshtein does not work okay)
<cek> anyone knows a good todo list ruby app?
<seanstickle> cek: todo.txt
<td123> Muon: what does order independent mean?
<td123> Muon: if I'm understanding you, why wouldn't you want a sorted output?
<Muon> it means "bazzy foobar" should match "spangly screwy foobar with bazzy" better than "foobar"
<Muon> td123: I want a sorted output, I'm not getting it
snearch has joined #ruby
<Muon> that script doesn't sort the completions in order of descending similarity
<td123> oh I see
<td123> I was wondering why, but you want to search for a string where the words can be in any order/place
<Muon> exactly
<td123> ah, then a tried is probably not what you're looking for :P
<Muon> exactly
syamajala has joined #ruby
<Muon> right now I'm thinking of rejecting anything which doesn't have ALL of the words and then doing some more sorting
Cliff_ has joined #ruby
<Muon> but Levenshtein is still crap because it favors short strings
syamajala has joined #ruby
sjang1 has joined #ruby
<Cliff_> Hi. I am new to Ruby and am running into a weird issue using DBI and dbh.select_all.
mephux has joined #ruby
<Cliff_> If I do "rows = @dbh.select_all(query)" -- where query is a string representing a database query that returns non-zero rows.
<td123> Muon: hmm, I have a feeling like matching individual words using levenshtein distance might work
<Cliff_> I want to return a random row from that query. I thought "return rows[rand(rows.size)]" would work, but returns the same row over and over. That row turns out to be the same as if I did "return rows[0]"
jwang has joined #ruby
<Cliff_> I'm sure I'm doing something obvious and silly, but I can't figure out what is wrong.
<td123> Muon: could get expensive though
<Muon> hm
<Cliff_> Full code is going up on pastie.org in a second.
DFectuoso has joined #ruby
<seanstickle> Cliff_: rows.sample
<Cliff_> rows.sample?
<seanstickle> Cliff_: yup
mephux has joined #ruby
<canton7> Cliff_, zero doesn't evaluate to a boolean false in ruby. Instead of "if !rows.size" use "if rows.empty?"
savage- has joined #ruby
<Cliff_> Thanks canton
<Cliff_> Fortunately hadn't run into that one, yet.
<Muon> td123: yeah, Levenshtein on words seems like my best bet so far :S
<Muon> but I still want to deal with misspellings
<Muon> gah
<Muon> thanks for trying
<Muon> I've got a lot of hacking to do
<td123> Muon: heh, ya I bet there's a whole search field dedicated to this topic :P
<seanstickle> Cliff_: rows.sample will give you a random row from your array of rows
<Cliff_> Yup. Just looked that up, seanstickle
syamajala has joined #ruby
<Cliff_> Why doesn't my method do the same thing, though?
<seanstickle> Cliff_: and use parameterized queries, for heaven's sake
<seanstickle> Cliff_: not concatenated strings
<Chaazd> I want to list the contents of a FTP directory in a way that I can sort by name. pwd doesnt work
<seanstickle> Cliff_: yours does the same thing, just less elegantly
<canton7> Cliff_, what is rows? Is it an array, or some form of object? Also, to get a random row using SQL (at least in MySQL), use "ORDER BY RAND() LIMIT 1"
<Cliff_> Not using MySQL. Using SQL server.
<Cliff_> OK. Running into the same problem using rows.sample as before.
<canton7> ah so I see. There's probably an equivalent
<Cliff_> So maybe this isn't an array.
<Cliff_> I thought dbh.select_all returned an array?
<canton7> Cliff_, yeah, use "p rows" or "pp rows" to get a good look at it
<Cliff_> Have done. It LOOKS like an array.
<canton7> Cliff_, and it has more than one row?
<Cliff_> Yes. 105 to be exact.
Keva161 has joined #ruby
<Cliff_> Look at the bottom of the method where I do lots of p calls.
<canton7> Cliff_, and "p rows[1]" gives the expected output?
<Cliff_> Hum. Let me see.
pu22l3r has joined #ruby
S2kx has joined #ruby
<Cliff_> HAH! That would explain it.
<Cliff_> For some reason, all of the rows return the same value.
<Cliff_> Now why is that?
<canton7> aah, there we go :)
<Cliff_> Would it have something to do with @dbh vs dbh?
<Keva161> Hey all sorry to bother you but i need a bit of help.. ive put together a script that scraped a wikipedia page and saves it to a file..pretty simple stuff - http://pastebin.com/B9FyDaLp however.. wen I try to insert the download_file variable into a string it just gives me #<File:0x0000010084de78>.. ive tried to get the string value by adding .to_s onto the end but nothing :/ any ideas?
<canton7> Cliff_, might it be your sql / db contents?
<Cliff_> I run the same query inside the DB and get the output I would expect.
Sliker has joined #ruby
<Cliff_> Going to do this manually from irb
<canton7> Keva161, a) you can't use open() to read remote urls. b) download_file is a file handler. What did you expect it to contain?
<linduxed> if i've got a line that goes like
<canton7> s/file handler/file handle
<linduxed> page.should have_content("total value: ")
<Keva161> the name of the file that i assigned to it (download_page.html)
<linduxed> how could i insert the value of a string argument after total value?
<linduxed> my guess would be ("total value: " + theargument)
<canton7> Keva161, you created a new File object (with open()), and assigned it to download_File
<linduxed> but i don't think that's right, and i remember there being something about using {}-brackets
<canton7> linduxed, "my string has an #{interpolated_variable}"
<Cliff_> HAH! It did the same thing from IRB
<Cliff_> WTF?
colint has joined #ruby
<linduxed> canton7: oh yeah! that's the thing
<linduxed> thank you
<Cliff_> *snrl* -- Hope it isn't the ODBC data source puking.
<Cliff_> caton7: Yup. Looks like it.
<Cliff_> Thanks!
DFectuoso has joined #ruby
<Cliff_> Aw. That sucks.
<Cliff_> OK. So it wasn't my code! Yay!
Guest70733 has joined #ruby
<Cliff_> Too bad. select_all would have been the elegant way to do it. Now I'll have to build the rows array from the usual method.
<canton7> That mixed feeling of satisfaction and annoyance...
<Cliff_> Oh, yeah.
<canton7> I guess you can monkey-patch DBI to have a decent select_all? :P
<Cliff_> Beyond my scope, I'm afraid.
<rippa> damn
<rippa> after ruby using for loops feels like using stone axe
t0mmyvyo has joined #ruby
Dreamer3 has joined #ruby
<Cliff_> LOL
<Cliff_> Know the feeling.
* Cliff_ had to get used to Enumerators a while ago.
nemesit has joined #ruby
<rippa> also
<rippa> >javascrit
<rippa> >"" == 0
<rippa> mfw
wroathe has joined #ruby
Chaazd has quit [#ruby]
<linduxed> rippa: wat
<linduxed> both me saying that out loud, and then remembering that that line was in the WAT speech
jbpros has joined #ruby
<Cliff_> Getting close, now.
jbpros has joined #ruby
kmurph79 has joined #ruby
emocakes has joined #ruby
jbpros has joined #ruby
S1kx has joined #ruby
elitheeli has joined #ruby
<elitheeli> Can someone help with some concurrent IO stuff? I'm trying to read input while printing to STDOUT. Here's what I want to work (but it's not): https://gist.github.com/b83351ff0e349f49e5a8
jxpx777 has joined #ruby
bbttxu has joined #ruby
Tearan has joined #ruby
andrewhl has joined #ruby
syamajala has joined #ruby
badabim has joined #ruby
S2kx has joined #ruby
tanto has quit [#ruby]
nyrb has joined #ruby
<wroathe> If I want to make a simple ruby game is there any reason I shouldn't package it as a gem?
<wroathe> Or is there a better way to structure pure ruby applications
ryan0x2 has joined #ruby
<td123> wroathe: gems are pretty much the standard
peindt has joined #ruby
mephux has joined #ruby
<wroathe> Ok. It seems to me that gems are used as libraries or other re-usable modules of code. I was just wondering if I'd be breaking any ruby rules by packaging my app as a gem.
pu22l3r has joined #ruby
Dreamer3 has joined #ruby
visof has joined #ruby
visof has joined #ruby
<visof> hello
<visof> how can i get all files in the current directory that match "history.n" and n = 1,2,3,......,n ?
colint has joined #ruby
Sliker has joined #ruby
<visof> anyone around can help?
<elitheeli> Dir['history.*'].filter {|x| (1..n).include? x.to_i }
syamajala has joined #ruby
<visof> elitheeli, thanks man
syamajala has joined #ruby
<elitheeli> Is Ruby-Doc.org down for anyone else?
<csherin> down for me
<syamajala> are there any mirrors of ruby-doc?
<etehtsea> works for me
christianreber has joined #ruby
<canton7> ah, it just came back up
looopy has joined #ruby
akem has joined #ruby
akem has joined #ruby
<syamajala> it was definitely down for a while
<canton7> Dir.new(".").select{ |f| f =~ /^history\.\d+$/ } is another way of doing it
<elitheeli> canton7, that's probably less efficient, right?
azureye has joined #ruby
<elitheeli> visof: if there are going to be a massive number of files in the directory and n is relatively small, you can do Dir["history.{#{(1..n).to_a.join(',')}}"]
<visof> elitheeli, how can i do that to get the bigger n in history.1, history.2, .....history.n ?
<elitheeli> what? are you saying you don't know what n is?
eugu has joined #ruby
<visof> nope
<canton7> elitheeli, they're neck and neck, with yours at 3.29 for 10000 cycles, and mine at 3.45. However, filter doesn't appear to be a method, and yours accepts e.g. history.10n (not sure if that makes any difference here)
<visof> how can i get the bigger number from [1,2,3,4] ?
<visof> using select or anything similar
colossus has joined #ruby
<elitheeli> > [1,2,3].max
<elitheeli> 3
<visof> using select?
FlyingFoX has joined #ruby
<elitheeli> Use max.
<elitheeli> Select is for filtering
dagnachewa has joined #ruby
<visof> elitheeli, can i use it to filter the biggest number
<elitheeli> What do you mean? What do you want to do with the biggest number?
sjang1 has joined #ruby
<visof> elitheeli, just curious
<elitheeli> With great difficulty you could
<colossus> hey all, quick regex question: need to find both "{nl:" AND "}" in this quote: "{nl:StuffupperAndLowercasew09}". I have nailed the first part but how do you omit the entire middle and grab the final "}"?
<elitheeli> and regexp with (.)$
finsdelosmundos has joined #ruby
<elitheeli> or better yet (})\z
<finsdelosmundos> is there anything I can do with the lines entered into the IRB? Like, can call the same thing I wrote in line 200-212 without ahving to press "up" back a couple thousands times?
<elitheeli> finsdelosmundos: if you know ahead of time, assign what you did to a proc
<colossus> elitheeli: do I need to create another delete method to get rid of the rest or can I string them together. at the moment I have (\A(nl\:\{))
nd______ has joined #ruby
<finsdelosmundos> elitheeli you know thats not what i was asking
<elitheeli> finsdelosmundos: you can also do "eval Readline::HISTORY[104]"
<elitheeli> colossus: /\A({nl\:).*({)\z/
<elitheeli> then captures 1 and 2 will have what you want
<colossus> elitheeli: hmm now I see, thank you
<elitheeli> finsdelosmundos: here's a transcript:
<elitheeli> ruby-1.9.3-p0 :003 > 4 + 5 # => 9
<elitheeli> ruby-1.9.3-p0 :004 > eval Readline::HISTORY[-2] # => 9
<elitheeli> Do *not* do "veal Readline::HISTORY[-1]" -- it'll blow up your Ruby
<elitheeli> as it tries to eval itself which evals itself, which ...
<visof> elitheeli, what i want to do is : ["foo.1", "foo.2", "foo.4"] want to get 4 is the biggest number after .
<finsdelosmundos> what about say 3 lines together
* canton7 was wondering what was so deadly about the 'veal' function for a minute there...
<visof> split each string then convert second part to_i then compare, but i guess ruby will do that in more easier way
<elitheeli> visof: .max can take a block
<canton7> visof, ["foo.1", "foo.2", "foo.4"].max_by{ |f| f[/\d+/] } is one quick and dirty way. You can do more complex regex if ther emight be more variation in your filenames
dagnachewa has joined #ruby
<elitheeli> canton7: do #max and #max_by differ?
<canton7> elitheeli, max takes two parameters and you have to compare them yourself. max_by just lets you just return an object, and ruby will do the comparison for you
peindt has quit [#ruby]
<canton7> in fact, in this case ["foo.1", "foo.2", "foo.4"].max will do what you want, visof :P
<canton7> elitheeli, for example here, you can use ["foo.1", "foo.2", "foo.4"].max{ |a,b| a[/\d+/] <=> b[/\d+/] }
<elitheeli> canton7: yeah, max_by is definitely better
<elitheeli> and you're right about just max working
<Cliff_> Does anyone here use Sahi for Ruby?
[edu] has joined #ruby
<finsdelosmundos> elitheeli can i use eval Readline to read a block of lines? liek say, 3-12?
astrostl has joined #ruby
<elitheeli> finsdelosmundos: it's just a glorified array
<elitheeli> just call to_a on it first to use a range
<elitheeli> try this: Readline::HISTORY.to_a[-4..-2]
dagnachewa has joined #ruby
<elitheeli> then just map eval them
<elitheeli> Readline::HISTORY.to_a[-x..-y].map {|x| eval x}
t-mart has joined #ruby
jaywastaken has joined #ruby
<finsdelosmundos> oh nice
Ownatik has joined #ruby
dagnachewa has joined #ruby
jaywastaken has joined #ruby
jbpros has joined #ruby
<visof> what is the best way to create a file ?
<visof> File.open("new_file", 'w') ?
<elitheeli> visof: and do what with it?
<visof> elitheeli, just create new file
<visof> is that enough ?
<elitheeli> `touch #{new_file}`
<csherin> visof: FileUtils#touch
<elitheeli> csherin's method is probably better
<elitheeli> mine is lazier
mxweas_ has joined #ruby
wallerdev has joined #ruby
kmurph79 has joined #ruby
dwon has joined #ruby
<csherin> elitheeli, visiof: as far as i understand with FileUtils you do not have to worry about platform oddities and you're not spawning a new sub process per command
baroquebobcat has joined #ruby
<elitheeli> Definitely
phux has joined #ruby
looopy has joined #ruby
Sliker has joined #ruby
<csherin> internally FileUtils#touch uses File#utime and File#open in append mode
Tearan has joined #ruby
kreantos has joined #ruby
jcromartie_ has quit [#ruby]
mefis has joined #ruby
baroquebobcat has joined #ruby
Yugo has joined #ruby
t-mart has joined #ruby
slash_nick has joined #ruby
snip_it has joined #ruby
jergason has joined #ruby
Sailias has joined #ruby
Sliker has joined #ruby
MissionCritical has joined #ruby
<colossus> ok why in this blockstr.gsub(/([A-Z][a-z]+[A-Z][A-Za-z0-9]+)/) {|page| %Q{#{/[^\A({nl\:)].*[^(})\z]/.match(page)}}} assuming str = {nl:RecordNotFound} gives me a result of "{nl:RecordNotFound}" and /[^\A({nl\:)].*[^(})\z]/.match(str) gives me a result of RecordNotFound
dandrinkard has joined #ruby
<colossus> yes I understand it is matchdata, but a simple to_s call solves that
hukl has joined #ruby
robotmay has joined #ruby
Keva161 has joined #ruby
dwon has joined #ruby
phantomfakeBNC has joined #ruby
KristianDK has joined #ruby
baroquebobcat has joined #ruby
<KristianDK> Does anyone know what Rubys equivalent of "python setup.py develop" is? I want to install a package into my rvm environment, but i want the package to read directly from the source, in case i change it.
Sliker has joined #ruby
niklasb has joined #ruby
azureye has joined #ruby
jefflembeck has joined #ruby
statonjr has joined #ruby
stephenjudkins has joined #ruby
ChampS666 has joined #ruby
mephux has joined #ruby
wroathe has joined #ruby
zykes- has joined #ruby
<zykes-> how can i find out which part of a rails app is requiring a gem when i get "Could not find rubyzip-0.9.6.1 in any of the sources" during a bundle command ? ChiliProject btw
<shevy> KristianDK not sure what that does. ruby projects used to have a setup.rb file
<KristianDK> shevy, i just want to install a bundle, in a way where its not copied somwhere else, but used from its actual path, if you know what I mean
<KristianDK> e.g. if you have 2 packages, where one depends on the other and you dont want to install new packages for every bugfix in the main package
sythe has joined #ruby
sythe has joined #ruby
tvw has joined #ruby
josefig has joined #ruby
mpabst has joined #ruby
<colossus> stuff
Sliker has joined #ruby
<colossus> exit
colossus has joined #ruby
<colossus> another regex question: why do I get different results from this block str.gsub(/([A-Z][a-z]+[A-Z][A-Za-z0-9]+)/) {|page| /[^\A({nl\:)].*[^(})\z]/.match(page)} and this /[^\A({nl\:)].*[^(})\z]/.match(str) if str = {nl:RecordNotFound ? Driving me nuts
<_obiJuan> zykes-: check out gemfile.lock
<zykes-> what's that file ?
mmokrysz has joined #ruby
mmokrysz has quit [#ruby]
baroquebobcat has joined #ruby
Rishi_ has joined #ruby
robbyoconnor has joined #ruby
robbyoconnor has joined #ruby
<zykes-> _obiJuan: ?
Jarred has joined #ruby
<Jarred> How do I have rake tasks within rake tasks (e.g. 'rake sec:load:disk')
<Jarred> ?
drPoggs has joined #ruby
<burgestrand> Jarred: it’s just a name
<burgestrand> Jarred: task 'sec:load:disk'
<zykes-> anyone that got a clue on why i fail on rubyzip with gemfile.lock ?
<Jarred> oh
<burgestrand> Jarred: you can also use a namespace block to scope tasks within that block, namespace('sec') { task 'load:disk' }
<Jarred> so I can pass a string instead of a symbol?
<Jarred> (to task)
<burgestrand> Jarred: sure
mjording_ has joined #ruby
Targen has joined #ruby
colint has joined #ruby
Apocalypse has joined #ruby
akem has joined #ruby
luckyruby has joined #ruby
<zykes-> what's the use of gemfile.lock ?
<zykes-> _obiJuan: got a hint or ?
waxjar has joined #ruby
dwon has joined #ruby
amerine has joined #ruby
al3xnull has joined #ruby
Seisatsu has joined #ruby
dmn001_ has joined #ruby
amerine has joined #ruby
elliot98 has joined #ruby
<Jarred> I'm getting an unexpected 'end' on line 10. I don't see any reason for it. https://gist.github.com/122a82f82f2366699016. What needs an end that doesn't have one?
samuel02 has joined #ruby
colint has joined #ruby
Muon has quit ["PLANE SHIFT!"]
<examancer> Jarred: i think interpretter thinks a coupel of your blocks are part of your range definition. you should surround your ranges in parens ()
<examancer> (1..4).each instead of 1..4.each
<Jarred> done
<examancer> that fix it?
<Jarred> now its complaining about line 12
<examancer> did you do it for both ranges?
<Jarred> Yeah
<Jarred> (at the second one)
<burgestrand> Jarred: forgot do for both tasks
<Jarred> ohhh
<examancer> yes, missing do
<Jarred> and namespace?
<burgestrand> Jarred: and your namespace
wroathe has joined #ruby
<burgestrand> :p
looopy has joined #ruby
<Jarred> Rails' rake tasks don't require the models?
<burgestrand> Jarred: you need to require the environment for that
<Jarred> What's the method for that?
<burgestrand> Jarred: you can add it as a prereq to your task; task 'my_task' => :environment do
<examancer> task :some_task_name => :environment do
<examancer> that makes :some_task_name dependent on the :environment task
<Jarred> hmmm
<Jarred> I updated the gist. How do I set it to the environment when the task name is a string?
rickmasta has joined #ruby
<examancer> funny that you used a private gist but posted it in a public channel :-)
<Jarred> Can I just do :load[:disk]?
baroquebobcat has joined #ruby
<Jarred> examancer: It's instinctual
<Jarred> nah, that didn't work
<examancer> Jarred: there probably isn't a :development task... that should literally be :environment
<Jarred> ohhhh
<burgestrand> Jarred: also, I believe task names are converted to strings, you could rely on 'environment' as well as :environment; not entirely sure though
<examancer> i don't know if you can name a task "load:disk"... i know you can make a "load" namespace with a "disk" task in it... maybe it works both ways
cooper has joined #ruby
<Jarred> It's working
<Jarred> Thanks for your help.,
<examancer> cool :-)
<burgestrand> examancer: you can, both task and namespace accept a string, you can also make a symbol a :"namepaced:symbol" :)
<examancer> nice
<burgestrand> which can make for some very strange symbols
<burgestrand> :""
DFectuoso has joined #ruby
seitensei has joined #ruby
mxweas_ has joined #ruby
Husel has joined #ruby
CannedCorn has joined #ruby
Karmaon has joined #ruby
superman_ffm has joined #ruby
Sailias has joined #ruby
* gen0cide_ loves ruby
<superman_ffm> Hi, how can I sum values in a Hash e.g. h = { a: 1, b: 2, c: 3, d: 4}
al3xnull has joined #ruby
ph^ has joined #ruby
<burgestrand> superman_ffm: { a: 1, b: 2, c: 3, d: 4}.reduce(0) { |m, (k, v)| m + v }
randym has joined #ruby
<seanstickle> superman_ffm: h.values.reduce(&:+)
<burgestrand> Ah yes, reduce allows you to specify the operator without a block too though
<burgestrand> { a: 1, b: 2, c: 3, d: 4}.values.reduce(:+)
<seanstickle> Nice
kmurph79 has joined #ruby
Husel has quit [#ruby]
fayimora has joined #ruby
baroquebobcat_ has joined #ruby
<superman_ffm> I try that in irb but nothing happend
<seanstickle> What happened?
<seanstickle> Nothing? Or something, but not what you expected?
<superman_ffm> noting
<superman_ffm> i have the hash : h = { a: 1, b: 2, c: 3, d: 4}
<RubyPanther> if "noting" happened, you didn't press enter yet
statarb3 has joined #ruby
statarb3 has joined #ruby
<superman_ffm> i pressed enter
otakutomo has joined #ruby
alexh_ has joined #ruby
<superman_ffm> is it for ruby 1.9
colint has joined #ruby
<RubyPanther> if you're in irb, and you type some stuff and press enter, something will happen.
<RubyPanther> that much I guar-an-tee
azureye has joined #ruby
<alexh_> hi, it seems that in a class method one can refer to a class instance variable with an @ or without. which is considered better practice?
<superman_ffm> i started a new irb and there works
<superman_ffm> :-
Sliker has joined #ruby
<seanstickle> alek_b_: when you are referring to it without the @, you are actually calling the getter/setter, not the instance variable.
<alexh_> ah… thx seanstickle
<seanstickle> alexh_: sure
<alexh_> btw, what's the diff between this channel (ruby) and ruby-lang?
<seanstickle> alexh_: politics
<alexh_> @seanstickle lol
<seanstickle> Not joking.
<alexh_> im a liberal so which should I go for :)?
cooper has joined #ruby
<seanstickle> I meant community politics
<seanstickle> Also, posting the same question to both at the same time is generally frowned upon. Just so you know. Someone else might call you out on that.
<alexh_> so should a newcomer just toss a coin between them?
<seanstickle> Yup.
<superman_ffm> where can I read more about values and how do I know that is reduce(&:+)
banisterfiend has joined #ruby
<seanstickle> superman_ffm: etc
ryanf has joined #ruby
jordanstephens has joined #ruby
stephenjudkins_ has joined #ruby
senthil has joined #ruby
wroathe has joined #ruby
conor_ireland has joined #ruby
<t-mart> Instead of calling myclass.new, I want people to call a class method of myclass to get instances. The problem is, since I'm not privatizing write methods to the instances variables, I can't make these generated instances the way I want to. How do people get around this?
<t-mart> since I am* privatizing
<seanstickle> Example
BrianE has joined #ruby
mikeric has joined #ruby
snip_it has joined #ruby
havenn has joined #ruby
nari has joined #ruby
dnyy has joined #ruby
dnyy has joined #ruby
<tayy> hi everyone.
<tayy> how do i calculate offset in seconds from two strings of %H:%M:%S?
<tayy> basically there's this server whose time is off by actual time by a few minutes
<tayy> and i want to calculate in seconds the offset
<seanstickle> Time.parse(a) - Time.parse(b)
<tayy> THANK YOU! :D
brngardner has joined #ruby
<tayy> i couldn't find the parse method on ruby-doc!
atheken has joined #ruby
<atheken> hi all, I have ruby-1.9.2-p180 installed via RVM. I've got a rails app with some generated views, the "new" JSON-ish hash syntax is not being recognized, switching to the hashrocket fixes things, any ideas why the "new" syntax isn't being recognized?
<seanstickle> atheken: example please
<superman_ffm> is there other way to write this: h1 = { a: 1, b: 2, c: 3, d: 4}
<superman_ffm> h2 = {e: 5}
<superman_ffm> h1.merge(h2)
<t-mart> h1[e] = 5
<seanstickle> superman_ffm: you just wrote it
<t-mart> you're just trying to add a key/value pair, right superman_ffm?
<superman_ffm> i thought there is something else, Yes you are right try do add some more hash
<t-mart> or h1[:e] = 5 (that there symbol)
<atheken> seanstickle: http://pastebin.com/PLiBrMqe
<seanstickle> atheken: the new syntax doesn't work with naked hashes