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
<havenwood> It's remarkably little code to implement, but needs the native browser support to work perfectly.
rvalue- has joined #ruby
rvalue has quit [Ping timeout: 252 seconds]
rvalue- is now known as rvalue
jhass has quit [Remote host closed the connection]
jhass has joined #ruby
ptrxff has joined #ruby
cappy has joined #ruby
eddof13 has quit [Quit: eddof13]
donofrio has joined #ruby
___nick___ has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
___nick___ has joined #ruby
___nick___ has quit [Client Quit]
___nick___ has joined #ruby
kludger has quit [Ping timeout: 252 seconds]
kludger has joined #ruby
dviola has quit [Ping timeout: 248 seconds]
smp has quit [Ping timeout: 244 seconds]
smp has joined #ruby
fercell has quit [Ping timeout: 252 seconds]
fercell has joined #ruby
rvalue- has joined #ruby
rvalue has quit [Ping timeout: 252 seconds]
rvalue- is now known as rvalue
brokkoli_origin has quit [Ping timeout: 265 seconds]
brokkoli_originl has joined #ruby
Sampersand has joined #ruby
eddof13 has joined #ruby
eddof13 has quit [Client Quit]
ptrxff has quit [Quit: ptrxff]
cappy has quit [Quit: Leaving]
Vonter has joined #ruby
Guest73 has joined #ruby
Guest73 has quit [Client Quit]
Sampersand has quit [Ping timeout: 256 seconds]
ufi has joined #ruby
ufi has quit [Quit: Leaving]
donofrio has quit [Ping timeout: 260 seconds]
grenierm has joined #ruby
lunarkitty has quit [Quit: WeeChat 3.8]
lunarkitty has joined #ruby
desnudopenguino has quit [Ping timeout: 248 seconds]
kludger has quit [Ping timeout: 244 seconds]
kludger has joined #ruby
kynareth has joined #ruby
smp has quit [Ping timeout: 252 seconds]
szkl has quit [Quit: Connection closed for inactivity]
kynareth has quit [Remote host closed the connection]
gene has joined #ruby
rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #ruby
fercell has quit [Ping timeout: 245 seconds]
Linux_Kerio has joined #ruby
___nick___ has quit [Ping timeout: 260 seconds]
Rounin has quit [Ping timeout: 260 seconds]
weaksauc_ has quit [Remote host closed the connection]
Munto_ has joined #ruby
Munto has quit [Ping timeout: 276 seconds]
Munto_ has quit [Remote host closed the connection]
kludger has quit [Ping timeout: 252 seconds]
smp has joined #ruby
kludger has joined #ruby
kludger has quit [Quit: kludger]
kludger has joined #ruby
kludger has quit [Client Quit]
kludger has joined #ruby
<isene> havenwood: Fixed namespace (I think) and included gem-stuff in Github repo. Looks OK?
diego has joined #ruby
grenierm has quit [Ping timeout: 256 seconds]
diego is now known as Guest4609
Stenotrophomonas has joined #ruby
brokkoli_originl has quit [Ping timeout: 255 seconds]
kludger has quit [Ping timeout: 265 seconds]
kludger has joined #ruby
Rounin has joined #ruby
Linux_Kerio has quit [Ping timeout: 244 seconds]
TomyWork has joined #ruby
gene is now known as kynareth
donofrio has joined #ruby
Guest4609 has left #ruby [WeeChat 4.4.3]
dviola has joined #ruby
kludger has quit [Ping timeout: 244 seconds]
szkl has joined #ruby
kludger has joined #ruby
kludger_ has joined #ruby
kludger has quit [Ping timeout: 244 seconds]
mange has quit [Quit: Zzz...]
Linux_Kerio has joined #ruby
Stenotrophomonas is now known as brokkoli_origin
user71 has joined #ruby
kludger_ has quit [Ping timeout: 264 seconds]
kludger has joined #ruby
kludger has quit [Client Quit]
kludger has joined #ruby
eddof13 has joined #ruby
tuxcrafter has quit [Quit: Client closed]
tuxcrafter has joined #ruby
eddof13 has quit [Quit: eddof13]
tuxcrafter has quit [Quit: Client closed]
tuxcrafter has joined #ruby
<havenwood> isene: Did you push the `lib/rcurses/*` changes? I still see one file outside a namespace.
<havenwood> I do see the gem stuff! One note on that, add `rcurses-*.gem` or `*.gem` to your `.gitignore` or use a convention like building into `pkg/` and add `pkg/*` to `.gitignore` just to avoid accreting gem build artifacts into the repo.
<havenwood> I'd `git rm` the one that got in just to clean up.
kynareth has quit [Quit: WeeChat 4.4.3]
Starfoxxes has quit [Ping timeout: 252 seconds]
desnudopenguino has joined #ruby
cappy has joined #ruby
<havenwood> isene: Ah, I see, you put `Pane` in `Rcurses`. *Every* new class needs to be inside.
<havenwood> Have your `lib/rcurses.rb` be just a `module Rcurses` newline and `end`. Then create a `lib/rcurses/` directory for a file corresponding to each of your modules and classes.
<havenwood> (With the one exception of String, which you can put in `lib/rcurses/ext/string.rb`.)
<havenwood> So `Rcurses::Pane` is `lib/rcurses/pane.rb` and `Rcurses::Rinput` is `lib/rcurses/rpinput.rb` and so on.
<havenwood> No new classes or modules outside of `Rcurses` module, and all files in `lib/rcurses/` directory or subdirectories to reflect that namespace.
<havenwood> Require the `lib/rcurses/` files like `path.rb` and `rinput.rb` from your `lib/rcurses.rb` file.
<havenwood> Maybe avoid the "r" prefix outside gem name.
<havenwood> The convention is important to avoid namespace pollution but also for code loading.
<havenwood> Also nice for the reader. If I see an `Rcurses::Pane::StainedGlass` I go looking for a `lib/rcurses/pane/stained_glass.rb` file.
Linux_Kerio has quit [Ping timeout: 246 seconds]
Starfoxxes has joined #ruby
ftajhii has quit [Ping timeout: 260 seconds]
kludger has quit [Quit: kludger]
victori has joined #ruby
eddof13 has joined #ruby
kludger has joined #ruby
kludger has quit [Client Quit]
eddof13 has quit [Quit: eddof13]
kludger has joined #ruby
c10l has quit [Ping timeout: 260 seconds]
c10l has joined #ruby
eddof13 has joined #ruby
<o0x1eef> +1
Linux_Kerio has joined #ruby
<johnjaye> o0x1eef: since you're around, can you recommend a good place to start exploring ruby packages?
<johnjaye> mostly i'm interested in http server/networking atm but any kind of thing you can recommend to get started would be great
<o0x1eef> Maybe https://www.ruby-toolbox.com/ helps ? I understood the async gem and its related plugins / extensions are popular right now. IIRC the falcon web server in particular. Other people may be able to chime in as well
hwpplayer1 has joined #ruby
<johnjaye> i meant more like, things you absolutely have to know if you're going to do ruby if that makes sense
<johnjaye> but i'll check it out thanks
<o0x1eef> No worries
tuxcrafter78 has joined #ruby
tuxcrafter has quit [Quit: Client closed]
hwpplayer1 has quit [Quit: I'll be back later thanks all !]
TomyWork has quit [Quit: Leaving]
Vonter has quit [Quit: WeeChat 4.4.3]
kludger has quit [Ping timeout: 252 seconds]
entropie has quit [Quit: ""]
entropie has joined #ruby
kludger has joined #ruby
Sampersand has joined #ruby
donofrio has quit [Ping timeout: 255 seconds]
cappy has quit [Quit: Leaving]
donofrio has joined #ruby
eddof13 has quit [Quit: eddof13]
kludger has quit [Quit: kludger]
eddof13 has joined #ruby
eddof13 has quit [Client Quit]
eddof13 has joined #ruby
eddof13 has quit [Client Quit]
weaksauce has joined #ruby
kludger has joined #ruby
hightower3 has joined #ruby
rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #ruby
<isene> havenwood: That was a mouthful. Not sure I understand all of it... Would it be possible for you to do a PR on all that?
user71 has quit [Quit: Leaving]
<isene> havenwood: How do I reconcile this statement: "Have your `lib/rcurses.rb` be just a `module Rcurses` newline and `end`." with this: "Require the `lib/rcurses/` files like `path.rb` and `rinput.rb` from your `lib/rcurses.rb` file." What would be the full content of the lib/rcurses.rb file, then?
Sampersand has quit [Ping timeout: 256 seconds]
<havenwood> isene: Sorry, I meant for the `module Rcurses` to be empty, using the files only for requires.
<havenwood> It's fine to instead use your top level namespace, but it's not necessary.
<havenwood> isene: Yes, I can do a PR to show or explain.
<havenwood> For example, extract just one class like `Pane` to start.
<havenwood> Remove the code from `lib/rcurses.rb` and replace it with a `require_relative 'rcurses/pane'` at the top of that file.
<havenwood> Then create a `lib/rcurses/pane.rb` and paste your `module Rcurses` with nested `class Pane` into that file.
<havenwood> Confirm things work, rinse and repeat.
<havenwood> isene: If you want to try extracting just `Pane` we can confirm it's correct. Since Ruby doesn't have a more formal way for namespaces, these conventions end up being inordinately critical to follow.
desnudopenguino has quit [Ping timeout: 252 seconds]
<isene> What I don't get is why not have it all in one file?
<weaksauce> what do you gain from one file?
<havenwood> You can do that, just nesting classes and modules. It's not ideal since humans like things separated into discrete digestible parts and because autoloaders can take advantage of conventions to load things when needed, do it efficiently up front, and so on.
<havenwood> I saw a huge customer facing app for macOS that was on one line that was one of the strangest money-making apps I've ever seen.
<havenwood> You *can* do it, but you're fighting the conventions for both humans and machines.
<havenwood> It's a huge favor to yourself and others to learn Ruby conventions and follow them.
<havenwood> isene: If you have a strong preference for one file, you can ditch namespace-to-filename conventions but don't unless you have a good reason. It breaks tools that are nice.
<havenwood> I get the hesitance to split files. This "organization for the point of organization" can make it harder for me too. That said, the Ruby conventions are 100% worth following for the readership and functionality wins.
hightower4 has joined #ruby
hightower4 has quit [Remote host closed the connection]
hightower3 has quit [Ping timeout: 244 seconds]
hightower4 has joined #ruby
hightower3 has joined #ruby
kludger has quit [Remote host closed the connection]
hightower4 has quit [Ping timeout: 252 seconds]
kludger has joined #ruby
mms has joined #ruby
desnudopenguino has joined #ruby
kludger has quit [Ping timeout: 260 seconds]
mms has quit [Quit: leaving]
kludger has joined #ruby
mange has joined #ruby
Linux_Kerio has quit [Ping timeout: 245 seconds]
ua_ has quit [Ping timeout: 255 seconds]
kludger has quit [Ping timeout: 248 seconds]
kludger has joined #ruby
cappy has joined #ruby
donofrio has quit [Ping timeout: 252 seconds]
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
kludger has quit [Ping timeout: 244 seconds]
kludger has joined #ruby
<leftylink> oops. I was going too fast and accidentally did `min, min = xs.minmax`
<leftylink> the error was quickly caught when getting a NameError on `max`
<leftylink> but just imagine if I'd reused the variable and `max` was set by some previous line of code
<leftylink> that would have been a complete and utter disaster
Sampersand has joined #ruby