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
<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
<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.
<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
<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
<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>
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
<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>
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.
<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?