Topic for #ruby is now Ruby programming language || ruby-lang.org || RUBY SUMMER OF CODE! rubysoc.org/ || Paste >3 lines of text in http://pastie.org || Para a nossa audiencia em portugues http://ruby-br.org/
<epochwolf|vps>
Is the ruby sleep call aborted if the process recieves a signal?
statbot joined #ruby
creativeprodigy joined #ruby
<banisterfiend>
does anyone actually use lambdas?
<epochwolf|vps>
yes
iamjarvo left #ruby
<mksm>
epochwolf|vps, which signal? (but yes)
<epochwolf|vps>
mksm: fork related ones
iamjarvo joined #ruby
<banisterfiend>
epochwolf|vps: what do you use them for that you can't simply use a block ?
<banisterfiend>
and why a lambda rather than a proc
Shamgar joined #ruby
<epochwolf|vps>
banisterfiend: active record scopes
hiptobecubic left #ruby
stephenjudkins joined #ruby
<banisterfiend>
epochwolf|vps: Any reason why you prefer lambda there and not procs?
<banisterfiend>
(i'm not a rails programmer)
<epochwolf|vps>
banisterfiend: lambdas allow the use of the return keyword iirc.
quest88 joined #ruby
<epochwolf|vps>
return will return the lambda instead of the function it's executed in
<banisterfiend>
epochwolf|vps: it functions the same as 'next' though, so if that's the only reason you could use a proc
<epochwolf|vps>
banisterfiend: lambdas in 1.8 check the number of parameters passed into them.
<banisterfiend>
epochwolf|vps: Yeah, but how important is that really in practice ?
<epochwolf|vps>
banisterfiend: for my usages? Pretty important for scopes.
thomaslee joined #ruby
<banisterfiend>
I"m just curious whether we actually need both lambdas and procs in ruby, or whether we can get by with just procs
<epochwolf|vps>
Literature.tagged_with("pickles")
btanaka joined #ruby
<epochwolf|vps>
banisterfiend: why are you making this decision when you don't know ruby?
Shamgar joined #ruby
<epochwolf|vps>
whoops, nevermind, you mentioned you didn't know rails.
<banisterfiend>
epochwolf|vps: i do know ruby :)
<banisterfiend>
I just don't think i've ever used a lambda when i could have just gotten by with a proc
peterwald joined #ruby
badabim_ joined #ruby
strife25 joined #ruby
igotnolegs joined #ruby
quest88 joined #ruby
Axsuul joined #ruby
<banisterfiend>
epochwolf|vps: procs are also badass as you can destructure the parameters right there in the parameter list
perryh joined #ruby
eft left #ruby
looopy joined #ruby
fayimora joined #ruby
tatsuya_o joined #ruby
quizme joined #ruby
<quizme>
> x = 'xyz'; y='abc'; class << x; def foo; y; end; end; x.foo
<quizme>
why isn't y defined inside x's ghost class ?
<banisterfiend>
quizme: 1) dont call it a 'ghost class' that sounds fucking gay
<quizme>
eigen class?
<banisterfiend>
quizme: 2) because class << x defines a new scope, and not only that def foo defines a new scope too
<banisterfiend>
quizme: eigenclass or eigenclass Yeah
<banisterfiend>
um, singleton class or eigenclass*
Shamgar joined #ruby
<quizme>
so
<quizme>
how do i get y in there ?
<quizme>
do i have create an eigen instance variable?
<banisterfiend>
quizme: like this: x.define_singleton_method(:foo); y; end
<quizme>
hmm
<quizme>
i like that
<quizme>
x = 'xyz'; y='abc'; class << x; attr_accessor :z; def foo; @z; end; end; x.z=y; x.foo
<banisterfiend>
do;y;end
sythe joined #ruby
<quizme>
i like your way better? less gay than mine
<etdebruin>
You have already activated rake 0.9.2, but your Gemfile requires rake 0.9.2.2. Consider using bundle exec.
RyuGuns left #ruby
<deryldoucette>
gem list rake and remove the older one. gem uninstall rake -v='0.9.2'
<blueadept>
anybody here use mustache a lot in rails ajax template renderings?
AndChat| joined #ruby
<etdebruin>
thanks deryldoucette - will give it a try
<deryldoucette>
np
<deryldoucette>
that usually happens when you have two versions installed and one was activated before the other and the one activated isn't the same version as what your dependency is
<deryldoucette>
you can also install mpapis-bundler and it will automatically use the right one. think it runs bundle --binstubs or something like that
mensch joined #ruby
<etdebruin>
ok, so this is the error:
<etdebruin>
You have already activated rake 0.8.7, but your Gemfile requires rake 0.9.2.2. Consider using bundle exec.
<etdebruin>
When I do gem list
<etdebruin>
it's the only rake I see, v. 0.8.7
<etdebruin>
i.e. I don't see two versions listed
seivan joined #ruby
<deryldoucette>
no its only listing one so basically it finds rake but checks the version and the versions don't match
<deryldoucette>
so gem uninstall rake && gem install rake -v='0.9.2.2'
looopy joined #ruby
seivan_ joined #ruby
looopy_ joined #ruby
<etdebruin>
coolness
<etdebruin>
did that
<deryldoucette>
the other suggestion is to install RVM and use gemsets for each project (use the per-project rvmrc files) and keep the gemsets clean and limited to just the versions you need
Nisstyre joined #ruby
apok joined #ruby
<etdebruin>
deryl, any idea what this means: "Gem.source_index called from /home/passenger/.rvm/gems/ruby-1.9.2-p180@MyGivingTweet/gems/bundler-1.0.12/lib/bundler/shared_helpers.rb:3."
crescendo joined #ruby
<deryldoucette>
no i've not seen that
<etdebruin>
k
Cerales joined #ruby
Tachyon joined #ruby
<sdwrage>
does @ reference the main object or the instance object?
<banisterfiend>
sdwrage: what does main object mean
<sdwrage>
the object that other objects get instanced from
apok joined #ruby
<banisterfiend>
the class ? :P
<sdwrage>
last time I checked, ruby doesn't have classes >.> even the classes are objects
<sdwrage>
yes the class
<sdwrage>
x.x
<sdwrage>
sorry
<banisterfiend>
sdwrage: just because classes are objects doesnt mean they're not classes ;)
<sdwrage>
too many languages to keep track of!
<sdwrage>
yeah...
<banisterfiend>
hehe
<sdwrage>
does @ reference the class or an instance?
<sdwrage>
im guessing instance
<banisterfiend>
sdwrage: well it depends where u refer to the @, ifyou refer to it inside an instance method, then it's on the instance
<sdwrage>
okay
<banisterfiend>
if you refer to it inside the class body (not inside an instance method) then it's an instance method on the class
lucasgonze joined #ruby
<banisterfiend>
so
<banisterfiend>
class Hello; @this_is_on_the_class; def hello; @but_this_is_on_the_instance; end; end
<sdwrage>
how come you are able to do def do_something something = "this" end
<sdwrage>
and instance.something is referenced
<sdwrage>
instead of using @
<sdwrage>
as if no scope is valued
<banisterfiend>
i dont know what you're talking about sorry
<banisterfiend>
but it sounds kind of lulzy
<sdwrage>
maybe it is a rails thing
<sdwrage>
maybe something activeRecord does
<sdwrage>
bah
<sdwrage>
lol
<sdwrage>
banisterfiend: shouldn't attr_accessor give a read and write method for anything listed with it?
ognevsky joined #ruby
looopy joined #ruby
<banisterfiend>
sdwrage: i really think you should read a book on ruby cos the qeustions you're asking are basic and you'd do better to learn it from a book i think
<banisterfiend>
you're basically asking questions about scope
<sdwrage>
banisterfiend: I will have to go back through the book I was reading...
<sdwrage>
thx
<sdwrage>
banisterfiend: the thing is… I know attr_accessor SHOULD create getters/setters for instance vars I define… but it seems that when I do self.var = "blah" for that var defined in attr_accessor… it complains about no method for var
<sdwrage>
more a question of second guessing myself
<sdwrage>
:\
<banisterfiend>
sdwrage: can u show me your code
JakeyChan joined #ruby
<JakeyChan>
hey :D
<sdwrage>
PM'd it to you banisterfiend
<JakeyChan>
I am new guy of ruby
robbyoconnor joined #ruby
<banisterfiend>
sdwrage: it's really weird to capitalize your methods like that btw
<banisterfiend>
:First_Name
<banisterfiend>
etc
<sdwrage>
meh
<sdwrage>
I know
<sdwrage>
ill refactor later
<sdwrage>
:\
apok joined #ruby
<sdwrage>
oh wait…. I know why Exp_Date = would work…. because it is a method of the object by having attr_accessor
<sdwrage>
am I correct in this assessment?
<banisterfiend>
sorry i turned off immediately when i saw all that rails bs
<sdwrage>
its alright :P
<sdwrage>
I'm guessing you hate rails lol
krz joined #ruby
wyhaines joined #ruby
radic_ joined #ruby
io_syl joined #ruby
io_syl joined #ruby
loocorez joined #ruby
minijupe joined #ruby
r0bby joined #ruby
banisterfiend joined #ruby
fl0w joined #ruby
rpowell joined #ruby
Banistergalaxy joined #ruby
looopy_ joined #ruby
seivan joined #ruby
seivan joined #ruby
headius joined #ruby
tburns joined #ruby
pen joined #ruby
MissionCritical joined #ruby
PaciFisT joined #ruby
mmokrysz joined #ruby
Banistergalaxy joined #ruby
mmokrysz joined #ruby
mmokrysz joined #ruby
x0F__ joined #ruby
pen joined #ruby
fl0w joined #ruby
maletor joined #ruby
rohit joined #ruby
kenperkins joined #ruby
Nisstyre joined #ruby
Ruthenium joined #ruby
spacebug joined #ruby
sejo joined #ruby
r0bby joined #ruby
ank joined #ruby
seivan joined #ruby
luxurymode joined #ruby
p0y joined #ruby
cdepue joined #ruby
bitri joined #ruby
dagnachewa joined #ruby
raythecat joined #ruby
Skaag joined #ruby
kawa_xxx joined #ruby
h4mz1d joined #ruby
banisterfiend joined #ruby
statbot joined #ruby
Azure|netbook joined #ruby
kongo_86 joined #ruby
Cerales joined #ruby
<kongo_86>
guys question
<andrewhl>
i'm using nokogiri to search an html document for the string "0 games", and then to return if it finds it. However, it seems to be breaking out of the containing function for each document: http://pastie.org/2984253
<kongo_86>
learning ruby and im wrote a small script to resolve dns names and return NS servers
<andrewhl>
the string "0 games" only occurs like in 1 out of 20 cases, so it shouldn't return every time
<kongo_86>
it was working fine at work.. but now at my house is not working
<rtyler>
any qt-ruby folks around I can hassle with an exception question?
<kongo_86>
i believe it has something to do with the network change.. any ideas
<andrewhl>
can someone check my pastie and tell me if there's something wrong with my code?
manizzle joined #ruby
Nisstyre joined #ruby
<kongo_86>
so anyone.. does ruby hold some sort of cache
Cervajz joined #ruby
Cervajz_ joined #ruby
Cervajz__ joined #ruby
Cervaj___ joined #ruby
QaDeS joined #ruby
<mmokrysz>
kongo_86: Cache of what?
WhiteHorse joined #ruby
sdwrage left #ruby
<kongo_86>
well i have a script worked fine at work not it doesnt
<kongo_86>
its a dns script to return NS servers for a domain
<mmokrysz>
When you say it doesn't work, do you mean it gives incorrect results, errors, ...?
<kongo_86>
no.. so im using Dnsruby library
<kongo_86>
when i run it to resolve a domain name it gives a FrmError
<kongo_86>
it worked fine at work.. but not now.. im thinking its the network change
<mmokrysz>
FormErr is "A format error in a received DNS message" by the way. Now to see if I can fix it
<kongo_86>
yea..ok thanks
Cerales joined #ruby
<mmokrysz>
Working fine here. If I had to guess, it might be some sort of email restrictions done by your residential ISP
<kongo_86>
but if i run dig from shell works fine
apucacao joined #ruby
<kongo_86>
mmm..
<kongo_86>
and i just did it in irb shell works too
<kongo_86>
im using rvm btw..
<kongo_86>
anyway to like reload ruby? or clear anything?
tomzx joined #ruby
mrevil joined #ruby
<mrevil>
what are some reasons why I wouldn't want to use jruby over ruby?
marcamilly joined #ruby
<mmokrysz>
kongo_86: Try specifying a custom DNS server (eg: 8.8.8.8) and see if it works.
<marcamilly>
easy questions
<marcamilly>
how do I find the modulus of a number?
<marcamilly>
i%5 doesn't seem to work
<Cerales>
mrevil: big feature of Java environment is that it's cross-platform, but Ruby already is. MRI is the main ruby community so it's always going to have new swanky stuff first, it's guaranteed not to die any time soon whereas anything predicated on Java is subject to all sorts of historical change
<mmokrysz>
marcamilly: It should do, probably an issue with your code
<marcamilly>
ok, mmokrysz second question
<kongo_86>
mmokrysz: worked!! mmmmmm stupid ISP
<marcamilly>
how do I print from 1 - 100, both inclusive using the times function?
<marcamilly>
i tried 100.times do
<marcamilly>
but that prints 0 - 99
bluOxigen joined #ruby
dankest joined #ruby
<mmokrysz>
kongo_86: Awesome! :) Residential ISPs do all sorts of crap with their DNS at times - I switched at one point because they were redirecting unused domains to 200 responses
replore joined #ruby
<randym>
marcamilly: (1..100).each { |x| puts x }
<kongo_86>
so final question.. my code.. crap right.. any quick pointers
lucasgonze joined #ruby
<kongo_86>
my next step is to a do a zone transfer on each nameserver
<marcamilly>
thanks
<mmokrysz>
kongo_86: As a quick utility, it's fine. I've written plenty of similar scripts for all sorts of stuff
<kongo_86>
sweet thanks man! and thanks for the help
Pip joined #ruby
<mmokrysz>
np :)
MissionCritical joined #ruby
pen joined #ruby
<Cerales>
is there a method to define an instance variable?
<Cerales>
i want to dynamically define instance variables based on the keys in a hash
<havenn>
Cerales: instance_variable_set
aef joined #ruby
<Cerales>
thanks
_axx joined #ruby
eeadc joined #ruby
ccooke joined #ruby
snapcase joined #ruby
tessi joined #ruby
eldariof joined #ruby
maveonaiR joined #ruby
vereteran joined #ruby
cinch joined #ruby
banisterfiend joined #ruby
relix joined #ruby
denysonique joined #ruby
denysonique joined #ruby
Bish joined #ruby
fusrodah joined #ruby
fcoury joined #ruby
MetaCosm joined #ruby
caveat- joined #ruby
joelio joined #ruby
literal joined #ruby
swistak35 joined #ruby
drizz joined #ruby
wereHamster joined #ruby
zawopak joined #ruby
mbreit joined #ruby
minijupe joined #ruby
rohit left #ruby
dch4pm4n joined #ruby
Seisatsu joined #ruby
Reikoku joined #ruby
eeadc joined #ruby
patricksroberts joined #ruby
fcoury joined #ruby
welterde joined #ruby
justicefries joined #ruby
john2x joined #ruby
h4mz1d joined #ruby
tonini joined #ruby
davidboy joined #ruby
vereteran joined #ruby
relix joined #ruby
zawopak joined #ruby
fixl joined #ruby
cesario joined #ruby
michael_mbp joined #ruby
<loocorez>
ls
<loocorez>
Oops
savage- joined #ruby
jredville joined #ruby
MetaCosm joined #ruby
yxhuvud joined #ruby
roaminghorse joined #ruby
dnyy joined #ruby
hemanth joined #ruby
banisterfiend joined #ruby
Tybalt joined #ruby
Pip_ joined #ruby
r0bby joined #ruby
SirThomasMore joined #ruby
SirThomasMore joined #ruby
Tyblat joined #ruby
levity_island joined #ruby
docwhat joined #ruby
<hemanth>
on of the channel owners had shared a link for video tutorials he had made, forgot the bookmark, logs are cleared…any help?
<Cerales>
Does anyone know a really easy way to wrap an object in another one and clone all its methods?
<Cerales>
i want to extend RestClient's error classes just by rescuing them and raising one of my own
<Cerales>
and i want to easily give my error objects all of the RestClient error classes' methods like 'message', 'body', etc.
symb0l joined #ruby
Tachyon joined #ruby
SaneWarning joined #ruby
Azure|netbook joined #ruby
Azure joined #ruby
banisterfiend joined #ruby
sinuc joined #ruby
sinuc joined #ruby
smgt joined #ruby
Muz joined #ruby
batlock666 joined #ruby
mmokrysz joined #ruby
mmokrysz left #ruby
djdb joined #ruby
Behi joined #ruby
dark3rdre4ms joined #ruby
dark3rdre4ms joined #ruby
banister_ joined #ruby
Axsuul joined #ruby
apok joined #ruby
ryanf joined #ruby
xpot joined #ruby
tburns joined #ruby
fixl joined #ruby
marcamilly joined #ruby
apucacao joined #ruby
Pip joined #ruby
Pip joined #ruby
hbien joined #ruby
ustreamer-76031 joined #ruby
ustreamer-76031 left #ruby
JohnBat26 joined #ruby
r0bby joined #ruby
visof joined #ruby
negaduck joined #ruby
luckyruby joined #ruby
jgrimes joined #ruby
jgrimes joined #ruby
ph^ joined #ruby
jgrimes joined #ruby
Jrz joined #ruby
cloudbase joined #ruby
<cloudbase>
hi, i was wondering if someone can please help me with this. if i do: a=[1,2,3] and then b=a and then b.delete(3) it will also delete 3 from a. any ideas why?
<banister_>
cloudbase: because they refer to the same object, if you want a copy you have t use a.dup
<cloudbase>
banister_: ah! thank you, i've been trying to figure this out for some time now
<cloudbase>
banister_, ah! thank you, i've been trying to figure this out for some time now
<disappea_>
Oh wow yield means a completely different thing in here than python
<disappea_>
I actually misunderstood this because of the difference. Yield actually mean "pass control to the lambda supplied"
JakeyChan joined #ruby
<banister_>
disappea_: Yeah, totally different. Ruby does have generators too, but they dont piggypack on the method syntax (unlike in python, which is weird IMO :P)
<disappea_>
you should blog it or put it into somewhere constructive where others can see
p1d joined #ruby
mafolz joined #ruby
<shevy>
:)
Skaag_ joined #ruby
ceej joined #ruby
havenn left #ruby
Morkel joined #ruby
workmad3 joined #ruby
jensn joined #ruby
Skaag_ joined #ruby
zommi joined #ruby
bosphorus joined #ruby
pi3r joined #ruby
Natch| joined #ruby
tburns joined #ruby
Jrz joined #ruby
tburns joined #ruby
pen joined #ruby
heftig joined #ruby
mikewintermute joined #ruby
manizzle_ joined #ruby
iocor joined #ruby
tburns joined #ruby
visof joined #ruby
Ch4rAzZz joined #ruby
hxmws joined #ruby
senayar joined #ruby
maletor joined #ruby
<hxmws>
Hi All, Im new to ruby and looking for some advice from you guys. I have some JSON in the following format [["Date","value2","value1","value3","value4"],["Thu",21040,10508,1,66]] can you tell me the best way to parse this and use the data? in an ideal world i would like to be able to say "puts value2" and it output 21040. Is this even possible?
manizzle_ joined #ruby
looopy joined #ruby
dnjaramba joined #ruby
Hoornet joined #ruby
esparkma_ joined #ruby
lkba joined #ruby
senayar joined #ruby
Guest92254 joined #ruby
nicoulaj joined #ruby
cyri_ joined #ruby
Ammar01 joined #ruby
Synthead joined #ruby
flippingbits joined #ruby
Synthead joined #ruby
BiHi joined #ruby
timonv joined #ruby
TandemAdam joined #ruby
<TandemAdam>
Hey does anyone here use aptana on Ubuntu for ruby dev?
<shevy>
TandemAdam I tried Aptana, and soon decided I hated it
<TandemAdam>
shevy: what do you use?
<shevy>
TandemAdam Bluefish version 1.0.7
yatiohi joined #ruby
<shevy>
mostly because of the default syntax highlighting. They changed it in 2.2.0, and I hate it :(
<TandemAdam>
hmm, interesting. I will take a look
banisterfiend joined #ruby
<TandemAdam>
thanks
hurikhan|Work joined #ruby
iocor joined #ruby
<TandemAdam>
anyone doing ruby/rails on Ubuntu, where do you put your projects? How do you organize them?
<TandemAdam>
I am a linux noob ;)
ikaros joined #ruby
banisterfiend joined #ruby
looopy_ joined #ruby
tburns joined #ruby
james_cotterill joined #ruby
nari joined #ruby
MrCheetoDust joined #ruby
Mcilvena joined #ruby
grekko joined #ruby
jbpros joined #ruby
Shrink joined #ruby
marcamilly joined #ruby
Hellojere joined #ruby
<shevy>
TandemAdam I don't think it is specific to any distribution
<shevy>
rails probably has some recommended way to organize things
tburns joined #ruby
<shevy>
as for ruby code, 99% of my ruby code resides under its own directory. And then within that directory, there are subdirectories, where more important projects get their own installable-directory structure
Seisatsu joined #ruby
<shevy>
for instance, the ruby build tools files reside in $RUBY_SRC + RUBY_BUILD_TOOLS/lib/rbt/ for me, where $RUBY_SRC points to my base dir, and the "RUBY_BUILD_TOOLS/lib/rbt/" part is just where the projects .rb files (and yaml files etc..) are put
<shevy>
and then either I do require 'rbt' or require 'rbt/base' or similar
adambeynon joined #ruby
tatsuya_o joined #ruby
Helius joined #ruby
adeponte joined #ruby
atmosx joined #ruby
mxweas_ joined #ruby
Ammar01 joined #ruby
Shrink joined #ruby
radic joined #ruby
iocor joined #ruby
mengu joined #ruby
jbhewitt joined #ruby
_debo joined #ruby
sandstrom joined #ruby
awesome joined #ruby
ggtoo joined #ruby
randym joined #ruby
Pip joined #ruby
smgt_ joined #ruby
bjhaid joined #ruby
rb2k joined #ruby
kingfishr joined #ruby
sandstrom joined #ruby
pen joined #ruby
workmad3 joined #ruby
tk___ joined #ruby
sandstrom joined #ruby
ChampS_ joined #ruby
sandstrom joined #ruby
robotmay joined #ruby
JakeyChan_ joined #ruby
Evixion joined #ruby
nighty968 joined #ruby
<nighty968>
ciao
nighty968 left #ruby
_debo joined #ruby
josephwilk joined #ruby
pen joined #ruby
hurikhan|Work joined #ruby
randym_ joined #ruby
radic_ joined #ruby
sandstrom joined #ruby
ramusara joined #ruby
Shrink joined #ruby
nark-1 joined #ruby
Silker joined #ruby
radic joined #ruby
bastilian joined #ruby
ggtoo joined #ruby
Helius joined #ruby
ph^ joined #ruby
visof joined #ruby
hemanth joined #ruby
burgestrand joined #ruby
Spockz joined #ruby
heftig joined #ruby
akem joined #ruby
trivol joined #ruby
iocor joined #ruby
jbpros joined #ruby
p0y joined #ruby
peterwald joined #ruby
flippingbits joined #ruby
nark-1 left #ruby
tburns joined #ruby
moondiamond_ joined #ruby
TandemAdam left #ruby
dazoakley joined #ruby
<banisterfiend>
How do i find the full path to a gem ?
tburns joined #ruby
mcpierce|afk joined #ruby
bwlang joined #ruby
p0y joined #ruby
<workmad3>
banisterfiend: using bundler?
<workmad3>
banisterfiend: or plain gem?
<banisterfiend>
plain gem
<banisterfiend>
using the ruby api
<workmad3>
banisterfiend: hmm... command line, you can use gem which to find the lib file
<workmad3>
that's probably got a ruby api representation
<banisterfiend>
im looking at the code for 'gem which' now
rgrinberg joined #ruby
<banisterfiend>
doesnt look like any simple api
<banisterfiend>
oh no
<banisterfiend>
i got it
<banisterfiend>
Spec#full_gem_path ;)
mads- left #ruby
<banisterfiend>
thanks workmad3
<workmad3>
naughtyboy`: np :)
<naughtyboy`>
workmad3: i just found it using pry, sometimes pry makes me want to ejaculate wet dreaming into a thousand c*nts pink and smooth as seashells
<workmad3>
banisterfiend: great... I now have that image stuck with me for the rest of the day :(
Jrz joined #ruby
<banisterfiend>
there are worse things...i think
<banisterfiend>
bbl :)
<lupine_85>
anyone else using pcaprub in anger? I'm trying to use BPF on an interface lacking an IPv4 address. tcpdump treats it as a warning, pcaprub treats it as an error
dkannan joined #ruby
jensn joined #ruby
Behi joined #ruby
p0y joined #ruby
iocor joined #ruby
bjhaid joined #ruby
etdebrui1 joined #ruby
nyuszika7h joined #ruby
dch4pm4n joined #ruby
JakeyChan joined #ruby
<JakeyChan>
hi ?
<JakeyChan>
I install rails with gem install rails command
<becom33>
btw I coudnt just require 'http_request' why is that ?
<lupine_85>
load path
<lupine_85>
add put $: to the start of the script
<lupine_85>
erm, puts
<lupine_85>
also, I'm assuming you know about net/http and are writing this just for learning purposes, right?
fantazo joined #ruby
ikaros joined #ruby
banisterfiend joined #ruby
kawa_xxx joined #ruby
nanderoo joined #ruby
xec joined #ruby
banisterfiend joined #ruby
Morkel joined #ruby
tvw joined #ruby
Manhose joined #ruby
Manhose_ joined #ruby
<bjhaid>
I have a variable that is a string, i need to parse it into an sql query, once I parse it directly it throws an exception, I think its because ruby strings are naturally double-quoted and mssql expects single quoted strings, how can I ensure ruby sends a single quoted string?
<AxonetBE>
I have an hash with the last visited products, but when I visit a product 2 times, he 2 times in the hash, how can I check that there is this one already in the hash and delete the oldest one?
luxurymode joined #ruby
vitoravelino joined #ruby
jtrudeau joined #ruby
<hemanth>
AxonetBE: Hash#key?
<AxonetBE>
hemanth: but I have always loop through the whole hash before inserting then?
<xkws49er>
rvm install 1.9.2 on macOSX I get the following error ERROR: Error running ' ./configure --prefix=/Users/thisperson/.rvm/rubies/ruby-1.9.2-p290 --enable-shared --disable-install-doc --with-libyaml-dir=/Users/thisperson/.rvm/usr ', please read /Users/thisperson/.rvm/log/ruby-1.9.2-p290/configure.log
<xkws49er>
Log says checking for strip... strip
<xkws49er>
configure: error: thread model is missing
<lupine_85>
becom33_, lower-case "class", rather than capitalised "Class"
<becom33_>
ahh ok
<lupine_85>
I don't suppose you've got a copy of the pickaxe?
<spyvrsspy>
I have another version that uses a bash script to grep out the appropros entries, and then php to insert into the database, which runs much faster, but I want to move every thing to ruby, and homogenize the scripts on my server
<spyvrsspy>
is there any obvious bottle necks?
<lupine_85>
egad, sri lanka?
statbot2 joined #ruby
evantravers joined #ruby
shevy joined #ruby
statbot2 joined #ruby
fl0w joined #ruby
strife25 joined #ruby
<becom33_>
lupine_85: I'm sri lankan :/
<becom33_>
who else is a SriLankan ?
<shevy>
I am not
<shevy>
becom33_ may be you are the only one from sri lanka here :D
<becom33_>
no I was wondering why lupine_85 asked such a thing :/
<shevy>
perhaps he is curious
<Morkel>
How can i remove the encoding worde from the string? '"\u00A0\u00A0D&G \u2013 Nylon"'
<Morkel>
words
<becom33_>
abt what ? shevy
redgetan joined #ruby
Indian joined #ruby
<shevy>
becom33_ no idea! He isn't saying anything though
<shevy>
perhaps he never said anything
<shevy>
Morkel what format are those encodings?
<becom33_>
shevy: alright =/
<Morkel>
shevy: ruby says UTF-8
looopy joined #ruby
<Morkel>
'#<Encoding:UTF-8>'
pencilcheck joined #ruby
iamjarvo joined #ruby
<becom33_>
how can I call another class method inside from a another class ?
<shevy>
Morkel hmmm... I am sure there is some way...
<shevy>
unfortunately I do not really know
statbot2 joined #ruby
<shevy>
becom33_ a class method? Should always work... if it is class Foo; def self.bar then you should be able to call it via Foo.bar
mr_the_shadow joined #ruby
statbot2 joined #ruby
<mr_the_shadow>
If I do raise 'some message' and I have a rescue grab it, how do I access 'some message'
rippa joined #ruby
<burgestrand>
mr_the_shadow: rescue => e
<burgestrand>
mr_the_shadow: traps the exception into e, and then you can access message via e.message
<burgestrand>
you can also acess it via $!.message
<shevy>
becom33_ I changed your code, http://pastie.org/2986271 , it should work and do what you want
<burgestrand>
AxonetBE: if by session you mean session cookie, the actual size is determined by the amount of bytes the serialized representation take up
<becom33_>
shevy: yea I mean for a example if I want to use it in deferent deferent methods or maby in loops I cant do that all the time ne ? thats why I'm asking is their any better way
jgarvey joined #ruby
RomD` joined #ruby
<mr_the_shadow>
burgestrand: thx dude
<burgestrand>
mr_the_shadow: :)
<shevy>
becom33_ not sure I understood that
Telling joined #ruby
statbot2 joined #ruby
<becom33_>
shevy: lemme show you
<becom33_>
give me a second
<lupine_85>
it surprised me a bit, is all
<lupine_85>
sri lanka's been in the news quite a bit over here :)
<shevy>
where is "here"
<lupine_85>
the UK
<shevy>
ah
<lupine_85>
wonder if he knows adam werritty...
<shevy>
in Austria, Sri Lanka is barely ever mentioned
davidruan joined #ruby
mfridh joined #ruby
<lupine_85>
my partner's been there on holiday, back when she was a nipper
RomD joined #ruby
_debo joined #ruby
hemanth joined #ruby
<shevy>
a nipper?
<lupine_85>
young
<shevy>
that's what I like about people in the UK - you learn new, completely unheard before words :D
<becom33_>
lupine_85: what about Sri Lanka ? Im a sri lankan =/
rdark joined #ruby
<lupine_85>
nothing about it, I was just commenting since it's rare
<lupine_85>
I'd do the same if someone logged in from peru or nepal
nej joined #ruby
<becom33_>
aww yea , anyway the country is totally messed this days .. war is over but now people inside the country fighting
mmokrysz left #ruby
<becom33_>
shevy: did u see what I pasted ?
<nej>
hello
<nej>
`activate': can't activate guard (~> 0.3.4, runtime) for ["ti-0.1.9"], already activated guard-0.8.8 for ["guard-sass-0.0.6", "ti-0.1.9"] (Gem::LoadError)
statbot2 joined #ruby
<nej>
does anyone know how to get around that? can you activate different version of guard somehow?
<becom33_>
I have togo junction . please if u can PM me the awnser shevy
<nej>
gem list guard … outputs: guard (0.8.8, 0.3.4)
<shevy>
becom33_ just use def self.hello in your first class
theRoUS joined #ruby
andrewhl joined #ruby
fl0w left #ruby
dotnull joined #ruby
fl0w joined #ruby
negaduck_ joined #ruby
sycr joined #ruby
hinogi joined #ruby
hinogi joined #ruby
dekroning joined #ruby
jetkoten joined #ruby
Ankhers joined #ruby
<xkws49er>
rvm install 1.9.2 on macOSX I get the following error ERROR: Error running ' ./configure --prefix=/Users/thisperson/.rvm/rubies/ruby-1.9.2-p290 --enable-shared --disable-install-doc --with-libyaml-dir=/Users/thisperson/.rvm/usr ', please read /Users/thisperson/.rvm/log/ruby-1.9.2-p290/configure.log
robyurkowski joined #ruby
<Ankhers>
Did you read the /Users/thisperson/.rvm/log/ruby-1.9.2-p290/configure.log?
kennethreitz joined #ruby
hxmws left #ruby
Sailias joined #ruby
<xkws49er>
yes I did it says this:<xkws49er> ERROR: There has been an error while running configure. Halting the installation.
<xkws49er>
<xkws49er> When I check the log the last few lines say :
<xkws49er>
<xkws49er> checking whether _SC_CLK_TCK is supported... yes
<xkws49er>
<xkws49er> checking stack growing direction on i386... -1 checking for backtrace... yes checking whether ELF binaries are produced... no checking whether OS depend dynamic link works... yes checking for strip... strip configure: error: thread model is missing
jwmann joined #ruby
becom33 joined #ruby
jwmann joined #ruby
ksinkar joined #ruby
jwmann joined #ruby
vitoravelino joined #ruby
<Ankhers>
You may want to ask in #rvm
tomzx joined #ruby
rdark joined #ruby
<xkws49er>
I did. I'm am just waiting for an answer figured someone in here might know
<mksm>
xkws49er, get a PC
* mksm
runs
<Ankhers>
...
<Ankhers>
fun fact... PC stands for Personal Computer. Macs are PCs
jds_ joined #ruby
<xkws49er>
so you don't know.. besides get a PC?
<Ankhers>
I did a quick google search, I didn't really find anything.
<xkws49er>
Thanks Ankhers
jetkoten left #ruby
mmokrysz joined #ruby
ggtoo joined #ruby
_kinderman joined #ruby
_kinderman_ joined #ruby
ph^ joined #ruby
atmosx joined #ruby
Silker joined #ruby
dnjaramba joined #ruby
ceej joined #ruby
vitoravelino joined #ruby
ikaros joined #ruby
linusoleander joined #ruby
test joined #ruby
becom33 joined #ruby
<linusoleander>
Is there a sort_by method in ruby that selectes highest value based on a block?
<jim_ec2>
working on a rails 1.x app, in a view I used <%= debug(r) %>
kyktommy_ joined #ruby
<jim_ec2>
but nothing is in the log or on the page
<jim_ec2>
I know r has values, I'm trying to find one more on it
looopy joined #ruby
Sailias joined #ruby
<burgestrand>
linusoleander: Enumerable#max_by
<linusoleander>
burgestrand: Aha, tack
<burgestrand>
:)
redgetan joined #ruby
kenperkins joined #ruby
xkws49er__ joined #ruby
varnie joined #ruby
Jrz joined #ruby
rdark joined #ruby
looopy_ joined #ruby
becom33 joined #ruby
theRoUS joined #ruby
nickfloyd joined #ruby
Reikoku joined #ruby
thepix joined #ruby
<jim_ec2>
an anyone help me figure out how to dump this object?
<kmmndr>
hi all
<kmmndr>
is anyone using rbenv ?
RomD` joined #ruby
LiquidInsect joined #ruby
sepp2k joined #ruby
<kmmndr>
and if yes, did you find a way to run ruby scripts using cron ?
csavola joined #ruby
Helius joined #ruby
redgetan joined #ruby
<becom33>
I want use a seperate class for words , I have no idea how to do that . should I use variables or are their any better ways to do that ?
altivec joined #ruby
ChampS_ joined #ruby
<ccooke>
becom33: when you say you want to use a seperate class for words, what do you mean? Words in some specific sense? Words from an arbitrary text string?
lkba joined #ruby
jim_ec2 left #ruby
Black joined #ruby
<Black>
Hi
johnduhart joined #ruby
<Black>
I'm trying to use ConditionVariable with Mutex but I have a bug into the libraries, is it normal ?
<burgestrand>
becom33: on is a local variable, it does not get outside “me”
cbuxton joined #ruby
johnduhart joined #ruby
banisterfiend joined #ruby
<becom33>
aww I get it now
<burgestrand>
becom33: also, in ruby, methods do not need to explicitly return, the value of the last expression (in your case, on = …) is the value you get when invoking the method
<burgestrand>
:)
_kinderman joined #ruby
jds joined #ruby
rdark joined #ruby
xkws49er joined #ruby
vootey joined #ruby
brownies joined #ruby
<JakeyChan>
hi ? I have question
<Harzilein>
hmm
<JakeyChan>
use "which rails", it returns /usr/bin/rails
<JakeyChan>
but use rails help, it tell me Rails is not currently installed on this system. To get the latest version, simply type:
<JakeyChan>
$ sudo gem install rails
<JakeyChan>
strang
<JakeyChan>
do you have any idea?
asQuirreL joined #ruby
johnduhart joined #ruby
<Harzilein>
i wonder why with so many perl elements adopted in ruby s/// never got added
<Harzilein>
it might just return a proc
evantravers joined #ruby
<shevy>
Harzilein I dont think ruby has a leading s before any /regex/
<Harzilein>
shevy: i did not claim that. i said it _could_ have been added.
<shevy>
you think so?
<Harzilein>
shevy: as in, someone would have needed to add the grammar for it
<shevy>
hmm
<shevy>
I think there may have been a reason not to. Perhaps related to MatchData object
flung joined #ruby
<burgestrand>
Hm, idea.
thoolihan joined #ruby
<flung>
Hi, I'm trying to build the therubyracer gem and it's failing because it tries to check python using 'python -version' when the command is 'python -V'. How can I change that?
ksinkar joined #ruby
thepix joined #ruby
<Harzilein>
hmm
<Harzilein>
is there any "noop" i can send to any object?
rdark joined #ruby
<Harzilein>
right now i am using nil?, but it is not really elegant...
<Harzilein>
hmm... actually the noop should just return the object before it...
<Harzilein>
the block with tap is optional, right?
<burgestrand>
Harzilein: I have no idea what you are talking about
strife25 joined #ruby
eywu joined #ruby
johnduhart joined #ruby
Cervajz_ joined #ruby
<Harzilein>
burgestrand: i'm evaluating rename.rb, as switching between ruby and perl all the time ties knots in my brain
<Harzilein>
burgestrand: but to facilitate using string methods it prepends the method given on the command line with the "f.dup." before it evals
tburns joined #ruby
<burgestrand>
rename.rb…?
<Harzilein>
burgestrand: which makes it misbehave in case you want to do the identity function
thepix joined #ruby
<Harzilein>
burgestrand: it's a port of the popular "rename" that comes with perl
ghanima joined #ruby
<burgestrand>
Still no idea what you are talking about; I’ll just go play something, you have fun with that :d
<Harzilein>
burgestrand: in that one, $_ is set to each filename (given on command line or stdin) in turn, then the expression given on the command line is run on it
<Harzilein>
burgestrand: and the file gets renamed to whatever resides in $_ after the expression was evaluated
banisterfiend joined #ruby
<Harzilein>
burgestrand: in rename.rb the semantics are slightly different. here the file is renamed to the return value of the expression and the start of the expression is fixed to f.dup. (with f being the current filename)
thone_ joined #ruby
rexo joined #ruby
rdark joined #ruby
dasfugufish joined #ruby
apucacao joined #ruby
minijupe joined #ruby
ph^ joined #ruby
io_syl joined #ruby
thepix joined #ruby
steph021 joined #ruby
steph021 joined #ruby
io_syl_ joined #ruby
maletor joined #ruby
io_syl_ joined #ruby
wyhaines joined #ruby
kenperkins joined #ruby
tonini joined #ruby
davidcelis joined #ruby
quest88 joined #ruby
io_syl joined #ruby
vmatiyko joined #ruby
heliar joined #ruby
adeponte joined #ruby
io_syl_ joined #ruby
Na_Klar joined #ruby
<Na_Klar>
\t stands for tab also in ruby, right?
vitoravelino joined #ruby
<Harzilein>
hmm... can't i somehow avoid testing for nilness here?:
<td123>
hi, I'm reading the ruby programming language, and it seems that it doesn't include any examples or practice problems, is this a good book for beginners to ruby?
<td123>
I was hoping for k&r style teaching but I don't know if I should read another book before reading this one
<Tasser>
td123, get your practice problems via rubykoans
WhiteHorse joined #ruby
redgetan joined #ruby
Cervajz joined #ruby
lucasgonze joined #ruby
<shevy>
td123 did you work through Chris Pine tutorial yet
<xkws49er>
I was installing rvm and on the last line of the log it says configure: error: thread model is missing https://gist.github.com/1447653 does anyone know what that means?
<xkws49er>
I was installing ruby through rvm. rvm install 1.9.2
<Tekhne>
Tasser: thanks. i was looking at that, but wasn't sure if the rubygems-update matched the rubygems versions.
<Tasser>
I hope so
DaZ joined #ruby
kirun joined #ruby
rb2k joined #ruby
Azure joined #ruby
Synthead joined #ruby
failshell joined #ruby
<failshell>
hello. anyone here with experience with AMQP? i'm reading the amqp gem doc and can't find how to list queues that are part of an exchange. or the number of pending messages in a queue
<failshell>
is that possible at all?
statbot2 joined #ruby
sepp2k joined #ruby
statbot2 joined #ruby
bluOxigen joined #ruby
statbot2 joined #ruby
macabre joined #ruby
jwmann joined #ruby
Spockz_ joined #ruby
SegFaultAX|work joined #ruby
Seisatsu joined #ruby
jr00n joined #ruby
badabim_ joined #ruby
DDAZZA joined #ruby
mr_the_s_ joined #ruby
xhubert joined #ruby
pantsman joined #ruby
pantsman joined #ruby
ik left #ruby
xhubert left #ruby
xhubert joined #ruby
Tekhne left #ruby
TaTonka joined #ruby
arcadio joined #ruby
Adman65 joined #ruby
rexo joined #ruby
josephwilk joined #ruby
fermo joined #ruby
SSnT left #ruby
kennethreitz joined #ruby
kaktus joined #ruby
raythecat joined #ruby
cjs226 joined #ruby
hadees joined #ruby
theRoUS joined #ruby
theRoUS joined #ruby
dekroning joined #ruby
Codif joined #ruby
Telling joined #ruby
rickmasta joined #ruby
grekko joined #ruby
gearaholic joined #ruby
vandemar joined #ruby
dankest joined #ruby
moted joined #ruby
emmanuelux joined #ruby
luckyruby joined #ruby
ilyam joined #ruby
ghanima joined #ruby
dotemacs joined #ruby
axl_ joined #ruby
Manhose joined #ruby
emmanuelux joined #ruby
thoraxe joined #ruby
<thoraxe>
is there already a way to generate md5_crypt with ruby?
michaelh joined #ruby
frem joined #ruby
frem left #ruby
fra000 joined #ruby
<ReinH>
google it
workmad3 joined #ruby
<thoraxe>
i have been, and have found several links that go nowhere
<thoraxe>
cloest thing i found is a ruby gem (crypt3) which seems to work, but was wondering if there was something that was more native
<gener1c>
why did you use css in onw and at_css in the other?
<linusoleander>
thoraxe: You want to generate a MD5 hash based on a input string?
<linusoleander>
gener1c: #css matches all elements, #at_css just one
<gener1c>
but i want more than one
<gener1c>
and just inside that div that has that class
<gener1c>
so do i use
<linusoleander>
Then use #css
<gener1c>
post.css("a.css_classname")
<gener1c>
?
<linusoleander>
Yes, that is correct
<gener1c>
cool
<linusoleander>
You can apply the #each method on that method
<gener1c>
yeah
<gener1c>
doc.css("tag.class").each {|post| post.css("a.classname").each {|p| p p }}
pangur joined #ruby
<gener1c>
mucho unreadable but works
dankest joined #ruby
<pangur>
roles =[] ; roles << r unless roles.include?(r) should give put r in roles unless it is already there. Am I right?
sorin joined #ruby
<gener1c>
sounds legit
r0bby joined #ruby
eugynon left #ruby
<gener1c>
yeah wokrs for me
<pangur>
Unfortunately, out of 416 records, it finds all records, even though some of them have duplicate role fields.
luckyruby joined #ruby
<gener1c>
huh?
<gener1c>
i didnt understand that
<pangur>
Basically, I have 416 records, there are about 18 roles - most of the people have one of 18 roles. When I use the formula that I have just used, I get all 416 records back - rather than the 18 or so.
<pangur>
Ah, I have just discovered my error.
<pangur>
No I haven't.
<gener1c>
lol
<pangur>
I thought I had left a line in that was ignoring my conditional.
<JJMalina>
what's the name of the most common ruby mysql library people use?
<pangur>
Basically, the objects on each side of the = must have the same hash value, so to speak?
<csavola>
pangur: yes except not == but #eql?
<csavola>
pangur: if a.eql?(b) then a.hash == b.hash
* pangur
looks up eql
<csavola>
pangur: it was mentioned in the #hash docs
JJMalina left #ruby
<pangur>
I know but I did not quite follow what the difference between it an equals was - but now I have the impression it means object equivalence or object.attribute equivalence?
Indian joined #ruby
* pangur
had never come across hash() and eql? before.
<envygeeks>
Is there a way to dup chain? EXP ENV.dup.delete('KEY')?
mksm_ joined #ruby
TandemAdam joined #ruby
Knodi joined #ruby
<csavola>
encygeeks: depends on the method you call after dup... I think delete returns the object that is deleted not the receiver
yoshie902a joined #ruby
<yoshie902a>
hello
stephans joined #ruby
tobym joined #ruby
<TandemAdam>
Hey what is the deal with the feud between the Ruby and Python communities? I know it is mostly a playful fight, but what is the aguments each side?
<yoshie902a>
I have an array a=[a,b,c,d,f] and another array b=[0,2]. I would like get another array of only the values at (.values_at) [0,2]. However the values_at method does not seem to take my array. What do I need to modify to get this working? Thank you
<csavola>
TandemAdam: same as any two language camps...
GreaseMonkey joined #ruby
<TandemAdam>
csavola: seems that ruby and python have a special thing going on though
<yoshie902a>
TandemAdam: What language I like best is what I know more of. lol
<shevy>
yoshie902a naaaah ... some languages just suck when you keep on using them for a longer time. Like, PHP. Or Perl.
* pangur
is back.
<TandemAdam>
yoshie902a: Yeah I know why any argument like that is silly, but just wondering the details
<csavola>
TandemAdam: It's like two home town teams... Java and C#
<shevy>
TandemAdam I don't see any feud. Ruby and Python are very similar, just some syntactic differences and a few philosophical differences, but they are in the same boat - against Perl, PHP and Javascript.
<TandemAdam>
shevy: haha, nice dig at PHP :)
<shevy>
It's true. I tried to write an IRC bot in PHP. I sucked though, and failed. After a few months in Ruby my first try at an IRC bot in Ruby worked. Since then, I am 100% sure that the better language makes you a better programmer simply because it is easier and more efficient to use and write code in.
<shevy>
What PHP ultimately lacks is consistency and beauty.
<pangur>
I was having a look at "seamless" earlier today and "rubypython" but neither worked for me.
axl__ joined #ruby
<TandemAdam>
shevy: thats true. when your goal is to build something, you don't want your tools to get in your way
<pangur>
If it were not for php, you would not appreciate ruby so much :)
<TandemAdam>
pangur: haha, so true. and good point ;)
<pangur>
I really enjoyed php until I began to meddle with ruby.
<shevy>
PHP showed that even a crappy language can become dominating and widely used.
<shevy>
I am still sad that ruby has nothing close to mediawiki and phpBB or wordpress.
<pangur>
I also enjoyed python but there is something neat about ruby that draws me back to it.
<yoshie902a>
csavola:Thanks! collect method was perfect, I guess I didn't realize it.
workmad3 joined #ruby
hemanth joined #ruby
Pip joined #ruby
Pip joined #ruby
kirun_ joined #ruby
GSpotAssassin joined #ruby
yoshie902a left #ruby
hemanth left #ruby
ChampS_ joined #ruby
bosphorus joined #ruby
kokap joined #ruby
sa_sh_ka joined #ruby
dv310p3r joined #ruby
lucasgonze_ joined #ruby
adeponte joined #ruby
mmercer joined #ruby
pantsman joined #ruby
pantsman joined #ruby
<TandemAdam>
anyone on Ubuntu, where do you put your ruby projects on the filesystem? I am a linux noob, and not sure how I should organise things
<pangur>
I am on Ubuntu. You can put your ruby files anywhere. Currently, I use /var/www/ruby but that is not necessary.
<pangur>
I am a newbie too though.
td123 joined #ruby
chessguy joined #ruby
<TandemAdam>
what is the var directory for?
<csavola>
TandemAdam pangur: put your project files in your /home if you are developing them
<csavola>
TandemAdam: /var is supposed to be for system things that change often... database contenxt
<pangur>
OK, thanks, csavola.
<TandemAdam>
csavola: oh cool, thanks
<pangur>
TandemAdam: /var/www is the default document root where you would put files that will appear when you do http://localhost
h4mz1d joined #ruby
linusoleander joined #ruby
<csavola>
TandemAdam: the idea being that you can have it mount a different partitian to keep fragmentation contained
n8ji joined #ruby
<TandemAdam>
pangur: ah interesting
<TandemAdam>
csavola: oh true
<pangur>
If you click on http://localhost in my posting, a default "It works" should open for you, TandemAdam. However, I would take the advice of csavola with regard to ruby every time.
simon joined #ruby
simon left #ruby
simon joined #ruby
<TandemAdam>
pangur: cool thanks
simon left #ruby
simon joined #ruby
simon left #ruby
atmosx joined #ruby
fridim_ joined #ruby
dr_bob joined #ruby
adambeynon joined #ruby
Norrin joined #ruby
jr00n joined #ruby
tvw joined #ruby
CharlieSu joined #ruby
johnduhart joined #ruby
adambeynon joined #ruby
<CharlieSu>
Hi.. I'm shelling out in a Ruby program and would like to see the results of the command being executed as it runs.. Do I need to do some type of IO redirection? https://gist.github.com/2ea685b0b07857330955
conor_ireland joined #ruby
jhowarth joined #ruby
h4mz1d joined #ruby
kreantos joined #ruby
<jhowarth>
Is there a way to syntax check ruby code stored in a string at runtime?
<davidcelis>
CharlieSu: What line are you wanting to output?
<CharlieSu>
davidcelis: the output form the very last line
<kreantos>
hello, does one of you has recently installed rvm on a mac?
<davidcelis>
CharlieSu: It's not already outputting?
<davidcelis>
kreantos: what's the problem?
<CharlieSu>
davidcelis: it isn't.. but it could be because the process isn't complete. but it outputs things the entire time it is being run
<kreantos>
i need want to remove the standard ruby version
<kreantos>
but i have no clue hwo
<kreantos>
how
<davidcelis>
kreantos: yeah... don't do that
<kreantos>
ok
<davidcelis>
kreantos: the point of RVM is to leave the system ruby alone
johnduhart joined #ruby
<kreantos>
ok
<kreantos>
but if i do rvm use 1.9.2
<kreantos>
i still have the standard version
xkws49er joined #ruby
<davidcelis>
yeah
<davidcelis>
it doesn't install the system version
* pangur
shudders as he has removed 1.8.7
<davidcelis>
the point of RVM is to manage multiple rubies and be able to switch between them easily
jr00n joined #ruby
<kreantos>
yes
<davidcelis>
if you do `rvm use 1.9.2`, that will be the one used until you specify otherwise
mengu_ joined #ruby
<davidcelis>
it doesnt uninstall other rubies unless A) you tell it to, and B) it's not the system installation
<kreantos>
this behavior i expected
<deryldoucette>
correct, RVM does not manage the system ruby. and for good reason
* pangur
has lived to tell the tale
<kreantos>
my problem is that rvm use does not change the ruby version
<davidcelis>
CharlieSu: If you assign that backtick call to a variable
<davidcelis>
the variable's value will be the output
<kreantos>
i have allways ruby 1.8.2
<davidcelis>
and then you can puts the variable
<kreantos>
1.8.7
<theRoUS>
i can access the closest ancestor of the current method with #super. what if i want to access the ancestor method provided by a *particular* ancestor class?
<pangur>
Have you installed a new version of ruby using rvm, kreantos?
hadronzoo joined #ruby
<theRoUS>
if class foo has ancestors class:bar, class:zed, module:bag, and class:bletch, and all of those supply a #fubar method, how can foo.new#fubar invoke bag's #fubar?
<hadronzoo>
How do I include an image in my yard documentation?
<davidcelis>
good question; have you actually installed 1.9.2 using rvm, kreantos?
<pangur>
It can only select the versions that are installed on your machine.
johnduhart joined #ruby
<deryldoucette>
rvm --install use 1.9.2 should install and then change to that version. you can verify that its changed to it with rvm info
<CharlieSu>
davidcelis: how can i make the output print as it comes through instead?
<kreantos>
but i switched recently from linux to mac
<deryldoucette>
ruby --version NOT ruby -version for one
<davidcelis>
CharlieSu: What if you just do.... puts `your shell shit`
<CharlieSu>
davidcelis: i'll try
<davidcelis>
That SHOULD output as it runs..
excelsior joined #ruby
apeiros_ joined #ruby
emmanuelux joined #ruby
<CharlieSu>
davidcelis: it doesn't.. :(
<davidcelis>
:\
<davidcelis>
hmmm
<deryldoucette>
kreantos: do a set -x ; rvm use 1.9.2 ; rvm info ; set +x and gist the ENTIRE output of that commandset and then post the problem and the URL of the gist in #rvm as well as file a bug at github.com/wayneeseguin/rvm/issues
btanaka joined #ruby
<deryldoucette>
please be sure to 'summon' mpapis in the gist (add @mpapis in the filed Issue)
<kreantos>
deryldoucette: ok ty
<deryldoucette>
welcome
<kreantos>
not sure if i understood your last sentence
<kreantos>
summon?
<deryldoucette>
please be sure to log into (or create) your github account before filing so he has a way to notify you
<kreantos>
aah
<kreantos>
ok
<deryldoucette>
yes, for github using a person's github nick preceeded with @ is called summoning
<deryldoucette>
it notifies them specifically
emmanuelux joined #ruby
<davidcelis>
CharlieSu: I can't find a way to do this
<davidcelis>
and why do you keep typing the command's full path?
<davidcelis>
/Users/simon/.rvm/bin/rvm => just type `rvm`
alex__c2022 joined #ruby
<kreantos>
this is not working
<davidcelis>
did you... follow RVM's post-install instructions?
<davidcelis>
and edit your dotfiles to initialize RVM correctly?
<davidcelis>
because it's starting to seem like ya didn't
<kreantos>
ehrm, installing xcode
<davidcelis>
kreantos: you didn't have gcc installed?
workmad3 joined #ruby
<kreantos>
yes sure
<davidcelis>
"yes sure" you DID have gcc installed? or didn't?
<kreantos>
yes sure i have installed gcc
tobym joined #ruby
<davidcelis>
so why're you installing xcode
CharlieSu left #ruby
<kreantos>
it was written in shell output after installing rvm
<davidcelis>
and what about my previous question? did you follow the post-install instructions for GCC? you should have edited your .bashrc or .bash_profile or some .bash file with a line to initialize RVM
<linduxed>
please remind me, what does the * do and what does the & do?
<linduxed>
also, do i understand that line correctly in that method_missing requests three parameters?
<linduxed>
or maybe two or more (with the *args being multiple)?
hadees joined #ruby
BinaryMuse joined #ruby
peterwald joined #ruby
Banistergalaxy joined #ruby
skillachie joined #ruby
<envygeeks>
linduxed: *args turns args into an array so if you do method_missing(my_method, this, that, this_again) anything after my_method will be an array on *args, &block allows you to pass a code block that you can block.call method_missing { puts 'hello world' } but you need to explicitly do block.call for it to work
BinaryMuse left #ruby
flip_digits joined #ruby
<linduxed>
oh i see
<linduxed>
well, then i'll read up on the examples with block calling then
<linduxed>
-then
<linduxed>
so... the &block is just an indicator of sorts?
<linduxed>
"do so that i can pass blocks"?
<linduxed>
or wait
<envygeeks>
yes, it just tells ruby that it's a block
<davidcelis>
linduxed: Think about it this way. If you just put "block", it would just be a normal variable named "block"
<linduxed>
ok
<linduxed>
so one thing though
andreassaebjoern joined #ruby
<linduxed>
or a couple
<linduxed>
first, what would the output of that be?
emmanuelux joined #ruby
<envygeeks>
my method
<envygeeks>
["hello", "world"]
<envygeeks>
hello world
<linduxed>
"hello", "world"?
<linduxed>
ok then it was like i would guess
<linduxed>
secondly
<linduxed>
i'm a bit confused about my_method
<Banistergalaxy>
Hello envygeeks
<Banistergalaxy>
Whats up
<linduxed>
when it's passed like that...
<linduxed>
hmmm
<envygeeks>
linduxed: my method under method_missing passing the missing method name so if you do MyClass.method and method_missing is there it will be the symbol with the method
<linduxed>
it's passed like a string but..
<linduxed>
wait, i need to think
<andreassaebjoern>
Hi! I have a string with a class name, unfortunately the string is lowercase, and need to find the class with the same name. Do you have any advice on how I can do this?
wilmoore joined #ruby
<Brozilla>
capitalise/camelize the string?
<andreassaebjoern>
Brozilla: I created a DSL where it's better if the string is lowercase, so I would prefer not to
<Asher>
you're introducing your own problem
<Asher>
best case you constrain your class names to be first letter cap
<envygeeks>
which capitalize would be the best
<andreassaebjoern>
I was considering using some functionality related to Kernel.const_get
<andreassaebjoern>
since ruby represents a class as a variable
<Asher>
const_get expects proper capitalization
<Asher>
not sure what you mean by represents class as variable
<andreassaebjoern>
I could then iterate over all variables and look for possible matches
<andreassaebjoern>
if there is more then one match then I generate an error
<andreassaebjoern>
however, I need to be able to iterate over all class names to do that. I am not sure how to achieve that.
<Asher>
those are terrible ideas
robyurkowski joined #ruby
<Asher>
use the proper capitalization in your dsl
emmanuelux joined #ruby
<andreassaebjoern>
why are they terrible? I don't think two classes would be named 'ClassName1' and 'classname1'. So normalizing to lowercase should be fine, simplifying the DSL.
<Asher>
*shrug* pick your poison but don't be surprised when it's a toxic solution
<Asher>
you will suffer your own error not us
<Brozilla>
what's the reason to use lowercase other than prettyness?
<davidcelis>
Brozilla: convention
<Asher>
and how is it pretty if two different classes could potentially end up looking the same
<andreassaebjoern>
Brozilla: davidcelis is correct, it's for convention.
<Asher>
how can you argue "convention" when you then face the problem that lowercase doesn't match ruby convention
<Brozilla>
if it was convention, wouldn't there be a solution?
<davidcelis>
okay, let me take a step back here.
<davidcelis>
what is being lowercased?
Seisatsu joined #ruby
<andreassaebjoern>
Asher: the code would check for this error. It would not allow two classes to have names that look the same when normalized to lowercase.
<andreassaebjoern>
and that is automatically enforced
<Asher>
lots of extra work, extra code to maintain, anti-intuitive architecture
atmosx joined #ruby
<davidcelis>
andreassaebjoern: if the class is two words, is there an underscore between the words?
dasfugufish joined #ruby
<davidcelis>
so that ClassName would be "class_name" as a string?
<davidcelis>
do i even know wtf is going on
<envygeeks>
I don't understand what he is trying to say
<envygeeks>
how about some code os we can get a feel of this shit?
<linduxed>
if i've got a variable called @messages, and i want to append stuff to it
<linduxed>
i've seen code with < < doing it, is that correct?
<linduxed>
or should i uss .append(foobar) or something like that?
<envygeeks>
.append is 1.9.3 only
<shevy>
linduxed < < does not seem correct
<shevy>
or did you mean <<
jrist joined #ruby
h4mz1d joined #ruby
<shevy>
anyway, to append to array or strings, use << 'what you want to append to that'
<andreassaebjoern>
davidcelis: if there are two words, it's just lowercased. No underscore between the words. I intend to improve that as it's not according to normal convention.
<linduxed>
shevy: well, i think it's <<
<shevy>
yeah
<davidcelis>
andreassaebjoern: Okay, yeah. if it's just "classname" then that's a terrible idea.
<shevy>
in C++ too ... cout << "bla" << endl; or something like that
<linduxed>
shevy: might be badly written webpage with example where it's < <
<davidcelis>
there's no way to know what to capitalize
<envygeeks>
personally I prefer not to us << on strings because normally new programmers associate << with arrays so I would do "test".concat(" test") or "#{var1} extra"