<barg>
Exception `LoadError' at C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55 - cannot load such file -- selenium-webdriver
<barg>
Exception `Errno::EADDRNOTAVAIL' at C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/selenium-webdriver-3.141.0/lib/selenium/webdriver/common/socket_lock.rb:61 - The requested address is not va
<barg>
its context. - bind(2) for "127.0.0.1" port 9514
donofrio has joined #ruby
code_zombie has joined #ruby
donofrio has quit [Ping timeout: 255 seconds]
donofrio has joined #ruby
houhoulis has joined #ruby
xrexeon has quit [Remote host closed the connection]
Swyper has joined #ruby
donofrio has quit [Ping timeout: 250 seconds]
Swyper has quit [Ping timeout: 255 seconds]
catbusters has quit [Quit: Connection closed for inactivity]
donofrio has joined #ruby
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
donofrio has quit [Ping timeout: 250 seconds]
hiroaki has quit [Ping timeout: 268 seconds]
arescorpio has quit [Remote host closed the connection]
hiroaki has joined #ruby
cagomez has quit [Remote host closed the connection]
cagomez has joined #ruby
donofrio has joined #ruby
cagomez has quit [Ping timeout: 250 seconds]
renich has joined #ruby
BTRE has quit [Remote host closed the connection]
renich has quit [Quit: renich]
cd has quit [Quit: cd]
AJA4350 has quit [Remote host closed the connection]
al2o3-cr has quit [Quit: WeeChat 2.4]
al2o3-cr has joined #ruby
wolfshappen has quit [Ping timeout: 245 seconds]
wolfshappen has joined #ruby
braincrash has quit [Quit: bye bye]
braincrash has joined #ruby
Nicmavr has quit [Read error: Connection reset by peer]
Nicmavr has joined #ruby
cagomez has joined #ruby
Swyper has joined #ruby
Swyper has quit [Ping timeout: 245 seconds]
bruul has quit [Ping timeout: 245 seconds]
jobewan has joined #ruby
planigan has quit [Quit: leaving]
planigan has joined #ruby
_whitelogger has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
doomspork has joined #ruby
houhoulis has quit [Remote host closed the connection]
gix has quit [Ping timeout: 272 seconds]
doomspork has quit [Ping timeout: 245 seconds]
skyikot has quit [Remote host closed the connection]
cagomez has quit []
noAKA has joined #ruby
fluxAeon has quit [Ping timeout: 255 seconds]
fluxAeon has joined #ruby
orbyt_ has joined #ruby
<noAKA>
Anyone have a second to help out with what I think is a scope problem? https://dpaste.de/FrUc. Method at line 37, description in inline commment.
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<baweaver>
noAKA: I'd bet on some form of eval (instance, module, class)
<baweaver>
If you made locals right above it I bet it works
apparition has quit [Quit: Bye]
<baweaver>
loddbot = Cinch::Bot.new; loddbot.configure do ... end
<baweaver>
Try that instead
<baweaver>
Bingo: `instance_eval(&b) if block_given?`
Swyper has quit [Remote host closed the connection]
manakanapa has joined #ruby
<xco>
i was trying to help a friend learn Ruby with this simple excercise but I failed to expalin to him line 28 https://gist.github.com/xcobar/afde617a4abd23d2eae783c4403a51a6 we wrote this program together step-by-step but on line 28 he had initially written “else @points += 1” without “results[0] == results[1]”
<xco>
i couldn’t answer his question why just “else @points += 1” didn’t work (returned 4 instead of 7) but i just knew he had to put “elsif results[0] == results[1]”
<xco>
can anyone tell me why just “else @points += 1” didn’t work. i need this explanation for myself and for him :)
manakanapa1 has joined #ruby
manakanapa has quit [Ping timeout: 246 seconds]
barg has quit []
<mnemon>
xco: I just tested it with else and it still returned 7
<xco>
mnemon: thanks! so he must have messed something on his computer that i missed
<xco>
phaul: what do you mean? I know myself to write it this way like you have but i’m helping a beginner out. he wouldn’t undestand this and it would be hard for me to explain <=> this to a complete noob that’s why i we wrote it the way we did
<xco>
if it makes any sense
<phaul>
it's unecesarrily trying to be clever sacrificing clarity for shortness
xrexeon has joined #ruby
mangold has quit [Quit: This computer has gone to sleep]
ravenousmoose has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
venmx has joined #ruby
mangold has joined #ruby
wolfshappen_ has quit [Ping timeout: 246 seconds]
wolfshappen has joined #ruby
venmx has quit [Quit: leaving]
conta has quit [Quit: conta]
phaul has quit [Quit: bye]
DTZUZO has quit [Read error: Connection reset by peer]
ravenousmoose has joined #ruby
doomspork has joined #ruby
Fernando-Basso has quit [Remote host closed the connection]
ravenousmoose has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lucasb has quit [Quit: Connection closed for inactivity]
my1es has quit [Remote host closed the connection]
doomspork has quit [Ping timeout: 246 seconds]
Swyper has joined #ruby
xco has quit [Quit: xco]
dellavg__ has joined #ruby
hiroaki_ has quit [Ping timeout: 246 seconds]
al2o3-cr has quit [Quit: WeeChat 2.4]
danst has quit [Ping timeout: 250 seconds]
al2o3-cr has joined #ruby
<dmwit>
I don't know how to Google this. If I've defined a [] method for my class, how do I call it from within another method of that same class?
<dmwit>
[foo] seems like it would just create a one-element list...
doomspork has joined #ruby
hiroaki_ has joined #ruby
catbusters has quit [Quit: Connection closed for inactivity]
Swyper has quit [Remote host closed the connection]
ravenousmoose has joined #ruby
ravenousmoose has quit [Client Quit]
conta has joined #ruby
<dmwit>
When I write `x = Enumerator.new {|y| y << 1; print 2; y << 2}`, then later I `x.each {|v| print v}`, the call to `y << 1` transfers control back from the original block into `x.each`. How the heck does that work?? Can I write my own class that behaves that way somehow?
<leftylink>
the only way I found to call [] was self.[foo]
<leftylink>
er, without the dot
<leftylink>
self[foo], or I guess self.[](foo) would also work
<leftylink>
given that you can do maybe_an_array&.[](foo) , seems logical that self.[](foo) would work
<dmwit>
Okay, cool.
<dmwit>
Didn't know about self, but it makes sense that something like that would exist.
houhoulis has quit [Remote host closed the connection]
zapata has joined #ruby
al2o3-cr has quit [Quit: WeeChat 2.4]
nowhere_man has quit [Ping timeout: 258 seconds]
al2o3-cr has joined #ruby
cthulchu_ has joined #ruby
<c-c>
I want to pass a block into a new, and into a method from there, into a method which yields. Whats the correct way to do this? Is it OK to bind the new proc into a var? like keep doing ablock = Proc.new if block_given?
<phaul>
if you use yhe & syntax on the argument list it automatically binds it to an argument
<phaul>
then you can assign it to any instance variable like everyting else.
<c-c>
Ahem, why didn't I realize the block can be bound to a class var
<c-c>
Anyway, I was thinking that &block in an argument list was 10x slower than Proc.new - read something about it somewhere.
ellcs has joined #ruby
<phaul>
It's probably slower than yield because then you don't have to proc-ify the block. But here the proc object is created either way. I don't beleive 10x but I don't have numbers. One would have to measure. But even then I would say don't optimize up front. Do your algorithm in a sane way and when it's slow profile it.
<c-c>
true
<c-c>
it may be 10x just for the case where the block is not ever run
<c-c>
never nil.call
<c-c>
- or something
sameerynho has quit [Ping timeout: 268 seconds]
<c-c>
phaul: how would you pass the @x? Like say when instantiating another class with new in method foo?
<c-c>
like &@x ?
<c-c>
Or maybe: Aklas.new(foo) @x
<phaul>
& on method declare "procifies" wheras on call "blockifies" back. so yes, that's how map(&method(:blah)) works
<rubydoc>
parser error at position 0 around ` '
<c-c>
erm, foo was a poor choice for unambiguity there on my part
<phaul>
but I'm don't fully understand your example or what it's trying.
<phaul>
I'm not sure I fully understand --- edited lines after I wrote it
<phaul>
write a small paste or something, and if it doesn't work we can help
<c-c>
&>> class Zero; def initialize; Proc.new.call if block_given?; end; end; class One; def initialize; @y = Proc.new if block_given?; Zero.new? @y; end;
<phaul>
syntax errors are not reported back correctly by the bot
<phaul>
click on the links
<c-c>
Weird! so it works if: class Zero; def initialize; Proc.new.call if block_given?; end; end; class One; def initialize; @y = Proc.new if block_given?; Zero.new &@y; end; end; One.new { p 0 }