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]
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]
<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
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.
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]
<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>
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.
<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]
<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.