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
crankharder has joined #ruby
crankharder has quit [Ping timeout: 245 seconds]
Awoobis has quit [Quit: ZNC - https://znc.in]
A_Dragon has joined #ruby
ur5us has joined #ruby
lesihctej has quit [Ping timeout: 260 seconds]
duds- has quit [Ping timeout: 276 seconds]
RougeR has quit [Quit: Leaving]
<dviola> adam12: do you happen to know if it's possible to extract this part to another file: https://gist.github.com/diegoviola/41732846978bf843ad705ce73d0097f6#file-external-rb-L17-L22
<dviola> while keepign the auth code in that existing file
<dviola> I'm having some trouble doing that, but maybe it's my lack of experience with roda
ur5us has quit [Ping timeout: 245 seconds]
Rounin has quit [Ping timeout: 246 seconds]
jetchisel has joined #ruby
<adam12> dviola: Not sure I understand.
<adam12> dviola: Definitely post to the roda group if you're stuck. Someone (probably Jeremy) will respond.
<dviola> adam12: I would like to have a directory with sub-directories, eg: routes/api/{external,internal}/v1/foo.rb where foo.rb is some endpoint, that endpoint will use some specific authentication method, for example, what I have in external.rb
<dviola> I just don't want to duplicate that authentication code on every file/endpoint
<dviola> adam12: ok, I will try that, thanks
<dviola> maybe I'm making things more complicated than they should be
<adam12> dviola: You could probably keep using hash_routes further.
<dviola> when I get stuck that almost always is the case
<adam12> Ie. external.rb could be authentication, then r.hash_routes :api, "external", "v1" or something. Then inside v1, you can have your routes.
<adam12> (I don't use hash_routes so I don't know)
<dviola> adam12: interesting, I'll try that, thanks
<adam12> but if I was using multi_route, that's what I would do.
<dviola> I'll try that, thanks :)
<adam12> dviola: Left a comment on your GIst
<adam12> Gotta run. Good luck.
TomyLobo has quit [Read error: Connection reset by peer]
reset has quit [Quit: reset]
ur5us has joined #ruby
duds- has joined #ruby
georgemp has quit [Remote host closed the connection]
georgemp has joined #ruby
jetchisel has quit [Ping timeout: 268 seconds]
duds- has quit [Ping timeout: 276 seconds]
jetchisel has joined #ruby
<dviola> adam12: looks like hash_branch takes two arguments only
<dviola> nice approach though
ur5us has quit [Ping timeout: 264 seconds]
pwnd_sfw has quit [Quit: Ping timeout (120 seconds)]
pwnd_sfw has joined #ruby
<dviola> adam12: I think I'll just keep it as-is, don't think there's much point in separating the auth code when the routes are already on the same file, i.e. https://gist.github.com/diegoviola/691bf1a2624fefb097f775b579e921a2
<dviola> I posted on roda group anyway
Inline_ has quit [Quit: Leaving]
jetchisel has quit [Ping timeout: 260 seconds]
jetchisel has joined #ruby
jpw has joined #ruby
jetchisel has quit [Ping timeout: 264 seconds]
jetchisel has joined #ruby
<dviola> jeremy replied in less than an hour, wow
<dviola> such dedication
seabre has quit [Quit: ZNC 1.8.2 - https://znc.in]
keyvan has quit [Ping timeout: 264 seconds]
joenoon has quit [Read error: Connection reset by peer]
joenoon has joined #ruby
seabre has joined #ruby
keyvan has joined #ruby
JayDoubleu has quit [Ping timeout: 264 seconds]
jposer has quit [Read error: Connection reset by peer]
jposer has joined #ruby
JayDoubleu has joined #ruby
integral has quit [Ping timeout: 264 seconds]
integral has joined #ruby
ferr_ has joined #ruby
fercell has quit [Ping timeout: 264 seconds]
sagax has joined #ruby
kapil has quit [Quit: ZNC 1.7.5+deb4 - https://znc.in]
kapil has joined #ruby
kapil has quit [Quit: ZNC 1.7.5+deb4 - https://znc.in]
jpw has quit [Remote host closed the connection]
kapil has joined #ruby
hololeap has quit [Ping timeout: 276 seconds]
howdoi has quit [Quit: Connection closed for inactivity]
vit has joined #ruby
hololeap has joined #ruby
Rounin has joined #ruby
hololeap has quit [Remote host closed the connection]
shokohsc8 has quit [Read error: Connection reset by peer]
hololeap has joined #ruby
shokohsc8 has joined #ruby
CrazyEddy has joined #ruby
goldfish has joined #ruby
goldfish has quit [Ping timeout: 260 seconds]
SuperLag has quit [Ping timeout: 260 seconds]
SuperLag has joined #ruby
<adam12> dviola: ah nice.
<adam12> dviola: I had a feeling it only took two args, but i didn't check. The syntax is similar to multi_route (you use "/foo/bar" as an argument).
<dviola> adam12: np
<dviola> "The important thing to realize is that the default argument for r.hash_routes is the already matched path. You can make things easier by making the namespace for your hash routes use the same path."
<adam12> Jeremy is a super OSS maintainer.
reset has joined #ruby
<dviola> yeah, one of a kind
A_Dragon is now known as Awoobis
<dviola> adam12: thanks for all your help so far
<adam12> dviola: yw :)
reset has quit [Ping timeout: 260 seconds]
reset has joined #ruby
donofrio has quit [Read error: Connection reset by peer]
gr33n7007h has quit [Ping timeout: 258 seconds]
gr33n7007h has joined #ruby
markong has joined #ruby
donofrio has joined #ruby
markong has quit [Ping timeout: 245 seconds]
shokohsc8 has quit [Ping timeout: 264 seconds]
shokohsc8 has joined #ruby
crankharder has joined #ruby
Inline has joined #ruby
Inline has quit [Quit: Leaving]
Inline has joined #ruby
markong has joined #ruby
shuvarek has quit [Ping timeout: 252 seconds]
crankharder has quit [Ping timeout: 260 seconds]
shuvarek has joined #ruby
crankharder has joined #ruby
gr33n7007h has quit [Ping timeout: 260 seconds]
<nakilon> is there any gem to fix english grammar? not just spell checking but fixing the sentences
Bi[m] has quit [Quit: You have been kicked for being idle]
Inline has quit [Quit: Leaving]
gr33n7007h has joined #ruby
shuvarek has quit [Ping timeout: 260 seconds]
mahlon has quit [Read error: Connection reset by peer]
mahlon has joined #ruby
vito has quit [Ping timeout: 244 seconds]
JSharp has quit [Ping timeout: 244 seconds]
Nowaker has quit [Quit: No Ping reply in 180 seconds.]
Nowaker has joined #ruby
vito has joined #ruby
JSharp has joined #ruby
KOTP has quit [Ping timeout: 264 seconds]
Inline has joined #ruby
markong has quit [Ping timeout: 268 seconds]
shuvarek has joined #ruby
KOTP has joined #ruby
dohtem_ has joined #ruby
jpw has joined #ruby
leftylin1 has joined #ruby
leftylink has quit [*.net *.split]
dohtem has quit [*.net *.split]
dohtem_ is now known as dohtem
<havenwood> nakilon: maybe write a Rust gem extension for nlprule? I don't know of one. https://github.com/bminixhofer/nlprule
<havenwood> or use the Python bindings to the Rust lib via Pycall >.> https://github.com/mrkn/pycall.rb
crankharder has quit [Ping timeout: 264 seconds]
hololeap has quit [Remote host closed the connection]
crankharder has joined #ruby
hololeap has joined #ruby
slightlypandaish has joined #ruby
hololeap has quit [Read error: Connection reset by peer]
hololeap has joined #ruby
crankharder has quit [Ping timeout: 260 seconds]
crankharder has joined #ruby
slightlypandaish has quit [Quit: Client closed]
SuperLag has quit [Ping timeout: 268 seconds]
SuperLag has joined #ruby
menace has joined #ruby
menace has joined #ruby
menace has quit [Changing host]
menace is now known as Deknos
Deknos has quit [Quit: Deknos]
menace has joined #ruby
menace has joined #ruby
menace has quit [Changing host]
KOTP has quit [Ping timeout: 260 seconds]
crankharder has quit [Ping timeout: 260 seconds]
havenwood has quit [Quit: The Lounge - https://thelounge.chat]
havenwood has joined #ruby
hololeap has quit [Remote host closed the connection]
hololeap has joined #ruby
KOTP has joined #ruby
menace has quit [Read error: Connection reset by peer]
menace has joined #ruby
Starfoxxes has quit [Read error: Connection reset by peer]
neshpion has joined #ruby
<neshpion> is there shorthand for `object_array.map{|obj| obj[:property]}` ?
<newton> if you're using rails object_array.pluck(:property) may work but in plain ruby i don't think there is a shortcut
<neshpion> T_T
<havenwood> neshpion: FWIW, you can now do: array.map { _1[:property] }
<neshpion> o.O
<havenwood> >> [1, 2, 3].map { _1.to_s(2) }
<havenwood> => ["1", "10", "11"]
moldorcoder7 has quit [Ping timeout: 264 seconds]
<neshpion> nice, that works for grabbing a single property
<neshpion> but i suppose if i want to grab a subset of properties i have to write it out the long way
moldorcoder7 has joined #ruby
Starfoxxes has joined #ruby
neshpion has quit [Ping timeout: 276 seconds]
jpw has quit [Remote host closed the connection]
moldorcoder7 has quit [Ping timeout: 258 seconds]
neshpion has joined #ruby
moldorcoder7 has joined #ruby
pull has joined #ruby
markong has joined #ruby
crankharder has joined #ruby
Inline has quit [Ping timeout: 260 seconds]
crankharder has quit [Ping timeout: 258 seconds]
Guest17 has joined #ruby
crankharder has joined #ruby
Guest17 has quit [Quit: Client closed]
TomyLobo has joined #ruby
neshpion has quit [Ping timeout: 276 seconds]
neshpion has joined #ruby
pull has quit [Quit: Czesc]
Leon_ has joined #ruby
leonthemisfit has quit [Read error: Connection reset by peer]
siasmj has joined #ruby
leftylin1 is now known as leftylink
neshpion has quit [Ping timeout: 276 seconds]
neshpion has joined #ruby
ur5us has joined #ruby
crankharder has quit [Ping timeout: 260 seconds]
ur5us has quit [Ping timeout: 264 seconds]
fredlinhares has joined #ruby
neshpion has quit [Ping timeout: 276 seconds]
neshpion has joined #ruby
Inline has joined #ruby
Inline has quit [Quit: Leaving]
Inline has joined #ruby
Leon__ has joined #ruby
Leon_ has quit [Ping timeout: 264 seconds]
swaggboi has quit [Quit: C-x C-c]
swaggboi has joined #ruby
Inline has quit [Ping timeout: 264 seconds]
hansolo has quit [Ping timeout: 246 seconds]
crankharder has joined #ruby
crankharder has quit [Client Quit]
vit has quit [Ping timeout: 260 seconds]