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/
scribble1 joined #ruby
benja-M- joined #ruby
michael_mbp_ joined #ruby
michael_mbp__ joined #ruby
steph021 joined #ruby
steph021 joined #ruby
ephemerian left #ruby
Aaaarg joined #ruby
michael_mbp_ joined #ruby
looopy joined #ruby
randym joined #ruby
wyhaines joined #ruby
looopy joined #ruby
Targen joined #ruby
atmosx joined #ruby
zomgbie joined #ruby
JStoker joined #ruby
Sliker joined #ruby
michael_mbp_ joined #ruby
akem joined #ruby
akem joined #ruby
<kuzushi> tomorrow is basically like my personal christmas
<kuzushi> but mostly because I can buy a bunch of books at 40% off at pragprog
<kuzushi> :-D
<rpowell> oh man seriously?
<rpowell> why do I have to be broke right now =[
<emocakes> pragprog?
havenn joined #ruby
<terraUNDverra> kuzushi: why is it so cheap tomorrow, and does that apply to everyone? or do you have some kind of special coupon?
<terraUNDverra> kuzushi: got a link talking about it kuzu?
zodiak joined #ruby
JStoker joined #ruby
michael_mbp_ joined #ruby
ebobby joined #ruby
swarles joined #ruby
<swarles> So, I'm looking for a decent documentation on how to effectivly use the Win32API, i really only need to produce a Yes, No, Cancel message box
<Adman65> what's the difference between alias and alias_method ?
advorak joined #ruby
<Adman65> samuelkadolph: cool, ty
<Adman65> I'm surprised I haven't learned that by now lol
<samuelkadolph> In basic usage they are the same
<Adman65> ya well, I'm never doing basic stuff lol
VnutZ joined #ruby
mxweas_ joined #ruby
advorak joined #ruby
mxweas_ joined #ruby
zwang joined #ruby
rpowell joined #ruby
michael_mbp joined #ruby
<kuzushi> terraUNDverra, its for everyone
<kuzushi> the code is just "turkey" for a coupon, 40% off the whole store
namidark joined #ruby
<terraUNDverra> kuzushi: link pls
sbanwart joined #ruby
incluye joined #ruby
wmoxam joined #ruby
<terraUNDverra> kuzushi: thanks
looopy joined #ruby
michael_mbp_ joined #ruby
wyhaines joined #ruby
juarlex joined #ruby
michael_mbp_ joined #ruby
dbgster joined #ruby
IrishGringo joined #ruby
dyer joined #ruby
looopy joined #ruby
tmart joined #ruby
looopy joined #ruby
conntrack joined #ruby
michael_mbp_ joined #ruby
conntrack joined #ruby
travisjeffery joined #ruby
samxor joined #ruby
Dangr_ joined #ruby
travisjeffery joined #ruby
nari joined #ruby
VnutZ joined #ruby
michael_mbp_ joined #ruby
mxweas_ joined #ruby
looopy joined #ruby
looopy joined #ruby
RLa joined #ruby
replore_ joined #ruby
mxweas_ joined #ruby
tayy joined #ruby
Banistergalaxy joined #ruby
redgetan joined #ruby
Hachima joined #ruby
michael_mbp_ joined #ruby
crescendo joined #ruby
crescendo joined #ruby
mpan joined #ruby
tomzx joined #ruby
mxweas_ joined #ruby
<mpan> guys, what's the idiomatic way to call one function from a list of functions?
<RLa> what you mean?
<RLa> i guess it depends on container where you keep your functions or blocks
<mpan> er, say I already have a bunch of functions defined: a, b, c
looopy joined #ruby
<mpan> and I have a list that maps from some stuff to which function I want to call
<mpan> like, can I convert defined functions into procs or something?
<RLa> one way would be to use classes and store instances
<mpan> uh, these functions are already defined
looopy joined #ruby
<RLa> all those classes would have one method with common name
<mpan> (by a certain gem I'm using)
<RLa> well, you can always wrap/delegate :)
<mpan> and I'm trying to avoid a large switch statement if I can help it
<mpan> is there something (preferably not eval) to call a function whose name is given by a string, for example?
<RLa> class MyDoer; def doSomething; end; end; doers = [MyDoer.new], doers[0].doSomething <- something like that
<RLa> or use map instead of array
<RLa> hash*
<mpan> I mean
<mpan> I could use send
<mpan> but that's rather messy
roaminghorse joined #ruby
frogstarr78 joined #ruby
luoluoluo joined #ruby
<mpan> what I mean is: I want to write less than if I used a giant bunch of if-else statements
frogstarr78 joined #ruby
<mpan> like the function can take 1, 2, or 3, and it should call a, b, or c, respectively, for example
<RLa> i would avoid metaprogramming as much as possible
mikeric joined #ruby
<mpan> short of metaprogramming, I dunno how I could avoid that giant chain of if-else
lucastorri joined #ruby
lucastorri left #ruby
sbanwart joined #ruby
looopy joined #ruby
wyhaines joined #ruby
looopy joined #ruby
sbanwart joined #ruby
<shevy> yeah RLa
looopy joined #ruby
looopy joined #ruby
<deryl> does anyone know of any existing applications (for examination) that uses Marshalled file dumps to capture previously generated internal objects with the purose of 'replaying' a previous session. I'm looking for a multi-tiered object (Something along the lines of a has_many and belongs_to dump and rebuild)
dasfugufish joined #ruby
<deryl> s/purose/purpose/
<deryl> that was my entire intent when I added Marshal.dump. My own implementation was obviously severely flawed. So I'd like to look at a real world example to see what I was doing wrong.
sven_ joined #ruby
roaminghorse joined #ruby
looopy joined #ruby
S1kx joined #ruby
S1kx joined #ruby
looopy joined #ruby
wmoxam joined #ruby
<deryl> http://www.ruby-doc.org/core-1.9.3/Marshal.html just isn't giving it to me. I *thought* that if I dumped the has_many class, the belongs_to was also dumped (docs say possibly with associated subordinate objects) and so if I pass Marshal.load a has_many Type shouldn't the belongs_to automatically be associated as well? (If I dump set, then set.items should be dumped too correct?, and if I read in set, then set.items[] of types item should be created ...
<deryl> ... automatically correct?
jwmann joined #ruby
<deryl> there's nothing that i see in the doc that says i need to interate through Marshal.load in fact their Marshal.load(data) doesn't.
jwmann joined #ruby
wmoxam joined #ruby
gayasentinel joined #ruby
Draco_ joined #ruby
dhodgkin joined #ruby
qzg joined #ruby
igotnolegs joined #ruby
michael_mbp_ joined #ruby
dotnull joined #ruby
michael_mbp_ joined #ruby
satyavvd joined #ruby
patant joined #ruby
savage- joined #ruby
sbanwart joined #ruby
iamjarvo joined #ruby
mengu joined #ruby
dotnull joined #ruby
sbanwart joined #ruby
dotnull joined #ruby
Indian joined #ruby
wmoxam joined #ruby
sbanwart joined #ruby
roaminghorse joined #ruby
dot_null joined #ruby
m_W joined #ruby
looopy joined #ruby
sbanwart joined #ruby
Indian joined #ruby
Cervajz joined #ruby
Cervajz joined #ruby
looopy joined #ruby
xol joined #ruby
fridim_ joined #ruby
klauern joined #ruby
sbanwart joined #ruby
looopy joined #ruby
p0y joined #ruby
wadedog joined #ruby
looopy joined #ruby
cbuxton joined #ruby
sbanwart joined #ruby
wmoxam joined #ruby
advorak joined #ruby
x0F_ joined #ruby
dabaR joined #ruby
<dabaR> If I have module Beanstalk, like provided by the beanstalkapp gem, and a module Tactica, which includes a class called Beanstalk, how can I call stuff from the Beanstalk module inside class methods of the Beanstalk class?
thecreators joined #ruby
looopy joined #ruby
rhinux joined #ruby
looopy joined #ruby
<mksm> dabaR, ::Beanstalk.class_method()
wmoxam joined #ruby
michael_mbp joined #ruby
jensn joined #ruby
tomzx joined #ruby
savage- joined #ruby
michael_mbp_ joined #ruby
goodieboy joined #ruby
terraUNDverra joined #ruby
michael_mbp_ joined #ruby
wmoxam joined #ruby
<dabaR> THanks
tobym joined #ruby
sbanwart joined #ruby
Seisatsu joined #ruby
sbanwart joined #ruby
michael_mbp joined #ruby
elevenarms joined #ruby
sbanwart joined #ruby
mikeric joined #ruby
cbuxton joined #ruby
sbanwart joined #ruby
michael_mbp joined #ruby
jay_zawrotny joined #ruby
kawa_xxx joined #ruby
radic joined #ruby
subbyyy joined #ruby
<subbyyy> whats a good free book to learn ruby and rails afterwards?
Zoxc left #ruby
sbanwart joined #ruby
eft joined #ruby
txa-ea left #ruby
sbanwart joined #ruby
mxweas_ joined #ruby
cbuxton joined #ruby
rpowell joined #ruby
jensn joined #ruby
looopy joined #ruby
steph021 joined #ruby
steph021 joined #ruby
looopy joined #ruby
<shevy> subbyyy the only way to learn ruby is to write ruby scripts
<subbyyy> yep, but i wanted some formal reading really :)
<shevy> I can't get your hopes up. The RoR books I tried to read sucked.
<shevy> Pickaxe for ruby was ok but ultimately the only way to really learn is to dive in head and start writing something
<subbyyy> i see, thanks shev :)
<subbyyy> im trying to read learn ruby the hard way, just to get a handle on syntax
<subbyyy> but its probably not for me since, im not really a beginner programmer
<shevy> well, if you are interested in learning ruby first, that's easier
<shevy> you worked through http://pine.fm/LearnToProgram/?Chapter=01 yet?
<shevy> you can go through it quickly if you can program :)
<subbyyy> not yet, thanks!
<shevy> it was my favourite tutorial when I started with ruby, I think I worked through it three times. there are a few others... but they were not as nice as that one
<subbyyy> you know any advanced ruby books/docs i can read through
<shevy> well there is this ... metaprogramming in ruby book
<shevy> perhaps if you are new to ruby, it may be helpful for you
<shevy> I forgot the real name hmmm
<subbyyy> thanks, appreciate it :)
<shevy> I didn't like it too much though but perhaps because I was not new to ruby... and also because metaprogramming annoys my head a lot
<shevy> it has some helpful tricks though
mikeric joined #ruby
jensn joined #ruby
robyurkowski joined #ruby
dubz joined #ruby
flip_digits joined #ruby
guest29381289371 joined #ruby
Indian joined #ruby
huxleyd joined #ruby
elevenarms joined #ruby
<guest29381289371> I am going make a search engine for search form millions of titles. should I 1)load all titles into Ram and do some similar text matching or 2) give each title some tags so that I do tag matching?
rpowell_ joined #ruby
<terraUNDverra> guest29381289371: i dont believe you're capable of pulling this off
<terraUNDverra> guest29381289371: pay someone in india to do it for u
<mksm> lol
<guest29381289371> some people advice me to compare tags only. is it an old method?
terraUNDverra joined #ruby
<RLa> the goal of search is to find something
<RLa> if tags make that easier then use tags
michael_mbp_ joined #ruby
<mksm> tag are useful to search stuff by attributes
<mksm> if you're just searching the title
<mksm> read on sphinx, see if it fits
emptyflask joined #ruby
looopy joined #ruby
Cervajz joined #ruby
looopy joined #ruby
michael_mbp_ joined #ruby
sdavis joined #ruby
michael_mbp joined #ruby
terraUNDverra joined #ruby
Aaaarg joined #ruby
looopy joined #ruby
michael_mbp joined #ruby
looopy joined #ruby
randym joined #ruby
michael_mbp_ joined #ruby
sdavis joined #ruby
michael_mbp_ joined #ruby
michael_mbp joined #ruby
macmartine joined #ruby
michael_mbp_ joined #ruby
statarb3 joined #ruby
michael_mbp joined #ruby
looopy joined #ruby
michael_mbp_ joined #ruby
statarb3 joined #ruby
statarb3 joined #ruby
michael_mbp_ joined #ruby
smgt joined #ruby
yxhuvud joined #ruby
mrpanda joined #ruby
michael_mbp_ joined #ruby
burgestrand joined #ruby
trivol joined #ruby
beseku joined #ruby
beseku joined #ruby
JohnBat26 joined #ruby
ryec joined #ruby
tomzx joined #ruby
statarb3 joined #ruby
Mchl joined #ruby
xpot joined #ruby
otakutomo joined #ruby
replore_ joined #ruby
petschbot joined #ruby
ph^ joined #ruby
ziggles joined #ruby
Indian joined #ruby
beseku joined #ruby
replore__ joined #ruby
havenn joined #ruby
LouisJB joined #ruby
ph^ joined #ruby
statarb3 joined #ruby
statarb3 joined #ruby
rpowell joined #ruby
luoluoluo joined #ruby
EddieBluh joined #ruby
sullx joined #ruby
bugz^ joined #ruby
statarb3 joined #ruby
robotmay joined #ruby
zommi joined #ruby
gentz joined #ruby
Cervajz joined #ruby
djdb joined #ruby
LouisJB joined #ruby
pen joined #ruby
trivol joined #ruby
usultis joined #ruby
stoffus joined #ruby
MissionCritical joined #ruby
fai|safe joined #ruby
ryanf joined #ruby
LouisJB_ joined #ruby
fai|safe_ joined #ruby
krz joined #ruby
workmad3 joined #ruby
Morkel joined #ruby
subbyyy left #ruby
xybre_ joined #ruby
ryanf_ joined #ruby
dr_bob joined #ruby
LouisJB joined #ruby
batlock666 joined #ruby
DarkFoxDK joined #ruby
jensn joined #ruby
ephemerian joined #ruby
rpowell joined #ruby
fai|safe left #ruby
Helius joined #ruby
mafolz joined #ruby
BiHi joined #ruby
Nss joined #ruby
ammar01 joined #ruby
p1d joined #ruby
otakutomo joined #ruby
Cervajz joined #ruby
iori joined #ruby
kalusn joined #ruby
probst joined #ruby
rpowell joined #ruby
cyri_ joined #ruby
Tuxist joined #ruby
james_cotterill joined #ruby
jbpros joined #ruby
becom33 joined #ruby
<becom33> how to read xml in ruby ? I cant find a good artial on that
bluOxigen joined #ruby
<Tasser> becom33, nokogiri
sdavis joined #ruby
adrake_ joined #ruby
grekko joined #ruby
grekko joined #ruby
<StitchedKite> /whois felispeskus
<StitchedKite> lol
<StitchedKite> stupid keyboard
roaminghorse joined #ruby
sdavis joined #ruby
LouisJB joined #ruby
codespectator joined #ruby
michael_mbp_ joined #ruby
becom33 joined #ruby
nicoulaj joined #ruby
dr_bob joined #ruby
hurikhan|Work joined #ruby
Nopik joined #ruby
robotmay joined #ruby
Adman65 joined #ruby
emptyflask joined #ruby
adambeynon joined #ruby
mengu joined #ruby
tatsuya_o joined #ruby
tatsuya_o joined #ruby
pi3r joined #ruby
<sie> Should I commit db/schema.rb to version control?
<Tasser> I've got "raw-data/17370645.pxml" and I'd like "17370645" - idas?
<Tasser> sie, #rubyonrails
<sie> wups, thought I'm in there
<Tasser> sie, ruby language here
desmovalvo joined #ruby
<sie> i know, i know
jarin joined #ruby
ramusara joined #ruby
michael_mbp_ joined #ruby
Helius joined #ruby
enikar joined #ruby
Spockz joined #ruby
james_cotterill joined #ruby
james_co_ joined #ruby
xol joined #ruby
tatsuya_o joined #ruby
canterer joined #ruby
<canterer> Is there good ruby develop client?
<canterer> ?
<Nopik> what is a ruby develop client?
<canterer> ruby client GUI
<canterer> :GUI
<Tasser> never heard of
<Nopik> die? i'm using RubyMine
<Nopik> ide
<shevy> DIE
<shevy> DIE!!!!
<canterer> ye
<shevy> DIE!!!!!!!!!!!!!!!!!!!!
<Tasser> die ide?
<canterer> IDE
<Nopik> stupid autocorrection ;)
<shevy> die, ide, die! all of them!
<shevy> seriously, all IDEs I tried got into my way so far :(
<canterer> for a beginner
<Nopik> shevy: i was using vim for like 12 years so far.. and somehow ruby mine was good enough for me.. the more i use it the more i like it
<Nopik> it is not perfect, but overall i think it is great
satyavvd joined #ruby
<shevy> ruby mine? isn't that a RoR application?
<canterer> I want the IDE for ruby to have the prompt facility
<shevy> canterer what does that mean, you want a terminal embedded somewhere? that's easy, with VTE. Geany has that
<canterer> prompt facility
<shevy> what is that
<shevy> "Do you want to delete this file?" [PROMPT]
<canterer> assistance
<canterer> class A ;
<canterer> A.memeber
<Tasser> shevy, the emacs one sucks, haven't tried any better so far. Separate urxvt + some magic from the WM that does the cd ;-)
<canterer> I can get the memeber more easy....
<canterer> by using the assistance
Vendethiel joined #ruby
<shevy> canterer I like memeber
<shevy> but cucumber is better
<canterer> understand what I say?
<shevy> almost as well as I understand polish
<canterer> where are you from?
<canterer> fun :)
<shevy> Tasser hmm I don't want to be too tied to any WM
<shevy> canterer I live in Rubylandia
<shevy> it's a beautiful place with red diamonds
pen joined #ruby
<canterer> which country
<canterer> afica?
<Tasser> shevy, why not?
nari joined #ruby
<canterer> ?
justinmcp joined #ruby
<shevy> Tasser they tend to get into my way and most of the time there is something that sucks
Nockenfell joined #ruby
<shevy> I am quite happy with KDE konsole though... running on gnome 2.x something here right now
<Tasser> shevy, ah well, everything sucks
<canterer> I am a beginner for studying the ruby
<shevy> Tasser yeah... just the degrees of suck vary :)
<canterer> how can I study this language
<canterer> ?
<shevy> canterer there is no hope
<Tasser> canterer, english? Just start reading ;-)
<canterer> ?
<canterer> 什么意思?
<shevy> canterer go work through this http://pine.fm/LearnToProgram/?Chapter=01
<canterer> thanks
<canterer> ;)
sdavis joined #ruby
<Tasser> canterer, sorry, I can't talk any Chinese :-)
<canterer> ah fun:)
iocor joined #ruby
<canterer> my english is so poor , so I want to speak in chinese:)
<terraUNDverra> canterer: use google translate
<Tasser> canterer, well, learn english. Got a proxy btw? :-)
<terraUNDverra> Tasser: your english is pretty damn strange too bish
<Tasser> terraUNDverra, possible
<terraUNDverra> hehe but then again i think your german is likely strange too :P
<shevy> canterer nie hau! wa liao!
<terraUNDverra> canterer: cao ni maaaaaaa
<canterer> wo cao ma de
<shevy> budumo ... wo ba za ju
<Tasser> terraUNDverra, depends on your point of view ;-)
<shevy> hmm
<shevy> bavarian german is ok
<canterer> terrUNDverra,是一个三炮
<shevy> I can't read that :(
Nockenfell left #ruby
<Tasser> shevy, google translate produces garbage only...
<Tasser> terraUNDverra, switch the position of 'garbage' and 'only'?
<terraUNDverra> Tasser: is german your native language?
james_cotterill joined #ruby
<shevy> Tasser yeah google translate is worse than babelfish
<shevy> I think they do it on purpose though
<Tasser> terraUNDverra, yeah
<Tasser> shevy, not better ^^
krz joined #ruby
sdavis joined #ruby
Sliker joined #ruby
RomD joined #ruby
fgro joined #ruby
sysuaf joined #ruby
ph^ joined #ruby
ikaros joined #ruby
flippingbits joined #ruby
sdavis joined #ruby
rpowell joined #ruby
sdavis joined #ruby
<StitchedKite> ich bin Kiten
<StitchedKite> :P
g0bl1n joined #ruby
g0bl1n joined #ruby
<shevy> what
pen joined #ruby
jarjar_prime joined #ruby
Manhose joined #ruby
jbpros joined #ruby
Indian joined #ruby
Vendethiel joined #ruby
sdavis joined #ruby
Sliker joined #ruby
workmad3 joined #ruby
<thomasfedb> Does anybody know when either ruby-debug will be made to work with 1.9.3 or ruby 1.9.3 will be made to work with ruby-debug?
fermo joined #ruby
Silker joined #ruby
sdavis joined #ruby
Amirh joined #ruby
<JohnBat26> hello
<Tasser> thomasfedb, I'd use pry ;-)
Manhose joined #ruby
<JohnBat26> please, tell me, how print all global_variables values ?
tvw joined #ruby
fixl joined #ruby
sdavis joined #ruby
ChampS_ joined #ruby
tormar joined #ruby
tormar left #ruby
<Amirh> JohnBat26: I have the same question
Helius joined #ruby
josephwilk joined #ruby
xhr joined #ruby
sdavis joined #ruby
sdavis joined #ruby
Nies joined #ruby
emmanuelux joined #ruby
flaleite joined #ruby
sdavis joined #ruby
sdavis joined #ruby
rsampaio joined #ruby
sdavis joined #ruby
<shevy> thomasfedb I think it is currently a hot dispute
<terraUNDverra> Amirh, JohnBat26: you want the value of...alll...global variables at once?
<terraUNDverra> Amirh, JohnBat26: isn't that too much information?
<Amirh> terraUNDverra: that could be an academic research project
sdavis joined #ruby
<terraUNDverra> Amirh: global_variables.each { |v| puts eval(v) }
<terraUNDverra> JohnBat26: ^
Draco_ joined #ruby
<Amirh> terraUNDverra: thanks dude
jbpros joined #ruby
sdavis joined #ruby
enikar joined #ruby
Manhose_ joined #ruby
ramkash joined #ruby
michael_mbp_ joined #ruby
sdavis joined #ruby
sdavis joined #ruby
jensn joined #ruby
sdavis joined #ruby
sdavis joined #ruby
sbanwart joined #ruby
pen joined #ruby
<thomasfedb> shevy, well I do wish they'd get on with it./
Sugamele joined #ruby
Sugamele left #ruby
<terraUNDverra> thomasfedb: i just use pry because it's so great and can do most things and it makes me feel cool to use it too
sdavis joined #ruby
<Tasser> terraUNDverra, and because you wrote? it?
<terraUNDverra> Tasser: i didnt write anything, im just a poor jewish girl stuck in an attic waiting for the wound of heavy boots outside my door
<terraUNDverra> sound*
<Tasser> terraUNDverra, at least the only strange thing about me is my english... :-P
sdavis joined #ruby
<thomasfedb> Look, cats are cool.
sdavis joined #ruby
sdavis1 joined #ruby
tmart joined #ruby
burgestrand joined #ruby
Vendethiel joined #ruby
maasha joined #ruby
rnz joined #ruby
<rnz> hi all
<maasha> I need to install RubyInline on a Mac without Xcode (build environment) and a version of Ruby/Gem that is too old for the latest RubyInline. Ideas?
<burgestrand> I tried that once, didn’t work out well for me, I wish you luck
<rnz> how to call function to check variable on write to class property?
<burgestrand> rnz: what do you mean?
<thomasfedb> rnz, that makes no sense.
Pip joined #ruby
jimgg joined #ruby
fixl joined #ruby
jbpros joined #ruby
sdavis joined #ruby
JonnieCache joined #ruby
sdavis joined #ruby
Vendethiel joined #ruby
wmoxam joined #ruby
<rnz> http://pastebin.com/vfNYvBU8 - On initialize property @key_buffer_size = check, how to check on write to property
<dagobah_> I've got a segmentation fault when calling 'instance_variable_defined?' - is there an alternative method I can use to bypass this?
<thomasfedb> dagobah_, instance_eval
fff joined #ruby
<terraUNDverra> thomasfedb: why would he use that
<thomasfedb> terraUNDverra, he could check if it was defined from within the eval.
<dagobah_> eugh
<terraUNDverra> thomasfedb: how exactly
dyer joined #ruby
sdavis joined #ruby
fff left #ruby
<terraUNDverra> dagobah_: but more importantly, wtf is it SEGFAULTING? are you writing some kind of messed up C extenssion?
<frerich> Did anybody here install Ruby on Mac OS X using Homebrew? I just noticed that 'brew install ruby' gave me a 64bit build of Ruby 1.9.3, but I'd need a 32bit build. I wonder how to do that.
<terraUNDverra> thomasfedb: btw still curious about your answer
<dagobah_> No I'm using grit, it's coming up with a segmentation fault on the call to :instance_variable_defined?
<rnz> I mix module to class
<rnz> class Chef::Recipe::MySQL # add class
<rnz> include mysql
<rnz> end
<rnz> and create object
<rnz> m = Chef::Recipe::MySQL.new(@mem_lim)
<rnz> m.key_buffer_size = 8777216 # value not in range and need override this in class
<rnz> m.nil
<terraUNDverra> dagobah_: there's no way in hell that should happen, can u give me steps to reproduce it?
RomD joined #ruby
shevy joined #ruby
<terraUNDverra> rnz: dont paste here paste on gist.github.com
<dagobah_> Not trivially, it's (unfortunately) occurring in a rails app.
<dagobah_> I will try and reproduce it in isolation though.
<terraUNDverra> dagobah_: can you run it in gdb
<terraUNDverra> dagobah_: or just show me the backtrace?
<rnz> <terraUNDverr> this is note paste. paste early http://pastebin.com/vfNYvBU8
<terraUNDverra> rnz: i want to get my gang of thugs to beat you down
<rnz> <terraUNDverra> why! )
<rnz> ?
<terraUNDverra> rnz: because you're a scoundrel
<rnz> ololo
<rnz> )))
axisys joined #ruby
<dagobah_> I'll paste the backtrace if you'd like.
<terraUNDverra> dagobah_: Yeah
wyhaines joined #ruby
<dagobah_> terraUNDverra: There's some stuff I had to cut out (let me know if you want it) https://gist.github.com/933fdfb1ff1a7af392bc
BiHi joined #ruby
probst joined #ruby
Locke23rus joined #ruby
<rnz> dagobah> I don't paste upper code, I write and press enter
<rnz> so.. how about question?
JStoker joined #ruby
<dagobah_> terraUNDverra: And the C backtrace is https://gist.github.com/387a166de8f9c2d8d178
<terraUNDverra> dagobah_: why so many nested yields?
<rnz> how to check property on write, example: mi.property = <invalid value> ?
<terraUNDverra> looks crazy
RomD joined #ruby
<dagobah_> Indeed! Not sure I can get round it ...
tatsuya_o joined #ruby
<burgestrand> rnz: in ruby, mi.thingy = whatever is a method call to m.thingy= method
nate_h joined #ruby
<burgestrand> rnz: http://codepad.org/Ey25tzqN
<burgestrand> rnz: however, @thingy = "anything" is an assignment, and you can't really intercept that the same way
dazoakley joined #ruby
linduxed joined #ruby
<linduxed> just a quick question, because i've forgotten the notation
xissburg^mba joined #ruby
ph^_ joined #ruby
<linduxed> what does $1[0, 1] mean?
<burgestrand> $1 is a thread-local global variable, referring to match group #1 after matching something with a regex
<xissburg^mba> what does :thing means?
<burgestrand> It’d be a string, so the [0, 1] would grab the first character (index 0, length 1)
<burgestrand> xissburg^mba: it’s a symbol, which is a kind of value in ruby
<burgestrand> a symbol literal you could call it, like 5 is a number literal and "thing" is a string literal
<xissburg^mba> hm i think i get it
<xissburg^mba> thanks
<rnz> <burgestrand> thx... so... ruby didn't to check property on change and override it....
<burgestrand> rnz: I don’t understand you
<rnz> sorry for my bad english
<rnz> <burgestrand> ruby can' t to call function on change property?
<burgestrand> rnz: not when you assign it directly like @property = value, only when doing object.property = value
<linduxed> burgestrand: thx
<burgestrand> linduxed: :)
m_W joined #ruby
<linduxed> burgestrand: hmmm
<linduxed> burgestrand: i still don't quite understand why the __ in this should be "one t-three"
<linduxed> assert_equal __, "one two-three".sub(/(t\w*)/) { $1[0, 1] }
<linduxed> maybe it's because i don't know what .sub() does
<linduxed> or maybe it's the regex that's confusing me
jensn joined #ruby
<rnz> <burgestrand>thx, but this is bad news...
<burgestrand> linduxed: do this once: "one two-three".sub(/(t\w*)/, "X")
<burgestrand> linduxed: after that: "one two-three".sub(/(t\w*)/) { "X" }
james_co_ joined #ruby
<burgestrand> linduxed: then: "one two-three".sub(/(t\w*)/) { $1 }
<burgestrand> linduxed: and finally, "two"[0, 1]
<burgestrand> (try it in IRB)
<linduxed> burgestrand: yeah i assumed irb
<linduxed> burgestrand: hmmm
<linduxed> burgestrand: wasn't \w whitespace?
<burgestrand> linduxed: word ;)
<linduxed> aaaah
<linduxed> hahaha
<burgestrand> linduxed: or, actually, word character
<burgestrand> whitespace is \s :)
<linduxed> because i understood it as "t then any amount of whitespace"
<burgestrand> hehe
<burgestrand> that explains the confusion
<linduxed> that confused stuff yeah
shellox joined #ruby
<shellox> hi
<shellox> how to convert a string in an array?
pac1 joined #ruby
<burgestrand> shellox: convert a string in an array to what?
<shellox> burgestrand: I have a string like [['1', 'a'], ['2', 'b']]
<shellox> and i just want to turn this in an array
<burgestrand> shellox: okay, what format is this? json?
<shellox> ruby?
<burgestrand> shellox: you could eval it, but that could be dangerous if you don't have control over what comes in
<burgestrand> shellox: since it’s a string, you have to parse it in some way to turn it into a ruby structure of some sort
<shellox> how would you do it with this structure?
<shellox> it should look like this just as an array
<burgestrand> "[['1', 'a'], ['2', 'b']]" is a string, to make it an array [['1', 'a'], ['2', 'b']], you need to parse it somehow
<burgestrand> eval will interpret it as ruby code, and give you a result
tomzx joined #ruby
<burgestrand> eval("[['1', 'a'], ['2', 'b']]") # => [["1", "a"], ["2", "b"]]
<burgestrand> And the example you gave is valid JSON, so you can use JSON.parse for it too
<shellox> eval would be better, no?
<shellox> it would save the json depedency
<burgestrand> Ruby 1.9 has JSON in standard library :)
<shellox> ah
<shellox> I use a kind of workaround to store an multidimensional array in redis first and store it there ;)
<shellox> so i convert the array to a string -> redis -> receive data from redis -> string to array
<burgestrand> Oh, I see
malkomalko joined #ruby
<burgestrand> Yeah, I’d store it as a JSON string in Redis probably
Manhose joined #ruby
iamjarvo joined #ruby
ecolitan joined #ruby
rippa joined #ruby
monkey13 joined #ruby
Spockz joined #ruby
s0ber joined #ruby
vitoravelino joined #ruby
vitoravelino joined #ruby
iocor joined #ruby
<rnz> <burgestrand> thanks! http://codepad.org/PR99LnGL
burgestrand joined #ruby
dr_bob joined #ruby
burgestrand joined #ruby
peleteiro joined #ruby
looopy joined #ruby
jfredett joined #ruby
KenSentMe joined #ruby
Adman65 joined #ruby
<xiphias_> i'm guessing most of you in here are familiar with MVC
<xiphias_> right?
tatsuya_o joined #ruby
rsampaio joined #ruby
tormar joined #ruby
<Tasser> xiphias_, #rubyonrails
<shellox> the most rails ppl get a train station to early and stop in #ruby instead of #rubyonrails :/
<burgestrand> Rails ain’t MVC, not in the traditional sense anyway
kawa_xxx joined #ruby
<burgestrand> … but if it’s traditional or not is not usually the question coming after the above mentioned one :)
CannedCo_ joined #ruby
tk__ joined #ruby
Lord-Harlot joined #ruby
<xiphias_> i'm not doing rails
<xiphias_> it's the principle of MVC i have questions about
<shellox> burgestrand: i dont like mvc much ;)
<shellox> also prefer sinatra > rails for web stuff
<xiphias_> i use padrino
<burgestrand> xiphias_: just ask your actual question, it’s easier to answer if we have it
<xiphias_> does one violate MVC if a view instantiates another view?
<xiphias_> shouldn't the controller do this?
Gromister joined #ruby
radmacd joined #ruby
<burgestrand> Yes
<burgestrand> But web applications are a bit special when it comes to MVC, it does not apply fully
<xiphias_> gotcha
<xiphias_> this isn't a web app, really
<xiphias_> wxruby
Vendethiel joined #ruby
<xiphias_> i should have mentioned that
<xiphias_> my apologies
apeiros_ joined #ruby
goodieboy joined #ruby
<burgestrand> Your controller should only be an event handler, it should react to things happening in the view (say, button presses) and update the models accordingly, which in turn might update the view
<xiphias_> got it
<shellox> WTF! i look in the code why my js code is not working for the form validation and the real issue was that i forgot the > in <form> -.-
<linduxed> for a line like "def method_with_var_args(*args)", what does the * mean?
<xiphias_> equivelent to ellipsis in C/C++
<burgestrand> linduxed: the rest of the arguments
<burgestrand> linduxed: it’ll capture them in args
<burgestrand> (as an array)
desmovalvo joined #ruby
<linduxed> burgestrand: ok thx
<burgestrand> linduxed: http://codepad.org/Iv7ciMgK
ankhers joined #ruby
<burgestrand> in 1.9, you can do some funny things with argument lists, for example you can have optional arguments before required arguments, like this:
<burgestrand> def funny_method(optional = "hello", required)
bier joined #ruby
<burgestrand> You can also use that *args thingy and still require arguments after it:
bier|tp joined #ruby
<burgestrand> def funny_method(arg_a, *args, arg_b)
kalusn joined #ruby
<linduxed> ok, nice link thx
fridim_ joined #ruby
looopy joined #ruby
ohookins joined #ruby
<ohookins> hi, i'm a little confused about the usage of SystemExit as an exception
<ohookins> i've seen some code call something like "raise SystemExit.new(1, 'some message')" but this doesn't look right
probst joined #ruby
<ohookins> in fact i can't get at the message in a rescue block at all, is it possible to set/get the exception message when using SystemExit?
Indian joined #ruby
<tmart> just found a bug in my code. i know how to fix it, but im curious why its happening. I thought i could create a 2-dimensional array of zeros with [[0]*x] * y, but if i set, say arr[2][2], that change is ALSO made in arr[0][2], arr[1][2], [3][2], [4][2], and so on. why is this happening?
<tmart> its like each row of the array is pointing to the same data
<rippa> because it does
<rippa> *is
Martiini joined #ruby
Manhose_ joined #ruby
<tmart> but yet, each element in a row is different, even though i used the same syntax to create them
<JonnieCache> try calling object_id on the different subarrays, that might be illuminating
<tmart> to create row: [0] * x to create next dimension: [row] * y
<rippa> tmart: Array.new(10) {[0]*10}
<rippa> tmart: that's because Fixnum is not normal object
<tmart> not normal in what sense?
<rippa> there's only one instance of each
<JonnieCache> like symbols
<tmart> ahh, i see
<JonnieCache> its an optimisation thing
<tmart> thank you guys
toddsundsted joined #ruby
luoluoluo joined #ruby
albemuth joined #ruby
Morkel joined #ruby
probst joined #ruby
utnick joined #ruby
atmosx joined #ruby
nicoulaj joined #ruby
Cervajz joined #ruby
Pip joined #ruby
michael_mbp_ joined #ruby
Spockz joined #ruby
<linduxed> ok i seriously can't figure out how to get this line to work
<linduxed> assert_match /__/, exception.message
<linduxed> the message is "private method `my_private_method' called for #<AboutMethods:0x00000002172918>"
JamieD joined #ruby
<linduxed> but
<linduxed> when i put that without quotes in between the slashes, it doesn't work
<linduxed> last time i had this kinda problem i only needed to escape to parenthesis, but now i don't know what to escape
Targen joined #ruby
JStoker joined #ruby
enikar joined #ruby
ohookins left #ruby
kawa_xxx joined #ruby
Dangr_ joined #ruby
amacgregor joined #ruby
ikaros joined #ruby
robyurkowski joined #ruby
emocakes joined #ruby
poppiez joined #ruby
<poppiez> I'm on mac and I just installed the json gem but I keep getting: no such file to load json loaderror. why is this?
<poppiez> hmm, apparently I have to require rubygems first
Adman65 joined #ruby
<poppiez> any way to avoid that?
jonathanrwallace joined #ruby
v0n joined #ruby
<burgestrand> poppiez: use ruby 1.9 instead, mac os have an old version of ruby
wmoxam joined #ruby
<burgestrand> you have to install it yourself though :x
michael_mbp_ joined #ruby
<poppiez> hehe gives me the bad news and then ditches :P
dch4pm4n joined #ruby
closedbracket joined #ruby
RomD joined #ruby
crankycoder joined #ruby
terraUNDverra left #ruby
SplitNova joined #ruby
<catphish> is there a way to delete / reinstall all gems (using rvm)
<mitchty> export/clear/import i think, ask in #rvm
<catphish> "gem list | cut -d" " -f1 | xargs gem uninstall -aIx" did the job :)
<NuclearLucifer> Same as: for i in $(gem list |grep -v '^*'|awk '{print $1}'); do gem install $i ; done
<catphish> i upgraded some C libs and then got landed with this: Inconsistency detected by ld.so: dl-open.c: 582: _dl_open: Assertion `_dl_debug_initialize (0, args.nsid)->r_state == RT_CONSISTENT' failed!
<NuclearLucifer> This solution would reinstall all gems.
<catphish> hmm, still fails :(
crankyco_ joined #ruby
savage- joined #ruby
goodieboy joined #ruby
<linduxed> could anyone help me with solving my previous question?
eldariof joined #ruby
<linduxed> i get this error message
<linduxed> Expected /private method `my_private_method' called for #<AboutMethods:0x000000011f6520>/ to match "private method `my_private_method' called for #<AboutMethods:0x00000001e427e8>".
tacocat joined #ruby
<linduxed> that's when i've replaced the __ between the slashes with the string
zommi joined #ruby
valner joined #ruby
tacocat joined #ruby
lkba joined #ruby
valner left #ruby
Gruber joined #ruby
failshell joined #ruby
apeiros_ joined #ruby
aurora joined #ruby
<apeiros_> poppiez: don't know whether you got an answer, but one way to avoid that is by using ruby 1.9 instead of 1.8 :)
<apeiros_> (1.8 is ancient anyway)
<poppiez> apeiros_: using 1.9 now :) seems to be working
Azure joined #ruby
Azure joined #ruby
dasfugufish joined #ruby
Azure joined #ruby
Azure joined #ruby
senny joined #ruby
<linduxed> oh ffs
dazoakley joined #ruby
<linduxed> i figured it out, there's no way to be sure the hex after AboutMethods: is the same, so one should put in a regex there
marcuspat joined #ruby
goodieboy joined #ruby
LouisJB joined #ruby
spinagon joined #ruby
michael_mbp_ joined #ruby
steph021 joined #ruby
steph021 joined #ruby
azure joined #ruby
azure joined #ruby
azure joined #ruby
rippa joined #ruby
ikaros joined #ruby
g0bl1n joined #ruby
rippa joined #ruby
looopy joined #ruby
jeremih joined #ruby
jeremih left #ruby
Azure joined #ruby
Jake232 joined #ruby
iocor joined #ruby
cbuxton joined #ruby
Azure joined #ruby
Azure joined #ruby
Nies joined #ruby
sullx joined #ruby
rickmasta joined #ruby
travisjeffery joined #ruby
Azure joined #ruby
Danielpk joined #ruby
rushed joined #ruby
Beoran__ joined #ruby
<Danielpk> I trying to use OhMyZsh and RMV, i added the necessary lines to .zshrc and loaded and tried to relog.. but rvm wont work..
<Danielpk> any tip?
<xissburg^mba> what is => ?
<Tasser> xissburg^mba, key => value in a hash
<xissburg^mba> oooouch
<xissburg^mba> hm, so , what does this mean in a class definition has_many :comments, :dependent => :destroy ?
<xissburg^mba> has_many is an...?
<Tasser> a method
<samuelkadolph> You can omit the {} for a hash when you are calling a method. foo(key => value) is the same as foo({ key => value })
<rippa> or even foo(arg1, arg2, key => value, key2 => value2)
<xissburg^mba> but, it that the signature of the method?
* xissburg^mba need to study more ruby before rails, or not study rails at all
<xissburg^mba> :s/study/learn/g
probst joined #ruby
<apeiros_> xissburg^mba: has_many is a class method
<xissburg^mba> but what is happening there? The method is being called?
<apeiros_> class MyModel; has_many :foos; end --> is the same as: MyModel.has_many(:foos). it will set state in the class itself.
<apeiros_> yes, the method is being called.
<xissburg^mba> ooh, yea, to define a method you start with def....
<apeiros_> correct. or you use the define_method or define_singleton_method methods.
<apeiros_> though, has_many is a method that *will* define additional methods when being called.
flexd joined #ruby
Azure joined #ruby
Azure joined #ruby
tobym joined #ruby
eerdogan joined #ruby
Mahoek joined #ruby
nimred joined #ruby
draginx joined #ruby
travisjeffery joined #ruby
jbpros joined #ruby
pabloh joined #ruby
iocor joined #ruby
jrist-out joined #ruby
dr_bob joined #ruby
syamajala joined #ruby
<failshell> anyone knows a gem that would do what PageSpeeds does in Firefox more or less. meaning, listing all resources from a web page?
iocor joined #ruby
<failshell> im getting near my goals with anemone/nokogiri
<failshell> but to parse the objets from CSS is trickier
<yfeldblum> the sass project has a CSS parser (well, a SCSS parser, but SCSS is a superset of CSS)
<failshell> parsing is the not issue really
<failshell> its just that if you parse the file, you don't know which images for example, are called on a given page
hydrozen joined #ruby
goodieboy joined #ruby
killing-joke joined #ruby
killing-joke left #ruby
draginx left #ruby
Russell^^ joined #ruby
robotmay joined #ruby
kartouch joined #ruby
BrokenCog joined #ruby
tmart joined #ruby
mengu joined #ruby
codespectator joined #ruby
Deesl joined #ruby
sdavis joined #ruby
<samu> anybody dealed with thin?
BrokenCog joined #ruby
<samu> I wonder does it have to use so much memory ;)
flip_digits joined #ruby
Draco_ joined #ruby
travisjeffery joined #ruby
thecreators joined #ruby
demian`_ joined #ruby
excelsio1 joined #ruby
jtrudeau joined #ruby
macmartine joined #ruby
Hachima joined #ruby
LouisJB joined #ruby
goodieboy joined #ruby
bjorkintosh joined #ruby
thone_ joined #ruby
tvo joined #ruby
<samu> allright, wht the hell 'passenger start' tries to build whole nginx?
Jake232 joined #ruby
EddieBluh joined #ruby
nyuszika7h joined #ruby
mengu_ joined #ruby
mengu_ joined #ruby
dubz joined #ruby
LouisJB_ joined #ruby
jsz` joined #ruby
dchelimsky joined #ruby
caveat- joined #ruby
Zanacross joined #ruby
AngerNESS joined #ruby
<samuelkadolph> samu: Because passenger needs nginx or apache to work
<samu> I think that a simmilar funcionality to djangos 'runfcgi' would be nice in ror
<samuelkadolph> cgi sucks
<samu> currently I have to do some weird admin ninjitsu to allow users to host their own ruby apps with any ruby version they want/.
<samu> and THIS sucks much more than fcgi.
<samuelkadolph> Then don't use passenger for that
<samu> there isn't any good alternative for that.
<samuelkadolph> Passenger is probably the second worst choice if you need to support multiple rubies.
<samuelkadolph> The worst being cgi
<samuelkadolph> Proxy to unicorn/thin/whatever?
<samu> so what's the best? ;z
<samu> thin, yeah
<samu> 120MB of ram per app?
<samu> please... ;-)
<samuelkadolph> And you think passenger is good with memory? Ahahaha
<samu> nope, I don't, I just wan't to get rid of passenger.
<yfeldblum> samu, it's easy: use RVM, have a start script that knows which port and which ruby version to use for each app, use nginx to proxy to the app, done
<samuelkadolph> So do you have any system admin or ruby experience at all? Doesn't sound like it
<samuelkadolph> yfeldblum: I just said that?
<samu> Yes, I do actually have some system admin experience, being asked to make RoR for one of my users, but I actually can't find any good solution for that
<samu> I mean, okay, maybe eating 120MBs of ram per app, or use one worker per TCP port is good for you
<samu> but comparing it to other language solutions, it sucks.
tayy joined #ruby
<samuelkadolph> Maybe you should get the author to stop using so much memory then
<yfeldblum> samuelkadolph: you mentioned proxying, but not using RVM and having a smart start script
<samu> yfeldblum: and that smart start script would launch...?
<samuelkadolph> yfeldblum: Because that makes no sense but that's irrelevant because proxying is the only important part
<samu> I know about rvm, it's not a problem, really
<samu> what I'm looking for is a good backend, to which I can proxy that.
<samuelkadolph> Unicorn, thin, trinidad, torquebox, etc
<samuelkadolph> At least use Google before asking in irc
<samu> as I said, ~100Mbytes per app isn't good solution ;)
atmosx joined #ruby
<samuelkadolph> If the app is that large then it's hard to avoid that
<samu> yeah, so let's avoid thin, because it's thin that is actually eating so much memory ;)
<yfeldblum> samu: what i do is, that smart start script reads the file ".ruby-version" in the app root to find out the ruby version, and reads the file "Procfile" (google it) to find out what the app start command is, and uses RVM to switch rubies and then starts the app
<samu> yfeldblum: Again - I'm not asking how to change ruby version per instance, but looking for a light and good backend for ror.
<samuelkadolph> No you're not
<samuelkadolph> You're asking in irc and not doing anything
<samuelkadolph> Looking implies a certain amount of action on your part including actually going and looking at some of the solutions
crankycoder joined #ruby
<yfeldblum> samu: thin, unicorn, rainbows, whatever the app wants (whatever the app specifies in its Procfile)
<samu> yes, I can see that you find fun in trying to troll me. Don't assume I haven't done anything, you haven't asked even what have I tried. And I have tried all backends I could actually google, including thin, mongrel and unicorn. That's why I'm saying that thin eats so much memory.
looopy joined #ruby
<yfeldblum> j/c, what's the evidence that thin eats memory?
<samuelkadolph> He doesn't have any
<yfeldblum> for example, what metric are you watching?
<samuelkadolph> He just sees it using memory and assumes something is wrong
<samu> top, and ps output.
<samu> for me, 100Megabytes for a simple backend is way too much.
<samuelkadolph> I dub you king of FUD
atmosx left #ruby
<samuelkadolph> Now I'm curious why you won't mention mongrel or unicorn at all. Seems rather interesting you said you tried them but only thin is evil
<samu> I actually did, but you were too busy in thinking of how to troll me ;)
crankycoder joined #ruby
<samu> I said, that one tcp port per worker, and having at least three for a single app isn't good.
<samuelkadolph> No you didn't
<samuelkadolph> unicorn doesn't use more than 1 port nor do you need more than 1 instance of it per app
<yfeldblum> samu: so far as i know, MRI never frees memory back to the operating system, even if it's actually not using that memory anymore
<yxhuvud> I don't see how 3 ports is a problem?
<samu> multiply it with 100 users, and an average of 2 or 3 apps per each.
<samu> or more - and then look at django, it doesn't require more than a single unix socket.
<yxhuvud> samu: oh noes, you only have 64k ports lefts then!
<yfeldblum> i don't see 250 ruby processes per server ... working very well ...
<samuelkadolph> yellow5: I'm not sure if YARV does that but MRI definitely doesn't. That's why ree came along
<samuelkadolph> yfeldblum ^^
<samuelkadolph> Among other reasons
<yfeldblum> also jruby & rubinius should have better GCs
<samu> yxhuvud: but still, it isn't very convenient to make users search for free ports, especially on a machine where more than 30k ports are used in a random order ;-)
<yxhuvud> samu: uh. now you compare a web framework to a webserver. that seems somewhat silly
<yfeldblum> samu: use ephemeral ports
<samu> yxhuvud: but ror is a framework, not a webserver, and yet other frameworks don't require a webserver to run well ;)
<samu> a *dedicated* one.
<yfeldblum> they all do
<samuelkadolph> Pretty sure he's just a crappy troll
<yfeldblum> oh, dedicated, not the file-oriented ones
<samu> yfeldblum: I don't see any evidence that django requires a dedicated webserver.
<samuelkadolph> Or just a really bad at computer
<yfeldblum> ruby/rack/rails is not a file-oriented system
<samu> I can easily use the same webserver to deploy django and php, just passing requests to django, while still serving static content with nginx.
<samuelkadolph> That's what passenger does, surprise surprise
<samu> Oh just stop trolling - we have already talked about switching versions of the language per app, I know it might be hard find relation between that and what we're talking about now, but at least give it a try ;0
<samu> ;)
<yfeldblum> samu: you mean http://code.google.com/p/modwsgi/ ?
<samuelkadolph> I'm pretty sure the only troll here is you
<samuelkadolph> You think django is better than rails and just want to start crap in ruby channels
<samu> no, I'm just searching for a similar way to deploy it, but all you keep doing is try to make a troll out of me, provoking me with shitty comments.
<samu> so if it's the only thing you want to do in this conversation, then don't even bother trying.
<samu> yfeldblum: well, not exactly, I was talking about fastcgi, not wsgi.
<samuelkadolph> That pretty much confirms it
<samuelkadolph> Come back later and try to troll harder. You should have some fud reasons for not using unicorn, trinidad or torquebox
<samu> Oh just go away, troll in your sandbox.
skrewler joined #ruby
<samuelkadolph> I wish more people like him went to #ruby-lang so they could get banned. Always funny watching trolls get banned.
<wmoxam> lol
<samu> I see that you find fun in this poor trolling, so I'll just simply add you to my ignore list, so I could see what smart people have to say.
<deryl> he gav you the right answer. you just didn't like it. apache+unicorn+rvm, nginx+unicorn+rvm
<samuelkadolph> Oh no, the dreaded ignore list of random troll in #ruby.
<deryl> go forth and multiply
<samuelkadolph> Well yfeldblum mentioned rvm
<samuelkadolph> I don't see it as being needed but it would help for someone that doesn't want to manage the rubies themselves
<wmoxam> it is true that Ruby web hosting still sucks to some degree
<samuelkadolph> No it isn't
<wmoxam> samuelkadolph: sure it is
<wmoxam> it's better than it was
<wmoxam> much better
<samuelkadolph> Passenger is great unless you need more than 1 ruby version
<wmoxam> could be better still
<samuelkadolph> Then you use unicorn or thin
<wmoxam> samuelkadolph: exactly
<wmoxam> :D
<deryl> wow install apache, add the mod_reqrite and mod_proxy, set up the virtual host, install rvm, install the needed rubies and gemsets, set the per-project rvmrc files, install and use unicorn_rails with unicorn_rails -D -e production -c config/unicorn.conf and away you go
<wmoxam> could be better
<deryl> done/done
<samuelkadolph> And if you app runs fine on jruby, use torquebox or trinidad
<samu> wmoxam: well, memory consumption is still a big issue here.
<wmoxam> deryl: thanks for proving my point
<wmoxam> samu: that one is not going away
<samu> Yeah, I was just about to write that it can't be changed
<samuelkadolph> Everything consume memory
<wmoxam> that's the tradeoff you've made
<wmoxam> memory for developer time
<samu> so I guess I will just have to make some serious limits for ror.
<wmoxam> if you don't like that tradeoff then use something else
<deryl> so when you go too severe on the restrictions/limits you can blame it all on ruby or rails?
<deryl> pfft
<samu> I mean, limits for ror apps allowed.
jay_zawrotny joined #ruby
<wmoxam> samu: what are you trying to accomplish?
<wmoxam> samu: you run a hosting service?
kirun joined #ruby
<samuelkadolph> I bet he's some system admin at one of the crappy shared hosting companies that try to put 100 customers on a single server.
<samuelkadolph> Afal: lol
<samu> yeah. And I'm searching for some 'not-so-much' resource consuming solution.
<samu> wmoxam: I guess that I'll have to stay with thin, as it is easy to make it work with nginx on map-based config
<samu> (mongrel and unicorn isn't)
<yfeldblum> samu: i don't think rails apps are meant to be on shared hosting, where the sharedness is that they're all bunched into a single process
<samu> yfeldblum: yeah, that's the issue.
<samu> I mean, the machine has a big ammount of ram
<wmoxam> samu: yeah, Rails is terrible for shared hosts
<samu> and it's dedicated for www hosting only
<wmoxam> it's not worth the hassle
<yfeldblum> samu: the solution is to respect what rails is, and write your software with that respect in mind, rather than try to force rails to do X that it doesn't do
<samu> but still, I don't like it when a single webpage takes so much resources.
<samuelkadolph> Rails is not a single webpage
<samuelkadolph> See, I told you he's a troll
<yfeldblum> samu: tell them to write in php then
<yfeldblum> samu: if they want cheap hosting
<wmoxam> samu: everyone who asks in #rubyonrails gets told to *not* use a shared hosting service
<samu> yfeldblum: it's not a matter of telling them what to do
<samu> neither a price matter
<samu> because introducing ror means they have to pay more for such hosting package
<wmoxam> samu: you need to charge them a lot more
<wmoxam> :p
<samu> the thing is that when I do something there, I wan't to keep it lightweight and easy to deploy
CannedCorn joined #ruby
friskd joined #ruby
<deryl> its want not wan't
<samu> But if you're saying there is no way to make ror apps consume less memory (i mean - thin, unicorn, mongrel, etc), than I have to deal with it.
<deryl> (you done it a couple times so i'm thinking you think it really does have a ' when it doesn't. only reason i say anything)
<samu> deryl: sorry, I forgot to mention that I am not a native english person ;-)
<deryl> thus why i wasn't being rude about it. just mentioning for edification reasons
jbw joined #ruby
<yfeldblum> deryl: it's it's not its
<samu> Sure, I know that I might sound weird, it is not my language, but I'm trying ;)
<yfeldblum> deryl: also, edificationally
<wmoxam> samu: the most popular Rails hosting company charges $35/month per *instance* that it runs (though the first instance is free)
<deryl> yfeldblum: yeha i always get that wrong (the its)
<deryl> yfeldblum: and no, the way i used edification is absolutely correct
<samu> wmoxam: and I guess that is something like the price I will have to introduce.
<yfeldblum> deryl: sorry, i meant that "it's it's not its" was also meant to be for edification reasons, not to be rude
<deryl> lol cool :)
<samu> wmoxam: overselling PHP was simple - a 1-2Mb worker spawns, serves and dies, so the memory is very clean; P
<samu> wmoxam: I know heroku ;-)
<deryl> i always get that one wrong and i AM a native englishs peaker
<deryl> s/shs/sh/
<samuelkadolph> wmoxam: Heroku is quite different than his shared hosting setup
<deryl> guh. nm
<wmoxam> samuelkadolph: yup
<samuelkadolph> deryl: Nah, you're a native 'MERICAN speaker
<wmoxam> samuelkadolph: just trying to illistrate how expensive it is to host Rails apps
MekkisFreenode joined #ruby
<samuelkadolph> It's not
<deryl> samuelkadolph: lol true true
LouisJB joined #ruby
<wmoxam> samuelkadolph: it is
<samuelkadolph> There's a huge difference between a dedicated solution and shared
<samuelkadolph> No it's not
<samuelkadolph> Otherwise cpanel and the others wouldn't support it
<deryl> We take the good old fashioned English language and butcher it by dropping the useless letter such as U from COLOUR to COLOR.
<wmoxam> comparatively it is
<samuelkadolph> Compared to php? Sure. PHP has had a massive headstart on shared hosting software
<samuelkadolph> But rails is catching up
csavola joined #ruby
<deryl> in a dedicated solution you generally hav absolute control over the machine. in shared you rarely have. (sometimes you're lucky if you have *enough* permissions to do what you want!)
<samuelkadolph> It's already caught up and is way ahead in dedicated hosting
<wmoxam> samuelkadolph: php has a runtime that is way cheaper to run
* deryl has an anti-fetish for shared-hosting solutions.
<samuelkadolph> That's insulting to the term runtime
<wmoxam> samuelkadolph: don't be a zealot
<samu> wmoxam: and it can be easily hacked to be even cheaper ;)
<samu> realy easily.
<samuelkadolph> PHP is just a thin wrapper around C
<wmoxam> php is well suited to running simple webapps in low reasource environments
<yfeldblum> ruby apps have the entire app loaded into memory before any request hits; there's no reading from disk during a request, no loading code, etc; it seems that would be rather cheaper than reloading 100 files every request
<samuelkadolph> C is better at that
<wmoxam> samuelkadolph: the dev time tradeoff in that case isn't economical
<Mon_Ouie> C is the most convenient language for web apps, surely
<wmoxam> it was in the early/mid 1990s
<samu> :D
dch4pm4n joined #ruby
<samu> It was much easier to host webapps when nobody actually needed them.
<deryl> ahhh the sounds of the good ol' php vs. rails/ror debate.. just in a different wrapper
<apeiros_> wmoxam: doesn't php still clock in with ~50MB RAM/instance?
jarjar_prime joined #ruby
<samuelkadolph> Wow
<samu> apeiros_: You mean, per worker?
<samuelkadolph> Man, samu's website and hosting look incredibly shady
<apeiros_> samu: yes, per apache worker/instance/whatever you call it
<wmoxam> apeiros_: but it's torn down after the request
<samuelkadolph> http://samu.pl/#rules
<samu> apeiros_: nope, it actually doesn't ;)
<apeiros_> wmoxam: woah, no sane system does that
<apeiros_> you leave the worker running and let it accept the new request
<apeiros_> spare workers & stuff
sahli_ joined #ruby
<samu> samuelkadolph: this is not my hosting company, this is my playground to check solutions before they actually go on production.
<samu> I see that you still haven't found anything better to do ;-)
<samuelkadolph> php can fork or use the worker system
<samuelkadolph> Well, mod_php
<apeiros_> wmoxam: if it is still at 50MB, I'm not convinced it is cheaper than rails. I'll have to check, but I think our apache workers with phusion weigh in less than that
<samu> apeiros_: single php worker shouldn't take more than 3 Mbytes, but some crappy spawners might still use so much memory.
michael_mbp_ joined #ruby
<wmoxam> apeiros_: that's just with mod_php, no?
parus joined #ruby
<apeiros_> wmoxam: yes, which was back when I did php the (by far) most widespread way to run php
<samuelkadolph> I've always wondered how people use so much memory in their rails app.
<apeiros_> what do the cool php kiddos use nowadays?
<apeiros_> samuelkadolph: it's easy to write bad code in high level languages…
<samuelkadolph> True
<wmoxam> apeiros_: I'm just thinking that using plain CGI or FCGI can be reasonable for many php apps that you'd want to host on shared hosting
<wmoxam> apeiros_: ie: shared hosting is generally for small, low trafficed apps
<wmoxam> thus php is well suited ofr it
<samu> wmoxam: actually, fastcgi is the most commonly used way to deploy php for a shared hosting right now
<apeiros_> wmoxam, samu - well, ruby alone ticks in with 1.5MB here
<apeiros_> so if you run it as cgi/fcgi, it won't be much over that
<wmoxam> samu: yeah, thought that might be the case
<samu> but yes, comparing rails to php isn't good here, a framework to a language.
<apeiros_> granted, ruby objects are heaver than comparable structures in php
<samuelkadolph> It's fairer to compare php to rails than to ruby
<wmoxam> apeiros_: rails isn't great under cgi/fcgi, too much framework to load
mickn joined #ruby
<apeiros_> wmoxam: you're speaking as if cgi and fcgi were basically the same…
<apeiros_> yes, rails is terrible for cgi for the reason you stated
<wmoxam> well, ok, fcgi is fine for Rails
<apeiros_> no, it isn't terrible for the reason you stated for fcgi.
<wmoxam> my bad
<apeiros_> you could say turn the same against php…
<wmoxam> apeiros_: in some cases
<apeiros_> mod_php/cgi'd php is bad because you'll not be able to load a reasonably big framework
<wmoxam> yeha
<samu> in general, mod_php is a bad idea, due to it's security issues
<apeiros_> samu, so what do people use today? suExec'd php?
<samu> but most people thing of mod_suphp when talking about it, which also gives some performance issues.
<apeiros_> then your issue about framework loading gets even worse afaik…
<samu> think, not thing*
<samu> apeiros_: well, currently the most common way is to use php-fpm
<apeiros_> with mod_php you could at least get stuff like zend_encoder and some other code cachers…
* apeiros_ googles
<samu> but this is a bit more to configure.
<apeiros_> so fcgi…?
<samu> some people still install apache and mod_php (sometimes even without mod_suphp, which is sick) and run a shared hosting on it
<deryl> but thats part of your job as the seller
<mitchty> with the amount of time spent arguing you could have prototyped a solution
<samu> and then wonder why is it so damn slow, and memory/cpu consuming.
<deryl> TO configure that stuff. TO do it FOR your customers. to add the most commonly used toolsets so theya re on par with their own level of competitors
<apeiros_> at least it sounds like they reinvented fcgi…
aresnick joined #ruby
<samu> apeiros_: well, php-fpm is good, but has a tiny little issue for shared hosting, but as fair as I know, it is (or it will be) fixed in the current/next release.
<samu> but still, it's a cheap way to earn money on shared hostings.
<apeiros_> samu, but it IS basically the same as fcgi, no?
trivol joined #ruby
<samu> it listens on fcgi, yes, but fpm is written quite well
<aresnick> Hi! I have a Module Foo, and I'm including it in two classes, Bar1, Bar2. Within Module, I'd like to be able to call Bar1.new or Bar2.new. In other words, I'd like call a method from Module's parent, kinda like super.send But super doesn't work, unsurprisingly. Does the fact that I'm even looking to do this mean I'm doing something wrong? Or is there a right way to go about it?
eerdogan_ joined #ruby
<samu> I mean, yeah, in fact it uses fcgi and listend on unix sockets*
<samu> instens*, misstype.
<samu> shit. ;D
<samu> listens.
<samuelkadolph> aresnick: When are you trying to call Bar1.new? In a method?
<aresnick> samuelkadolph: Yeah, in a method of the Module
<apeiros_> why do I now have the urge to write a webserver in C? o0
* apeiros_ puzzled
<samuelkadolph> apeiros_: lol
<apeiros_> sometimes I hate my NIH-syndrome…
<samuelkadolph> aresnick: What is the point of calling Bar1.new when the method you call is on an instance of Bar1?
tayy_ joined #ruby
<apeiros_> aresnick: you're aware that when you include a module, the methods will be on the *instances* of the class, and that Bar1.new and Bar2.new would be on the class itself?
<samuelkadolph> apeiros_: Shoo, I said it first :P
<aresnick> apeiros_, samuelkadolph: Now I am =) OK, that makes sense then
<apeiros_> samuelkadolph: I don't read you. you're boring :-p
<apeiros_> j/k
<samuelkadolph> lol
<apeiros_> (it's friday, I'm full of nonsense today)
<samuelkadolph> After using ruby and rubygems, I want to kill myself after trying to find a way to share code in ObjectiveC.
<apeiros_> I'm especially full of nonsense when I've had a great week. wrote a nice little issue tracker which integrates into pivotal.
<aresnick> apeiros_, samuelkadolph: Basically, I have a function that I would like to use across multiple Classes, and that method needs to have access to the .new method of each of those classes. What's the right way to do that?
<apeiros_> aresnick: you have a method. there, fixed that for you.
<samuelkadolph> aresnick: extend will bring the instance methods of the module as class methods for the class
<samuelkadolph> It's kind of like the opposite of include
<apeiros_> aresnick: from *where* does it need that access? from instance methods of the class? or from class methods of the class?
<apeiros_> and what samuelkadolph said
<aresnick> samuelkadolph: Oh, I see
* apeiros_ goes off, writes that stupid webserver in C. just to show 'em all. whoever 'em are.
<samuelkadolph> Or you can use the AS::Concern pattern which is to extend MyModule::ClassMethods when MyModule is included
d3vic3 joined #ruby
<samuelkadolph> But that's only useful if you want instance and class methods for what class you include into
<aresnick> sameulkadolph: OK, let me parse that for a second (new to all this) Thanks!
<yfeldblum> ActiveSupport::Concern <- love it
thecreators joined #ruby
* apeiros_ wonders how much crap http servers must accept due to buggy browsers…
xol joined #ruby
banisterfiend joined #ruby
<aresnick> samuelkadolph: Hm, so basically I have Foo.bar, and then I have these other classes, Baz1 and Baz2. Each of them want to be able to call bar as an instance method. Foo.bar needs to have access to methods in the class calling it (e.g. new). The reason I can't make just do Baz1 < Foo is that I don't know what the opposite of "super" is --e.g. if I need to call [Baz1 or Baz2].new, I don't know how to write that in Foo. So extend doesn
<aresnick> seem to be what I'm looking for?
<samuelkadolph> Perhaps you should create a gist of that because it sounds like you have class and instance methods mixed up
<apeiros_> samuelkadolph: which is why I asked my first question :-p
<samuelkadolph> apeiros_: Pft
<samuelkadolph> You didn't ask him for a gist
<aresnick> samuelkadolph, apeirod_: OK, thanks! Will spend a couple more minutes on it than post it if I've still confused myself.
LittleBill902 joined #ruby
<apeiros_> aresnick: use tab completion for nicks
<apeiros_> saves you time and me sanity
<samuelkadolph> lol I'm gonna start calling you apeirod_
<apeiros_> samuelkadolph: you'll have to go to the end of the line. currently the last position for mutilations of my nick is held by judofyr
<aresnick> apeiros_ oh perfect; thanks =p
minijupe joined #ruby
Zanacross joined #ruby
workmad3 joined #ruby
tayy joined #ruby
<Jarred> Are there any gems to send HTTP requests for a JSON file? I want to do authentication from a desktop client where the user gives their login details, and it sends it over to a webserver and expects a JSON response back saying whether or not the user is logged in
<Jarred> specifically, post and get
<samuelkadolph> Just use net/http
<apeiros_> Jarred: a json request is still an http request
<apeiros_> nothing special about it
<yxhuvud> restclient could also be what you want
<Jarred> hah, shows how little I know beyond using rails
monkey13 joined #ruby
friskd joined #ruby
dotnull joined #ruby
closedbracket joined #ruby
mikeric joined #ruby
cyri_ joined #ruby
tayy joined #ruby
tayy_ joined #ruby
tomzx joined #ruby
m_W joined #ruby
iocor joined #ruby
Draco_ joined #ruby
xol joined #ruby
median joined #ruby
Mch1 joined #ruby
dasfugufish joined #ruby
vitoravelino joined #ruby
vitoravelino joined #ruby
tayy joined #ruby
jmcphers joined #ruby
DaZ joined #ruby
RomD joined #ruby
michael_mbp_ joined #ruby
ziggles joined #ruby
travisjeffery joined #ruby
rmc3 joined #ruby
mikepack joined #ruby
ryanf joined #ruby
smgt joined #ruby
xol joined #ruby
ThatDudeGuy_ joined #ruby
xhr joined #ruby
Morkel joined #ruby
marcuspat joined #ruby
iocor joined #ruby
Manhose joined #ruby
RomD joined #ruby
travisjeffery joined #ruby
justinmcp joined #ruby
ryanf joined #ruby
steakknife joined #ruby
<steakknife> Is there an alias or alias_method syntax for referring to a method in another module or class (say s/::/__/ )?
rubyruy joined #ruby
jrist-out joined #ruby
Y_Ichiro joined #ruby
jbpros joined #ruby
workmad3 joined #ruby
closedbracket joined #ruby
<steakknife> Looking at MRI: calls rb_to_id, which uses SYM2ID.
kartouch joined #ruby
dr_bob joined #ruby
SplitNova left #ruby
skrewler joined #ruby
minijupe_ joined #ruby
kartouch joined #ruby
<apeiros_> steakknife: that's just converting to a symbol
<apeiros_> steakknife: and no, such an aliasing method does not exist, you'll have to use delegation
<apeiros_> (neither a syntax)
<apeiros_> of course, alias works just fine for inherited methods, be that inherited from a superclass or included module.
rpowell joined #ruby
otakutomo joined #ruby
fantazo_ joined #ruby
<sullx> is there any way to have ruby puts its memory usage, or rather assign it to a string?
<apeiros_> sullx: not really. you can use `ps -p #{$$}` for example
<apeiros_> e.g. with -orss,vsz,%mem and whatever you want to see
<apeiros_> for obvious reasons not portable, though :)
<sullx> apeiros_, I need something corss platform tho.. I am working with a script that slowly increases in memory usage
<sullx> and I want to have some logic for when memory usuage gets too high
<sullx> any suggestions?
<apeiros_> you could take a look at some memory profilers for ruby
<apeiros_> I only remember bleak-house by name. but I think there have been others
<sullx> an array with a growing number of elements that are all non-duplicates. Each time I add an element to it I use an include? to make sure it is not already in the array. If it is, I throw it out. If it is not it goes in the array. As the array becomes larger more memory is needed in addition to include?
<apeiros_> no idea about their cross-platform capabilities, though.
<sullx> apeiros_, thanks for the suggestion
<apeiros_> sullx: uh, use a Set
zoo-zed joined #ruby
<apeiros_> testing for membership in an array is O(n)
<sullx> apeiros_, is O(n) ?
<apeiros_> google big-oh
<apeiros_> means the bigger the array gets, the slower it becomes, linearly
<apeiros_> whereas with Set and Hash, size of the Set/Hash has almost no impact
<sullx> Fantastic
<sullx> even with membership testing?
<apeiros_> I was refering to membership testing
<apeiros_> iterating of course can't be done below O(n) :)
<sullx> Love it. Thank you
xpot-mobile joined #ruby
tatsuya_o joined #ruby
brianherman joined #ruby
<sullx> csavola, got it. thanks
RomD joined #ruby
<mksm> hash lookup slows down with 500K keys even if it all fits in memory
<mksm> at least in my env
Lytol joined #ruby
brianherman joined #ruby
<apeiros_> mksm: it's quite possible that there are upper limits in rubys hash implementation
ryanf_ joined #ruby
<mksm> apeiros_, probably. you can quickly setup redis and overcome this
<apeiros_> mksm: or use a bigtable binding or whatever
eft left #ruby
<Jarred> When do I need to use self?
randym joined #ruby
<Jarred> Is it only when there's a method by the same name within the scope? (i.e open when there's a self.open method)
<apeiros_> you need self for methods ending with = (as it otherwise assigns to a local variable)
<apeiros_> and for methods which are keywords (e.g. self.class)
<apeiros_> other than that, you don't need self. you can use self if a local variable shadows a method of the same name, but you can just as well use parens
<yxhuvud> considering there are limits for how big arrays can be, of course there are limits to how big hashes can be.
<apeiros_> you don't even need to do either if you're passing args to the method (as that makes it unambiguously a method call)
demian`__ joined #ruby
ryanf joined #ruby
Natch| joined #ruby
aresnick joined #ruby
Guest70665 joined #ruby
dasfugufish joined #ruby
Guest70665 joined #ruby
n8ji joined #ruby
Guest70665 joined #ruby
rpowell joined #ruby
workmad3 joined #ruby
Mchl joined #ruby
brianher1an joined #ruby
Axsuul joined #ruby
radmacd joined #ruby
IPGlider joined #ruby
robotmay joined #ruby
Guest70665 joined #ruby
linusoleander joined #ruby
linusoleander left #ruby
Guest70665 joined #ruby
h4mz1d joined #ruby
<steakknife> apeiros_: belated thanks
macmartine joined #ruby
<apeiros_> yw
Axsuul joined #ruby
flexd2 joined #ruby
robbyoconnor joined #ruby
juarlex joined #ruby
akem joined #ruby