whitelogger joined #ruby
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.
<ablemike> They are private channels yeah?
<whitequark> like this.
<ablemike> wait
<ablemike> public channels
<whitequark> yep
<ablemike> pffff …
<cordoval> t = Time.new(2007,11,19,8,37,48,"-06:00") #=> 2007-11-19 08:37:48 -0600
<ablemike> Sorry … that bi-law crap about being logged or not is absurd.
<cordoval> t.strftime("Printed on %m/%d/%Y") #=> "Printed on 11/19/2007"
<cordoval> want to get today's date
<cordoval> howto
<cordoval> now()
<cordoval> that is where I am at
<ablemike> irb
<ablemike> ruby-1.9.2-p290 :001 > t = Time.now
<ablemike> => 2011-11-16 10:26:04 -0600
<samuelkadolph> ablemike: What bi-law?
<cordoval> so Time.now.strftime(
<cordoval> ?
<ablemike> "i think it's also against freenode policy to log a channel without indicating in the channel topic,"
<cordoval> so Time.now.strftime('%Y%m%d')
<ablemike> i mean i understand the intent with that
<ablemike> but a public channel
<ablemike> I am logging this crap right now locally
<ablemike> I could do whatever I wanted with that log
<samuelkadolph> It's not against their policy
<ablemike> and who would know about that?
<samuelkadolph> He took that part out of context
<ablemike> aahhh ok. I wasn't sure if it was.
<samuelkadolph> Freenode has almost no policy whatsoever for your channels
dv310p3r joined #ruby
<ablemike> whitequark: log that shit :)
<ablemike> and publish it
<samuelkadolph> What he copied is from their channel guidelines page which is just a list of suggestions for helping your channel grow
<ablemike> and feed google please
<samuelkadolph> Indeed
<ablemike> <rue> It's the internet. Unless expressly designated private, it's not. And probably not then either
<samuelkadolph> I've been helped a few times by random irc logs that mentioned the same internet
<ablemike> spot on
<samuelkadolph> error* lol
<ablemike> log that shit and make t-shirts
LiquidInsect joined #ruby
<whitequark> ablemike: well that's what I'm slowly beginning to think is the right way
<ablemike> you know whats funny
<cordoval> it works
<cordoval> thanks guys
cordoval left #ruby
<ablemike> searching banister freenode
<samuelkadolph> lol And he gisted it
<ablemike> about an hour ago
Mothore joined #ruby
dasfugufish joined #ruby
burgestrand joined #ruby
<Mothore> Anybody remember the website that allowed users to modify other's code to make it smaller and smaller?
<ablemike> refactor my code
<ablemike> and it's been overrun
<ablemike> by bots
<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"
<glacius> here is my issue its not finding or replacing that section of the string http://pastebin.com/uQHRrYiA
<LiquidInsect> glacius: what does the full string you're running gsub on look like?
luminare joined #ruby
froy joined #ruby
<LiquidInsect> ciupicri: I think the code I gave you ealier should work for that case
zanaga joined #ruby
<glacius> LiquidInsect http://pastebin.com/ne9wTFAv
<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> `gem which heroku`
<durre> aha, its a command :)
<durre> samuelkadolph: /usr/local/Cellar/ruby/1.9.2-p290/lib/ruby/gems/1.9.1/gems/heroku-2.14.0/lib/heroku.rb
mengu joined #ruby
mengu joined #ruby
<samuelkadolph> ruby from brew, interesting
<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
<durre> samuelkadolph: https://gist.github.com/1371087
<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.
<Mon_Ouie> littlebill902: array[1..-1].each { … }
<chronos> this should be a gem?
Jake232 joined #ruby
<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
<shadoi> array.shift
<BoomerET> newArray = oldArray[1..-1]
<samuelkadolph> Closest to chomp would be compact to remove nil elements
<shadoi> shift just removes and returns the first element
otakutomo joined #ruby
skrite joined #ruby
<skrite> hey all
gentz joined #ruby
vandemar joined #ruby
cogman joined #ruby
zomgbie joined #ruby
<cogman> If I have an array of fixed length arrays, is there any way to cleanly iterate over them? Something like items.each do |a, b, c, d|?
<skrite> if i use system "some command" how do i get my script to halt until the system command is finished
hashbangchris joined #ruby
<cogman> skrite: use backticks. So `some command` That will halt the script until some command finishes.
kevinbond joined #ruby
Indian joined #ruby
<samuelkadolph> cogman: items.each do |(a,b,c,d)|
<cogman> samuelkadolph: lol, thanks (are you following me :D)?
rickmasta joined #ruby
<LiquidInsect> win 2
<LiquidInsect> ekjfbkl
<LiquidInsect> typing fail
<skrite> cogman: thanks
<lectrick> samuelkadolph: Is that parentheses inside vertical bar syntax new?
<samuelkadolph> No
<lectrick> heh. ruby, y u no stop learning me?
stephenjudkins joined #ruby
<samuelkadolph> It's quite useful if you like obscure code. [[1,2],[3,4]].each_with_object("") { |(a,b),str| }
NotreDev joined #ruby
<lectrick> nice.
* ccooke bangs his head against another batch of CVs
<ccooke> eek. Wrong window.
MasterIdler_ joined #ruby
<samuelkadolph> lol
BiHi joined #ruby
virunga joined #ruby
sdavis joined #ruby
Targen joined #ruby
j3r0m3 joined #ruby
rushed joined #ruby
blueadept joined #ruby
<blueadept> how can you generate an array of numbers with a beginning number like 1, and ending number like 20?
<blueadept> i thought it was something like b = [1..20]
julian-delphiki joined #ruby
<blueadept> but that comes back nil
whitequark joined #ruby
<robyurkowski> Array(1..20) works
<burgestrand> b = [1..20]
<burgestrand> => [1..20]
<blueadept> ah
<apeiros_> [*1..20]
iocor joined #ruby
<apeiros_> Array.new(20) { |i| i+1 }
wyhaines joined #ruby
<whitequark> the |(...)| syntax was not supported in 1.8
<apeiros_> whitequark: incorrect.
<blueadept> awesome
<blueadept> ty
<whitequark> hm
<workmad3> blueadept: (1..20).each or 1.upto(20) will also work if you just want to iterate over that lot
<apeiros_> good point
<apeiros_> i prefer 1.upto(20)
<blueadept> thats a good one too
hashbangchris joined #ruby
<samuelkadolph> (1..20).to_a
tshauck joined #ruby
<whitequark> apeiros_: ok. it was supported, but it had different semantics
<apeiros_> whitequark: please elaborate
<whitequark> sure
j3r0m3__ joined #ruby
fayimora joined #ruby
<whitequark> apeiros_: http://pastie.org/2874714
<whitequark> I may be missing something, but at the moment it looks like |()| in 1.8 is a no-op
<whitequark> also the tests in 1.9 include a lot of decomposition checks, but 1.8 ones do not
<apeiros_> that's odd… I'm quite sure that was differently. I wonder whether they changed/broke it in 1.8.7 (weird release in many regards)
<whitequark> ahh okay, I'll build 1.8.6 then
Draco_ joined #ruby
<samuelkadolph> Looks like 1.8.7 doesn't behave the same for just args in ()
Spockz joined #ruby
<samuelkadolph> proc { |(a,b),c| p a; p b; p c }.call([1,2],3) works fine in 1.8.7
<apeiros_> hm, I was also quite sure that it was lambda which did the args check and not proc… weird. I hope it's not my memory that fails here…
skrite joined #ruby
<whitequark> apeiros_: http://pastie.org/2874714
<whitequark> exactly the same in 1.8.6
<samuelkadolph> proc cares about the arity in 1.8
<workmad3> isn't that because the proc() method returns a lambda though?
<apeiros_> hm, ok, seems I missremember then.
<apeiros_> workmad3: there's only Proc as class
<samuelkadolph> The () inside proc args works fine in 1.8(.7), it's proc that changed
fayimora_ joined #ruby
<workmad3> apeiros_: http://www.ruby-doc.org/core-1.8.7/Kernel.html#method-i-proc <-- that puts proc() and lambda() as exactly the same, with arity checks
<whitequark> proc{} and proc{||} are not the same. proc{...} and lambda{...} are same. Proc.new {...} is different.
<whitequark> just checked everything.
<apeiros_> ah well, 1.8 is dead and buried.
<samuelkadolph> Agreed
<samuelkadolph> Long live 1.9
<apeiros_> indeed
<samuelkadolph> Until 2.0
iocor joined #ruby
<workmad3> whitequark: it changes in 1.9... proc{} and lambda{} are different now :)
<samuelkadolph> Then I hope it dies a quicker death
<whitequark> workmad3: I know
* apeiros_ wants collations
* apeiros_ wants ?. syntax
eggs joined #ruby
* apeiros_ wants dbc
<whitequark> dbc?
<samuelkadolph> I'd love the null-coalescing operator http://msdn.microsoft.com/en-us/library/ms173224.aspx
<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?
ezkl joined #ruby
<C|S> #rubyonrails
<epochwolf|vps> syllogism: #rubyonrails
<syllogism> thanks
John_P joined #ruby
<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
ali_h joined #ruby
milkshakes joined #ruby
<samuelkadolph> Sure you can
<whitequark> samuelkadolph: i.e. here is rb_warn: http://rxr.whitequark.org/mri/source/error.c#196 and here is how it's typically called: http://rxr.whitequark.org/mri/source/bignum.c#3079
<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