havenwood changed the topic of #ruby to: Ruby 3.3.6 (3.4.0-preview2) https://www.ruby-lang.org | Log https://libera.irclog.whitequark.org/ruby
mange has joined #ruby
MsInput has quit [Quit: WeeChat 4.4.3]
MsInput has joined #ruby
ih8u has quit [Quit: ih8u]
ih8u2 has joined #ruby
crespire has joined #ruby
TomyLobo2 has quit [Ping timeout: 252 seconds]
niv has quit [Ping timeout: 252 seconds]
niv has joined #ruby
crespire has quit [Remote host closed the connection]
niv has quit [Ping timeout: 248 seconds]
crespire has joined #ruby
crespire has quit [Killed (NickServ (GHOST command used by crespire1))]
crespire1 has joined #ruby
niv has joined #ruby
niv has quit [Ping timeout: 276 seconds]
crespire1 has quit [Ping timeout: 245 seconds]
Guest7231 has joined #ruby
crespire1 has joined #ruby
Guest7231 has quit [Client Quit]
R2robot has joined #ruby
donofrio has joined #ruby
niv has joined #ruby
donofrio has quit [Ping timeout: 252 seconds]
Pixi` has joined #ruby
sam113102 has joined #ruby
olusx has quit [Quit: No Ping reply in 120 seconds.]
vls has quit [Ping timeout: 246 seconds]
havenwood5 has joined #ruby
adam127 has joined #ruby
noahmg123 has quit [Ping timeout: 248 seconds]
crespire has joined #ruby
nirvdrum1 has joined #ruby
legahc has quit [Ping timeout: 252 seconds]
legahc- has joined #ruby
sam113101 has quit [Read error: Connection reset by peer]
sam113102 is now known as sam113101
itok has quit [Ping timeout: 252 seconds]
legahc- is now known as legahc
olus has joined #ruby
newton has quit [Ping timeout: 246 seconds]
crespire1 has quit [Ping timeout: 248 seconds]
Pixi has quit [Ping timeout: 246 seconds]
newton has joined #ruby
itok has joined #ruby
nirvdrum has quit [Ping timeout: 246 seconds]
aindilis has quit [Ping timeout: 246 seconds]
adam12 has quit [Ping timeout: 246 seconds]
havenwood has quit [Ping timeout: 246 seconds]
nirvdrum1 is now known as nirvdrum
adam127 is now known as adam12
havenwood5 is now known as havenwood
aindilis has joined #ruby
vls has joined #ruby
noahmg123 has joined #ruby
powersurge3604 has quit [Ping timeout: 260 seconds]
ih8u2 has quit [Ping timeout: 245 seconds]
ih8u2 has joined #ruby
bhaak has quit [Remote host closed the connection]
bhaak has joined #ruby
JulioPapel has joined #ruby
hwpplayer1 has joined #ruby
TomyLobo2 has joined #ruby
TomyWork has joined #ruby
TomyLobo2 has quit [Ping timeout: 252 seconds]
hwpplayer1 has quit [Remote host closed the connection]
Vonter has quit [Ping timeout: 276 seconds]
Vonter has joined #ruby
MsInput has quit [Quit: WeeChat 4.4.3]
MsInput has joined #ruby
MsInput has quit [Quit: WeeChat 4.4.3]
MsInput has joined #ruby
splud has quit [Ping timeout: 244 seconds]
donofrio has joined #ruby
cappy has joined #ruby
donofrio has quit [Ping timeout: 248 seconds]
hwpplayer1 has joined #ruby
donofrio has joined #ruby
user71 has joined #ruby
donofrio has quit [Ping timeout: 252 seconds]
donofrio has joined #ruby
mange has quit [Quit: Zzz...]
splud has joined #ruby
hwpplayer1 has quit [Ping timeout: 265 seconds]
<isene> rcurses 2.0 up (full code refactoring); https://github.com/isene/rcurses
cappy has quit [Quit: Leaving]
hwpplayer1 has joined #ruby
polishdub has quit [Ping timeout: 248 seconds]
polishdub has joined #ruby
chromis has quit []
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> Here's an example of moving the one `Pane` class: https://gist.github.com/havenwood/196aeaa58d3e18efdcb3b6ff978efdf9
<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.]
chen has joined #ruby
hwpplayer1 has joined #ruby
Hess has quit [Quit: The Lounge - https://thelounge.chat]
<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
<havenwood> I do think Paint is quite nicely done in particular.