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/
Karmaon has joined #ruby
ccapndave has joined #ruby
jamw has joined #ruby
<ccapndave> Hey all - I am looking for a framework to test a REST server; I know I've seen a Ruby one before but can't find it anywhere. I want to do something like get "http://someservice/blah" and then do some asserts on the output (and be able to run the test suite). Any ideas?
mikeric has joined #ruby
<shadoi> ccapndave: capybara or just rack-test if you don't want the DSL
<mikeric> is there a selector for adjacent item "before" another item? for example, if i want the <li> element that is right before the <li class='active'> element.
Mac_ has joined #ruby
<shevy> mikeric perhaps with lookahead in regexes or something
<mikeric> so like "li + li.active { … }" but the other way around..
wyhaines has joined #ruby
mengu_ has joined #ruby
mengu_ has joined #ruby
<ccapndave> shadoi: Ta
patrick99e99 has joined #ruby
<patrick99e99> hi everyone.. I just updated my rubygems (gem update --system) and now I am getting two warnings
<patrick99e99> Invalid gemspec in [/Users/patrick/.rvm/gems/ruby-1.8.7-p334/specifications/tilt-1.3.3.gemspec]: invalid date format in specification: "2011-08-25 00:00:00.000000000Z"
fayimora has joined #ruby
<patrick99e99> ... I tried removing those gems, but i still get the warnings
<patrick99e99> do I need to delete the actual gemspec files
<patrick99e99> ?
apok_ has joined #ruby
<shevy> what gem version do you have now
<patrick99e99> 1.8.16
S1kx has joined #ruby
S1kx has joined #ruby
Indian has joined #ruby
<shevy> hmm
pleax has joined #ruby
havenn has joined #ruby
havenn has joined #ruby
bjensen has joined #ruby
zec- has joined #ruby
zec- has quit ["Leaving"]
HomeBrand has joined #ruby
al3xnull has joined #ruby
<startling> what's the best way to have alternate constructors in ruby? class methods?
pu22l3r has joined #ruby
<heftig> startling: you can redefine Foo.new; define other class methods; Foo.allocate will get you an uninitialized object of class Foo
<startling> heftig: thanks!
Murr_ has joined #ruby
Ttech has joined #ruby
<startling> can I call the parent class's implementation of method x from within the child class's method x?
<startling> where x is not `initialize`
speerfissure has joined #ruby
dagnachewa has joined #ruby
<heftig> startling: super
<startling> oh! super does the method it's in? I thought it just did initialize
<heftig> startling: without parameters, tries to call the parent method with the child method's parameters
<heftig> a super with parameters, even if it's super(), uses the parameters given
<startling> got it. thanks
<CannedCorn> guys how do you call a function with a block that was passed into a method if one was passed in
<CannedCorn> if it was passed in as say &block
<CannedCorn> i want to call another method with it, if there was one
<CannedCorn> any thoughts
<CannedCorn> do you just pass it in as an argument to the inner function
<CannedCorn> ?
ylluminate has joined #ruby
_|christian|_ has joined #ruby
eignerchris has joined #ruby
fridim_ has joined #ruby
guillaum has joined #ruby
ahlatimer has joined #ruby
ahlatimer has quit [#ruby]
asobrasil has quit [#ruby]
Murr_ has joined #ruby
<patrick99e99> so I had an object, and I wanted to reference it later on a different machine.. so I did File.open("file.rb", "w") { |f| f.write(my_obj) }
<patrick99e99> and then on the other machine, I did File.read("file.rb") and I get a string
<patrick99e99> how do I get it to actually turn that into an object
xiaotian has joined #ruby
apok has joined #ruby
<patrick99e99> anyone?
milkpost_ has joined #ruby
danishkhan has joined #ruby
apok_ has joined #ruby
<shevy> patrick99e99 what do you mean with object
jxpx777 has joined #ruby
tatsuya_o has joined #ruby
<shevy> with .write you just write
<shevy> use marshal if you need to dump binary streams
jxpx777_ has joined #ruby
<patrick99e99> I mean.. I did that, and the file is like #<OmniAuth::AuthHash credentials=#<Hashie::Mash expires=false token="AA....">
<patrick99e99> and when I do file.read, it's a string
<patrick99e99> instead of the actual OmniAuth hash object
<patrick99e99> shevy: is there another way I should do this
<heftig> CannedCorn: you just pass it on using &. def foo(&block); bar(&block); end
saurb has joined #ruby
<shevy> patrick99e99 hmm no idea really. I think with marshal it should work though
bigkm has joined #ruby
<heftig> patrick99e99: you need to use str = Marshal.dump(obj) to serialize it, and obj = Marshal.load(str) to unserialize it again
chimkan___ has joined #ruby
parzo has joined #ruby
<startling> how should I `require` a file that's in the current same directory as this other one?
Murr_ has joined #ruby
andrewhl has joined #ruby
<patrick99e99> heftig: ah. ok thanks
philcrissman has joined #ruby
philcrissman_ has joined #ruby
<patrick99e99> heftig: ok-- I am still having problems.. So I am now trying to do File.open("#{Rails.root}/omg.rb", "w") { |f| f.write(Marshal.dump(Post.first)) }
<patrick99e99> that fails with "Encoding::UndefinedConversionError: "\xF7" from ASCII-8BIT to UTF-8"
<frontendloader> I'm using activerecord without rails, and I'm not sure how to set up the table initially for a one-to-many relation, in the past I'd been coddled by rails migrations.
dark3rdre4ms has joined #ruby
dark3rdre4ms has joined #ruby
oposomme has joined #ruby
<frontendloader> school has many students, there's no :foreign_key data type to create a column of
<patrick99e99> heftig: are you alive?
<fayimora> I wan to write a script that help renew ma library books erry 22hrs .. would this be possible with ruby?
mikepack has joined #ruby
<startling> fayimora: sure, but I don't think the librarians will be convinced
<startling> `puts "I'd like to renew a library book."`
<fayimora> startling: lol why? Its nufin illegal..just need the script to go to a page, login and press a few buttons..lol
<linduxed> i need some help with input box checking
<linduxed> i need to make sure that the only things going into a certain input box are numbers
ivorybishop has joined #ruby
<linduxed> no letters or stuff like that
pu22l3r has joined #ruby
tommyvyo has joined #ruby
speerfissure has joined #ruby
Animawish has joined #ruby
Animawish has quit [#ruby]
nari has joined #ruby
speerfissure has joined #ruby
ivorybishop has joined #ruby
speerfissure has joined #ruby
briankbuckley has joined #ruby
ivorybishop has joined #ruby
tommyvyo has joined #ruby
speerfissure has joined #ruby
kevinbond has joined #ruby
ivorybishop has joined #ruby
adamjleonard has joined #ruby
speerfissure has joined #ruby
mrtheshadow has joined #ruby
gen0cide_ has joined #ruby
speerfissure has joined #ruby
gen0cide_ has joined #ruby
ivorybishop has joined #ruby
dagnachewa has joined #ruby
<dagnachewa> hi all
trend has joined #ruby
speerfissure has joined #ruby
ivorybishop has joined #ruby
havenn has joined #ruby
* dagnachewa guys is it me or ruby is loosing momentum ??? altough am just starting using ruby since I decided to build my app on it, once RoR losses it's edge, will ruby survive 5 years from know in the sense that will it support ture conccurency and get rid of the GIL ??
<startling> is there a way to mark a unit test as an expected failure?
speerfissure has joined #ruby
Murr_ has joined #ruby
ivorybishop has joined #ruby
<dagnachewa> I updated ruby to 1.9.3-p125 and how can I load all my gems for this ruby version ? when I do rvm use 1.9.3 it shows ruby-1.9.3-p0
<dagnachewa> I updated ruby to 1.9.3-p125 and how can I load all my gems for this ruby version ? when I do rvm use 1.9.3 it shows ruby-1.9.3-p0
speerfissure has joined #ruby
Seisatsu has joined #ruby
oposomme has joined #ruby
etehtsea has joined #ruby
Murr_ has joined #ruby
speerfissure has joined #ruby
pu22l3r has joined #ruby
vfxectropy has joined #ruby
pac1 has joined #ruby
stephenjudkins has joined #ruby
vfxectropy has quit [#ruby]
ivorybishop has joined #ruby
sterNiX has joined #ruby
johnmilton has joined #ruby
looopy has joined #ruby
speerfissure has joined #ruby
ivorybishop has joined #ruby
kevinbond has joined #ruby
tommyvyo has joined #ruby
dark3rdre4ms has joined #ruby
speerfissure has joined #ruby
badelat has joined #ruby
ivorybishop has joined #ruby
dagnachewa has joined #ruby
Hanmac1 has joined #ruby
sdwrage has joined #ruby
paissad has joined #ruby
speerfissure has joined #ruby
ivorybishop has joined #ruby
aers has joined #ruby
csprite has joined #ruby
speerfissure has joined #ruby
dhruvasagar has joined #ruby
ivorybishop has joined #ruby
cassarani has joined #ruby
mun has joined #ruby
<mun> hi
<mun> does anyone here have a mouse with a tilt wheel? mine already has a back and forward button and i don't know what i should map tilt left and right to. any suggestions?
scientes has joined #ruby
<scientes> is this channel logged?
<drizz> yes
<scientes> where?
speerfissure has joined #ruby
sterNiX has joined #ruby
alanp has joined #ruby
momo_ has joined #ruby
<scientes> that domain name doesn't even have working whois
<scientes> ....
ivorybishop has joined #ruby
<drizz> if you mean dns then yes - it does
badelat has joined #ruby
<scientes> DNS, but not whois data
porco has joined #ruby
jcromartie has joined #ruby
<scientes> thanks, found what I was looking for
fayimora_ has joined #ruby
<drizz> it does.
zulax has joined #ruby
speerfissure has joined #ruby
<jcromartie> sometimes Ruby makes me want to use my computer like an olympic discus thower
<scientes> ~$ whois cycle.io
<scientes> Domain "CYCLE.IO" - Not available
<scientes> For more information please go to http://www.nic.io/
<jcromartie> #<RangeError: bignum too big to convert into `long'> in FileUtils.mv
<jcromartie> apparently
<jcromartie> in chown
<jcromartie> how does that make any sense
<drizz> For more information please go to http://www.nic.io/
<scientes> ahh gotcha drizz
<drizz> :P
<scientes> im use to whois working
<scientes> i mean the command program
<scientes> maybe it needs a rule for the .io TLD
ivorybishop has joined #ruby
<drizz> nah, their whois server just responds like that
<drizz> mk@maero ~ % echo cycle.io | nc whois.nic.io 43
<drizz> Domain "CYCLE.IO" - Not available
<drizz> For more information please go to http://www.nic.io/
<deryl> isn't is just ape, ripe, and (i thought) apnic on a whois without naming a specific to use?
<jcromartie> "The options parameter is a hash of options, taken from the list :force, :noop, :preserve, and :verbose. :noop means that no changes are made. The other two are obvious. Each method documents the options that it honours."
<drizz> deryl: those are ip registrars
<jcromartie> MATH FAIL
<jcromartie> and NO METHOD uses the :preserve optino
<jcromartie> option
<drizz> jcromartie: yes, because documentation errors are that rare >_>
<jcromartie> and looking at the source of FileUtil::mv, it uses a fifth and undocumented option :secure
<jcromartie> drizz: maybe I expect too much
<drizz> oh, it's the stdlib?
speerfissure has joined #ruby
macmartine has joined #ruby
<jcromartie> yes
<drizz> then it is pretty silly, yes :x
adamjleonard has joined #ruby
ivorybishop has joined #ruby
<jcromartie> is monkey patch time nao
igotnolegs has joined #ruby
speerfissure has joined #ruby
waxjar has joined #ruby
blueadept has joined #ruby
ivorybishop has joined #ruby
<jcromartie> at least it's an option that kind of un-sucks it a bit
pu22l3r has joined #ruby
<jcromartie> hooray I fixed Ruby
randym has joined #ruby
speerfissure has joined #ruby
thecreators has joined #ruby
samsonjs_ has joined #ruby
chrxn has joined #ruby
speerfissure has joined #ruby
Rishi_ has joined #ruby
ivorybishop has joined #ruby
Eth4n has joined #ruby
Eth4n has joined #ruby
dv310p3r has joined #ruby
mxweas_ has joined #ruby
speerfissure has joined #ruby
luxurymode has joined #ruby
ivorybishop has joined #ruby
Nisstyre has joined #ruby
radic has joined #ruby
speerfissure has joined #ruby
randym has joined #ruby
nobitanobi has joined #ruby
dark3rdre4ms has joined #ruby
ivorybishop has joined #ruby
nobitanobi has joined #ruby
chrxn has joined #ruby
<nobitanobi> Let's say I have a URL like this: http://mysite.com/myscope/myaction -- What would be the most efficient way to get myscope out of that string?
<nobitanobi> so, the first thing that comes after http://mysite.com/
randym_ has joined #ruby
Indian has joined #ruby
albemuth has joined #ruby
speerfissure has joined #ruby
nobitanobi has joined #ruby
<waxjar> require 'uri'; x = URI.parse('http://etc'); x.path # => "/myscope/myaction"
<nobitanobi> waxjar: thanks
<waxjar> *URI('http://etc').path
<nobitanobi> let me check that
ivorybishop has joined #ruby
markt has joined #ruby
speerfissure has joined #ruby
mephux has joined #ruby
samsonjs has joined #ruby
nobitanobi has joined #ruby
Rishi_ has joined #ruby
speerfissure has joined #ruby
ivorybishop has joined #ruby
<johnmilton> well now
speerfissure has joined #ruby
philcrissman has joined #ruby
trend_ has joined #ruby
ivorybishop has joined #ruby
hooper_ has joined #ruby
paradisaeidae has joined #ruby
savage- has joined #ruby
y3llow has joined #ruby
andrewhl has joined #ruby
tdmackey has joined #ruby
mythmon has joined #ruby
decentrality has joined #ruby
speerfissure has joined #ruby
porco has joined #ruby
ivorybishop has joined #ruby
havenn has joined #ruby
cola_zero has joined #ruby
neurodrone has joined #ruby
neurodrone has joined #ruby
speerfissure has joined #ruby
ivorybishop has joined #ruby
denom has joined #ruby
rippa has joined #ruby
aBionic has joined #ruby
DrShoggoth has joined #ruby
trend_ has joined #ruby
speerfissure has joined #ruby
jjore has joined #ruby
swills has joined #ruby
Eth4n has joined #ruby
ivorybishop has joined #ruby
<jjore> I was looking at http://code.google.com/p/dart/issues/detail?id=34 and I wanted to ask a Q about why exactly it's a good thing to not have to type semi-colons on the ends of commands. Prior to doing Ruby, I had the impression that one of the nicer things to do to code was to start your continuation lines with your binary operators.
<jjore> This never works here though so at least as I've understood it, this has forced style to adopt what seemed like an ancient style of ending lines in operators because I have to inform the compiler that the statement isn't actually done yet.
speerfissure has joined #ruby
ivorybishop has joined #ruby
nobitanobi has joined #ruby
banister`sleep has joined #ruby
<jjore> So I'd generally have held something like http://pastie.org/3399114 as an excellent style to be preferred. What I haven't understood is why there is an assumption among some of the people on that thread that it is objectively better to not see statement terminators.
aers has joined #ruby
dark3rdre4ms has joined #ruby
minijupe has joined #ruby
speerfissure has joined #ruby
gen0cide_ has joined #ruby
ivorybishop has joined #ruby
guns has joined #ruby
nfluxx has joined #ruby
mxweas_ has joined #ruby
guillaum has joined #ruby
speerfissure has joined #ruby
looopy has joined #ruby
Murr_ has joined #ruby
gokul has joined #ruby
krz has joined #ruby
ivorybishop has joined #ruby
i8igmac has joined #ruby
maletor has joined #ruby
kp666 has joined #ruby
wmoxam has joined #ruby
speerfissure has joined #ruby
fizx has joined #ruby
rohit has joined #ruby
ivorybishop has joined #ruby
tommyvyo has joined #ruby
carlyle has joined #ruby
speerfissure has joined #ruby
kp666 has joined #ruby
Seisatsu has joined #ruby
ivorybishop has joined #ruby
porco has joined #ruby
randym has joined #ruby
mephux has joined #ruby
kevinbond has joined #ruby
a_a_g has joined #ruby
speerfissure has joined #ruby
<i8igmac> Im haveing a hard time with this thread
ivorybishop has joined #ruby
<i8igmac> its simple but one runs once's
hSATAC has joined #ruby
stephans has joined #ruby
<i8igmac> Thread.start{while; system("ping google.com -c 3"); end}
speerfissure has joined #ruby
ivorybishop has joined #ruby
jgrevich has joined #ruby
rickmasta has joined #ruby
speerfissure has joined #ruby
ivorybishop has joined #ruby
carlyle has joined #ruby
Asher has joined #ruby
indeterminate has joined #ruby
nfluxx has joined #ruby
randym has joined #ruby
speerfissure has joined #ruby
dark3rdre4ms has joined #ruby
ivorybishop has joined #ruby
akem has joined #ruby
akem has joined #ruby
bambanx has joined #ruby
<bambanx> hello
<bambanx> guys i am installed on my system ruby 1.8.7 and 1.9.2 how i can set the 1.9.2 version for use default?
<banistergalaxy> bambanx: use rvm
speerfissure has joined #ruby
<bambanx> thx banistergalaxy i use this command rvm use 1.9.2 but when i type ruby -v i get this ruby 1.8.7 (2011-06-30 patchlevel 352) [i686-linux]
ivorybishop has joined #ruby
<bambanx> is necessary uninstall 1.8.7 version?
<banistergalaxy> bambanx: read the documentation for rvm
<banistergalaxy> bambanx: about setting the default ruby, also checkout rvm.beginrescueend.com
<bambanx> thanks
chimkan_ has joined #ruby
speerfissure has joined #ruby
ivorybishop has joined #ruby
macmartine has joined #ruby
saurb has joined #ruby
speerfissure has joined #ruby
Asher1 has joined #ruby
ivorybishop has joined #ruby
tonini has joined #ruby
speerfissure has joined #ruby
ivorybishop has joined #ruby
gianlucadv has joined #ruby
speerfissure has joined #ruby
Seisatsu has joined #ruby
enherit has joined #ruby
ivorybishop has joined #ruby
shadoi has joined #ruby
havenn_ has joined #ruby
speerfissure has joined #ruby
GoBin has joined #ruby
oposomme has joined #ruby
mxweas_ has joined #ruby
ed_hz_ has joined #ruby
speerfissure has joined #ruby
oposomme has joined #ruby
chrxn has joined #ruby
banjara has joined #ruby
ivorybishop has joined #ruby
Karmaon has joined #ruby
x0F_ has joined #ruby
speerfissure has joined #ruby
djdb has joined #ruby
zomgbie has joined #ruby
speerfissure has joined #ruby
<ed_hz_> Hi gentlemen, I am trying to solve the Ruby Quizz #28, madlibs (http://www.rubyquiz.com/quiz28.html) , and I am running into an error in my regex (`sub!': can't convert nil into String (TypeError) I do not understand. I would also appreciate any correction on the style of my code to make if less C-ish and rubyish :) http://pastie.org/private/o7kmep3qbympowg30tbn9 Thank you !
ivorybishop has joined #ruby
drewrm has joined #ruby
speerfissure has joined #ruby
nim_ has joined #ruby
ivorybishop has joined #ruby
floomoon has joined #ruby
speerfissure has joined #ruby
oposomme has joined #ruby
ivorybishop has joined #ruby
matthias has joined #ruby
<csprite> can you use qtcreator to make guis for ruby?
yxhuvud has joined #ruby
phantomfakeBNC has joined #ruby
speerfissure has joined #ruby
mxweas_ has joined #ruby
ivorybishop has joined #ruby
thone has joined #ruby
Targen has joined #ruby
speerfissure has joined #ruby
oposomme has joined #ruby
ivorybishop has joined #ruby
punkrawkR has joined #ruby
speerfissure has joined #ruby
ivorybishop has joined #ruby
speerfissure has joined #ruby
eldariof has joined #ruby
ivorybishop has joined #ruby
replore has joined #ruby
speerfissure has joined #ruby
taipres has joined #ruby
banister_ has joined #ruby
ivorybishop has joined #ruby
samuel02 has joined #ruby
speerfissure has joined #ruby
nobitanobi has joined #ruby
speerfissure has joined #ruby
ivorybishop has joined #ruby
banistergalaxy has joined #ruby
acekiller has joined #ruby
a_a_g has joined #ruby
speerfissure has joined #ruby
ryndor has joined #ruby
marvin_ has joined #ruby
ivorybishop has joined #ruby
nim__ has joined #ruby
xpot-arcturus has joined #ruby
speerfissure has joined #ruby
JohnBat26 has joined #ruby
ivorybishop has joined #ruby
hukl has joined #ruby
speerfissure has joined #ruby
Azure has joined #ruby
senny has joined #ruby
ivorybishop has joined #ruby
thecreators has joined #ruby
robotmay has joined #ruby
arturaz has joined #ruby
speerfissure has joined #ruby
ivorybishop has joined #ruby
cHarNe2 has joined #ruby
pepone has joined #ruby
speerfissure has joined #ruby
ryan0x2 has joined #ruby
<pepone> Hi, i trying to build 1.9.3 on windows with Visual C++ 6, and it fails to link
<pepone> linking miniruby.exe unicows.lib(failure.obj) : fatal error LNK1103: debugging information corrupt; r ecompile module
<pepone> any ideas?
speerfissure has joined #ruby
gregorg has joined #ruby
gregorg has joined #ruby
ivorybishop has joined #ruby
<arturaz> pepone, can you use jruby? :)
<arturaz> oh, but you need 1.9.3
mafolz has joined #ruby
speerfissure has joined #ruby
amacgregor has joined #ruby
ivorybishop has joined #ruby
macmartine has joined #ruby
speerfissure has joined #ruby
LMolr has joined #ruby
stephenjudkins has joined #ruby
ivorybishop has joined #ruby
Morkel has joined #ruby
<cHarNe2> dominikh: hi, im having some troble with the time in cinch. i dont get how it works. you got an working example i can look at?
speerfissure has joined #ruby
ivorybishop has joined #ruby
Sliker has joined #ruby
bier has joined #ruby
stephenjudkins has joined #ruby
speerfissure has joined #ruby
csherin has joined #ruby
adamjleonard has joined #ruby
ivorybishop has joined #ruby
replore_ has joined #ruby
replore has joined #ruby
vitoravelino has joined #ruby
vitoravelino has joined #ruby
speerfissure has joined #ruby
ivorybishop has joined #ruby
ephemerian has joined #ruby
speerfissure has joined #ruby
Spockz` has joined #ruby
ivorybishop has joined #ruby
bjensen has joined #ruby
KL-7 has joined #ruby
speerfissure has joined #ruby
trivol has joined #ruby
banseljaj has joined #ruby
<banseljaj> Hi guys. How can I develop a gui using mono? What's the protocol? Am i supposed to use iron ruby or will normal ruby work?
Helius has joined #ruby
<arturaz> banseljaj, why would you want mono?
<arturaz> i mean you're using gtk one way or another
<arturaz> just use gtk-ruby bindings
ivorybishop has joined #ruby
<banseljaj> I don't know any other HUI toolkiit
<banseljaj> GUi
<banseljaj> And iwanted to visually design the interface
akemrir has joined #ruby
<banseljaj> arturaz: so, gtk-ruby will work?
<banseljaj> Is there an IDE for using gtk?
<arturaz> well gtk has glade
<arturaz> for gui design
speerfissure has joined #ruby
<arturaz> it generates xml which you can then load using any binding you want
<banseljaj> Nice.
<banseljaj> I should find a tutorial for that.
<banseljaj> thanks arturaz
<banseljaj> :)
<arturaz> np
<arturaz> i once written an app using gtk-perl bindings
<arturaz> fun times :D
ivorybishop has joined #ruby
<banseljaj> arturaz: How easy is it in use?
<arturaz> was pretty easy
Seisatsu has joined #ruby
speerfissure has joined #ruby
<banseljaj> arturaz: good. :0
banister_ has joined #ruby
RubyRobW has joined #ruby
<RubyRobW> Hello all!
speerfissure has joined #ruby
matthias2 has joined #ruby
<RubyRobW> I'm running Ubuntu 11.10 and have encountered some difficulties running rails and dev an app. I want to remove Ruby, Gem, RVM, Rails etc. and start from fresh. Can anyone help me?
vahnpaper has joined #ruby
<cHarNe2> RubyRobW: cant you just remove the packages?
<RubyRobW> how?
ivorybishop has joined #ruby
<banseljaj> RubyRobW: If you're using rvm, use "rvm implode"
<RubyRobW> ok tried that
<banseljaj> It will remove everything that rvm installed plus rvm
<banseljaj> Oh
<banseljaj> what's the output of "which ruby"?
<RubyRobW> so that should include ruby and rails
<banseljaj> RubyRobW: Ideally, it should
pi3r has joined #ruby
<RubyRobW> which ruby: /usr/bin/ruby
<RubyRobW> ruby -v: ruby 1.8.7
<RubyRobW> rails -v: 2.3.14
<banseljaj> RubyRobW: use synaptic.
speerfissure has joined #ruby
<banseljaj> unistall the ruby and rails packages
porco has joined #ruby
<RubyRobW> is there a more straight fowd Terminal line I can use?
nari has joined #ruby
<banseljaj> RubyRobW:"sudo apt-get remove ruby rails"
<RubyRobW> ok I can that, then ran ruby -v. response ruby 1.8.7
<RubyRobW> *ran that
<banseljaj> o.O
<banseljaj> RubyRobW: gist the outgput of the command
Asebolka has joined #ruby
<RubyRobW> ok sure, which command? sudo apt-get remove ruby rails ?
<banseljaj> yes
zommi has joined #ruby
mikewintermute has joined #ruby
speerfissure has joined #ruby
<RubyRobW> git://gist.github.com/1851919.git
<banseljaj> RubyRobW: http address.:)
<csprite> is there a visual gui editor for ruby?
ivorybishop has joined #ruby
davidpk has joined #ruby
speerfissure has joined #ruby
dross_ has joined #ruby
gregorg_taf has joined #ruby
Jelco has joined #ruby
Jelco has joined #ruby
<RubyRobW> banseljaj: any ideas?
<banseljaj> None. :\
<banseljaj> Try the "rvm reload shell"?
ivorybishop has joined #ruby
<Hanmac> RubyRobW: you only removed the ruby meta package, the interpreter is in ruby1.8
<banseljaj> Actually, yeah
porco has joined #ruby
<banseljaj> try "sudo apt-get autoremove"
<RubyRobW> sorry guys in a newbie
<RubyRobW> #I'm
<banseljaj> RubyRobW: We are all newbies at some stage.:)
nemesit has joined #ruby
<RubyRobW> lookd like it's successfully removing
<banseljaj> RubyRobW: \o/
<RubyRobW> Ok Ruby 1.8 has been removed, did ruby -v and I got ruby 1.9.2
speerfissure has joined #ruby
<RubyRobW> did rails -v. Response Rails is not installed
<banseljaj> try "sudo apt-get uninstall ruby1.9"
replore has joined #ruby
ivorybishop has joined #ruby
banseljaj has joined #ruby
gregorg_taf has joined #ruby
<RubyRobW> robwatt@robsvr:~$ sudo apt-get uninstall ruby1.9 E: Invalid operation uninstall
PhilK has joined #ruby
JohnBat26 has joined #ruby
probst has joined #ruby
tvw has joined #ruby
jlebrech has joined #ruby
speerfissure has joined #ruby
ivorybishop has joined #ruby
<RubyRobW> Ok well I'm happy to have Ruby 1.9.2. I'm trying to do this tut: http://rubysource.com/building-your-first-rails-application-models/ any suggestions? Rails has now been removed.
briankbuckley has joined #ruby
nerdy_ has joined #ruby
Gekz has joined #ruby
Gekz has joined #ruby
sspiff has joined #ruby
<sspiff> is there a still maintained alternative to rubyscript2exe?
speerfissure has joined #ruby
<RubyRobW> I'm using Ubuntu
<banisterfiend> sspiff: ocra
fayimora has joined #ruby
ivorybishop has joined #ruby
<sspiff> banisterfiend: tanks!
<sspiff> thanks**
robotmay has joined #ruby
rohit has joined #ruby
banseljaj has joined #ruby
cyri_ has joined #ruby
speerfissure has joined #ruby
<banseljaj> RubyRobW: Still here?
ivorybishop has joined #ruby
seitensei has joined #ruby
cHarNe2 has quit [#ruby]
speerfissure has joined #ruby
gen0cide_ has joined #ruby
ivorybishop has joined #ruby
tatsuya_o has joined #ruby
speerfissure has joined #ruby
cachemoney has joined #ruby
ivorybishop has joined #ruby
graft_ has joined #ruby
jbw_ has joined #ruby
fragmachine has joined #ruby
<fragmachine> is there a way to thread methods?
<fragmachine> so they go simultaneously
<Phlogistique> fragmachine: yes; see Thread
<fragmachine> ok
stayarrr has joined #ruby
speerfissure has joined #ruby
mikewintermute has joined #ruby
ivorybishop has joined #ruby
<fragmachine> when I make my array of methods I turn them into strings so they don't execute right away. How can i let Ruby know they are methods again when I try and call them from the thread?
bluOxigen has joined #ruby
speerfissure has joined #ruby
ikaros has joined #ruby
eldariof has joined #ruby
Asebolka has joined #ruby
ivorybishop has joined #ruby
ph^ has joined #ruby
berkes has joined #ruby
CacheMoney1 has joined #ruby
<banisterfiend> frontendloader: use send()
<fragmachine> awesome thanks banisterfiend
speerfissure has joined #ruby
Kambus has joined #ruby
evenix has joined #ruby
<evenix> hi all
ivorybishop has joined #ruby
a_a_g has joined #ruby
<evenix> anyone can help me with the following pastebin : http://pastebin.com/T1SXnX5b
<evenix> I've been trying to build an .rb file based on a test file in order to better understand how Test works
<evenix> but I've been having issues with the assignment. The following pastebin shows what I've been doing so far, if anyone can point me what I am doing wrong that would definitely help.
speerfissure has joined #ruby
ivorybishop has joined #ruby
yopp has joined #ruby
b6 has joined #ruby
speerfissure has joined #ruby
<banseljaj> evenix: Possibly not relevant, but i did find some spelling mistakes in line 36
tatsuya__ has joined #ruby
tatsuya_o has joined #ruby
<evenix> banseljaj: true thanks
ivorybishop has joined #ruby
alienvenom has joined #ruby
<banseljaj> Also, shouldn't that be PairTest? Might be relevant.
virunga has joined #ruby
<b6> can String scan parse stuff like http://pastie.org/3400242 ? i don't understand how to capture the lines in the sections.
trivol has joined #ruby
speerfissure has joined #ruby
norm has joined #ruby
<shevy> b6 you can use a regex
<shevy> if x is the string
<shevy> x.scan /#(.+)\n/ # => [[" section 0"], [" section 1"], [" section 2"]]
ivorybishop has joined #ruby
<evenix> banseljaj: not sure
<banseljaj> evenix: me niether
clockwize has joined #ruby
speerfissure has joined #ruby
ivorybishop has joined #ruby
davidpk has joined #ruby
QaDeS has joined #ruby
fayimora has joined #ruby
<evenix> banseljaj: http://pastebin.com/uLw60BbV here a new pastebin
tvo has joined #ruby
speerfissure has joined #ruby
probst has joined #ruby
marvin_ has joined #ruby
<banseljaj> evenix: still the same error?
marvin_ has joined #ruby
ivorybishop has joined #ruby
<banseljaj> evenix: You're calling Lexicon as a class, but i don't see any class named lexicon in your code.
<evenix> banseljaj: oh ok, because of "Pair = Lexicon::Pair" from the test i thought it was the class Pair under the module Lexicon
<banseljaj> That's correct. but you're still calling @@lexicon = Lexicon.new
<banseljaj> Lexicon is the module, not the class.
speerfissure has joined #ruby
<evenix> so THere is a module and a class
aers has joined #ruby
<evenix> banseljaj: how is this : http://pastebin.com/fsQyKiG6
josephwilk has joined #ruby
rohit has quit [#ruby]
trivol has joined #ruby
<banseljaj> No idea. does lexicon.rb contain your data?
Rounin has joined #ruby
BrianE has joined #ruby
banisterfiend has joined #ruby
InBar has joined #ruby
dibri has joined #ruby
speerfissure has joined #ruby
headius has joined #ruby
ivorybishop has joined #ruby
speerfissure has joined #ruby
cesarstafe has joined #ruby
GiambalaGiambala has joined #ruby
Talvino has joined #ruby
TheTFEF has joined #ruby
hukl has joined #ruby
speerfissure has joined #ruby
virunga has joined #ruby
ivorybishop has joined #ruby
cyx has joined #ruby
speerfissure has joined #ruby
cyx has quit [#ruby]
iocor has joined #ruby
ivorybishop has joined #ruby
speerfissure has joined #ruby
headius has joined #ruby
lampe2 has joined #ruby
rorymckinley2 has joined #ruby
<lampe2> hey i wanne write a lib in ruby is there a good template,framework or boilerplate out there?
<Phlogistique> lampe2: why would you need that?
<Phlogistique> write your functions/class/module in a file and that's it
QKO_ has joined #ruby
<lampe2> Phlogistique, sometimes there are some best practices for that ;)
<Phlogistique> Ruby is a pretty DRY language; you don't need boilerplate
speerfissure has joined #ruby
<Phlogistique> just put a ruby file in a git repo and worry about the rest when you'll have something useful
<banisterfiend> lampe2: a gem?
ivorybishop has joined #ruby
<banisterfiend> lampe2: answer
<shevy> lol
<lampe2> the thing is i wanne write a lib for reading and makeing xml objects ind the lom1.0 iee standard her the draft: http://ltsc.ieee.org/wg12/files/LOM_1484_12_1_v1_Final_Draft.pdf
<banisterfiend> lampe2: ok, put the file u want ppl to require in a lib/ folder
<banisterfiend> lampe2: put everything else inside lib/project_name/
<lampe2> okay banisterfiend
<banisterfiend> lampe2: and make sure you nest everything under a module that's named after your project
<banisterfiend> so all your classes are name spaced inside YourProject module
canton7 has joined #ruby
<banisterfiend> lampe2: you should also include a Gemfile and a .gemspec in your git repo
<lampe2> so something like lib/lomlib/lom.rb
<banisterfiend> lampe2: if u want them to require lom
<banisterfiend> then have lib/lom.rb
<banisterfiend> and put everything else inside lib/lom/*.rb
<lampe2> ahhha okay
<lampe2> thx banisterfiend
speerfissure has joined #ruby
<lampe2> okay thx ya all im afk ;)
davidpk has joined #ruby
|DM| has joined #ruby
runeb has joined #ruby
Helius has joined #ruby
dibri has joined #ruby
ivorybishop has joined #ruby
neurodrone has joined #ruby
neurodrone has joined #ruby
berserkr has joined #ruby
tuxdna has joined #ruby
speerfissure has joined #ruby
dibri has joined #ruby
speerfissure has joined #ruby
tk_ has joined #ruby
kaiwren has joined #ruby
eka has joined #ruby
dibri has joined #ruby
csherin has joined #ruby
fr0gprince_mac has joined #ruby
Gekz has joined #ruby
trivol has joined #ruby
fayimora has joined #ruby
sdwrage has joined #ruby
ccapndave has joined #ruby
ikaros has joined #ruby
jeekl has joined #ruby
eldariof has joined #ruby
senthil has joined #ruby
csherin has joined #ruby
dibri has joined #ruby
bluenemo has joined #ruby
Sliker has joined #ruby
skaczor has joined #ruby
<JonnieCache> lampe2: for when you get back, the `bundle gem` command creates a standard minimal gem structure if a gem is what you want to write
atmosx has joined #ruby
methodfree has joined #ruby
eldariof has joined #ruby
raluxgaza has joined #ruby
<JonnieCache> ahhh ruby 1.9.3-p125 can now be built with llvm/clang
<JonnieCache> so the new xcodeless command line developer tools package from apple can now build ruby properly
<JonnieCache> great news
<JonnieCache> no more 5 year old gcc necessary, at least for modern mri
<senthil> JonnieCache: I used to use this, but I've moved onto using bones
paissad has joined #ruby
<banister`sleep> JonnieCache: how to install it with rvm?
Silker has joined #ruby
<JonnieCache> banister`sleep: no idea. ruby-build the plugin for rbenv just released an update with defintions for 1.9.3-p125
snearch has joined #ruby
<JonnieCache> i assume if you rvm get head or whatever it will have support
tomzx has joined #ruby
MrGando has joined #ruby
KL-7 has joined #ruby
dibri has joined #ruby
<lampe2> thx JonnieCache
prs` has joined #ruby
fr0gprince_mac has joined #ruby
<prs`> when running unittests, is there a way to suppress output to stdout from the code that is being tested?
<banister`sleep> prs`: i usually design my tests so they dont output to stdout
<prs`> okay, but what if the code under test does output and its usefull in production, should I wrap the output in a check if the code is live or under test?
<prs`> seems like there should be an existing solution for this
lampe2 has quit ["Verlassend"]
lampe2 has joined #ruby
timonv1 has joined #ruby
frishi has joined #ruby
<JonnieCache> if youre using rspec you can have an around filter that redirects the $stout variable before each test and then sets it back afterwards
<JonnieCache> i assume other test frameworks have the same hooks
b6 has quit ["*"]
<prs`> might work, ill try
<prs`> JonnieCache: redirect to what? is there a ruby equivalent of /dev/null? or should i use a tempfile
<JonnieCache> no idea. nil maybe?
<JonnieCache> I think you can pass nil into the Logger contructor and that creates a logger which does nothing i have a vague memory of doing that
<prs`> okay, thanks
rfloriano has joined #ruby
emocake has joined #ruby
ccapndave has quit [#ruby]
sdwrage has joined #ruby
rorymckinley2 has quit ["Leaving"]
kf8a has joined #ruby
<prs`> worked, just needed to use StringIO istead of a logger class
hubub has joined #ruby
hubub has joined #ruby
hubub has joined #ruby
hubub has joined #ruby
emmanuelux has joined #ruby
emmanuelux has joined #ruby
wvdschel has joined #ruby
rfloriano has joined #ruby
<Tasser> how do I seek to element x in an iterator?
<Tasser> ehh, enumerator :-)
<JonnieCache> an ugly-ass while loop? ;)
<Tasser> #drop(x)
`brendan has joined #ruby
QaDeS has joined #ruby
<Tasser> Struct.new(:eod?).new(true) # is that evil?
gvt has joined #ruby
albemuth has joined #ruby
Sailias_ has joined #ruby
ctp has joined #ruby
prs` has quit ["ERC Version 5.3 (IRC client for Emacs)"]
lorandi has joined #ruby
ph^ has joined #ruby
<lampe2> hey i made a gem with "bundle gem <thename>" and now i wanne run the gem but ruby says that he cant find the version.rb if iq require it can some one help?
burgestrand has joined #ruby
jds has joined #ruby
<`brendan> morning
iouns has joined #ruby
SPYGAME has joined #ruby
<SPYGAME> is there any ruby library for infrared device programming/control, like an IR remote control ?
<Tasser> SPYGAME, wrap your own
<SPYGAME> Tasser, any recommendation ?
ryannielson has joined #ruby
<JonnieCache> depends on what kind of IR device
<JonnieCache> if its just a serial device then its easy to talk to the serial port in ruby as an IO object
senthil has joined #ruby
<SPYGAME> JonnieCache, consider it as a car remote lock/unlock device
<JonnieCache> i suggest getting an arduino or something and soldering on an infrared LED, and doing it all yourself in C
<JonnieCache> write a simple C wrapper on the chip that watches the serial pins and uses PWN to flash the LED based on commands
Dangr_ has joined #ruby
<JonnieCache> then use ruby to talk to the chip down the serial wire
<JonnieCache> *PWM
virunga has joined #ruby
Deele has joined #ruby
eregon has joined #ruby
Dangr_ has quit [#ruby]
patjoh has joined #ruby
warlock_handler has joined #ruby
<warlock_handler> hi
<warlock_handler> is there a ruby version of CMU Sphinx ? http://cmusphinx.sourceforge.net/
<adman65> how would you guys test an "abstract" class? I know ruby doesn't technically have abstract classes. But I have classes that leave implementation details to sub classes
<Tasser> adman65, test it via a subclass
gianlucadv has joined #ruby
_john has joined #ruby
<adman65> ya that's what I'm doing now. Running into mocking/stubbing hell lol
<Tasser> use more integration stuff
rohit has joined #ruby
sspiff has joined #ruby
<adman65> ya, that's my usual approach
<banister`sleep> Tasser: why is your github avatar a pic of u with a microphone? u were giving a speech somehwere? was it in german?
<warlock_handler> is there a ruby version of CMU Sphinx ? http://cmusphinx.sourceforge.net/
pen has joined #ruby
<adman65> Tasser: and using metaprogramming techniques make it more unweidly to test
<Tasser> banister`sleep, nah, euroku 2010 a short one about apeiros and his baretest (also called vaportest)
<Tasser> banister`sleep, and merboutpost makes good photos :-)
ABK has joined #ruby
De`off has joined #ruby
aeu has joined #ruby
rohit has joined #ruby
darthdeus has joined #ruby
rohit has joined #ruby
dv310p3r has joined #ruby
rohit has quit [#ruby]
bjensen has joined #ruby
patjoh has joined #ruby
marvin_ has joined #ruby
bjensen_ has joined #ruby
bga_ has joined #ruby
swills has joined #ruby
swills has joined #ruby
nanderoo has joined #ruby
<bga_> why ist not possible to write (lambda { p 1 })() but possible a = lambda { p 1 }
<bga_> ?
ph^ has joined #ruby
<bga_> seems ()() is syntaxically forbidded
<bga_> but ().() is ok
<bga_> :(
<bga_> ugly dot
enrox-bayou has joined #ruby
enroxorz-work has quit [#ruby]
<bga_> or i can ()[]
<bga_> but its not call, its substricy operator
<Tasser> bga_, [] is call
<bga_> in wierd ruby
<Tasser> wierd? why?
<bga_> in other langs [] is subscript
<bga_> but ok
GiambalaGiambala has joined #ruby
<banister`sleep> bga_: [] is not call it's just an alias for call for some objects, .() is call
<bga_> but
<bga_> p.(1)
<bga_> so for fn, created by def .() isnt work
etehtsea has joined #ruby
<banister`sleep> bga_: methods arent objects so they dont have a call
tommyvyo has joined #ruby
<bga_> any generic way to just call?
<bga_> or may be monkey patch?
<banister`sleep> bga_: if you mean a generic way to invoke both methods and other callables, no, because a method is not a 'callable'
<banister`sleep> bga_: but for callables you can always use .call() or .()
<bga_> method is NilClass?
<banister`sleep> bga_: method isnt related to classes/objects at all, they're just methods
pu22l3r has joined #ruby
<banister`sleep> i mean they're not instances of
<banister`sleep> they're related of course :)
Husel has joined #ruby
<Tasser> there's method(:method).call(:method)
patjoh has joined #ruby
<banister`sleep> or method(method_name).owner.instance_method(method_name).bind(method(method_name).owner).call
<Tasser> you forgot a ( somewhere
<banister`sleep> method(method_name).receiver even
<bga_> ok im trying to monkey patch NilClass
<bga_> add .call() or .()
dhodgkin has joined #ruby
fayimora_ has joined #ruby
<Phlogistique> bga_: uh, this doesn't sound like a great idea
bubby has joined #ruby
<Phlogistique> what do you want to do? you may want to use andand or ick
<bga_> i want uniform way
bubby has quit [#ruby]
<JonnieCache> i use andand but whats ick? some other monad?
senthil has joined #ruby
davidpk has joined #ruby
rfloriano has joined #ruby
<linduxed> my app has two pages: index (with a lot of input fields whose values are sent) and result (which only displays a total value)
<linduxed> i realized that it's overkill to have a full new page for this, so should this be handled by javascript intstead in some way?
<linduxed> ruby? coffeescript?
<linduxed> some rails magic?
<JonnieCache> javascript
<JonnieCache> and some rails magic ;)
<linduxed> oh ok
<JonnieCache> just make the form a remote form, and have it return some javascript that updates the page to display the result
<JonnieCache> for more help than that use google or ask in #rubyonrails
<linduxed> ok
bjensen has joined #ruby
ph^ has joined #ruby
Silker has joined #ruby
v0yager has joined #ruby
emocake has joined #ruby
briankbuckley has joined #ruby
emocake has joined #ruby
<burgestrand> linduxed: do it in its’ own page. You’ll be able to test it with rack::test (which is a helluvalot faster than doing it in selenium) and it’ll work without javascript as well.
<linduxed> i'm not sure i'm following you
mikewintermute has joined #ruby
nowthatsamatt has joined #ruby
<linduxed> burgestrand: the current implementation takes input data from the fields on index and then loads another page with the actual result
nowthatsamatt has quit [#ruby]
v0yager_ has joined #ruby
<burgestrand> linduxed: does not sound like overkill to me.
<linduxed> it seems a bit tedious to have to load a new page for such a simple thing as getting a number...
cantbecool has joined #ruby
<burgestrand> linduxed: why?
cantbecool has quit [#ruby]
<linduxed> burgestrand: because the page is very reminiscent of a calculator, so just adding some stuff up to get one number seems like an in-place-operation
BrianE has joined #ruby
<linduxed> click-result
<linduxed> maybe i'm overthinking it, but whatever
<linduxed> oh well actually...
<linduxed> later on it will make a lot more sense to have the result on a new page
<linduxed> yeah scratch that
wroathe has joined #ruby
<burgestrand> :)
<linduxed> when the result will be more complex than "Total value: 1500" then i guess a result page is nice to have
<wroathe> How would I go about preventing ruby from returning the collection after .each?
<burgestrand> wroathe: use another method than each
<burgestrand> wroathe: why do you want to prevent ruby from doing that?
<burgestrand> what do you want to return instead?
<wroathe> Because I'm iterating over a large collection and it's annoying to see it printed after every time I loop.
<wroathe> After every .each call I mean
<burgestrand> wroathe: you mean in IRB?
<burgestrand> … or pry :)
<wroathe> Yeah
csherin has joined #ruby
<wroathe> irb
crankycoder has joined #ruby
geekbri has joined #ruby
LMolr has joined #ruby
<burgestrand> wroathe: for pry, you can just add a semicolon to the end of the statements, I believe you can do the same in irb but with a nil after: [1, 2, 3].each { |i| p i }; nil
rfloriano has joined #ruby
jeekl has joined #ruby
jeekl has joined #ruby
td123 has joined #ruby
neurodrone has joined #ruby
neurodrone has joined #ruby
ph^ has joined #ruby
headius has joined #ruby
badelat has joined #ruby
Pluto6 has joined #ruby
fayimora_ has joined #ruby
<Pluto6> I know this is a Ruby programming channel but is there anyone here thats is familiar with assembly language? I have a relative easy question
<bga_> just ask
drknus has joined #ruby
mutewinter has joined #ruby
<Pluto6> http://pastebin.com/3rnPTeS4 code is there. I want to store r3 in a new letter for every loop, how should i write the code to be able to do that? just now it saves every new r3 in c
<Tasser> Pluto6, #asm ? ;-)
rippa has joined #ruby
pdelgallego has joined #ruby
linoj_ has joined #ruby
<Pluto6> also r# represents CPU, letter a,b,c... represents RAM
samuelj has joined #ruby
wmoxam has joined #ruby
csavola has joined #ruby
<pepone> Hi, i have build Ruby 1.9.3 on windows using VC++ 9 , and build my extension using the same compiler, now when try to load my extension i fails because MSVCP90.dll is missing, any ideas?
<samuelj> Hi all, as a learning exercise to fully get my head around Rack, I'm interested in knocking out a barebones web server. As simple as possible! Would you recommend using TCPSocket or TCPServer?
<bga_> banister`sleep class Object; def _call2(*args); p(self, args) end end; p._call2
<bga_> why self is nil for NilClass ?
CannedCorn has joined #ruby
<CannedCorn> whats a good way to to test whether the arguements to a function is either a single array of strings or an a series of [string, integer] array arguments
<bga_> ah i see
<bga_> :(
<bga_> NilClass is just nil singleton
<bga_> so i wonder why methods are NilClass
MrGando_ has joined #ruby
<bga_> global methods
<bga_> class methods - not
<samuelj> I think I'm going to use TCPServer because that's what Thin does, and it looks like it abstracts a lot of complexity away. Please let me know if you disagree with my choice!
rfloriano has joined #ruby
<Tasser> samuelj, just make sure the abstraction doesn't bite your ass
<samuelj> Tasser: Anything I should know? I'm happy with the concept of Sockets, and TCPServer I would assume just creates a Socket and listens?
crankycoder has joined #ruby
mkscrg has joined #ruby
<Tasser> samuelj, yeah, should do
<samuelj> sweet
davidpk has joined #ruby
Silker has joined #ruby
gilesw has quit [#ruby]
philcrissman has joined #ruby
asobrasil has joined #ruby
Xerife has joined #ruby
<Xerife> Hello
crankyco_ has joined #ruby
<Xerife> Can anyone tell me how to navigate in the stack frames when debugging ruby?
kpshek has joined #ruby
dv310p3r has joined #ruby
goyox86 has joined #ruby
crankycoder has joined #ruby
enherit has joined #ruby
carlyle has joined #ruby
Gekz has joined #ruby
fayimora has joined #ruby
headius has joined #ruby
Jackneill has joined #ruby
td123 has joined #ruby
yekta has joined #ruby
rfloriano has joined #ruby
jlebrech has joined #ruby
atlantaman has joined #ruby
denom has joined #ruby
crankyco_ has joined #ruby
<atlantaman> i have a ruby object and can inspect it and see the hashes, how can i iterate through the hashes? i tried @object.each and get an error
Silker has joined #ruby
crankycoder has joined #ruby
minijupe has joined #ruby
<Hanmac> atlantaman. no, only if the hash-value have an attr_acessor of attr_reader
jgarvey has joined #ruby
cook1es has joined #ruby
badelat has joined #ruby
<atlantaman> how can i cycle through the attributes?
luckman212 has joined #ruby
macmartine has joined #ruby
biomunky has joined #ruby
<rippa> atlantaman: what do you mean by attributes?
<senthil> alanp: Hash#each_pair?
<senthil> oops
<senthil> atlantaman: Hash#each_pair ?
<atlantaman> will give that a try
patjoh has joined #ruby
robbyoconnor has joined #ruby
robotmay has joined #ruby
r0bby has joined #ruby
dr_bob has joined #ruby
rfloriano has joined #ruby
ekaleido has joined #ruby
Prajjwal has joined #ruby
OnResolve has joined #ruby
samuelj has joined #ruby
swistak35 has joined #ruby
bbttxu_ has joined #ruby
<samuelj> If I'm fetching HTTP data from a Socket, should I be using recv? Should I be concerned about setting a maxlength? Is it better just to use an IO method?
Prajjwal has quit [#ruby]
OnResolve has joined #ruby
startling has joined #ruby
banseljaj has joined #ruby
<dr_bob> Why not use Net::HTTP, samuelj?
<samuelj> dr_bob: I'm trying to build an HTTP server to learn more about Rack, so Net::HTTP would kind of defeat the point :)
<samuelj> however, I will look to it for inspiration!
<dr_bob> Net::HTTP is a client
berserkr has joined #ruby
<samuelj> oh
<dr_bob> Why not test your homegrown server with a robust client?
<ekaleido> irb(main):001:0> Time.now.to_f
<ekaleido> => 1329491831.36331
<ekaleido> how do i convert that value back to a human readable format?
<samuelj> dr_bob: fine by me, but should I be concerned about the limits imposed by recv? Is it fast?
<dr_bob> Do not convert it to float but store the Time object
<dr_bob> samuelj: recv is connectionless IMHO, HTTP uses TCP and not UDP.
skim1776 has joined #ruby
<samuelj> ah I see. So I would be better fetching the information with an IO method?
<skim1776> hello there
<skim1776> is it possible to use regexp for testing whether the string consists of the same characters?
<dr_bob> samuel, use read ot gets
<samuelj> dr_bob: thanks!
Sailias has joined #ruby
<dr_bob> samuelj, with gets you can even pass a separator, for HTTP that would be "\r\n" AFAIK.
<samuelj> ah I see, I'm happier using gets anyway
<samuelj> thanks!
<ekaleido> i need to use the time as part of a key, but when i pull keys and make it human readable i need it to be a standard time format
uris has joined #ruby
<ekaleido> but i dont think storing the key with Time.now.utc, for example, would be easy to search against
<dr_bob> ekaleido: always use the proper type internally and only convert for input and output. Makes a lot of stuff much easier
patjoh has joined #ruby
waxjar has joined #ruby
bitrot has joined #ruby
andrewhl has joined #ruby
theRoUS has joined #ruby
theRoUS has joined #ruby
PaciFisT has joined #ruby
albemuth has joined #ruby
albemuth has joined #ruby
Knodi has joined #ruby
aldodelgado has joined #ruby
tommyvyo has joined #ruby
ed_hz__ has joined #ruby
danishkhan has joined #ruby
spanner has joined #ruby
TaTonka has joined #ruby
rfloriano has joined #ruby
ScottNYC has joined #ruby
tommyvyo has joined #ruby
atlantaman has quit [#ruby]
shevy2 has joined #ruby
adamjleonard has joined #ruby
nvez has joined #ruby
skim1776 has quit [#ruby]
john_doe_jr has joined #ruby
IAD has joined #ruby
wmoxam has joined #ruby
john_doe_jr has quit [#ruby]
gvt has joined #ruby
<samuelj> Hi again, my server keeps hanging when I try to call each or suchlike on an instance of Socket. I'm trying to avoid using recv, do I need to pass an additional separator to each or something?
nvez has joined #ruby
nvez has joined #ruby
atlantaman has joined #ruby
KL-7 has joined #ruby
Spockz has joined #ruby
axl_ has joined #ruby
nemesit|osx has joined #ruby
aers has joined #ruby
blischalk has joined #ruby
mikepack has joined #ruby
chimkan has joined #ruby
emocakes has joined #ruby
axl_ has joined #ruby
fayimora has joined #ruby
nari has joined #ruby
hacketeer has joined #ruby
skitrees has joined #ruby
imami has joined #ruby
nobitanobi has joined #ruby
rfloriano has joined #ruby
lampe2 has joined #ruby
iocor has joined #ruby
rflorianobr has joined #ruby
marvin_ has joined #ruby
gabeh_ has joined #ruby
caiges has joined #ruby
<startling> what's the best way to do partial application?
emocake has joined #ruby
<csavola> startling: partial application?
<philcrissman> startling: what is a partial application?
conor_ireland has joined #ruby
<lampe2> hey iam a little bit confused. i got a dir named lib/ and there is a ruby file called mylib.rb and this is a module. now i wanne require it in my main.rb. so i do: include lib/mylib.rb but this dont work
<startling> functional languages have it a lot. You have a function that takes, e.g two arguments and you return a function with one argument pre-supplied
<csavola> startling: a closure?
<startling> you can implement them with closures, yeah, but I thought there might be a better way
conor_ireland has joined #ruby
conor_ireland has joined #ruby
<startling> like, if I had a function `add` that takes two arguments, I could make a function `add2` that takes one argument and adds two to it
r0bby has joined #ruby
<shajen> is it possible in rails to use @q.result(:distinct => true).includes(:indices_quotations) and include only two last record (order by date)?
<philcrissman> startling: I'd have to look it up; my functional-fu is not strong. :-) But actually "returning a function" is not really done (per se) in ruby; you can return a Proc/lambda... which is _almost_ the same thing. You'd need to use .call on the returned Proc to invoke it.
<philcrissman> startling: also, I could be wrong.
<philcrissman> but from the closure/proc/lambda experiments I've done, that was my impression.
<startling> yeah, I'm confused by ruby functions. :x
briankbuckley has joined #ruby
r0bby_ has joined #ruby
<startling> it's weird that it's non-lazy but also that just writing them with no arguments calls them
emocake has joined #ruby
designated has joined #ruby
<csavola> startling: blocks in ruby are lazy
mxweas_ has joined #ruby
<startling> yeah, I guess I need to start thinking in terms of blocks
Jake232 has joined #ruby
<startling> what I've seen of them is really nice, though
zulax has joined #ruby
tuxdna has joined #ruby
Indian has joined #ruby
porco has joined #ruby
Silker has joined #ruby
jrist_ has joined #ruby
maletor has joined #ruby
<samuelj> can anyone give me any advice on http-parser? I can't get the gem http-parser.rb to install, so I'm trying to build it from source, and the gem build is failing because it can't find 'http/parser-version' - any ideas?
acekiller has joined #ruby
<banseljaj> Hi. I'm using rvm with glade to design the GI. I tried using the "glader" gem but it isn't generating a skeleton. Neither is ruby-glade-create-template.
coucher has joined #ruby
alx- has joined #ruby
jrist has joined #ruby
kenperkins has joined #ruby
<ekaleido> is there a way using Time to get a simple datestamp like 20110306
blueadept has joined #ruby
<banseljaj> ekaleido: strftime?
<ekaleido> ugh, of course
rflorianobr has joined #ruby
<ekaleido> thanks
ckrailo has joined #ruby
jgrevich has joined #ruby
<samuelj> Any recommendations for parsing HTTP requests? YAJL?
<acekiller> +
Deele has joined #ruby
SamWhited has joined #ruby
clockwize has joined #ruby
theRoUS has joined #ruby
theRoUS has joined #ruby
Nathandim has joined #ruby
wyhaines has joined #ruby
rflorianobr has joined #ruby
ph^ has joined #ruby
csprite has joined #ruby
lorandi has joined #ruby
zomgbie has joined #ruby
Indian has joined #ruby
kevinbond has joined #ruby
luxurymode has joined #ruby
rflorianobr has joined #ruby
havenn has joined #ruby
darchitect has quit ["Saliendo"]
clockwize has joined #ruby
rfloriano_ has joined #ruby
icrazyhack has joined #ruby
<lampe2> hey i made my own gem and now i wanne test it rvm says that it is in the bundle list and i require it in my test file but ruby says it cant find the gem...
CacheMoney1 has joined #ruby
<banseljaj> lampe2: That's because bundel tries to get it from rubygems.org
porco has joined #ruby
`brendan has joined #ruby
<lampe2> banseljaj, but bundle list says its there
<jlebrech> how do I delimit a regex into a string?
canton7 has joined #ruby
mtkd has joined #ruby
<banseljaj> what does "bundel show [gemname]" say?
<lampe2> banseljaj, the path to the folder where the gem is
Barakas has joined #ruby
zomgbie has joined #ruby
<banseljaj> lampe2: don't know then. copy the gem file to vendor/cache?
<banseljaj> or try bundle package?
ed_hz_ has joined #ruby
<lampe2> the error is:`include': wrong argument type String ! but there is no include anymore...
<jlebrech> sorry, i don't need a string
jds has joined #ruby
alfism has joined #ruby
<banseljaj> lampe2: can you gist the code?
<lampe2> okay i removed it from the gem list
<lampe2> so now he cant find the lib
Jay_Levitt has joined #ruby
matthias2 has joined #ruby
prakr has joined #ruby
<mikewintermute> What does this regex mean: /^\d{3}-\d{3}-\d{4}/
rfloriano has joined #ruby
eywu has joined #ruby
<lampe2> mikewintermute, http://rubular.com/
<mikewintermute> aha - thanks
<geekbri> mikewintermute: looks like a phone number to me
<mikewintermute> geekbri: yes
<samuelj> Hey everyone, I think I'm being really dumb, but I can't figure out why my super simple server won't work. http://pastie.org/3402472 - It's easily testable by starting the process then visiting localhost:3000 in a browser. For some reason, lines 12 - 14 hang, it's like the condition isn't detecting that the input is finished. I'd really appreciate any help you guys can give. Thanks!
dcarper has joined #ruby
mxweas_ has joined #ruby
<mikewintermute> samuelj: works for me.
<samuelj> mikewintermute: it isn't hanging?
<samuelj> and it's serving "hi" ?
<mikewintermute> telnet localhost 3000
<mikewintermute> then tap some stuff
<mikewintermute> it's just going around in the while … end loop
<mikewintermute> won't ever get to the client.puts line
mrtheshadow has joined #ruby
matthias3 has joined #ruby
<eeadc> mikewintermute: the socket is blocking
<eeadc> so you have to implement some event loop to detect events on sockets
<samuelj> mikewintermute: Why not? Shouldn't gets fail if it's a newline?
<mikewintermute> dunno - i'm just saying what i see. spits out stuff on one terminal if i input it on the other.
arvindravi has joined #ruby
gvt has joined #ruby
<samuelj> mikewintermute: eeadc: what about this revision? http://pastie.org/3402472 - I want it to break the loop when there's nothing more to be read!
<samuelj> Can you point me in the right direction?
baroquebobcat has joined #ruby
<mikewintermute> hmm. not responding to Ctrl D.
<ekaleido> isnt requiring rubygems frowned upon?
<samuelj> ok, so i'm not using bundler
fayimora_ has joined #ruby
cbuxton has joined #ruby
<csavola> ekaleido: Pretty sure it is only in 1.9 that you don't need to require it
jacktrick has joined #ruby
ed_hz_ has joined #ruby
<ekaleido> oh, ok
daniel_hinojosa has joined #ruby
<csavola> ekaleido: or maybe it was back ported. It works in 1.8.2-p352
<csavola> * 1.8.7 not 1.8.2
dnyy has joined #ruby
wmoxam has joined #ruby
andrewhl has joined #ruby
<lampe2> good damn i got it... i forget a self. ...
maletor has joined #ruby
skaczor has joined #ruby
banseljaj has joined #ruby
<JonnieCache> damn, ftp.ruby-lang.org is sloooow. i guess everyone in the world is downloading the new 1.9.3
<td123> JonnieCache: I had the same experience :P
<JonnieCache> they should just use github
<td123> there is a ruby mirror on github
<mikewintermute> samuelj: try this: http://pastie.org/3402619
colint has joined #ruby
dnjaramba has joined #ruby
<JonnieCache> td123: yes but the various ruby building scripts all point to ruby-lang.org :(
<td123> JonnieCache: ya, that's the "official" source
<td123> would be nice if official ruby switched to github :)
<mikewintermute> samuelj: don't think eof works on a stream
sawjig has joined #ruby
lateau_ has joined #ruby
nvez has joined #ruby
kidoz has joined #ruby
crankyco_ has joined #ruby
cesarstafe has joined #ruby
SegFaultAX|work has joined #ruby
iocor has joined #ruby
_2easy has joined #ruby
savage- has joined #ruby
<samuelj> mikewintermute: I've been trying variants on that for ages! No look whatsoever
<samuelj> *luck
diegok has joined #ruby
pdtpatr1ck has joined #ruby
savage- has joined #ruby
cloke has joined #ruby
trend_ has joined #ruby
R3dy has joined #ruby
<samuelj> Working on a new approach, however, can someone tell me why I can't call recvmsg on an instance of TCPSocket?
<R3dy> How do I take a string variable that contains "<div>UserID&nbsp;</div>" and output only 'UserID'
<shevy> R3dy can you give a second example
crankycoder has joined #ruby
<R3dy> <div>Login&nbsp;</div>
lateau_ has joined #ruby
patrick99e99 has joined #ruby
<canton7> R3dy, is the space always present? How about the div tags?
<R3dy> I basically want to strip out <div>&nbsp;</div>
<R3dy> yes
<R3dy> they will al ways be of that format
macmartine has joined #ruby
QKO has joined #ruby
hooper has joined #ruby
<lampe2> is there a ruby method to format a string into a valid url ? when someone only do: www.example.com but the method wants the http:// too
<canton7> R3dy, my_string[/<div>(.+)&nbsp;<\/div>/, 1] would be the most explicit, probably
<shevy> yeah I think it will be easiest with a regex
<R3dy> canton7: perfect!
<R3dy> thank you :D
<rippa> lampe2: you can add "http://" yourself
_bga has joined #ruby
RubyRobW has joined #ruby
<RubyRobW> Hello
<lampe2> rippa, i can but this is a api for 3rd person so that he dont must think if he must do with or without http
voodoofish430 has joined #ruby
ests has joined #ruby
bjensen has quit [#ruby]
<RubyRobW> I have a question I hope someone can answer...
<rippa> lampe2: check if string has http:// , add if it does not
<shevy> x = "your string"; x[0,0] = 'http://' unless x[0,'http://'.size'] == 'http://'
<rippa> thing is, parser has no way of knowing if it's http
<lampe2> rippa, this is what iam doing right now ;) but i thought maybe ruby can
<rippa> it could be ftp://www.example.com
robotmay has joined #ruby
<rippa> you should say it it's http
<shevy> yeah you have to decide one way or the other anyway
<lampe2> rippa, yeah i got a validate_url method
<canton7> shevy, would "unless x.start_with?("htp://")" be better?
<RubyRobW> I was running rails earlier (finally got it working!) Rails 3, Ruby 1.9.3 and then I close Terminal (Linux). When I re-opened Terminal and the directory "cd shorty", Rails seems to be no longer installed and the version of Ruby is 1.8. Any ideas?
QKO has joined #ruby
<rippa> start_with? is 1.9.3 though, i think
<canton7> RubyRobW, how did you install ruby 1.9? rvm?
<canton7> rippa, aah, ok. thanks
<RubyRobW> yes
mk03 has joined #ruby
<canton7> rippa, hrm, it's in the 1.8.7 docs
<RubyRobW> RVM 1.10.2
<rippa> oh well
<rippa> must've mixed it up with omething
crankycoder has joined #ruby
<ests> RubyRobW: RVM rubies have different gemsets
<RubyRobW> I think I'm in the system ruby instead of RVM Ruby?
<shevy> canton7 probably. I was not sure if that method exists... I tend to carry shitloads methods in class String in my personal code here, so I get confused what is part of std ruby and what is not
briankbuckley has joined #ruby
<ests> RubyRobW: $ rvm list
<lampe2> if !(url.start_with? 'http://')url = 'http://' + url
<shevy> in projects I try to release for others to use too, I try to use as little as possible from my own stuff :)
<canton7> shevy, ah, gotcha
<RubyRobW> ests: yes..
<shevy> RubyRobW I think it would be easier to just use one ruby
<RubyRobW> how do I access RVM Ruby?
<canton7> lampe2, url[0,0] = "http://" unless url.start_with?("http://") would be better methinks
Sliker has joined #ruby
<shevy> no real clue about RVM, sorry
<ests> RubyRobW: set 193. as default: $ rvm use 1.9.3 --default
siksia has joined #ruby
<shevy> but I can tell you how I do it. right now, my ruby 1.8.x is installed into /usr prefix. And the latest 1.9.3 is under /Programs/Ruby/1.9.3something and waits until I managed to change
zulax has joined #ruby
<shevy> or switch to it, rather
<ests> RubyRobW: or make use of rvmrc http://beginrescueend.com/workflow/rvmrc/
<RubyRobW> Thanks ests!! That worked!
<ests> yw
<RubyRobW> I love how helpful everyone is here... wish the world had the mindset. #betterplace
adamkittelson has joined #ruby
<RubyRobW> anyone familiar with running the "rails server" command?
<ests> what's wrong?
icrazyhack has joined #ruby
Helius has joined #ruby
<RubyRobW> I've run "rails server" - the output is above in the gist link
<ests> I have similar output
<RubyRobW> Now I must use Rails generators to generate the Class and Migration
<CannedCorn> hey guys, what's a good way to to test whether the arguements to a function is either a single array of strings or an a series of [string, integer] array arguments?
<ests> didn't checke that yet, but I think it's normal in dev env
<RubyRobW> rails generate model Url url:string
<RubyRobW> that's the next command
badabim has joined #ruby
<RubyRobW> do I just type it below the output from "rails server"?
<canton7> CannedCorn, I'd go for "args[0].is_a?(Array)" or so
mrsolo has joined #ruby
<ests> RubyRobW: have you finished reading this: http://ruby.railstutorial.org/ruby-on-rails-tutorial-book ?
marvin_ has joined #ruby
cassarani has joined #ruby
<philcrissman> RubyRobW: you don't want to start the server until your app is ready to run...
atmosx has joined #ruby
<RubyRobW> Thanks ests! Haven't seen that doc before
gvt has joined #ruby
<RubyRobW> philcrissman: I'm doing a tut - here's the link: http://rubysource.com/building-your-first-rails-application-models/
<RubyRobW> I'm halfway down the page at "Creating Your First Model"
carlyle has joined #ruby
bluenemo has joined #ruby
<ests> RubyRobW: I think you can skip that rubysource article for now, it's nice but the book will make you groke
<philcrissman> RubyRobW: so... rails server should have run without errors. But yeah, if you want to go on, you'll want to stop the server with ctrl-C
gabeh_ has joined #ruby
nfluxx has joined #ruby
<philcrissman> RubyRobW: I'd agree with ests, spend the time and go through something like the railstutorial
<RubyRobW> phil: sp "ctrl-C" then run the command?
ged has joined #ruby
<RubyRobW> *so
<philcrissman> RubyRobW: if the server is still running, you'll need to stop it, yes.
<philcrissman> You can't run commands while the server is running. Unless you open another terminal window
Araxia has joined #ruby
<JonnieCache> do you really need to stop the server? you can just leave it running and open another tab in your terminal...
gvt has joined #ruby
lkba has joined #ruby
<JonnieCache> you rarely need to restart the server
Russell^^ has joined #ruby
<philcrissman> JonnieCache: yeah, of course. But he's getting errors running the server in the first place. Probably should get that figured out.
<philcrissman> RubyRobW: I'd really recommend using a different resource to learn. Railstutorial is good. So is Rails 3 in Action, or Agile Web Development with Rails.
<samuelj> Hey guys, I need a bit of stylistic advice. I have this code: http://pastie.org/3402894 but before I execute the block, I want to do something with the first line. In c, I'd just use the equivalent of gets first, then repeatedly in the block. How can I do the same with a ruby String?
dcarper has joined #ruby
gvt has joined #ruby
<philcrissman> ahh
<philcrissman> gotcha. I guess I've never seen it.
nfluxx has joined #ruby
shadoi has joined #ruby
xec has joined #ruby
<RubyRobW> thanks for your help - opened a new Terminal tab and ran the command, continuing with the tut - will be getting to grips with the links y'all sent tomorrow :)
nfluxx has joined #ruby
<ests> samuelj: er.. what do you want to do with first line?
<samuelj> I just want to fetch it first, because that block is soon going to be expanded to apply some processing to every other line ests
dhruvasagar has joined #ruby
<ests> RubyRobW: good luck with you path to Enlightenment (if you feel you can need it http://rubykoans.com/)
<RubyRobW> ests - always welcome help! I'm such a newbie!
sythe has joined #ruby
sythe has joined #ruby
crankyco_ has joined #ruby
<samuelj> ests: do you have any suggestions? I'm about to implement a counter
stephenjudkins has joined #ruby
looopy has joined #ruby
krz has joined #ruby
demian`__ has joined #ruby
<ests> samuelj: not me
demian`_ has joined #ruby
nfluxx has joined #ruby
18WABOI3G has joined #ruby
crankycoder has joined #ruby
statarb3 has joined #ruby
statarb3 has joined #ruby
samsonjs has joined #ruby
emanu has joined #ruby
senthil has joined #ruby
a_a_g has joined #ruby
<emanu> so I want to write a script that runs a rake database task in rails. I'm using: output = %x["rake db:migrate 2>&1"] and then puts-ing the output. The thing with this is that the command runs and there's no output until I puts what's in the variable. Is there a way to put the output onto the console while capturing it in that variable?
<emanu> does that make sense?
kpshek has joined #ruby
gvt has joined #ruby
ninor has joined #ruby
tatsuya_o has joined #ruby
nfluxx_ has joined #ruby
fridim_ has joined #ruby
zulax has joined #ruby
nowthatsamatt has joined #ruby
berserkr has joined #ruby
rfloriano has joined #ruby
nowthatsamatt has quit [#ruby]
<matled> emanu: the simplest way I can think of is using | tee #{tempfile.path} and then reading the output from the tempfile
<gen0cide_> the sh command in rake does that
<matled> emanu: but you could also fork manually, use a pipe to pass the output back to the original process, and write it to the terminal
<gen0cide_> in rake - backticks won't output term output of command but the sh command will - if you want a use case
<gen0cide_> task :test do
<gen0cide_> `date`
<gen0cide_> sh 'uname -a'
<gen0cide_> end
<gen0cide_> or ls -l or any other terminal command
apok has joined #ruby
<emanu> matled: hrmm, tee sounds like an interesting idea
johndbritton has joined #ruby
<matled> I don't know about the sh method of rake. maybe it does all that already
<emanu> gen0cide_: I don't have rake in this gem though (for various reasons)…
<gen0cide_> What do you mean?
jrodicus has joined #ruby
<gen0cide_> It seems like the wrong architecture to be calling rake tasks as a shell function instead of building them around a centralized repository of tasks - aka rake
<ests> matled: #sh is just Ruby, no Rake method
nfluxx has joined #ruby
<ests> or wait...
<gen0cide_> I don't believe it is ests
<gen0cide_> it's part of rake
nd____ has joined #ruby
<ests> ye, sorry, its part of Rake FileUtils
<gen0cide_> If you're going to be automating rake tasks, build it inside rake itself as another task with task deps - it will output the output of those task deps
<gen0cide_> if you're using Rails v3.x
<gen0cide_> lib/tasks/sometask.rake
Guest79953 has joined #ruby
lateau_ has joined #ruby
ph^ has joined #ruby
y3llow has joined #ruby
<csprite> chingu is nice
bananas has joined #ruby
<JonnieCache> right time to go and write some beatz. soon i will be one hour closer to being this fuckin guy http://www.youtube.com/watch?v=wXRnbS6o64U
<JonnieCache> have a nice weekend all
bhunt has joined #ruby
fayimora has joined #ruby
Sailias has joined #ruby
<ests> lol ^
nixmaniack has joined #ruby
nricciar__ has joined #ruby
lateau_ has joined #ruby
clockwize has joined #ruby
designated has joined #ruby
mahlon has joined #ruby
dnyy has joined #ruby
tvo has joined #ruby
jrodicus has joined #ruby
Sliker has joined #ruby
r0bby_ has joined #ruby
diago has joined #ruby
<diago> hello, I am working on some unit tests and have a need to override an initialize method to remove the database dependency from the method. How would I go about doing this?
havenn has joined #ruby
rushed has joined #ruby
kf8a has joined #ruby
ephemerian has joined #ruby
nixmaniack has joined #ruby
speerfissure has joined #ruby
linoj__ has joined #ruby
ed_hz_ has joined #ruby
gvt has joined #ruby
<philcrissman> diago: one way would be to open up the class just above the test and override the initialize method there... not sure the details of what you're working with.
fayimora has joined #ruby
<diago> philcrissman: I'm trying that now actually, it looks like that will do what I need. Thanks!
minijupe has joined #ruby
<philcrissman> diago: that's definitely the simplest way. It depends. :)
<ests> philcrissman: wouldn't stub be a better way?
banseljaj has joined #ruby
<diago> I am a testing noob so any advice would be welcome
<philcrissman> ests: it depends. I don't know what test framework diago is using.
<philcrissman> ests: possibly! :)
<diago> minitest
<diago> when you say stub, do you mean create fake db objects?
<philcrissman> I don't remember off the top of my head if that has stubbing built in.
<diago> It has a small mock lib
<philcrissman> ests: I think it depends what you're trying to do. In some cases it might be easier to override the actual method; if you just stub it, then you'd also need to stub any other variables that might be set in initialize.
skaczor has joined #ruby
fridim_ has joined #ruby
<diago> an override will work here, but I still need to create fake db objects for the other methods to do their deal
<ests> yes, but this would be sign of not so nice initialize method
<diago> The class builds a navigation <ul><li> and so on from db pages
moshee has joined #ruby
moshee has joined #ruby
zakwilson_ has joined #ruby
tvw has joined #ruby
MrGando has joined #ruby
ceej has joined #ruby
Jrz has joined #ruby
hck has joined #ruby
<_bga> is it possible to make class w/ binding to closure?
<jcromartie> puts "hi".inspect.inspect.inspect.inspect.inspect.inspect
Sliker has joined #ruby
<_bga> a = 1; class Foo; def _a(); return a += 1 end end
kirun has joined #ruby
<_bga> Foo.new()._a
<_bga> ruby report that a is undefined
<Mon_Ouie> You can use define_method
<Mon_Ouie> as you pass a block to define a method, that block has access to the local scope
colint has joined #ruby
<rippa> jcromartie: puts 10.times.inject("hi") {|m| m.send(:inspect)}
hobodave has joined #ruby
<jcromartie> rippa: I like it
skitrees has joined #ruby
<rippa> count on me when you need to code somethign useless
<jcromartie> will do, boss
danslo has joined #ruby
cloke has joined #ruby
<_bga> Mon_Ouie a = 1; class Foo; define_method(:_foo) { p(a += 1) } end
<_bga> NoMethodError: undefined method `+' for nil:NilClass
<_bga> :(
<_bga> also define_method isnt available from instance_eval
bhunt has joined #ruby
<_bga> ruby 1.9.3p0 (2011-10-30) [i386-mingw32]
<TheTFEF> Dongs
<_bga> may be i need higher version?
TheTFEF has joined #ruby
TheTFEF has joined #ruby
nixmaniack has joined #ruby
<rippa> _bga: Foo.send(:define_method, :_foo) {block}
jds has joined #ruby
robbyoconnor has joined #ruby
tommyvyo has joined #ruby
<_bga> rippa now work. thanks
TheTFEF has joined #ruby
kidoz has joined #ruby
ctp has joined #ruby
lateau_1 has joined #ruby
cyri_ has joined #ruby
lateau_ has joined #ruby
speerfissure has joined #ruby
Censored has joined #ruby
Helius has joined #ruby
briankbuckley has joined #ruby
mutewinter has joined #ruby
cloke has joined #ruby
coucher has joined #ruby
syamajala has joined #ruby
Foxandxss has joined #ruby
lateau_ has joined #ruby
Phibs has joined #ruby
<Phibs> CentOS6, Ruby 1.9, binary or src rpm, anyone ?
<la_pedycti> Phibs: use rvM?
<Phibs> was thinking that yes
<la_pedycti> rvm is much better than installing manually via yum
<la_pedycti> Phibs: I use it with my fedora 11, and it saves me a lot of hassle
<Phibs> sadly it's for production though
<Phibs> and i'd like to reproduce w/ automatino at scale
<Phibs> automation too
<la_pedycti> All it'll take is a tiny script to automate everything.
xsdg has joined #ruby
<Phibs> yeh
<td123> Phibs: time to learn rpm? :) (I personally hate it, but I'm not an admin :P)
<Phibs> td123: I know rpm but packaging it up is m ore effort than I want to spend ;0
<Phibs> the maintainer of centos hasn't even packaged it
ph^ has joined #ruby
<td123> ah ok, ya, this is why i hate rpm :P
mshibanami has joined #ruby
<Phibs> :)
<td123> even a seemingly small job is too complex
<Phibs> indeed not a huge fan myself
gvt has joined #ruby
<td123> Phibs: all I could come up with were blogs telling you how to install from source :/
<Phibs> ;)
<td123> Phibs: oh, is ruby 1.9.2 ok?
Axsuul has joined #ruby
<td123> or do you need 1.9.3?
<td123> cause I just found https://github.com/imeyer/ruby-1.9.2-rpm
<Phibs> I found a 1.9.3 spec
Axsuul has joined #ruby
<Phibs> we'll see if it works
Axsuul has joined #ruby
Axsuul has joined #ruby
Sliker has joined #ruby
Axsuul has joined #ruby
Axsuul has joined #ruby
johnn has joined #ruby
chrxn has joined #ruby
Axsuul has joined #ruby
crankyco_ has joined #ruby
snearch has joined #ruby
csherin has joined #ruby
<johnn> Is anyone familiar with DataMapper or even ActiveRecord? I want to build a model with arbitrary properties/attributes (I'm loading in a pretty huge CSV file, and basically stripped the column headers and have them stored as keys)
looopy has joined #ruby
<johnn> its plain Ruby not the Rails env
tayy has joined #ruby
caiges_ has joined #ruby
crankyco_ has joined #ruby
tommyvyo has joined #ruby
emocake has joined #ruby
iocor has joined #ruby
remink has joined #ruby
<td123> Phibs: just have a random question, does centos or other rpm distros have a site for user contributed rpms?
<Phibs> yes
<Phibs> Wrote: /root/rpmbuild/RPMS/x86_64/ruby-1.9.3p0-2.el6.x86_64.rpm
<td123> I meant, like a website
werdnativ has joined #ruby
<werdnativ> Why is this workaround still necessary? https://raw.github.com/gist/1333785 Why aren't these gem versions (from October) published on rubygems yet?
<Phibs> hater
Gekz has joined #ruby
Gekz has joined #ruby
tayy has joined #ruby
<werdnativ> me? sorry if that sounded unfriendly… just asking!
<werdnativ> there might well be good reasons…
<shevy> I think rubygems is dying
oposomme has joined #ruby
<werdnativ> new hotness?
<Phibs> haha
seanstickle has joined #ruby
<shevy> werdnativ github is the new hotness indeed
icrazyhack has joined #ruby
carlyle has joined #ruby
<werdnativ> is github publishing gems again!?
cashman has joined #ruby
<werdnativ> I thought they quit that business a few years back.
tatsuya_o has joined #ruby
<werdnativ> or you mean bundler with :git => 'url' ?
<shevy> hmm
llaskin has joined #ruby
<llaskin> hi can anyone help me with this question? http://pastie.org/3403861
<shevy> ohhh
<shevy> sorry
ryannielson has quit [#ruby]
<shevy> I meant to say *rubyforge, not rubygems
<werdnativ> yeah, kill it with a fork.
krz has joined #ruby
runeb has joined #ruby
havenn has joined #ruby
cbuxton1 has joined #ruby
havenn has joined #ruby
ubercore has joined #ruby
baroquebobcat has joined #ruby
Indian has joined #ruby
Mchl has joined #ruby
enroxorz has joined #ruby
<banseljaj> https://gist.github.com/1855344 Hi. I'm getting this error wven with the libraries installed. what might be wrong?
jordanstephens has joined #ruby
llaskin has quit [#ruby]
Phibs has quit [#ruby]
emocake has joined #ruby
jergason has joined #ruby
Sliker has joined #ruby
emocakes has joined #ruby
ScottG has joined #ruby
ChampS666 has joined #ruby
enroxorz has joined #ruby
enroxorz has joined #ruby
Sliker has joined #ruby
mshibanami has joined #ruby
dnjaramba_ has joined #ruby
volv has joined #ruby
volv has quit [#ruby]
stephans has joined #ruby
banseljaj has joined #ruby
hobodave has joined #ruby
robbyoconnor has joined #ruby
robbyoconnor has joined #ruby
nixmaniack has joined #ruby
caiges has joined #ruby
yawniek has joined #ruby
Sliker has joined #ruby
mengu_ has joined #ruby
asteros has joined #ruby
dark3rdre4ms has joined #ruby
stephenjudkins has joined #ruby
Leave_This_Place has joined #ruby
booginga has joined #ruby
a|i has joined #ruby
<a|i> how to wrap a block inside another block?
<banseljaj> <banseljaj> https://gist.github.com/1855344 Hi. I'm getting this error wven with the libraries installed. what might be wrong?
chrxn has joined #ruby
<a|i> eg: def foo &block; end; inside foo I want to add some stuff to &block.
cHarNe2 has joined #ruby
i8igmac has joined #ruby
<ScottG> I'm having a problem installing a gem. The problem technically is through Arch Linux's package manager but I think it's due to a way I've configured gem's since I did something for development. Here is a pastebin: http://privatepaste.com/004a5528bd
marvin_ has joined #ruby
sabooky has joined #ruby
al3xnull has joined #ruby
<sabooky> What is the recommended xml parser for ruby (need xpath support)
jsick3 has joined #ruby
Mohan has joined #ruby
<seanstickle> sabooky: SAX or DOM?
<jsick3> is it possible to pass a string variable to a thor executable without a task name?
<seanstickle> sabooky: but Nokogiri is quite nice in general.
<sabooky> dom preferably
<jsick3> i.e. ./myscript.rb "some string" instead of ./myscript.rb taskname "some string"
<seanstickle> sabooky: Nokogiri
<sabooky> seanstickle: ok sounds good. I was reading a few articles.. and depending on date, they had conflicting information. Nokogiri was the latest article I read, just wanted to make sure things haven't changed since.
<sabooky> Thanks a bunch!
rickmasta has joined #ruby
<ScottG> seanstickle: nokogiri is the gem im trying to install!
<seanstickle> ScottG: nifty
<seanstickle> ScottG: installing gems from a Linux package manager is a thing I've always avoided.
<ScottG> seanstickle: The advantage seems, though, that if I need a gem it will then be removed if I remove the package. And the gem will be updated along with the package.
<seanstickle> ScottG: a dubious benefit, but I'm not in your position
<ScottG> seanstickle: gem install --ignore-dependencies -i "$pkgdir$_gemdir" -n "$pkgdir/usr/bin" $_realname-$pkgver.gem
<shevy> shell isn't very beautiful is it
<ScottG> seanstickle: That seems to be the command that is installing the gem, so the pkg manager isn't doing it directly
alienvenom has joined #ruby
gabeh has joined #ruby
santamariaa has joined #ruby
santamariaa has quit [#ruby]
headius has joined #ruby
wroathe has joined #ruby
<ScottG> seanstickle: What would you recommend me doing?
<seanstickle> ScottG: I don't know Arch from a hole in the wall, I'm afraid.
<seanstickle> I just install rvm and go from there.
<ScottG> seanstickle: I just did a gem install of the dependency but that didn't seem to work
<ScottG> rvm sound familiar, though
macmartine has joined #ruby
chrxn has joined #ruby
<seanstickle> ScottG: rvm is non-package-managed ruby
<seanstickle> ScottG: (among many other things)
<td123> ScottG: what are you trying to do?
<ScottG> td123: I'm having a problem installing a gem. The problem technically is through Arch Linux's package manager but I think it's due to a way I've configured gem's since I did something for development. Here is a pastebin: http://privatepaste.com/004a5528bd
<ScottG> seanstickle: Right, someone recommended I install rvm for development instead of through my package manager
<ScottG> Or something along those lines. How would "go from there" after I have rvm? lol
<td123> ScottG: that sounds like a weird mix
tyfighter has joined #ruby
syamajala has joined #ruby
<ScottG> td123: What is?
tayy has joined #ruby
<td123> using an ruby from rvm to build a package for yourself using the distro's package manager
<ScottG> td123: I don't think that's what I'm trying to do...
<td123> RUBY EXECUTABLE: /home/scott/.rvm/rubies/ruby-1.9.2-p290/bin/ruby
<seanstickle> The idea is to drop package managed Ruby, and use rvm instead.
<ScottG> td123: I believe what happend was I configured gem to work in my dev environment then when my package maanger tried to use 'gem install' it messed up.
<td123> ScottG: I can build ruby-nokogiri from the aur on my system
<td123> not sure why gem isn't creating that folder for you
<ScottG> td123: What do you think I'm doing wrong?
<ScottG> td123: I could try creating that dir myself?
<ScottG> td123: I use yaourt, fyi
<td123> I'm using ruby from the distro to build it
<td123> I really don't know what the problem could be if rvm uses some combo of flags by default
Azure has joined #ruby
clockwize has joined #ruby
Sliker has joined #ruby
banister`sleep has joined #ruby
<td123> ScottG: perhaps try considering using gem if you're going to insist on using rvm?
Jrz has joined #ruby
<ScottG> I used gem to install nokogiri
ph^ has joined #ruby
<ScottG> but then yaourt still tries to install nokogiri
<td123> well that's because the package manager doesn't know about gem
<td123> and gem installed gems
<ScottG> Yeah
tayy has joined #ruby
zalesz has joined #ruby
davidcelis has joined #ruby
Guest79953 has joined #ruby
<tayy> hi everyone
<tayy> how do i get the header from mechanize?
<td123> ScottG: what are you trying to install?
dnjaramba has joined #ruby
<ScottG> td123: nokogiri
<td123> ScottG: I mean the package that depends on nokogiri
<davidcelis> tayy: I believe you will find the answer to that question in the documentation, good sir and/or madam.
<ScottG> td123: oh sorry, pkgcl
<td123> ScottG: ah ok, what I found that works best is to use the system's ruby/gem for everything provided by the distro's packages
<ScottG> td123: How do I force it to use that?
<td123> stop using rvm by default, or disable rvm
<td123> whenever you want to run something you installed through the distro's package manager
<ScottG> How would I do either of those?
<td123> rvm doesn't run by default automatically, so you had to enable it somewhere
<ScottG> td123: Perhaps this line in my bashrc? ...
<ScottG> [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
<davidcelis> nah, couldn't be that line
<davidcelis> impossible
dnjaramba_ has joined #ruby
<td123> nah, not that line
<ScottG> lol f u guys
<davidcelis> :)
mshibanami has joined #ruby
albemuth has joined #ruby
<td123> ScottG: check if you didn't cd into a folder with .rvmrc
<Leave_This_Place> i'm trying to install mongrel on linux using gem install, but I get this error message: http://pastie.org/3404404
cassarani has joined #ruby
<Leave_This_Place> anyone else see this problem?
<ScottG> td123: What do you mean? I mean, 'which ruby' doesn't link to what i want
<ScottG> td123: by what I want I mean /usr/bin/ruby
<td123> I know
<ScottG> td123: Even after I remove that line from my .bashrc the ruby binary is still wrong.
rushed has joined #ruby
<ScottG> I ran `source ~/.bashrc` btw
<td123> you need to get more familiar with how rvm/bash works
<td123> ScottG: open up another terminal
<ScottG> td123: Still gives me the wrong bin
cableray has joined #ruby
<td123> and you removed the line from the .bashrc file?
<ScottG> yes
<ScottG> ERROR: While executing gem ... (Errno::ENOENT) No such file or directory - /tmp/yaourt-tmp-scott/aur-ruby-nokogiri/pkg/usr/bin
<ScottG> That's the error from yaourt btw
<td123> which ruby
cbuxton has joined #ruby
<ScottG> /home/scott/.rvm/rubies/ruby-1.9.2-p290/bin/ruby
<ScottG> td123: ^
<td123> this is in the new terminal that was started after removing that line?
cbuxton has joined #ruby
crankycoder has joined #ruby
<td123> if so, I don't know, rvm shouldn't be loading it at all
Sliker has joined #ruby
cantbecool has joined #ruby
jhowarth has joined #ruby
<ScottG> td123: Yes
<ScottG> td, hm idea
gabeh has joined #ruby
<ScottG> td123: fixed
<ScottG> It was a problem with screen.
<ScottG> Although I don't understand what exactly.
<ScottG> td123: You have any idea? I was opening up new screen windows and that didn't seem to have an affect
<ScottG> I detached from screen, ran yaourt again, and it worked. which ruby was correct
cbuxton1 has joined #ruby
jordanstephens has joined #ruby
<td123> yup, lesson here, use system's ruby to install system's packages using gem :P
<ScottG> Yeah definitely. And that's what I thought the problem was. Thanks a lot for your help, though.
asteros has joined #ruby
<ScottG> td123: But as for screen, what was up with that?
ChampS666 has joined #ruby
<td123> I really don't know, maybe it was saving the PATH across screen sessions?
Sailias has joined #ruby
skitrees has joined #ruby
ivorybishop has joined #ruby
yekta has quit [#ruby]
csherin has joined #ruby
Foxandxss has joined #ruby
nixmaniack has joined #ruby
speerfissure has joined #ruby
<td123> sudo does that, I don't know about it myself :P
Azure has joined #ruby
<werdnativ> what's the latest gem for ruby-debug for ruby 1.9.3? gem ruby-debug seems maintained more recently and ruby-debug19 is untouched since 2009?
Rounin has quit [#ruby]
tayy has joined #ruby
nseemallel has joined #ruby
<banistergalaxy> werdnativ: i just use pry myself
<banistergalaxy> ;)
<werdnativ> hm, I should check it out then.
Helius has joined #ruby
<werdnativ> thank you!
<banistergalaxy> werdnativ: np tell me how u get on
<werdnativ> cheers, will do.
SJr has joined #ruby
<SJr> How can I sort the keys in a hash map?
<SJr> or a Hash sorry
<banistergalaxy> SJr: what do u mean, when iterating through it? or actually sort them in the hash itself?
booginga has quit ["Leaving"]
<SJr> params.keys.map{|x| "-#{x} '#{params[x]}'"}.join(" ")
<SJr> I assume it's something like
<banistergalaxy> params.keys.sort ?
<SJr> params.keys.sort.map{|x| "-#{x} '#{params[x]}'"}.join(" ")
<banistergalaxy> did u try it?
<SJr> I was looking it up while I asked, as I figured out what it was doing.
stephenjudkins_ has joined #ruby
muneeb has joined #ruby
dagnachewa has joined #ruby
csavola has joined #ruby
samuelj has joined #ruby
asobrasil has quit [#ruby]
<samuelj> Hey everyone, I'm trying to build a simple Rack server, though I'm having way to many issues :) For some reason, everything has just started to hang and I have no idea why! With this code, everything just hangs and the client isn't served, nor is there any stdout: http://pastie.org/3404613. However, if i never access the data variable of #start, i.e. i just initialise it and then write to the client, everything works fine. Is the
<samuelj> something I should know about recvmsg?
<samuelj> Thanks in advance - I'm really starting to bang my head against a wall!
apucacao has joined #ruby
dagnachewa has joined #ruby
Sliker has joined #ruby
<shadoi> samuelj: where does 'accept' come from?
<samuelj> accept is server.accept, it's an instance method of the TCPSocket class
<shadoi> gotcha
<samuelj> any ideas? It's easy to test, just run it and hit up localhost:3000
<shadoi> any recvmsg?
Sliker has joined #ruby
<shadoi> where does that come from?
aBound has joined #ruby
<samuelj> recvmesg is from BasicSocket, a parent class (somewhere up the tree) of TCPSocket
aBound has quit ["Leaving"]
phantomfakeBNC has joined #ruby
<shadoi> does it hang after a while or immediately?
<samuelj> immediately
hmans has joined #ruby
chrxn has joined #ruby
DaniG2k has joined #ruby
<DaniG2k> guys can someon suggest a good tet for learning Ruby?
<DaniG2k> *text
colint has joined #ruby
crankycoder has joined #ruby
<samuelj> danheberden:
<samuelj> oops sorry!
<DaniG2k> thnx :)
<shadoi> samuelj: it seems like maybe you're not hitting the maxmsglen so it's waiting for the buffer to fill?
<samuelj> so i just tried recvmsg(10) and still nothing
looopy has joined #ruby
<davidcelis> DaniG2k: also check out The Well Grounded Rubyist
<DaniG2k> davidcelis: alright thanks i'll take a look :)
ivorybishop has joined #ruby
Leave_This_Place has joined #ruby
<Leave_This_Place> i'm on linux, i'm having trouble installing mongrel.. does anyone else get this message?: http://pastie.org/3404404
dark3rdre4ms has joined #ruby
dark3rdre4ms has joined #ruby
<Leave_This_Place> i'm doing the gem install
banistergalaxy has joined #ruby
Asher1 has joined #ruby
stephenjudkins has joined #ruby
ed_hz_ has joined #ruby
chimkan_ has joined #ruby
speerfissure has joined #ruby
Furankuru has joined #ruby
ivorybishop has joined #ruby
ekaleidox has joined #ruby
bbttxu_ has joined #ruby
ekaleidox has joined #ruby
speerfissure has joined #ruby
<Leave_This_Place> I have another problem...
<Leave_This_Place> I'm making a new RoR app but the script/ directory doesn't ahve things like "server" or "console" only "rails"
<Leave_This_Place> this is incongruent with the guides i'm reading, and I can't find these files.. anyone know what's going on?
ekaleidox has joined #ruby
marvin_ has joined #ruby
seanstickle has joined #ruby
ivorybishop has joined #ruby
<Leave_This_Place> do I simply use the rails program in script/ and do "./rails console"?
banistergalaxy has joined #ruby
trivol has joined #ruby
speerfissure has joined #ruby
banistergalaxy has joined #ruby
Russell^^ has joined #ruby
ivorybishop has joined #ruby
<robacarp> Leave_This_Place: rails should be a command in your PATH
<Leave_This_Place> robacarp⎙ it is
<robacarp> so you should just be able to do `rails console` without specifying anything
Dreamer3 has joined #ruby
<Leave_This_Place> robacarp⎙ but I want what I enter into the rails IRB to affect the RoR app
<robacarp> yea, just run `rails console`
<robacarp> that'll drop you into your apps exec space
<Leave_This_Place> what if I have 8 different apps. how will it know what to do?
<Leave_This_Place> how will it know which app to affect?
<davidcelis> Leave_This_Place: You're probably looking at old tutorials. script/server and script/console are rails 2
<robacarp> based off of the directory you're in when you run the command
<davidcelis> Leave_This_Place: #rubyonrails is a good resource, btw
<Leave_This_Place> ok
<Leave_This_Place> i'll ask there instead, thanks
<robacarp> oh, i didn't even realized this was #ruby....I'm in both
<robacarp> :D
c0rn has joined #ruby
burgestrand has joined #ruby
speerfissure has joined #ruby
<davidcelis> lol
jimmyy111 has joined #ruby
ivorybishop has joined #ruby
chrxn has joined #ruby
SamWhited has joined #ruby
speerfissure has joined #ruby
moshee has joined #ruby
moshee has joined #ruby
ivorybishop has joined #ruby
pen has joined #ruby
RenatoSilva has joined #ruby
gabeh has joined #ruby
tomzx has joined #ruby
sj26 has joined #ruby
savage- has joined #ruby
speerfissure has joined #ruby
<ElderFain> yeah two of you are having a conversation in what seems like both
<ElderFain> i kept thinking i was in the same channel
ivorybishop has joined #ruby
senj has joined #ruby
shevy has joined #ruby
jimmyy111 has joined #ruby
<davidcelis> i lurk here and am active in the rails channel
nemesit has joined #ruby
Pikkachu has quit [#ruby]
virunga has joined #ruby
nim_ has joined #ruby
<ekaleidox> is that #rails?
<td123> #rubyonrails
<davidcelis> ^
speerfissure has joined #ruby
<ekaleidox> thanks