havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.6.3, 2.5.5, 2.7.0-preview1: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.de/ and select Ruby as the language | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | Can't talk? Register/identify with Nickserv first!
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
brool has joined #ruby
emptyfl4sk has quit [Ping timeout: 268 seconds]
orbyt_ has joined #ruby
fphilipe_ has joined #ruby
txdv has quit [Ping timeout: 268 seconds]
exmortus has quit [Ping timeout: 244 seconds]
emptyfl4sk has joined #ruby
involans has quit [Quit: involans]
exmortus has joined #ruby
fphilipe_ has quit [Ping timeout: 245 seconds]
txdv has joined #ruby
emptyfl4sk has quit [Ping timeout: 245 seconds]
lepepe has quit [Remote host closed the connection]
ngw has quit [Quit: WeeChat 2.4]
emptyfl4sk has joined #ruby
envex has quit []
tdy has joined #ruby
emptyfl4sk has quit [Ping timeout: 268 seconds]
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
chalkmonster has quit [Quit: WeeChat 2.5]
megamos has quit [Ping timeout: 244 seconds]
chalkmonster has joined #ruby
involans has joined #ruby
tdy has quit [Ping timeout: 268 seconds]
emptyfl4sk has joined #ruby
henninb has quit [Quit: leaving]
esrse has joined #ruby
emptyfl4sk has quit [Ping timeout: 248 seconds]
DEac- has quit [Ping timeout: 245 seconds]
involans has quit [Quit: involans]
tdy has joined #ruby
envex has joined #ruby
fphilipe_ has joined #ruby
sarink has joined #ruby
tdy has quit [Ping timeout: 268 seconds]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
emptyfl4sk has joined #ruby
braincrash has quit [Quit: bye bye]
Technodrome has joined #ruby
emptyfl4sk has quit [Ping timeout: 248 seconds]
braincrash has joined #ruby
fphilipe_ has quit [Ping timeout: 245 seconds]
Junaos has quit [Read error: Connection reset by peer]
Junaos has joined #ruby
rafadc has quit [Ping timeout: 244 seconds]
tdy has joined #ruby
gix- has joined #ruby
gix has quit [Disconnected by services]
nowhereman has joined #ruby
nowhere_man has quit [Ping timeout: 252 seconds]
donofrio has quit [Remote host closed the connection]
Nicmavr has quit [Read error: Connection reset by peer]
Nicmavr has joined #ruby
brett-soric has joined #ruby
englishm has quit [Excess Flood]
akem__ has quit [Remote host closed the connection]
englishm has joined #ruby
akem__ has joined #ruby
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
SeepingN has joined #ruby
englishm has quit [Excess Flood]
englishm has joined #ruby
matheusmoreira has joined #ruby
brett-soric has left #ruby [#ruby]
dellavg_ has quit [Ping timeout: 246 seconds]
DTZUZO has joined #ruby
za1b1tsu has joined #ruby
za1b1tsu has quit [Remote host closed the connection]
emptyfl4sk has joined #ruby
sagax has joined #ruby
brool has quit [Ping timeout: 252 seconds]
fphilipe_ has joined #ruby
DTZUZO has quit [Ping timeout: 246 seconds]
gix- has quit [Ping timeout: 245 seconds]
emptyfl4sk has quit [Ping timeout: 258 seconds]
conta has joined #ruby
za1b1tsu has joined #ruby
lord4163 has quit [Excess Flood]
lord4163 has joined #ruby
polishdub has joined #ruby
polishdub has quit [Client Quit]
conta has quit [Remote host closed the connection]
conta has joined #ruby
ur5us has quit [Remote host closed the connection]
matheusmoreira has quit [Ping timeout: 246 seconds]
conta has quit [Ping timeout: 258 seconds]
matheusmoreira has joined #ruby
conta has joined #ruby
fphilipe_ has quit [Ping timeout: 248 seconds]
za1b1tsu has quit [Remote host closed the connection]
emptyfl4sk has joined #ruby
sarink has quit [Remote host closed the connection]
kyrylo has joined #ruby
_whitelogger has joined #ruby
schne1der has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
johnny56 has quit [Ping timeout: 272 seconds]
emptyfl4sk has quit [Ping timeout: 245 seconds]
kyrylo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sarink has joined #ruby
cd has quit [Quit: cd]
Inline has quit [Quit: Leaving]
sandstrom has joined #ruby
SeepingN has quit [Quit: The system is going down for reboot NOW!]
schne1der has quit [Ping timeout: 258 seconds]
za1b1tsu has joined #ruby
aupadhye has joined #ruby
emptyfl4sk has joined #ruby
conta has quit [Ping timeout: 272 seconds]
andikr has joined #ruby
clemens3 has joined #ruby
nowhereman has quit [Ping timeout: 245 seconds]
fphilipe_ has joined #ruby
also_uplime has joined #ruby
<also_uplime> in eventmachine, is there a way to pass an argument to a handler? something like EventMachine.connect("host", 1234, Handler, { some: "options" }) and then module Handler def post_init(opts) @opts = opts end
fphilipe_ has quit [Ping timeout: 246 seconds]
emptyfl4sk has quit [Ping timeout: 245 seconds]
clemens3 has quit [Quit: WeeChat 1.6]
fphilipe_ has joined #ruby
<also_uplime> ah, i see. i need to give it a class
also_uplime has left #ruby ["/me scurries away"]
howdoi has joined #ruby
uranoss has quit [Quit: Connection closed for inactivity]
conta has joined #ruby
deepredsky has quit [Ping timeout: 272 seconds]
schne1der has joined #ruby
rafadc has joined #ruby
fphilipe_ has quit [Ping timeout: 244 seconds]
miskatonic has joined #ruby
DTZUZO has joined #ruby
hightower2 has quit [Ping timeout: 248 seconds]
mayurvpatil has joined #ruby
mayurvpatil has quit [Max SendQ exceeded]
emptyfl4sk has joined #ruby
BH23 has joined #ruby
fphilipe_ has joined #ruby
<Cork> is it possible to get OpenSSL::PKey::RSA.new to NOT ask for password if given an encrypted private key?
lxsameer has joined #ruby
absolutejam1 has joined #ruby
emptyfl4sk has quit [Ping timeout: 244 seconds]
deepredsky has joined #ruby
DEac- has joined #ruby
sandstrom has quit [Quit: My computer has gone to sleep.]
queip has quit [Ping timeout: 244 seconds]
absolutejam1 has quit [Ping timeout: 246 seconds]
DEac- has quit [Read error: Connection reset by peer]
reber has joined #ruby
ovnimancer has joined #ruby
sandstrom has joined #ruby
andikr has quit [Ping timeout: 245 seconds]
andikr has joined #ruby
conta has quit [Ping timeout: 245 seconds]
BH23 has quit [Ping timeout: 272 seconds]
queip has joined #ruby
emptyfl4sk has joined #ruby
lepepe has joined #ruby
lepepe has quit [Ping timeout: 258 seconds]
Bounga has joined #ruby
BH23 has joined #ruby
za1b1tsu has quit [Remote host closed the connection]
emptyfl4sk has quit [Ping timeout: 248 seconds]
BH23 has quit [Ping timeout: 248 seconds]
conta has joined #ruby
m27frogy_ has joined #ruby
m27frogy has quit [Ping timeout: 245 seconds]
ovnimancer has quit [Read error: Connection reset by peer]
ovnimancer has joined #ruby
ellcs has joined #ruby
jefffrails35 has joined #ruby
jefffrails35 has quit [Remote host closed the connection]
DEac- has joined #ruby
emptyfl4sk has joined #ruby
emptyfl4sk has quit [Ping timeout: 245 seconds]
andikr has quit [Quit: No Ping reply in 180 seconds.]
johnny56 has joined #ruby
andikr has joined #ruby
UnionJack has joined #ruby
UnionJack has left #ruby [#ruby]
ovnimancer has quit [Ping timeout: 246 seconds]
emptyfl4sk has joined #ruby
emptyfl4sk has quit [Ping timeout: 248 seconds]
absolutejam1 has joined #ruby
tdy has quit [Ping timeout: 272 seconds]
S007 has quit [Quit: Quit]
lepepe has joined #ruby
unreal has quit [Ping timeout: 245 seconds]
lepepe has quit [Ping timeout: 272 seconds]
cassolas has joined #ruby
unreal has joined #ruby
leitz has joined #ruby
kyrylo has joined #ruby
emptyfl4sk has joined #ruby
mello has quit [Remote host closed the connection]
conta has quit [Ping timeout: 246 seconds]
emptyfl4sk has quit [Ping timeout: 244 seconds]
NL3limin4t0r_afk is now known as NL3limin4t0r
armyriad has quit [Ping timeout: 248 seconds]
conta has joined #ruby
rudis has joined #ruby
cassolas has quit [Quit: Textual IRC Client: www.textualapp.com]
miskatonic has quit [Remote host closed the connection]
<rudis> Can I create a Ruby C extension that uses the oniguruma lib without colliding with Ruby's modified onigmo version?
rudis has quit []
rudis has joined #ruby
rudis is now known as rudis2037
rudis2037 has quit [Client Quit]
rudis has joined #ruby
rudis has quit [Client Quit]
akem__ has quit [Ping timeout: 248 seconds]
davor has quit [Ping timeout: 245 seconds]
emptyfl4sk has joined #ruby
armyriad has joined #ruby
davor has joined #ruby
jrafanie has joined #ruby
sarink has quit [Remote host closed the connection]
sarink has joined #ruby
sarink has quit [Remote host closed the connection]
sarink has joined #ruby
AJA4350 has joined #ruby
absolutejam has quit [Quit: WeeChat 2.5]
absolutejam1 has quit [Quit: WeeChat 2.4]
johnny56 has quit [Ping timeout: 272 seconds]
emptyfl4sk has quit [Ping timeout: 245 seconds]
stooj has quit [Quit: ZNC 1.7.3 - https://znc.in]
stooj has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lepepe has joined #ruby
suukim has joined #ruby
lepepe has quit [Ping timeout: 248 seconds]
akem-lnvo has joined #ruby
Guest22 has joined #ruby
fphilipe_ has quit [Ping timeout: 245 seconds]
emptyfl4sk has joined #ruby
Guest22 has left #ruby [#ruby]
lepepe has joined #ruby
Guest22 has joined #ruby
Guest22 is now known as fretta
sarink has quit [Remote host closed the connection]
sarink has joined #ruby
emptyfl4sk has quit [Ping timeout: 268 seconds]
lepepe has quit [Ping timeout: 268 seconds]
DaRock has joined #ruby
fphilipe_ has joined #ruby
lepepe has joined #ruby
deathwishdave has joined #ruby
yo-wan has joined #ruby
conta has quit [Ping timeout: 268 seconds]
lepepe has quit [Ping timeout: 245 seconds]
conta has joined #ruby
johnny56 has joined #ruby
lepepe has joined #ruby
akem-lnvo has quit [Ping timeout: 244 seconds]
fretta has quit [Quit: Textual IRC Client: www.textualapp.com]
lepepe has quit [Ping timeout: 244 seconds]
reber has quit [Remote host closed the connection]
emptyfl4sk has joined #ruby
emptyfl4sk has quit [Ping timeout: 245 seconds]
sarink has quit [Remote host closed the connection]
sarink has joined #ruby
jcalla has quit [Ping timeout: 248 seconds]
Tuor has joined #ruby
conta has quit [Remote host closed the connection]
za1b1tsu has joined #ruby
conta has joined #ruby
cisco has joined #ruby
lepepe has joined #ruby
sarink has quit [Remote host closed the connection]
lepepe has quit [Read error: Connection reset by peer]
lepepe has joined #ruby
lepepe has quit [Remote host closed the connection]
lepepe has joined #ruby
sarink has joined #ruby
sarink has quit [Remote host closed the connection]
al2o3-cr has quit [Quit: If the universe is a machine where the future is uniquely determined by its present state, it would not be possible to calculate what the future will be.]
lepepe_ has joined #ruby
Azure has quit [Ping timeout: 258 seconds]
esrse has quit [Ping timeout: 248 seconds]
sarink has joined #ruby
lepepe has quit [Ping timeout: 258 seconds]
al2o3-cr has joined #ruby
sarink has quit [Remote host closed the connection]
involans has joined #ruby
Esa_ has joined #ruby
jcalla has joined #ruby
davor has quit [Ping timeout: 244 seconds]
sarink has joined #ruby
davor has joined #ruby
sarink has quit [Ping timeout: 245 seconds]
vondruch_ has joined #ruby
queip has quit [Ping timeout: 268 seconds]
vondruch has quit [Ping timeout: 248 seconds]
vondruch_ is now known as vondruch
fphilipe_ has quit [Read error: Connection reset by peer]
fphilipe_ has joined #ruby
absolutejam has joined #ruby
Swyper has joined #ruby
queip has joined #ruby
megamos has joined #ruby
fphilipe_ has quit [Ping timeout: 244 seconds]
sarink has joined #ruby
DTZUZO has quit [Ping timeout: 244 seconds]
Swyper has quit [Remote host closed the connection]
ropeney has quit [Ping timeout: 245 seconds]
Swyper has joined #ruby
ropeney has joined #ruby
sarink has quit [Remote host closed the connection]
fphilipe_ has joined #ruby
jrafanie has joined #ruby
sarink has joined #ruby
sylario has joined #ruby
Swyper has quit [Remote host closed the connection]
Bish has joined #ruby
conta has quit [Ping timeout: 245 seconds]
fphilipe_ has quit [Ping timeout: 245 seconds]
sarink has quit [Remote host closed the connection]
emptyfl4sk has joined #ruby
fphilipe_ has joined #ruby
_falsebay_ has quit [Read error: Connection reset by peer]
Swyper has joined #ruby
fphilipe has joined #ruby
sarink has joined #ruby
fphilipe_ has quit [Ping timeout: 248 seconds]
_falsebay_ has joined #ruby
sandstrom has quit [Ping timeout: 252 seconds]
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
<havenwood> zenspider: I'm curious about your thoughts on `it`? https://bugs.ruby-lang.org/issues/15897
emptyfl4sk has quit [Ping timeout: 245 seconds]
sarink has quit [Remote host closed the connection]
sarink has joined #ruby
sarink has quit [Remote host closed the connection]
Yxhuvud has quit [Read error: Connection reset by peer]
Yxhuvud has joined #ruby
sarink has joined #ruby
kyrylo_ has joined #ruby
kyrylo has quit [Ping timeout: 245 seconds]
Nicmavr has quit [Read error: Connection reset by peer]
sarink has quit [Remote host closed the connection]
sarink has joined #ruby
Nicmavr has joined #ruby
sandstrom has joined #ruby
conta has joined #ruby
Tuor has quit [Quit: Konversation terminated!]
schne1der has quit [Ping timeout: 246 seconds]
LtHummus has quit [Read error: Connection reset by peer]
LtHummus has joined #ruby
* Bish said we need this 3 years or something ago
SeepingN has joined #ruby
vdl has quit [Quit: WeeChat 2.3]
jrafanie has quit [Ping timeout: 246 seconds]
vdl has joined #ruby
sarink has quit [Remote host closed the connection]
ascarter has joined #ruby
sarink has joined #ruby
sarink has quit [Remote host closed the connection]
sarink has joined #ruby
ascarter has quit [Client Quit]
deathwishdave has quit [Quit: Textual IRC Client: www.textualapp.com]
dbugger has joined #ruby
sarink has quit [Remote host closed the connection]
ascarter has joined #ruby
lxsameer has quit [Quit: out]
jrafanie has joined #ruby
Dr_MDMA_MD has joined #ruby
orbyt_ has joined #ruby
cjohnson has joined #ruby
reber has joined #ruby
ellcs has quit [Ping timeout: 248 seconds]
conta has quit [Quit: conta]
sarink has joined #ruby
Swyper has quit [Remote host closed the connection]
_dreamer has joined #ruby
_dreamer has left #ruby [#ruby]
rippa has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tdy has joined #ruby
emptyfl4sk has joined #ruby
ua_ has joined #ruby
tdy has quit [Ping timeout: 245 seconds]
Bounga` has joined #ruby
chromis has left #ruby [#ruby]
ua has quit [Ping timeout: 244 seconds]
andikr has quit [Remote host closed the connection]
deepredsky has quit [Ping timeout: 245 seconds]
Bounga has quit [Ping timeout: 252 seconds]
jrafanie has quit [Quit: Textual IRC Client: www.textualapp.com]
Bounga` has quit [Ping timeout: 252 seconds]
Swyper has joined #ruby
<leitz> havenwood, I've put some date parameters to my project status. I've been reading "Deep Work" and "Software Craftsmanship" (McBreen). While I don't fully agree with the latter, having a small working project seems a good step towards journeyman. Goal is to have it up by 1 Oct 2019.
kyrylo_ is now known as kyrylo
<havenwood> &>> require 'date'; "#{Integer Date.new(2019, 10, 1) - Date.today} days to go!" # leitz
<rubydoc> stderr: playpen: timeout triggered! (https://carc.in/#/r/771o)
<havenwood> #=> "85 days to go!"
<leitz> :)
sphenxes has joined #ruby
DaRock has quit [Ping timeout: 272 seconds]
emptyfl4sk has quit [Ping timeout: 268 seconds]
emptyfl4sk has joined #ruby
schne1der has joined #ruby
Tuor has joined #ruby
houhoulis has joined #ruby
aupadhye has quit [Quit: Leaving]
gix has joined #ruby
johnny56 has quit [Ping timeout: 272 seconds]
lord4163 has quit [Excess Flood]
conta has joined #ruby
lord4163 has joined #ruby
ci-pod-mod has joined #ruby
Tuor has quit [Ping timeout: 272 seconds]
DTZUZO has joined #ruby
kyrylo_ has joined #ruby
kyrylo has quit [Ping timeout: 245 seconds]
kyrylo_ is now known as kyrylo
deepredsky has joined #ruby
suukim has quit [Quit: Konversation terminated!]
AJA4350 has quit [Quit: AJA4350]
deepreds1 has joined #ruby
johnny56 has joined #ruby
deepredsky has quit [Ping timeout: 244 seconds]
kyrylo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dbugger has quit [Quit: Leaving]
kurko_ has joined #ruby
DTZUZO has quit [Ping timeout: 244 seconds]
dellavg_ has joined #ruby
<Net> how do you feel about classes that include many modules resulting in a large public api?
brool has joined #ruby
<Net> my problem with them is that it makes it hard to locate the source of a given method as you can't simply open the class and search for the method
<Net> and I'm wondering if this is valid criticism
fphilipe has quit [Read error: Connection reset by peer]
Tuor has joined #ruby
crankharder has joined #ruby
crankharder has quit [Remote host closed the connection]
DTZUZO has joined #ruby
<NL3limin4t0r> Net: You can use #owner to see where the method is defined.
<NL3limin4t0r> &>> {}.method(:reject).owner
<rubydoc> # => Hash (https://carc.in/#/r/771r)
<NL3limin4t0r> &>> {}.method(:each_slice).owner
<rubydoc> # => Enumerable (https://carc.in/#/r/771s)
<NL3limin4t0r> This also works for unbound methods.
<NL3limin4t0r> &>> Hash.instance_method(:each_slice).owner
<rubydoc> # => Enumerable (https://carc.in/#/r/771t)
Tuor has quit [Ping timeout: 246 seconds]
Inline has joined #ruby
cisco has quit [Ping timeout: 258 seconds]
fphilipe has joined #ruby
fphilipe has quit [Ping timeout: 245 seconds]
renich has joined #ruby
DTZUZO has quit [Ping timeout: 244 seconds]
rprimus has quit [Ping timeout: 245 seconds]
rprimus has joined #ruby
DTZUZO has joined #ruby
deepredsky has joined #ruby
DTZUZO has quit [Ping timeout: 268 seconds]
deepreds1 has quit [Ping timeout: 258 seconds]
Esa_ has quit []
conta has quit [Remote host closed the connection]
<Net> NL3limin4t0r: thanks, that's great
<Net> as a more general question: what do you think of modules that are written to be included in a single class for the purpose of breaking a long class file into several files?
<Net> (not to write DRYer code)
houhoulis has quit [Remote host closed the connection]
sauvin has quit [Read error: Connection reset by peer]
kyrylo has joined #ruby
armyriad has quit [Read error: Connection reset by peer]
megamos has quit [Ping timeout: 244 seconds]
<NL3limin4t0r> Net: That is mostly done to group code together that has similar functionality or the same target. For example take ActiveRecord::Persistence https://github.com/rails/rails/blob/master/activerecord/lib/active_record/persistence.rb, which is only include in ActiveRecord::Base (as far as I can tell). This module contains code that effects persistence functionality of ActiveRecord::Base. On one hand this allows
<NL3limin4t0r> developers to stay sane and keep code organized, by not having a huge god class with everything mixed together. On the other hand it can be harder to navigate for developers that are not part of the project, and just want check out some source code. Like everything in life extracting code away in a module has pros and cons, weigh them before doing it yourself.
<NL3limin4t0r> You can always build your class and extract code away when you feel like it.
emptyfl4sk has quit [Ping timeout: 244 seconds]
conta has joined #ruby
Azure has joined #ruby
_whitelogger has joined #ruby
deepreds1 has joined #ruby
miskatonic has joined #ruby
deepredsky has quit [Ping timeout: 244 seconds]
involans has quit [Quit: involans]
Exuma has joined #ruby
Azure has quit [Remote host closed the connection]
emptyfl4sk has joined #ruby
<Net> NL3limin4t0r: arguably this pattern does not provide much over simply organizing code into sections in the main class
<Net> add code folding and it seems to be almost the same
bjpenn has joined #ruby
bjpenn has quit [Changing host]
bjpenn has joined #ruby
conta has quit [Quit: conta]
ellcs has joined #ruby
<bjpenn> i have two ruby files, each containing a class. Just for simplicity, let's say `foo` and `bar` (i left out the .rb extension). in `bar` i have require_relative 'foo', but somehow I keep getting LaadError: cannot load such file -- path/to/foo
<bjpenn> they're both in the same directory
<bjpenn> is there something else i must do to get require_relative to work, aside from simply having the two files in the same directory?
emptyfl4sk has quit [Ping timeout: 244 seconds]
za1b1tsu has quit [Remote host closed the connection]
emptyfl4sk has joined #ruby
fphilipe has joined #ruby
<havenwood> bjpenn: Maybe sanity check?: absolute_path = File.absolute_path 'foo', __dir__
<havenwood> bjpenn: realpath = File.realpath "#{absolute_path.chomp '.rb'}.rb"
chalkmonster has quit [Quit: WeeChat 2.5]
<havenwood> bjpenn: Are absolute_path and realpath as expected?
<bjpenn> let me check that
<havenwood> bjpenn: The former is used for the LoadError and the latter to check against $LOADED_FEATURES.
<bjpenn> my file doesn't have .rb, so i guess for realpath = File.realpath "#{absolute_path.chomp '.rb'}.rb", i'll leave out the .rb?
<bjpenn> filename*
<havenwood> bjpenn: What's the extension?
<bjpenn> theres no extension, its just `foo`
<bjpenn> when i put this in `bar`, https://dpaste.de/n417
<bjpenn> it prints the smae path in both puts
<havenwood> bjpenn: It looks like my Ruby reproduction of #require_relative is faithful, in that it appends the .rb.
<bjpenn> it appends the .rb? both my paths show the foo without the .rb, because in the 2nd line of my paste (https://dpaste.de/n417), i didn't include last .rb from what yours had
<bjpenn> you mentioned this realpath = File.realpath "#{absolute_path.chomp '.rb'}.rb"
<bjpenn> i have this realpath = File.realpath "#{absolute_path.chomp '.rb'}"
<havenwood> bjpenn: Those two lines were just my attempt at mimicking what #require_relative does in pure Ruby.
<bjpenn> ohh
<havenwood> bjpenn: I used it here (so you can enable TCO): https://gist.github.com/havenwood/3c5a5e1476c811460992
<bjpenn> regardless if i use chomp '.rb' or not, i still get the same path
<bjpenn> realpath = File.realpath "#{absolute_path}" <-- this is the same path as realpath = File.realpath "#{absolute_path.chomp '.rb'}"
<bjpenn> i feel like i dont know how to properly use require_relative
<havenwood> bjpenn: The missing .rb is the problem.
<bjpenn> oh really
<bjpenn> let me try
<havenwood> bjpenn: #require_relative is meant to work with .rb files
<havenwood> bjpenn: #require is fancy with “.so”, “.o”, or “.dll” as well.
<havenwood> bjpenn: #load doesn't care.
<havenwood> bjpenn: load 'foo'
<havenwood> bjpenn: or rename `foo` to `foo.rb` and: require_relative 'foo'
<havenwood> bjpenn: The only reason for the `chomp` is that `require_relative 'foo.rb'` is also valid.
<bjpenn> interesting.. yeah it works _after_ renaming it from foo to foo.rb
<havenwood> (It adds an .rb if there *isn't* one already.)
<bjpenn> the docs don't say this! :)
<havenwood> bjpenn: Very true...
<bjpenn> yes, load works well...
<havenwood> bjpenn: A difference with #load is it'll load multiple times (it disregards $LOADED_FEATURES).
<havenwood> Unlike #require and #require_relative, #load doesn't keep track of loaded files and will evaluate them each time they're loaded.
<bjpenn> that shouldnt be a problem for my case, since its a one off script, that gets run all over everytime it gets used anyway
<havenwood> bjpenn: You might even then: load f
<havenwood> bjpenn: You might even then: load 'foo', true
<bjpenn> yeah just use `load 'foo'` right?
<bjpenn> i think the other option is to rename the files to have .rb, which isnt the end ofthe world, but none of my files have the .rb extension
<havenwood> bjpenn: The second argument to #load provides an anonymous module as a namespace, just to make sure it won't stomp on any constant or local.
<bjpenn> i want to keep it consistent :)
<havenwood> bjpenn: load 'foo', anonymous_wrapper = true
<bjpenn> oh, .. looking into what that does
<bjpenn> what's the point of anonymous_wrapper?
codefriar has joined #ruby
<bjpenn> i can't find anything about that
<havenwood> bjpenn: You can set any local variables you want without accidentally stomping on something else set at top level. It insulates what you're loading from your top level namespace by wrapping it in a one-time module.
Exuma has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ellcs has quit [Ping timeout: 252 seconds]
<bjpenn> ohh nice
<bjpenn> thanks much havenwood
<havenwood> bjpenn: you're welcome
megamos has joined #ruby
cisco has joined #ruby
cisco is now known as Guest43711
kyrylo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ellcs has joined #ruby
ci-pod-mod has quit [Ping timeout: 272 seconds]
dellavg_ has quit [Ping timeout: 245 seconds]
sarink has quit [Remote host closed the connection]
sarink has joined #ruby
sarink has quit [Ping timeout: 245 seconds]
ur5us has joined #ruby
Exuma has joined #ruby
akem-lnvo has joined #ruby
fphilipe has quit [Ping timeout: 245 seconds]
themsay has joined #ruby
ellcs has quit [Ping timeout: 264 seconds]
lepepe_ has quit []
budonyc has quit [Ping timeout: 244 seconds]
lepepe has joined #ruby
lepepe_ has joined #ruby
mahlon has quit [Ping timeout: 245 seconds]
schne1der has quit [Ping timeout: 248 seconds]
mahlon has joined #ruby
Exuma has quit [Quit: Textual IRC Client: www.textualapp.com]
Inline has quit [Quit: Leaving]
lepepe has quit [Ping timeout: 248 seconds]
Exuma has joined #ruby
fphilipe has joined #ruby
lepepe_ has quit [Remote host closed the connection]
sarink has joined #ruby
lepepe has joined #ruby
reber has quit [Remote host closed the connection]
lepepe_ has joined #ruby
deepredsky has joined #ruby
NL3limin4t0r is now known as NL3limin4t0r_afk
lepepe has quit [Ping timeout: 248 seconds]
sarink has quit [Ping timeout: 272 seconds]
deepreds1 has quit [Ping timeout: 245 seconds]
reber has joined #ruby
lepepe_ has quit [Ping timeout: 248 seconds]
IanMalcolm has quit [Ping timeout: 258 seconds]
sandstrom has quit [Quit: My computer has gone to sleep.]
queip has quit [Ping timeout: 272 seconds]
Exuma has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
TomyLobo has quit [Read error: Connection reset by peer]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
yo-wan has quit [Ping timeout: 272 seconds]
queip has joined #ruby
mkroman has joined #ruby
Azure has joined #ruby
fphilipe has quit [Ping timeout: 244 seconds]
fphilipe has joined #ruby
Exuma has joined #ruby
kurko_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
reber has quit [Remote host closed the connection]
Azure has quit [Ping timeout: 245 seconds]
Azure has joined #ruby
fphilipe has quit [Ping timeout: 244 seconds]
sarink has joined #ruby
code_zombie has joined #ruby
DTZUZO has joined #ruby
sphenxes has quit [Ping timeout: 245 seconds]
sarink has quit [Ping timeout: 272 seconds]
Azure has quit [Ping timeout: 272 seconds]
lepepe has joined #ruby
Exuma has quit [Quit: Textual IRC Client: www.textualapp.com]
lepepe has quit [Ping timeout: 272 seconds]
Azure has joined #ruby
Swyper has quit [Remote host closed the connection]
Azure has quit [Ping timeout: 244 seconds]
DTZUZO has quit [Ping timeout: 248 seconds]
Azure has joined #ruby
Azure has quit [Read error: Connection reset by peer]
ajamielittle has joined #ruby
fphilipe has joined #ruby
Azure has joined #ruby
emptyfl4sk has quit [Ping timeout: 248 seconds]
Exuma has joined #ruby
miskatonic has quit [Quit: ERC (IRC client for Emacs 24.5.1)]
leitz has quit [Quit: Leaving]
Guest43711 has quit [Ping timeout: 244 seconds]
uplime is now known as ^
^ is now known as KindOne
sarink has joined #ruby
lepepe has joined #ruby
sarink has quit [Ping timeout: 272 seconds]
dbugger has joined #ruby
AJA4350 has joined #ruby
cd has joined #ruby
monika has joined #ruby
mistergibson has joined #ruby
fphilipe has quit [Ping timeout: 246 seconds]
emptyfl4sk has joined #ruby
Azure has quit [Ping timeout: 248 seconds]
emptyfl4sk has quit [Ping timeout: 268 seconds]
monika has left #ruby ["WeeChat 2.5"]
canton7 has quit [Remote host closed the connection]
canton7 has joined #ruby
<garyserj> &>> def abc x,y; end; abc 4,{"aa":"bb"} {}
<rubydoc> stderr: -e:2: syntax error, unexpected '{', expecting end (https://carc.in/#/r/772v)
sarink has joined #ruby
<garyserj> why can't I pass a block there?
<al2o3-cr> you need parens
orbyt_ has joined #ruby
queip has quit [Ping timeout: 244 seconds]
sarink has quit [Ping timeout: 245 seconds]
<garyserj> what's the rule re when passing a block requires parens?
<havenwood> garyserj: {/} and do/end have different precedence.
<havenwood> garyserj: the rule is precedence.
<havenwood> &>> def abc x,y; end; abc 4,{"aa":"bb"} do end
<rubydoc> # => nil (https://carc.in/#/r/772w)
<havenwood> garyserj: note that ^ works
<garyserj> oh yeah, ok, thanks
<garyserj> i knew i remembered passing a block without parens. was via do end
queip has joined #ruby
<garyserj> or a no parameter situation
dbugger has quit [Ping timeout: 264 seconds]
<garyserj> And if i want to pass more than one hash then I need parens, unless it's a keyword argument, right?
<havenwood> garyserj: yes
<garyserj> and a keyword argument is not a hash, right?
<garyserj> (i'm aware that a hash can be automatically converted to a keyword argument)
DaRock has joined #ruby
<havenwood> garyserj: a real keyword argument is not a Hash. Ruby used to not have keyword arguments, and only had naked Hashes for arguments. now Ruby has some keyword argument support, but there's still ambiguity. in Ruby 3 there's a proposal for *real* keyword arguments not equivocal with Hashes.
<havenwood> garyserj: Here's a tracking ticket with some background reading: https://bugs.ruby-lang.org/issues/14183
<garyserj> thanks
<havenwood> np
ajamielittle has quit [Read error: No route to host]