jhass[m] 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
jl- has quit [Ping timeout: 268 seconds]
Rounin has quit [Ping timeout: 268 seconds]
bhaak has joined #ruby
nirvdrum has joined #ruby
markong has quit [Ping timeout: 240 seconds]
havenwood has quit [Quit: The Lounge - https://thelounge.chat]
havenwood has joined #ruby
jl- has joined #ruby
John_Ivan has quit [Read error: Connection reset by peer]
John_Ivan has joined #ruby
pgib has quit [Ping timeout: 260 seconds]
nirvdrum_ has joined #ruby
nirvdrum has quit [Ping timeout: 240 seconds]
Sankalp has quit [Ping timeout: 268 seconds]
Sankalp has joined #ruby
John_Ivan has quit [Read error: Connection reset by peer]
duds- has quit [Max SendQ exceeded]
jl- has quit [Ping timeout: 268 seconds]
shiru has joined #ruby
duds- has joined #ruby
shiru has quit [Client Quit]
shiru has joined #ruby
<gr33n7007h> ruby is the boss!
<ule> gr33n7007h: not sure about that but definitely helps to pay the bills over here
<gr33n7007h> ule: no language comes close to being as "boss" as ruby, imho.
duds- has quit [Max SendQ exceeded]
<gr33n7007h> it's a damn fine language for sure
duds- has joined #ruby
nirvdrum_ has quit [Quit: nirvdrum_]
kristianpaul has quit [Ping timeout: 268 seconds]
duds- has quit [Max SendQ exceeded]
duds- has joined #ruby
nirvdrum has joined #ruby
Al2O3 has quit [Ping timeout: 255 seconds]
almanac2 has joined #ruby
almanac2 has quit [Ping timeout: 268 seconds]
Ziyan has joined #ruby
shiru has quit [Remote host closed the connection]
shiru has joined #ruby
shiru has quit [Client Quit]
shiru has joined #ruby
shiru has quit [Remote host closed the connection]
_ht has joined #ruby
Mikaela has quit [Ping timeout: 268 seconds]
Mikaela has joined #ruby
jl- has joined #ruby
jl- has quit [Ping timeout: 268 seconds]
teclator has joined #ruby
Furai has quit [Quit: WeeChat 3.6]
Furai has joined #ruby
SteveR has joined #ruby
Ziyan has quit [Quit: Textual IRC Client: www.textualapp.com]
rvalue has quit [Remote host closed the connection]
rvalue has joined #ruby
entropie has quit [Ping timeout: 255 seconds]
entropie has joined #ruby
dionysus69 has joined #ruby
jl- has joined #ruby
jl- has quit [Ping timeout: 252 seconds]
dionysus69 has quit [Ping timeout: 252 seconds]
dionysus69 has joined #ruby
ur5us has joined #ruby
SteveR has quit [Quit: Client closed]
arahael has quit [Ping timeout: 268 seconds]
arahael has joined #ruby
ur5us has quit [Ping timeout: 240 seconds]
reset has quit [Quit: reset]
Rounin has joined #ruby
reset has joined #ruby
ur5us has joined #ruby
Pixi` has joined #ruby
Pixi has quit [Ping timeout: 245 seconds]
ua_ has quit [Read error: Connection reset by peer]
ua_ has joined #ruby
ur5us has quit [Ping timeout: 240 seconds]
ur5us has joined #ruby
ur5us has quit [Ping timeout: 240 seconds]
Ziyan has joined #ruby
jpn has joined #ruby
twosuns has joined #ruby
jpn has quit [Ping timeout: 240 seconds]
TomyWork has joined #ruby
cognemo has quit [Quit: ZNC 1.8.2 - https://znc.in]
cognemo has joined #ruby
jpn has joined #ruby
jpn has quit [Ping timeout: 240 seconds]
jpn has joined #ruby
jpn has quit [Ping timeout: 268 seconds]
markong has joined #ruby
jpn has joined #ruby
jpn has quit [Ping timeout: 245 seconds]
Guest93 has joined #ruby
nmollerup has joined #ruby
<Guest93> hello, trying out the tutorial http://railscasts.com/episodes/250-authentication-from-scratch gave problems with Ruby 3.1.2p20 and Rails 7.0.3.1. Saving the user entity will make the attribut email nil. In Rails Console the behavior is the same. How can i fix it?
Ziyan_ has joined #ruby
Ziyan has quit [Ping timeout: 268 seconds]
Mikaela has quit [Remote host closed the connection]
Mikaela has joined #ruby
Mikaela has quit [Remote host closed the connection]
Mikaela has joined #ruby
jpn has joined #ruby
jl- has joined #ruby
jl- has quit [Ping timeout: 252 seconds]
arg_ has joined #ruby
Guest93 has quit [Quit: Client closed]
twosuns has quit [Quit: Leaving]
<Ziyan_> In Rails, I am writing specs to a helper method that calls another helper method. These helper methods are not on the same file. When I test the method that depends on the other, I get the NoMethodError. Is this normal behaviour?
Ziyan has joined #ruby
Ziyan_ has quit [Ping timeout: 240 seconds]
<Ziyan> mah... I forgot to use `helper.method_name`, when i added `helper.` to the method call it worked
brahmana has joined #ruby
<brahmana> Hi all. I am facing a somewhat weird problem with one of my Rails deployment. I am getting a "Broken Pipe" error from this file : /usr/lib/ruby/2.5.0/forwardable/impl.rb
<brahmana> This process is being started through monit using a shell script. Oddly, if I redirect the output of the command to a file, this error does not come up.
<brahmana> This is on Ubuntu 18.04.6 with ruby 2.5.8p224 (2020-03-31 revision 67882) [x86_64-linux-gnu]
<brahmana> Any pointers on what could be wrong?
gschanuel has quit [Quit: The Lounge - https://thelounge.chat]
protektwar has joined #ruby
protektwar has quit [Changing host]
protektwar has joined #ruby
John_Ivan has joined #ruby
ur5us has joined #ruby
<brahmana> To add a little more info about my question : The line which is raising a Broken Pipe error is this : iseq = RubyVM::InstructionSequence.compile("().#{method}", nil, nil, 0, false)
<brahmana> From what I understand it is just compiling a small ruby snippet. I am not able to figure out what could possibly cause a Broken Pipe error here.
<brahmana> I tried looking into the relevant C code but nothing stood out to me.
* brahmana is in no way fluent / familar with Ruby sources but can only try to see if something obvious can be spotted.
<Zerock> the redirection thing is suspicious. How are you actually executing your program?
<Zerock> I also know nothing of rails but that seems like it is losing the terminal somehow
<brahmana> I have a shell script which initially sets a bunch of ENV vars and then invokes my ruby script. The command has a & at the end to put the process in BG. So losing the terminal is correct.
<Zerock> does your shell script `wait` for the background thread to complete?
<Zerock> or are you using & as a way to daemonize it?
<brahmana> No, not really. The line that runs the ruby script is the last line. However this shell script is actually run by monit which daemonizes the process i.e. makes init the parent
<brahmana> What's surprising for me is that this has not been a problem for almost 2+ years and has suddenly cropped up now.
<Zerock> I would say to just remove & then and let it be in the foreground. It sounds like monit is daemonizing the shell script but when that terminates, the application is left without a terminal. You need to either redirect that or make the shell script wait for it to preserve the terminal
<Zerock> that is to say, monit is making init the parent of the script, but not the application
<Zerock> the application depends upon the script, but that quickly exits after starting the application
<brahmana> Oh ok..
<Zerock> that's my guess. I don't know the workings of monit, but the symptoms are right for that situation
<brahmana> IIRC, we explicitly added & otherwise monit would complain that the `start script` did not `return` or `complete`
<Zerock> hmm
<Zerock> I don't know then
<brahmana> Btw, what is the requirement here for a terminal?
<Zerock> the application is trying to write to stdout, but the target for stdout is lost, and this throws an i/o error
<Zerock> you could just redirect it to a log file, or if you don't care about the output, redirect it to /dev/null
<brahmana> This line `RubyVM::InstructionSequence.compile("().#{method}", nil, nil, 0, false)` tries to write to stdout, is it?
<Zerock> either that or something down the calling stack
<brahmana> hmm.. ok.. I wonder if it is something to do with this specific ruby version which did not exist in the yesteryears
<Zerock> possibly
<Zerock> I'm very new to ruby myself but have experienced similar issues with other applications in the past
<Zerock> it's also possible that a new version fixes it. I don't know if ubuntu has backports repos like debian you could try
<brahmana> Will check that.
<brahmana> Ok. Cool. I will keep the redirection in place for now since it is working. Will try to post this in the mailing list and see if somebody can point out the deeper cause.
<brahmana> Thank you very much Zerock
<Zerock> no problem, good luck!
brahmana has quit [Remote host closed the connection]
Mikaela is now known as Aminda
dionysus69 has quit [Ping timeout: 240 seconds]
Inoperable has joined #ruby
Inoperable has quit [Quit: All your buffer are belong to us!]
dionysus69 has joined #ruby
Inoperable has joined #ruby
John_Ivan has quit [Remote host closed the connection]
jl- has joined #ruby
jl- has quit [Ping timeout: 268 seconds]
<moo> tried out rails again today, and wow this time it didn't install 12 gb of javascript and didn't require nodejs :)
<moo> life's good now
<adam12> Import maps are definitely a nice improvement.
protektwar has quit [Ping timeout: 240 seconds]
<moo> normally i use sinatra but this might be good time for me haha
<adam12> I've been using Sinatra more lately. I forgot how much I enjoyed it.
<adam12> I use Roda in almost everything else, but there's something about looking at a list of routes and knowing how everything is going to match.
<moo> oh interesting, made by the same author as sequel , my another favorite
John_Ivan has joined #ruby
<adam12> Sinatra could have a few things that I think would make it way better. I know they are opting for stable, but it's definitely missing some core pieces.
<adam12> Like flash messages.
<moo> does eg. rails handle them in some special way?
<adam12> They ship with sessions. It seems like flash messages is a natural addition to that.
<moo> usually i just had some kind of variable passed to template and eg. layout.erb would check for flash message and do stuff
<adam12> Handle what in some special way?
<adam12> It's a special type of Hash that's cleared between requests.
<adam12> But it has a few more bits, like ability to set the _next_ hash with values without disrupting the current one.
<adam12> It's just surprising that it doesn't come with one. Every other implementation looks abandoned.
<adam12> If you compare it to Flask (from Python), it includes one. And some other nice bits.
<adam12> If hanami-router and hanami-controller v2-stable drop, I might just switch to using them for new projects.
arg_ has quit [Quit: Connection closed for inactivity]
brahmana has joined #ruby
dionysus69 has quit [Ping timeout: 252 seconds]
brahmana has quit [Ping timeout: 252 seconds]
aeris has quit [Remote host closed the connection]
aeris has joined #ruby
dviola has quit [Ping timeout: 245 seconds]
jpn has quit [Ping timeout: 240 seconds]
moldorcoder7 has quit [Ping timeout: 245 seconds]
moldorcoder7 has joined #ruby
fef has joined #ruby
fef has quit [Remote host closed the connection]
fef has joined #ruby
dviola has joined #ruby
Guest93 has joined #ruby
pgib has joined #ruby
dionysus69 has joined #ruby
markong has quit [Ping timeout: 268 seconds]
ur5us has quit [Ping timeout: 240 seconds]
Guest93 has quit [Quit: Client closed]
dviola has left #ruby [WeeChat 3.6]
dviola has joined #ruby
TomyWork has quit [Quit: Leaving]
brahmana has joined #ruby
brahmana has quit [Ping timeout: 252 seconds]
danjo007 has quit [Read error: Connection reset by peer]
danjo007 has joined #ruby
NightMonkey has quit [Quit: ZNC - http://znc.in]
NightMonkey has joined #ruby
protektwar has joined #ruby
protektwar has joined #ruby
protektwar has quit [Changing host]
dionysus69 has quit [Ping timeout: 252 seconds]
jl- has joined #ruby
howdoi has joined #ruby
fef has quit [Ping timeout: 268 seconds]
jl- has quit [Ping timeout: 245 seconds]
comeoooon has joined #ruby
<comeoooon> Hello! Any neat ways to simplify this little snippet? https://clbin.com/A4yoU
some14u has joined #ruby
<adam12> comeoooon: Probably help to have more context.
<comeoooon> adam12: https://clbin.com/IK9dj basically
<adam12> comeoooon: Would you ever do english AND danish (or another language) in the same method call?
<comeoooon> Not for the foreseeable future :D
<adam12> comeoooon: I'd fetch out the language, then use a case statement.
<adam12> comeoooon: languge = ld.fetch("languages").first.key.downcase; case language; when "en" # do some stuff; end.
<comeoooon> Cool! I'll give it a go thanks man!
<adam12> Oh, actually, the syntax is a little odd.
<comeoooon> Looks so much prettier
<comeoooon> hmm
<adam12> I think it might need to be ld.fetch("languages").first.keys.first.downcase
<adam12> IMHO, it would be better returning a more structured object from detect_language.
<adam12> Or flattening the keys a bit. So many choices.
<adam12> I'd use the case statement tho, for sure.
<comeoooon> Thanks a bunch my man!
dionysus69 has joined #ruby
arg_ has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Al2O3 has joined #ruby
<adam12> comeoooon: Probably a bunch of things to change. Depends on how far you want to go.
<adam12> comeoooon: If you control `detect_language`, I'd definitely have it return a Hash with all the keys and values.
protektwar has quit [Ping timeout: 240 seconds]
havenwood has quit [Quit: The Lounge - https://thelounge.chat]
havenwood has joined #ruby
John_Ivan has quit [Quit: Leaving]
Jonopoly has joined #ruby
some14u has joined #ruby
some14u has quit [Client Quit]
jhass has quit [Quit: Bye]
Ziyan has quit [Quit: Textual IRC Client: www.textualapp.com]
royo25 has joined #ruby
royo25 has quit [Client Quit]
jhass has joined #ruby
_ht has quit [Quit: _ht]
jl- has joined #ruby
heartbur1 has quit [Quit: Reconnecting]
heartburn has joined #ruby
jl- has quit [Ping timeout: 268 seconds]
<comeoooon> adam12: I really appreciate it!
jl- has joined #ruby
Pixi__ has joined #ruby
markong has joined #ruby
Spitfire_ has quit [Ping timeout: 240 seconds]
Hobbyboy has quit [Ping timeout: 268 seconds]
micro has quit [Ping timeout: 240 seconds]
mooff has quit [Ping timeout: 268 seconds]
arahael has quit [*.net *.split]
Pixi` has quit [*.net *.split]
mbarbar_ has quit [*.net *.split]
mbarbar_ has joined #ruby
arahael has joined #ruby
John_Ivan has joined #ruby
hightower2 has joined #ruby
jl- has quit [Ping timeout: 240 seconds]
teclator has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
pvalenta has quit [Quit: ZNC - https://znc.in]
nirvdrum has quit [Quit: nirvdrum]
Spitfire has joined #ruby
micro has joined #ruby
Hobbyboy has joined #ruby
mooff has joined #ruby
<comeoooon> adam12: The script I'm working on is actually all thanks to you
<comeoooon> For introducing me to ruby-nlp :thumbsup:
<comeoooon> Here's something cool by the way
<comeoooon> Soon *fingers crossed* a reverse engineered version of Google's Imagen should be available for Ruby: https://github.com/lucidrains/imagen-pytorch
howdoi has quit [Quit: Connection closed for inactivity]
dionysus69 has quit [Ping timeout: 268 seconds]
graywolf has joined #ruby
pvalenta has joined #ruby
<comeoooon> They call this new AI technology the death of human creativity
graywolf has quit [Quit: WeeChat 3.5]
jpn has joined #ruby
jpn has quit [Ping timeout: 240 seconds]
jl- has joined #ruby
Rounin has quit [Ping timeout: 268 seconds]
EternalSunshine has joined #ruby