havenwood changed the topic of #ruby to: Rules: https://ruby-community.com | Ruby 3.2.0, 3.1.3, 3.0.5, 2.7.7: https://www.ruby-lang.org | Paste 4+ lines to: https://gist.github.com | Books: https://t.ly/9ua4 | Logs: https://libera.irclog.whitequark.org/ruby/
markong has joined #ruby
markong has quit [Ping timeout: 255 seconds]
myappie has joined #ruby
<myappie> heyy
<myappie> wuz the best gpt-like chatbot i can use with ruby?
John_Ivan has quit [Quit: Phantom of the future.]
snonux has quit [Ping timeout: 252 seconds]
myappie has left #ruby [#ruby]
gonix has quit [Ping timeout: 252 seconds]
ollysmith has quit [Quit: ZNC 1.8.2+deb3+b4 - https://znc.in]
ollysmith has joined #ruby
blaster has joined #ruby
<blaster> Hi I am trying to install ruby 2.7.6 on OSX 11.7.2, and when I run rbenv install 2.7.6 it's failing with "configure: error: cannot run C compiled programs."
<blaster> I have tried multiple solutions online but nothing seems to work.
<blaster> It's an intel x86_64 mac.
ollysmith has quit [Ping timeout: 252 seconds]
<adam12> blaster: What have you tried
<blaster> Reinstalling rbenv and reinstalling xcode tools
<adam12> blaster: How did you install rbenv?
<blaster> brew install rbenv ruby-build
<adam12> What's the output of `brew --prefix`
<blaster> adam12, /usr/local
<adam12> Can you paste entire error in a github gist? gist.github.com
<adam12> What's the output of `ls -fl /usr | grep local`
<blaster> drwxr-xr-x 14 root wheel 448 8 Jan 18:35 local
<blaster> I will paste the full output of the install in a moment, I just restarted to see if that might fix anything, and just waiting for the command to finish.
<adam12> No problem.
<blaster> It's seems to be doing more this time, hopefully it works.
<blaster> It worked :) I thought hail mary restarts were a Windows thing
<blaster> Thank you for the support
ollysmith has joined #ruby
<adam12> blaster: Cheers.
ollysmith has quit [Ping timeout: 252 seconds]
ollysmith has joined #ruby
razetime has joined #ruby
gonix has joined #ruby
caedmon has joined #ruby
caedmon has quit [Quit: caedmon]
howdoi has quit [Quit: Connection closed for inactivity]
jhass has quit [Ping timeout: 248 seconds]
gastus has joined #ruby
gastus_ has quit [Ping timeout: 248 seconds]
jhass has joined #ruby
moldorcoder7 has quit [Ping timeout: 252 seconds]
<ox1eef_> OptionParser makes no sense to me. Why does it have a concept of required, and optional options but do neither raise an error, or call an option block, if a "required" option is missing?
<ox1eef_> Now I know why Slop exists.
blaster has quit [Ping timeout: 248 seconds]
ur5us has quit [Ping timeout: 248 seconds]
c10l has quit [Read error: Connection reset by peer]
c10l has joined #ruby
gonix has quit [Remote host closed the connection]
Ziyan has joined #ruby
rvalue has quit [Remote host closed the connection]
rvalue has joined #ruby
Mo has joined #ruby
Aminda has quit [Remote host closed the connection]
<ox1eef_> In the end I decided to patch OptionParser to have a concept of a "required switch": https://gist.github.com/0x1eef/f44fceea40a9b5d9dfa9ec5fa5b184ac
Aminda has joined #ruby
ur5us has joined #ruby
teclator has joined #ruby
ur5us has quit [Ping timeout: 260 seconds]
reset has quit [Quit: reset]
_ht has joined #ruby
dviola has quit [Ping timeout: 246 seconds]
dviola has joined #ruby
quazimodo has quit [Ping timeout: 252 seconds]
razetime has quit [Ping timeout: 252 seconds]
ur5us has joined #ruby
razetime has joined #ruby
aestheti1 has quit [Ping timeout: 256 seconds]
snonux has joined #ruby
Ziyan has quit [Ping timeout: 268 seconds]
Ziyan has joined #ruby
Ziyan has quit [Quit: Textual IRC Client: www.textualapp.com]
jvalleroy has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
jvalleroy has joined #ruby
aestheti1 has joined #ruby
gonix has joined #ruby
gonix has quit [Client Quit]
TomyWork has joined #ruby
dionysus69 has joined #ruby
tomtmym has joined #ruby
tomtmym has quit [Changing host]
tomtmym has joined #ruby
ur5us has quit [Ping timeout: 255 seconds]
snonux has quit [Ping timeout: 246 seconds]
Petruchio has quit [Ping timeout: 246 seconds]
razetime has quit [Quit: See You Space Cowboy]
weaksauc_ has joined #ruby
weaksauce has quit [Ping timeout: 260 seconds]
Linux_Kerio has joined #ruby
gonix has joined #ruby
moldorcoder7 has joined #ruby
graywolf has joined #ruby
dionysus69 has quit [Ping timeout: 268 seconds]
graywolf has quit [Ping timeout: 252 seconds]
<rapha> hi all! does somebody know the answer to the question at https://gist.github.com/sixtyfive/c5dbc32710e8b9f6f36fe00b30e31632#file-recsorthash-rb-L8 ?
sphex_ has quit [Remote host closed the connection]
otisolsen70 has joined #ruby
Guest9185 has joined #ruby
Guest9185 has quit [Client Quit]
graywolf has joined #ruby
gonix has quit [Quit: AndroIRC - Android IRC Client ( http://www.androirc.com )]
m_antis has quit [Quit: ZNC - https://znc.in]
m_antis has joined #ruby
<sam113101> rapha: is_a? checks subclasses, whereas .class is the immediate class
<sam113101> also you don't have to turn it into a string, you can do seed[key].class == Hash
dionysus69 has joined #ruby
<rapha> oh
<rapha> but where is something being subclassed, sam113101?
<sam113101> rapha: you never explained the issue
<rapha> hmm
<rapha> but i demonstrated it, no?
<rapha> ah, wait, let me change the gist to not show my weird solution but the problem
<rapha> sam113101: ok, i hope https://gist.github.com/sixtyfive/c5dbc32710e8b9f6f36fe00b30e31632 now demonstrates my new question :)
Linux_Kerio has quit [Read error: Connection reset by peer]
Linux_Kerio has joined #ruby
<sam113101> rapha: because when you use Hash there, it refers to CoreExtensions::Hash rather than the standard library Hash, because of scoping
<sam113101> use seed[key].is_a?(::Hash) and it'll work
<rapha> woah!!! i've seen that before ... the ::Something notation ... and finally i learned what it is. thank you, sam113101!! :D
<sam113101> no problem
<adam12> ox1eef_: Worth upstreaming perhaps? I do find Optionparser both powerful and strange at the same time.
szkl has joined #ruby
Mo has quit [Ping timeout: 252 seconds]
moldorcoder7 has quit [Ping timeout: 252 seconds]
moldorcoder7_ has joined #ruby
dionysus69 has quit [Ping timeout: 252 seconds]
kovital has joined #ruby
aeris has quit [Remote host closed the connection]
jonathan8 has joined #ruby
<jonathan8> hi, I'm having trouble building a form partial with ERB. Basically, if I'm doing a form_with; model: <%= model %> it doesn't work.
<jonathan8> ERB doesn't seem to like one liners
_aeris_ has joined #ruby
jonathan8 has quit [Quit: Ping timeout (120 seconds)]
jonathan8 has joined #ruby
<ox1eef_> adam12: Yeah it crossed my mind. I will battle test the changes in my project, and see where it goes. I thought about forking it altogether as well.
<adam12> jonathan8: Can you shar what you're trying? It's not obvious from your example.
<adam12> jonathan8: (more code in a gist)
<jonathan8> OK.
<adam12> !!! Failed to download https://raw.githubusercontent.com/postmodern/ruby-versions/master/ruby/versions.txt to /Users/adam/.cache/ruby-install/ruby/versions.txt!
<adam12> Um, that's bizzare. havenwood you ever seen that?
<adam12> Oh. My wget from homebrew is corrupt. I wonder if ruby-install prefers wget over curl..
<jonathan8> To give you some context it's a partial where I'd like to be able to construct a form with different fields each time.
<adam12> jonathan8: Ah. If you take out the ERB brackets, what is the line you want?
<jonathan8> The thing is, form_with can take many different params.
<adam12> form_with model, id: form_id do |f|
<adam12> but only if model is present, if not, just `form_with id: form_id do |f|` ?
<jonathan8> Again I'd like something configurable. Like being able to pass, no parameters, model, or anything else.
<adam12> That was it. `brew reinstall wget` fixed it.
<adam12> jonathan8: IMHO? Pass in the created form object from outside the partial.
<adam12> <%= form_with your_options do |f| %>; <%= render "your_partial", f: f %>
<adam12> If that doesnt' work for you, perhaps you want to make a helper? form_with_options(model=nil, **opts) or something. Then you can build what you want inside Ruby, and not be at the whim of ERB parsing.
<jonathan8> Hum... It seems a good idea. I'll try that. Thanks.
<jonathan8> I like your first option.
finsternis has quit [Read error: Connection reset by peer]
jonathan8 has quit [Quit: Ping timeout (120 seconds)]
hightower3 has quit [Remote host closed the connection]
hightower3 has joined #ruby
hightower3 has quit [Ping timeout: 264 seconds]
hightower2 has joined #ruby
joto has quit [Ping timeout: 252 seconds]
joto has joined #ruby
szkl has quit [Quit: Connection closed for inactivity]
reset has joined #ruby
haxn9k has joined #ruby
ziqehu has joined #ruby
kovital has quit [Ping timeout: 264 seconds]
haxn9k has quit [Ping timeout: 252 seconds]
razetime has joined #ruby
razetime has quit [Remote host closed the connection]
<ox1eef_> Does Ruby still have a HTML builder, besides what's built into nokogiri ?
<ox1eef_> I seem to remember a library or two dedicated to it, but not anytime recently.
haxn9k has joined #ruby
ziqehu has quit [Ping timeout: 260 seconds]
teclator has quit [Ping timeout: 260 seconds]
__ht has joined #ruby
_ht has quit [Ping timeout: 248 seconds]
__ht is now known as _ht
ziqehu has joined #ruby
haxn9k has quit [Ping timeout: 260 seconds]
<adam12> ox1eef_: DSL like? Builder from Jim Weirich can do it, I think. Then there's oldschool Markaby, Erector, etc. New kid on the block is Phlex.
<ox1eef_> Thanks!
Exuma has joined #ruby
gr33n7007h has quit [Quit: WeeChat 3.8]
snonux has joined #ruby
gr33n7007h has joined #ruby
Exuma has quit [Quit: Textual IRC Client: www.textualapp.com]
crankharder has joined #ruby
eddof13 has joined #ruby
polishdub has joined #ruby
hightower2 has quit [Ping timeout: 248 seconds]
TomyWork has quit [Remote host closed the connection]
<ox1eef_> adam12: Came up with a simpler implementation of the "required" switch: https://github.com/0x1eef/optparse/pull/1/
eddof13_ has joined #ruby
hightower2 has joined #ruby
tsvallender has quit [Quit: Lost terminal]
eddof13_ has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
snonux has quit [Remote host closed the connection]
rantanplan has joined #ruby
<havenwood> ox1eef_: REXML is still in the stdlib, FWIW.
<havenwood> Oh, you said HTML not XML. >.>
<havenwood> I just read "Nokogiri" and thought XML. Never used Phlex but seems nice.
<ox1eef_> Nokogiri certainly works but it doesn't feel like an intended feature. There's a bit of hackery involved to generate a HTML fragment IIRC.
<adam12> I'm using Phlex on a project and it's been enjoyable. I've tried Markaby/etc in the past and it's been OK but I never stuck with it.
<ox1eef_> Do you know of effigy ? That was a cool idea.
<adam12> I can't place it.
<adam12> I'm still slightly worried about Phlex performance. That's _a lot_ of method calls, and more constants in RAM, but maybe it won't be that bad.
<leah2> p
<adam12> ox1eef_: Interesting.
<ox1eef_> I think you could even have placeholder content, and replace it. Nice way to develop in HTML first then add Ruby later.
<adam12> ox1eef_: Kinda reminds me of the view library for Pakyow.
<ox1eef_> What's that?
<adam12> Interesting, their website is offline.
ur5us has joined #ruby
<adam12> I wonder if it's dead. It was commercial, so I am surprised.
<ox1eef_> No commits since 2021. It is an interesting idea all the same.
<ox1eef_> Maybe a distant cousin of Angular. That's what hit me when reading the README.
<ox1eef_> Re RAM / peformance on a HTML builder - it is not a big of a deal in a static site.
Vonter has quit [Ping timeout: 260 seconds]
eddof13_ has joined #ruby
eddof13_ has quit [Client Quit]
Linux_Kerio has quit [Ping timeout: 268 seconds]
crankharder has quit [Ping timeout: 252 seconds]
rantanplan has quit [Ping timeout: 248 seconds]
aeris| has joined #ruby
rantanplan has joined #ruby
_aeris_ has quit [Remote host closed the connection]
willow has joined #ruby
willow has joined #ruby
willow has quit [Changing host]
willow has left #ruby [#ruby]
_ht has quit [Quit: _ht]
_aeris_ has joined #ruby
aeris| has quit [Ping timeout: 255 seconds]
<ox1eef_> https://gist.github.com/0x1eef/63cdbbd696aec4e1e992c67ab1d505a4 - Nice to see optparse work with Ryo out of the box.
<ox1eef_> Oh, just realized. :REQUIRED_ARGUMENT is not even needed. That's inferred from the short / long switch syntax.
_aeris_ is now known as aeris
rantanplan has quit [Ping timeout: 265 seconds]
teclator has joined #ruby
ur5us has quit [Ping timeout: 260 seconds]
crankharder has joined #ruby
crankharder has quit [Ping timeout: 248 seconds]
crankharder has joined #ruby
crankharder has quit [Ping timeout: 248 seconds]
___nick___ has joined #ruby
teclator has quit [Ping timeout: 248 seconds]
graywolf has quit [Quit: WeeChat 3.7.1]
otisolsen70 has quit [Quit: Leaving]
crankharder has joined #ruby
crankharder has quit [Ping timeout: 268 seconds]
davidw has joined #ruby
crankharder has joined #ruby
markong has joined #ruby
crankharder has quit [Ping timeout: 260 seconds]
Sankalp- has joined #ruby
Sankalp has quit [Ping timeout: 252 seconds]
Sankalp- is now known as Sankalp
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
eddof13 has joined #ruby
eddof13 has quit [Client Quit]
crankharder has joined #ruby
ruby[bot] has quit [Remote host closed the connection]
___nick___ has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
ruby[bot] has joined #ruby
___nick___ has joined #ruby
___nick___ has quit [Client Quit]
___nick___ has joined #ruby
crankharder has quit [Ping timeout: 248 seconds]
crankharder has joined #ruby
crankharder has quit [Ping timeout: 252 seconds]
aeris has quit [Remote host closed the connection]
aeris has joined #ruby
davidw has quit [Ping timeout: 260 seconds]