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"
<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.
<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.
<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
<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>
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
<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?
<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
<|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?
<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
<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
<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
<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)
<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
<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.
<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 :)
<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>
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
<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
<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"?
<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 :)
<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
<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
<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.
<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?
<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
<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