Topic for #rubyis 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/
whitequark joined #ruby
whitequark left #ruby
asteve joined #ruby
albemuth joined #ruby
axl_ joined #ruby
nanderoo joined #ruby
iocor joined #ruby
MetaCosm joined #ruby
zawopak joined #ruby
shaatar joined #ruby
dotemacs joined #ruby
p0y joined #ruby
crankycoder joined #ruby
king313 joined #ruby
avandendorpe joined #ruby
omry joined #ruby
<omry>
is it possible to pass a string object to %x[] ?
<omry>
ruby is trying to execute the string name instead of its content
relix joined #ruby
king313 joined #ruby
alx- joined #ruby
rhinux joined #ruby
cesario joined #ruby
<samuelkadolph>
omry: #{} works inside of
<samuelkadolph>
%x
srji joined #ruby
<omry>
samuelkadolph, I noticed. but I still want to execute the string content (I am using the string somewhere else, don't want to repeat it)
<samuelkadolph>
omry: Then perhaps you should gist your code since that makes no sense
<omry>
that makes perfect sense. I want to print the command and run it, for example.
<samuelkadolph>
That makes sense and it's easy to do: puts cmd; %x[#{cmd}]
patricksroberts joined #ruby
<omry>
ah, okay. I actually tried it but had a syntax errr in the inner string
<omry>
thanks
<omry>
(accidentally rried %x[%{cmd}]
yfeldblum joined #ruby
asteve left #ruby
Jarred joined #ruby
oponder joined #ruby
justicefries joined #ruby
gmcabrita joined #ruby
deweysmith joined #ruby
KL-7 joined #ruby
bauruine joined #ruby
davidboy joined #ruby
ckrailo joined #ruby
kirk_r joined #ruby
john2x joined #ruby
ablemike joined #ruby
diago1 joined #ruby
<diago1>
can I ask RVM questions in here?
lobo_d_b joined #ruby
p0y joined #ruby
<samuelkadolph>
diago1: You can but it should be better to ask in #rvm
<diago1>
oh snap, didn't know aabout #rvm thanks
dcarper joined #ruby
steph021 joined #ruby
steph021 joined #ruby
rexamophone joined #ruby
iocor joined #ruby
KL-7 joined #ruby
centipedefarmer joined #ruby
mklappstuhl joined #ruby
rippa joined #ruby
KL-7 joined #ruby
beakerma_ joined #ruby
lectrick joined #ruby
Draco_ joined #ruby
echoprinter joined #ruby
macmartine joined #ruby
echoprinter left #ruby
echoprinter joined #ruby
king313 joined #ruby
lonny joined #ruby
heftig joined #ruby
rhinux joined #ruby
bbttxu joined #ruby
fcoury joined #ruby
dkannan joined #ruby
pootpoot joined #ruby
kaspernj joined #ruby
fatguylaughing joined #ruby
mcowan joined #ruby
p0y joined #ruby
vtr joined #ruby
mikepack joined #ruby
theRoUS joined #ruby
theRoUS joined #ruby
raincole joined #ruby
alex__c2022 joined #ruby
raincole_ joined #ruby
whitelogger joined #ruby
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/
user__ joined #ruby
John_P joined #ruby
crankycoder joined #ruby
crankyco_ joined #ruby
tshauck joined #ruby
crankycoder joined #ruby
pen_isident joined #ruby
kenichi joined #ruby
akem joined #ruby
crankyco_ joined #ruby
brownies joined #ruby
<brownies>
oh man... little-know but incredibly useful flag: ./configure --with-gcc=clang
raincole_ joined #ruby
raincole__ joined #ruby
smgt joined #ruby
crankycoder joined #ruby
j3r0m3 joined #ruby
<srji>
exist a method to remove white spaces in strings like "Hello World"?
martisj joined #ruby
whitequark joined #ruby
crankycoder joined #ruby
eywu joined #ruby
crankycoder joined #ruby
<whitequark>
I've noticed that there is no #ruby/#ruby-lang IRC logs, and I wrote a log viewer to make some: http://irclog.whitequark.org/ruby
<whitequark>
this has raised some privacy concerns on #ruby-lang, through.
crankycoder joined #ruby
<srji>
ah, gsub
<srji>
cool
stunna joined #ruby
<brownies>
sweet
* brownies
installed ruby from source... without gcc.
cordoval joined #ruby
<cordoval>
how to get todays date on format 20111116 ?
crankycoder joined #ruby
<cordoval>
and also how to output current time in 11:00 format?
<samuelkadolph>
cordoval: strftime
<cordoval>
hmm url? any examples?
quest88 joined #ruby
<whitequark>
ok, no one cares. fine then
<ablemike>
privacy concerns?
<ablemike>
Uh … thats kind of like being nude in a park and then complaining that someone is looking at your junk.
<Mothore>
That's one I found, but I remember it being a lot better a few years ago
<ablemike>
oooh
cjz joined #ruby
mitchty_ joined #ruby
jrist joined #ruby
martisj_ joined #ruby
mitchty joined #ruby
strife25 joined #ruby
lorandi joined #ruby
dotnot joined #ruby
dotnot left #ruby
lorandi joined #ruby
whitequark left #ruby
dcarper joined #ruby
Jake232 joined #ruby
Paladin joined #ruby
lkba joined #ruby
flexd joined #ruby
iocor joined #ruby
dcarper joined #ruby
travisjeffery joined #ruby
Blackflys joined #ruby
KL-7 joined #ruby
helllen joined #ruby
<helllen>
helllo
<helllen>
how could I see all gems deps are resolved ?
lorandi joined #ruby
<helllen>
I have uninstalled some gems and I am not sure now if I have deleted a good gem now
tjj joined #ruby
panzi joined #ruby
Adman65 joined #ruby
<panzi>
what is the difference between `fmt % argarray` and `sprintf(fmt, *argarray)`? which one should I use?
ablemike left #ruby
manizzle joined #ruby
apeiros_ joined #ruby
mengu joined #ruby
philcrissman joined #ruby
<burgestrand>
panzi: they’re the same, I’d use the String#% one myself
luckyruby joined #ruby
flip_digits joined #ruby
<burgestrand>
Feels better to ask the string to format itself rather than asking the Kernel to format a string for me :x
robyurkowski joined #ruby
iocor joined #ruby
Beoran__ joined #ruby
<panzi>
burgestrand: ok, if there are no differences I'd also use %. for one I'm used to this from python and it is more object orientated. I just saw sprintf used in the code of a coworker and wondered what this C-ish function is all about
h4mz1d joined #ruby
<burgestrand>
I don’t see the sprintf style often; mostly you do string interpolation or String#%
badabim joined #ruby
tehdekan joined #ruby
maletor joined #ruby
KL-7 joined #ruby
eignerchris joined #ruby
n8ji joined #ruby
dyer joined #ruby
conor_ireland joined #ruby
themadcanudist joined #ruby
CannedCorn joined #ruby
helllen left #ruby
Araxia_ joined #ruby
artOfWar joined #ruby
Cervajz joined #ruby
minijupe joined #ruby
_debo joined #ruby
SegFaultAX|work joined #ruby
maggie_n joined #ruby
quest88 joined #ruby
luxurymo_ joined #ruby
craigglennie joined #ruby
Clooth joined #ruby
cook1es joined #ruby
<brownies>
seeing something strange with rbenv.... anyone around to help?
<brownies>
just got this random error, and i notice the version numbers don't match...
<brownies>
/Users/brownies/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/openssl/buffering.rb:121:in `sysread': Operation timed out (Errno::ETIMEDOUT)
<epochwolf|vps>
they match just fine
<epochwolf|vps>
ruby 1.9.3 uses stdlib 1.9.1
Sliker_ joined #ruby
GlennO joined #ruby
<brownies>
oh hmmm ok
<brownies>
so that's not the issue?
<JonnieCache>
epochwolf|vps: ahhh… so thats why. i thought some packager somewhere forgot to bump their version strings
alfism joined #ruby
ethndbst joined #ruby
ethndbst joined #ruby
mrsolo joined #ruby
<brownies>
fixed it. gem update.
tshauck joined #ruby
gmcabrita left #ruby
SolarisBoy joined #ruby
mcowan_ joined #ruby
Targen joined #ruby
Blackflys joined #ruby
Evixion joined #ruby
<glacius>
hi guys i am have problems with the gsub function can i get a little help
adamkittelson joined #ruby
maletor joined #ruby
Squarepy joined #ruby
Squarepy joined #ruby
ciupicri joined #ruby
<ciupicri>
easy question: how do I strip "," from the ends of a string?
p1d joined #ruby
craigglennie_ joined #ruby
<LiquidInsect>
"f,o,o,".gsub(/,$/,"") might work for you
<glacius>
na
<glacius>
u think if i pastebin the code someone could take a look
<LiquidInsect>
if there's always a , at the end you can just remove the last character
<LiquidInsect>
glacius: not for your question, for ciupicri
<LiquidInsect>
didn't see yours
<ciupicri>
LiquidInsect, it's not always, otherwise I might as well truncate it
cbuxton joined #ruby
josh_ joined #ruby
stephenjudkins joined #ruby
<rcvalle>
Hi, Is it possible to call a method of a subclass via inherited method of the superclass? It keeps raising NoMethodError. Any help is much appreciated
<ciupicri>
as for the code it's Facter::Util::Resolution.exec('mysql --version').chomp.split(' ')[4] and sometimes the version can be "5.1.52,"
<ciupicri>
as in "mysql Ver 14.14 Distrib 5.1.52, for redhat-linux-gnu (i386) using readline 5.1"
<LiquidInsect>
it's just looking for any comma which comes at the end of a string and removing it
jbpros joined #ruby
<glacius>
LiquidInsect but it does change but that s an example
<ciupicri>
LiquidInsect, yeah, although it's kind of overkill to use a regex :-)
tdubellz joined #ruby
<ciupicri>
LiquidInsect, nevertheless, thank you
marcuspat joined #ruby
<LiquidInsect>
ciupicri: simpler solution? grab that last character, if it's a comma just truncate the string then
mklappstuhl joined #ruby
<LiquidInsect>
then you're not using a regex, just comparing one character
lump joined #ruby
<ciupicri>
LiquidInsect, I think that would destroy the one-liner :-) I find it a bit odd that Ruby doesn't have a parameter for strip just like Python which lets you mention what character to trim
philcrissman joined #ruby
blischalk joined #ruby
<glacius>
LiquidInsect did that string help
<LiquidInsect>
glacius: honestly I can't spend a lot of time helping here. I'll take a look but I'm at work.
dracflamloc joined #ruby
<LiquidInsect>
Have you tried macthing on a smaler subset of the string?
<glacius>
LiquidInsect oh not a problem, thanks so much for even considering
<LiquidInsect>
ciupicri: you could still make it a oneliner, it might just get ugly
dbernar1 joined #ruby
stkowski joined #ruby
Jake232 joined #ruby
demian`_ joined #ruby
bier_ joined #ruby
Russell^^ joined #ruby
reg__ joined #ruby
echoprinter joined #ruby
gianlucadv joined #ruby
tomorama joined #ruby
lonny joined #ruby
<tomorama>
When I attempt to run `bundle install` for a rails app, I get the following error: rescue in <top (required)>': uninitialized constant Bundler::BundlerError (NameError)
<tomorama>
I've tried bringing everything up to date, with no success. I'm on ubuntu 10.04 lts and using aptitude
ciupicri left #ruby
EddieBluh joined #ruby
theRoUS joined #ruby
theRoUS joined #ruby
charlenopires joined #ruby
nicoulaj joined #ruby
kuranai joined #ruby
kuranai left #ruby
eignerchris_ joined #ruby
echoprinter left #ruby
brownies left #ruby
skim1776 joined #ruby
<skim1776>
hey, is it possible to check whether string is in array in case statement?
v0n joined #ruby
<skim1776>
for example, "case str when in array ... end"
nerded joined #ruby
\13k joined #ruby
\13k_ joined #ruby
dnyy joined #ruby
\13k joined #ruby
zomgbie joined #ruby
Draco_ joined #ruby
skim1776 left #ruby
ank joined #ruby
rushed joined #ruby
_debo joined #ruby
SaneWarning joined #ruby
voodoofish430 joined #ruby
RomD joined #ruby
Ogion joined #ruby
charlenopires joined #ruby
zanaga joined #ruby
crankycoder joined #ruby
stephenjudkins joined #ruby
andywww joined #ruby
<andywww>
hi, i'm receiving what i'm told is binary data through a web service.. using savon to speak to a .NET soap service
hukl joined #ruby
<andywww>
the binary data, representative of a zip file is coming through as a string of random numbers and letters in an XML element
<andywww>
i'really struggling (with savon) to make it behave as anything other than a string
charlenopires joined #ruby
<philips>
Can I set GEM_HOME from within a script before calling rubygems?
dankest joined #ruby
<philips>
require 'rubygems' that is
n8ji joined #ruby
solars joined #ruby
<solars>
does anyone know if there is a solution to this ubuntu ruby 1.9 ssl problem?
<samuelkadolph>
skrewler: case str; when *array; end
<samuelkadolph>
Err, that was for skim1776 but he's gone
eignerchris joined #ruby
Knodi joined #ruby
visof joined #ruby
mog- joined #ruby
josemota joined #ruby
ablemike joined #ruby
philcrissman joined #ruby
btanaka joined #ruby
philcrissman joined #ruby
<josemota>
hey guys, can anyone tell me what's wrong in this spec? First steps into Rspec and Rails: http://pastie.org/2873745
p1d joined #ruby
senj joined #ruby
panzi joined #ruby
skim1776 joined #ruby
<skim1776>
hey, is it possible to check whether the string is in array in case statement?
mcowan joined #ruby
<lectrick>
I tried to install Ack on a Unix install that didn't install it, and it installed "Ack- the Kanji code converter". WTF?
<lectrick>
ah, it's ack-grep normally. lame
robotmay joined #ruby
durre joined #ruby
mikewintermute joined #ruby
<durre>
hi! I need some help setting my ruby environment up in OSX. I ran "gem install heroku"... which installed fine. but I cant run the "heroku" command at command line. this worked fine at work with ubuntu. what dir do I need to put in the path?
jbw joined #ruby
chronos joined #ruby
<chronos>
good afternoon guys.
<chronos>
I have a error here with gitorious, but I know nothing about rails, someone can help me? Error is at http://gist.github.com/1370933 ...
<samuelkadolph>
durre: Did you use sudo?
<chronos>
I really need help on that
sepp2k joined #ruby
<durre>
samuelkadolph: yep
dbernar1 left #ruby
andywww joined #ruby
jensn joined #ruby
<samuelkadolph>
Maybe reload your terminal
<samuelkadolph>
sudo gem install should work fine with OS X's ruby
fayimora joined #ruby
<andywww>
samuelkadolph, tore tore: apologies for any lack of response, i got disconnected
<samuelkadolph>
ruby needs a good zip library
<durre>
samuelkadolph: I restarted the terminal a couple of times. I have other gems I can run. like "compass". I'm thinking maybe I have several ruby installations or something and heroku ended up in the wrong one
<samuelkadolph>
What does gem which heroku give you?
<durre>
samuelkadolph: I'm not sure what you mean. it's the CLI for the heroku platform
<samuelkadolph>
durre: gist.github.com the output of gem env
<durre>
compass was in the same place
<samuelkadolph>
My guess is you installed compass with the system ruby (/usr/bin/ruby) which installed a compass stub into /usr/bin but you only installed heroku with your brew ruby
<samuelkadolph>
And it's gem executable directory is not in your $PATH
<samuelkadolph>
Now /usr/local/Cellar/ruby/1.9.2-p290/bin and see if heroku is there
<samuelkadolph>
Now check*
codespectator joined #ruby
ethndbst joined #ruby
<andywww>
toretore: where have you gone? I've got it working thanks, it was base64 encoded and i've written the decode64(data) to a file which unzipped nicely as a standard zip file
<samuelkadolph>
andywww: You were talking in #rubyonrails before
<durre>
samuelkadolph: heroku is in that dir
<andywww>
i just realised! sorry
<samuelkadolph>
durre: There ya go
andywww left #ruby
theRoUS joined #ruby
senj joined #ruby
kaspernj joined #ruby
<durre>
samuelkadolph: wonderful! thank you for straightening that out
steph021 joined #ruby
<samuelkadolph>
rubygems executable stubs are rather interesting and sometimes annoying like that
skim1776 left #ruby
Helius joined #ruby
bbttxu joined #ruby
mikewintermute joined #ruby
tvo_ joined #ruby
tvo_ joined #ruby
kuadrosx joined #ruby
rhinux joined #ruby
smgt joined #ruby
tatsuya_o joined #ruby
Hellojere joined #ruby
pantsman joined #ruby
pantsman joined #ruby
Martiini joined #ruby
sodani joined #ruby
jbpros joined #ruby
<sodani>
hello, I'm using datamapper to create a table in a mysql database but the encoding in the sql query isn't query i'm specifying. any tips on how I can troubleshoot this?
stephans joined #ruby
<sodani>
sorry. the encoding in the sql query isn't the encoding that I'm specifying in the datamapper call
theRoUS joined #ruby
kedare joined #ruby
mikewintermute joined #ruby
stoffus joined #ruby
yfeldblum joined #ruby
j3r0m3 joined #ruby
hashbangchris joined #ruby
jensn joined #ruby
pabloh joined #ruby
s0ber joined #ruby
Transformer joined #ruby
Morkel joined #ruby
Holger1970 joined #ruby
<Holger1970>
Hi
Manhose joined #ruby
atmosx joined #ruby
<conor_ireland>
is there anyway to auto-generate tests cases in ruby?
hydrozen joined #ruby
dyer joined #ruby
justinmcp joined #ruby
Jake232 joined #ruby
thone joined #ruby
Zanacross joined #ruby
eignerchris_ joined #ruby
p1d joined #ruby
sodani left #ruby
felipe joined #ruby
zomgbie_ joined #ruby
workmad3 joined #ruby
Draco__ joined #ruby
codespectator joined #ruby
mikewintermute joined #ruby
Squee-D joined #ruby
jensn joined #ruby
<Squee-D>
Is there another name for '<=>' thats more google friendly :D
jay_zawrotny joined #ruby
mklappstuhl joined #ruby
LiquidInsect joined #ruby
Manhose joined #ruby
<apeiros_>
Squee-D: spaceship operator
<Squee-D>
awesome.
<Squee-D>
any idea why symbols don't support it?
xpot joined #ruby
travisjeffery joined #ruby
<conor_ireland>
Squee-D: because symbols will either be the exact same or different?
<apeiros_>
Squee-D: symbols ain't strings. but in 1.9, they get <=>, using their name to sort them by.
froy joined #ruby
<Squee-D>
apeiros_ which is a bit closer to how their (sometimes) used in lisps, for sorted sets for example.
<Squee-D>
All good. wish i had 1.9, working on that today. meanwhile i'll let my list be unsorted
manizzle joined #ruby
hashbangchris joined #ruby
<apeiros_>
Squee-D: given that we know how <=> is implemented in 1.9, there's nothing stopping you from backporting that to 1.8.
incluye joined #ruby
<Squee-D>
I'll just be patient and not add work to my day. Running 1.9 is a priority anyway
ablemike left #ruby
vitoravelino joined #ruby
vitoravelino joined #ruby
LiquidInsect joined #ruby
rhinux1 joined #ruby
kirun joined #ruby
segv joined #ruby
<segv>
how would one access the key of a hash without knowing the name of said hash, assuming i'd have to for loop it to access that without calling blah[??]
chessguy joined #ruby
pablo_ joined #ruby
<apeiros_>
segv: eh?
<apeiros_>
do you mean access a key stored in a variable? `key = 'mykey'; hash[key]`
Spockz joined #ruby
<segv>
yeah
jesteracer joined #ruby
Azure joined #ruby
Tomasso joined #ruby
h4mz1d joined #ruby
<Tomasso>
how do you read a value into a variable like read... or scanf..
burgestrand joined #ruby
skrewler joined #ruby
travisjeffery joined #ruby
nopper joined #ruby
Tomasso left #ruby
LiquidInsect joined #ruby
skrewler joined #ruby
shadoi joined #ruby
tehdekan joined #ruby
xpot joined #ruby
iocor joined #ruby
<robyurkowski>
deryldoucette: what are you trying to do with json? I couldn't quite make out your tweet
eignerchris joined #ruby
nopper joined #ruby
tatsuya_o joined #ruby
enroxorz joined #ruby
enroxorz joined #ruby
littlebill902 joined #ruby
havenn joined #ruby
<littlebill902>
How do methods work that allow you to do Method "text" instead of Method("text")
<burgestrand>
All of them allow you to do that
<LiquidInsect>
All of them do that
<littlebill902>
its just automaticly like that?
<LiquidInsect>
yes
<littlebill902>
oh cool..
<littlebill902>
thanks
<LiquidInsect>
that's ruby's syntax
<burgestrand>
Yeah, you can leave off the parentheses, even when defining them if you want
<burgestrand>
def method a, b, c
<burgestrand>
puts [a, b, c].inspect
<burgestrand>
end
<burgestrand>
Don’t do it slavishly though, remove them sparingly
<littlebill902>
ok
<burgestrand>
Leaving them out can cause confusion sometimes, whereas you’re pretty much always safe having them :)
chronos joined #ruby
<littlebill902>
since it works either way i think ill stick to using them
<littlebill902>
it is what im use to seeing
<chronos>
Guys, I'm here upgrading gitorious but when I do a db:migrate I get rake aborted with following error: https://gist.github.com/1370933 (already tryed #gitorious). I already upgraded EVERYTHING on system and tryed again, same issue
<burgestrand>
Looks very gitorious-specific
BoomerET joined #ruby
<chronos>
may guys can help with trace
<chronos>
I'm 0 in ruby
<BoomerET>
I'm trying to get my SOAP client working, and using wsdl2ruby, so far it's going great. I'm printing a return value, and it sayd #<LoadBalancePort:0xbb664422> I thought that might be an array, but how do I access the values?
<BoomerET>
I've been googling all day with little success
<Mon_Ouie>
Being 0 in Ruby: self #=> 0
gearaholic joined #ruby
<littlebill902>
How do i iterate through an array skipping the first item in the array
<shadoi>
chronos: it's likely that upgrading EVERYTHING caused the issue. Looks like a compatibility problem with activemessaging.
<Jake232>
Is the url of the page stored in the NET:HTTP response object. I need the url, because it could have followed a redirect
<littlebill902>
im trying to pass in a array as a param to a method but i want to pass the whole array minus the first item so instead of interating through them all and make a new array excluding the first item could i instead just pass array[1..-1] as a param?
artOfWar joined #ruby
<BoomerET>
Is there a chomp equivalent for arrays?
<BoomerET>
Or just define a new array with only 1..-1
<eggs>
Hey, I have a gem file that I want to install just in my home directory somewhere so I can peruse the source. What's the gem invocation to do that?
<apeiros_>
design by contract. watch the movies about it on eiffel.co
<apeiros_>
*eiffel.com
<whitequark>
ah yes, know about contracts
<samuelkadolph>
eggs: --user-install or --install-dir
<apeiros_>
samuelkadolph: like ||, but not working with false?
<samuelkadolph>
Yeah
excelsior joined #ruby
<apeiros_>
agreed
<samuelkadolph>
Would be nice to use instead of ||=
<apeiros_>
I want ?. from groovy: nil?.join # => nil
bier joined #ruby
<apeiros_>
[1,2,3]?.join # => "123"
<whitequark>
apeiros_: already exists as .try in activesupport
<apeiros_>
i.e., if the receiver is nil, the return value is nil, nothing is yielded, nothing is raised.
<apeiros_>
whitequark: not the same
<apeiros_>
try is a poor mans workaround
<whitequark>
but it is considered harmful by some
<samuelkadolph>
It's the same just not native
notbrent joined #ruby
<samuelkadolph>
I wonder if you could implement ?. with method_missing
<apeiros_>
samuelkadolph: no, it's not the same. it can't shortcut for one
<samuelkadolph>
Shortcut what? A chain of them?
<whitequark>
6 symbols instead of 1
<samuelkadolph>
abc.foo?.bar?.blah?.to_s
<whitequark>
otherwise just the same
<apeiros_>
there was some other thing where it'd be different… ah, stupid memory fails me today
<samuelkadolph>
What does symbols have to do with anything?
<apeiros_>
yes, a chain of them
<whitequark>
apeiros_: chains do work
<samuelkadolph>
He's talking about not being able to optimize the rest of them away
<whitequark>
ah.
<samuelkadolph>
At least that stupid commit that silenced errors in the block (or somesuch) got reverted
<samuelkadolph>
(for try)
<apeiros_>
oh, right, and I want the warning system reimplemented on top of exceptions
<apeiros_>
with something like Kernel#resume
<whitequark>
use strict; ?
<apeiros_>
the current warning system is pretty much useless.
<samuelkadolph>
Kernel#resume?
j3r0m3 joined #ruby
<apeiros_>
resume code where the exception was raised. if you want warnings in terms of exceptions, that's pretty much a prerequisite :)
redgetan joined #ruby
<samuelkadolph>
Wouldn't that break a lot of code that expects code to not run after raise?
mikewintermute joined #ruby
<burgestrand>
If you swamp my ruby debug output with a shitload of exceptions I will find you
<burgestrand>
:(
<apeiros_>
burgestrand: but that's the point - right now you either get swamped by warnings or don't get any. if it uses the exception system, you can filter warnings.
<apeiros_>
also you get backtraces, hurray
<samuelkadolph>
Pft, use caller. The poor man's backtrace
<apeiros_>
samuelkadolph: you can't use caller with warnings…
<banister`sleep>
apeiros_: have you seen judofyr's Exception#continue?
<apeiros_>
banister`sleep: looked at it
<banister`sleep>
it's pretty badass
juarlex_ joined #ruby
<samuelkadolph>
You can't catch the warning and look at the caller but you can certainly include the caller stack in your warning
<apeiros_>
yeah, but I'm only interested in it with regards to warnings ;-)
<banister`sleep>
oh ok
<apeiros_>
samuelkadolph: yes, you can. but the issue are the warnings of all the other m'therf'ckers code
<samuelkadolph>
apeiros_: implement it in a gem then :P
<apeiros_>
samuelkadolph: you still don't get rb_warn
<samuelkadolph>
monkeypatch warn and use that Exception#continue
<burgestrand>
apeiros_: I meant more rather that if you throw exceptions nowadays, even if you catch them, running ruby with “-d†will show them, which means using them for anything other than exceptions will make the output of “ruby -d†a little less useful :o
<samuelkadolph>
Hmm
<apeiros_>
samuelkadolph: also having a backtrace still doesn't solve the problem. I want to be able to do something like: rescue MyLibWarning => warning; …print the warning…; resume; rescue Warning; …ignore, I don't care about 3rd party code stupidities…; resume; end
<samuelkadolph>
That would be hard without the library dev helping you
<apeiros_>
iow, filter for warnings that my code emits, print it, resume operations. all other warnings: just resume operations, don't print anything. what do I care if 3rd party code is a mess?
<apeiros_>
samuelkadolph: no, that's the point. it would be stupidly easy. but only if warnings work on top of exceptions.
hashbangchris left #ruby
<samuelkadolph>
I suppose if you just lump them all under Warning it would still work
<apeiros_>
with the current warning system, you can patch warn and filter out stuff based on the backtrace, but that's stupid.
wyhaines joined #ruby
<apeiros_>
samuelkadolph: of course. you'd need a baseclass (no idea for the name), from which Exception and Warning inherit. warn raises Warning per default. raise raises RuntimeError per default.
<apeiros_>
you rescue warnings by rescue Warning or subclass.
<samuelkadolph>
I would if it would be feasible to patch warn to use fibers to achieve reentrant warning exceptions
<apeiros_>
(or included module
Axsuul joined #ruby
<Squee-D>
apeiros_ i forgot to thank you for helping with my spaceship question earlier :D Didn't mean to be impolite, was just coding frantically.
<apeiros_>
Squee-D: heh, easy. I only get put off by people who ask and do a goldfish (30s later vanish and stop don't act upon answers)
badabim joined #ruby
tomzx joined #ruby
<Squee-D>
apeiros_ Certainly an annoying trait. But I usually get put of by people who don't exhibit awareness that there are other humans present :D
<Squee-D>
Of which basic manners is an integral part
<apeiros_>
agreed
pootpoot left #ruby
* apeiros_
off
goodieboy joined #ruby
sbanwart joined #ruby
thepix joined #ruby
ztaylor joined #ruby
jbpros joined #ruby
C|S joined #ruby
Azure|netbook joined #ruby
<C|S>
is there a better way of keeping track which line you are on when performing an each loop on a file, than creating a counter variable and ticking it up once each loop?
syllogism joined #ruby
<epochwolf|vps>
C|S: Array#each_with_index ?
<syllogism>
Is this a decent channel to ask some basic rails-specific questions, or should I be elsewhere?
<eggs>
"'activesupport','~> 2.3.4']" what does that ~> mean
<eggs>
would that limit it to loading 2.3.x instead of 3.0.10?
j3r0m3__ joined #ruby
<C|S>
epochwolf|vps: thanks, is the value of the index saved as a variable labeled 'index'? I need to do a next if index=INT
<epochwolf|vps>
C|S: it takes a code block...
<C|S>
so, file.each do |line,index| ?
<C|S>
epochwolf|vps: ^
<epochwolf|vps>
I suppose, I didn't read the docs.
jbpros joined #ruby
<epochwolf|vps>
each_with_index, not each
<C|S>
epochwolf|vps: right, ok thanks
jbpros joined #ruby
sythe joined #ruby
jbpros joined #ruby
alexchaffee joined #ruby
sbanwart joined #ruby
friskd joined #ruby
gearaholic joined #ruby
pac1 joined #ruby
yaasii joined #ruby
strife25 joined #ruby
krz joined #ruby
<strife25>
hi im trying to programmatically run a test::unit TestSuite from a build script and was wondering how one can pass in an external value into the my TestCase class when my build script executes?
SilverMonkey joined #ruby
<strife25>
This is the code I currently have: http://pastie.org/2875028 I need to set a URL attribute inside of JKEFunctionalTests to get the tests to work:
fayimora joined #ruby
btanaka joined #ruby
eggs left #ruby
macmartine joined #ruby
yekta left #ruby
j3r0m3 joined #ruby
syllogism left #ruby
cook1es joined #ruby
<whitequark>
samuelkadolph: you can't monkey-patch most of warn calls
<whitequark>
it just does not involve any Ruby-alterable code paths
lobo_d_b joined #ruby
lobo_d_b joined #ruby
<samuelkadolph>
I know you can't monkeypatch c methods
nricciar_ joined #ruby
<samuelkadolph>
Has nothing to do with patching most warn calls
dankest joined #ruby
<whitequark>
samuelkadolph: looks like I'm missing something. I always thought that warn calls are "most" useful as a part of verbose mode to find smelly constructs
<whitequark>
and that Kernel#warn is seldom used in the wild
<whitequark>
am I wrong?
dv310p3r joined #ruby
<samuelkadolph>
You probably weren't reading the conversation then
<whitequark>
yeah I understand that you were talking about libraries. That does not exclude the verbose mode usage.
<whitequark>
Nevermind, I already understand that I indeed missed something.
<samuelkadolph>
It had nothing to do with verbose mode
<samuelkadolph>
And there are more warn calls in ruby than in c in ruby itself, so you can patch most of them
rook_flood joined #ruby
<whitequark>
Were you talking about patching existing warn calls in the existing libraries to make them more helpful, or just about improving the generic interface to encourage it's usage in the future?
<samuelkadolph>
I was talking about if you could patch warn to achieve what he wanted after we started talking about ruby 2.0