apeiros_ changed the topic of #ruby to: programming language || ruby-lang.org || Paste >3 lines of text in http://pastie.org || Rails is in #rubyonrails
chson has joined #ruby
MrWhite has joined #ruby
cjs226 has joined #ruby
CallMeWhite has joined #ruby
_numbers has joined #ruby
_numbers has quit [#ruby]
btaitelb has joined #ruby
CallMeWhite has joined #ruby
vju has joined #ruby
minijupe has joined #ruby
maletor has joined #ruby
freeayu has joined #ruby
ZachBeta has joined #ruby
<vju> is there a way to delete an element from an array within a call to map? something like this %w{a b c c d}.map{|item| if third item then delete it }
<Tasser> vju, nope, stack a #select
tomzx has joined #ruby
<vju> ah
<vju> thats even better, thanks
dv310p3r has joined #ruby
DoniRS has joined #ruby
albemuth has joined #ruby
davidamcclain has joined #ruby
eph3meral has joined #ruby
chessguy has joined #ruby
thetrav has joined #ruby
ben_alman has joined #ruby
<thetrav> so apparantly rspec -> capybara requires a rack app, but cucumber -> capybara does not? what's going on there?
<thetrav> I'm trying to use cap to test a generic web app
td123 has joined #ruby
<thetrav> something written in some long forgotten language
<thetrav> so I can get confidence before porting it to rails
ofcan has joined #ruby
igotnolegs has joined #ruby
<ofcan> what is the best Ruby book in your opinion?
<chessguy> i'm curious what the ruby equivalent of https://github.com/wilig/PyLight would look like. perhaps something using rubinius?
iamjarvo has joined #ruby
geekfactor has joined #ruby
sent-hil has joined #ruby
frishi has joined #ruby
conan has joined #ruby
<sent-hil> when using instance_eval to execute a block, instance variable assignments need to have self prefix right? or it will set local variable instead
snip_it has joined #ruby
shevy has joined #ruby
mdhopkins has joined #ruby
dax has joined #ruby
strife25 has joined #ruby
kenperkins has joined #ruby
mailtruck_ has joined #ruby
mikepack has joined #ruby
stephenjudkins has joined #ruby
GuidovanPossum has joined #ruby
frogstarr78 has joined #ruby
icmap has joined #ruby
fbernier has joined #ruby
davidcelis has joined #ruby
davidcelis has joined #ruby
hirotoshi has joined #ruby
<rking> Hi fellas. I'm running into an instance of something I see from time to time -- basically I want a snippet of text to be synced from a master location to a slave location, within a project. For this example it is the output of "usage" of the program, which I want included directly as part of README.md. Is there an existing templating solution, or roll my own?
invalidusrname_ has joined #ruby
iamjarvo1 has joined #ruby
richardlxc has joined #ruby
L-----D has joined #ruby
richardlxc has joined #ruby
brngardner has joined #ruby
ZachBeta has joined #ruby
JivaD has joined #ruby
Paradox2000 has joined #ruby
williamcotton has joined #ruby
kpshek has joined #ruby
frogstarr78 has joined #ruby
pubis_ has joined #ruby
<rking> Hrm. I guess I'll roll my own, but not now.
quest88 has joined #ruby
Haydos has quit ["Leaving"]
liluo has joined #ruby
shobhitg has joined #ruby
kenperkins has joined #ruby
shobhitg has joined #ruby
shobhitg has joined #ruby
kenperkins has joined #ruby
GuidovanPossum has joined #ruby
tomsthumb has joined #ruby
n8ji has joined #ruby
JackeyChen has joined #ruby
<sent-hil> Is there a way to rescue uninitialized constant without having to rescue NameError and grep for "unitialized constant"
<banisterfiend> sent-hil: implement const_missing? :P
Kruppe has joined #ruby
<sent-hil> banisterfiend: :), thx
<banisterfiend> sent-hil: not such a nice solution tho
<sent-hil> banisterfiend: better than using "=~ /uninitialized constant/ "
williamcotton_ has joined #ruby
<sent-hil> rking: never seen anything like it. You prob. have to do it manually.
<rking> sent-hil: OK. It's a fairly common thing I want to do.
<sent-hil> rking: maybe banisterfiend knows something
<banisterfiend> nope
<rking> Hrm, k.
<rking> I mean, there are templating systems out there.
<rking> Perhaps one of the differences here is that I want to extract it from an existing thing that is both a use of the text and also the canonical source.
<sent-hil> rking: i'd prob. use a rake task. feels hacky though
<sent-hil> rking: there are?
<rking> sent-hil: Not too bad. I don't want to overdesign it at this point... right now I think I can create a common_bits_of_text.rb (with a better name of course), then my program will refer to that, and the README.md-generator will do the same.
<sent-hil> i thought you wanted the output, not static text
<rking> sent-hil: Oh, definitely. eRuby is one.
<rking> sent-hil: Could be output, sure.
icmap has joined #ruby
<rking> sent-hil: But in either case there has to be some way the canonical source is DRY'd.
JackeyChen has quit [#ruby]
ryan_dev70 has joined #ruby
ben_alman has joined #ruby
phantasm66 has joined #ruby
JivaD has joined #ruby
Shaded has joined #ruby
pdtpatr1ck has joined #ruby
GuidovanPossum has joined #ruby
igotnolegs has joined #ruby
eph3meral has joined #ruby
redgetan has joined #ruby
brngardner has joined #ruby
krusty_ar has joined #ruby
sohocoke has joined #ruby
<shevy> https://github.com/browning/comment-troll-classifier/blob/master/spamcheck.py <-- It seems python does not believe in classes
JackeyChen has joined #ruby
<JackeyChen> hey ?
<JackeyChen> I begin config nginx as sevrer for ruby
Tasser has joined #ruby
<JackeyChen> do you have any documents for me ? I searched on google but didn't find good one
<rking> shevy: Because it uses stdout instead of acting as a module with methods?
shtirlic_ has joined #ruby
startling has joined #ruby
startling has quit [#ruby]
<shevy> rking, no not that, it seems like a collection of serial instructions and only one method definition
<rking> shevy: For something like that I wouldn't bother. Can you gist a sketch of what you would do differently?
<shevy> rking in ruby I always write a class these days
<rking> shevy: But for a 10 line thing?
<shevy> yes
<rking> class DoStuff
<rking> def do_it
<rking> ....
<rking> end; end
<rking> That is not valuable.
<rking> This second one is the same way. I don't see that the conceptial complexity is such that it needs to be organized by classes/objects.
<rking> Perhaps there are other files that follow similar patterns that would illuminate such a need, but within the standalone context here I am not seeing it.
dfamorato has joined #ruby
<rking> shevy: One big difference about this, actually, is Ruby's open classes. I would maybe find an existing class to tack these little procedural bits onto, for organization.
<rking> JackeyChen: Are you trying to use Rails?
joaoh82 has joined #ruby
noyb has joined #ruby
<JackeyChen> rking: right, I am instlaling it
<rking> JackeyChen: It's pretty (awesomely) easy. Try: http://www.modrails.com/videos/passenger_nginx.mov
<JackeyChen> rking: great !
looopy has joined #ruby
jgrevich has joined #ruby
jgrevich has joined #ruby
dfamorato_ has joined #ruby
manizzle has joined #ruby
blueadept has joined #ruby
freeayu has joined #ruby
shadoi has joined #ruby
td123 has joined #ruby
soveran has joined #ruby
lewis1711 has joined #ruby
brngardner has joined #ruby
abra has joined #ruby
brngardner has joined #ruby
gtuckerkellogg has joined #ruby
josefig has joined #ruby
kwertii has joined #ruby
sroy2_ has joined #ruby
Bosma has joined #ruby
poincare101 has joined #ruby
<poincare101> Anyone care to check out my code? A commandline issues "system": https://github.com/Poincare/Cronk
<poincare101> Very quick, just wanted to make sure I'm not doing anything silly.
krzkrzkrz has joined #ruby
savage- has joined #ruby
<fowl__> poincare101, in Conk#show the file isnt closed
<fowl__> #remove alos
kenperkins has joined #ruby
adamkittelson has joined #ruby
RORgasm has joined #ruby
goodieboy has joined #ruby
mdhopkins has joined #ruby
JivaD has joined #ruby
philcrissman has joined #ruby
Rambozo has joined #ruby
radic_ has joined #ruby
kah_ has joined #ruby
<sent-hil> poincare101: 2 space indentation!
stefanp_ has joined #ruby
<fowl__> tabs > spaces
chessguy has joined #ruby
<lewis1711> is the setup method in test/unit not called until the class has some actual tests?
krzkrzkrz has joined #ruby
<lewis1711> oh right nm
Tasser has joined #ruby
savage- has joined #ruby
jobicoppola has joined #ruby
stefanp has joined #ruby
stefanp has joined #ruby
thetrav has joined #ruby
ScottNYC has joined #ruby
redgetan has joined #ruby
savage- has joined #ruby
jobicoppola has joined #ruby
kah_ has joined #ruby
conan has joined #ruby
cconstantine has joined #ruby
<cconstantine> hey all, I'm trying to use rvm in debian, and I'm 99% there! I just can't run my rails/unicorn stack :( I'm getting a undefined symbol: rb_thread_io_blocking_region when using my freshly compiled ruby-1.9.2. Any ideas how to fix this?
banisterfiend has joined #ruby
kah_ has joined #ruby
<sent-hil> cconstantine: does it work w/ webrick or mongrel?
<cconstantine> sent-hil, testing wth RAILS_ENV=production bundle exec rails server
<cconstantine> I think the issue is that unicorn is using the kios gem, and it's what is failing to find that symbol when loading some .so
<cconstantine> it works yeah
<cconstantine> the 'RAILS_ENV=production bundle exec rails server' worked
GuidovanPossum has joined #ruby
dankest has joined #ruby
brianpWins has joined #ruby
<cconstantine> sent-hil, and oddly enough it works on my staging server, but I can't figure out what is different
iamjarvo has joined #ruby
<sent-hil> no clue
<cconstantine> yeah, google doesn't know either :(
<cconstantine> trying a staticly linked build
philcrissman has joined #ruby
soveran has joined #ruby
baroquebobcat has joined #ruby
krzkrzkrz has joined #ruby
Mohan has joined #ruby
Mohan has joined #ruby
MasterIdler_ has joined #ruby
rdw200169 has joined #ruby
sacarlson has joined #ruby
yoklov has joined #ruby
freeayu has joined #ruby
krzkrzkrz has joined #ruby
dv_ has joined #ruby
simao_ has joined #ruby
andrewhl has joined #ruby
jaywastaken has joined #ruby
albemuth has joined #ruby
<jaywastaken> Any ObjC developers around? Banging my head trying to find the equivalent of Ruby's String#match
<eph3meral> jaywastaken, /join #ios,#macosx,#ios-dev,#macosx-dev etc etc
<eph3meral> jaywastaken, http://lmgtfy.com/?q=objc+regex
<jaywastaken> eph3meral: http://letmewhoismynickforyou.com/?nick=jaywastaken and you'll see i'm on ##objc and #macdev and have asked there
<jaywastaken> my reason for asking here was to see if a ruby developer would happen to know
<eph3meral> jaywastaken, you're cute, ya big brute
<eph3meral> jaywastaken, give it to me harder, like you mean it
cola_zero has joined #ruby
<jaywastaken> sometimes it's better to give people the benefit of the doubt than to quickly pull out the lmgtfy link
stephenjudkins has joined #ruby
rohit has joined #ruby
soveran has joined #ruby
<eph3meral> jaywastaken, not when you're drunk
<eph3meral> jaywastaken, srsly, if you've been on IRC for more than two seconds (which I presume by the fact that you know what /whois means) then you know that asking a blatantly OT question is bound to garner bad results/responses
<eph3meral> jaywastaken, as they say, IRC is just a google front end with more insults
<jaywastaken> eph3meral: at the risk of arguing with a drunk person, you'll see that I simply asked if any ObjC programmers were around and then referenced the Ruby method for a common programming issue, hoping for a polyglot to be present.
<eph3meral> jaywastaken, challenge accepted
<eph3meral> your mom!
<eph3meral> wait, what are we talking about?
<lewis1711> this argument is silly. if you don't like his question put him on ignore
<jaywastaken> ended up finding my answer, so no sweat. For anyone curious: ObjC : NSTextCheckingResult#rangeAtIndex :: Ruby : MatchData#[]
<jaywastaken> Ruby is so much more readable
<banisterfiend> jaywastaken: what are oyu working on in objc?
TheIronWolf has joined #ruby
<jaywastaken> banisterfiend: attempting to learn by porting a Ruby log parser I wrote
<lewis1711> isn't there an implementation of ruby in coca objective C that's super fast?
<lewis1711> wonder if the same could be done with gnustep
freeayu has joined #ruby
<banisterfiend> lewis1711: macruby
<banisterfiend> i think it's dead now
<lewis1711> a shame
<eph3meral> ios/cocoa dev sux0rs :(
<eph3meral> actually objc is nice - it's the cert signing/Apple centric shit that's crap
<banisterfiend> eph3meral: it's not that bad
<eph3meral> the NS libs are great, objc is fine
<eph3meral> apple is teh evilz :(
Hsparks has joined #ruby
rippa has joined #ruby
cola_zero has joined #ruby
apok has joined #ruby
bawer has joined #ruby
deobald has joined #ruby
savage- has joined #ruby
<banisterfiend> eph3meral: why are you talking like a 13 year old
<eph3meral> banisterfiend, beer, mosly
<eph3meral> also, becuz i'm 13
<eph3meral> cuple beers and whooooo!
rohit has joined #ruby
krzkrzkrz has joined #ruby
<Sou|cutter> well this is shitty. It seems as though nokogiri sax parsing does not work with io streams... at least not in the way I would expect it to
<Sou|cutter> I should specify, http io streams...
<Sou|cutter> it downloads the entire file before parsing afaict, which seems to defeat the point
nfluxx has joined #ruby
<Sou|cutter> I even tried using em-http-request
paradisaeidae has joined #ruby
Vortex_Rikers has joined #ruby
wedgeV has joined #ruby
bawer has joined #ruby
sabooky has joined #ruby
L-----D has joined #ruby
<sabooky> what's the best way to iterate through lines starting from a particular line?
<sabooky> lets say i have a string: data.each_lines {|l| stuff} (but I want each_lines to start doing stuff from line 5)
<banisterfiend> what's the best way to prepend something to a string?
Chryson has joined #ruby
<lewis1711> if data is enumearble, couldn't you slice?
<Sou|cutter> data.split("\n")[4..-1].each { |l| stuff } ?
<lewis1711> or that :)
<Sou|cutter> banisterfiend: str = "adsfsdf #{str}" maybe?
<Sou|cutter> str = 'asdfasdfasd %s' % str
<sabooky> Sou|cutter: thanks
GuidovanPossum has joined #ruby
lkba has joined #ruby
<Sou|cutter> sabooky: no problem.. don't overthink it
heylukecarrier has joined #ruby
sohocoke has joined #ruby
<sabooky> Yeah.. I realized my problem runs deeper than that.. nested function + iterator isn't working to well for me
c0rn has joined #ruby
rohit has joined #ruby
DoniRS has joined #ruby
josefig has joined #ruby
josefig has joined #ruby
<Mon_Ouie> banisterfiend: string.insert 0, other_string or, since 1.9.3, string.prepend other_string
andantino has joined #ruby
josephwi_ has joined #ruby
Akuma has joined #ruby
n8ji has joined #ruby
jeedey has joined #ruby
jeekl has joined #ruby
greenarrow has joined #ruby
knirhs has joined #ruby
snip_it has joined #ruby
rellin has joined #ruby
albemuth has joined #ruby
<rellin> Maybe a newbie question, but is there a way to include all my .rb files into a module without explicitly writing module ModName in every file?
lewix_ has joined #ruby
<rellin> I was thinking there's probably some trick I can do with 'eval' inside a module, but I just want to keep everything for my new project in one scope.
yxhuvud has joined #ruby
<Mon_Ouie> module MyModule; class MyClass; end; end → class MyModule::MyClass; end
<Mon_Ouie> That implies MyModule is already defined, and also it changes constant scoping — constants won't be looked up in MyModule
lewis has joined #ruby
clockwize has joined #ruby
CheeToS has joined #ruby
<rellin> Mon_Ouie: But how do I apply that to a tree of subdirectories and files?
<rellin> I was thinking module MyModule; eval(File.open(init.rb));end
<davidcelis> wwwwwat
hukl has joined #ruby
<banisterfiend> Mon_Ouie: have oyu ever considered procuring some absinth and becoming the next rimbaud
<lewis> huh
<lewis> yes
FACEFOX has joined #ruby
lobolars has joined #ruby
pastjean has joined #ruby
<lewis> Mon_Ouie: give me homework in ruby
machine2 has joined #ruby
banjara has joined #ruby
banjara has quit [#ruby]
Morkel has joined #ruby
looopy has joined #ruby
hemanth has joined #ruby
sent-hil has joined #ruby
pabloh has joined #ruby
bawer has joined #ruby
schovi has joined #ruby
lewis1711 has quit [#ruby]
knopkodav has joined #ruby
mborromeo has joined #ruby
knopkodav has joined #ruby
mailtruck_ has joined #ruby
madhatter has joined #ruby
Mohan has joined #ruby
williamcotton has joined #ruby
redgetan has joined #ruby
madhatter has joined #ruby
looopy has joined #ruby
Cache_Money has joined #ruby
sebastorama has joined #ruby
ph^ has joined #ruby
sonkei has joined #ruby
maletor has joined #ruby
x0F_ has joined #ruby
GoBin has joined #ruby
Emmanuel_Chanel has joined #ruby
shruggar has joined #ruby
jgrevich_ has joined #ruby
jgrevich_ has joined #ruby
L-----D has joined #ruby
vectorshelve has joined #ruby
KL-7 has joined #ruby
schovi has joined #ruby
symb0l has joined #ruby
nilg` has joined #ruby
symb0l has joined #ruby
Eldariof-ru has joined #ruby
djdb has joined #ruby
madhatter has joined #ruby
friskd has joined #ruby
bawer has joined #ruby
c0rn has joined #ruby
<ddv> lewis: just read some book(s)
Synthead has joined #ruby
<lewis> ddv: huh that was random homie
bluOxigen has joined #ruby
<ddv> lewis: because you asked Mon_Ouie for homework
<lewis> ddv: oh, my apologies
<lewis> ddv: I need challenge
<ddv> Google
<ddv> codechef
agilobable has joined #ruby
<ddv> etc etc
<lewis> too easy
<ddv> ruby programming exercises, challenges etc
<lewis> lol thanks for your input though
<ddv> lewis: no problem
Jelco has joined #ruby
Gonzih has joined #ruby
andrewhl has joined #ruby
JackeyChen has quit [#ruby]
maletor has joined #ruby
jprovazn has joined #ruby
bier has joined #ruby
twinturbo has joined #ruby
gtuckerkellogg has joined #ruby
arturaz has joined #ruby
machine2 has joined #ruby
BiHi has joined #ruby
sspiff has joined #ruby
andrewhl has joined #ruby
tayy has joined #ruby
francisfish has joined #ruby
clockwize has joined #ruby
bluenemo has joined #ruby
bluenemo has joined #ruby
hukl has joined #ruby
KL-7 has joined #ruby
jhunter has joined #ruby
zakwilson_ has joined #ruby
FACEFOX has joined #ruby
freeayu has joined #ruby
Synthead has joined #ruby
apeiros_ has joined #ruby
falena has joined #ruby
scwh has joined #ruby
mikeric has joined #ruby
KJF has joined #ruby
mikeric has joined #ruby
hukl has joined #ruby
shruggar has joined #ruby
ph^ has joined #ruby
spencerward has joined #ruby
pastjean has joined #ruby
Ammar01 has joined #ruby
tijmencc has joined #ruby
<vectorshelve> apeiros_: Hai :)
andrewhl has joined #ruby
ephemerian has joined #ruby
peterhil` has joined #ruby
davidw has joined #ruby
tvw has joined #ruby
scwh has joined #ruby
eka has joined #ruby
roolo has joined #ruby
nikhgupta has joined #ruby
cezar has joined #ruby
schovi has joined #ruby
elektronaut has joined #ruby
__main__ has joined #ruby
zommi has joined #ruby
dv_ has joined #ruby
shtirlic has joined #ruby
heftig has joined #ruby
spuz has joined #ruby
_2easy has joined #ruby
spuz has joined #ruby
tatsuya_o has joined #ruby
<Zelest> is there any way to specify the source-port when connecting using Net::HTTP? :o
ukwiz has joined #ruby
berserkr has joined #ruby
mehulkar has joined #ruby
Ethan has joined #ruby
Ethan has joined #ruby
davorb has joined #ruby
JivaD has joined #ruby
stefanp has joined #ruby
stefanp has joined #ruby
cezar has joined #ruby
maesbn has joined #ruby
workmad3 has joined #ruby
r0bby has joined #ruby
<davorb> sort of off topicish question: how do i create more than 1 app with heroku?
<davorb> do i have to register a new account?
moshef has joined #ruby
jimeh has joined #ruby
alanp has joined #ruby
JivaD has joined #ruby
platzhirsch has joined #ruby
mehul has joined #ruby
<platzhirsch> gosh, I love the big talk in Mr. Neighborly's Humble Little Ruby Book
araujo has joined #ruby
bier has joined #ruby
<banisterfiend> platzhirsch: paste
JivaD1 has joined #ruby
<platzhirsch> banisterfiend: http://humblelittlerubybook.com/book/html/
bier|tp has joined #ruby
<mehulkar> i have an interview with Pivotal Labs in the morning for an entry level position. anyone have any advice for me?
abra has joined #ruby
<mehulkar> LISTCHANS
<davorb> platzhirsch thanks for listing that
<platzhirsch> davorb: I actually got this from this channel
<platzhirsch> I think its scripted into the channel bot
<workmad3> davorb: you can just create more apps (or at least, I've never had any problem or billing from them for doing so :) )
sohocoke has joined #ruby
nikhgupta has quit [#ruby]
Tearan_ has joined #ruby
ph^ has joined #ruby
davidw has joined #ruby
jlebrech has joined #ruby
platzhirsch has quit [#ruby]
<davorb> workmad3 i haven't been able to locate the "create new app" button :P
Ethan has joined #ruby
Kevin- has joined #ruby
KJF has joined #ruby
Mohan has joined #ruby
richardlxc has joined #ruby
richardlxc has joined #ruby
Vert has joined #ruby
Foxandxss has joined #ruby
spencerward has joined #ruby
seoaqua has joined #ruby
Ethan has joined #ruby
Ethan has joined #ruby
* Ethan np: Green Day - The Static Age
<Ethan> sorry
<Ethan> my script is absolutely failing
jitesh_shetty has joined #ruby
d_roge has joined #ruby
sei has joined #ruby
madcoder_ has joined #ruby
polysics has joined #ruby
tk__ has joined #ruby
clockwize has joined #ruby
greenarrow has joined #ruby
spencerward has joined #ruby
<greenarrow> why does this xpath not work .//*[@id='rso']/li[1]/div/div[2]/div[1]/cite after http://www.google.com/search?q=youtube
cdmdcmdmcdm has joined #ruby
iocor has joined #ruby
greengriminal has joined #ruby
latrommi has joined #ruby
Nanuq has joined #ruby
<cdmdcmdmcdm> gents. ruby on rails 1.8.7 - i have an old app which handles push notifications. i'm trying to update the certificates. is it simple as replacing the production/dev certs and restarting the app or am i missing something? (it's throwing an sslv3 expired cert error currently)
artm has joined #ruby
<artm> say I suspected that a particular library didn't play well with garbage collector. how would I go about testing/proving that? Could I somehow simulate a lot of garbage collection?
<artm> in fact I would like garabage collection to occure while a library call is in progress somehow
mfournier has quit ["WeeChat 0.3.6"]
<banisterfiend> artm: GC.start
<artm> right. but I can do that before or after I call the library function
<greenarrow> anyone know xpath that can help me
<artm> I would like to somehow generate just enough garbage so I could hope it will be collected when the method is running
<artm> banisterfiend: ^
dbgster has joined #ruby
knirhs has joined #ruby
cha1tanya has joined #ruby
alem0lars has joined #ruby
jenglish has joined #ruby
Floydzy has joined #ruby
BrianE has joined #ruby
_null has joined #ruby
_null has joined #ruby
kacperix has joined #ruby
frogstarr78 has joined #ruby
twinturbo has joined #ruby
<spuz> A question about program structure: If I have a module which defines a bunch of methods which at various writes to a log using a logger, how should those module functions get hold of the logger?
<spuz> Something tells me there's a better way than using a global variable
justinmcp has joined #ruby
knirhs has joined #ruby
ABK has joined #ruby
tewecske has joined #ruby
fearoffish has joined #ruby
DMKE has joined #ruby
moshef has joined #ruby
spencerward has joined #ruby
<shevy> spuz in the past I also often thought about that, then I realized that modules are crippled classes
sacarlson has joined #ruby
kevinykchan has joined #ruby
mogaj has joined #ruby
mogaj has quit [#ruby]
mogaj has joined #ruby
falena has joined #ruby
<mogaj> am getting this error : ERROR: Gem bundler is not installed, run `gem install bundler` first. .... i have installed gem bundler already
davidcelis has joined #ruby
yannis has joined #ruby
<spuz> shevy, I'm not sure what my options are, (ruby is still magic to me at the moment)
<spuz> Can the methods of a module access member variables of a class they are mixed into?
etehtsea has joined #ruby
Ethan has joined #ruby
JohnBat26 has joined #ruby
richardlxc has joined #ruby
richardlxc has joined #ruby
peterhellberg has joined #ruby
sn0lan has joined #ruby
<artm> spuz: may be use a constant?
<artm> ModuleName::Logger = ...
<artm> or something
ph^ has joined #ruby
davidd___ has joined #ruby
<artm> (but it's "magic to me" too :-))
frishi has joined #ruby
<shevy> spuz yes
<shevy> well
KL-7 has joined #ruby
<shevy> if you mix it into a class
goodieboy has joined #ruby
<shevy> mogaj you on debian?
emmanuelux has joined #ruby
<spuz> artm: that code just looks crazy to me
<artm> spuz but it mixes in logger into any class
<shevy> hehehe
<spuz> but that is probably because I haven't got my head around ruby's dynamism
<spuz> Why do you create a class called ClassMethods?
<spuz> Why not replace the ClassMethods.log method with the MyLogger.log method?
<cdmdcmdmcdm> broken pipe when i try to send out multiple push notifications… any idears? yes i'm cluless...
Squarepy has joined #ruby
Squarepy has joined #ruby
<spuz> artm, why do you need to have Foo extend ClassMethods?
krusty_ar has joined #ruby
<artm> spuz: so not only instances but a class itself has .log method
richardl1c has joined #ruby
<artm> otherwise you wouldn't be able to log from self.setup
freeayu has joined #ruby
richardl1c has joined #ruby
<spuz> hmm, hangon, ClassMethods is not a class, it's a module, I didn't know you could extend a module...
moshee has joined #ruby
<spuz> this is all very strange to me
<mogaj> shevy: yes i am on ubuntu
cdmdcmdmcdm has quit [#ruby]
<shevy> mogaj yeah it is typical for debian based systems that they cripple their ruby
<mogaj> shevy : is there any solution ?
<shevy> you need to decide what to do. if you stick with the debian-ruby, you need to ask the debian guys how to decripple their stuff. otherwise, you could use RVM. or you could compile ruby from source.
apeiros_ has joined #ruby
<shevy> mogaj if you stick with the debian-base, ask them how you are supposed to install something ruby-related
iamjarvo has joined #ruby
<shevy> mogaj they changed their gem install paths. "gem env". I show you what it shows for me, I am 100% sure it is different for you. http://pastie.org/3803839
<shevy> - INSTALLATION DIRECTORY: <-- I am sure this one is different for you
<shevy> spuz what helps the most is to think of modules as crippled classes IMHO
jitesh_shetty has joined #ruby
richardlxc has joined #ruby
artm has joined #ruby
irocksu has joined #ruby
<irocksu> hi
<irocksu> i am using active_record with sqlite3 and have the following problem with pathname
<irocksu> i cannot mass assign a filename if i use Pathname.new().to_s
andrewhl has joined #ruby
<irocksu> it works with Pathname.new().to_s.to_sym.to_s though
elalande has joined #ruby
<irocksu> i checked the class and encoding and both seem ok. i do not know what causes this problem
kaneda__ has joined #ruby
<irocksu> i get this error: NoMethodError: undefined method `error' for nil:NilClass: INSERT INTO "documents" ("created_at", "discussable_elements", "discussion_id", "filename", "format", "source", "sync_document_id", "title", "uid", "updated_at", "version") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
<apeiros_> that makes no sense
iocor has joined #ruby
<shevy> hehehe
<shevy> apeiros_ is the Devastator :D
<shevy> Railsator!
<irocksu> i guess the sqlescapes somehow get screwed up.
freeayu has joined #ruby
<apeiros_> AR doesn't escape sql (doesn't need to, since it does the proper thing and uses bind variables)
Sailias|work has joined #ruby
<banisterfiend> apeiros_: check out this upcoming feature, showing all monkey-patches of a given class :P https://gist.github.com/2405083
BiHi has joined #ruby
<apeiros_> banisterfiend: woah, ripping through all of $LOADED_FEATURES for that?
<banisterfiend> apeiros_: no
scwh has joined #ruby
<apeiros_> brb, work
<banisterfiend> apeiros_: we just check source_location on all the methods, and from that source_location we can extract the class
Jackneill has joined #ruby
cezar has quit ["Leaving"]
<iamjarvo> can the builder gem only build the xml? not read it?
fixl has joined #ruby
Bofu2U has joined #ruby
<shevy> this is kinda cool: 1.method(:to_d).owner
cjs226 has joined #ruby
<apeiros_> banisterfiend: heh, nice
rohit has joined #ruby
wvdschel has joined #ruby
<banisterfiend> apeiros_: just a simple regex to find the start of the class definition and then we read from that point down until we get a complete expression
<apeiros_> for a first version that should be just fine
<apeiros_> I'd probably use ripper for that later
`brendan has joined #ruby
<banisterfiend> yeah it' snot 100% infallible
weasels has joined #ruby
otters has joined #ruby
voodoofish has joined #ruby
<artm> ok I've pinned that Garbage Collection related problem: https://gist.github.com/2405586
<artm> anyone cares to test that?
otters has joined #ruby
nanderoo has joined #ruby
SPYGAME has joined #ruby
zakwilson has joined #ruby
raluxgaza has joined #ruby
greengriminal has quit [#ruby]
neohunter has joined #ruby
otters has joined #ruby
btaitelb has joined #ruby
<Squarepy> artm, mine raises the err
<artm> MRI 1.9.x?
jbw has joined #ruby
wefawa has quit [#ruby]
<artm> Squarepy: ^
<Squarepy> 1.9.2-p290
<artm> Squarepy: thanks.
<Squarepy> ok
<otters> meta-j 11
<otters> whoops
pen has joined #ruby
Boohbah_ has joined #ruby
iamjarvo1 has joined #ruby
samuelkadolph has joined #ruby
liluo has joined #ruby
andrewhl has joined #ruby
dql has joined #ruby
spencerward has joined #ruby
spencerward has joined #ruby
gregorg has joined #ruby
jmeeuwen_ has joined #ruby
s0ber has joined #ruby
fbernier has joined #ruby
rpgsimmaster_ has joined #ruby
albemuth has joined #ruby
tomzx has joined #ruby
spencerw_ has joined #ruby
sspiff has joined #ruby
tommyvyo has joined #ruby
tatsuya_o has joined #ruby
banisterfiend has joined #ruby
jrist-mtg has joined #ruby
Synthead has joined #ruby
knirhs has joined #ruby
Afal has joined #ruby
Afal has quit [#ruby]
welterde has joined #ruby
banisterfiend has joined #ruby
igaiga has joined #ruby
Zelest has joined #ruby
mattyoho has joined #ruby
mattyoho has joined #ruby
uris has joined #ruby
spencerward has joined #ruby
looopy has joined #ruby
mstratman has joined #ruby
linoj has joined #ruby
asobrasil has joined #ruby
geekbri has joined #ruby
justinmcp has joined #ruby
linoj has joined #ruby
dv310p3r has joined #ruby
fmcgeough has joined #ruby
pu22l3r has joined #ruby
krusty_ar_ has joined #ruby
jroes has quit [#ruby]
pu22l3r has joined #ruby
td123 has joined #ruby
jobicoppola has joined #ruby
|RicharD| has joined #ruby
<|RicharD|> Hello
<|RicharD|> what mean ?
bbttxu has joined #ruby
Morkel has joined #ruby
tatsuya_o has joined #ruby
yoklov has joined #ruby
d3c has joined #ruby
jlebrech has joined #ruby
FACEFOX has joined #ruby
stefanp has joined #ruby
<shevy> |RicharD| wat
<shevy> english please
<|RicharD|> ops sorry
<|RicharD|> i'm reading
<|RicharD|> this:
<|RicharD|> but i'm not know well what it say
<shevy> ok
<|RicharD|> for the self ?
<shevy> what this does
<shevy> def self.title
<shevy> it makes a class method
<shevy> so you can invoke it without using .new
<shevy> Book.title
<shevy> vs
<shevy> Book.new.title
<shevy> ok?
<|RicharD|> yes
<|RicharD|> so i use self
<shevy> ok
<|RicharD|> for invoke a method without
<shevy> and self refers to the current class
<|RicharD|> create a object
<shevy> you can use self in methods too
<shevy> def foo
<shevy> puts self.class
<|RicharD|> yes and then i can do
<|RicharD|> User.foo
<|RicharD|> without do User.new ?
<shevy> yeah
<|RicharD|> whiteout instance the object
<|RicharD|> right ?
<shevy> yeah
<|RicharD|> so
<|RicharD|> what it the difference between def self.foo
<|RicharD|> and def foo puts self.class ?
<shevy> they do different things
<shevy> in the first example you create a class method
<workmad3> |RicharD|: the first defines a class method, the second prints out some string representation of the class
<shevy> in the second example you only output the name of the class
<shevy> and the second example works with your object
<shevy> x = Bla.new
<shevy> x.foo
tatsuya_o has joined #ruby
<|RicharD|> it print
<|RicharD|> Bla class for example ?
<shevy> only "Bla"
<shevy> but yes
<|RicharD|> yes
<|RicharD|> instead when it's def self.foo
<|RicharD|> it's for use the method without instance object
<|RicharD|> right ?:)
<shevy> yes
<|RicharD|> oki thx man
delinquentme has joined #ruby
<shevy> rails does that a lot
<|RicharD|> sorry but i'm learning ruby and i not know 100% always :)
<delinquentme> what do you call it when you're in ruby and you drop down into C?
<shevy> User.find :blalalala
<delinquentme> for like faster num crunching etc
<shevy> delinquentme I call it torture :(
<|RicharD|> yes it's for rails but i want learning ruby before :)
<|RicharD|> if no i write code without know what i'm doing
<delinquentme> shevy, is it bad?
<|RicharD|> :)
<delinquentme> or do you just not like C?
<shevy> delinquentme lol I don't really know. I have mixed feelings with C
<delinquentme> im phor it!
<delinquentme> but im writing a tweet to a perl programmer and im looking for the technical jargon
<shevy> I hate that it requires .h files to compile something and that these .h files must reside in a specific location
<shevy> hmm
<shevy> I am not sure there is a jargon for that
<delinquentme> you mean like how ruby has requires that need to be in syspath?
<delinquentme> :D
<workmad3> delinquentme: embedded C code is frequently referred to as native code
<workmad3> delinquentme: or just embedded C code :)
<delinquentme> thatll do!
<shevy> delinquentme, yes but even more so, the python import way. I think that is the best approach (except that require works on single files... I dont know if import in python works on single files in i.e. /foo/bar.py too)
<workmad3> delinquentme: or a native extension (depends on how exactly you do it)
<shevy> ah
<shevy> that is a good word, native extension!
indeterminate has joined #ruby
<shevy> ok two words :P
visof has joined #ruby
visof has joined #ruby
<workmad3> shevy: the headers don't need to be in a specific location... but you need to tell the compiler where they are
<workmad3> shevy: and so conventions have developed
<shevy> workmad3 how do you do that when you just use make and a Makefile?
<shevy> like I would do an additional dir called /headers
<shevy> in addition to /usr/include
Sailias has joined #ruby
<workmad3> shevy: from what I remember, you can declare some variables at the top, and then when you're calling gcc (or whatever compiler) pass in additional -I params
<workmad3> shevy: or there are env vars that contain directories that are added to the include paths
<workmad3> shevy: if the prog has a configure script, you can also frequently specify specific package locations when running that too...
<shevy> yeah via some specific switch like --with-bla=/headers
<shevy> but if there would be env vars I wouldn't need that
<workmad3> shevy: but if you're doing it with a plain Makefile without the extra tooling, it's akin to maintaining your ruby $LOAD_PATH without something like rubygems
jeebster has joined #ruby
brngardner has joined #ruby
<workmad3> shevy: a quick google about gcc and env vars gives C_INCLUDE_PATH as the env var to put your include paths
<shevy> hmm lemme look!
<workmad3> shevy: and there's tools like pkg_config that can give you the params for gcc for specific tasks and packages
<workmad3> *pkg-config
Downy7 has joined #ruby
<workmad3> shevy: overall, I'd actually say there's far too many different ways to piss around with your include paths with GCC and the like... lots of different toolchains and lots of places for conflicts to occur
<shevy> hehehe
<shevy> yeah
<shevy> did I mention that I hate libtool?
<workmad3> shevy: doesn't everyone? :P
<jeebster> hey fellow rubyists, any available methods or code examples to do the following: while looping through an array, compare the attributes of one item to the next?
<workmad3> jeebster: .each_cons(2) {|first, next| ...}
<jeebster> awesome. thanks workmad!
asno has joined #ruby
<asno> hi
philcrissman has joined #ruby
mikeycgto has joined #ruby
<asno> i've got a question about ror....i query to mysql server data field and I got things like 2011-10-13T13:14:10Z
<asno> what's happening?
<asno> thanks
v0n has joined #ruby
Kruppe has joined #ruby
iamjarvo has joined #ruby
iamjarvo has joined #ruby
Natch has joined #ruby
nilg` has joined #ruby
ph^ has joined #ruby
scwh has joined #ruby
chioque has joined #ruby
Abner_ has joined #ruby
_ack has joined #ruby
EvanR has joined #ruby
EvanR has joined #ruby
crazed_ has joined #ruby
looopy has joined #ruby
<spuz> What is the difference between 'def methodname' and 'def Module.methodname' ?
eka has joined #ruby
yoklov has joined #ruby
theRoUS has joined #ruby
spencerward has joined #ruby
josefig has joined #ruby
rbanffy has joined #ruby
baroquebobcat has joined #ruby
phantasm66 has joined #ruby
Morkel has joined #ruby
nricciar has joined #ruby
crankycoder has joined #ruby
crazed_ has joined #ruby
masolino has joined #ruby
<spuz> the answer: The first is an instance method and the second is a class method
ank has joined #ruby
pen has joined #ruby
chson has joined #ruby
jitesh_shetty has joined #ruby
classix has joined #ruby
soveran has joined #ruby
n1x has joined #ruby
ngzax has joined #ruby
cephalobod has joined #ruby
KL-7 has joined #ruby
aibo has joined #ruby
carlyle has joined #ruby
savage- has joined #ruby
tiennou has joined #ruby
<tiennou> encodings in ruby are giving me a hard time
benatwork has joined #ruby
<vectorshelve> shevy: hai :)
<tiennou> i have a csv utf8 file i need to change a column depending on the contents of another column
<tiennou> but I can't get ruby to compare accented string right
<shevy> hi vectorshelve
<shevy> tiennou yeah I hate encoding
<vectorshelve> shevy: how you doing ?
<shevy> vectorshelve, dunno. too many things to do in the next weeks
<vectorshelve> shevy: oh is this you ?-> https://github.com/shevy
<tiennou> damn true, i'm not even sure where the problem lies...
<shevy> vectorshelve nope, well yeah, but I then decided to use https://github.com/shevegen instead
<shevy> and I think at rubygems it is reversed now :\
thecreators has joined #ruby
<shevy> tiennou in two months I have to be on ruby 1.9.x too :(
<tiennou> the only clue I got is that pp'ing one of those gives me "Adh\xC3\xA9rent" instead of "Adhérent"
sacarlson has quit [#ruby]
<vectorshelve> shevy: I am following u now :) and someone is sought of trolling you -> https://gist.github.com/1565411 :)
<shevy> vectorshelve yeah andrewvos is just bored
<vectorshelve> shevy: how is your girlfriend ?
classix has joined #ruby
<shevy> girls are evil man
pubis_ has joined #ruby
<vectorshelve> shevy: :) But not all... and certain men are
thone_ has joined #ruby
dennda has joined #ruby
elliot98 has joined #ruby
zaydana has joined #ruby
<asno> Hi, I'm trying to.i query to mysql server data field and I got things like 2011-10-13T13:14:10Z
<asno> whats wrong?
ysiad has joined #ruby
eph3meral has joined #ruby
axl_ has joined #ruby
johnduhart has joined #ruby
chioque has quit [#ruby]
asno has joined #ruby
kevinbond has joined #ruby
spencerward has joined #ruby
Asher has joined #ruby
masolino has joined #ruby
netrealm has joined #ruby
nilg` has joined #ruby
jgarvey has joined #ruby
Tomasso has joined #ruby
dennda has joined #ruby
DarkFoxDK has joined #ruby
artm has joined #ruby
snip_it has joined #ruby
bpgoldsb has joined #ruby
mengu has joined #ruby
mdhopkins has joined #ruby
JivaD has joined #ruby
dbgster has joined #ruby
pastjean has joined #ruby
Asher1 has joined #ruby
CoverSlide has joined #ruby
masolino has joined #ruby
BeLucid_ has joined #ruby
chittoor has joined #ruby
Tomasso has joined #ruby
frogstarr78 has joined #ruby
yoklov has joined #ruby
pyreal has joined #ruby
spencerw_ has joined #ruby
ysiad has joined #ruby
zommi has joined #ruby
joaoh82 has joined #ruby
philcrissman_ has joined #ruby
jbw has joined #ruby
waxjar has joined #ruby
PaciFisT has joined #ruby
sleetdrop has joined #ruby
rushed has joined #ruby
GuidovanPossum has joined #ruby
<vectorshelve> banisterfiend: hai :)
philcrissman_ has joined #ruby
albemuth has joined #ruby
oooPaul has joined #ruby
deception has joined #ruby
brngardner has joined #ruby
LiquidInsect has joined #ruby
pdtpatr1ck has joined #ruby
ckrailo has joined #ruby
pubis has joined #ruby
classix has joined #ruby
delinquentme has quit ["Leaving"]
LBRapid has joined #ruby
quest88 has joined #ruby
rippa has joined #ruby
emmanuelux has joined #ruby
lkba has joined #ruby
<waxjar> can someone link me a good article on writing DSLs (how, best practices, etc)?
peterhil` has joined #ruby
maxok has joined #ruby
maxok has joined #ruby
baroquebobcat has joined #ruby
issackelly has joined #ruby
kenperkins has joined #ruby
issackelly has quit [#ruby]
mikepack has joined #ruby
shaman42 has joined #ruby
chimkan has joined #ruby
CheeToS has joined #ruby
<deception> waxjar:http://pastie.org/3804939
<waxjar> thanks deception :)
<deception> np don't know how good those are but it should help point you in the right firection
<deception> direction*
davidcelis has joined #ruby
maxok has joined #ruby
visof_ has joined #ruby
ringotwo has joined #ruby
<irk3z> Is it possible to connect rails with dbase ??
<deception> ?
<irk3z> deception: thx :)
<deception> would that work?
<deception> It's read only
<eph3meral> hmm... how do I get Time objects in another timezone? I've tried several things, I've been reading the docs on the Time object, but no matter what, it seems I can only ever retrieve the time either in my local zone or in UTC/GMT
Emmanuel_Chanel_ has joined #ruby
maskact has joined #ruby
williamcotton has joined #ruby
iamjarvo has quit [#ruby]
iamjarvo has joined #ruby
visof_ has joined #ruby
<Mon_Ouie> time.getlocal "[+-]HH:MM"
<shevy> Mon_Ouie knows everything
<deception> local
<deception> *disregard that*
berkes has joined #ruby
spencerward has joined #ruby
<shevy> lol
<shevy> YOU ALL MUST DIE!!!
<Mon_Ouie> shevy: Actually, I used Pry to check what that method was called — I just knew it existed
<shevy> *disregard that*
<shevy> cool Mon_Ouie
<deception> haha
<shevy> how did you do that in pry actually? that searching for the method
frogstarr78 has joined #ruby
<deception> yeah
<shevy> that's like pry replacing ri :)
<Veejay> Let's settle on Mon_Ouie knows an awful lot
looopy has joined #ruby
<Veejay> He knows too much, I'm envious and I want to do anything in my power to smear his name
<deception> TO THE PLANK
<Veejay> I've heard he's a neo-nazi
<Mon_Ouie> cd Time.new; ls -m; *read*; getlocal "test"; *read the error message to know how to use the method*
<Veejay> j/k he's nice and spends a lot of time helping people for no reward whatsoever :(
<shevy> Veejay the only way to beat Mon_Ouie is by telling bad french jokes
<Veejay> Mon_Ouie: Are you invoved with Rubinius by the way?
virunga has joined #ruby
<Mon_Ouie> Veejay: Nope, I played with it, but I've never worked *on* it
<Veejay> C'est l'histoire de Toto à l'école. Son professeur lui demande "Toto, quelle est la cinquième lettre de l'alphabet ?
<shevy> Mon_Ouie nice... never saw "cd Foo.new" before
<Veejay> "euhhhh"
DrShoggoth has joined #ruby
<shevy> what are you doing Veejay
blueadept has joined #ruby
blueadept has joined #ruby
<shevy> are you french moaning?
<Veejay> Mon_Ouie: You should get involved man, the future of Ruby shines brilliant and bright and they need skilled people like you. I know you have your stuff to work on, but I'm really excited about Rubinius and what it means for Ruby
Synthead has joined #ruby
<Veejay> shevy: Telling bad French jokes
<shevy> but I dont understand them :(
<shevy> french jokes should only be told in english
<Veejay> shevy: Basically it's about a teacher asking Johnny what's the 13th letter of the alphabet
<Veejay> And Johnny goes "mmmmhhh"
<Veejay> Doesn't really translate well
<shevy> man
<shevy> if I were that teacher, I'd shoot the whole class
<deception> hadn't heard of Rubinius. That's cool
<deception> I'm a ruby newb
<shevy> Rubinius cool idea is to use ruby to extend ruby
<Veejay> Rubinius is insanely cool. I'm especially excited about the idea of a clean and modern slate
<Veejay> About Hydra and concurrency
<shevy> and it must help me to realize RubyOS
brngardner has joined #ruby
<Veejay> Ruby 2.0 will come with a new garbage collector, but reading about it you realize the algorithm used to GC stuff is kind of old and known to be suboptimal
<Veejay> Which is a bummer
axl___ has joined #ruby
joaoh82 has joined #ruby
classix has joined #ruby
<deception> hey rubyOS is cool too
mvangala has joined #ruby
Araxia_ has joined #ruby
dkissell has joined #ruby
<shevy> deception yeah but in all honesty, it is too much work
<shevy> but who knows, perhaps with thousand little steps it could be done
<deception> Neat idea though
<shevy> the idea would be really cool to treat everything on the computer like a tangible object
<shevy> and to allow these objects to intercommunicate in one way too
<deception> Ok so pry is pretty cool
<deception> I need to stop saying 'cool'
JivaD has joined #ruby
<shevy> cool
Teomari has joined #ruby
<deception> how about swell?
<shevy> that sucks
Tomasso has joined #ruby
nlc has joined #ruby
tatsuya_o has joined #ruby
dql has joined #ruby
<Mon_Ouie> awesome, great, marvelous, groovy, wonderful, impressive, dazzling?
<deception> groovy
visof has joined #ruby
visof has joined #ruby
<shevy> cool
machine2 has joined #ruby
SegFaultAX|work has joined #ruby
rramsden has joined #ruby
savage-_ has joined #ruby
KL-7 has joined #ruby
horofox has joined #ruby
<horofox> when iterating with a .each over a object is there any way to output inside which "iteration" i am without creating a temp variable?
cloke has joined #ruby
<shevy> horofox if you use .each_with_index then sure
<shevy> you could also use a counter inside the .each but that is kinda ugly
pdtpatrick has joined #ruby
<shevy> ah
<horofox> shevy: that's what i wanted... thanks!!!
<shevy> I suppose your temp variable is a counter ;)
<horofox> shevy: yes it is :P
<horofox> shevy: each_with_index is perfect
<horofox> shevy: how do I get a good knowledge about not so frequent methods like you?
<horofox> :P
<shevy> %w( cat dog horse ).each_with_index {|item, index| puts index.to_s+' '+item}
<shevy> 0 cat
<shevy> 1 dog
<shevy> 2 horse
<shevy> these are quite common methods
<shevy> Enumerator or Enumerable
hukl_ has joined #ruby
<shevy> hmm lemme find the docu
<shevy> http://ruby-doc.org/core-1.9.3/Enumerable.html here is one, just read through the methods listed on the left side once, then your brain at least has seen it once
<shevy> remembering them will be easier
<shevy> #all? #any? #chunk #collect #collect_concat
<shevy> omg
<shevy> I could not tell you what #chunk does not what #collect_concat does
<shevy> *nor
<shevy> [[1,2],[3,4]].flat_map {|i| i } #=> [1, 2, 3, 4]
<shevy> I am confused
<shevy> why is not .flatten used here?
yoklov has joined #ruby
Dreamer3 has joined #ruby
ckrailo has joined #ruby
greenarrow has joined #ruby
<greenarrow> i
<Mon_Ouie> Here's another example [2, 3].flat_map { |n| Array.new(n, n) } #=> [2, 2, 3, 3, 3]
<virunga> Hi, how can i read a method's documentation from the irb?
<Mon_Ouie> virunga: You can shell out to ri
<Mon_Ouie> system "ri Class#method"
looopy has joined #ruby
niku4i_ has joined #ruby
<virunga> Mon_Ouie, in the cmd of Win when i write ri Array#new it says Nothing known
<virunga> what's wrong?
<virunga> Nothing known about ...
whuffor has joined #ruby
maletor has joined #ruby
<Mon_Ouie> The documentation wasn't installed; I'm not sure how to install it on Windows.
<shevy> could be you have no rdoc
<shevy> when you compile ruby from source, there is a step to install all the documentation too :)
<Mon_Ouie> I'd think the installer has some option to install it
<shevy> make install-doc
<virunga> ok thank you
DMKE has joined #ruby
MasterIdler_ has joined #ruby
SphericalCow has joined #ruby
bluOxigen has joined #ruby
jgrevich has joined #ruby
schovi has joined #ruby
wilmoore has joined #ruby
tayy has joined #ruby
tommyvyo has joined #ruby
frogstarr78 has joined #ruby
nilg` has joined #ruby
chad_ has joined #ruby
williamcotton has joined #ruby
io_syl has joined #ruby
<Synthead> shouldn't "require 'active_support/core_ext/enumerable.rb'" work if I want .sum ?
greenarrow has joined #ruby
adeponte has joined #ruby
<Mon_Ouie> I don't know, but you can just do enum.inject(0, :+)
cwang has joined #ruby
MrGando has joined #ruby
greenarrow has joined #ruby
dbgster has joined #ruby
jrist-mtg has joined #ruby
lewix has joined #ruby
mrsolo has joined #ruby
mvangala has joined #ruby
apok has joined #ruby
pastjean has joined #ruby
<Tasser> Mon_Ouie, or even .inject(&:+)
<Tasser> or was it :+
<Tasser> nah, &:+
<Mon_Ouie> Both work, but they're not really the same as inject(0, :+)
<canton7> #inject is a special case iirc, and accepts :+
<Mon_Ouie> [].inject(:+) #=> nil, [].inject(0, :+) #=> nil
<Mon_Ouie> I mean #=> 0
<any-key> I hate "inject" when you can say "reduce" and it makes more sense
apeiros_ has joined #ruby
<any-key> it's just a fold, you're going from a many -> 1 relationship
<any-key> so "reduce" is more apt
<any-key> <-- snob
<canton7> for something like this, i'm inclined to agree with you
brngardner has joined #ruby
seungers has joined #ruby
<canton7> for a case where you're building up another variable (in a way which can't be done with map), #inject seems more intuitive for me
maxok has joined #ruby
spencerward has joined #ruby
<any-key> it's good we have a choice, it can make code easier to read at times
seungers_ has joined #ruby
<canton7> ^^ one of the things I love about ruby
<any-key> <3
* apeiros_ actually dislikes that plethora of aliases
<any-key> there's only a handful
<any-key> most live in enumerable anyways
<apeiros_> I disagree
<any-key> how dare you
<any-key> you're lucky Matz doesn't hang out here
<any-key> :P
<apeiros_> I'm a natural
twinturbo has joined #ruby
<any-key> ugh, random complaint with git: I'm really lazy at times so I do a commit -m for messages...but putting ! to express excitement doesn't go over well with bash :P
<apeiros_> use single quotes
<any-key> d'oh
<Kyle__> Is nimage not part of narray any more?
bglusman has joined #ruby
<any-key> that is appealing, I don't even have to press shift!
greenarrow has joined #ruby
TheIronWolf has joined #ruby
Floydzy has joined #ruby
adamkittelson has joined #ruby
<apeiros_> any-key: the only ugly part about single quoted strings in bash is how to escape a single quote within it… '\''
<any-key> true
* apeiros_ wants %{} for bash quoting :)
<any-key> at that point I just leave off -m and type my message in vim
<any-key> I'm still waiting on a decent ruby shell :D
<apeiros_> meh, I rather write "dont" etc. instead of going into an editor just for a commit message
<rippa> ruby is too smart for shell
<apeiros_> commit messages are mostly wasted time IMO (there may be different envs where they're more valuable)
<any-key> I find them useful, even when I'm the only one working on a project
maesbn has joined #ruby
<any-key> if I screw everything up it's nice to be able to revert back to when a certain feature worked
<burgestrand> every time I went back to look at a commit message I wished the author had explained *why* the change was made
maesbn has joined #ruby
<apeiros_> to improve the software! d'uh…
<any-key> also, when you use a bug/feature tracker putting reference to the bug/feature is essential
tatsuya_o has joined #ruby
<any-key> for work I add "Refs <number>" at the bottom of my commits
<any-key> <3 git
<burgestrand> I actually use them for closing github issues :)
<burgestrand> Very convenient
<burgestrand> On another note, about naming: artist.top_hits, artist.tophits, artist.top_tracks, artist.popular_tracks, or something else for a method that returns a list of an artist’s most popular tracks?
<any-key> burgestrand: I just don't write code with issues :D
<any-key> even more convenient :P
<burgestrand> any-key: :P
iocor has joined #ruby
<apeiros_> if top hits, then top_hits
<any-key> burgestrand: I'd do "hits", or something of that nature
<any-key> top_hits is more verbose in a good way though
<apeiros_> and now that any-key mentions it… top hits is kind of a pleonasm, isn't it?
Bofu2U_ has joined #ruby
<any-key> I suppose
<burgestrand> Hm!
<any-key> it is how he explained the functionality though
<any-key> so we all understood immediately from "top hits" what the function returned
jitesh_shetty has joined #ruby
jrist-mtg has joined #ruby
<burgestrand> hits is not bad either
<burgestrand> For some additional context, this is the object I’m adding the method to: http://rdoc.info/github/Burgestrand/Hallon/master/Hallon/ArtistBrowse
<any-key> reminds me...I should work on my ncurses itunes replacement
<any-key> if only I could get rbcurses to work :(
<apeiros_> curses is cursed
c0rn has joined #ruby
<apeiros_> (I never got any version of curses to work for me…)
jrist has joined #ruby
Russell^^ has joined #ruby
<Synthead> is there any way I can do a gsub backwards in ruby?
tatsuya_o has joined #ruby
stephenjudkins has joined #ruby
<oooPaul> What do you mean by "backwards"?
<burgestrand> Synthead: reverse the string, gsub it, reverse it again
JohnBat26 has joined #ruby
<burgestrand> :p
<shevy> :)
<burgestrand> Also reverse your regex
machine2 has joined #ruby
<shevy> well
<shevy> a gsub ...
<shevy> lol
<shevy> reverse a gsub???
<oooPaul> A gsub is global, so it doesn't really matter if it's backwards or forwards. :P
maveoanir has joined #ruby
<shevy> yeah!
<shevy> I think Synthead wants to do something else
<jeebster> question: is each_cons the correct method to call if I want to loop through an array and compare object values? say I wanted to check if the first value is greater than the following value)
<oooPaul> Unless you're doing block operations... :)
nfluxx has joined #ruby
<Synthead> shevy: I want to make "1, 2, 3" gsub'ed to "1, 2, or 3"
<burgestrand> jeebster: each_cons(n) will yield each value to the block n times
<burgestrand> jeebster: http://19pad.charlie.bz/1054
<any-key> gsub(/, (\d)$/, asdfasdf)
<shevy> "1, 2, 3".gsub(/(3)/,'or \\1') # => "1, 2, or 3"
<any-key> I forgot the syntax for the capture groups
mengu_ has joined #ruby
<any-key> ah, \1
<Synthead> shevy: with any text joined by ", "
<Synthead> schovi: for any "array" length
<Synthead> shevy: ^
<Synthead> schovi: sorry
<burgestrand> Synthead: couldn’t you replace the last ", " with ", or "?
<Synthead> burgestrand: that's exactly what I'm trying to do
mengu__ has joined #ruby
<shevy> Synthead I dont understand your new need case. the original problem was solved.
indeterminate has joined #ruby
<shevy> you want to replace the last ',' in a string with a ', or'
<shevy> is this correct?
<Synthead> shevy: my text isn't always going to be "1, 2, 3". it can be anything, separated by commas
<Synthead> shevy: the last ', ', but yes
<shevy> good
<shevy> the last ', ' with ', or'
<Synthead> oh, I see, yeah, ',' if you're replacing it with ', or'
<shevy> ...
<shevy> ok
<shevy> the last ',' with ', or'
<shevy> we need to stop the changing specs ;)
<Synthead> I could .reverse, then gsub with 'ro ,', then .reverse, but that's hugely tacky
iamjarvo has joined #ruby
brngardner has joined #ruby
iamjarvo has joined #ruby
choffstein has joined #ruby
<shevy> hmm actually
<burgestrand> Synthead: I’m thinking using String#rindex and replacing with a range
iamjarvo has joined #ruby
<shevy> what I wonder is why you want a .gsub
<shevy> the substitution with the above specification would be solvable with a .sub
iamjarvo has joined #ruby
<Synthead> shevy: I want to display hash keys (objects) in a nice, human-readable form
flagg0204 has joined #ruby
<shevy> I think burgestrand's solution is the simplest
<shevy> x = "1, 2, 3, 4, 5, 6"; x[x.rindex(','),1] = ', or'; x # => "1, 2, 3, 4, 5, or 6"
<shevy> I dont know how to make a regex to fetch the most distant element to the right :\
<shevy> "1, 2, 3, 4, 5, 6".sub(/(,)/,'or \\1') <-- that one works on the first , ... how to make it work on the last , ?
<vectorshelve> shevy: :)
<shevy> hmm
linoj_ has joined #ruby
<shevy> is that even possible?
<any-key> try matching [^|$] and doing a gsub
<any-key> or doing two separate substitutions...it will be easier to read
linoj_ has joined #ruby
Eldariof-ru has joined #ruby
<shevy> now I wanna know how to match to the most right element :(
<shevy> I need to get better at regexes
iocor has joined #ruby
<Synthead> what if I replaced ', \(.*\)\z' with ', or \1' ?
<burgestrand> shevy: you can fake it: , [^,]+$
<Synthead> yeah, that's kinda what I was thinking
<any-key> ^ and $ are your friends
<shevy> hmm
<Synthead> any-key: more like \A \z ;)
<burgestrand> But you’ll need to use backreferences in your replacement string
akemrir has joined #ruby
<burgestrand> And if the last element is very very long it’s really unnecessary :p
<shevy> what is the [^,] doing again?
<shevy> it looks like a smiley to me
<burgestrand> shevy: none of the characters inside the [^]
<Synthead> shevy: ^ = not, so not ','
<Synthead> yeah
<burgestrand> shevy: [^a-z] no lowercase letters between a to z
<any-key> Synthead: I guess those are a bit more clear
<Synthead> any-key: ^ and $ don't respect the beginning and ends of strings with newlines
pastjean has joined #ruby
kidoz has joined #ruby
akemrir has joined #ruby
akemrir has joined #ruby
<any-key> oooooh that's true
<any-key> common pitfall
zacstewart has joined #ruby
akemrir has joined #ruby
symb0l has joined #ruby
<Synthead> this is interesting, "1, 2, 3, 4, 5".sub('5\z', 'test') doesn't work as expected
dr_bob has joined #ruby
kpshek has joined #ruby
<Synthead> OH
<Synthead> "1, 2, 3, 4, 5".sub(/5\z/, 'test')
ed_hz_ has joined #ruby
<Synthead> how do I make sub non-greedy?
RORgasm has joined #ruby
<shevy> I dunno
<any-key> /regex/o I believe
<rippa> щ штеукзщдфеуы щтсу
<rippa> o interpolates once
<any-key> according to rubular.com, " perform #{...} substitutions only once"
<rippa> but you cn make modifiers non-greedy
<any-key> sub is inherently non-greedy, iirc
<any-key> gsub is greedy
<rippa> gsub is global
<shevy> gsub is lethal
<any-key> aah shit
<any-key> my regex-fu is rusty, I should shut up :P
<shevy> \o/
hukl has joined #ruby
friskd has joined #ruby
lectrick has joined #ruby
Bosma has joined #ruby
cpruitt_ has joined #ruby
cpruitt has joined #ruby
<Synthead> whatever
<Synthead> pita
<Synthead> "1, 2, 3, 4, 5".reverse.sub(/ ,/, ' ro ,').reverse works
<burgestrand> hehe
DMKE has joined #ruby
<burgestrand> Monkeypatched string, it was fun
<any-key> problem => use regular expressions => two problems
<shevy> hehe
<burgestrand> Synthead: ^ link is for you, you can do without the string monkeypatching if you want
<burgestrand> that’ll also crash horribly if there is no match
shruggar has joined #ruby
mehulkar has joined #ruby
RORgasm has joined #ruby
mengu has joined #ruby
mengu_ has joined #ruby
dv310p3r has joined #ruby
nfluxx has joined #ruby
bglusman_ has joined #ruby
matt312 has joined #ruby
voodoofish430 has joined #ruby
shruggar has joined #ruby
schaerli has joined #ruby
shruggar1 has joined #ruby
jonathanwallace has joined #ruby
sabooky has joined #ruby
<Mon_Ouie> Without reverse: "1, 2, 3, 4, 5".sub(/(.*),/, '\1 or')
`brendan has joined #ruby
<sabooky> How do you get multiple elements out of an array in one go. Say i want the 2nd, 4th, and 5th element? my_array[2,4,5] <- something like that
<oooPaul> [2,4,5].map{|idx| ary[idx]}
looopy has joined #ruby
<any-key> nice, that was fast
<oooPaul> I just happened to look here as the question was asked. :)
<any-key> oooPaul is now the quickest draw in #ruby
frogstarr78 has joined #ruby
wmoxam has joined #ruby
crazed_ has joined #ruby
<rippa> sabooky: array.values_at(2,4,5)
<sabooky> rippa: thanks
supernova has joined #ruby
maloik has joined #ruby
<any-key> hah, Enumerable wins again
<supernova> hello
<supernova> i need some help
<supernova> if anyone can help me out
<any-key> don't ask to ask, just ask
<supernova> i installed Ruby using RVM
<supernova> and after the installation it says package not found
flak has joined #ruby
<supernova> i have installed the same thing like 3 times
<burgestrand> supernova: what package?
<supernova> ruby -v
<burgestrand> supernova: did you switch to your new ruby?
<supernova> command not found
<burgestrand> supernova: "rvm use new-ruby"
<supernova> i just installed new
<supernova> i wanted to learn
<burgestrand> supernova: did you switch to your new ruby?
<supernova> yes i did rvm use ruby 1.9.2
<any-key> rvm use 1.9.3 --default
flak has joined #ruby
<supernova> yes i did rvm use ruby 1.9.2 --default
<supernova> and also checked by starting the rails server
<any-key> why not 1.9.3?
<supernova> it works
btaitelb has joined #ruby
<supernova> but after i log out and log in again
<burgestrand> supernova: have you restarted your shell since you installed rvm and ruby?
<supernova> same problem
<supernova> yes
<supernova> if i restart the shell
<oooPaul> Have you done "bundle install" ?
<supernova> it stops working
<burgestrand> supernova: so, after "rvm use 1.9.3" it works, but no longer if you login and logout?
<supernova> yes
<supernova> i created the project also
<supernova> ruby new project name
dennda has joined #ruby
<supernova> yes
scwh has joined #ruby
<supernova> exactly
<supernova> but after logout and login
<supernova> it cant find ruby , rails , RVM or anything
<supernova> i checked the .rvm file its there
Jakee` has joined #ruby
<supernova> everything is there when i install again it says all the packages are there it wont download it will just do something and it works at that time
bashdy has joined #ruby
iamjarvo has joined #ruby
mattyoho has joined #ruby
spuz has joined #ruby
<burgestrand> supernova: it can’t find rvm? then that’s probably your problem
<burgestrand> supernova: when you install rvm, it displayed a notice that you need to add a short little snippet to your .bash_profile (or similar)
<burgestrand> supernova: it usually looks something like this: [[ -s "/home/username/.rvm/scripts/rvm" ]] && source "/home/username/.rvm/scripts/rvm"
iamjarvo has joined #ruby
<burgestrand> supernova: it is what will load RVM when you enter a new session in your shell
<burgestrand> supernova: without that, rvm probably won’t be found, and it can’t set up ruby for you
moshee has joined #ruby
moshee has joined #ruby
<burgestrand> after you’ve added that script (after modifying the paths to point to *your* home directory) to your .bashrc, .bash_profile or .zshenv reopen your shell and it should work
<burgestrand> after you’ve done that it’s probably a good idea to execute "rvm requirements" and/or "rvm notes" and read both
Hsparks has joined #ruby
<supernova> i did that also
<supernova> i added the path in the .bashrc file
ph^_ has joined #ruby
mehulkar has joined #ruby
supernova has joined #ruby
<supernova> hey burgestrand u there
workmad3 has joined #ruby
agilobable has joined #ruby
swistak35 has joined #ruby
williamcotton_ has joined #ruby
iamjarvo has joined #ruby
bglusman has joined #ruby
stkowski has joined #ruby
sn0lan has joined #ruby
daveecee has joined #ruby
fr0gprince_mac has joined #ruby
davidcelis has joined #ruby
ctwiz has joined #ruby
Vert has joined #ruby
rippa has joined #ruby
dankest has joined #ruby
KL-7 has joined #ruby
shruggar has joined #ruby
<burgestrand> supernova: now I am
<burgestrand> supernova: make sure you do not have a return above the line in your .bashrc, and also make sure your .bashrc is actually loaded
<burgestrand> supernova: even then, when RVM is *not* working, it’s probably a good idea to try to load it manually: source ~/.rvm/scripts/rvm
<burgestrand> if rvm works after that, it’s the loading of RVM on login that is borked
tyman has joined #ruby
tyman has quit [#ruby]
jfelchner has joined #ruby
otters has joined #ruby
chimkan___ has joined #ruby
micah has joined #ruby
brngardner has joined #ruby
<micah> one of the lines in the output of a command produces "mail mdbox:~/mdbox:INDEX=/srv/dovecot_indexes//m/micah" -- I would like to get the path that follows the INDEX= into a variable, but my ruby skills are still to primitive
<micah> what method should I be looking at?
<micah> some substring match?
tyman has joined #ruby
classix has joined #ruby
<micah> maybe .sub!(/.*INDEX=/, '') ?
<micah> but somehow I have to get the output of that command :P
Chryson has joined #ruby
n3m has joined #ruby
luxurymode has joined #ruby
stephenjudkins has joined #ruby
sabooky has joined #ruby
spencerward has joined #ruby
classix has joined #ruby
sn0lan has joined #ruby
mehulkar has joined #ruby
tobor_one has joined #ruby
zacstewart has joined #ruby
supernova has joined #ruby
workmad3 has joined #ruby
IPGlider has joined #ruby
BSaboia has joined #ruby
josefig has joined #ruby
bbttxu has joined #ruby
mborromeo has joined #ruby
triptec has joined #ruby
Sailias has joined #ruby
bluOxigen has joined #ruby
<triptec> how do I copy a array?
<triptec> an*
<triptec> do I need to dump and marshal?
iamjarvo has joined #ruby
xcvd has joined #ruby
choffstein has joined #ruby
<otters> I would think clone or dup
<triptec> ok
niku4i_ has joined #ruby
A4ab51e26 has joined #ruby
<triptec> huh.. worked just fine, thanks
ryannielson has joined #ruby
orange33 has joined #ruby
ken_barber has joined #ruby
<orange33> Getting a strange error: Could not find a valid gem 'rack' (etc.), Possible alternatives: rack
<burgestrand> triptec: keep in mind it’s a shallow copy
<burgestrand> triptec: elements within it are not copied
<burgestrand> or, the copy of the array references the same elements
<orange33> Any ideas? 'gem env' shows rubygems.org, and gem list -r rack shows rack.
<supernova> hello burgestrand
<triptec> burgestrand: seems to work for me
<orange33> So 'rack' is an alternative to the invalid gem 'rack'.
<burgestrand> triptec: if that works for you then great
<supernova> i tried installing again 1.9.3
<burgestrand> supernova: with rvm I take it?
<supernova> and also did changes in the .baschrc file
<supernova> yes with RVM
<burgestrand> alright
classix has joined #ruby
<supernova> now i m paranoid bout logging off
Advocation has joined #ruby
<supernova> i mean restarting the shell
<burgestrand> supernova: do it
<supernova> if it stops working again then
<burgestrand> supernova: you’ll have to do it sooner or later
<burgestrand> supernova: then I have something new for you to try
<supernova> okk
<supernova> tell me will try that also
<burgestrand> supernova: you need to restart your shell and see if rvm is missing again after
bglusman_ has joined #ruby
<micah> what is the diff between %x[] and ``?
alem0lars has joined #ruby
<supernova> okk
<supernova> after restarting if i type rvm requirements it should work right ??
<burgestrand> supernova: yep
<burgestrand> supernova: any rvm command
<supernova> bash >= 4.1 required
<supernova> curl is required
<supernova> git is required (>= 1.7 for ruby-head)
<supernova> patch is required (for 1.8 rubies and some ruby-head's).
josefig has joined #ruby
<supernova> i got this as output
<supernova> does that mean that it is working now
Araxia_ has joined #ruby
<orange33> So 'gem list -r rack' shows 'rack,' but 'gem install rack' says 'Could not find a valid gem 'rack''.
<burgestrand> supernova: it means rvm is loaded, but those notes should probably be adressed, what about "ruby -v"
<supernova> yeah its showing me the version
<burgestrand> orange33: sorry, I have no idea about your issue, I’d just hammer the problem by reinstalling ruby/rvm
<burgestrand> supernova: \o/
yoklov has joined #ruby
<supernova> but it cant find rails
<supernova> and rails server is nt working
<burgestrand> micah: but to answer your question, ` is actually a method
<burgestrand> supernova: you have to be more specific
<burgestrand> supernova: what is it telling you?
kuzushi has joined #ruby
<supernova> ubuntu@binod-P5K-V:~$ rails server
<supernova> The program 'rails' is currently not installed. You can install it by typing:
<supernova> sudo apt-get install rails
davidw has joined #ruby
<burgestrand> supernova: gem list rails — what does it show?
<supernova> *** LOCAL GEMS ***
<supernova> rails (3.2.3)
<burgestrand> hm
<burgestrand> supernova: what did "ruby -v" show?
<micah> burgestrand: this one is really useful: http://tech.natemurray.com/2007/03/ruby-shell-commands.html
thecreators has joined #ruby
supernova has joined #ruby
<burgestrand> micah: sweet, thanks
crankycoder has joined #ruby
<burgestrand> micah: it doesn’t say anything about %x though
<supernova> what should i do next
<burgestrand> supernova: what is the output of "ruby -v"?
<supernova> ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-linux]
spencerward has joined #ruby
justinmcp has joined #ruby
<burgestrand> hm, odd
<burgestrand> supernova: could you run "gem environment" and put the result here: http://pastie.org/
<burgestrand> (and then give us the link)
<supernova> okk
<supernova> this is suppose to be the link right ??
<burgestrand> supernova: yes, thank you
sn0lan has joined #ruby
<burgestrand> supernova: what does "file /home/ubuntu/.rvm/gems/ruby-1.9.3-p125/bin/rails" say?
<micah> burgestrand: yeah you are right
Bonkers has joined #ruby
<burgestrand> micah: but you can use the differences between the other ones in that article and compare with %x :)
Bonkers has joined #ruby
<supernova> i didnt get u
<burgestrand> micah: I believe %x is an alias for `
<burgestrand> micah: it uses the same implementation at least, so if you override ` (def `(x); x.upcase; end) %x is also affected
<burgestrand> supernova: if you run "file /home/ubuntu/.rvm/gems/ruby-1.9.3-p125/bin/rails" in the terminal, what does it say?
<burgestrand> or write
<burgestrand> :)
td123 has joined #ruby
tatsuya_o has joined #ruby
brngardner has joined #ruby
krz has joined #ruby
<supernova> /home/ubuntu/.rvm/gems/ruby-1.9.3-p125/bin/rails: a /home/ubuntu/.rvm/rubies/ruby-1 script text executable
deobald has joined #ruby
<orange33> Huh, my problem only seems to be with installing 'rack'. daemons and eventmachine installed the same way just fine (these are all thin prerequisites).
<burgestrand> supernova: alright, one final thing then, could you do "echo $PATH" and show it to us?
<orange33> So (refresher) it claims not to be able to find 'rack' but suggests 'rack' as an alternative.
<supernova> /usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/ubuntu/.rvm/bin
<burgestrand> supernova: it looks like you are missing the gem executable path from your own path, which is why it cannot find "rails"
<burgestrand> supernova: could you do "rvm use 1.9.3" and then show us "echo $PATH" again?
deobald has joined #ruby
<orange33> Yet 'gem list -r rack' shows rack v. 1.4.1 in the resulting list.
<supernova> RVM is not a function, selecting rubies with 'rvm use ...' will not work.
<supernova> Please visit https://rvm.io/integration/gnome-terminal/ for a solution.
<burgestrand> heh
TheIronWolf has joined #ruby
<supernova> i followed exactly what is written in this site
<burgestrand> supernova: did you follow https://rvm.io/integration/gnome-terminal/?
csexton has joined #ruby
<burgestrand> It’s strange it mentions multi-user rvm though, you do not have that
<supernova> nope when i m using the command type rvm | head -1
<supernova> it says rvm is a function
<burgestrand> Hm.
<supernova> and when i use rvm use 1.9.3 --default
<supernova> ruby-1.9.3-p125-default is not installed.
<supernova> To install do: 'rvm install ruby-1.9.3-p125-default'
<supernova> sorry
kuzushi has joined #ruby
<supernova> this is the output for rvm use 1.9.3 --default
<supernova> Using /home/ubuntu/.rvm/gems/ruby-1.9.3-p125
<burgestrand> supernova: it’s okay, it is strange that you cannot use "rvm use 1.9.3" though
<supernova> its giving me the same output
<burgestrand> supernova: but you just said it gave you "RVM is not a function […]"
<supernova> /home/ubuntu/.rvm/gems/ruby-1.9.3-p125/bin:/home/ubuntu/.rvm/gems/ruby-1.9.3-p125@global/bin:/home/ubuntu/.rvm/rubies/ruby-1.9.3-p125/bin:/home/ubuntu/.rvm/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
<supernova> sorry i was seeing the output of previous line. i am sorry to mislead u
<supernova> and the output after using rvm use 1.9.3 is
<supernova> /home/ubuntu/.rvm/gems/ruby-1.9.3-p125/bin:/home/ubuntu/.rvm/gems/ruby-1.9.3-p125@global/bin:/home/ubuntu/.rvm/rubies/ruby-1.9.3-p125/bin:/home/ubuntu/.rvm/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
<burgestrand> supernova: it looks good, "rails" command should work now
<burgestrand> supernova: your problem seems to be that on a new shell RVM does not load ruby 1.9.3 fully, only half or so (because your $PATH contains not all things needed)
<burgestrand> supernova: if I was you I would try to fix the things you are shown in "rvm requirements", they might be the problem
<supernova> yeah i used this
<supernova> source "$HOME/.rvm/scripts/rvm
skrewler has joined #ruby
<supernova> then it started showing that RVM is a function
<supernova> its my second day with rails i will ask someone whom i know to fix it for me
<supernova> and thank you very much for your time and helping me out
<burgestrand> supernova: we are now back again with RVM not loading on login
<burgestrand> supernova: I would check that out first :)
mehulkar has joined #ruby
<burgestrand> supernova: you maybe have a "return" in your .bashrc, or it is not running on login
<burgestrand> supernova: but I will go now, hope you solve it soon
<supernova> one last question
<maddog_> Hi, given I have two Arrays, containing partly the same content, is there a way retrieve all values that are present in both arrays?
<supernova> if i do rails server
<supernova> the server should start right
<burgestrand> supernova: yes, after the source "$HOME" thing and "rvm use 1.9.3" it should work
<supernova> whats the port that the server use
<burgestrand> maddog_: array_one & array_two
<burgestrand> supernova: it will tell you when it starts :)
<burgestrand> supernova: I think 3000
<burgestrand> maddog_: Array#& is array intersection
<supernova> but it not showing me that
<burgestrand> supernova: what is it showing you then?
<maddog_> burgestrand: perfect, thanks :)
<supernova> it showed me some errors
<burgestrand> maddog_: \o,
<supernova> and said me to use bundle install
<supernova> i did that
<supernova> now its working
<burgestrand> supernova: good :)
<supernova> thanks thanks again
<supernova> and i will be coming here again and again
<supernova> ppl in IRC are really helpful thats why i love IRCs more then any other chat thing in world
<orange33> I tried installing rack again with verbose mode enabled and there seems to be an 'ECONNREFUSED' error in there. However this only occurs with the rack gem, not with the other gems I've just installed.
<burgestrand> sometimes we can be real dicks to, I try to not be :)
JivaD has joined #ruby
<burgestrand> orange33: weird!
<supernova> Thank You burgestrand
<orange33> Something about the entry on rubygems.org?
<burgestrand> orange33: is it picking up rack from some other source?
<supernova> that was good one
<burgestrand> orange33: it works for me :p
flagg0204 has joined #ruby
<burgestrand> orange33: anyhow, try asking in #ruby-lang, they might know
<orange33> I compared its verbose output with that of the gem daemons, and they seem roughly the same as far as the servers they're hitting.
<burgestrand> supernova: you’re welcome :)
<burgestrand> orange33: somebody really does not want you getting rack
<orange33> I always get the weird stuff like this. :(
<supernova> again i am back where i started from :(
sabooky has joined #ruby
<burgestrand> supernova: you reopened your shell?
kpshek has joined #ruby
<supernova> yes
<burgestrand> supernova: RVM does not load properly from your .bashrc, I believe that is the root of your problem
workmad3 has joined #ruby
<supernova> even i think thats the problem
<supernova> so any way to fix that
<burgestrand> supernova: make sure there is no return or exit in the .bashrc
<burgestrand> supernova: and also make sure it is loaded on startup, maybe it is not
<burgestrand> supernova: if you do "source ~/.bashrc" after opening a new shell, does "type rvm | head -1" say RVM is a function?
<supernova> yes
<supernova> only thing is rails is nt starting up
<burgestrand> supernova: if you start a new shell, and *not* do anything, does "type rvm | head -1" still say "rvm is a function"?
<supernova> rvm is /home/ubuntu/.rvm/bin/rvm
<supernova> it says the above
sohocoke has joined #ruby
<burgestrand> supernova: hm, I think your .bashrc is not getting loaded on startup at all
<burgestrand> supernova: you can move it, "mv ~/.bashrc ~/.bash_profile" and try to start a new shell and do "type rvm | head -1" again and hope it says "rvm is a function"
bawer has joined #ruby
<burgestrand> hm, maybe you are using zsh and not bash
poincare101 has joined #ruby
<supernova> after moving that file it saying bash:type:RVM not found
<burgestrand> hm
brngardner has joined #ruby
<bawer> hi rubyists! anyone running ruby in production? what are you guys using as web-server/app-server? nginx + unicorn?
<burgestrand> bawer: usually just thin
<canton7> passenger may be worth looking into if you haven't come across it
<bawer> is thin usable in production?
kirun has joined #ruby
<bawer> canton: I'm actually having trouble building passenger on SmartOS, that's why I chose not to use it.
<supernova> after moving that file it saying bash:type:RVM not found
<burgestrand> supernova: okay, maybe move it back :)
<burgestrand> supernova: "mv ~/.bash_profile ~/.bashrc"
<bawer> burgerstrand: have you used thin on a production server with good results?
<supernova> rvm is /home/ubuntu/.rvm/bin/rvm
<burgestrand> bawer: yes
<supernova> i think i have to give up my thoughts of learning Ruby
<shevy> supernova depends
<shevy> real men compile ruby from source
<supernova> but i really want to learn
jenglish has joined #ruby
nemesit has joined #ruby
<shevy> the initial problem is debian hates ruby
<cconstantine> shevy: word
bglusman has joined #ruby
<bawer> problems building on Deb?
TheIronWolf has joined #ruby
FACEFOX has joined #ruby
classix has joined #ruby
<supernova> but my fren works in a company and they use Ruby with ubuntu
<supernova> its a e-commerce company
<shevy> dunno, just the usual bawer ... debian-user comes here, realizes that debian crippled ruby, then it is recommended to use RVM (which may or may not work)
<supernova> my fren also said install using RVM
<bawer> but, are there problems actually building it on Debian?
<shevy> ah
<shevy> so he is not using debian, he is using RVM
TheIronWolf has joined #ruby
<supernova> okk
<supernova> okk
<bawer> I just built the latest stable on SmartOS, which is an OpenSolaris spinoff
<shevy> bawer, should not be. ruby does not depend on that many things. I can compile ruby from source on debian fine
<burgestrand> I’ve never hit any problems building ruby with rvm on debian nor ubuntu
<burgestrand> but many others have
<shevy> only problem may sometimes be openssl I have, but this was always because of missing .h files, which apt-get install <SOMETHING_HERE> can fix
<burgestrand> most often they try to install ruby via apt first
<supernova> yeah i m facing hell lot of problems
<burgestrand> and then they try rvm on top of that
TheIronWolf has joined #ruby
<shevy> :)
<supernova> making it run so that i can try writing my first ruby program
FACEFOX has joined #ruby
<shevy> supernova, well dont give up hope too quickly. if I'd sit at your computer, it would not take me long to compile ruby into /usr prefix :P
<bawer> supernova: is it a 'desktop' system or some remote server? I mean? can you just install ubuntu in a virtual box and give it a try from there?
<shevy> but I am not the one to recommend RVM, for RVM you have to ask others here like... burgestrand !
<burgestrand> supernova: considering "source ~/.bashrc" makes it work tells us it should work if your shell loads .bashrc
<bawer> RVM is pretty easy to get going if it works on your system
<burgestrand> supernova: but when moving .bashrc you get errors from your shell
<burgestrand> very strange ^^
<supernova> yeah
<burgestrand> supernova: I can’t help you any more, sorry, if you need more help ask in #rvm, they are good with rvm :)
<shevy> if the RVM method fails, there is always the source way ;)
<burgestrand> that or rbenv
FACEFOX has joined #ruby
<supernova> i think i have to wait for that fren who has been using ruby in production level to come to my place and help me out
<shevy> supernova, what ruby version do you want to use? 1.9.x or 1.8.x ?
<bawer> yeah.. I had problems with RVM, I just build ruby from source instead
<supernova> 1.9.x
<supernova> 1.9.2 or higher
<shevy> k use a shell, make a directory... then "wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p105.tar.bz2"
<supernova> i searched and it says 1.9.1 has some stability issues
<bawer> why not latest stable?
BSaboia__ has joined #ruby
<supernova> 1.9.2 or plus is okk
<shevy> when it was downloaded do "tar -vjxf ruby-1.9.3-p105.tar.bz2" then change dir into that dir
<supernova> and i think 1.9.3 is only there after that
<shevy> then do a "./configure --prefix=/usr" and report what error it throws (if it throws no error, your task is even easier!)
<bawer> also get libyaml on your system before build
<shevy> oh
<shevy> true that
FACEFOX has joined #ruby
<shevy> how is the debian way for that...
<shevy> apt-get install libyaml <--- I am sure this won't work.
<bawer> yeah.. debian? long time ago
<shevy> latest source for libyaml is http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz
cooper has joined #ruby
<bawer> googleit? :)
<supernova> ubuntu@binod-P5K-V:~$ type rvm | head -1
<supernova> rvm is /home/ubuntu/.rvm/bin/rvm
<supernova> ubuntu@binod-P5K-V:~$ source "$HOME/.rvm/scripts/rvm"
<supernova> ubuntu@binod-P5K-V:~$ rvm use 1.9.3 --default
<supernova> Using /home/ubuntu/.rvm/gems/ruby-1.9.3-p125
<supernova> ubuntu@binod-P5K-V:~$ type rvm | head -1
<supernova> rvm is a function
<supernova> ubuntu@binod-P5K-V:~$ ruby -v
<supernova> ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-linux]
<supernova> it works fine till this point
<shevy> do you still have old ruby version btw?
<shevy> at /usr/bin look for all *ruby*
<bawer> supernova? when does it go wrong?
FACEFOX has joined #ruby
<shevy> typically debian has a /usr/bin/ruby1.8
machine2 has joined #ruby
<shevy> as symlink to -> ruby or vice versa
<shevy> well!
<shevy> at least it reports the right version, right?
<shevy> 1.9.3p125
<shevy> oh damn... I have an outdated 1.9.3
<bawer> that output looked right
<supernova> there is nothing called ruby in /usr/bin
<shevy> ok less things that could be wrong in theory then
johnmilton has joined #ruby
tatsuya_o has joined #ruby
<supernova> but when i use the command rails server
<shevy> can you start irb?
<supernova> irb ??
<shevy> yes
<shevy> it comes bundled with ruby
<shevy> "irb - interactive ruby"
<shevy> you can test ruby code interactively with it
<shevy> pls try it
<supernova> ubuntu@binod-P5K-V:~$ rails server
<supernova> Usage:
<supernova> rails new APP_PATH [options]
<supernova> Options:
<supernova> -r, [--ruby=PATH] # Path to the Ruby binary of your choice
<supernova> # Default: /home/ubuntu/.rvm/rubies/ruby-1.9.3-p125/bin/ruby
<supernova> -b, [--builder=BUILDER] # Path to a application builder (can be a filesystem path or URL)
<supernova> -m, [--template=TEMPLATE] # Path to an application template (can be a filesystem path or URL)
<shevy> try "irb"
<supernova> [--skip-gemfile] # Don't create a Gemfile
<d-snp> hey bawer, what is smartos?
<shevy> you can try rails when ruby works
<shevy> can you try irb pls
<bawer> ok, so he has a working ruby?
FACEFOX has joined #ruby
<shevy> I dunno yet
<shevy> he wants to jump to rails already :P
<supernova> no
<supernova> i dnt want to jump
<shevy> supernova, start irb. when you started it, do this:
<shevy> RUBY_VERSION
<supernova> how to start IRB
<d-snp> ?
<d-snp> you can just do ruby --version
<shevy> supernova, type "irb" in your terminal. Like you did with "ruby"
td123 has joined #ruby
<supernova> ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-linux]
<shevy> did you start irb?
<bawer> d-snp: http://smartos.org/
<d-snp> is it a linux distro?
<supernova> ubuntu 11.10
<d-snp> I'm looking at it but I'm a bit confused
FACEFOX has joined #ruby
<supernova> yes
<supernova> i started the IRB
cooper has joined #ruby
<bawer> it's a distribution based on the Illumos kernel, a fork of OpenSolaris
<d-snp> hey supernova, what are you trying to do, I fell into your discussion just now
<shevy> supernova EXCELLENT
<shevy> do:
<supernova> was trying to install ruby on rails
<d-snp> oh, we did try to support opensolaris I think, what kind of issue did you have with passenger?
<shevy> RUBY_VERSION
<d-snp> shevy: he's running 1.9.3
<d-snp> p125 :P
<shevy> supernova, sorry. for ruby-on-rails try #rubyonrails
<shevy> supernova, you can start coding in irb
<bawer> d-snp: are you involved in the passenger project?
<supernova> => "1.9.3"
<d-snp> bawer: a bit yes
<shevy> class Foo; def hi; puts "hi from Foo"; end; end; x = Foo.new; x.hi
<shevy> ^^^ you can copy paste this into IRB supernova and it will work
<shevy> tada! welcome to ruby!!!
<d-snp> shevy: that's the worst introduction I've ever seen :D
<bawer> d-snp: there are some strange things that kills the build? I could show you if you like.. it has to do with Solaris-stuff, but it chokes in some of the defines
jonathanwallace has joined #ruby
nimred has joined #ruby
<supernova> THAT I already tried using print 'my name'
<supernova> so for rails i need to go somewhere else
<bawer> supernova: do you know any programming languages from before?
<supernova> yes
<shevy> yeah it is complicated
<shevy> it would be easier if you spend some days with ruby first, without rails
<supernova> that was funny
willb has joined #ruby
<supernova> u know any programming language
<any-key> programming is overrated
<shevy> rails has some bad practices
<d-snp> no it doesn't
<d-snp> :P
<supernova> actually i need ruby on rails for a project
<shevy> what was the PHP thing... class HashThatActsLikeArray
mengu has joined #ruby
<any-key> rails is its own universe, it won't force you to /learn/ ruby
<bawer> supernova: me? yes I know some.. I was just asking so I could give you some links and stuff
<supernova> okk
<supernova> actually i work in a IT company
<shevy> rails is like one of those carnivorous plants
<shevy> and you are the insect
<supernova> and i know couple of languages
<d-snp> lol
<d-snp> what do you guys have against rails?
<bawer> rails is an opinionated framwork and it doesn't try to hide that fact
<supernova> this ruby thing is new
<shevy> d-snp sometimes a bazooka, usually only my fists :(
<supernova> and my boss expects me to learn in a week and start the project
<shevy> cool
<shevy> one week
<supernova> yeah
dv_ has joined #ruby
<shevy> you should fire your boss and get a new one
<d-snp> heh, supernova that doesn't sound very realistic
<supernova> thats why he told me to meet him next week
<shevy> one week
<supernova> he gave me a week holiday
<bawer> supernova: ok, so you are interested in rails? have you worked with any other web-development frameworks before?
<shevy> well
<shevy> make a simple rails tutorial then
<d-snp> you can get a bit of a grip on rails in that time, but you won't be very good
<supernova> what to do atleast i should be in a position to write something
<shevy> but learning ruby and rails in one week is a joke
v0n has joined #ruby
<d-snp> no.. I think you should go to railscasts.com and follow all the basic tutorials
<supernova> i also know that
<shevy> supernova, ok work through this tutorial then:
<supernova> i have been following that ruby on rails org
<supernova> but to try my hands on
<bawer> shvy: quit it! :)
<shevy> you have irb, test this all in irb. when you understood the chapter, move to next chapter
<supernova> atleast i need ruby on rails working in my system
<supernova> job
<shevy> when you FINISHED it, then start rails
<d-snp> learn to program.. really?
<shevy> yeah
etank has joined #ruby
<supernova> i would then have to start looking for new job
<bawer> supernova: it seems that ruby is actually working for you. doesn't it?
<shevy> he will understand the ruby object model after that
<supernova> yeah i was working on C
<d-snp> ..
<supernova> yeah ruby is working for me
<d-snp> that sounds like a very bad idea, just read through the ruby reference model for an hour and then get to doing rails tutorials
<bawer> supernova: good start :) have you tried like some of the basic "hello world" tutorials for Rails?
<supernova> rails is not working that my problem
<d-snp> ruby is super easy, nothing complicated you need that's in the way of building a nice rails app that a 'learn to program' book will teach you imo
<supernova> i have tried writing a login module also
<burgestrand> supernova: what error are you getting when doing "rails server"?
<supernova> but for that i need the rails server runnning to see my code
<bawer> supernova: what exactly do you mean by 'not working'?
SuperNewb1 has joined #ruby
<supernova> ubuntu@binod-P5K-V:~$ rails server
<supernova> Usage:
<supernova> rails new APP_PATH [options]
<supernova> Options:
<supernova> -r, [--ruby=PATH] # Path to the Ruby binary of your choice
<supernova> # Default: /home/ubuntu/.rvm/rubies/ruby-1.9.3-p125/bin/ruby
<supernova> -b, [--builder=BUILDER] # Path to a application builder (can be a filesystem path or URL)
<supernova> -m, [--template=TEMPLATE] # Path to an application template (can be a filesystem path or URL)
<d-snp> ...
<supernova> it shows me this
<burgestrand> supernova: you must create a rails application
<d-snp> don't paste in chat
<shevy> man
<supernova> okk sorry
<shevy> supernova, work through it http://pine.fm/LearnToProgram/?Chapter=01
<bawer> supernova: paste in pastebin.com (you don't need an account)
<burgestrand> supernova: if you have a rails application, you must run "rails server" *inside* it
Foxandxss has joined #ruby
<d-snp> that's because you first have to do 'rails new your_app_name'
<supernova> i should paste in that pastie.org
<d-snp> but this is getting out of hand, you should just go read rails tutorials
<supernova> i did that i created a project also
<shevy> yeah
<d-snp> your rails is running fine
<supernova> from the tutorial
<shevy> "rails create bla" or something like that
<shevy> but please man
<supernova> but when i open a terminal again
<shevy> dont go into rails without knowing AT LEAST A LITTLE BIT about ruby
<bawer> supernova: http://guides.rubyonrails.org/getting_started.html .. read it.. really
<supernova> rails not found
<shevy> he will die
<shevy> one week left
<burgestrand> supernova: it is because rvm is not loading
<d-snp> supernova: you need to reboot ubuntu for it to work probably
<supernova> use sudo apt-get install
<shevy> nah
<d-snp> or log out/log in again
<shevy> argh
<supernova> i tried everything
<shevy> why does he want to use apt-get suddenly
<d-snp> it's because his virtual terminal ap didn't load rvm?
<shevy> I swear, debian dumbs down people
<supernova> and with the help pf burgestrand
<burgestrand> supernova: start a new shell
<bawer> no.. it's probably beacause of that one-liner you need in your .bashrc
<burgestrand> if I could just… screen share with you this could probably be solved very quickly, so I could see what you are actually typing
<supernova> now i can atleast reach to a point where the system says ruby is there
<supernova> how to do that
<burgestrand> supernova: open new terminal
jchauncey has joined #ruby
<burgestrand> supernova: rvm will not be there, right?
<supernova> i did
kuzushi has joined #ruby
<burgestrand> supernova: "type rvm | head -1", does not say "rvm is a function", yes?
<supernova> rvm is /home/ubuntu/.rvm/bin/rvm
<d-snp> in a new terminal, `which ruby` should give you a location that includes .rvm
<supernova> no it doesnt
<supernova> 1.9.3
<burgestrand> supernova: okay, now do "source ~/.bashrc", *NOT* the RVM source line
<d-snp> if it doesn't, then either your rvm is not installed correctly, or it wasn't loaded correctly
<fowl__> rvm seems like such a PITA
<supernova> after that
<fowl__> rb-env ftw
<burgestrand> supernova: "type rvm | head -1", what does it say?
mikepack has joined #ruby
<supernova> same thing
<bawer> there is an alternative.. called rbenv...
<supernova> rvm is /home/ubuntu/.rvm/bin/rvm
<burgestrand> supernova: good, can you paste your ~/.bashrc?
<burgestrand> supernova: pastie.org
<supernova> okk
<bawer> source "$HOME/.rvm/scripts/rvm"
krz has joined #ruby
csexton has quit ["Textual IRC Client: http://www.textualapp.com/"]
<d-snp> >_>
<burgestrand> bawer: he has it in his .bashrc, or he’s said he has it
<burgestrand> but if he does, source ~/.bashrc would have loaded RVM
<Mon_Ouie> He doesn't
<Mon_Ouie> You need source "$HOME/.rvm/scripts/rvm"
<Mon_Ouie> Not just "$HOME/.rvm/scripts/rvm"
<burgestrand> supernova: line 105 is wrong
<burgestrand> supernova: inside .bashrc
malkomalko has joined #ruby
<burgestrand> supernova: after you have changed, please pastie your new .bashrc
<d-snp> >_>
<burgestrand> d-snp: I’ve done this for two hours now, trust me it’s necessary :p
<d-snp> yes.. I see
<d-snp> I'm going to go back and code in C :P
<burgestrand> So you do C!
* burgestrand badabum tish
<d-snp> :P
<d-snp> I'm in this weird quest implementing websocket in passenger, and everytime I feel I'm very close to where I need to be, it turns out I need to be in a whole different place
<bawer> hah!
<bawer> d-snp: cool.. would you know who to talk to, if perchance you don't get whats wrong with passenger on SmartOS/OpenSolaris
<d-snp> well, usually hongli is interested in weird build errors, so your best shot is to open an issue on passenger, and attach a log of your build, showing where it fails
<lectrick> Is it possible to freeze individual hash key/value pairs?
<supernova> yes it says rvm is a function even if i open a new terminal
<burgestrand> supernova: it looks good now
<burgestrand> supernova: hooray!
brngardner has joined #ruby
netrealm has joined #ruby
<d-snp> bawer: but there's a chance he just won't bother, because the non-standard operating systems have _very_ weird properties, I remember hongli's reported a dozen kernel issues with opensolaris
<d-snp> it's just not very.. production proof :P
<burgestrand> supernova: can you show the output of "echo $PATH"?
<supernova> to paste here or in pastie.org
<burgestrand> lectrick: please, don’t freeze things!
<d-snp> maybe not a dozen, but a few anyways
shadoi has joined #ruby
<burgestrand> supernova: pastie.org
frogstarr78 has joined #ruby
<burgestrand> lectrick: it’s your choice, but for the sake of everyone, don’t :p
<lectrick> burgestrand: Functional programming style really wants immutable values
<bawer> d-snp: A lot of things actually do build on that system, just not passenger 'put-of-the-box'.. I would like to help and make it 'rpoduction-ready' if I can :)
blueadept has joined #ruby
blueadept has joined #ruby
<fowl__> lectrick, you want to freeze things because its your style?
<burgestrand> supernova: looks good now
<burgestrand> supernova: new terminals should have RVM loaded
<supernova> now how to start rails server
<burgestrand> supernova: and ruby loaded too, and rails available too
spencerward has joined #ruby
<burgestrand> supernova: where is your rails project you created for the guide?
<burgestrand> supernova: what is the path to it?
<lectrick> fowl__: They call me MRI Ice
<d-snp> so an issue with details of the failing build would be very welcome :) at the least you'll receive some feedback as to why we think it doesn't work
<supernova> okk
<d-snp> and in the best case hongli will immediately fix it
<supernova> so i need to be in that project to start the rails server
<supernova> thanks
<supernova> thanks everyone
<fowl__> lectrick, i'll give that one two claps and not a clap more
<burgestrand> supernova: yes, otherwise rails server does not know what project to serve
<burgestrand> supernova: :p
<supernova> will sleep now its 3 in the morning here
<supernova> and i learned a great deal today
<burgestrand> :)
<supernova> thanks everyone for helping me out
ctwiz has joined #ruby
<supernova> will be seeing u guys again .. byee
<lectrick> fowl__: :)
<bawer> supernova: good luck with your Rails-week! :)
<supernova> yeah
<supernova> he gave me holiday
<d-snp> :P
<d-snp> I hope it's a paid holiday..
<supernova> going office wud have been better then scratching me head
<supernova> yeah
<burgestrand> supernova: hehe
<supernova> paid one but one week and rails
jonathanwallace has joined #ruby
<supernova> lest see
<supernova> see u all tomorrow
<d-snp> nn :)
<bawer> bummer boss
<lectrick> > 5.freeze; 5.frozen? #true > 2.frozen? # false > (2+3).frozen? # true ...WHOA.
<lectrick> Individual scalar integer values can be frozen? That's bizarre
krzkrzkrz has joined #ruby
<shadoi> 5 is 5, no matter where you have it
<shadoi> or how you get to it.
<bawer> 2+3=5?
telling has joined #ruby
telling has joined #ruby
<LiquidInsect> lectrick: an instance of Fixnum with a given value has a static object id
<LiquidInsect> like symbols
<LiquidInsect> so when you froze 5, you froze the one instance of the Fixnum 5
<lectrick> LiquidInsect: TIL. ("today i learned", for non-redditors)
<bawer> yaaay! knowledge is the shiznits! :)
<LiquidInsect> lectrick: something else that might interest you...
<LiquidInsect> [1,2,3,4,5].map(&:object_id) => [3, 5, 7, 9, 11]
sabooky has joined #ruby
bwlang has joined #ruby
mcwise has joined #ruby
<lectrick> ... head hurts, need moar coffees
<lectrick> ;)
<lectrick> Is there a way to reverse-map object ID's back to their objects?
<lectrick> I bet it's something in ObjectSpace
sebastorama has joined #ruby
<bwlang> i think i must be having a bad brain day... can't seem to split a string like this 0A0^CC110T5 into [0,A,0,^CC,110,T,5]. Tried regex like this ?<=\d, but that's not quite right. what am i missing here?
<lectrick> LiquidInsect: ^
<bwlang> is there some nice way to do this?
<LiquidInsect> lectrick: oh I don't know, you're probably right
<lectrick> bwlang: It looks like you want to split on number boundaries basically
<Mon_Ouie> lectrick: Yep, ObjectSpace._id2ref object_id
<bwlang> i lectrick: yeah - i think so - but i couldn't figure out the regex for it. i'm about to resort to while i < string.length ...
Vert has joined #ruby
keyword has joined #ruby
<keyword> hi guys I have a question anyone knows some ruby lib for check if some things about proxy like country, latency
kevinbond has joined #ruby
<d-snp> bwlang: that is not a very bad idea
<bwlang> keyword: sounds more like a database than a library
<d-snp> writing a small parser can be a lot more efficient, if not just as well as a regex, and sometimes easier to read too
<lectrick> bwlang: "0A0^CC110T5".split(/(\d+)/)
<d-snp> ..
d3c has joined #ruby
<d-snp> unless it really is _that_ simple :P
<keyword> bwlang: mmm for example I have a proxy I want to see latency country, you cant see the latency from a database
<lectrick> d-snp: It is. Double check my solution :)
<d-snp> yes :P
<lectrick> The only "catch" is the first result is a blank string
<bwlang> lectrick: huoh! - and me with the fancy look ahead look behind stuff...
<bwlang> lectrick: thanks - i suspected i was missing something stupid...
philcrissman_ has joined #ruby
<shadoi> as long as it always alternates between \w and \d it'll work
<lectrick> bwlang: i have a knack for regex for some reason
<bwlang> d-snp: by the way - this is for parsing Single Nucleotide Polymorphisms (snps) from an alignment.
<lectrick> bwlang: fuck yeah did I just help with something computationally genetic? Love it
<d-snp> lol bwlang :P
tommyvyo has joined #ruby
bwlang_ has joined #ruby
<lectrick> bwlang: BTW I thought that entire industry was dominated by Python...
<bwlang_> lectrick: not in my lab ...
<LiquidInsect> lectrick: I got sucked into helping a friend with something similar (phylogeny not directly with genetics) and I didn't do it in python...
asobrasil has quit [#ruby]
<shadoi> my friend ran a bioinformatics department at stanford and they used ruby
<LiquidInsect> 8)
<lectrick> LiquidInsect: bwlang_ Ah, that's cool. The last time I looked at bioinformatics I was disappointed to see a lot of python I think
jenglish has quit [#ruby]
<lectrick> shadoi: again, awesome. did not know! Thought there was a lot of python.
<lectrick> bwlang: I hope this brings us one step closer to curing cancer. right, right?
<shadoi> bwlang: SNPS aren't always alternating digit and alpha are they?
QKO has joined #ruby
malkomalko has joined #ruby
<bwlang> lectrick: weellll... it's s stretch - but maybe.
<lectrick> bwlang: :)
<bwlang> shadoi: this is a description of an alignment from a SAM file - see http://samtools.sourceforge.net/SAM1.pdf for the MD field... it describes how the read differs from the reference (could be SNPs or insertions or deletions)
<keyword> bwlang: so do you have any idea?
davidw has joined #ruby
<shadoi> guess so
<bwlang> keyword: sorry - i don't really know ...
<keyword> bwlang: np thanks
<lectrick> a = 5; a.freeze; a = 6 # no error? wtf
niklasb has joined #ruby
<shadoi> you froze 5
<Mon_Ouie> You don't freeze variables, you freeze objects
frogstarr78 has joined #ruby
<Mon_Ouie> You can't mutate that object anymore, but you can still modify any variable that references it
<LiquidInsect> and you can't mutate a Fixnum anyway
<LiquidInsect> Try it with strings
<Mon_Ouie> You can, actually
<Mon_Ouie> They have instance variables too
<LiquidInsect> Oh really?
<LiquidInsect> ah ok
<Mon_Ouie> (not that it's a good idea to use those ivars)
<LiquidInsect> I assume they don't have accoessors
spencerward has joined #ruby
<banisterfiend> LiquidInsect: u cna define accessors for them too
<LiquidInsect> banisterfiend: you CAN...
tvw has joined #ruby
axl___ has joined #ruby
<banisterfiend> LiquidInsect: yeah... :)
<LiquidInsect> but it's never a good idea to decide "hey, this class I didn't make? I'm going to go ahead and monkeypatch in stuff that dives behind its implementation and messes with its private parts"
mborromeo has joined #ruby
TheIronWolf has joined #ruby
<banisterfiend> LiquidInsect: monkeypatching has its legitimate uses
<LiquidInsect> banisterfiend: oh sure
Jake232 has joined #ruby
<LiquidInsect> our app has patches on Hash and some other core classes
<oooPaul> Rails has some great monkeypatches that I often miss when I'm doing straight Ruby. :P
<LiquidInsect> but they don't go around messing with instance variables and send()ing private method calls
<oooPaul> ...also true. :)
<Boohbah> monkeypatch is the dumbest name i have ever heard...
NivenHuH has joined #ruby
mehulkar has joined #ruby
<banisterfiend> Mon_Ouie: did you see our new command that can show you all monkeypathces for a class? :)
<NivenHuH> silly question, but how can you use the 1.9 style hash syntax when there's a dash in the symbol? eg: data-name
kevinbond has joined #ruby
<LiquidInsect> NivenHuH: does :"data-name" work?
keyword has quit [#ruby]
<LiquidInsect> oh wait, the colon comes after there huh...
<LiquidInsect> so then, does "data-name": work?
<NivenHuH> LiquidInsect :"data-name" works, "data-name": does not work
Foxandxss has joined #ruby
<Mon_Ouie> banisterfiend: I saw that you mentioned it. Sounds like a nice idea.
classix has joined #ruby
<banisterfiend> Mon_Ouie: monny https://gist.github.com/2405083
workmad3 has joined #ruby
axl_ has joined #ruby
maveoanir has joined #ruby
chson has joined #ruby
malkomal_ has joined #ruby
giles has joined #ruby
cbuxton has joined #ruby
<shadoi> *drool*
<fowl__> banisterfiend, thank you for showing me how janky rvm code is
mailtruck_ has joined #ruby
<fowl__> nvm thats grit
<fowl__> whatever that is
<shadoi> git repo ruby lib
<fowl__> o
<banisterfiend> o
nif has joined #ruby
iocor has joined #ruby
PragCypher has joined #ruby
stephenjudkins has joined #ruby
MaGiC_Reloaded has joined #ruby
davidw has joined #ruby
burgestrand has joined #ruby
Guedes0 has joined #ruby
<burgestrand> lectrick, Mon_Ouie: careful about ObjectSpace._id2ref, it’ll return whatever object that currently has that ID, even if it’s something really strange that you should not call methods on, it might not be the object you originally had at that ID since ruby reuses the object ids after they’ve been GC’d
mehulkar has quit ["Leaving"]
nif has joined #ruby
<Mon_Ouie> Yeah, you just shouldn't use it for anything except perhaps for debugging purpose
mlue has joined #ruby
<banisterfiend> burgestrand: like what kind of weird monster cant u call mlethods on burgy
<burgestrand> you can call methods on them but they tend to segfault :p
<banisterfiend> burgestrand: oh, a GC'd object?
<Mon_Ouie> Or implementation-private object perhaps?
<burgestrand> banisterfiend: yeah, often those, but sometimes also some kind of VM object when done from a separate thread
<banisterfiend> Mon_Ouie: what's an implementation-private object mon?
<banisterfiend> ah cool
<banisterfiend> sounds interesting
<banisterfiend> burgestrand: what class do they belong to? do they even have that?
<Mon_Ouie> Don't know, just guessing Ruby could allocate objects that aren't really supposed to be used outside the VM itself
<banisterfiend> burgestrand: ah im guessing like one of those strange 'block environment' objects?
<burgestrand> no idea, it segfaulted on me and I kind of wanted to fix the reason for the issue :p
<burgestrand> I recall it being named Ruby::VM or similar
<banisterfiend> one sec, ive created those objects myself when i was doing binding of caller
<burgestrand> RubyVM::something
<burgestrand> I’d guess
<Mon_Ouie> I guess that's the kind of stuff I was talking about too :p
blueadept has joined #ruby
blueadept has joined #ruby
<banisterfiend> burgestrand: RubyVM::Env
<banisterfiend> i think
<Mon_Ouie> Well, the only other one (assuming they all show with #constants) is InstructionSequence
chad_ has joined #ruby
<burgestrand> it was actually kind of fun messing with it
<burgestrand> needed a hash that could map keys to objects, where the objects needed to be allowed to be garbage collected
Guedes0 has joined #ruby
v0n has joined #ruby
Guedes has joined #ruby
Guedes has joined #ruby
btaitelb has joined #ruby
Guedes0 has joined #ruby
babinho has joined #ruby
redgetan has joined #ruby
Foxandxss has joined #ruby
shruggar has quit [#ruby]
includex has joined #ruby
Sailias has joined #ruby
looopy has joined #ruby
<PragCypher> where the best place to store persistant data for a gem? I noticed theres Gem.datadir 'packagename' but not much mention of it on google
babinho has joined #ruby
axl_ has joined #ruby
davidcelis has joined #ruby
jgrevich_ has joined #ruby
MaGiC_Reloaded has joined #ruby
atmosx has joined #ruby
VegetableSpoon has joined #ruby
liluo has joined #ruby
vitor-br has joined #ruby
jimeh has joined #ruby
heftig has joined #ruby
tommyvyo has joined #ruby
<banisterfiend> PragCypher: your gem should manage that itself
<icy`> hm, i'm wondering about the proper way to design a scraping class... should i have a bunch of @global = some_method in initialize? e.g. @title = get_title , and then attr_accessor it
<icy`> well i guess the other option is to have a method title which then returns @title
nect has joined #ruby
<icy`> (and to only scrape if @title is nil) ?
<epochwolf> How do I get nokogiri or libxml-ruby to load a schema with an external dtd?
<niklasb> icy`: for the second suggestion you can use @title ||= begin ... end
chson has joined #ruby
<epochwolf> neither LibXML::XML.default_load_external_dtd nor LibXML::XML.default_substitute_entities have any effect.
<icy`> i'm just wondering about which is the cleaner/ruby way
<niklasb> icy`: i think the on-demand way sounds good
Oog_ has joined #ruby
<Oog_> Please install the scheme adapter: `gem install activerecord-scheme-adapter` (cannot load such file -- active_record/connection_adapters/scheme_adapter). trying to add that to Gemfile results in Could not find gem 'activerecord-scheme-adapter (>= 0) ruby' in any of the gem sources listed in your Gemfile.
<icy`> niklasb, alright, that's basically what i've been doing so far, thanks
rramsden has joined #ruby
sohocoke has joined #ruby
chessguy has joined #ruby
scwh has joined #ruby
axl_ has joined #ruby
<apok> is there a method for checking memory usage in ruby? look for something like php's memory_get_usage
davidcelis has joined #ruby
<icy`> thanks for the the tip on begin...end by the way
axl_ has joined #ruby
<chessguy> my environment got hosed when i upgraded to lion the other day. can anyone help? i'm trying to install a gem, and i get "ERROR: Failed to build gem native extension."
<niklasb> chessguy: you should first look at what the error was
<chessguy> oh, i thought that was the error
<chessguy> later it does say it can't find make
eywu has joined #ruby
<niklasb> chessguy: you should install the build tools, then
<chessguy> niklasb i suspect they're around, somewhere, i just have to find them
axl_ has joined #ruby
davidcelis has joined #ruby
<niklasb> chessguy: what does 'which make' say?
<chessguy> not found
<niklasb> chessguy: don't you use a package manager?
<chessguy> sometimes i use homebrew. doesn't seem like it makes things that much easier, half the time
<chessguy> is there a brew package for the build tools?
io_syl has quit ["Textual IRC Client: http://www.textualapp.com/"]
v0n has joined #ruby
<niklasb> chessguy: I have no idea, don't use Mac OS
davidcelis has joined #ruby
RubyRedGirl has joined #ruby
axl_ has joined #ruby
<chessguy> ok, let me ask this, is there a typical place where make usually lives?
<fowl__> /usr/bin
SuperNewb1 has joined #ruby
carlyle has joined #ruby
axisys has joined #ruby
<chessguy> hm, not there
<chessguy> ah, /Developer/usr/bin
<chessguy> yep, just found that thread :)
brianpWins has joined #ruby
savage- has joined #ruby
<chessguy> oy
<chessguy> now make can't find something that it needs, that it thinks should be in /usr/bin too
<axisys> i have entries like this in a file foo:bar .. how do print myuser { 'foo': comment => 'bar - rt119', } one for each line where everything else is changing except foo and bar
<niklasb> chessguy: add /Developer/usr/bin to your PATH
<chessguy> apparently i did
<niklasb> echo $PATH
<niklasb> chessguy: also read the linked thread where the second answer describes how to install the tools to /usr/bin
<axisys> so far I have done this in irb
<axisys> File.open('out', 'r').each { do |line| }
Beoran__ has joined #ruby
<axisys> line.split/:/
<niklasb> axisys: that's not python
<niklasb> *ruby
<icy`> oh, also i wanted to ask -- is there a way to keep going if there's an error in assert_equal unit test?
<axisys> oops!
<axisys> hmm..
<niklasb> icy`: why would you want to?
<icy`> niklasb, so that it goes through all the assert_equal statements in the method and only then reports all the errors
mikeliss has joined #ruby
<niklasb> icy`: that doesn't sound sensible
<mikeliss> Hi - very new to ruby. I defined a method using def at the top of a script, and when I call it later in the script, it gives me an error about private methods.
<mikeliss> Am I missing something?
<niklasb> axisys: you can use File.open('input', 'r') { |f| f.lines.map { |line| ... } }
<niklasb> mikeliss: can you pastie the code?
<axisys> niklasb: ok.. let me give it a try
yoklov has joined #ruby
<mikeliss> niklasb: Yeah, one sec...making it safe to do so now...
<niklasb> axisys: Oh, I meant lines.each { |line| ... } if you just want to print something
<icy`> niklasb, well i'd rather it imitate a compiler .. finding all the errors and not breaking after it finds the first one, no?
<axisys> niklasb: ok
<niklasb> icy`: then unit tests are not the right tool for the job
<niklasb> or you should use separate tests for the separate asserts
<mikeliss> See lines 20 and 78: http://pastie.org/private/d76x6qaezvvoip6mainw
<niklasb> mikeliss: you are calling `file_name.i_starts_with?`, but file_name is a String and has no `i_starts_with?` method
sbanwart has joined #ruby
<mikeliss> niklasb: Ah, I guess I need to subclass String to give it this function?
<niklasb> mikeliss: it seems like you wanted to make it one, though. in this case you have to wrap it inside class String ... end
<niklasb> mikeliss: no, you can add the functionality directly to String
<niklasb> but if you don't need to, I wouldn't recommend this
<niklasb> in your case, just change the parameters to (string, prefix) and call it as a function
<mikeliss> niklasb: Why not just wrap it in String?
<mikeliss> Seems neater.
<SuperNewb1> does anyone know how to end a loop without a comma?
<SuperNewb1> I got a comma at the end of each element, but even on the last one which is empty has a comma, can that be removed?
<niklasb> mikeliss: hmm, in this case it seems legit. usually monkey-patching core classes is discouraged because the change is global and will affect all the code that uses String in your program
<mikeliss> niklasb: Gotcha. I was reading this is how Rails does it, actually.
<LiquidInsect> SuperNewb1: what exactly are you doing? can you post a poastie or something?
<LiquidInsect> pastie^
<mikeliss> niklasb: Seems like a good standard function in any case (but then, I'm used to having it in Python)
<SuperNewb1> i know its the ruby channel but its actually a ror problem :(
<niklasb> mikeliss: well, if it pleases you, go ahead :)
<niklasb> and yes, Rails does this a lot.
<LiquidInsect> SuperNewb1: I speak Rails, what are you doing?
<icy`> niklasb, is there a "softer" error-checking system, that will go through all assertions first?
<niklasb> SuperNewb1: can you post minimal example code to illustrate the question?
<niklasb> icy`: I don't think so, as it's not something you would need in unit tests
<SuperNewb1> i got | at the end and the result is 12:30 | 15:10 | 17:50 | 20:30 |
<SuperNewb1> i want to remove that last |
classix has joined #ruby
<niklasb> SuperNewb1: you can use each_with_index and only insert the `|` if index > 0
<niklasb> (though you have to insert it *before* the link then
<SuperNewb1> hmmm
SolarisBoy has joined #ruby
<niklasb> SuperNewb1: like http://pastie.org/3807501
<niklasb> sry
<niklasb> should be ? '|' : ''
<fowl__> cant you do <%= ?| if i > 0 %>
<fowl__> since your else is empty
<LiquidInsect> well you can do the reverse and not put the | there if i >= shows.count
<niklasb> fowl__: I don't know ERB very well, but if that's possible, it's surely cleaner
<SuperNewb1> Thanks niklasb!!
<SuperNewb1> Thanks fowl__
mikeric has joined #ruby
<SuperNewb1> fowl__ yours worked, i didnt know about this and i might use this a lot now :D
<fowl__> SuperNewb1, if you want to you could use css to get that effect also
<SuperNewb1> thanks guys!! :) appreciate it
mybot has joined #ruby
<mikeliss> niklasb: Thanks for the help - it's now working perfectly.
<niklasb> mikeliss: have fun
<atmosx> guys
<atmosx> Just read the cryptonomicon, so my question is: Baroque Cycle or Anathem ?
helichopter has joined #ruby
Foxandxss has joined #ruby
<shadoi> I thought REAMDE was by far the most entertaining after cryptonomicon
<shadoi> never finished anathem though
deucepont has joined #ruby
fbernier has joined #ruby
<deucepont> Howdy folks
CallMeWhite has joined #ruby
dagnachewa has joined #ruby
ZachBeta has joined #ruby
mikepack has joined #ruby
ctwiz has joined #ruby
<banisterfiend> shadoi: what did u think of snowcrash
mattyoho has joined #ruby
ctwiz_ has joined #ruby
<shadoi> I loved it
<shadoi> I read it ages ago though
frishi has joined #ruby
<atmosx> shadoi: thanks
CallMeWhite has joined #ruby
<atmosx> good night
Foxandxss has joined #ruby