roshanavand has quit [Remote host closed the connection]
roshanavand has joined #ruby
Azure has quit [Ping timeout: 244 seconds]
Azure has joined #ruby
Renich has quit [Quit: Renich]
Renich has joined #ruby
sgen has joined #ruby
Renich has quit [Client Quit]
Renich has joined #ruby
<desnudopenguino>
baweaver: that was like aesop's fable worthy. you wrapped some learning into a fun story.
roshanavand has quit [Remote host closed the connection]
cnsvc_ has quit [Ping timeout: 256 seconds]
arescorpio has quit [Remote host closed the connection]
Renich has quit [Quit: Renich]
Renich has joined #ruby
Renich has quit [Client Quit]
Renich has joined #ruby
Fusl has quit [Excess Flood]
Fusl has joined #ruby
akem has quit [Remote host closed the connection]
akem has joined #ruby
Fridtjof has joined #ruby
cnsvc_ has joined #ruby
ghormoon has quit [Ping timeout: 240 seconds]
cthulchu_ has quit [Ping timeout: 268 seconds]
sgen has quit [Remote host closed the connection]
ghormoon has joined #ruby
jottr has quit [Ping timeout: 246 seconds]
dviola has quit [Quit: WeeChat 2.3]
ghormoon has quit [Ping timeout: 250 seconds]
hurricanehrndz has quit [Excess Flood]
eclm has quit [Read error: Connection reset by peer]
hurricanehrndz has joined #ruby
SeepingN has quit [Ping timeout: 240 seconds]
akem has quit [Remote host closed the connection]
akem has joined #ruby
ghormoon has joined #ruby
arand has quit [Ping timeout: 252 seconds]
arand has joined #ruby
jottr has joined #ruby
jottr has quit [Ping timeout: 246 seconds]
mangold has quit [Ping timeout: 252 seconds]
mangold has joined #ruby
rawrg has quit [Remote host closed the connection]
rawrg has joined #ruby
houhoulis has joined #ruby
sgen has joined #ruby
AJA4350 has quit [Quit: AJA4350]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cmhobbs has quit [Ping timeout: 250 seconds]
orbyt_ has joined #ruby
ghormoon has quit [Ping timeout: 250 seconds]
lunorian has joined #ruby
gix has quit [Ping timeout: 250 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<lunorian>
I'm learning Ruby and have a question about the `do` and `end` keywords. When defining a class I can type `class Person` and `end` but not include a `do` keyword. When is the `do` keyword required?
\void has quit [Quit: So long, and thanks for all the fish.]
Nicmavr has quit [Read error: Connection reset by peer]
<lunorian>
Are class declarations different than blocks?
mangold has quit [Ping timeout: 252 seconds]
cnsvc_ has quit [Ping timeout: 256 seconds]
<Iambchop>
e.g. "[1,2,3].each do |n| puts n; end" or "[1,2,3].each{|n| puts n}": the do/end (or {}) is an anonymous function passed into the each method
<lunorian>
So I'm understanding how to use them, I'm more interesting in why the `do` keyword isn't required for Class declarations
orbyt_ has joined #ruby
braincrash has quit [Quit: bye bye]
Renich has quit [Quit: Renich]
Renich has joined #ruby
Renich has quit [Remote host closed the connection]
cnsvc_ has joined #ruby
Renich has joined #ruby
<Iambchop>
I think that if it was "class Foo(a,b,c) do" the do keyword would be wasted and not provide any new info when parsing/reading the code that the class keyword didn't already provide. :)
roshanavand has joined #ruby
braincrash has joined #ruby
<Iambchop>
Oh, I meant "class Foo do" or "def bar(a,b,c) do" there but squished them together. :-)
sgen has quit [Remote host closed the connection]
<lunorian>
it's a matter of `Class Foo do` vs `Class Foo`
<lunorian>
and why do isn't required for it but is possible to use it
cnsvc_ has quit [Ping timeout: 256 seconds]
roshanavand has quit [Ping timeout: 268 seconds]
Renich has quit [Quit: Renich]
Renich has joined #ruby
Renich has quit [Client Quit]
Renich has joined #ruby
mangold has joined #ruby
<Iambchop>
What do you mean by "is possible to use it"? It's not posdible; "class Foo do" errors out. (There is a way to create an anonymous class that does not use the class keyword, but does use the do keyword; I was leaving that out because I didn't want to complicate matters.)
<Iambchop>
If you've seen code that used "Class.new do" that was an anonymous class. The do keyword is used there because it's actually passing a block to the "new" method. But, "normal" methods just use the class keyword.
<Iambchop>
of course that should read "normal *classes*" :-)
<lunorian>
thanks for the info
<lunorian>
I'm going to read all of those blog posts in the morning
<lunorian>
it's late here so I'm exiting for the night
<lunorian>
have fun everyone :)
lunorian has quit [Quit: sleepy time :heart:]
tjmcginnis has joined #ruby
houhoulis has quit []
kapil____ has quit [Quit: Connection closed for inactivity]
akem has quit [Read error: Connection reset by peer]
doubledup has joined #ruby
akem has joined #ruby
chouhoulis has quit [Ping timeout: 268 seconds]
Renich has quit [Quit: Renich]
Renich has joined #ruby
Renich has quit [Client Quit]
Renich has joined #ruby
cnsvc_ has quit [Ping timeout: 256 seconds]
Fusl has quit [Excess Flood]
Fusl has joined #ruby
phaul has joined #ruby
mangold has joined #ruby
cnsvc_ has joined #ruby
Renich has quit [Quit: Renich]
Renich has joined #ruby
Renich has quit [Client Quit]
keden has joined #ruby
venmx has quit [Ping timeout: 246 seconds]
venmx has joined #ruby
mangold has quit [Ping timeout: 260 seconds]
hahuang65 has quit [Read error: Connection reset by peer]
hahuang65 has joined #ruby
troulouliou_dev has joined #ruby
Renich has joined #ruby
Renich has quit [Client Quit]
Renich has joined #ruby
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
cnsvc_ has quit [Ping timeout: 256 seconds]
mangold has joined #ruby
dellavg_ has quit [Ping timeout: 250 seconds]
EvilJStoker has quit [Ping timeout: 250 seconds]
dellavg_ has joined #ruby
EvilJStoker has joined #ruby
cnsvc_ has joined #ruby
keden has quit [Ping timeout: 246 seconds]
AJA4350 has joined #ruby
keden has joined #ruby
jottr has quit [Quit: WeeChat 2.2]
EvilJStoker has quit [Read error: Connection reset by peer]
EvilJStoker has joined #ruby
mangold has quit [Ping timeout: 260 seconds]
roshanavand has quit [Remote host closed the connection]
roshanavand has joined #ruby
nchambers has quit [Ping timeout: 250 seconds]
akem has quit [Remote host closed the connection]
akem has joined #ruby
mangold has joined #ruby
vonfry has joined #ruby
ua_ has joined #ruby
nchambers has joined #ruby
ua has quit [Ping timeout: 246 seconds]
mangold has quit [Ping timeout: 268 seconds]
EvilJStoker has quit [Ping timeout: 250 seconds]
nchambers has quit [Ping timeout: 250 seconds]
kapil____ has quit [Quit: Connection closed for inactivity]
nchambers has joined #ruby
cnsvc_ has quit [Ping timeout: 256 seconds]
nchambers has quit [Ping timeout: 246 seconds]
mangold has joined #ruby
nchambers has joined #ruby
gix has joined #ruby
apparition47 has joined #ruby
dbz has joined #ruby
vonfry has quit [Quit: WeeChat 2.2]
nchambers has quit [Ping timeout: 245 seconds]
dbz has quit [Ping timeout: 246 seconds]
leitz has joined #ruby
cnsvc_ has joined #ruby
venmx has quit [Quit: leaving]
nchambers has joined #ruby
nchambers has quit [Ping timeout: 250 seconds]
paulscoder has joined #ruby
Renich has quit [Quit: Renich]
Renich has joined #ruby
Renich has quit [Client Quit]
nchambers has joined #ruby
Renich has joined #ruby
kapil____ has joined #ruby
ghormoon has joined #ruby
bmurt has joined #ruby
reber has joined #ruby
nchambers has quit [Ping timeout: 250 seconds]
reber has quit [Read error: Connection reset by peer]
nchambers has joined #ruby
clemens3 has joined #ruby
marz_d`ghostman has joined #ruby
hahuang65 has quit [Read error: Connection reset by peer]
<marz_d`ghostman>
I'm trying to test my Module methods(self.method) in rspec. However, I'm getting uninitialized constant error. How do I test it like Module::Module.method?
hahuang65 has joined #ruby
AJA4350 has quit [Ping timeout: 246 seconds]
<phaul>
marz_d`ghostman: post your code + errors. then we figure out what's wrong.
<phaul>
otherwise methods are just methods.. Modules are just objects..
<phaul>
leitz: probably there are more straightforward ways of doing that, you could call map on Hash directly. Or there is #each_value on hash, which would skip looking up the key and operating directly on value
<leitz>
phaul, my goal is to make a link for each key, Still trying to figure it out.
<leitz>
Ah, the return is just the last evaluated item.
<jnoon>
i have a native rice ext wrapping a c++ lib working. the library im wrapping does some of its own threading with std::thread. one of the things i call takes a ruby lambda, makes it a void*, and the c++ lib passes that along to the a thread where eventually it should be called. but i cant just call it there on a non-ruby thread (crash). is there a way i can start a new ruby thread safely from a non-ruby thread in order to uncas
<jnoon>
d* and call it? i know how to uncast and call it synchronously in the original thread and that works.
kaleido has quit [Remote host closed the connection]
kaleido has joined #ruby
<phaul>
marz_d`ghostman: is mirror.rb required in the spec?
<phaul>
otherwise it should be defined, regardless of RSpec
<marz_d`ghostman>
phaul: When you require files in spec files, is the path relative to the file like you'll have to put ../../.. to reach the root dir then go inside the /lib directories where your .rb files are?
BTRE has quit [Remote host closed the connection]
<phaul>
marz_d`ghostman: I ususally configure my include path in .gemspec. But otherwise require_relative can also work. if you just do require then it's using $:
mangold has quit [Ping timeout: 252 seconds]
BTRE has joined #ruby
lxsameer has quit [Ping timeout: 250 seconds]
<marz_d`ghostman>
phaul: thanks, I'll look into it
mangold has joined #ruby
leitz has quit [Quit: Leaving]
za1b1tsu has quit [Remote host closed the connection]
conta has joined #ruby
nchambers has joined #ruby
lxsameer has joined #ruby
pskosinski has joined #ruby
pskosinski has quit [Read error: Connection reset by peer]
Renich has quit [Quit: Renich]
Renich has joined #ruby
Renich has quit [Client Quit]
Renich has joined #ruby
nchambers has quit [Ping timeout: 250 seconds]
nchambers has joined #ruby
cnsvc_ has quit [Ping timeout: 256 seconds]
alem0lars has quit [Ping timeout: 240 seconds]
keden has quit [Quit: WeeChat 2.3]
troulouliou_dev has quit [Quit: Leaving]
nchambers has quit [Ping timeout: 268 seconds]
cnsvc_ has joined #ruby
troulouliou_dev has joined #ruby
chouhoulis has joined #ruby
troulouliou_dev has quit [Remote host closed the connection]
desperek has joined #ruby
planigan has quit [Ping timeout: 268 seconds]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zautomata has joined #ruby
reber has joined #ruby
crankharder has joined #ruby
clarkema has quit [Quit: clarkema]
cnsvc_ has quit [Ping timeout: 256 seconds]
orbyt_ has joined #ruby
cnsvc_ has joined #ruby
nchambers has joined #ruby
jcarl43 has joined #ruby
nchambers has quit [Quit: he was a sk8r boi, she said see you later boi]
crankharder has quit [Ping timeout: 245 seconds]
doubledup has quit [Quit: Leaving]
za1b1tsu has joined #ruby
<havenwood>
I just packaged a Ruby command line app and released it on snap. It's pretty nice...
graphene has quit [Remote host closed the connection]
<havenwood>
Getting Snap and AWS Lambda support in one day.. good stuff!
graphene has joined #ruby
<havenwood>
If you want a command line SipHash ¯\_(ツ)_/¯ you can now: sudo snap install siphash
akaiiro has quit [Remote host closed the connection]
waheedi has quit [Read error: Connection reset by peer]
BaroMeter has left #ruby [#ruby]
Xeago has quit [Ping timeout: 250 seconds]
waheedi has joined #ruby
TheBloke has quit [Read error: No route to host]
kapil____ has quit [Excess Flood]
kapil____ has joined #ruby
dbz has quit [Remote host closed the connection]
TheBloke has joined #ruby
kapil____ has quit [Client Quit]
Xeago has joined #ruby
kapil____ has joined #ruby
dbz has joined #ruby
<marz_d`ghostman>
Is it good practice to place a self.log on the top most module so that I can just call it anywhere whenever I want to log something?
cnsvc_ has joined #ruby
SeepingN has joined #ruby
<Zarthus>
well it will never be the best practice
<Zarthus>
but if you're writing something small, why not
planigan has joined #ruby
waheedi has quit [Read error: Connection reset by peer]
cnsvc_ has quit [Ping timeout: 256 seconds]
crankharder has joined #ruby
<marz_d`ghostman>
Is there a way to make sure a file gets run before anything else? Like I have a config/initializer/test.rb that popuplates config variables. I'd like that to run since the constant I'm declaring under a module is saying its nil since it depends on the config variables
crankharder has quit [Ping timeout: 250 seconds]
Zavoli has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
waheedi has joined #ruby
Zavoli has quit []
awkwords has quit [Quit: sleepy time]
rubydoc has quit [Ping timeout: 250 seconds]
nchambers has joined #ruby
phaul has quit [Ping timeout: 244 seconds]
waheedi has quit [Read error: Connection reset by peer]
tdy has quit [Read error: Connection reset by peer]
Andrevan has joined #ruby
crankharder has joined #ruby
tdy has joined #ruby
phaul has joined #ruby
rubydoc has joined #ruby
crankharder has quit [Ping timeout: 250 seconds]
waheedi has joined #ruby
cnsvc_ has joined #ruby
evdubs has quit [Remote host closed the connection]
evdubs has joined #ruby
crankharder has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Eiam has quit [Ping timeout: 268 seconds]
waheedi has quit [Read error: Connection reset by peer]