hwpplayer1 has quit [Remote host closed the connection]
__DuBPiRaTe__ has joined #ruby
SaveFerris has quit [Quit: Ping timeout (120 seconds)]
SaveFerris has joined #ruby
<havenwood>
isene: You're leaking `Clipboard` outside the `Rcurses` namespace.
<havenwood>
It's really quite important to not introduce new top level constants outside `Rcurses`.
<havenwood>
Just two gems need a `Clipboard` and you're toast.
<havenwood>
The only gem allowed to introduce `Clipboard` is `clipboard` gem.
<havenwood>
It would be good to create a `lib/rcurses/` directory and move most all of your `lib/rcurses.rb` stuff there.
<havenwood>
Like `module Rcurses; module Clipboard; ...; end; end` should be in `lib/rcurses/clipboard.rb`.
<havenwood>
It's where Rubyists and code loaders expect the file.
<havenwood>
Not putting constants inside your gem namespace will break things. If multiple folk do it it will break all the things.
<havenwood>
Then I'd make your String monkeypatch opt in, rather than enabled by default.
<havenwood>
Typically, you'd expect something like `lib/rcurses/core_ext/string` or similar.
<havenwood>
isene: Not following file structure conventions seems to be leading to dangerous leakage of constants. I'd recommend for your next version putting it into a Ruby gem file structure.
<havenwood>
Why `Rcurses::Rinput` but not `Rcurses::Curser` etc? Can you drop the Rs other than Rcurses?
<havenwood>
I mean but not `Rcurses::Rcurser`? I'd recommand against putting Rs everywhere.
<havenwood>
If Curser and Input are only used in Pane, consider making `lib/rcurses/pane/cursor.rb` and `lib/curses/pane/input.rb` and having those be `Rcurses::Pane::Input` and `Rcurses::Pane::Cursor`. In any case, make a `lib/rcurses/` directory and start moving stuff there.
chen has quit []
<havenwood>
Clipboard also only seems to be used in Pane.
<havenwood>
I'd suggest either 1) forget having an Rcurses module and make it the pane class, or 2) put everything under `lib/rcurses/pane.rb` and `lib/rcurses/pane/`.
chen has joined #ruby
<havenwood>
Oh, Clipboard is a gem. Okay.
livoreno has joined #ruby
<havenwood>
Add it as a gem dependency and know it's there rather than a load error asking to install.
<havenwood>
Which it seems you've done, so it _will_ be there. Assume so in the code.
<havenwood>
In that case, I'd require it from `lib/rcurses/pane.rb`.
<havenwood>
It's super confusing to see this flat file and I wouldn't know where to find these classes and Zeitwerk or autoload wouldn't know what to do either.
<havenwood>
Check out how gems do it and copy that style.
<havenwood>
We don't have "real" namespaces so it's super important.
chromis has joined #ruby
chen has quit [Quit: No Ping reply in 180 seconds.]
<isene>
But, but, but.... I Want it as One File to Rule'em All. One File, I say... ;-/
brokkoli_origin has quit [Remote host closed the connection]
<o0x1eef>
Interesting code. More or less agree with havenwood. Btw there's already String#b. Your monkeypatch is going to conflict with it.
dviola has joined #ruby
brokkoli_origin has joined #ruby
Vonter has quit [Ping timeout: 276 seconds]
Vonter has joined #ruby
<weaksauce>
hard agree with havenwood and also think you should make an optional rcurses task to install it to your vendor place and drop the extconf file... it's useless for anyone outside of your system
<weaksauce>
follow the convention to have it gem install to where every other gem gets installed
<weaksauce>
it will be installed system wide
<weaksauce>
as it stands it's brittle
donofrio has quit [Ping timeout: 248 seconds]
hwpplayer1 has quit [Quit: See you tomorrow take care !]
livoreno has quit [Quit: Connection closed for inactivity]
TomyWork has quit [Ping timeout: 252 seconds]
donofrio has joined #ruby
donofrio has quit [Ping timeout: 252 seconds]
donofrio has joined #ruby
Linux_Kerio has joined #ruby
user71 has quit [Quit: Leaving]
donofrio has quit [Remote host closed the connection]
donofrio has joined #ruby
polishdub has quit [Remote host closed the connection]
FetidToot7 has joined #ruby
FetidToot has quit [Ping timeout: 255 seconds]
FetidToot7 is now known as FetidToot
R2robot has quit [Quit: Pull the lever, Kronk. Wrong leverrrrrrr!]
R2robot has joined #ruby
polishdub has joined #ruby
donofrio_ has joined #ruby
donofrio has quit [Ping timeout: 248 seconds]
<isene>
Ok, fine. I yield. I like and respect you guys too much to be stubborn on this. I'll make a push for it tomorrow. Not sure I fully grasp it all, so bear with me.
polishdub has quit [Remote host closed the connection]
polishdub has joined #ruby
crespire has quit [Remote host closed the connection]
donofrio_ has quit [Ping timeout: 265 seconds]
crespire has joined #ruby
<o0x1eef>
You might take inspiration from the 'paint' gem when it comes to monkey patching String. Paint["some string", :bold] instead of "some string".b - I'm not sure how it would look for rcurses, maybe Rcurses["some text", :bold] or Rcurses["some text"].b
mange has joined #ruby
Linux_Kerio has quit [Ping timeout: 255 seconds]
szkl has quit [Quit: Connection closed for inactivity]
<isene>
Too convoluted/complex. I'll spell them out instead "some string".bold
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
<o0x1eef>
r("some string").bold :) No doubt there will be other gems out there that have defined 'String#bold'. So you might want to consider how that conflict can be resolved. Maybe refinements help. Maybe include a module into String instead of defining methods directly on the String class.
<weaksauce>
you can go the route that colorize takes where you can require one or the other file and it will have something like Colorize("word").red or "word".red depending on what you want