adam12 changed the topic of #ruby to: Rules: https://ruby-community.com | Ruby 3.0.2, 2.7.4, 2.6.8: https://www.ruby-lang.org | Paste 4+ lines to: https://gist.github.com | Books: https://goo.gl/wpGhoQ
neshpion has joined #ruby
gggp_ has quit [Remote host closed the connection]
gggp_ has joined #ruby
gggp_ has quit [Remote host closed the connection]
gggp_ has joined #ruby
gggp_ has quit [Remote host closed the connection]
gggp_ has joined #ruby
gggp_ has quit [Remote host closed the connection]
gggp_ has joined #ruby
ua_ has quit [Excess Flood]
ua_ has joined #ruby
ur5us__ has quit [Ping timeout: 256 seconds]
va5c0 has joined #ruby
gggp__ has joined #ruby
gggp_ has quit [Ping timeout: 256 seconds]
Rounin has quit [Ping timeout: 268 seconds]
va5c0 has quit [Ping timeout: 258 seconds]
gggp_ has joined #ruby
ur5us__ has joined #ruby
gggp__ has quit [Ping timeout: 240 seconds]
gggp__ has joined #ruby
gggp_ has quit [Ping timeout: 256 seconds]
gggp has joined #ruby
gggp__ has quit [Ping timeout: 245 seconds]
vaillancourtmax has joined #ruby
vaillancourtmax has quit [Ping timeout: 245 seconds]
lunarkitty has quit [Quit: Connection closed for inactivity]
lunarkitty has joined #ruby
neshpion has quit [Quit: neshpion]
gggp_ has joined #ruby
gggp has quit [Ping timeout: 258 seconds]
gggp_ is now known as gggp
shokohsc has quit [Read error: Connection reset by peer]
shokohsc has joined #ruby
ua_ has quit [Ping timeout: 258 seconds]
ua_ has joined #ruby
gggp_ has joined #ruby
gggp has quit [Ping timeout: 240 seconds]
gfawcett3 has quit [Quit: The Lounge - https://thelounge.chat]
gfawcett3 has joined #ruby
ua_ has quit [Ping timeout: 272 seconds]
ua_ has joined #ruby
llua has quit [Quit: <Rudolph> shell code is what greycat reads to kids when he tucks them in]
gggp__ has joined #ruby
llua has joined #ruby
gggp_ has quit [Ping timeout: 250 seconds]
va5c0 has joined #ruby
lunarkitty has quit [Quit: Connection closed for inactivity]
va5c0 has quit [Ping timeout: 272 seconds]
_ht has joined #ruby
gggp_ has joined #ruby
ur5us__ has quit [Ping timeout: 272 seconds]
gggp__ has quit [Ping timeout: 258 seconds]
gggp__ has joined #ruby
gggp_ has quit [Ping timeout: 258 seconds]
reset has quit [Quit: reset]
ua_ has quit [Ping timeout: 258 seconds]
ua_ has joined #ruby
gggp__ has quit [Read error: Connection reset by peer]
kluk has joined #ruby
<kluk> I can't install ruby 3.0.2 on my mac 10.13; neither via rbenv nor installing from source. both fail with this error: "./include/ruby/internal/scan_args.h:264:48: error: use of undeclared identifier 'fmt'; did you mean 'fma'?". Is there a way to get it to work?
xall has quit [Quit: Client closed]
teclator has joined #ruby
gggp has joined #ruby
kaleido has joined #ruby
kaleido has joined #ruby
kaleido has quit [Changing host]
gggp_ has joined #ruby
TomyWork has joined #ruby
gggp has quit [Ping timeout: 240 seconds]
gggp__ has joined #ruby
gggp_ has quit [Ping timeout: 258 seconds]
Oxfuxxx_ has joined #ruby
Oxfuxxx_ has quit [Read error: Connection reset by peer]
Oxfuxxx has quit [Read error: Connection reset by peer]
Oxfuxxx has joined #ruby
plujon has quit [Remote host closed the connection]
gggp_ has joined #ruby
gggp__ has quit [Ping timeout: 240 seconds]
gggp__ has joined #ruby
gggp_ has quit [Ping timeout: 258 seconds]
Rounin has joined #ruby
va5c0 has joined #ruby
va5c0 has quit [Ping timeout: 256 seconds]
flooose has joined #ruby
flooose has quit [Remote host closed the connection]
flooose has joined #ruby
qk1z has quit [Ping timeout: 250 seconds]
va5c0 has joined #ruby
va5c0 has quit [Ping timeout: 258 seconds]
va5c0 has joined #ruby
qk1z has joined #ruby
va5c0 has quit [Ping timeout: 258 seconds]
jetchisel has joined #ruby
gggp_ has joined #ruby
gggp__ has quit [Ping timeout: 240 seconds]
gggp__ has joined #ruby
weyhmueller has quit [Quit: ZNC 1.8.2 - https://znc.in]
gggp_ has quit [Ping timeout: 252 seconds]
weyhmueller has joined #ruby
gggp__ has quit [Remote host closed the connection]
gggp__ has joined #ruby
reset has joined #ruby
<adam12> kluk: Intel or M1?
<adam12> kluk: Actually, looking at 10.13 makes me think an Intel.
<adam12> kluk: I'd try compiling other versions, one by one, starting from 3.0.1, and see if you can compile any down to the 2.5 branch. If you can't, it might be environment specific, but if it's 3.0.2 only (or 3.x only), it might be worth a bug report to bugs.ruby-lang.org.
gggp__ is now known as gggp
gggp_ has joined #ruby
danjo has joined #ruby
Oxfuxxx_ has joined #ruby
Oxfuxxx_ has quit [Read error: Connection reset by peer]
gggp has quit [Ping timeout: 258 seconds]
Oxfuxxx_ has joined #ruby
Oxfuxxx has quit [Ping timeout: 256 seconds]
Guest74 has joined #ruby
<Guest74> Hello, is it acceptable in Ruby to have a method return different types, depending on a conditional inside? Or does the caller always expect that it will always return the same object type?
<adam12> Guest74: You can return different types, but I'd say that violates Principle of Least Surprise, so you should at least consider what you're doing when you choose to do that.
<Guest74> Thanks @adam12, my method has an (async=false) param, so will either return the actual result or a reference to the job. I'm guessing best practice would be to have foo() and foo_async() instead?
<adam12> Guest74: I'd probably do that, unless you could find a way for both types of return values to share the same API.
<adam12> Guest74: ie. do you eventually call foo.value for an async call? if that's the case, you could return an object that has a value method that is synchronous.
<Guest74> Good point. Thanks! adam12
<adam12> Guest74: If the API is more complex then that, I'd personally split the methods.
<Guest74> Yeah, I'll split avoid extra unnecessary complexities.
<Guest74> Yeah, I'll split and avoid extra unnecessary complexities.
<nakilon> lots of stdlib methods return different types, it's ok
<nakilon> at least when it can return Nil
gggp__ has joined #ruby
gggp_ has quit [Ping timeout: 240 seconds]
gggp_ has joined #ruby
gggp__ has quit [Ping timeout: 272 seconds]
Guest74 has quit [Quit: Client closed]
gggp_ has quit [Ping timeout: 252 seconds]
gggp has joined #ruby
<kluk> adam12 I am on an Intel
<kluk> adam12 Thank you for your tip, I like it and will do it, much appreciated.
qk1z has quit [Ping timeout: 276 seconds]
fmccann has joined #ruby
fmccann has quit [Client Quit]
crankharder has joined #ruby
<crankharder> is there a gem install command that will install the version of bundler defined in Gemfile.lock or do I have grep/parse Gemfile.lock to get that info?
<adam12> crankharder: I don't believe there is one.
<crankharder> gem install bundler -v $(grep "BUNDLED WITH" -A 1 Gemfile.lock | tail -n 1) should work, but seems like there should be a more better way
<crankharder> werd, cheers
easbarbosa has joined #ruby
fmccann has joined #ruby
fmccann has quit [Quit: My computer has gone to sleep 😴]
fmccann has joined #ruby
fmccann has quit [Client Quit]
fmccann has joined #ruby
fmccann has quit [Client Quit]
motherr has joined #ruby
Oxfuxxx has joined #ruby
Oxfuxxx_ has quit [Ping timeout: 245 seconds]
Oxfuxxx_ has joined #ruby
Oxfuxxx has quit [Ping timeout: 256 seconds]
Tempesta has quit [Quit: AdiIRC is updating to v4.1 Beta Build (2021/08/05 UTC) 64 Bit]
Tempesta has joined #ruby
Oxfuxxx_ has quit [Read error: Connection reset by peer]
Oxfuxxx has joined #ruby
Oxfuxxx has quit [Ping timeout: 245 seconds]
Oxfuxxx has joined #ruby
Oxfuxxx has quit [Read error: Connection reset by peer]
Oxfuxxx has joined #ruby
teclator has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
kaleido has quit [Ping timeout: 276 seconds]
Oxfuxxx_ has joined #ruby
Oxfuxxx has quit [Ping timeout: 258 seconds]
<nakilon> can't find the term explained anywhere
TomyWork has quit [Quit: Leaving]
kaleido has joined #ruby
kaleido has joined #ruby
kaleido has quit [Changing host]
orbyt has joined #ruby
xall has joined #ruby
<adam12> nakilon: I suspect it's just the wrong word used, and "remote" would of been more appropriate.
orbyt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orbyt has joined #ruby
orbyt has quit [Client Quit]
<kluk> adam12 I tried ruby 3.0.1 and ruby 3.0.0 and they all failed like 3.0.2 in the exact same way: https://gist.github.com/jasnow/74c79f042c9da9f3d4319acf13e590ca
<kluk> i.e. ./include/ruby/internal/scan_args.h:264:48: error: use of undeclared identifier 'fmt'; did you mean 'fma'?
<rg> i think rvm has binaries for osx you might be able to use
<kluk> I'd love some binaries
<rg> rvm offers them afaik
<kluk> I know nothing about rvm but I'll install it right now. is there something important like a flag I need to know in order to get binaries?
<rg> it's default behavior, if it finds it'll use them
<kluk> thank you!
_ht has quit [Remote host closed the connection]
<rg> yw
gggp has quit [Ping timeout: 276 seconds]
manuel has joined #ruby
_ht has joined #ruby
lunarkitty has joined #ruby
manuel has quit [Quit: Leaving]
<kluk> Okay! on my laptop I updated my mac os x to the latest and ruby 3.0.2 installs fine there. Thank you for the help.
<kluk> I will update my desktop and try ruby 3.0.2 on it and I'm sure it will work just like on my laptop
gr33n7007h has joined #ruby
<rg> cool
seydar has joined #ruby
<seydar> I dislike how in order to use some array methods on a range, I have to explicitly call #to_a on the range
<seydar> I think my code looks ugly when I have to do (1..10).to_a.combination(4).etc.etc.
<leftylink> yeah or sometimes I want a random letter so I'll try (?a..?z).sample ... too bad for me
<nakilon> [*1..10]
<nakilon> though it's weird that there is implicit casting of everything to String, but not Range to Array
orbyt has joined #ruby
seydar has quit [Quit: leaving]
goldfish has joined #ruby
goldfish has quit [Ping timeout: 256 seconds]
goldfish_ has joined #ruby
thiccdaddy has joined #ruby
desnudopenguino has quit [Ping timeout: 276 seconds]
desnudopenguino has joined #ruby
cer-0 has joined #ruby
Oxfuxxx has joined #ruby
Oxfuxxx has quit [Client Quit]
chromis has quit [Ping timeout: 240 seconds]
Oxfuxxx_ has quit [Ping timeout: 276 seconds]
chonkbit has joined #ruby
Oxfuxxx has joined #ruby
Oxfuxxx has quit [Client Quit]
Oxfuxxx has joined #ruby
rubion has joined #ruby
orbyt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
goldfish__ has joined #ruby
goldfish_ has quit [Ping timeout: 258 seconds]
crankharder has quit [Ping timeout: 258 seconds]
crankharder has joined #ruby
chromis has joined #ruby
kenliten has joined #ruby
goldfish_ has joined #ruby
goldfish_ has quit [Remote host closed the connection]
goldfish has joined #ruby
<kenliten> Hello guys! I'm getting creazy with this: using a form_with in a rails application, the `form.select` isn't accepting the classes I want it to have, for instance, i do this: `<%= form.select :user_id, User.all.collect { |user| [user.name, user.id], class: 'form-control' %>` and get a simple select, without the class, can you, guys, help me?
<kenliten> Thanks in advance!
goldfish__ has quit [Ping timeout: 252 seconds]
_ht has quit [Remote host closed the connection]
xall has quit [Quit: Client closed]
chonkbit has quit [Ping timeout: 250 seconds]
fmccann has joined #ruby
fmccann has quit [Client Quit]
mrkz_c has joined #ruby
cer-0 has quit [Ping timeout: 258 seconds]
vaillancourtmax has joined #ruby
goldfish has quit [Remote host closed the connection]
goldfish has joined #ruby
<newton> kenliten, does the html it generates look weird or just lack it completely?
<newton> or you may need to pass that class param as part of a separate hash: f.select(:user_id, ..., { class: 'form-control' })
ur5us__ has joined #ruby
rhe has quit [Quit: Ping timeout (120 seconds)]
rhe has joined #ruby
goldfish_ has joined #ruby
goldfish has quit [Ping timeout: 258 seconds]
crankharder has quit [Ping timeout: 252 seconds]
<kenliten> newton, it looks good, just as I've never passed the class away, and the second one, I've already tried it that way, and doesn't work either
<kenliten> I really found a fix, but works really weird, fixed the look with inobstrusive js, when charge the form, js look for every select in the form and assign the classes I need, the problem is that isn't work when I get the form asynchronously or render it from other view
<kenliten> That's why I'm looking for a more appropriated solution
<kenliten> I know, this channel isn't rails focussed, but I didn't find one like that
kenliten has quit [Quit: Client closed]
kenliten has joined #ruby
motherr has quit [Quit: zzz]
crankharder has joined #ruby
<weaksauce> kenliten shouldn't that be in the html_options part?
<kenliten> the `class` part or javascript?
<weaksauce> the class part
fmccann has joined #ruby
<weaksauce> there's an options hash and a html_options hash
<kenliten> Yes, that's the only one way I didn't try before, let's check and tell you what, thanks
<weaksauce> also, the code above is missing the closing } on the block
<kenliten> I feel so idiot right now, Haha, done, it works! Just passed an empty hash as options, and then a new hash with the classes. So, finally solved it like this: `<%= form.select :vehicle_class, vehicle_sizes, {}, {class:'form-control rounded-0 form-control-sm'} %>`
<weaksauce> awesome! :)
<kenliten> Thank you so much weaksauce
<kenliten> I'll try to be more diligent when read the docs again
<weaksauce> hopefully you won't forget the html_options lesson any time soon
<kenliten> Once I learn something, It becomes hard to forget to me, but this one, I'm writing it on a stone...
crankharder has quit [Ping timeout: 258 seconds]
goldfish__ has joined #ruby
goldfish__ has quit [Read error: Connection reset by peer]
goldfish__ has joined #ruby
goldfish_ has quit [Ping timeout: 272 seconds]
SuperLag has quit [Ping timeout: 245 seconds]
goldfish__ has quit [Ping timeout: 258 seconds]
SuperLag has joined #ruby
orbyt has joined #ruby
fmccann has quit [Quit: My computer has gone to sleep 😴]
easbarbosa has quit [Remote host closed the connection]
goldfish has joined #ruby
goldfish has quit [Remote host closed the connection]
goldfish has joined #ruby
kenliten has quit [Quit: Client closed]
goldfish has quit [Remote host closed the connection]
goldfish has joined #ruby
goldfish has quit [Remote host closed the connection]
goldfish has joined #ruby
goldfish has quit [Remote host closed the connection]
auk has joined #ruby
flooose has quit [Ping timeout: 240 seconds]
fmccann has joined #ruby
<auk> can anyone point me to a syntax reference for => ?
<auk> i'm having a hard time finding it
<auk> for example this syntax: :mount_options => ["ro"]