<galaxie>
woodruff: It does, but RuboCop says it's a security hazard and while I don't think it might make a difference, I'd rather not get those annoying messages when they aren't relevant.
queip has quit [Read error: Connection reset by peer]
DTZUZO has quit [Read error: Connection reset by peer]
jrhorn424_away has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
DTZUZO has joined #ruby
queip has joined #ruby
lupine has joined #ruby
<nchambers>
what about net/http?
<galaxie>
nchambers: It's an idea, but it's also more low-level. I'm a bit lazy.
<galaxie>
How would I monkeypatch rand() so that every object uses the new method? I'm trying to monkeypatch Kernel#rand and that works but it does not carry over to rand().
gnufied has quit [Quit: Leaving]
elphe has quit [Ping timeout: 244 seconds]
knight33_ has joined #ruby
elphe has joined #ruby
queip has quit [Read error: Connection reset by peer]
jgpawletko has joined #ruby
elphe has quit [Ping timeout: 245 seconds]
arescorpio has quit [Ping timeout: 240 seconds]
<woodruffw>
galaxie: yeah, that's a problem with `open-uri` as a whole. as nchambers mentioned, net/http is probably the right way to go
<woodruffw>
FWIW, using `net/http` is as simple as this: `Net::HTTP.get(URI(your_url))`
<woodruffw>
that returns a `String` containing just the response body
<galaxie>
woodruffw: Hmm, OK. How easy to set a user-agent?
<woodruffw>
galaxie: for that, you'll need to create a `Net::HTTP::Get` object, i think. that object can then be treated like a hash to add headers, e.g. `foo['X-Whatever'] = 'bar'`
Exuma has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Exuma has joined #ruby
arescorpio has quit [Remote host closed the connection]
Exuma has quit [Client Quit]
Exuma has joined #ruby
braincrash has quit [Quit: bye bye]
braincrash has joined #ruby
awkwords has joined #ruby
cd has joined #ruby
justicefries has joined #ruby
justicefries has left #ruby [#ruby]
<nchambers>
So I wrote an each method for my class, but I'd like to return an enumerator if no block is given. Is there a good article or doc on how to define an enumerator for your class?
queip has quit [Read error: Connection reset by peer]
Inline has quit [Read error: Connection reset by peer]
dbugger_ has quit [Ping timeout: 240 seconds]
lomex has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Inline has joined #ruby
conta has quit [Quit: conta]
elphe has quit [Ping timeout: 252 seconds]
dkmueller has joined #ruby
whysthatso has quit [Quit: whysthatso]
Yxhuvud has quit [Ping timeout: 276 seconds]
weird_error has quit [Quit: weird_error]
Guest24308 has joined #ruby
roshanavand has joined #ruby
queip has quit [Read error: Connection reset by peer]
queip has joined #ruby
desperek has quit [Quit: xoxo]
elphe has joined #ruby
ua_ has quit [Ping timeout: 268 seconds]
weaksauce has quit [Ping timeout: 268 seconds]
jetchisel has quit [Ping timeout: 246 seconds]
BTRE has quit [Remote host closed the connection]
im0nde has quit [Ping timeout: 264 seconds]
clemens3 has quit [Remote host closed the connection]
BTRE has joined #ruby
_whitelogger has joined #ruby
whysthatso has joined #ruby
joast has joined #ruby
im0nde has joined #ruby
pabs has quit [Ping timeout: 252 seconds]
reber has joined #ruby
whysthatso has quit [Quit: whysthatso]
reber__ has quit [Read error: Connection reset by peer]
akem has joined #ruby
pabs has joined #ruby
dbugger__ has quit [Remote host closed the connection]
conta has joined #ruby
akem has quit [Remote host closed the connection]
elphe has quit [Ping timeout: 240 seconds]
akem has joined #ruby
akem has quit [Read error: Connection reset by peer]
akem has joined #ruby
wildermind has quit [Quit: Connection closed for inactivity]
maximjaffe has joined #ruby
paulscoder has joined #ruby
whysthatso has joined #ruby
elphe has joined #ruby
elphe has quit [Ping timeout: 244 seconds]
desperek has joined #ruby
houhoulis has joined #ruby
apparition has quit [Quit: Bye]
kaleido has joined #ruby
sgen has joined #ruby
queip has quit [Read error: Connection reset by peer]
queip has joined #ruby
luminous has joined #ruby
ptx0 has joined #ruby
universa1 has joined #ruby
conta has quit [Ping timeout: 244 seconds]
Sembei has joined #ruby
ByronJohnson has quit [Remote host closed the connection]
Puffball has quit [Remote host closed the connection]
Puffball has joined #ruby
yohji has joined #ruby
Yxhuvud has joined #ruby
yohji has quit [Client Quit]
whysthatso has quit [Quit: whysthatso]
akem has quit [Read error: Connection reset by peer]
ChatCodingLab has joined #ruby
akem has joined #ruby
sgen has quit [Ping timeout: 250 seconds]
ivanskie has joined #ruby
jetchisel has joined #ruby
jetchisel has quit [Max SendQ exceeded]
queip has quit [Read error: Connection reset by peer]
bairyn has joined #ruby
akem has quit [Remote host closed the connection]
jetchisel has joined #ruby
akem has joined #ruby
za1b1tsu has joined #ruby
kn-928 has joined #ruby
kn-928 has quit [Client Quit]
queip has joined #ruby
akem has quit [Ping timeout: 246 seconds]
akem has joined #ruby
clemens3 has joined #ruby
Nicmavr has quit [Read error: Connection reset by peer]
lomex has joined #ruby
clemens3 has quit [Remote host closed the connection]
Nicmavr has joined #ruby
akem has quit [Remote host closed the connection]
akaiiro has joined #ruby
ChatCodingLab has quit [Quit: Leaving]
Puffball has quit [Remote host closed the connection]
Puffball has joined #ruby
Tom-_ has joined #ruby
<Tom-_>
is learning ruby from learnrubythehardway.org a good idea?
<kaleido>
the generic, but still accurate, answer is that yes it will help you learn the basics just as well as any other means.
pabs has quit [Ping timeout: 240 seconds]
pabs has joined #ruby
lomex has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jordila has joined #ruby
jaddison has joined #ruby
<Tom-_>
that's quite good enough for me, thanks very much!
bendersteed has joined #ruby
ua has joined #ruby
jthomas has joined #ruby
<jordila>
absolute ruby beginner here, trying to get to know Nil ... on the following snippet at https://pastebin.com/Ly2hCVfC , what __ should be substituted for ?
<ruby[bot]>
jordila: we in #ruby do not like pastebin.com, it loads slowly for most, has ads which are distracting and has terrible formatting. Please use https://gist.github.com
voice_ftp has quit [Read error: Connection reset by peer]
<jordila>
when trying to get to know a little bit more on Nil ... on the following snippet at https://dpaste.de/ZsMV , what __ should be substituted for in order to the function to become true ?
phil80 has joined #ruby
raul782 has quit []
patr0clus has joined #ruby
conta has quit [Quit: conta]
<phaul>
jordila: make it something - anyting that would make it run past syntax errors. change __ to any object you like: 1, 'a', nil, [13] etc. then run it again and observe.
phil80 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<jordila>
phaul, tried 'nil' , unsuccesfully
elphe has joined #ruby
patr0clus has quit [Quit: WeeChat 2.1]
<phaul>
did you get different output? What did it say?
elphe has quit [Ping timeout: 240 seconds]
<jordila>
Koans application says ... 'Expected nil to equal NoMethodError ' ... but i cannot (yet) see the light .
<jordila>
Eve when substituting '__' by 'NoMethodError' ?
<phaul>
yeah. that should get you further
<phaul>
always read what it says. and try to make sense of it..
nchambers has joined #ruby
weaksauce has joined #ruby
queip has quit [Read error: Connection reset by peer]
clemens3 has joined #ruby
lomex has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bmurt has joined #ruby
Dbugger has joined #ruby
clemens3 has quit [Remote host closed the connection]
queip has joined #ruby
<jordila>
when substituting '__' for 'NoMethodError' i cannot (yet) see the light.
im0nde has quit [Quit: im0nde]
phil80 has joined #ruby
aufi has joined #ruby
Tom-_ has quit [Quit: Leaving]
Tom-_ has joined #ruby
phil80 has quit []
<phaul>
jordila: 'NoMethodError' is different from NoMethodError. Notice the 'marks'.
akaiiro has joined #ruby
<phaul>
one is a constant pointing to some object. Typically a class or module, but sometimes, something else. The other with single quotes is a string
elphe has joined #ruby
<phaul>
NoMethodError is a class in this case which denotes the error of method on object is non-existent
ur5us has quit [Remote host closed the connection]
jaddison has quit [Quit: jaddison]
sgen has joined #ruby
ivanskie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bairyn is now known as ByronJohnson
akaiiro has quit [Ping timeout: 252 seconds]
sheepman has joined #ruby
venmx has joined #ruby
Guest24308 has joined #ruby
elphe has joined #ruby
reber has quit [Remote host closed the connection]
Guest24308 has quit [Ping timeout: 252 seconds]
lunarkitty7 has joined #ruby
paulscoder has joined #ruby
bendersteed has quit [Remote host closed the connection]
daemonwrangler has quit [Quit: ZNC 1.6.5 - http://znc.in]
dviola has joined #ruby
daemonwrangler has joined #ruby
akaiiro has joined #ruby
beeman has quit []
Exuma has joined #ruby
beeman has joined #ruby
paulscoder has quit [Quit: paulscoder]
aufi has quit [Ping timeout: 252 seconds]
paulscoder has joined #ruby
<nchambers>
is there something like Object#class expcet it outputs the basename of the class? I've got a class named Raspberry::Type::Lambda and I'd like to just get Lambda
<nchambers>
other than foo.class.name.split("::")[-1]
<phaul>
there aretwo distinct things in play. scope nesting and inheritance
<phaul>
:: separates nesting. and it's independent of inheritance