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
apotheon has joined #ruby
<apotheon> note to self: consider adding this channel to autojoins
oxfuxxx has quit [Ping timeout: 256 seconds]
oxfuxxx has joined #ruby
freeworld has quit [Ping timeout: 272 seconds]
<apotheon> note handled
michigan has quit []
oxfuxxx has quit [Ping timeout: 245 seconds]
oxfuxxx has joined #ruby
roadie has joined #ruby
markong has quit [Ping timeout: 272 seconds]
michigan has joined #ruby
liqu1d has joined #ruby
va5c0 has quit [Ping timeout: 272 seconds]
ur5us has joined #ruby
liqu1d has quit [Quit: liqu1d]
<ox1eef> most the time, i see Rails used as a monolith - but that's not because it doesn't lend itself to being modular. it does.
goldfish has quit [Quit: Leaving]
Sheilong has quit []
ur5us has quit [Ping timeout: 240 seconds]
roadie has quit [Ping timeout: 240 seconds]
ur5us has joined #ruby
mooff has quit [Quit: Quit]
mooff has joined #ruby
bluedust has joined #ruby
ur5us has quit [Ping timeout: 240 seconds]
va5c0 has joined #ruby
bluedust has quit [Ping timeout: 256 seconds]
oxfuxxx has quit [Ping timeout: 272 seconds]
va5c0 has quit [Ping timeout: 256 seconds]
oxfuxxx has joined #ruby
weaksauce has quit [Remote host closed the connection]
bluedust has joined #ruby
bluedust has quit [Remote host closed the connection]
<michigan> ox1eef: Reading up on modular monoliths as we speak...
<michigan> apotheon: Welcome back lol
<ox1eef> my approach would be to use something like sinatra or roda to mount other rack apps (eg rails, etc).
<michigan> ox1eef: I'll keep you guys posted đź‘Ť
<michigan> By the way, I'm trying to check if a JSON response contains `en` or `fr`, but struggle to convert it to a hash (TypeError: no implicit conversion of Hash into String). Can anybody tell what's wrong? https://gist.github.com/basicfeatures/77612d12ed0c4ba5b3e9619dadb4aa5f
Rounin has quit [Ping timeout: 272 seconds]
John_Ivan has quit [Read error: Connection reset by peer]
<ox1eef> michigan: it looks like you already have a Hash from detect_language.
<ox1eef> new_hash = json_response["languages"] should work.
<michigan> Oh I see, my bad. Great, thanks!
<ox1eef> welcome
<michigan> Would you happen to know how I could check if that hash has a key present? I tried `if new_hash.key?("en")` but got `NoMethodError: undefined method `key?' for [{"en"=>0.9999953354389854}]:Array`
<ox1eef> michigan: what response are you expecting? it is kind of odd to have an array of languages, with each element being a hash. why is there not one hash with each language as a key?
<ox1eef> if that's simply the data you're working with, then languages = json_response['languages']; languages.each { |language, float| if language == "en; ...; elsif language == "de"; ....; end }
<michigan> It's the response I get from this language analysis API: `{"languages"=>[{"en"=>0.9999970265109813}]}` means there's a 99% probability a sentence is in English. I'm trying to check if the key `en` is present that's all.
<michigan> Nice! Cheers mate!
<ox1eef> languages = json_response['languages']; languages.any? { |language| language.key?("en") } }
<ox1eef> sorry first paste didnt work, the above should work.
<michigan> Much obliged ❤️
<ox1eef> if you want to find the response for "en": languages = json_response['languages']; english = languages.find { |language| language.key?("en") }
<michigan> Great, might come in handy some day
<ox1eef> yeah, probably require some edits, but hopefully you get the idea
<michigan> Yep!
<ox1eef> the structure of the response makes it more awkward than it seems it should be. a single hash rather than arrays wrapping one would be easier to work with,
<michigan> I'm not fully familiar with the API yet, but I do believe there are cases where it's not sure, so it'll suggest several different languages with their respective probability scores...
<michigan> Works like a charm! https://gist.github.com/basicfeatures/77612d12ed0c4ba5b3e9619dadb4aa5f (looks gorgeous too)
<ox1eef> ruby always does :D
ur5us has joined #ruby
bluedust has joined #ruby
infinityfye has joined #ruby
bluedust has quit [Ping timeout: 256 seconds]
<michigan> :-)
bluedust has joined #ruby
<apotheon> michigan: thanks
freeworld has joined #ruby
gr33n7007h has joined #ruby
bluedust has quit [Remote host closed the connection]
Tempesta has quit [Quit: See ya!]
Tempesta has joined #ruby
ur5us has quit [Ping timeout: 240 seconds]
brw has quit [Read error: Connection reset by peer]
brw has joined #ruby
_ht has joined #ruby
oxfuxxx has quit [Ping timeout: 272 seconds]
taupiqueur has joined #ruby
brw has quit [Read error: Connection reset by peer]
brw has joined #ruby
va5c0 has joined #ruby
va5c0 has quit [Ping timeout: 256 seconds]
teclator has joined #ruby
brw has quit [Read error: Connection reset by peer]
brw has joined #ruby
___nick___ has joined #ruby
bluedust has joined #ruby
brw has quit [Read error: Connection reset by peer]
brw has joined #ruby
brw has quit [Read error: Connection reset by peer]
brw has joined #ruby
teclator has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
markong has joined #ruby
brw has quit [Read error: Connection reset by peer]
brw has joined #ruby
va5c0 has joined #ruby
va5c0 has quit [Ping timeout: 256 seconds]
taupiqueur has quit [Quit: taupiqueur]
taupiqueur has joined #ruby
taupiqueur has quit [Client Quit]
taupiqueur has joined #ruby
markong has quit [Ping timeout: 256 seconds]
markong has joined #ruby
reset has quit [Quit: reset]
Dooky has joined #ruby
Dooky has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Dooky has joined #ruby
foxxx0 has quit [Quit: foxxx0]
foxxx0 has joined #ruby
gproto23 has joined #ruby
Dooky has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
taupiqueur has quit [Ping timeout: 256 seconds]
<nakilon> am I missing something or bundler install every group unless I exclude it explicitely?
<nakilon> why can't I have a group that the explicitness would apply to include it, not exclude
<nakilon> or is it optional => true ? https://github.com/rubygems/bundler/pull/3531/files
<nakilon> yeah looks like that
taupiqueur has joined #ruby
<nakilon> I wish minitest assert_match was populating $1
<nakilon> because I want to see the mismatch and then also use the group
Rounin has joined #ruby
taupiqueur has quit [Ping timeout: 256 seconds]
gproto23 has quit [Ping timeout: 256 seconds]
oxfuxxx has joined #ruby
oxfuxxx has quit [Read error: Connection reset by peer]
taupiqueur has joined #ruby
oxfuxxx has joined #ruby
va5c0 has joined #ruby
va5c0 has quit [Ping timeout: 272 seconds]
analogsalad has joined #ruby
m_antis_ has quit [Ping timeout: 240 seconds]
___nick___ has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
oxfuxxx has quit [Ping timeout: 256 seconds]
m_antis has joined #ruby
goldfish has joined #ruby
___nick___ has joined #ruby
___nick___ has quit [Client Quit]
m_antis has quit [Client Quit]
___nick___ has joined #ruby
m_antis has joined #ruby
bluedust has quit [Remote host closed the connection]
infinity_fye has joined #ruby
infinityfye_ has joined #ruby
infinityfye has quit [Ping timeout: 256 seconds]
infinity_fye has quit [Ping timeout: 256 seconds]
RedNifre has joined #ruby
<RedNifre> Any known problems regarding ffi on Apple M1? I get funny control frame errors with the YNAB gem: c:0022 p:---- s:0151 e:000150 CFUNC :attach
<RedNifre> c:0021 p:0258 s:0145 e:000144 METHOD /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.5/lib/ffi/library.rb:275 y
<RedNifre> "You may have encountered a bug in the Ruby interpreter or extension libraries. "
<RedNifre> Is that likely? Maybe I should ask the gem maintainer first...
perrierjouet has joined #ruby
analogsalad has quit [Quit: bye]
<nakilon> RedNifre what is dependent on ffi in your Gemfile.lock? maybe it's misused somehow
graywolf has joined #ruby
hololeap has quit [Ping timeout: 240 seconds]
aeris has quit [Ping timeout: 240 seconds]
infinityfye_ has quit [Quit: Leaving]
aeris has joined #ruby
hololeap has joined #ruby
bluedust has joined #ruby
bluedust has quit [Remote host closed the connection]
bluedust has joined #ruby
bluedust has quit [Ping timeout: 260 seconds]
<havenwood> RedNifre: Use Rubies that came out after M1.
<RedNifre> What's the proper way to use ruby on macs anyway? I just switched to macs and heard that the one that comes with the system is old.
reset has joined #ruby
<havenwood> RedNifre: You can `brew install ruby` for an up-to-date version but most folk working on more than one app use a version switcher like chruby, rbenv, RVM, or asdf so they can have whatever versions of Ruby the app needs.
<havenwood> RedNifre: Any of those switchers is fine.
michigan has quit [Quit: Connection closed for inactivity]
bluedust has joined #ruby
taupiqueur has quit [Ping timeout: 256 seconds]
bluedust has quit [Remote host closed the connection]
oxfuxxx has joined #ruby
gproto23 has joined #ruby
markong has quit [Ping timeout: 240 seconds]
taupiqueur has joined #ruby
perrierjouet has quit [Quit: WeeChat 3.4]
donofrio has joined #ruby
graywolf has quit [Quit: WeeChat 3.3]
va5c0 has joined #ruby
donofrio has quit [Ping timeout: 272 seconds]
va5c0 has quit [Ping timeout: 272 seconds]
Dooky has joined #ruby
entropie has quit [Quit: ""]
entropie has joined #ruby
Spitfire has joined #ruby
entropie has quit [Quit: ""]
entropie has joined #ruby
Spitfire has quit [Changing host]
Spitfire has joined #ruby
random-jellyfish has joined #ruby
weaksauce has joined #ruby
oxfuxxx has quit [Ping timeout: 240 seconds]
random-jellyfish has quit [Ping timeout: 256 seconds]
perrierjouet has joined #ruby
taupiqueur has quit [Ping timeout: 240 seconds]
taupiqueur has joined #ruby
brown121407 has quit [Ping timeout: 250 seconds]
hwrd has quit [Ping timeout: 250 seconds]
taupiqueur has quit [Client Quit]
brown121407 has joined #ruby
hwrd has joined #ruby
ur5us has joined #ruby
srushe has quit [Ping timeout: 250 seconds]
srushe has joined #ruby
matta has quit [Ping timeout: 250 seconds]
matta has joined #ruby
szkl has joined #ruby
___nick___ has quit [Ping timeout: 256 seconds]
Spitfire is now known as Spitteh
Spitteh is now known as Spitfire
<nakilon> no, the Gemfile thing does not seem to work
<nakilon> oh, or maybe it resolves everything and I'm supposed to chose only when installing or running
_ht has quit [Remote host closed the connection]
Dooky has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Dooky has joined #ruby
perrierjouet has quit [Quit: WeeChat 3.4]
gproto23 has quit [Remote host closed the connection]
perrierjouet has joined #ruby
random-jellyfish has joined #ruby
markong has joined #ruby
donofrio has joined #ruby
donofrio has quit [Ping timeout: 240 seconds]
donofrio has joined #ruby
va5c0 has joined #ruby
va5c0 has quit [Ping timeout: 272 seconds]
hololeap has quit [Remote host closed the connection]
hololeap has joined #ruby
donofrio has quit [Ping timeout: 272 seconds]
va5c0 has joined #ruby
pgib has quit [Ping timeout: 252 seconds]
Dooky has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
John_Ivan has joined #ruby