apeiros_ changed the topic of #ruby-lang to: Ruby 1.9.3-p327: http://ruby-lang.org (ruby-2.0.0-preview2) || Paste >3 lines of text on http://gist.github.com
<iosctr> whitequark: I think you'll need to write your own "success?" method; creating an array of status codes or classes, then checking that the response.code or #is_a? class is included.
<whitequark> iosctr: when Net::HTTPSuccess works fine
<whitequark> `when Net::HTTPSuccess', that is.
<zzak> response.is_a? Net::HTTPSuccess
<iosctr> that would be true for status codes 2xx - so, it just depends on your request and what you'll accept as "successful" :)
AlHafoudh has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
wyhaines has joined #ruby-lang
thufir_ has quit [Remote host closed the connection]
wyhaines has quit [Remote host closed the connection]
apeiros_ has joined #ruby-lang
leopard_me has quit [Quit: Computer has gone to sleep.]
apeiros_ has quit [Remote host closed the connection]
<whitequark> iosctr: well, 2xx does mean "success" :)
<iosctr> whitequark: some 3xx may be considered successful as well - and even some 2xx may not, depending (like NoContent)
kurko_ has joined #ruby-lang
<whitequark> iosctr: well, in this particular case I'm making a request to a RESTful API
<whitequark> so 3xx is quite definitely not success
<iosctr> then you just need to be aware of what their API will return under specific circumstances.
<iosctr> and some don't away document the response for all edge cases ;)
<iosctr> you could go with that, but be sure to log any failures with some response info, so you'll know.
charliesome has joined #ruby-lang
<whitequark> yeah, that's what I do
<iosctr> you might also look at some other http libraries, like faraday. Been working with that recently - I like it.
<whitequark> iosctr: I'm posting to twitter
<whitequark> it's 300 LOC complete with some app-specific logic, so I'm satisfied with that
<whitequark> I'm unlikely to ever need more than the 3 requests I do now
srbaker has quit [Quit: Computer has gone to sleep.]
Hakon has quit [Quit: Leaving...]
srbaker has joined #ruby-lang
mwjcomputing has joined #ruby-lang
io_syl has quit [Quit: Computer has gone to sleep.]
<iosctr> well, I should say that faraday is a wrapper around Net::HTTP, Excon (used by Fog), etc...
<iosctr> be aware, however, that faraday-middleware (mentioned by many blog posts) is behind/not-compatible-with the current master (0.9.0-pre) branch of faraday - FYI.
imajes has quit [Excess Flood]
imajes has joined #ruby-lang
<matti> Eh.
<whitequark> iosctr: thanks
leopard_me has joined #ruby-lang
<zzak> 3xx is HTTPRedirection
<zzak> they are separate
<theoros> i'm getting reset connections trying to push a newly built gem. adding credentials seems to have worked fine
sepp2k1 has quit [Remote host closed the connection]
faustman has quit [Ping timeout: 245 seconds]
<havenn> theoros: I was having problems pushing a gem earlier today then I realized I had installed RubyGems 2.0.0.preview2.2
<theoros> still on 1.8.24 here
guns has quit [Ping timeout: 250 seconds]
briantrust has joined #ruby-lang
<theoros> hm, rbx-head :)
<theoros> drbrain: for what it's worth, rubinius 2.0.0rc1 hangs at this line when `gem push`ing: POST https://rubygems.org/api/v1/gems
<whitequark> theoros: just fyi, I never was able to successfully push a gem with rbx for some reason
<zzak> theoros: i would file a ticket
marr has quit [Ping timeout: 265 seconds]
seanstickle has joined #ruby-lang
guns has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
wallerdev has joined #ruby-lang
lcdhoffman has joined #ruby-lang
postmodern has quit [Quit: Leaving]
srbaker has quit [Quit: Computer has gone to sleep.]
srbaker has joined #ruby-lang
jcr has quit [Quit: Leaving]
crazyhorse has joined #ruby-lang
crazyhorse has left #ruby-lang ["Leaving..."]
havenn has quit [Remote host closed the connection]
havenn has joined #ruby-lang
mwjcomputing has quit [Ping timeout: 264 seconds]
apeiros_ has joined #ruby-lang
Bosox20051 has joined #ruby-lang
synaesthetik has joined #ruby-lang
havenn has quit [Ping timeout: 264 seconds]
apeiros_ has quit [Ping timeout: 260 seconds]
imajes has quit [Excess Flood]
imajes has joined #ruby-lang
BigO_ has joined #ruby-lang
BigO_ has quit [Remote host closed the connection]
jsilver has joined #ruby-lang
glebm has joined #ruby-lang
wycats has quit [Ping timeout: 246 seconds]
robotmay has quit [Ping timeout: 245 seconds]
andrewhl has quit [Remote host closed the connection]
wycats has joined #ruby-lang
banisterfiend has joined #ruby-lang
gsav has quit [Read error: Connection reset by peer]
iosctr has quit [Quit: Konversation terminated!]
<drbrain> theoros: yes, please file one including --debug output
jackhammer2022 has quit [Ping timeout: 245 seconds]
io_syl has joined #ruby-lang
coliflor_ has joined #ruby-lang
synaesthetik has left #ruby-lang [#ruby-lang]
coliflor has quit [Ping timeout: 245 seconds]
havenn has joined #ruby-lang
kurko_ has quit [Ping timeout: 264 seconds]
havenn has quit [Ping timeout: 255 seconds]
mercwithamouth has joined #ruby-lang
guns has quit [Quit: guns]
jackhammer2022 has joined #ruby-lang
brianpWins has quit [Quit: brianpWins]
jackhammer2022 has quit [Ping timeout: 245 seconds]
lcdhoffman has quit [Quit: lcdhoffman]
havenn has joined #ruby-lang
havenn has quit [Read error: Connection reset by peer]
havenn has joined #ruby-lang
gsav has joined #ruby-lang
guns has joined #ruby-lang
lcdhoffman has joined #ruby-lang
madish has quit [Quit: ChatZilla 0.9.89 [Firefox 16.0.1/20121026125834]]
mwjcomputing has joined #ruby-lang
srbaker has quit [Quit: Computer has gone to sleep.]
lcdhoffman has quit [Client Quit]
leopard_me has quit [Quit: Computer has gone to sleep.]
srbaker has joined #ruby-lang
kennyvb has quit [Ping timeout: 255 seconds]
mwjcomputing has quit [Ping timeout: 245 seconds]
io_syl has quit [Quit: Computer has gone to sleep.]
jackhammer2022 has joined #ruby-lang
faces has joined #ruby-lang
kennyvb has joined #ruby-lang
reppard has joined #ruby-lang
seanstickle has quit [Quit: seanstickle]
imajes has quit [Remote host closed the connection]
jackhammer2022 has quit [Ping timeout: 264 seconds]
jackhammer2022 has joined #ruby-lang
imperator has quit [Ping timeout: 260 seconds]
havenn has quit [Read error: No route to host]
havenn has joined #ruby-lang
S1kx has quit [Ping timeout: 248 seconds]
guns has quit [Ping timeout: 265 seconds]
io_syl has joined #ruby-lang
banisterfiend has quit [Ping timeout: 264 seconds]
imajes has joined #ruby-lang
srbaker has quit [Quit: Computer has gone to sleep.]
guns has joined #ruby-lang
swaits has joined #ruby-lang
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
Mon_Ouie has quit [Ping timeout: 264 seconds]
Mon_Ouie has joined #ruby-lang
manveru has quit [Ping timeout: 244 seconds]
andrewhl has joined #ruby-lang
setmeaway2 has joined #ruby-lang
io_syl has quit [Quit: Computer has gone to sleep.]
setmeaway has quit [Ping timeout: 265 seconds]
postmodern has joined #ruby-lang
aef has quit [Remote host closed the connection]
aef has joined #ruby-lang
mercwithamouth has quit [Ping timeout: 265 seconds]
reppard has quit [Quit: leaving]
havenn has quit [Remote host closed the connection]
guns has quit [Quit: guns]
io_syl has joined #ruby-lang
io_syl has quit [Client Quit]
io_syl has joined #ruby-lang
waffleau has joined #ruby-lang
voker57 has joined #ruby-lang
mercwithamouth has joined #ruby-lang
jackhammer2022 has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
wallerdev has quit [Quit: wallerdev]
wallerdev has joined #ruby-lang
Nisstyre has joined #ruby-lang
Z_Mass has joined #ruby-lang
kurko_ has joined #ruby-lang
sent-hil has joined #ruby-lang
sent-hil has quit [Remote host closed the connection]
sullenel has joined #ruby-lang
sullenel has quit [Client Quit]
kurko_ has quit [Ping timeout: 265 seconds]
sush24 has joined #ruby-lang
waffleau has quit [Quit: waffleau]
jaimef has quit [Ping timeout: 276 seconds]
gjaldon has joined #ruby-lang
Z_Mass has quit [Quit: WeeChat 0.3.9.2]
<gjaldon> hi all. is there a big difference in time it takes to test between rspec 2 and minitest?
manveru has joined #ruby-lang
<gjaldon> Also, i've set up a mailer method which uses MailGun API to send mails. It's working as intended but spec returns a failure
<gjaldon> Could anyone help on how to make the spec work? here's the gist:
jashank has quit [Excess Flood]
jashank has joined #ruby-lang
jashank has quit [Excess Flood]
jashank has joined #ruby-lang
jashank has quit [Changing host]
jashank has joined #ruby-lang
rippa has joined #ruby-lang
jsilver has quit [Ping timeout: 264 seconds]
voker57 has quit [Ping timeout: 245 seconds]
xalei has joined #ruby-lang
voker57 has joined #ruby-lang
voker57 has quit [Changing host]
voker57 has joined #ruby-lang
swaits has quit [Quit: swaits]
<rue> gjaldon: You may want to ask on #rubyonrails, too. Doesn’t actionmailer have some kind of a mock thing?
faustman has joined #ruby-lang
robotmay has joined #ruby-lang
<ryanf> gjaldon: that seems like not the way to set up what you're trying to do
<ryanf> at the moment you're inheriting from ActionMailer and not using any of its capabilities whatsoever
<ryanf> (the reason your spec isn't working though is that let(:mail) is lazy, so you would need to actually call "mail" in your spec in order for anything to happen)
xalei has quit [Quit: Leaving]
xalei has joined #ruby-lang
dzhulk has joined #ruby-lang
chendo_ has joined #ruby-lang
voker57 has quit [Ping timeout: 250 seconds]
mercwithamouth has quit [Ping timeout: 248 seconds]
stardiviner has joined #ruby-lang
faustman has quit [Ping timeout: 248 seconds]
mistym has quit [Remote host closed the connection]
sush24 has quit [Quit: This computer has gone to sleep]
Bosox20051 has quit [Ping timeout: 264 seconds]
<zenspider> gjaldon: there was the last time I measured... but it has been a while
robotmay has quit [Remote host closed the connection]
marr has joined #ruby-lang
faces has quit [Ping timeout: 244 seconds]
faces has joined #ruby-lang
Nisstyre has quit [Read error: Connection reset by peer]
Croms has quit [Quit: Croms]
faces has quit [Ping timeout: 248 seconds]
xalei has quit [Remote host closed the connection]
sepp2k has joined #ruby-lang
<gjaldon> thanks for the responses ryanf and zenspider. zenspider: which was faster? minitest?
<zenspider> gjaldon: last time I measured minitest by a long shot.
<gjaldon> zenspider: thanks a lot! will try out minitest then
kurko_ has joined #ruby-lang
<zenspider> gjaldon: enjoy
<gjaldon> ryanf: how do I call "mail" inside my spec? i tried removing the inheritance from ActionMailer but when I do that, I can't call the registration_confirmation method from my controller. What's the work-around for that?
<charliesome> is there a good way to express multiple 'overloads' with rdoc?
<zenspider> charliesome: overloads?
tockitj_ has joined #ruby-lang
<charliesome> zenspider: so if i have a method that does different things based on whether it's passed a symbol, string or proc
<charliesome> i know i can have multiple call-seqs, but i'd like to write a different bit of documentation for each call-seq
<zenspider> not sure about that. I just use good english doco so I'd describe all the uses for a given argument in a single paragraph that spells them all out
<zenspider> there are ul and dl markups too if you'd rather it be more structured
<zenspider> you said call-seqs... are you writing this in C?
<charliesome> nah ruby
vlad_starkov has joined #ruby-lang
<charliesome> yeah i took a look at that
<zenspider> you might want to go the tomdoc route
<zenspider> oh interesting... I've only used call-seq for C ... didn't know you could do it for ruby too.
<zenspider> but they don't produce separate doco entries ... just augment the summary at the top of the doco block... so it'd still be the english side that you'd do this in
<charliesome> alright, so i may as well just focus on writing nice english docos
S1kx has joined #ruby-lang
S1kx has quit [Changing host]
S1kx has joined #ruby-lang
toretore has joined #ruby-lang
<zenspider> charliesome: sorry I couldn't be more help
qwerxy has joined #ruby-lang
<charliesome> no worries
ebouchut has joined #ruby-lang
kurko_ has quit [Ping timeout: 265 seconds]
ebouchut has quit [Quit: This computer has gone to sleep]
adambeynon has joined #ruby-lang
imperator has joined #ruby-lang
tdy has quit [Remote host closed the connection]
thone has joined #ruby-lang
kiritoSAO has joined #ruby-lang
kiritoSAO has quit [Client Quit]
thone_ has quit [Ping timeout: 245 seconds]
sush24 has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
kirin` has quit [Ping timeout: 246 seconds]
Boohbah has quit [Ping timeout: 246 seconds]
apeiros_ has joined #ruby-lang
kirin` has joined #ruby-lang
MaddinXx_ has joined #ruby-lang
leopard_me has joined #ruby-lang
spike|spiegel has joined #ruby-lang
qwerxy has quit [Quit: offski]
io_syl has quit [Quit: Computer has gone to sleep.]
stonerfish has quit [Ping timeout: 276 seconds]
dzhulk has quit [Quit: Leaving.]
jxie has quit [Quit: leaving]
stonerfish has joined #ruby-lang
stonerfish has quit [Client Quit]
coliflor has joined #ruby-lang
coliflor_ has quit [Ping timeout: 245 seconds]
faustman has joined #ruby-lang
beiter has joined #ruby-lang
vlad_starkov has quit [Remote host closed the connection]
madish has joined #ruby-lang
nXqd has joined #ruby-lang
vlad_starkov has joined #ruby-lang
vlad_starkov has quit [Remote host closed the connection]
qwerxy has joined #ruby-lang
qwerxy has quit [Client Quit]
faces has joined #ruby-lang
qwerxy has joined #ruby-lang
qwerxy has quit [Client Quit]
<whitequark> ok, now I have this moronic social network whose API does not allow web applications to post stuff via OAuth unless they can violate same-origin policy somehow
<whitequark> what's the best headless browser to install on a production server?
nXqd has quit [Ping timeout: 252 seconds]
ebouchut has joined #ruby-lang
lcdhoffman has joined #ruby-lang
beiter has quit [Quit: beiter]
x0F has quit [Disconnected by services]
x0F_ has joined #ruby-lang
x0F_ is now known as x0F
Nisstyre-laptop has quit [Ping timeout: 250 seconds]
adambeynon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
AndChat| has quit [Ping timeout: 245 seconds]
ebouchut has quit [Quit: This computer has gone to sleep]
Banistergalaxy has joined #ruby-lang
charliesome has quit [Quit: Textual IRC Client: www.textualapp.com]
ebouchut has joined #ruby-lang
agarie has quit [Remote host closed the connection]
ebouchut has quit [Quit: This computer has gone to sleep]
sush24 has quit [Ping timeout: 264 seconds]
meatballhat has joined #ruby-lang
meatballhat has quit [Changing host]
meatballhat has joined #ruby-lang
sush24 has joined #ruby-lang
<yorickpeterse> Fuck yeah, my parser parses stdlib again
bjensen has joined #ruby-lang
gaveen has joined #ruby-lang
gaveen has quit [Changing host]
gaveen has joined #ruby-lang
rsl has joined #ruby-lang
imperator has quit [Read error: Connection reset by peer]
meatballhat has quit [Ping timeout: 246 seconds]
mwjcomputing has joined #ruby-lang
methods has joined #ruby-lang
methods has left #ruby-lang [#ruby-lang]
powershellyoda has joined #ruby-lang
gaveen has quit [Remote host closed the connection]
powershellyoda has quit [Quit: Leaving]
JohnBat26 has joined #ruby-lang
<manveru> whitequark: i think phantomjs maybe
qwerxy has joined #ruby-lang
<manveru> but depends on what you mean with "best" :)
<manveru> sometimes you need selenium, but that requires xvfb
meatballhat has joined #ruby-lang
meatballhat has joined #ruby-lang
meatballhat has quit [Changing host]
burge has joined #ruby-lang
lcdhoffman has quit [Quit: lcdhoffman]
qwerxy has quit [Quit: offski]
<gjaldon> hi all. any idea on how to fix my spec? I'm using mailgun api to send an email and email is being sent and test should pass. Something wrong with my spec though
jxie has joined #ruby-lang
qwerxy has joined #ruby-lang
<gjaldon> I was advised by ryanf earlier that I need to call "mail" in my spec. How do I do that?
<rue> gjaldon: When you use let, it’s basically def mail(); stuff you put inside the definition; end
<gjaldon> Also, I'm not using any functions of ActionMailer but have my RegistrationMailer class inherit from "ActionMailer". I tried removing that before but then I couldn't call RegistrationMailer.registration_confirmation from a controller
qwerxy has quit [Client Quit]
srbaker has joined #ruby-lang
<gjaldon> rue: I see. So I need to call the mail method inside my spec? I tried adding a line with just "mail" but didn't work
jtoy has joined #ruby-lang
<rue> If you wish to actually use whatever you do in it, yes
<rue> You don’t *need* to use a let
MrWibbles has joined #ruby-lang
MrWibbles has quit [Quit: Leaving...]
MrWibbles has joined #ruby-lang
<MrWibbles> hey.. erm
swav has quit [Remote host closed the connection]
<MrWibbles> find a * in an array of string
<MrWibbles> ![].grep(/*/).empty?
<gjaldon> rue: tried removing let and I still get the same error
<MrWibbles> works.. but not that pretty
<apeiros_> /*/ does not raise?
<apeiros_> for me, /*/ raises, because it's not a valid regexp
<MrWibbles> sorry /\*/
swav has joined #ruby-lang
<gjaldon> here's how my spec looks like now:
<apeiros_> ary.any? { |str| str.include?('*') }
<MrWibbles> !['*'].grep(/\*/).empty?
<apeiros_> ary.enum_for(:grep, /\*/).any?
<MrWibbles> ['*'].grep(/\*/).length > 0
<MrWibbles> hmm
<apeiros_> .any? shortcuts
meatballhat has quit [Ping timeout: 245 seconds]
<apeiros_> that's why I used enum_for, otherwise I could have gone with plain grep:
<apeiros_> ary.grep(/\*/).any?
<MrWibbles> ohh yeah
<apeiros_> but that'll test every item, even when one matched already
<MrWibbles> :(
<MrWibbles> if search_key_array.include?('*') || search_key_array.include?('**')
<MrWibbles> my bro wants this
<MrWibbles> says it's more obvious
<apeiros_> it's not the same
<MrWibbles> yeah. thats the exact test
<MrWibbles> we are checking for * or **
<MrWibbles> '*' or '**'
<apeiros_> but then your previous test was not correct
<MrWibbles> we're doing the whole
<apeiros_> your "bro"'s test is correct
<MrWibbles> yeah it would match 'a*'
<MrWibbles> but none of our other strings have *'s in them
<MrWibbles> haha.. he's actually my bro
<apeiros_> your regex would have to be /\A\*\*?\z/
<MrWibbles> this is for the
<apeiros_> ah, real bro for once :)
<MrWibbles> {some masssive hash}.search('element/element/*/something/**/any_node') code
<MrWibbles> so you can do hash.search('something/**/*').reject
<apeiros_> ah, you're the guy with the Hash#search, I remember
<MrWibbles> hash.search('/something/*').reject {|key, value, parent| value == 'cats'}
<MrWibbles> yeah
<MrWibbles> we decided to make it return a search object
<MrWibbles> so we could shove
<MrWibbles> more methods on the search object response
<MrWibbles> and make it easier to read
gjaldon has quit [Quit: Leaving]
jtoy has quit [Quit: jtoy]
chaosis has joined #ruby-lang
imperator2 has joined #ruby-lang
vlad_starkov has joined #ruby-lang
sent-hil has joined #ruby-lang
sent-hil has quit [Remote host closed the connection]
nick_h has quit [Ping timeout: 256 seconds]
vlad_sta_ has joined #ruby-lang
MrWibbles has quit [Remote host closed the connection]
vlad_starkov has quit [Ping timeout: 260 seconds]
Hakon has joined #ruby-lang
nick_h has joined #ruby-lang
neocoin has quit [Remote host closed the connection]
Banistergalaxy has quit [Ping timeout: 245 seconds]
La0fer has joined #ruby-lang
dzhulk has joined #ruby-lang
La0fer has quit [Ping timeout: 245 seconds]
intellitech has joined #ruby-lang
srbaker has quit [Quit: Computer has gone to sleep.]
meatballhat has joined #ruby-lang
meatballhat has joined #ruby-lang
meatballhat has quit [Changing host]
Banistergalaxy has joined #ruby-lang
Croms has joined #ruby-lang
leopard_me has quit [Quit: Computer has gone to sleep.]
faces has quit [Ping timeout: 248 seconds]
facest has joined #ruby-lang
leopard_me has joined #ruby-lang
facest has quit [Ping timeout: 244 seconds]
leopard_me has quit [Client Quit]
havenn has joined #ruby-lang
burge has quit [Quit: Computer has gone to sleep.]
havocjoseph has joined #ruby-lang
srbaker has joined #ruby-lang
mercwithamouth has joined #ruby-lang
Mellett68_ has left #ruby-lang [#ruby-lang]
Mellett68 has joined #ruby-lang
naquad has quit [Ping timeout: 252 seconds]
naquad has joined #ruby-lang
naquad has quit [Max SendQ exceeded]
naquad has joined #ruby-lang
ebouchut has joined #ruby-lang
dzhulk has quit [Quit: Leaving.]
intellitech has quit [Quit: intellitech]
qwerxy has joined #ruby-lang
meatballhat has quit [Ping timeout: 245 seconds]
ddd has joined #ruby-lang
MaddinXx_ has quit [Remote host closed the connection]
dzhulk has joined #ruby-lang
meatballhat has joined #ruby-lang
postmodern has quit [Quit: Leaving]
mwjcomputing has quit [Ping timeout: 250 seconds]
kuja has quit [Quit: ZNC - http://znc.sourceforge.net]
krohrbaugh has quit [Quit: Leaving.]
kuja has joined #ruby-lang
vlad_sta_ has quit [Remote host closed the connection]
krohrbaugh has joined #ruby-lang
sent-hil has joined #ruby-lang
leopard_me has joined #ruby-lang
Guest____ has joined #ruby-lang
Mon_Ouie has quit [Ping timeout: 264 seconds]
<Guest____> what's the easiest way to launch a long running process in the background, and retain the pid? if i use IO.popen, it runs the cmd in a shell, and returns the pid of the shellm which is not what i want
<Guest____> i tried using 'exec <cmd>', but this doesn't seems to work on linux ubuntu
<apeiros_> I think the modern way to launch subprocesses is Kernel#spawn
sent-hil has quit [Remote host closed the connection]
<Guest____> Process.spawn?
lcdhoffman has joined #ruby-lang
<Guest____> it's not available on 1.8.7, right?
CaptainJet has joined #ruby-lang
dzhulk has quit [Quit: Leaving.]
<apeiros_> Guest____: no, if you're still on 1.8, you should really move up to 1.9
<apeiros_> Kernel#spawn is the same as Process::spawn btw.
dzhulk has joined #ruby-lang
<Guest____> thanks
vlad_starkov has joined #ruby-lang
<Guest____> it seems Process.spawn is also running the cmd in a shell. ps shows tow process, one one is a 'sh', and the pid of this shell is what spawn returns
<Guest____> *two processes
imperator2 has quit [Ping timeout: 264 seconds]
leopard_me has quit [Quit: Computer has gone to sleep.]
qwerxy has quit [Quit: offski]
sepp2k has quit [Ping timeout: 245 seconds]
rsl has quit [Quit: Computer has gone to sleep.]
<apeiros_> Guest____: you called it with a single string or with an array?
<apeiros_> with an array should bypass the shell
<apeiros_> with a string it must use a shell
<Guest____> yes i was just looking into the docs
sepp2k has joined #ruby-lang
krohrbaugh has quit [Quit: Leaving.]
meatballhat has quit [Ping timeout: 245 seconds]
srbaker has quit [Quit: Computer has gone to sleep.]
sush24 has quit [Ping timeout: 255 seconds]
sush24 has joined #ruby-lang
workmad3 has joined #ruby-lang
kurko_ has joined #ruby-lang
krohrbaugh has joined #ruby-lang
robotmay has joined #ruby-lang
io_syl has joined #ruby-lang
Mellett68 has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
imajes has quit [Excess Flood]
imajes has joined #ruby-lang
banisterfiend has joined #ruby-lang
tdy has joined #ruby-lang
faces has joined #ruby-lang
faces has quit [Ping timeout: 244 seconds]
workmad3 has quit [Ping timeout: 255 seconds]
leopard_me has joined #ruby-lang
JohnBat26 has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
banisterfiend has quit [Remote host closed the connection]
intellitech has joined #ruby-lang
burge has joined #ruby-lang
briantrust has quit [Remote host closed the connection]
dzhulk has quit [Quit: Leaving.]
dzhulk has joined #ruby-lang
srbaker has joined #ruby-lang
ebouchut has quit [Quit: This computer has gone to sleep]
kalleth has quit [Remote host closed the connection]
kurko_ has quit [Ping timeout: 246 seconds]
faustman has quit [Ping timeout: 248 seconds]
kalleth has joined #ruby-lang
havenn has quit [Remote host closed the connection]
kalleth has quit [Remote host closed the connection]
kalleth has joined #ruby-lang
srbaker has quit [Quit: Computer has gone to sleep.]
srbaker has joined #ruby-lang
burge has quit [Quit: Textual IRC Client: www.textualapp.com]
vlad_starkov has quit [Remote host closed the connection]
meatballhat has joined #ruby-lang
bentis has quit [Quit: Lost terminal]
stonerfish has joined #ruby-lang
briantrust has joined #ruby-lang
S1kx has quit [Read error: Connection reset by peer]
Nisstyre has joined #ruby-lang
S1kx has joined #ruby-lang
S1kx has quit [Changing host]
S1kx has joined #ruby-lang
adambeynon has joined #ruby-lang
KA__ has joined #ruby-lang
headius has joined #ruby-lang
stonerfish has quit [Quit: Leaving.]
KA__ has quit [Client Quit]
schaerli has joined #ruby-lang
glebm has quit [Quit: Computer has gone to sleep.]
lcdhoffman has quit [Quit: lcdhoffman]
lcdhoffman has joined #ruby-lang
wyhaines has joined #ruby-lang
sn0wb1rd has quit [Quit: sn0wb1rd]
sn0wb1rd has joined #ruby-lang
wmoxam has quit [Quit: leaving]
Mon_Ouie has joined #ruby-lang
srbaker has quit [Quit: Computer has gone to sleep.]
stonerfish has joined #ruby-lang
mistym has joined #ruby-lang
mistym has joined #ruby-lang
mistym has quit [Changing host]
jaimef has joined #ruby-lang
stonerfish has quit [Client Quit]
srbaker has joined #ruby-lang
dzhulk has quit [Quit: Leaving.]
robotmay_ has joined #ruby-lang
robotmay has quit [Read error: Connection reset by peer]
robotmay_ has quit [Read error: Connection reset by peer]
robotmay has joined #ruby-lang
kurko_ has joined #ruby-lang
faustman has joined #ruby-lang
rippa has quit [Ping timeout: 248 seconds]
rippa has joined #ruby-lang
bampersand has joined #ruby-lang
<bampersand> Hey guys. i'm trying to use the example from http://www.ruby-doc.org/stdlib-1.9.3/libdoc/rss/rdoc/RSS.html .. however when I use a different URL i'm getting an error: incompatible character encodings: ASCII-8BIT and UTF-8 (Encoding::CompatibilityError)
<bampersand> I tried googling but can't find anything specific. or where I should be forcing an encoding
<apeiros_> bampersand: by "the example", I assume you mean the first one?
<bampersand> Yeah, sorry about that.
<apeiros_> care to paste the *precise* error you get?
<bampersand> the only thing I changed was the url rss feed
marr has quit [Ping timeout: 256 seconds]
<apeiros_> you know, with backtrace and stuff…
<bampersand> C:/Ruby193/lib/ruby/1.9.1/rexml/source.rb:162:in `initialize': incompatible char
<bampersand> acter encodings: ASCII-8BIT and UTF-8 (Encoding::CompatibilityError)
stardiviner has quit [Quit: my website: http://stardiviner.dyndns-blog.com/]
<bampersand> oh, okay i'll pastie the full one.
<apeiros_> line 5 in test.rb is `open(url) do |rss|` ?
<bampersand> yeah
<apeiros_> also, does the same error happen if you use the example's url?
<bampersand> i'll check
<bampersand> apeiros_: it works with the given example
<apeiros_> then please provide the url you're using.
<bampersand> the rss feed i'm using must have a different encoding, i don't know how to make it friendly though.
<apeiros_> ah damn, how did I get to the headers again with open-uri…
<apeiros_> data = open(url, &:read) # <-- funny data I get back from that url…
<bampersand> hmm, any ideas then.
<apeiros_> got to figure out how to get at the headers first, they should contain the encoding
<apeiros_> unless you happen to know the encoding…
<bampersand> I'm unsure how to do that.
<apeiros_> hm, "content-type"=>["application/rss+xml; charset=utf-8"],
Mon_Ouie has quit [Ping timeout: 272 seconds]
<apeiros_> seems to be utf-8, but the data looks odd
abstr4ct has joined #ruby-lang
<injekt> :)
<bampersand> so what exactly is the problem here? it's wanting ASCII-8BIT but instead it's getting UTF-8?
<abstr4ct> messin with nokogiri, and ive got this terrible thing..... seems it could be much simpler, any ideas? $texas = '//*[text()="Sunday:"]/following::div[1] | //*[text()="Sunday:"]/following::div[2]'
<abstr4ct> i want to just list multiple divs instead of piping the entire shit over and over. ugh
schaerli has quit [Remote host closed the connection]
<apeiros_> bampersand: no, the problem is worse, that website gives broken data
<apeiros_> it says its contents were utf-8
<apeiros_> but what it returns is not valid utf-8
<apeiros_> (or net/http and/or open-uri is horribly broken)
intellitech has quit [Quit: intellitech]
<bampersand> apeiros_: oh that's a shame.
<bampersand> I was in a creative mood and had a decent idea, alas back to nothing.
<apeiros_> bampersand: does the feed work with a normal feed reader?
sent-hil has joined #ruby-lang
<injekt> abstr4ct: xpath doesn't support what you'd like to do
<abstr4ct> hehe
<injekt> abstr4ct: which of course would be something like [1..2] or [1-2] [1,2]
<abstr4ct> yes, ive not had any luck
<injekt> abstr4ct: write the expression once and store it in a var instead? "#{v}[1] | #{v}[2]"
<bampersand> apeiros_: it worked when I tried it with firefox
<injekt> abstr4ct: might be a good question to ask stack overflow, though
dzhulk has joined #ruby-lang
<apeiros_> so we're at net/http and/or open-uri being horribly broken. that's bad.
<apeiros_> and yes, works here too in firefox.
<apeiros_> and reports utf-8.
<apeiros_> bampersand: I'd report it on the ruby mailing list
<apeiros_> I might be able to figure out what's going on, but that'd most likely cost me much much more time than what I'm willing to spend
<bampersand> apeiros_: if you're feeling generous that'd be great, if not thanks for the help.
<apeiros_> no, sorry, I've got some things to do today and am already running out of time
<bampersand> okay thanks.
Mon_Ouie has joined #ruby-lang
mercwithamouth has quit [Ping timeout: 255 seconds]
<injekt> abstr4ct: still there? I have an idea
<injekt> abstr4ct: '//*[text()="Sunday:"]/following::div[position()<=2]'
<injekt> abstr4ct: div[1] == div[position()=1]
<injekt> so that should work I guess
AndChat| has joined #ruby-lang
<injekt> and by 'i guess' i mean definitely
Guest____ has quit [Quit: Textual IRC Client: www.textualapp.com]
mercwithamouth has joined #ruby-lang
havenn has joined #ruby-lang
Banistergalaxy has quit [Ping timeout: 256 seconds]
zmack has joined #ruby-lang
wallerdev has joined #ruby-lang
tbuehlmann has joined #ruby-lang
nXqd has joined #ruby-lang
sush24 has quit [Read error: Connection reset by peer]
marr has joined #ruby-lang
stardiviner has joined #ruby-lang
voker57 has joined #ruby-lang
voker57 has quit [Changing host]
voker57 has joined #ruby-lang
adambeynon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
leopard_me has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
burgestrand1 has joined #ruby-lang
havocjoseph has left #ruby-lang [#ruby-lang]
burgestrand has quit [Ping timeout: 265 seconds]
KA_ has joined #ruby-lang
lcdhoffman has quit [Quit: lcdhoffman]
methods has joined #ruby-lang
glebm has joined #ruby-lang
sepp2k1 has joined #ruby-lang
methods has left #ruby-lang [#ruby-lang]
ddd has quit [Quit: Leaving.]
sepp2k has quit [Ping timeout: 264 seconds]
jtoy has joined #ruby-lang
ddd has joined #ruby-lang
headius has quit [Quit: headius]
robotmay has quit [Remote host closed the connection]
headius has joined #ruby-lang
headius has quit [Client Quit]
benanne has joined #ruby-lang
[Cupcakes] has joined #ruby-lang
<abstr4ct> yes i am here
<abstr4ct> was working on another idea about how to do it
<abstr4ct> but havnt worked it out yet
<abstr4ct> div[1] == div[position()=1] not following that part
Nisstyre has quit [Quit: Leaving]
<abstr4ct> yup that worked perfectly
<abstr4ct> here was what i was workin on
<abstr4ct> not as clean but also useful
<abstr4ct> '//*[text()="Saturday"]/following::p[not(preceding::*[text()="Sunday"])] '
<abstr4ct> heh
<abstr4ct> that p should be a div to be consistant with my example
sent-hil has quit [Remote host closed the connection]
[Cupcakes] has quit [Read error: Connection reset by peer]
[Cupcakes] has joined #ruby-lang
[Cupcakes] has quit [Max SendQ exceeded]
meatballhat has quit [Ping timeout: 272 seconds]
[Cupcakes] has joined #ruby-lang
[Cupcakes] has quit [Max SendQ exceeded]
[Cupcakes] has joined #ruby-lang
[Cupcakes] has quit [Max SendQ exceeded]
[Cupcakes] has joined #ruby-lang
[Cupcakes] has quit [Max SendQ exceeded]
MaddinXx has joined #ruby-lang
meatballhat has joined #ruby-lang
charliesome has joined #ruby-lang
apeiros_ has quit [Remote host closed the connection]
S1kx has quit [Remote host closed the connection]
S1kx has joined #ruby-lang
S1kx has quit [Changing host]
S1kx has joined #ruby-lang
zmack has quit [Remote host closed the connection]
My_Hearing has joined #ruby-lang
bjensen has quit [Quit: bjensen]
AndChat| has quit [Ping timeout: 272 seconds]
KA_ has quit [Read error: Connection reset by peer]
KA_ has joined #ruby-lang
Mon_Ouie has quit [Ping timeout: 272 seconds]
mistym has quit [Remote host closed the connection]
KA_ has quit [Quit: KA_]
srbaker has quit [Quit: Computer has gone to sleep.]
KA_ has joined #ruby-lang
tjadc has quit [Ping timeout: 256 seconds]
robotmay has joined #ruby-lang
seanstickle has joined #ruby-lang
Banistergalaxy has joined #ruby-lang
KA__ has joined #ruby-lang
KA_ has quit [Ping timeout: 250 seconds]
KA__ is now known as KA_
_Mon_Ouie_ has joined #ruby-lang
stonerfish has joined #ruby-lang
My_Hearing has quit [Ping timeout: 272 seconds]
MaddinXx has quit [Remote host closed the connection]
Mon_Ouie has joined #ruby-lang
_Mon_Ouie_ has quit [Ping timeout: 244 seconds]
abstr4ct has quit [Ping timeout: 272 seconds]
mjio has joined #ruby-lang
nXqd has quit [Ping timeout: 244 seconds]
kurko_ has quit [Ping timeout: 255 seconds]
havenn has quit [Remote host closed the connection]
havenn has joined #ruby-lang
havenn has quit [Read error: Connection reset by peer]
Mon_Ouie has quit [Ping timeout: 272 seconds]
wyhaines has quit [Remote host closed the connection]
cirenyc has joined #ruby-lang
tockitj_ has quit [Ping timeout: 264 seconds]
nertzy2 has quit [Quit: Leaving]
tockitj_ has joined #ruby-lang
nertzy has joined #ruby-lang
KA_ has quit [Quit: KA_]
KA_ has joined #ruby-lang
heftig has quit [Quit: leaving]
tbuehlmann has quit [Remote host closed the connection]
nXqd has joined #ruby-lang
toretore has quit [Quit: Leaving]
meatballhat has quit [Ping timeout: 272 seconds]
dzhulk has quit [Quit: Leaving.]
dzhulk has joined #ruby-lang
nXqd has quit [Ping timeout: 272 seconds]
joevandyk_ has joined #ruby-lang
mistym has joined #ruby-lang
mistym has joined #ruby-lang
mistym has quit [Changing host]
benanne has quit [Quit: kbai]
lcdhoffman has joined #ruby-lang
CaptainJet has quit []
<soahccc> Does anybody know if I can colorize CLI output "interpolation safe" somehow? As you cannot undo a color change in a terminal (just set a new color) there is no direct way to do something like "foo #{"bar".red} baz".yellow
methods has joined #ruby-lang
<soahccc> But I don't think this is possible with ruby, is it? Sort of knowing the future
<charliesome> soahccc: perhaps look into the paint gem
methods has left #ruby-lang [#ruby-lang]
<charliesome> not sure off the top of my head if it supports sanitising ansi escapes from strings
<badeball> soahccc: it is possible. you can write your own class that acts as a string, but you override the + (which concatenates them)
<soahccc> Hmm didn't know that interpolations will call #+
<badeball> well, at least it sounds possible in my head
<badeball> i have no idea if it does
<charliesome> interpolation does not call +
reppard has joined #ruby-lang
<soahccc> alternatively I could do a fake hacky sort of "foo %r{#{some_var}} bar".yellow
<drbrain> class String; def +(other) raise "no" end end; "a#{1}"
sn0wb1rd has quit [Quit: sn0wb1rd]
heftig has joined #ruby-lang
<charliesome> an #interpolated method would be handy
<charliesome> the rails guys could use it to extend safe buffer support into interpolation
<heftig> interpolated method?
<badeball> hmm, it does not seem like one can override rb_str_append, which makes it impossible to mess with the behavior of string interpolation.
<charliesome> badeball: load a c extension that overwrites rb_str_append with a trampoline into a patched version
faustman has quit [Read error: Operation timed out]
robotmay has quit [Remote host closed the connection]