havenwood changed the topic of #ruby to: Ruby 3.4.1, 3.3.7 https://www.ruby-lang.org | Log https://libera.irclog.whitequark.org/ruby
ollysmith has quit [Ping timeout: 245 seconds]
donofrio has joined #ruby
donofrio has quit [Ping timeout: 260 seconds]
nil78 has quit [Read error: Connection reset by peer]
nil78 has joined #ruby
donofrio has joined #ruby
Vonter has quit [Ping timeout: 244 seconds]
donofrio has quit [Ping timeout: 252 seconds]
Vonter has joined #ruby
donofrio has joined #ruby
donofrio has quit [Remote host closed the connection]
donofrio has joined #ruby
szkl has quit [Quit: Connection closed for inactivity]
Inline has quit [Ping timeout: 265 seconds]
ollysmith_ has quit [Ping timeout: 276 seconds]
gemmaro_ has quit [Quit: ZNC 1.8.2+deb3.1+deb12u1 - https://znc.in]
gemmaro_ has joined #ruby
donofrio has quit [Remote host closed the connection]
donofrio has joined #ruby
donofrio has quit [Ping timeout: 252 seconds]
donofrio has joined #ruby
rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #ruby
donofrio has quit [Ping timeout: 246 seconds]
gr33n7007h has quit [Ping timeout: 265 seconds]
gr33n7007h has joined #ruby
donofrio has joined #ruby
donofrio has quit [Ping timeout: 265 seconds]
nil78 has quit [Read error: Connection reset by peer]
nil78 has joined #ruby
donofrio has joined #ruby
Vonter has quit [Ping timeout: 252 seconds]
Vonter has joined #ruby
donofrio has quit [Ping timeout: 252 seconds]
donofrio has joined #ruby
xokia has joined #ruby
donofrio has quit [Ping timeout: 252 seconds]
nil78 has quit [Read error: Connection reset by peer]
nil78 has joined #ruby
xokia has quit [Remote host closed the connection]
numlocked has joined #ruby
donofrio has joined #ruby
donofrio has quit [Ping timeout: 252 seconds]
dalan03822833508 has quit [Quit: dalan03822833508]
gemmaro_ has quit [Read error: Connection reset by peer]
donofrio has joined #ruby
ollysmith has joined #ruby
gemmaro_ has joined #ruby
donofrio has quit [Ping timeout: 252 seconds]
hwpplayer1 has joined #ruby
donofrio has joined #ruby
donofrio has quit [Ping timeout: 246 seconds]
donofrio has joined #ruby
donofrio has quit [Ping timeout: 248 seconds]
nil78 has quit [Read error: Connection reset by peer]
nil78 has joined #ruby
donofrio has joined #ruby
donofrio has quit [Remote host closed the connection]
donofrio has joined #ruby
donofrio has quit [Ping timeout: 260 seconds]
donofrio has joined #ruby
donofrio has quit [Ping timeout: 248 seconds]
donofrio has joined #ruby
donofrio has quit [Ping timeout: 252 seconds]
deadmarshal_ has quit [Remote host closed the connection]
donofrio has joined #ruby
donofrio has quit [Ping timeout: 268 seconds]
nil78 has quit [Read error: Connection reset by peer]
donofrio has joined #ruby
nil78 has joined #ruby
donofrio has quit [Ping timeout: 248 seconds]
deadmarshal_ has joined #ruby
donofrio has joined #ruby
donofrio has quit [Ping timeout: 265 seconds]
hwpplayer1 has quit [Quit: later]
donofrio has joined #ruby
donofrio has quit [Ping timeout: 260 seconds]
donofrio has joined #ruby
<mange> Is there a convenient way to use case/in to pattern match on a regexp, while extracting capture groups? I want to match one string against multiple regexps, and take the first one that matches. I know I can use $1, $2, etc, but I'm hoping for something more like `case "abc"; in /(.)b(.)/ => [m1, m2]; pp [:m1, m1, :m2, m2]; end` (which doesn't work, as far as I can tell).
hd1 has joined #ruby
hd1 has left #ruby [#ruby]
R2 has joined #ruby
R2robot has quit [Ping timeout: 260 seconds]
donofrio has quit [Remote host closed the connection]
donofrio has joined #ruby
Inline has joined #ruby
donofrio has quit [Ping timeout: 248 seconds]
donofrio has joined #ruby
donofrio has quit [Ping timeout: 252 seconds]
R2 is now known as R2robot
donofrio has joined #ruby
donofrio has quit [Ping timeout: 252 seconds]
donofrio has joined #ruby
donofrio has quit [Ping timeout: 246 seconds]
hwpplayer1 has joined #ruby
donofrio has joined #ruby
donofrio has quit [Remote host closed the connection]
donofrio has joined #ruby
donofrio has quit [Remote host closed the connection]
donofrio has joined #ruby
konsolebox has joined #ruby
donofrio has quit [Ping timeout: 272 seconds]
donofrio has joined #ruby
konsolebox has quit [Ping timeout: 248 seconds]
szkl has joined #ruby
donofrio has quit [Ping timeout: 260 seconds]
konsolebox has joined #ruby
donofrio has joined #ruby
donofrio has quit [Ping timeout: 244 seconds]
FetidToot has quit [Ping timeout: 252 seconds]
FetidToot has joined #ruby
nil78 has quit [Read error: Connection reset by peer]
donofrio has joined #ruby
nil78 has joined #ruby
_whitelogger has quit [Ping timeout: 260 seconds]
_whitelogger_ has joined #ruby
donofrio has quit [Ping timeout: 248 seconds]
r3m has joined #ruby
donofrio has joined #ruby
<henk> hypernormalisation is a great term I recently learned about
donofrio has quit [Ping timeout: 252 seconds]
TomyWork has joined #ruby
konsolebox has quit [Ping timeout: 260 seconds]
donofrio has joined #ruby
Inline has quit [Quit: Leaving]
donofrio has quit [Ping timeout: 260 seconds]
Inline has joined #ruby
donofrio has joined #ruby
donofrio has quit [Ping timeout: 260 seconds]
TomyWork has quit [Remote host closed the connection]
Inline has quit [Remote host closed the connection]
Inline has joined #ruby
donofrio has joined #ruby
donofrio has quit [Ping timeout: 268 seconds]
Inline has quit [Quit: Leaving]
donofrio has joined #ruby
donofrio has quit [Ping timeout: 260 seconds]
nil78 has quit [Read error: Connection reset by peer]
nil78 has joined #ruby
donofrio has joined #ruby
donofrio has quit [Ping timeout: 252 seconds]
deadmarshal_ has quit [Remote host closed the connection]
nil78 has quit [Read error: Connection reset by peer]
donofrio has joined #ruby
hwpplayer1 has quit [Remote host closed the connection]
donofrio has quit [Ping timeout: 268 seconds]
nil78 has joined #ruby
donofrio has joined #ruby
donofrio has quit [Ping timeout: 260 seconds]
rdsm has quit [Ping timeout: 252 seconds]
rdsm_ has joined #ruby
donofrio has joined #ruby
deadmarshal_ has joined #ruby
donofrio has quit [Ping timeout: 252 seconds]
Linux_Kerio has joined #ruby
donofrio has joined #ruby
donofrio has quit [Ping timeout: 244 seconds]
Inline has joined #ruby
konsolebox has joined #ruby
weaksauc_ has joined #ruby
weaksauce has quit [Ping timeout: 245 seconds]
donofrio has joined #ruby
donofrio has quit [Remote host closed the connection]
donofrio has joined #ruby
donofrio has quit [Ping timeout: 260 seconds]
TomyWork has joined #ruby
donofrio has joined #ruby
donofrio has quit [Ping timeout: 268 seconds]
donofrio has joined #ruby
donofrio has quit [Ping timeout: 244 seconds]
donofrio has joined #ruby
donofrio has quit [Ping timeout: 252 seconds]
donofrio has joined #ruby
rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #ruby
donofrio has quit [Ping timeout: 260 seconds]
donofrio has joined #ruby
donofrio has quit [Ping timeout: 272 seconds]
donofrio has joined #ruby
donofrio has quit [Ping timeout: 252 seconds]
donofrio has joined #ruby
donofrio has quit [Remote host closed the connection]
donofrio has joined #ruby
donofrio has quit [Remote host closed the connection]
mange has quit [Remote host closed the connection]
donofrio has joined #ruby
donofrio has quit [Remote host closed the connection]
donofrio has joined #ruby
donofrio has quit [Remote host closed the connection]
donofrio has joined #ruby
deadmarshal_ has quit [Remote host closed the connection]
donofrio has quit [Remote host closed the connection]
donofrio has joined #ruby
donofrio has quit [Remote host closed the connection]
donofrio has joined #ruby
donofrio has quit [Ping timeout: 252 seconds]
donofrio has joined #ruby
donofrio has quit [Remote host closed the connection]
donofrio has joined #ruby
donofrio has quit [Ping timeout: 248 seconds]
donofrio has joined #ruby
konsolebox has quit [Ping timeout: 240 seconds]
donofrio has quit [Remote host closed the connection]
donofrio has joined #ruby
donofrio has quit [Remote host closed the connection]
donofrio has joined #ruby
donofrio has quit [Remote host closed the connection]
donofrio has joined #ruby
deadmarshal_ has joined #ruby
donofrio has quit [Remote host closed the connection]
donofrio has joined #ruby
donofrio has quit [Ping timeout: 272 seconds]
donofrio has joined #ruby
donofrio has quit [Ping timeout: 246 seconds]
donofrio has joined #ruby
donofrio has quit [Remote host closed the connection]
donofrio has joined #ruby
donofrio has quit [Remote host closed the connection]
donofrio has joined #ruby
donofrio has quit [Ping timeout: 248 seconds]
donofrio has joined #ruby
donofrio has quit [Remote host closed the connection]
user71 has joined #ruby
donofrio has joined #ruby
donofrio has quit [Ping timeout: 260 seconds]
donofrio has joined #ruby
xokia has joined #ruby
fantazo has joined #ruby
eddof13 has joined #ruby
donofrio has quit [Ping timeout: 252 seconds]
Inline has quit [Ping timeout: 248 seconds]
hwpplayer1 has joined #ruby
donofrio has joined #ruby
donofrio has quit [Ping timeout: 248 seconds]
donofrio has joined #ruby
donofrio has quit [Remote host closed the connection]
donofrio has joined #ruby
donofrio has quit [Remote host closed the connection]
donofrio has joined #ruby
trillion_exabyte has quit [Ping timeout: 248 seconds]
trillion_exabyte has joined #ruby
denvermullets has joined #ruby
donofrio has quit [Ping timeout: 248 seconds]
donofrio has joined #ruby
donofrio has quit [Ping timeout: 244 seconds]
Quiet-Oil9262 has joined #ruby
peder_ has joined #ruby
donofrio has joined #ruby
cappy has joined #ruby
donofrio has quit [Ping timeout: 268 seconds]
peder has quit [Quit: leaving]
peder_ is now known as peder
eddof13 has quit [Quit: eddof13]
donofrio has joined #ruby
peder_ has joined #ruby
eddof13 has joined #ruby
donofrio has quit [Remote host closed the connection]
donofrio has joined #ruby
denvermullets has quit [Remote host closed the connection]
denvermullets has joined #ruby
donofrio has quit [Ping timeout: 248 seconds]
donofrio has joined #ruby
donofrio has quit [Ping timeout: 260 seconds]
donofrio has joined #ruby
Inline has joined #ruby
denvermullets has quit [Ping timeout: 260 seconds]
konsolebox has joined #ruby
cappy has quit [Quit: Leaving]
sarna has quit [Remote host closed the connection]
Inline has quit [Quit: Leaving]
sarna has joined #ruby
Inline has joined #ruby
hwpplayer1 has quit [Remote host closed the connection]
wbooze has joined #ruby
konsolebox has quit [Ping timeout: 252 seconds]
donofrio has quit [Remote host closed the connection]
donofrio has joined #ruby
denvermullets has joined #ruby
ftajhii has joined #ruby
nil78 has quit [Read error: Connection reset by peer]
nil78 has joined #ruby
eddof13 has quit [Quit: eddof13]
denvermullets has quit [Ping timeout: 268 seconds]
Inline has quit [Quit: Leaving]
Inline has joined #ruby
wbooze has quit [Quit: Leaving]
wbooze has joined #ruby
eddof13 has joined #ruby
wbooze has quit [Remote host closed the connection]
wbooze has joined #ruby
deadmarshal_ has quit [Remote host closed the connection]
TomyWork has quit [Ping timeout: 260 seconds]
<havenwood> mange: You can check if #deconstruct and #deconstruct_keys are defined to see if an Object supports pattern matching. Unfortunately, Regexp pattern matching is suspect with the global `$~` as the only way I can think of to get at a match. It's not implemented by default.
<havenwood> Or preferably, Regexp.last_match, but same issue of it being global.
xokia has quit [Ping timeout: 244 seconds]
deadmarshal_ has joined #ruby
JulioPapel has joined #ruby
user71 has quit [Quit: Leaving]
JulioPapel has quit [Quit: JulioPapel]
Guest49 has joined #ruby
<Guest49> Hello
<Guest49> Can we discuss issues here? I need a bit of help
<Guest49> I have this code:
<Guest49>       stats_id = req.path_info.split('/').last
<Guest49>       sql = "SELECT * FROM stats WHERE id = (?)"
<Guest49>       result = DB.execute(sql, [stats_id])
<Guest49>       puts result.first
<Guest49> It fails, no result is returned
<Guest49> But if I do :
<Guest49>       stats_id = "5d651baa"
<Guest49>       sql = "SELECT * FROM stats WHERE id = (?)"
<Guest49>       result = DB.execute(sql, [stats_id])
<Guest49>       puts result.first
<Guest49> It works
<Guest49> A puts stats_id tell me the string obtained from the split is 5d651baa
<Guest49> I'm lost
<adam12> Guest49: Is `DB` a Sequel connection?
<Guest49> adam12 DB is `SQLite3::Database`
wbooze has quit [Quit: Leaving]
<adam12> Guest49: I don't see why your code wouldn't work.
Inline has quit [Quit: Leaving]
<Guest49> Me neither...
<Guest49> I'm doing the dirty
<Guest49> ```      stats_id = req.path_info.split('/').last.gsub(/[^a-z0-9]/, '')
<Guest49>       sql = "SELECT * FROM stats WHERE id = '#{stats_id}'"
<Guest49>       result = DB.execute(sql)```
<Guest49> for now, but...
eddof13 has quit [Ping timeout: 252 seconds]
<adam12> That's working??
<Guest49> Yes
Inline has joined #ruby
<Guest49> "Variable inclusion" in the sql string works
wbooze has joined #ruby
konsolebox has joined #ruby
finsternis has joined #ruby
konsolebox has quit [Quit: Quit]
donofrio_ has joined #ruby
Linux_Kerio has quit [Ping timeout: 248 seconds]
Guest49 has quit [Quit: Client closed]
<weaksauc_> probably have some kind of whitespace issue in the first one or some extra thing that doesn't get shown in a puts. p would show it
<sphex> weaksauc_: could be an encoding issue. the SQLite module treats US-ASCII strins as SQL blobs and they're not equal to SQL strings.
<weaksauc_> true as well
<sphex> I think I had that exact same problem using a string from the rack env with sqlite. I just ended up using "#{var}" to give it the ruby script's encoding.
grenierm has joined #ruby
xokia has joined #ruby
R2robot has quit [Quit: Pull the lever, Kronk. Wrong leverrrrrrr!]
<sphex> ASCII-8BIT I mean, not US-ASCII. And seems like puma and webrick don't use the same encodings by default for the strings in the rack env...
patrick has quit [Ping timeout: 252 seconds]
patrick_ is now known as patrick
R2robot has joined #ruby
donofrio_ has quit [Quit: Leaving]
patrick_ has joined #ruby
patrick has joined #ruby
patrick has quit [Changing host]
patrick_ is now known as patrick
patrick_ has joined #ruby
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
mjacob has quit [Ping timeout: 268 seconds]
mjacob has joined #ruby
grenierm has quit [Quit: Client closed]
o0x1eef has quit [Ping timeout: 252 seconds]
graywolf has joined #ruby
mange has joined #ruby
gr33n7007h has quit [Ping timeout: 252 seconds]
o0x1eef has joined #ruby
gr33n7007h has joined #ruby
o0x1eef has quit [Ping timeout: 252 seconds]
fantazo has quit [Quit: Lost terminal]
graywolf has quit [Quit: WeeChat 4.5.1]
o0x1eef has joined #ruby
o0x1eef has quit [Ping timeout: 252 seconds]