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/
delian66 joined #ruby
Apocalypse joined #ruby
raincole joined #ruby
alek_b joined #ruby
Samoi joined #ruby
havenn joined #ruby
tomzx joined #ruby
tatsuya_o joined #ruby
mrsolo left #ruby
jgrimes joined #ruby
LittleBill902 joined #ruby
ryanf joined #ruby
luckyruby joined #ruby
wyhaines joined #ruby
ramusara joined #ruby
nelsnelson joined #ruby
rvmeier joined #ruby
moted joined #ruby
johntitor joined #ruby
randym joined #ruby
wedgeV joined #ruby
creativeprodigy joined #ruby
yfeldblum joined #ruby
fridim_ joined #ruby
chessguy joined #ruby
killing-joke left #ruby
josePhoenix left #ruby
atmosx joined #ruby
hadees joined #ruby
igotnolegs joined #ruby
johntitor joined #ruby
crankycoder joined #ruby
io_syl joined #ruby
tobym joined #ruby
zedUNDginger joined #ruby
jonathanrwallace joined #ruby
BrokenCog joined #ruby
LiquidInsect joined #ruby
tomas_w joined #ruby
jacortinas joined #ruby
ilyam joined #ruby
rpowell joined #ruby
sven_ joined #ruby
nelsnelson joined #ruby
tobym joined #ruby
rpowell_ joined #ruby
macabre joined #ruby
dasfugufish joined #ruby
fixl joined #ruby
zedUNDginger joined #ruby
ilyam joined #ruby
Houghtootin joined #ruby
<Houghtootin> hey does anyone know how to get method completion in emacs the way it is in the terminal?
<Houghtootin> like if a = 5 and i do a.<tab> it gives me all the number methods
kdrsx joined #ruby
dhruvasagar joined #ruby
cableray joined #ruby
QKO joined #ruby
Adept` joined #ruby
s0ber joined #ruby
jgrimes joined #ruby
akem joined #ruby
Derander joined #ruby
Marco joined #ruby
GreaseMonkey joined #ruby
Axsuul joined #ruby
cafesofie joined #ruby
quest88 joined #ruby
cantonic joined #ruby
tobym joined #ruby
ronniemlr joined #ruby
rpowell joined #ruby
teej_m joined #ruby
Marco joined #ruby
ceej joined #ruby
<teej_m> I've got this snippet: now = Time.now.localtime("-08:00"); return now.end_of_day.to_i - now.to_i
<teej_m> it's positive on my local machine but coming up negative on my prod box
<teej_m> it's meant to calulate seconds until the end of the day in california
bugz^ joined #ruby
kawa_xxx joined #ruby
<teej_m> Oh, turns out end_of_day is backed by Time.change(), and that nukes the timezone
sbanwart joined #ruby
<teej_m> thanks #ruby!
macmartine joined #ruby
Synthpixel joined #ruby
dhruvasagar joined #ruby
<blueadept`> might anyone know why a folder wouldn't be compiling on bundle exec rake assets:precompile?
<atmosx> how do I view my local gems?
<atmosx> it's ri -p 8080 ?
<atmosx> something like that, I can't recall the cli for documentation
<atmosx> ok gem server
cpruitt joined #ruby
dhruvasagar joined #ruby
krz joined #ruby
n8ji joined #ruby
colloquialismic joined #ruby
nonotza joined #ruby
Draco_ joined #ruby
wilmoore joined #ruby
eft joined #ruby
cdepue joined #ruby
proxie joined #ruby
sdwrage joined #ruby
zedUNDginger joined #ruby
zedUNDginger joined #ruby
dhruvasagar joined #ruby
Pip joined #ruby
Pip joined #ruby
jergason_school joined #ruby
brownies joined #ruby
incluye joined #ruby
dotnull joined #ruby
dhruvasagar joined #ruby
zedUNDginger joined #ruby
martisj joined #ruby
ryanf joined #ruby
sorin joined #ruby
dhruvasagar joined #ruby
wilmoore joined #ruby
zedUNDgi_ joined #ruby
sorin joined #ruby
zedUNDginger joined #ruby
dhruvasagar_ joined #ruby
martisj joined #ruby
tobym joined #ruby
quest88 joined #ruby
martisj joined #ruby
KitsuneDrag0n joined #ruby
BrokenCog joined #ruby
cdepue_ joined #ruby
dhruvasagar joined #ruby
bwlang joined #ruby
Marco joined #ruby
skrewler joined #ruby
hadronzoo joined #ruby
Guest66410 joined #ruby
Guest66410 left #ruby
colloquialismic joined #ruby
rpowell joined #ruby
bwlang_ joined #ruby
_--|o]__ joined #ruby
<_--|o]__> hi
<colloquialismic> how is _--|o]__
<colloquialismic> i have to admit bro... that name is awesome
<_--|o]__> how do i integrate a ruby script into my index.html
<_--|o]__> lol
<colloquialismic> i'm serious
<_--|o]__> its not a name.
<_--|o]__> its a penguin
<colloquialismic> it is a beast penguin
sythe joined #ruby
<colloquialismic> _--|o]__, are you faily advanced in the ruby lang?
<_--|o]__> faily?
<_--|o]__> im ok
<shevy> lol
<colloquialismic> excuse me * busy day. fairly
<shevy> you are faily advanced man
<_--|o]__> not that faily
<colloquialismic> yesh faily advanced indeed
<shevy> totally faily man
kennethreitz joined #ruby
<colloquialismic> no no... you are
<colloquialismic> yesh
<shevy> colloquialismic, how about you, are you faily advanced? is your ruby code very faily?
<_--|o]__> i am suck a fucker
<shevy> fuck a sucker?!?
<_--|o]__> hahaha
<_--|o]__> lol
<colloquialismic> shevy, no sir. i am green around the ears
<shevy> colloquialismic, I think when you use the word "fairly", the question is what you mean with it
<_--|o]__> greenday
<_--|o]__> i am suck a fucker
<_--|o]__> hahahaha
<shevy> Because how do you define who is fairly advanced? 10 years writing in ruby regularly?
<colloquialismic> lol
<colloquialismic> yes
<shevy> Plus, some people learn faster than others
<_--|o]__> i have coded ruby a few days now
<_--|o]__> lol
<colloquialismic> are you an regular shevy
<_--|o]__> but im getting on well
<colloquialismic> haha
<_--|o]__> lol
<_--|o]__> its not that hard
<_--|o]__> just puts 'hello world'
<colloquialismic> yeah
<shevy> colloquialismic, yes, I use ruby daily. However, I would not really call myself fairly advanced
<colloquialismic> it's fun
<shevy> All the metamagic stuff in ruby is confusing me
<colloquialismic> shevy, do you think python or ruby is more powerful for exploitation/etc
<colloquialismic> metasploit is a product of ruby
<_--|o]__> i want to code a virtual casino
<colloquialismic> lol
<shevy> I have not really used python much, but in my opinion it seems to more enforce a specific style of coding and is more restrictive in several aspects
<_--|o]__> lol
<_--|o]__> how is metasploit coded in ruby?
<_--|o]__> are you thick
<_--|o]__> that's bs
<shevy> my dream language would be a hybrid of python and ruby philosphy, but prototypic and minimalistic
<_--|o]__> how is metasploit coded in ruby?
<colloquialismic> shevy, in what several aspects?
<_--|o]__> ruby is more like server side web app coding isn't it
<_--|o]__> im new so pardon me
<shevy> colloquialismic well, for one thing, I think ruby as a whole is too complex, especially for newcomers
<_--|o]__> its not complex
<shevy> _--|o]__ how many times did you use Proc yet?
<_--|o]__> none
<shevy> I can use a subset of ruby without a problem, but if I read other people's code, I need to understand what is going on
<colloquialismic> metasploit is coded in ruby, use to be perl
<_--|o]__> how is it coded in ruby
<_--|o]__> its not a web app
<_--|o]__> i really thought it was visual c
<colloquialismic> lol
<colloquialismic> shevy, but have you seen Social Engineer toolkit?
<colloquialismic> that is python and it is beast
<shevy> don't know that one
<shevy> you can write great apps in PHP too, mediawiki, phpbb
<shevy> sad that ruby can not replace PHP
<_--|o]__> you can combine the 2
<shevy> which two
<shevy> mediawiki and phpBB?
<shevy> well actually
<shevy> Wordpress isn't as bad as people used to say, at least not when using it to admin a site
<shevy> damn WWW
<shevy> you made javascript more popular than ruby :(
suung_ joined #ruby
colloquialismic joined #ruby
aakashvd joined #ruby
mksm joined #ruby
Marco joined #ruby
tobym joined #ruby
berserkr joined #ruby
<blueadept`> man why is the asset pipeline so hard to debug on upgrade
mksm joined #ruby
x0F_ joined #ruby
_kinderman joined #ruby
sorin joined #ruby
sorin joined #ruby
sorin joined #ruby
macmartine joined #ruby
sorin joined #ruby
sorin left #ruby
cdepue joined #ruby
Synthpixel joined #ruby
sorin joined #ruby
sorin joined #ruby
h4mz1d joined #ruby
cafesofi` joined #ruby
<hadronzoo> What's the easiest way to drop the last n characters from the end of a string?
<hadronzoo> For some reason, chop doesn't take a numeric argument
tobym joined #ruby
<zedUNDginger> hadronzoo: look at slice
radic_ joined #ruby
<hadronzoo> zedUNDginger: thanks. "some string"[0..-n] works
rpowell joined #ruby
iamjarvo joined #ruby
mindCrime joined #ruby
heftig joined #ruby
hadees joined #ruby
<dch4pm4n> I am getting a weird error running some spec tests on my rails 3.1.3 applications, seems to be with active record backtrace: http://pastebin.com/03yxt3r6
<dch4pm4n> undefined method 'mb_chars' for nil:NilClass?
<dch4pm4n> oops wrong channel, meant for #rails
j3r0m3 joined #ruby
kuadrosx joined #ruby
fixl joined #ruby
<fixl> hi. when would you re-open a class in practice to open add a mathod? I understand the concept, jsut its application seems a bit abstract
milkpost_ joined #ruby
jonathanrwallace joined #ruby
blueadept` joined #ruby
sorin joined #ruby
mrapple joined #ruby
Marco joined #ruby
Samoi joined #ruby
jahanzaib30 joined #ruby
aakashvd joined #ruby
jahanzaib30 left #ruby
Dreamer3 joined #ruby
raythecat joined #ruby
esparkman joined #ruby
Beoran__ joined #ruby
brownies- joined #ruby
brownies joined #ruby
joshfng joined #ruby
ryanf joined #ruby
zedUNDginger joined #ruby
kuadrosx joined #ruby
ethndbst joined #ruby
Morbis joined #ruby
<Morbis> Hello. Mite there be anyone who can help out with a C# problem?
<Seventoes> C#? this is #ruby? o.O
<Morbis> Was just asking. I cant seem to find C# room
<brownies> Seventoes: that's his problem ;)
<Morbis> Well thank you anyways.
Morbis left #ruby
MekkisFreenode joined #ruby
tobym joined #ruby
<fixl> lol
<fixl> priceless :D
<fixl> can somebody please give me money? I couldn't find the bank
<Axsuul> Morbis: haha its #csharp
Dreamer3 joined #ruby
randym_ joined #ruby
mikepack joined #ruby
cantonic joined #ruby
colloquialismic joined #ruby
mxweas_ joined #ruby
ryanf joined #ruby
maletor joined #ruby
AlexLibman joined #ruby
xpot joined #ruby
Cervajz joined #ruby
AlexLibman left #ruby
workmad3 joined #ruby
eft joined #ruby
eldariof joined #ruby
rpowell joined #ruby
looopy joined #ruby
<looopy> require 'digest' returns false using ruby 1.9.2 am i missing something?
raythecat joined #ruby
raincole joined #ruby
tobym joined #ruby
tomzx joined #ruby
Marco joined #ruby
aglenday joined #ruby
themadcanudist joined #ruby
themadcanudist left #ruby
thepix joined #ruby
jonathan___ joined #ruby
<jonathan___> Hi all, I installed ruby by using rvm on my ubuntu and now I want to install rails. So I do a 'sudo gem install rails' but I get a sudo: gem: command not found
<jonathan___> Any idea to fix it ?
<Seventoes> install gem? :P
<jonathan___> gem is installed, when I don't use sudo it works. By example I can do a gem environment
sdwrage joined #ruby
<Seventoes> sudo `which gem` install rails
<jonathan___> but I read that I need to be root to install rails and it seems that when I use sudo it can't find gem
<Seventoes> use gem's absolute path, it probably isn't in root's env
<jonathan___> Ok I'll try, thanks
tatsuya_o joined #ruby
themadcanudist joined #ruby
themadcanudist left #ruby
themadcanudist joined #ruby
themadcanudist left #ruby
themadcanudist joined #ruby
rippa joined #ruby
<jonathan___> Seventoes, the result is different but not better, I get a /usr/bin/env: ruby: No such file or directory
themadcanudist left #ruby
<Seventoes> jonathan___: add the path that ruby and gem are at to root's $PATH
<jonathan___> yes I read some workaround but it's a dirty way
<jonathan___> may be the first question is : Do I need to be root to do a gem install rails ?
<Seventoes> dunno
<Seventoes> try it without root
Pip joined #ruby
Pip joined #ruby
<jonathan___> ok, I think I will get a second problem ... it's that the gem repositories are blocked in China
<Seventoes> ouch
<Seventoes> proxy it up
<Seventoes> tor if you gotta
<Seventoes> because fuck that :D
Paladin joined #ruby
<jonathan___> tor is blocked too, I don't know how they did but they did
<Seventoes> wait
<Seventoes> nope
jbpros joined #ruby
<jonathan___> ok, I know some guys working with Rails in South China, they set up a gem proxy
<Seventoes> yeah it should work fine, i don't see any blog posts on tor's blog about them blocking it
<Seventoes> ah cool
<jonathan___> what is the gemfile ? It's the .gemrc ?
<jonathan___> at first I don't have a .gemrc into my home folder
<jonathan___> it shall be in /usr/share/ruby-rvm somewhere I guess
fixl joined #ruby
thecreators joined #ruby
p1d joined #ruby
aetaric joined #ruby
<aetaric> quick question, trying to use Net::HTTP, how would i give it authentication details?
enikar joined #ruby
tvw joined #ruby
Adman65 joined #ruby
aakashvd joined #ruby
tobym joined #ruby
y_matsu joined #ruby
thecreators joined #ruby
zommi joined #ruby
iocor joined #ruby
robotmay joined #ruby
Cervajz joined #ruby
mklappstuhl joined #ruby
jbpros joined #ruby
Codif joined #ruby
y_matsu joined #ruby
jrbran joined #ruby
fl0w joined #ruby
aetaric joined #ruby
Tuxist joined #ruby
cableray joined #ruby
apeiros_ joined #ruby
jamiemill joined #ruby
robotmay joined #ruby
iocor joined #ruby
jari joined #ruby
iocor_ joined #ruby
vladyn joined #ruby
fixl joined #ruby
burgestrand joined #ruby
maletor joined #ruby
iocor joined #ruby
araujo joined #ruby
p1d joined #ruby
indentman joined #ruby
Reikoku joined #ruby
michael_mbp joined #ruby
timonv joined #ruby
tobym joined #ruby
RLa joined #ruby
mxweas_ joined #ruby
vmatiyko joined #ruby
yxhuvud joined #ruby
techieshark joined #ruby
zedUNDginger joined #ruby
_debo joined #ruby
adambeynon joined #ruby
zastaph joined #ruby
odinswand joined #ruby
fl0w_ joined #ruby
zedUNDginger joined #ruby
shevy joined #ruby
zedUNDginger joined #ruby
akem joined #ruby
akem joined #ruby
iocor joined #ruby
andrewblack joined #ruby
senny joined #ruby
thecreators joined #ruby
ph^ joined #ruby
Codif joined #ruby
mengu joined #ruby
araujo joined #ruby
araujo joined #ruby
rpowell joined #ruby
fl0w joined #ruby
ntnd joined #ruby
_debo joined #ruby
Sliker joined #ruby
Adept` joined #ruby
hzlocky joined #ruby
<hzlocky> Hi, guys
<Seventoes> Hi, guy
nachtwandler joined #ruby
<hzlocky> I need to write some application that will receive about 10 000 messages per minute, then it will do calculations with messages, and then put all data into db(probably mysql).
<Seventoes> 166 per second? that shouldn't be any big deal
<Seventoes> might be for the database layer
<hzlocky> Since, I like ruby I`d like to make calculation with it, but the app really need to be very fast
<hzlocky> thats why I cant do the whole application in ruby - cause of green threads problem
<Seventoes> ruby won't have any trouble with 166 things per second
<Seventoes> depending on the intensity of the calculations of course
<Seventoes> but your database backend might have trouble adding that many, again depending on how much data it is
<hzlocky> yes, but one calculation is about 0.1 seconds
<hzlocky> and I need to answer for each message in less than 10 secs
<Seventoes> you're going to need a cluster if it's that much calculation :P
<hzlocky> currently we have java app
<hzlocky> that does so much calculation at time
<Seventoes> if you've got a stable 166 per second at 0.1s per calculation you'll fall behind 10 seconds quickly
<Seventoes> how much hardware do you have to work with?
fermo joined #ruby
<hzlocky> I am talking about 1 machine task
<Seventoes> no language is going to handle 166 messages per second if each calculation takes 1/10th of a second
<Seventoes> on one box
<Seventoes> 166 1/10th of a second calculations is going to take 16 seconds
<Seventoes> have you benchmarked the calculations in ruby vs java yet?
<hzlocky> currently we have java server that does calculation in 166 threads
<hzlocky> it is just methaphore
<Seventoes> so they take a tenth of a second while sharing the CPU time with other calculations?
<hzlocky> I mean that I got a problem that due to green threads in mri we cant use ruby as whole framework
james_cotterill joined #ruby
<Seventoes> some quick googling tells me ruby 1.9.1 added native threads
<hzlocky> eh
aakashvd joined #ruby
kidoz joined #ruby
<RLa> i wonder what both java and ruby do when gc kicks in
<RLa> does it have to be real-time?
cpruitt joined #ruby
ikaros joined #ruby
tatsuya_o joined #ruby
atmosx joined #ruby
polymar joined #ruby
polymar joined #ruby
<shevy> they dance
james_cotterill joined #ruby
james_cotterill joined #ruby
sepp2k joined #ruby
jimmy1980 joined #ruby
nari joined #ruby
qinmugong joined #ruby
kidoz joined #ruby
Manhose joined #ruby
iocor joined #ruby
Black-Heaven joined #ruby
zedUNDginger joined #ruby
jgrimes_ joined #ruby
zedUNDginger joined #ruby
mk03 joined #ruby
juarlex joined #ruby
CorpusCallosum joined #ruby
jimmy1980 joined #ruby
Vendethiel joined #ruby
rpowell joined #ruby
dbgster joined #ruby
chessguy joined #ruby
senayar joined #ruby
jensn joined #ruby
jbw joined #ruby
sbanwart joined #ruby
sbanwart joined #ruby
_debo joined #ruby
jimmy1980 joined #ruby
senny joined #ruby
bozhidar joined #ruby
eldariof joined #ruby
tobym joined #ruby
bwlang joined #ruby
pantsman joined #ruby
pantsman joined #ruby
pen_isident joined #ruby
cantonic joined #ruby
Manhose_ joined #ruby
katselphrime joined #ruby
statarb3 joined #ruby
statarb3 joined #ruby
cdepue joined #ruby
Vendethiel` joined #ruby
ikaros joined #ruby
arpegius joined #ruby
sopheak joined #ruby
iocor joined #ruby
shevy joined #ruby
Marco joined #ruby
qinmugong left #ruby
katselphrime joined #ruby
lkba joined #ruby
pantsman joined #ruby
pantsman joined #ruby
jimmy1980 joined #ruby
jensn joined #ruby
jonathanrwallace joined #ruby
rkk joined #ruby
nonotza joined #ruby
tobym joined #ruby
jetblack joined #ruby
bwlang joined #ruby
Squarepy joined #ruby
Squarepy joined #ruby
John_P joined #ruby
gayasentinel joined #ruby
dyer joined #ruby
<rkk> what does regexp /:([^\/]+)/ match?
<burgestrand> Colon, followed by any non-forward slash at least once
kirun joined #ruby
<rkk> it should match "http://blabla.com", but it failed
<burgestrand> No, more like spotify:track:0dh2F3Mi1b1EGafGmvUC9M
<burgestrand> …
<apeiros_> rkk: no, it should not
<burgestrand> Did that come out as spotify:track:… something? If not that’s what it should have come out as.
<apeiros_> rkk: what makes you think it should?
<burgestrand> rkk: no, because the colon in that string is followed by a forward slash, /
Super-Pomme joined #ruby
<burgestrand> rkk: it must *not* be followed by a forward slash, anything *but* a forward slash
Super-Pomme left #ruby
robotmay joined #ruby
<rkk> emm
looopy joined #ruby
tobym joined #ruby
<rkk> i see
<rkk> i forget that "^" in "[]" means "not include"
<rkk> i still regard it as "beginning of the string"
<apeiros_> it doesn't mean that either
<apeiros_> ^ outside a character class means 'begin of line', not 'begin of string'
<apeiros_> \A is 'begin of string'
<rkk> emm, i see
<rkk> thank you apeiros_
iocor joined #ruby
emmanuelux joined #ruby
dch4pm4n joined #ruby
bjhaid joined #ruby
<bjhaid> Hi I am trying to install ruby oci8 on cgywin from source and I get this error: MiniRegistry::MiniRegistryError any ideas on what this is?
muzzle-fuzzle joined #ruby
bjhaid left #ruby
renanoronfle joined #ruby
Evixion joined #ruby
tobym joined #ruby
linoj joined #ruby
gayasentinel joined #ruby
<tommylommykins> hmm
<tommylommykins> Does obj.new always return self?
tobym joined #ruby
<burgestrand> tommylommykins: you can override it if you wish, but it does by default
<burgestrand> tommylommykins: or, well, it does not return self
<tommylommykins> class Abc def initialize 1 end; Abc.new
<tommylommykins> Does not return 1
bjhaid joined #ruby
<burgestrand> That’s pretty much the implementation of Klass.new
<tommylommykins> hmm
<burgestrand> tommylommykins: so as you can see, the return value of initialize is pretty much irrelevant
<tommylommykins> yeah
ciaran_lee joined #ruby
<burgestrand> tommylommykins: but as I’ve done there, you can actually override Klass.new to do whatever you want
<tommylommykins> is it particularly unrubyful to override it though?
<burgestrand> Well, it will most likely end up being confusing and that’s bad
<burgestrand> You expect Klass.new to always return an instance of Klass, and to use the correct parameters given to initialize and such
<burgestrand> Often, it’s better to create a new method, so you could do… Klass.create(parameters) instead, for example
will_b joined #ruby
<yfeldblum> unless you override MyCustomClass.new :P
<burgestrand> That way you get some more flexibility because you won’t have the same expectations of what Klass.create does
<yfeldblum> class MyCustomClass; def self.new; 3 end end
iocor joined #ruby
sythe joined #ruby
sythe joined #ruby
deryl joined #ruby
namidark joined #ruby
fetimo joined #ruby
_debo joined #ruby
<tommylommykins> hmm
<tommylommykins> if I want to fo 16 bit integer arithmetic in ruby
<tommylommykins> am I going to have to define all operations myself?
<RLa> unsigned?
<tommylommykins> and 2s complement
<tommylommykins> well, I don't care about representation
jensn joined #ruby
Knodi joined #ruby
<RLa> you could use normal integers
flippingbits joined #ruby
bier joined #ruby
bier|tp joined #ruby
tburns joined #ruby
<apeiros_> tommylommykins: just & 0xffff after each operation
io_syl joined #ruby
<RLa> that looks like module arithmetics
io_syl joined #ruby
<apeiros_> well, that's what 16bit arithmetic essentially is…
<RLa> all calculations are done mod 2^16
<RLa> i think i have seen some special libs for that
<apeiros_> ok, on some architectures you also have an overflow bit that can be set.
asobrasil joined #ruby
* apeiros_ wonders why tommylommykins has a requirement for 16 bit int arithmetic, though
michas joined #ruby
<tommylommykins> just messing around with a work language used on 16-bit processors
enikar joined #ruby
<tommylommykins> I guess there isn't too much stopping me pretending it's a bignum processor for my purposes at the moment
senny joined #ruby
axilla joined #ruby
Brozilla joined #ruby
martisj joined #ruby
Mahoek joined #ruby
SaneWarning joined #ruby
sbanwart joined #ruby
bjhaid left #ruby
macmartine joined #ruby
kakaskin joined #ruby
Pip joined #ruby
iamjarvo joined #ruby
michael_mbp joined #ruby
Pip joined #ruby
cyri_ joined #ruby
Pip joined #ruby
HNDavid joined #ruby
niklasb joined #ruby
jensn joined #ruby
Hellojere joined #ruby
banisterfiend joined #ruby
pen_isident joined #ruby
<kakaskin> hi
Prajjwal joined #ruby
banisterfiend joined #ruby
<apeiros_> hi kakaskin
<axilla> Ruby should do winter of code
<axilla> not summer of code
<kakaskin> do somebody answer silly questions
<axilla> in the summer i want to be on a boat and swimming
<axilla> in the winter i'm couped up
<apeiros_> kakaskin: #politics does, I guess
<axilla> and want to code :)
<kakaskin> apeiros_, ok
Adept` joined #ruby
<apeiros_> but we do answer ruby questions.
cantonic_ joined #ruby
<kakaskin> ok, i`ll try to ask a silly ruby question. http://pastie.org/private/wvvuvxvuexzixit6mczwa. why does ruby foo.rb -w 2 print nil?
apeiros_ joined #ruby
vmatiyko left #ruby
<shevy> kakaskin before one can look at what is going on
<apeiros_> kakaskin: you forgot to specify that -w takes an argument
<shevy> puts (options.width) <-- please kill the ()
<apeiros_> --> opts.on( '-w', '--width WIDTH', …
<apeiros_> also what shevy says. no spaces before a method's parens. also in most cases, don't use parens at all.
rvmeier joined #ruby
banisterfiend joined #ruby
esparkman joined #ruby
<kakaskin> apeiros_, mmm
<kakaskin> opts.on( '-w', '--width', OptionParser::DecimalInteger, 'Specifies image width' ) do |w|
<kakaskin> what should I write?
colloquialismic joined #ruby
albemuth joined #ruby
<apeiros_> kakaskin: errr, just read my answer?
csavola joined #ruby
<kakaskin> oh
<kakaskin> huge thanks
tburns joined #ruby
ikaros joined #ruby
nachtwandler_ joined #ruby
h4mz1d joined #ruby
ChampS_ joined #ruby
banisterfiend joined #ruby
matti joined #ruby
matti joined #ruby
Marco joined #ruby
atmosx joined #ruby
colloquialismic joined #ruby
nachtwandler joined #ruby
mrapple joined #ruby
looopy joined #ruby
dotnull joined #ruby
zommi joined #ruby
tobym joined #ruby
carloshpf joined #ruby
RLa joined #ruby
<shevy> hehe
<shevy> reading an answer is not always an option!
Vendethiel joined #ruby
burgestrand joined #ruby
banisterfiend joined #ruby
banisterfiend joined #ruby
banisterfiend joined #ruby
pippo joined #ruby
pippo left #ruby
banisterfiend joined #ruby
dfamorato joined #ruby
katselphrime joined #ruby
blueadept` joined #ruby
emptyflask joined #ruby
CannedCorn joined #ruby
ubuntunoob joined #ruby
<ubuntunoob> ubuntu is better.
<ubuntunoob> ruby is too unstable, IMO.
<ubuntunoob> ubuntu is better.
<apeiros_> I've definitively seen better trolls…
<ubuntunoob> ?
<ubuntunoob> i just expressed my opinion
<ubuntunoob> nothing else
<ubuntunoob> ubuntu is better than ruby. thats a fact.
<apeiros_> your opinion is, that ubuntu is better than ruby, yes?
<apeiros_> aha
<apeiros_> so an operating system is better than a programming language…
<ubuntunoob> they are both used for programming.
<apeiros_> there's 2 options: you're either retarded or a troll
<ubuntunoob> sir, you probably havent tried them either. maybe you are just another groupie.
was kicked by apeiros_: we don't need trolls
adambeynon joined #ruby
happynoff joined #ruby
<happynoff> Hi there. I have a question about testing a module with rspec. How would you test the foo method ? http://pastie.org/2960475
ubuntunoob joined #ruby
<happynoff> I'm trying to stub the bar method but I don't know how to do it :/
<ubuntunoob> nice. use intimidation to quiet down the truther. pure nazi tactics.
<apeiros_> ubuntunoob: didn't get the hint?
Bonkers joined #ruby
<ubuntunoob> i will come back when you are not here.
was kicked by apeiros_: get off my lawn
ubuntunoob joined #ruby
was kicked by apeiros_: get off my lawn
quest88 joined #ruby
nachtwandler_ joined #ruby
AnusUranus joined #ruby
<AnusUranus> any one here?
* AnusUranus slaps apeiros_ around a bit with a large trout
<apeiros_> rofl
AnusUranus joined #ruby
<AnusUranus> ntu
was kicked by apeiros_: AnusUranus
looopy joined #ruby
<musee> lol apeiros_
<apeiros_> I'm always at a loss for an explanation of such behaviour…
<musee> ubuntu vs ruby
<musee> who will win!?!
<musee> :P
<apeiros_> of course ferrari!
<apeiros_> it's better than both!
<musee> xD
<apeiros_> but the real question is:
<apeiros_> will they blend?
<musee> :|
thone joined #ruby
Jackneill joined #ruby
<Jackneill> hi
<Jackneill> can you help me with ruby? i decided to learn ruby or python but i cant choose
<burgestrand> we can help if you have questions
<Jackneill> what i cant do in ruby?
mztriz joined #ruby
<Jackneill> the speed of ruby?
<burgestrand> you can do the same thing with python that you can do with ruby, but I’d say python is better if you’re into the academic world
<Jackneill> academic world?
<burgestrand> yes, ruby has no proper equivalent to http://numpy.scipy.org/ as far as I know
<musee> well then burgestrand
<musee> get crackin!
<apeiros_> burgestrand: narray?
<burgestrand> both ruby and python are fast enough, they are not as fast C for example
t-roll__o joined #ruby
tshauck joined #ruby
<t-roll__o> WADDUP MOTHERFUCKERS
<Jackneill> yes script language..i dont want to be as fast as a compiled language
<t-roll__o> SUCK MY DICK
<t-roll__o> BITCHES
<t-roll__o> BITCHCUNTS
* t-roll__o slaps apeiros_ around a bit with a large trout
was kicked by apeiros_: t-roll__o
<Jackneill> lol
t-roll__o joined #ruby
<t-roll__o> FUCK U
was kicked by apeiros_: t-roll__o
t-roll__o joined #ruby
<t-roll__o> CUNT
<burgestrand> apeiros_: *shrugs*
<mztriz> T_T
<Jackneill> kickban
<t-roll__o> FUCK OFF
thepix joined #ruby
Telling joined #ruby
<Jackneill> so eg. i can use opengl in ruby?
<musee> i think rubygame uses opengl
<musee> so pretty sure
<musee> yeah
<apeiros_> oh dear, I fail at banning…
<musee> ruby-opengl.rubyforge.org
<burgestrand> there are a bunch of gems for graphics and such, some for creating games as well, I can’t speak for them as I have not used them though
<Jackneill> thanks
tommyblue joined #ruby
<apeiros_> hostmask != nick, shame on me…
<shevy> the troll numbers are legion
<shevy> kill one, five new get spawned
<musee> lol
<musee> yeah...
<apeiros_> assuming 1 out of 1000 is a troll, there's some 7'000'000 trolls on the world…
<Jackneill> *trollface*
eldariof joined #ruby
<shevy> HERE IS ONE!
<shevy> GET JACKNEILL!!!
<shevy> READY YOUR PITCHFORKS
<Jackneill> ?
<Jackneill> .
<Mon_Ouie> Rubygame doesn't use OpenGL, it uses SDL
<Mon_Ouie> Gosu and Ray both use OpenGL
jimmy1980 joined #ruby
attack-tro-lLOL joined #ruby
<attack-tro-lLOL> SUCK MY DICK
<attack-tro-lLOL> FUCKIN LOSER
<attack-tro-lLOL> [17:25] <@FloodBot1> BlauskaerM, this is a check to ensure that you're human and not a spambot: What is the first letter in the word 'man' (which, aside from the obvious meaning, is also a command in Ubuntu to read manual pages)?
<apeiros_> at least he spelled 'loser' right…
attack-tro-lLOL left #ruby
felipegb joined #ruby
TTR0LL-PATR0LL joined #ruby
<TTR0LL-PATR0LL> FUCK OFF
was kicked by apeiros_: TTR0LL-PATR0LL
TTR0LL-PATR0LL joined #ruby
Guest___ joined #ruby
smokerrrrr joined #ruby
<smokerrrrr> FUCK OFF
<smokerrrrr> CUNTS
flip_digits joined #ruby
<Mon_Ouie> ban by nick doesn't look very efficient (with such people, that is)
<apeiros_> hm… should I ban the proxy ips or not? o0
tryIntryOUT joined #ruby
<tryIntryOUT> HAHAHAHA
<tryIntryOUT> FUCKERS
<apeiros_> Mon_Ouie: well, limechat sucks for administrative things… this way his work is at least more than mine.
<burgestrand> hehe
<cuvius> Hi all. I'd like to parse XML from a URL in a streaming fashion (i.e. parse as it's downloading). I'm trying to use Nokogiri::XML::Reader. As far as I can tell, Reader supports this, it only needs an IO object. How can I get an IO object from a URL, that doesn't download the contents up front?
renanoronfle joined #ruby
<apeiros_> cuvius: in the worst case, use a tcpsocket
<apeiros_> but I'd guess net/http has a way to read a response…
<cuvius> I guess it could work with tcpsocket, it just seems very low level, when all I want is "magic_open(url)" to return an IO that reads the contents lazily.
maletor joined #ruby
mickn joined #ruby
dagnachewa joined #ruby
mickn joined #ruby
mxweas_ joined #ruby
nyuszika7h joined #ruby
Azure joined #ruby
niklasb joined #ruby
<Mon_Ouie> Would open-uri do the job?
<cuvius> open-uri unfortunately loads the contents up front.
niklasb joined #ruby
dbgster joined #ruby
jimmy1980 joined #ruby
sdwrage joined #ruby
niklasb joined #ruby
mxweas_ joined #ruby
dchelimsky joined #ruby
niklasb joined #ruby
LittleBill902 joined #ruby
flippingbits joined #ruby
Jake232 joined #ruby
h4mz1d joined #ruby
sdwrage joined #ruby
ikaros joined #ruby
jimmy1980 joined #ruby
workmad3 joined #ruby
dchelimsky joined #ruby
pangur joined #ruby
<pangur> When setting up my ubuntu 11.10 apache2 to run ruby, I followed an old tutorial at http://mattroper.co.uk/2008/04/02/running-ruby-scripts-in-apache2/ but instead of opening the file when I run http://localhost/ruby/test.rb - it tries to download it.
<pangur> Any suggestions?
<apeiros_> pangur: current preferred way to run ruby is by using rack
sbanwart joined #ruby
<RLa> does server accept .htaccess override for those parameters?
<apeiros_> rack with apache is usually done using passenger phusion (an apache module)
<pangur> I put in the .htaccess file.
<RLa> or ruby ee which is passenger with modified memory management
<pangur> So, would I install phusion by sudo apt-get install phusion?
<apeiros_> gem install passenger
Codif_ joined #ruby
<RLa> pangur, i guess it will not be so easy
<pangur> thanks apeiros_
<apeiros_> rack works a bit differently from cgi
<pangur> I have no experience of rack
<RLa> i would start with thin or webrick for testing
<apeiros_> if you prefer using ruby as cgi, the description given in that site seems accurate.
<pangur> I have installed ruby via rvm
<pangur> I am able to set up rubyonrails to work properly but I want to be able to write ruby files without involving rails.
mickn joined #ruby
<pangur> Basically, I want to be able to write a ruby proggy and see it on localhost
<pangur> I am not fussed about how I do it - easier (long-term) the better :)
<apeiros_> pangur: you can try putting the configuration into your vhost config instead of .htaccess
<pangur> I did purge apache2 and then reinstall after that.
Pip joined #ruby
<pangur> I am going to investigate this rack stuff as I want to learn a bit more about it.
looopy joined #ruby
<shevy> pangur, just use ruby in .cgi files
<pangur> Not in .rb files?
<pangur> ok, will test
<shevy> remember the leading line of your .cgi file, the shebang, must point to your ruby
<shevy> and apache httpd.conf needs something like: http://pastie.org/2960812
yourstrly joined #ruby
yourstrly left #ruby
<pangur> I have installed ruby1.9.2 via rvm, so should I replace ruby with ruby1.9.2 in my shebang?
DarthGandalf joined #ruby
<pangur> How do I work out where my ruby is located?
mxweas_ joined #ruby
<shevy> no idea about rvm
<shevy> I swear rvm makes people dumber
<pangur> My version of Ubuntu 11.10 does allow me to install rails3
<shevy> try whereis ruby, but if I would have to make a guess, it would be at either /usr/bin/ruby /usr/bin/ruby1.8 or /usr/local/bin/ruby
<pangur> but rvm makes it possible for me.
<shevy> does or does not
<shevy> I see a "but" but I don't understand the context to that but
<pangur> ruby: /usr/bin/ruby1.8 /usr/bin/ruby /usr/lib/ruby /usr/share/man/man1/ruby.1.gz
dfamorato joined #ruby
<shevy> there. your shebang could be #!/usr/bin/ruby1.8
<shevy> or supposedly, /usr/bin/env ruby would also work
<pangur> When I do ruby -v, it gives ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux]
<pangur> Now that I see that, I am wondering if it has installed a 64bit version rather than a 32bit version.
<shevy> hmm
<shevy> so you also have a 1.9.2p290
<pangur> I guess that I should uninstall the 1.8.7 version
<shevy> one reason I don't like to use what distributions offer is that I don't know where they put things, how they setup things and so on
<shevy> and whether they break something or not by picking apart standard lib
raythecat joined #ruby
Knodi joined #ruby
raythecat left #ruby
Knodi joined #ruby
sepp2k1 joined #ruby
DMKE joined #ruby
ph^ joined #ruby
jimmy1980 joined #ruby
timonv joined #ruby
Black-Heaven joined #ruby
<Black-Heaven> Hi.
visof joined #ruby
<apeiros_> hi Black-Heaven
SegFaultAX joined #ruby
<Black-Heaven> I'm new to Ruby and I have done a verry small project which works well, but, if you have 5 minutes free, I want your opinioon on my code (any optimizations, best practices, usuals convention), for your help, in advance, thanks
<Black-Heaven> Server.rb (http://pastebin.com/t9H82k0K), Front.rb (http://pastebin.com/yCVMgXzM), Flow.rb (http://pastebin.com/uRjcLSnm), Protocols/Factory.rb (http://pastebin.com/Uz1xTH7w), Protocols/Abstract.rb (http://pastebin.com/WxE42eGE), Protocols/TCP_PULL.rb (http://pastebin.com/m3bgK1eb)
<apeiros_> Black-Heaven: it's easier to create a git repository if you've got that many files…
<apeiros_> (and upload it to github, that is)
<drizz> it's easier to create a gist repository
<apeiros_> general advice: require convention is to have require 'front', all lowercase. and have the filenames all lowercase too.
<Black-Heaven> ok
cdepue joined #ruby
<Black-Heaven> I take notes
<apeiros_> also, method names in ruby are (again, only per convention) usually snake_case
<apeiros_> (server.address, server.port)
<Black-Heaven> ?
jrbran joined #ruby
gregorz joined #ruby
<Black-Heaven> ok
<Black-Heaven> eaven if I want them to be constants ?
<apeiros_> Black-Heaven: a method is never a constant
<apeiros_> but yes, constants have to start with an uppercase letter.
<Black-Heaven> port and address are attributes
<apeiros_> e.g. Foo is a constant, but @Foo is not
<Black-Heaven> ah
<Black-Heaven> ok
<apeiros_> yes, attributes are methods. `attr_reader :foo` is just a shortcut for `def foo; return @foo; end`
<apeiros_> (it's a method that defines methods)
<drizz> yo dawg
<Black-Heaven> yes
<Black-Heaven> ok
<apeiros_> it seems quite ok.
<Black-Heaven> ok
<apeiros_> your indentation is off a couple of times, makes code harder to read :)
<Black-Heaven> directory have to be lowercased ?
<apeiros_> I'd probably decouple the reading of the configuration too
jimmy1980 joined #ruby
<apeiros_> Black-Heaven: library directories (stuff that's part of a require)? yes.
<Black-Heaven> in fact i'm using ViM to code and I used Kate to paste
<apeiros_> e.g. if you have a class Foo::Bar, it should be in the file foo/bar.rb
jbw joined #ruby
<Black-Heaven> ok
<Black-Heaven> thank you very much
<apeiros_> I'd create a method that parses a configuration file into a hash
<apeiros_> and let all other methods that currently want a file to read the configuration from accept a hash instead
clockwize joined #ruby
<apeiros_> and instead of inventing your own config file format, I'd probably just use YAML. it's pretty close to what you're currently using.
<Black-Heaven> yes
tomzx joined #ruby
<Black-Heaven> in fact this an imposed format
<apeiros_> oh, you have to read that format?
<Black-Heaven> yes
<apeiros_> hm, ok
<apeiros_> you can simplify the factory part btw.
<apeiros_> classes are objects, so you can pass the easily
<apeiros_> if you need to get a class by its constant, you can use const_get, e.g.: Protocols.const_get("TCP_PUSH")
<apeiros_> (assuming it's Protocols::TCP_PUSH)
<apeiros_> Black-Heaven: do you use ruby 1.9?
jbpros joined #ruby
<Black-Heaven> 1.8.6
<Black-Heaven> yes
<Black-Heaven> ok
<apeiros_> :-/
<apeiros_> can you upgrade to 1.9?
<Black-Heaven> no, because i'm only a guest on my computer
<Black-Heaven> but it's not a problem for the Factory
<Black-Heaven> it's not complex
macabre joined #ruby
lander2k2 joined #ruby
mjording_ joined #ruby
lander2k2 left #ruby
xhubert joined #ruby
xhubert left #ruby
xhubert joined #ruby
jinglebellz joined #ruby
vmatiyko joined #ruby
macmartine joined #ruby
<Black-Heaven> Thank you very much, nothing else?
derailed joined #ruby
<derailed> hi all! i've got an app which is dependend on sinatra and on redis. is there someway i can start both services and stop them using one command?
<derailed> is a 'procfile' what i need or is it 'god' ? im sorta confused
jergason joined #ruby
bosphorus joined #ruby
sdwrage joined #ruby
dcarper joined #ruby
jimmy1980 joined #ruby
workmad3 joined #ruby
minijupe joined #ruby
badabim joined #ruby
apok joined #ruby
cdepue joined #ruby
marting joined #ruby
cooper joined #ruby
berserkr joined #ruby
vitoravelino joined #ruby
vitoravelino joined #ruby
awesome joined #ruby
abstrakt joined #ruby
<abstrakt> n
y_matsu joined #ruby
y_matsu joined #ruby
<abstrakt> what's a module?
<abstrakt> and or what doc should I read from http://www.ruby-lang.org/en/documentation/ to get familiar with this?
<abstrakt> I'm coming from C++/PHP/bash mostly
<Black-Heaven> abstrakt: module is like namespace
<Black-Heaven> but we can do more
<Black-Heaven> it near the PHP's traits
y_matsu joined #ruby
QaDeS joined #ruby
vmatiyko left #ruby
martinklepsch joined #ruby
<abstrakt> what's the difference between class methods and instance methods
<martinklepsch> Hey, I'm using rbenv and installed some gems with bundler.. these gems are not in my path. Where are they located?
<yxhuvud> bundle knows how to find them. bundle exec ..
<burgestrand> abstrakt: class methods are like static methods in PHP, you don’t need an instance of the class to call them, instance methods are… instance methods
<burgestrand> abstrakt: this is not entirely accurate, though, class methods are actually instance methods but on the class’ singleton class
<abstrakt> burgestrand, ahh, ok gotcha
<burgestrand> abstrakt: but that’s just semantics, the core idea is that class methods are attached to the class itself and not an instance of it
raythecat joined #ruby
<abstrakt> there's a singleton class?
<burgestrand> abstrakt: not the same kind of singleton you’d think of from PHP :)
Codif joined #ruby
<abstrakt> ok
<burgestrand> abstrakt: eigenclass it can be called as well
<abstrakt> hmm, i've heard of eigenvalues and eigenvectors, what's an eigenclass?
QKO joined #ruby
<abstrakt> burgestrand, so what makes the difference, syntactically, between an instance method and a class method?
<abstrakt> is there a static keyword or something similar?
<burgestrand> abstrakt: class method: MyClass.class_method(arguments)
<burgestrand> abstrakt: instance method: instance = MyClass.new; instance.instance_method(arguments)
<burgestrand> I’ll pastie it, easier to read with newlines
<abstrakt> burgestrand, hrm... so basically it would be up to you to not use self from within a class method?
<abstrakt> burgestrand, I understand the calling, i'm talking about the def
michas joined #ruby
_kinderman joined #ruby
<burgestrand> abstrakt: ah, coming right up :)
<yxhuvud> abstrakt: self within a class method is the class itself.
<abstrakt> yxhuvud, hm so then is there something equivalent to $this from PHP?
<abstrakt> yxhuvud, i.e. somethingi you need to avoid when writing instance methods?
<Mon_Ouie> I assume $this is self
DDAZZA joined #ruby
<abstrakt> Mon_Ouie, nope, php has both self:: and $this
<yxhuvud> abstrakt: to define a method on an arbitrary object, you can do 'def self.method_name ..'. So to define a class method, do def self.method_name within the class definition
ph^ joined #ruby
<yxhuvud> abstrakt: how shizoid.
BrianJ joined #ruby
Sliker joined #ruby
<burgestrand> lots of examples, some of them are equivalent
<burgestrand> abstrakt: in ruby, there is always some kind of self
<burgestrand> abstrakt: inside an instance method, self is the instance, same as $this in PHP
zul__ joined #ruby
<abstrakt> burgestrand, hahaha, wow that's awesome thanks for the paste
<burgestrand> abstrakt: inside a class method, self is the same as self in PHP, but classes are objects in ruby
<abstrakt> burgestrand, it's exactly what I was looking for
<zul__> I'd like to install data_mapper_mapper into my ubuntu linux 10.04 but when I do gem list I can't find it. Anyone could help me?
<zul__> data_mapper :)
workmad3 joined #ruby
DDAZZA joined #ruby
clockwize joined #ruby
<zul__> I'd like to install data_mapper gem into my ubuntu linux 10.04 but when I do gem list I can't find it. Anyone could help me?
<burgestrand> abstrakt: one thing that is good to know right now is that you cannot do this in ruby: http://pastie.org/private/fhreom3kztegidhdbclmg
<burgestrand> you can do similar things, but just writing the same thing in ruby will mean something else
<zul__> oh sorry this is the first one I use a irc
<zul__> what it means repeat the same question (I'm a newbie)
<abstrakt> burgestrand, er, which part can't you do?
<burgestrand> zul__: did "gem install data_mapper" not work?
<abstrakt> burgestrand, what's wrong with it, in other words?
<burgestrand> abstrakt: that PHP code, essentially adds an instance variable before there is any kind of instance
<zul__> burger no it doesnt find the gem
<burgestrand> abstrakt: in ruby, you cannot create an instance variable on an instance that does not yet exist
sdwrage joined #ruby
<abstrakt> burgestrand, er, ok I don't quite get that, what does an instance variable look like in ruby by default?
<abstrakt> i didn't think you had to declare instance or class vars in ruby
<abstrakt> I thought you just, used them, basically
<abstrakt> via @some_var
<burgestrand> yeah, and if they don’t exist you’ll get nil as its’ value
<burgestrand> I’ll show you how to do the same thing in Ruby as in that PHP example, second
<abstrakt> uhh... but you can set the thing right?
<abstrakt> and then it won't be nil, right?
<abstrakt> @some_var = "blah"
<abstrakt> can you actually do that outside of a def?
<abstrakt> also, I'm minorly confused by this
<abstrakt> "If this made you think of class methods, your next thought might well be ``what happens if I define instance methods within a module?'' Good question. A module can't have instances, because a module isn't a class."
<abstrakt> but I don't see any instance method in that example
<abstrakt> unless... every method, is an instance method, regardless of whether its def occurs inside a class def
<burgestrand> abstrakt: http://codepad.org/asczrmj3
<burgestrand> every method is an instance method on something
<abstrakt> burgestrand, huh, ok cuz "everything is an object" right?
<burgestrand> Yeah
<abstrakt> burgestrand, so really, instance method is kind of redundant in a way, they should just call it a "method" :)
<burgestrand> so even class methods are instance methods, they’re instance methods on the singleton class of that class :p
lolsuper_ joined #ruby
lolsuper_ joined #ruby
<abstrakt> burgestrand, ahh, and every class has a singleton class?
<abstrakt> how does that work?
<abstrakt> that's just automatic, that just happens under the hood or whatever?
<abstrakt> ruby creates a singleton for each class definition?
<burgestrand> so Moo.class_method is actually a method inside class << Moo (moo’s singleton class)
<Mon_Ouie> They are created lazily
<burgestrand> Like Mon_Ouie said, when they are accessed
<abstrakt> Mon_Ouie, ah, ok on demand
<abstrakt> sure, ok so if I don't define any class methods, the singleton probably never gets created
<abstrakt> but if I def Moo.blarp
<abstrakt> then it will create the singleton for me to place blarp() on
<abstrakt> ?
<Mon_Ouie> Yep
<abstrakt> ok got it thanks
<Mon_Ouie> Or maybe it is not that lazy with classes, but you got the idea anyway
<burgestrand> This also means you can add instance methods on the singleton class of instances
<burgestrand> And, even if not always that useful, it’s kinda cool :p
<burgestrand> say…
tburns joined #ruby
stephenjudkins joined #ruby
wilmoore joined #ruby
DDAZZA joined #ruby
<abstrakt> burgestrand, hmm, yeah, not particularly amazing, more like just another variety of syntax for you to use
dfamorato_ joined #ruby
stephenjudkins joined #ruby
<burgestrand> abstrakt: aye
<zul__> burgestrand I solved the data_mapper problem :)
<burgestrand> zul__: :)
martinklepsch joined #ruby
<zul__> just another question: How can I install geokit? geokit is a gem for rails and I don't need rails
<zul__> geokit is a gem
y3llow joined #ruby
s0ber joined #ruby
<burgestrand> If it’s a gem and exists on rubygems.org then same thing, gem install <gemname>
<burgestrand> so, gem install geokit for example
<burgestrand> zul__: ^
looopy joined #ruby
shadoi joined #ruby
apok joined #ruby
<abstrakt> zul__, I think geokit is a gem for ActiveRecord, which is not necessarily rails
<abstrakt> it's just part of the rails stack
<abstrakt> zul__, which DB are you using?
<abstrakt> zul__, you can just run vincenty yourself if you're on MySQL or Postgres
Kn|t3 joined #ruby
Jake232 joined #ruby
Tempus joined #ruby
<Jake232> If I have a hash, like follows
<Jake232> 'zero' => 0, one => 1
<Jake232> etc
<Jake232> Is there anyway, to find the "inverse" of a hash, without a completely seperate hash?
<Jake232> So I could go some_hash.inverse(1)
<Jake232> and it would throw out one
<zul__> I'm using mysql
<Tempus> Quick Q: What's the equivalent of python's dir() in ruby?
<zul__> yes I like the question of Tempus..
<burgestrand> Tempus: was three years since I did python, what’s it do?
<Jake232> burgestrand: Perfect, thanks.
<Tempus> It lists all methods, subclasses, and properties of an object.
<zul__> dir(something) shows all the methods of 'something'
<Tempus> eg. dir(str) = [ 'capitalize', 'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find', 'format', 'index', etc...
andrewhl joined #ruby
<burgestrand> As far as I know, there’s no built-in variant that does that. Objects don’t have properties (they can have instance variables though), their methods can come from a little bit every where (you can see them with obj.instance_methods) and their subclasses? Hmm. ObjectSpace.each_object(YourClass) does something similar as far as I know.
<burgestrand> Actually, I meant obj.methods, not obj.instance_methods.
<Tempus> It is essentially what you do if documentation sucks or if you have some object and you don't know what it can do.
<burgestrand> I use pry for that.
<zul__> pry?
<burgestrand> One moment. :)
<zul__> can you do an example?
colloquialismic joined #ruby
<Tempus> Well, I'll start with obj.methods before I pull in another gem.
atmosx joined #ruby
<burgestrand> Keep in mind it’ll often return more than what you really want.
<burgestrand> (or different things and whatnot :))
<Tempus> Hmm, output is annoying, but it'll do.
<Tempus> Yeah, it just spammed stdout
<Tempus> Somewhere in there is a gleam of hope though, thank you.
<burgestrand> Naw, it won’t do nothing with stdout, that’s your own doing.
<burgestrand> It returns an array of symbols.
<Tempus> Yeah.
<Tempus> But printing/putsing ruby arrays is by nature spammy.
looopy joined #ruby
<Tempus> Especially when they're as long as the one it returned for me.
<burgestrand> Indeed, large amounts of information don’t print well unless formatted. :)
daniel_hinojosa joined #ruby
<abstrakt> zul__, well if you've got MySQL then you can do the vincenty query in SQL
<abstrakt> zul__, just do a raw query for that one thing, I've done it before, it's not too difficult
<abstrakt> I mean, vincenty is long, but it's just a bunch of sin() cos() and multiplication and division
workmad3 joined #ruby
<Tempus> Sorry, just started a ruby project, long time been working in python.
<Tempus> Used to pythons very neat and readable output style.
pangur joined #ruby
nbl_ joined #ruby
tburns joined #ruby
<Tempus> K, thanks again.
Tempus left #ruby
<nbl_> Hi all, I'm french and I have some questions, I'm noob/low in ruby, but I would like to start with the minimal configuration, I launch webrick server, it run, but I would like to use erb, somebody can help me ?
perryh joined #ruby
AuraHxC joined #ruby
Axsuul joined #ruby
<pangur> On Ubuntu 11.10, I have installed ruby-1.9.3 via RVM. Previously, I had ensured that there was no other version of Ruby on my system. I have made 1.9.3 the default.
<pangur> When I try accessing /var/www/ruby/test.rb via http://localhost/ruby/test.rb, it offers me a DOWNLOAD rather than running the file in my browser like an html file.
<pangur> What am I doing wrong?
<pangur> Rather, how do I fix it so that it will work.
<pangur> ?
mikepack joined #ruby
iocor joined #ruby
me345 joined #ruby
nonotza joined #ruby
altivec joined #ruby
AuraHxC left #ruby
jbpros joined #ruby
pangur left #ruby
dfamorato joined #ruby
dchelimsky joined #ruby
<atmosx> anyone has any experience with the twitter API?
altivec joined #ruby
banisterfiend joined #ruby
tburns joined #ruby
bosphorus joined #ruby
cdepue joined #ruby
johntitor joined #ruby
seivan joined #ruby
thoolihan joined #ruby
iocor joined #ruby
s14 joined #ruby
Norrin joined #ruby
dch4pm4n joined #ruby
riush joined #ruby
Sliker joined #ruby
jinglebellz joined #ruby
mindCrime joined #ruby
kartouch joined #ruby
wilmoore joined #ruby
fahadsadah joined #ruby
cdepue joined #ruby
looopy joined #ruby
incluye joined #ruby
minijupe joined #ruby
cableray joined #ruby
igotnolegs joined #ruby
andreassaebjoern joined #ruby
<andreassaebjoern> Hi! I would like to access a variable in an object by the string representing it's name. This variable name is stored as a string in a hash. Is that possible?
aj910martin joined #ruby
ChampS_ joined #ruby
dfamorato joined #ruby
cafesofie joined #ruby
<andreassaebjoern> I found out that I can use .send for this :)
fahadsadah joined #ruby
<apeiros_> andreassaebjoern: technically, send invokes a method
sythe joined #ruby
sythe joined #ruby
<andreassaebjoern> apeiros_: is there a more efficient way of achieving this?
sythe joined #ruby
sythe joined #ruby
kke joined #ruby
looopy joined #ruby
d3c joined #ruby
rpowell joined #ruby
p1d_ joined #ruby
conor_ireland joined #ruby
brownies joined #ruby
ping-pong joined #ruby
ChampS_ joined #ruby
malkomalko joined #ruby
lkba joined #ruby
sbanwart joined #ruby
fridim_ joined #ruby
esparkman joined #ruby
becom33 joined #ruby
<becom33> why does it keep the last view value in STUDOUT.flush ?
dbgster joined #ruby
milkpost_ joined #ruby
<apeiros_> becom33: what is a "view value"?
randym joined #ruby
BrianJ joined #ruby
<becom33> well I read some word files using a loop . when it moves to the next word file , it shows like the last word file
<becom33> if its ok I can PM you the script
<becom33> apeiros_:
colloquialismic joined #ruby
colloquialismic joined #ruby
gearaholic joined #ruby
jay_zawrotny joined #ruby
looopy joined #ruby
Cervajz joined #ruby
<apeiros_> becom33: no, please paste it on a paste service like pastie.org
rickmasta joined #ruby
marcamilly joined #ruby
CannedCo_ joined #ruby
niklasb joined #ruby
bosphorus_ joined #ruby
mxweas_ joined #ruby
marting joined #ruby
ph^_ joined #ruby
jbpros joined #ruby
becom33 joined #ruby
pen_isident joined #ruby
jimmy1980 joined #ruby
stephenjudkins joined #ruby
rpowell joined #ruby
ChampS_ joined #ruby
andrewblack joined #ruby
anynick123 joined #ruby
anynick123 left #ruby
luckyruby joined #ruby
<marcamilly> I have a gem installed locally, and am trying to run it in IRB
<marcamilly> but I keep getting 'no such file to load -- rubyoverflow'
<marcamilly> i.e. once I get in the IRB console, I do 'require rubyoverflow'
<marcamilly> and that's what I see
<burgestrand> marcamilly: ruby 1.8?
<marcamilly> yep
<marcamilly> 1.8.7
<burgestrand> marcamilly: you’ll need to require rubygems first
brownies joined #ruby
<marcamilly> oh
<burgestrand> marcamilly: you don’t need to do it on 1.9 :)
_debo joined #ruby
<marcamilly> would it be better to switch to 1.9.2 ?
<marcamilly> lemme switch
<burgestrand> yes unless you have a reason to stay on 1.8
<marcamilly> still happens in 1.9.2-p0
<burgestrand> Did you install the gem as well?
<marcamilly> oh
<marcamilly> i have to re-install it?
<marcamilly> interesting
<burgestrand> Yeah :)
<marcamilly> ahh, kewl
<marcamilly> it wasn't installed
<marcamilly> sweet
<marcamilly> that worked
<marcamilly> thnx
<burgestrand> yw :)
<mxweas_> I've got the following three lines:
<mxweas_> url = URI.parse(page_url)
<mxweas_> host_with_port = url.host
<mxweas_> host_with_port << ":#{url.port}" unless url.port == 80
<mxweas_> the last line adds my port number to host_with_port. However, when I use url.host from now on, it also has the port number added
<mxweas_> which leads me to think host_with_port and url.host are pointing to the same string instance.
<mxweas_> Should I copy url.host when I assign it to host_with_port?