adam12 changed the topic of #ruby to: Rules: https://ruby-community.com | Ruby 3.1.2, 3.0.4, 2.7.6: https://www.ruby-lang.org | Paste 4+ lines to: https://gist.github.com | Books: https://goo.gl/wpGhoQ | Logs: https://libera.irclog.whitequark.org/ruby/
grokify_ has joined #ruby
grokify has quit [Ping timeout: 252 seconds]
peirik__ has quit [Ping timeout: 256 seconds]
Aminda has quit [Ping timeout: 255 seconds]
Aminda has joined #ruby
c10l has quit [Quit: See ya! o/]
grokify_ has quit [Remote host closed the connection]
Aminda has quit [Read error: Connection reset by peer]
Aminda has joined #ruby
grokify has joined #ruby
c10l has joined #ruby
Aminda has quit [Remote host closed the connection]
grokify_ has joined #ruby
Aminda has joined #ruby
_aeris_ has quit [Remote host closed the connection]
grokify has quit [Ping timeout: 256 seconds]
_aeris_ has joined #ruby
grokify_ has quit [Ping timeout: 256 seconds]
hd1 has joined #ruby
lucerne has joined #ruby
goldfish has quit [Ping timeout: 260 seconds]
va5c0 has joined #ruby
va5c0 has quit [Client Quit]
Rounin has quit [Ping timeout: 248 seconds]
grokify has joined #ruby
grokify has quit [Remote host closed the connection]
dviola has quit [Changing host]
dviola has joined #ruby
moldorcoder7 has quit [Ping timeout: 240 seconds]
markong has quit [Ping timeout: 260 seconds]
_aeris_ has quit [Remote host closed the connection]
_aeris_ has joined #ruby
hd1 has quit [Quit: Connection closed]
Inoperable has quit [Ping timeout: 268 seconds]
crax23 has joined #ruby
cartdrige has quit [Ping timeout: 260 seconds]
In0perable has joined #ruby
tirnanog has quit [Quit: = ""]
Petruchio has quit [Read error: Connection reset by peer]
Petruchio has joined #ruby
grokify has joined #ruby
peirik__ has joined #ruby
peirik__ has quit [Ping timeout: 256 seconds]
grokify has quit [Ping timeout: 255 seconds]
grokify has joined #ruby
grokify has quit [Ping timeout: 260 seconds]
donofrio has joined #ruby
donofrio_ has quit [Ping timeout: 260 seconds]
hd1 has joined #ruby
grokify has joined #ruby
grokify has quit [Ping timeout: 255 seconds]
grokify has joined #ruby
FullMetalStacker has joined #ruby
grokify has quit [Ping timeout: 260 seconds]
ur5us has quit [Ping timeout: 256 seconds]
Aminda has quit [Ping timeout: 255 seconds]
Aminda has joined #ruby
Alhamdulillah[m] has joined #ruby
D_A_N_ has quit [Quit: leaving]
ur5us has joined #ruby
yella has joined #ruby
yella has quit [Remote host closed the connection]
otisolsen70 has joined #ruby
caedmon68 has joined #ruby
caedmon68 has quit [Client Quit]
caedmon has joined #ruby
moldorcoder7 has joined #ruby
caedmon has quit [Quit: caedmon]
caedmon has joined #ruby
reset has quit [Quit: reset]
desnudopenguino has quit [Ping timeout: 260 seconds]
GvJordan has quit [Read error: Software caused connection abort]
GvJordan has joined #ruby
caedmon has quit [Ping timeout: 260 seconds]
ur5us has quit [Ping timeout: 255 seconds]
yella has joined #ruby
ur5us has joined #ruby
code has joined #ruby
ur5us has quit [Ping timeout: 260 seconds]
Laplace has joined #ruby
ur5us has joined #ruby
teclator has joined #ruby
royo25 has joined #ruby
ccapndave has joined #ruby
A_Dragon has quit [Read error: Software caused connection abort]
Byteflux has quit [Read error: Software caused connection abort]
Byteflux has joined #ruby
A_Dragon has joined #ruby
peirik__ has joined #ruby
lutrinus has joined #ruby
moldorcoder7_ has joined #ruby
moldorcoder7 has quit [Ping timeout: 252 seconds]
Rounin has joined #ruby
Rounin has quit [Changing host]
Rounin has joined #ruby
hd1 has quit [Quit: Connection closed]
_aeris_ has quit [Remote host closed the connection]
_aeris_ has joined #ruby
BSaboia has quit [Read error: Software caused connection abort]
dionysus69 has joined #ruby
BSaboia has joined #ruby
crax23 has quit [Ping timeout: 260 seconds]
ccapndave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
some14u has joined #ruby
moldorcoder7 has joined #ruby
TomyWork has joined #ruby
moldorcoder7_ has quit [Ping timeout: 260 seconds]
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
supay has joined #ruby
some14u has joined #ruby
walez has joined #ruby
some14u has quit [Client Quit]
IsoLnCHiP has quit [Read error: Software caused connection abort]
walez___ has joined #ruby
IsoLnCHiP has joined #ruby
walez has quit [Ping timeout: 260 seconds]
some14u has joined #ruby
jvalleroy has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
jvalleroy has joined #ruby
some14u has quit [Client Quit]
<cxl> Hi all, I'm trying to have a generic ApplicationError class that is easily extensible. So I came up with this: https://dpaste.org/ZifeE but the PageUpdateStateJob isn't happy with the retry_on:, the error is "ArgumentError: #<ApplicationError: ApplicationError> must be an Exception class or a String referencing an Exception class". However, when I run ApplicationError::PageNotReady.is_a? Exception, I get true.
<cxl> Any ideas?
peirik__ has quit [Ping timeout: 260 seconds]
yosafbridge has quit [Quit: Leaving]
yella has quit [Ping timeout: 255 seconds]
SeaCreature102 has joined #ruby
yosafbridge has joined #ruby
<SeaCreature102> Hey guys, I'm seeking a fair analysis of Ruby on Rails vs Django Web Dev Frameworks, please say opinions and experiences and analysis here.
grokify has joined #ruby
grokify has quit [Ping timeout: 255 seconds]
some14u has joined #ruby
ur5us has quit [Ping timeout: 260 seconds]
SeaCreature102 has quit [Ping timeout: 260 seconds]
some14u has quit [Client Quit]
ua_ has quit [Ping timeout: 260 seconds]
alexherbo2 has joined #ruby
sixecho has quit [Quit: Bridge terminating on SIGTERM]
some14u has joined #ruby
wuming2[m] has quit [Quit: Bridge terminating on SIGTERM]
Alhamdulillah[m] has quit [Quit: Bridge terminating on SIGTERM]
tiziodcaio has quit [Quit: Bridge terminating on SIGTERM]
jhass[m] has quit [Quit: Bridge terminating on SIGTERM]
lutrinus has quit [Ping timeout: 248 seconds]
ua_ has joined #ruby
jhass[m] has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Sophira has quit [Ping timeout: 268 seconds]
Sophira has joined #ruby
royo25 has quit [Quit: Bye]
u0_a87 has joined #ruby
<FullMetalStacker> @SeaCreature102: What will you want to use it for. This is the No1 question you should clear
<FullMetalStacker> Generic analyses are of small value and if you seek those, you will find tons of them online in 1001 blog posts. IMHO most of them are failing because they don't compare the stacks for a specific use case. There is no one better for all, but the best tool for the specific goal. So tell us the goal and we can help
sixecho has joined #ruby
tiziodcaio has joined #ruby
Alhamdulillah[m] has joined #ruby
wuming2[m] has joined #ruby
<FullMetalStacker> this goal should not only contain the technical specifications of some web app, but also why you want to learn/use those web stacks should you be someone who asks because he wants to know what to learn. learning goals are very important to chose the right way
aeris- has joined #ruby
_aeris_ has quit [Ping timeout: 255 seconds]
<adam12> cxl: What happens if you pass it a string of the exception? "ApplicationError::PageNotReady"
<adam12> cxl: Your solution is creative, but I'd probably punt on the meta programming and just create the subclasses I want.
peirik__ has joined #ruby
alexherbo2 has quit [Ping timeout: 260 seconds]
supay has quit [Quit: Connection closed for inactivity]
aeris- is now known as aeris
Laplace has quit [Quit: Connection closed for inactivity]
u0_a87 has quit [Ping timeout: 252 seconds]
<cxl> adam12: Yeah, I thought it might be too clever
lutrinus has joined #ruby
aeris has quit [Quit: ZNC - http://znc.sourceforge.net]
markong has joined #ruby
aeris has joined #ruby
u0_a87 has joined #ruby
aeris has quit [Remote host closed the connection]
aeris has joined #ruby
cartdrige has joined #ruby
lutrinus has quit [Quit: lutrinus]
aeris has quit [Quit: ZNC - http://znc.sourceforge.net]
aeris has joined #ruby
<cxl> How do I get a module to autoload all *.rb files within a sub directory? Like I have './mymodule.rb' and I want it to load any rb file in './mymodule/*.rb' within the module? But without having to enumerate every single file, so that if I add a new class to that module in a new file, it will just get loaded into it.
<adam12> cxl: Zeitwerk.
<cartdrige> cxl: use something like flist = Dir[*/*.rb]; flist.each(){ |f| load(f) }
<cartdrige> not the exact syntax maybe, pseudocode, but that's the idea.
<cxl> Ok, and then the files in `mymodule/lala.rb` must also include `module MyModule; class MyClass...` or can they simply be `class MyClass` without the module explicitly specified?
crax23 has joined #ruby
supay has joined #ruby
cartdrige has quit [Ping timeout: 246 seconds]
cartdrige has joined #ruby
Y05hito__ has joined #ruby
crax23 has quit [Ping timeout: 260 seconds]
<Y05hito__> cxl, if the load() call is within the module definition it's probably not needed i'd say. However i'm not sure better test for it. But anyway, it's better to specify what module it belongs to
u0_a87 has quit [Ping timeout: 252 seconds]
<Y05hito__> So that if you look at the file separatly you know what it is/what module etc.
alexherbo2 has joined #ruby
<cxl> Y05hito__: Ok, got it
cartdrige has quit [Ping timeout: 260 seconds]
alexherbo2 has quit [Ping timeout: 260 seconds]
CrazyEddy has quit [Ping timeout: 255 seconds]
reset has joined #ruby
CrazyEddy has joined #ruby
crax23 has joined #ruby
CrazyEddy has quit [Ping timeout: 260 seconds]
crax23 has quit [Remote host closed the connection]
cartdrige has joined #ruby
Y05hito__ has quit [Ping timeout: 246 seconds]
CrazyEddy has joined #ruby
D_A_N_ has joined #ruby
Tempesta has quit [Quit: See ya!]
Tempesta has joined #ruby
lutrinus has joined #ruby
crax23 has joined #ruby
Y05hito__ has joined #ruby
cartdrige has quit [Ping timeout: 256 seconds]
ccapndave has joined #ruby
crax23 has quit [Ping timeout: 260 seconds]
lucerne has quit [Ping timeout: 256 seconds]
cartdrige has joined #ruby
cartdrige has quit [Max SendQ exceeded]
cartdrige has joined #ruby
Y05hito__ has quit [Ping timeout: 260 seconds]
gonix has joined #ruby
ccapndave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
u0_a87 has joined #ruby
ccapndave has joined #ruby
peirik__ has quit [Ping timeout: 252 seconds]
FullMetalStacker has quit [Remote host closed the connection]
grokify has joined #ruby
grokify has quit [Remote host closed the connection]
grokify has joined #ruby
u0_a87 has quit [Ping timeout: 246 seconds]
tirnanog has joined #ruby
grokify has quit [Remote host closed the connection]
FullMetalStacker has joined #ruby
some14u has joined #ruby
grokify has joined #ruby
<cxl> Does MyModel.counter.increment skip the model's callbacks? I know `increment!` does skip validations and callbacks, but not sure about `increment`.
<adam12> cxl: Doesn't update database record.
<adam12> Actually, that might be wrong method docs.
<adam12> Oh no, it's not. I think it's right.
gonix has quit [Ping timeout: 268 seconds]
alexherbo2 has joined #ruby
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ruby
otisolsen70_ has joined #ruby
otisolsen70 has quit [Ping timeout: 268 seconds]
desnudopenguino has joined #ruby
lutrinus has quit [Ping timeout: 260 seconds]
caedmon has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
grokify has quit [Remote host closed the connection]
grokify has joined #ruby
<cxl> adam12: ah so there is no other way than my_model.update(count: my_model.count + 1)
alexherbo2 has quit [Ping timeout: 260 seconds]
<adam12> cxl: You should look if there's a way to do it atomically.
yourfriend has joined #ruby
yourfriend has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
otisolsen70_ has quit [Quit: Leaving]
yourfriend has joined #ruby
niv has quit [Quit: Powered by LunarBNC: https://LunarBNC.net]
niv has joined #ruby
ccapndave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ccapndave has joined #ruby
grokify has quit [Remote host closed the connection]
ccapndave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ccapndave has joined #ruby
ccapndave has quit [Client Quit]
<cxl> adam12: What do you mean?
caedmon has quit [Ping timeout: 246 seconds]
<cxl> meh, I think I have to rethink that part, because it's very possible that two jobs will run in parallel and try to update the counter at the same time, which means the count might end up being wrong
lucerne has joined #ruby
ccapndave has joined #ruby
ccapndave has quit [Client Quit]
<adam12> cxl: Right. Doing it atomically means having the database do the update for you.
<adam12> cxl: I don't know how to do it in ActiveRecord.
ccapndave has joined #ruby
hrberg has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
hrberg has joined #ruby
hrberg has quit [Client Quit]
hrberg has joined #ruby
grokify has joined #ruby
walez___ has quit [Quit: Leaving]
grokify has quit [Ping timeout: 246 seconds]
cartdrige has quit [Ping timeout: 252 seconds]
caedmon has joined #ruby
dionysus69 has quit [Ping timeout: 252 seconds]
alexherbo2 has joined #ruby
ccapndave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ccapndave has joined #ruby
<havenwood> cxl: Consider `with_lock do` blocks for pessimistic locking.
caedmon has quit [Ping timeout: 252 seconds]
caedmon has joined #ruby
ccapndave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Al2O3 has quit [Ping timeout: 256 seconds]
ccapndave has joined #ruby
ccapndave has quit [Client Quit]
cartdrige has joined #ruby
caedmon has quit [Ping timeout: 252 seconds]
Al2O3 has joined #ruby
grokify has joined #ruby
grokify has quit [Remote host closed the connection]
grokify has joined #ruby
grokify has quit [Remote host closed the connection]
___nick___ has joined #ruby
grokify has joined #ruby
grokify has quit [Remote host closed the connection]
grokify has joined #ruby
alexherbo2 has quit [Ping timeout: 260 seconds]
grokify has quit [Remote host closed the connection]
grokify has joined #ruby
grokify has quit [Remote host closed the connection]
grokify has joined #ruby
grokify has quit [Ping timeout: 255 seconds]
crax23 has joined #ruby
cartdrige has quit [Ping timeout: 268 seconds]
Y05hito__ has joined #ruby
crax23 has quit [Ping timeout: 268 seconds]
grokify has joined #ruby
grokify has quit [Remote host closed the connection]
___nick___ has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
___nick___ has joined #ruby
___nick___ has quit [Client Quit]
___nick___ has joined #ruby
grokify has joined #ruby
markong has quit [Ping timeout: 252 seconds]
grokify has quit [Remote host closed the connection]
grokify has joined #ruby
donofrio_ has joined #ruby
grokify has quit [Remote host closed the connection]
donofrio has quit [Ping timeout: 252 seconds]
grokify has joined #ruby
grokify has quit [Remote host closed the connection]
supay has quit [Quit: Connection closed for inactivity]
grokify has joined #ruby
walez has joined #ruby
grokify has quit [Remote host closed the connection]
walez has quit [Quit: Leaving]
peirik__ has joined #ruby
_73 has joined #ruby
_ht has joined #ruby
peirik__ has quit [Ping timeout: 260 seconds]
teclator has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
<_73> If I say "foo = foo()", the variable foo is set to the return value of the foo() method. I get equivalent behavior if I say "bar = foo". However, if I say "foo = foo", then the variable is always set to nil. Why is this?
<leftylink> because if there is a variable and a function of the same name, that name without parentheses is presumed to be the variable, instead of the function
<_73> Ok, and Ruby thinks that the foo variable already exists when it goes to evaluate the right hand side of the expression?
<_73> thanks for that link
caedmon has joined #ruby
walez has joined #ruby
<leftylink> pandabot: rb foo = local_variables
<pandabot> [:foo] - https://carc.in/#/r/e4d0
<leftylink> we can see that therefore, when the time comes to evaluate the RHS, foo already exists at that point
<_73> Got it. This is an interesting edge case of the language.
<leftylink> pandabot: what's wat
<leftylink> "and what happens when you assign `a` to `a` with `a` undefined"? (no it doesn't explain why it happens, it is just showing it)
<adam12> I wonder if this will change on Ruby 3.2
<adam12> Nope.
grokify has joined #ruby
grokify has quit [Remote host closed the connection]
alexherbo2 has joined #ruby
ur5us has joined #ruby
Sankalp has quit [Ping timeout: 260 seconds]
Sankalp has joined #ruby
TomyWork has quit [Quit: Leaving]
FullMetalStacker has quit [Read error: Connection reset by peer]
walez has quit [Quit: Leaving]
cartdrige has joined #ruby
Y05hito__ has quit [Ping timeout: 252 seconds]
<leftylink> though this part did not materially affect the talk, at the point of saying `a = b` then `a` was already defined, so "with `a` undefined" was not true at that particular point. but it's okay, that demonstration was still true, defined or not
<leftylink> pandabot: rb begin; a = b; rescue; end; local_variables
<pandabot> [:a] - https://carc.in/#/r/e4dn
___nick___ has quit [Ping timeout: 248 seconds]
crax23 has joined #ruby
alexherbo2 has quit [Remote host closed the connection]
Aminda has quit [Remote host closed the connection]
Aminda has joined #ruby
cartdrige has quit [Ping timeout: 255 seconds]
_ht has quit [Remote host closed the connection]
crax23 has quit [Quit: Leaving]
grokify has joined #ruby
<adam12> heh
<isene> I am reading user input in the console with STDIN.gets , how can I supply a default value that the user can edit or add to if needed? Example, I want the user to enter a command, but give him "mkdir " as a default/ starting value. How?
<adam12> isene: You'd need something more than gets. Maybe reline.
<adam12> I'm not even sure you can provide a default/starting value to reline... hmm.
<isene> Well, any trick will do, I guess
aeris has quit [Ping timeout: 255 seconds]
<isene> I was first thinking that I could somehow force a string into STDIN, then do STDIN.gets and it should magically appear as if the user first entered that string. But nope.
<adam12> Not that simple, unfortunately :P
aeris has joined #ruby
<adam12> You might be able to simulate it, but you'd need to use io/console.
grokify has quit [Remote host closed the connection]
<isene> How, if I may ask?
<adam12> Well, just spitballing here, but if you use io/console, you can flip to raw mode. That can allow you to getc without it echoing to the screen.
<adam12> So you'd have a loop of getc, where you compare the characters. You can check for escape, carriage-return, etc. When you read a character that's not one of them, you can print it to the screen.
<adam12> And add it to your internal buffer.
<adam12> To clear a character, you might have to send an ANSI sequence.
aeris has quit [Remote host closed the connection]
<isene> Yeah, this is what I do with several of my ncurses applications. Trying to go simple than that with my xrpn project...
<isene> Looking at readline now to see if that could do the trick.
aeris has joined #ruby
markong has joined #ruby
<adam12> Ah nice
grokify has joined #ruby
aeris has quit [Remote host closed the connection]
_aeris_ has joined #ruby
grokify has quit [Remote host closed the connection]
_aeris_ is now known as aeris
cartdrige has joined #ruby
grokify has joined #ruby
aeris has quit [Client Quit]
<isene> 🤗
<isene> Thanks for that reminder about readline.
grokify has quit [Remote host closed the connection]
aeris has joined #ruby
soknte5 has joined #ruby
sam113102 has joined #ruby
m_antis_ has joined #ruby
smp_ has joined #ruby
grvgr_ has joined #ruby
jdmark_ has joined #ruby
mjacob_ has joined #ruby
gr_wity has joined #ruby
dostoyev1ky2 has joined #ruby
eam_ has joined #ruby
leftylin1 has joined #ruby
grawity has quit [Killed (zinc.libera.chat (Nickname regained by services))]
gr_wity is now known as grawity
Vonter_ has joined #ruby
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
soknte5 has quit [Ping timeout: 256 seconds]
jhass[m] has quit [*.net *.split]
m_antis has quit [*.net *.split]
Vonter has quit [*.net *.split]
jdmark has quit [*.net *.split]
smp has quit [*.net *.split]
sam113101 has quit [*.net *.split]
grvgr has quit [*.net *.split]
eam has quit [*.net *.split]
leftylink has quit [*.net *.split]
joast has quit [*.net *.split]
Sandlayth has quit [*.net *.split]
dostoyevsky2 has quit [*.net *.split]
mjacob has quit [*.net *.split]
grvgr_ is now known as grvgr
sam113102 is now known as sam113101
smp_ is now known as smp
Sandlayth has joined #ruby
dostoyev1ky2 has quit [Quit: leaving]
dostoyevsky2 has joined #ruby
wnd has quit [Ping timeout: 252 seconds]
jhass[m] has joined #ruby
wnd has joined #ruby
grokify has joined #ruby
wnd has quit [Read error: Connection reset by peer]
wnd has joined #ruby
cartdrige has quit [Quit: Leaving]
markong has quit [Ping timeout: 260 seconds]
moldorcoder7 has quit [Ping timeout: 256 seconds]
aeris has quit [Remote host closed the connection]
Aminda has quit [Remote host closed the connection]
Aminda has joined #ruby
aeris has joined #ruby
wnd has quit [Remote host closed the connection]
wnd has joined #ruby
<adam12> isene: cheers.
Aminda has quit [Ping timeout: 255 seconds]
Aminda has joined #ruby