havenwood changed the topic of #ruby to: Rules: https://ruby-community.com | Ruby 3.1.1, 3.0.3, 2.7.5: https://www.ruby-lang.org | Paste 4+ lines to: https://gist.github.com | Books: https://goo.gl/wpGhoQ
freeworld has quit [Ping timeout: 256 seconds]
ua_ has joined #ruby
markong has quit [Ping timeout: 240 seconds]
hanzo has quit [Quit: Connection closed for inactivity]
<mooff> an IRC bot library, composed of small modules
<ox1eef> generally i would say it is not a good idea, storing things on the class is much like using globals
<mooff> in which regards?
<ox1eef> classes are usually referenced by constants that are accessible from everywhere in your program, including different threads. my rule of thumb is to keep as much as possible local to a given thread.
<mooff> race safety, that's a reasonable point
<ox1eef> i like how JS handles this, where other ES6 modules are references in the local scope.
<mooff> don't ES6 imports give the same object, when used in different files, like CommonJS?
<ox1eef> i don't think so, at least 'import foo from "foo.js"' followed by foo.bar = 1, keeps that change local to its scope. if you wanted your changes to hang around, probably you want to add them to 'window' or another global object.
<mooff> cool
<mooff> here's basically what i've got, to concretize: https://dpaste.org/WmE1
<ox1eef> it looks good, but id just repeat what i said before - do you really need class methods? couldn't the hooks be on the bot instance itself?
<mooff> the hooks are, but the configure actions are there to add the hooks onto instances
<mooff> classes fit nicely in their role as templates, i think
gr33n7007h has quit [Ping timeout: 240 seconds]
<ox1eef> they're shared state by all bot instances though, and i think not neccessary. it seems that too could belong to the Bot instance.
<mooff> i'm using it to run many bots in a process, and they're made / modified a lot at runtime
gr33n7007h has joined #ruby
<mooff> it would be onerous to have to add behavior 'by hand' after an instance is constructed
<mooff> especially when a lot.. for example, the PONG reply given by Bot::Pong.. is common to most instances
<ox1eef> if you want to have multiple bots per process then it sounds like having each isolated to one thread with no shared state would be ideal. i dont fully understand what youre trying to do in terms of sharing behavior tho.
<mooff> atm they do run! in separate threads, but their behavior is composed at a class level
<mooff> i did want instances to be flexible. the on instance method is the thing that ultimately binds actions
<mooff> how do you feel about ActiveModel, ActionController etc?
<ox1eef> rails is the model thats proven itself most successful in ruby, and i think that speaks to itself. having said that, the rails model isnt the only model and at times it feels like one guys opinion.
<mooff> you might appreciate this. gave me a chuckle last night https://boyter.org/static/books/Cfh9oRrXIAAiA2Y.jpg
<ox1eef> lol
justGhost has quit [Read error: Connection reset by peer]
justGhost has joined #ruby
unyu has quit [Quit: brb]
ua_ has quit [Ping timeout: 272 seconds]
<leftylink> pandabot: what's ruby globals
Rounin has quit [Ping timeout: 256 seconds]
ua_ has joined #ruby
polishdub has joined #ruby
ua_ has quit [Ping timeout: 256 seconds]
unyu has joined #ruby
polishdub has quit [Quit: leaving]
teclator has joined #ruby
teclator has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
reset has quit [Quit: reset]
gr33n7007h has quit [Quit: WeeChat 3.4]
bluedust has quit [Remote host closed the connection]
freeworld has joined #ruby
_ht has joined #ruby
bluedust has joined #ruby
szkl has joined #ruby
taupiqueur has joined #ruby
Rounin has joined #ruby
bluedust has quit [Remote host closed the connection]
perrierjouet has joined #ruby
Dooky has joined #ruby
ua_ has joined #ruby
bluedust has joined #ruby
markong has joined #ruby
TomyLobo has joined #ruby
bluedust_ has joined #ruby
bluedust has quit [Ping timeout: 256 seconds]
roadie has joined #ruby
bluedust_ has quit [Remote host closed the connection]
roadie has quit [Ping timeout: 240 seconds]
szkl has quit [Quit: Connection closed for inactivity]
___nick___ has joined #ruby
___nick___ has quit [Client Quit]
___nick___ has joined #ruby
bluedust has joined #ruby
ollysmith has quit [Quit: ZNC 1.8.2+deb2+b1 - https://znc.in]
ollysmith has joined #ruby
ollysmith has quit [Client Quit]
ollysmith has joined #ruby
bluedust has quit [Remote host closed the connection]
justGhost is now known as justAstache
Sheilong has joined #ruby
ua_ has quit [Ping timeout: 240 seconds]
reset has joined #ruby
ua_ has joined #ruby
taupiqueur has quit [Ping timeout: 272 seconds]
John_Ivan has joined #ruby
bluedust has joined #ruby
bluedust has quit [Ping timeout: 256 seconds]
taupiqueur has joined #ruby
taupiqueur has quit [Ping timeout: 256 seconds]
fef has joined #ruby
markong has quit [Ping timeout: 250 seconds]
Dooky has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
taupiqueur has joined #ruby
Aylat has joined #ruby
Aylat has quit [Changing host]
Aylat has joined #ruby
dviola has quit [Ping timeout: 240 seconds]
havenwood has quit [Quit: The Lounge - https://thelounge.chat]
havenwood has joined #ruby
perrierjouet has quit [Ping timeout: 240 seconds]
FetidToot7 has joined #ruby
FetidToot has quit [Ping timeout: 256 seconds]
FetidToot has joined #ruby
FetidToot7 has quit [Ping timeout: 256 seconds]
taupiqueur has quit [Ping timeout: 256 seconds]
fef has quit [Ping timeout: 240 seconds]
michigan has joined #ruby
<michigan> Hi! I run this forum app on my main www.myapp.com, with two secondary apps photos.myapp.com and shop.myapp.com. Each are separate Rails apps. Should I keep it like that, or turn them all into a single app?
<michigan> From what I understand the pros are: It would eliminate unnecessary code repetition and make upgrading and maintenance much easier. Having a single user database sounds nice too.
<michigan> On the flipside, the app would be complicated by (please correct me if I'm wrong) namespaces, routes, tenants and possibly even Rails Engines. I'd also have to restructure everything in Git.
<weaksauce> that's a tough question to answer
va5c0 has joined #ruby
<michigan> Cool. That means it at least isn't a dumb question :-)
<weaksauce> like anything there are tradeoffs
<weaksauce> are they all bespoke projects?
<weaksauce> how big?
_ht has quit [Remote host closed the connection]
<michigan> Nope, they're all personal.
<weaksauce> how are the apps architected right now?
<michigan> The main app currently clocks in at 110 commits. The other ones around 50.
<michigan> I can show you the log, hold up.
<michigan> Actually, any advice to improve this log would also be sincerely appreciated.
swaggboi has quit [Quit: C-x C-c]
<michigan> The two other apps share the same commits up until "Images: Add ImageProcessing gem".
<michigan> Not sure if all this is related to my original question, but still.
<weaksauce> if they are in the same domain it makes sense to have them all in one app typically...
<weaksauce> depends
<weaksauce> depending on the shopping requirements it can be separate or if it's simple then in one
<weaksauce> really tough to say with any certainty
<mooff> probably a good question for #rubyonrails
<michigan> Good point.
___nick___ has quit [Ping timeout: 272 seconds]
<michigan> mooff: #rubyonrails is dead though :(
<mooff> i just joined it. eek :(
<michigan> Hopefully my question should be more of a general Ruby webapp question, but I can see how it's not.
<weaksauce> not to drive people away from irc but michigan you can ask in the ruby discord too
<weaksauce> irc is still good
<weaksauce> weekends are slow though
<michigan> mooff: I remember it used to be something though! Back when Radar et. al. used to be around :(
<weaksauce> yeah it was pretty prolific a while back
<michigan> weaksauce: Will do so!
<michigan> Yeah :-)
<weaksauce> turns out the freenode thing and generally rails questions are not all that common any more since it's a stable thing
<michigan> Then, as you'd have it, they all went and got married and had children :lol:
<mooff> which answer do you want to your question, btw? :P
<weaksauce> have you tried the flip the coin trick?
<mooff> i haven't Rails'd since about 2016, but working with engines, esp when they lived in different repos, was always a pain
swaggboi has joined #ruby
Aylat has quit [Read error: Connection reset by peer]
<michigan> mooff: Whether or not I should combine multiple apps (under the same domain) into one :P
<michigan> mooff: Good to have that confirmed, thanks 👍
<mooff> i'll just say "it's okay to monolith"
<mooff> you can forgive yourself & enjoy
<weaksauce> it probably simplifies things too
<michigan> Thanks a lot for the advice guys!
va5c0 has quit [Ping timeout: 240 seconds]
markong has joined #ruby
va5c0 has joined #ruby
TCZ has joined #ruby
va5c0 has quit [Read error: Connection reset by peer]
goldfish has joined #ruby
bluedust has joined #ruby
va5c0 has joined #ruby
bluedust has quit [Ping timeout: 256 seconds]
roadie has joined #ruby
TCZ has quit [Quit: Leaving]
oxfuxxx has joined #ruby
roadie has quit [Ping timeout: 272 seconds]