<banisterfiend>
hi guys - we have an http payload signed with ed25519
<banisterfiend>
what's the best way to verify that in ruby? and is it possible to verify using stdlib?
tolerance5 has quit [Remote host closed the connection]
dionysus69 has quit [Ping timeout: 268 seconds]
jpn has joined #ruby
desnudopenguino has quit [Read error: Connection reset by peer]
Ziyan_ has joined #ruby
desnudopenguino has joined #ruby
Ziyan has quit [Ping timeout: 268 seconds]
protektwar has quit [Ping timeout: 240 seconds]
dionysus69 has joined #ruby
michigan has quit [Quit: Connection closed for inactivity]
protektwar has joined #ruby
protektwar has quit [Changing host]
protektwar has joined #ruby
siery has joined #ruby
Ziyan_ has quit [Ping timeout: 268 seconds]
Ziyan has joined #ruby
Madd has joined #ruby
jl- has joined #ruby
Madd has quit [Quit: Client closed]
jl- has quit [Ping timeout: 246 seconds]
banisterfiend has quit [Quit: Client closed]
markong has joined #ruby
Guest30 has joined #ruby
Ziyan has quit [Ping timeout: 260 seconds]
Ziyan has joined #ruby
<Guest30>
Hello, everyone! After developing in Ruby for a few years, I'm now for the first time looking at the Ruby source code. I was writing a local C extension that adds a pair of methods to Array, just to play around. I bumped into this, however:
<Guest30>
It's some kind of comparison optimization:
<Guest30>
```
<Guest30>
#define id_cmp idCmp
<Guest30>
```
<Guest30>
I cannot find where idCmp is defined or what it does exactly. I tried tracing back through the commit history, but it's hard to find explanations on why it was introduced. Can anyone give me a hint?
<Guest30>
Let me know also if this is the right place to ask such questions.
siery has quit [Ping timeout: 248 seconds]
protektwar has quit [Ping timeout: 248 seconds]
protektwar has joined #ruby
protektwar has joined #ruby
protektwar has quit [Changing host]
s-liao-2000 has quit [Quit: Client closed]
finsternis has quit [Read error: Connection reset by peer]
protektwar has quit [Ping timeout: 255 seconds]
Ziyan has quit [Ping timeout: 268 seconds]
Ziyan has joined #ruby
Ziyan has quit [Ping timeout: 268 seconds]
Ziyan has joined #ruby
protektwar has joined #ruby
protektwar has quit [Changing host]
protektwar has joined #ruby
Ziyan has quit [Ping timeout: 255 seconds]
Ziyan has joined #ruby
<adam12>
Guest30: This is the right place, but fewer C authors in here than Ruby authors.
<Guest30>
I can try Discord too then. Thanks
s-liao-2000 has joined #ruby
Ziyan has quit [Ping timeout: 246 seconds]
Guest30 has quit [Quit: Client closed]
Ziyan has joined #ruby
Guest30 has joined #ruby
Guest30 has quit [Client Quit]
protektwar has quit [Ping timeout: 268 seconds]
Ziyan_ has joined #ruby
Ziyan has quit [Ping timeout: 255 seconds]
<rapha>
y'all
<rapha>
what's the meaning of !!something?
<rapha>
whatever i make "something" be, it seems i always get true out of it
<rapha>
havenwood: ox1eef_: wow, ok, you did golf that down, good lord!!!
<rapha>
havenwood: i'm not sure i'm understanding yours, but only due to a typo / line break on IRC ... was it intended to begin with `each.with_index(1).each_with_object({})`?
<rapha>
but missing the edge case of 1 element in the array only :)
jpn has quit [Ping timeout: 268 seconds]
<gr33n7007h>
rapha: this part handles 1 element `:h[k]=v` of the ternary operator =)
<rapha>
o_O
jpn has joined #ruby
<rapha>
ok i'll have to expand that and really read it in depth tonight after work
<gr33n7007h>
rapha: 👍
jpn_ has joined #ruby
jpn has quit [Ping timeout: 260 seconds]
jl- has joined #ruby
Ziyan has joined #ruby
Ziyan_ has quit [Ping timeout: 248 seconds]
jl- has quit [Ping timeout: 268 seconds]
bit4bit has joined #ruby
jpn_ has quit [Ping timeout: 246 seconds]
davidw_ has joined #ruby
jpn has joined #ruby
dionysus69 has quit [Ping timeout: 240 seconds]
dionysus69 has joined #ruby
<adam12>
I wonder if OptionParser can work in a git-subcommand style. Where some options are global, and some options are relevant to ARGV[0] after parsing. Has anybody done that before?
<adam12>
I'm trying to stay dependency-free for this, so only core+stdlib.
jl- has joined #ruby
<adam12>
I feel like you'd need to double parse, first for the global options, then second for the specific command options, but OptionParser complains when it finds an option it doesn't recognize. I don't think you could just rescue it as the flow is already broken. Hmm.
<weaksauce>
i've used it before and it's pretty slick
<axisys>
how to handle exception and return "false" and with no exception return "true"
<ox1eef_>
many ways
<ox1eef_>
def foo
<ox1eef_>
bar
<ox1eef_>
true
<ox1eef_>
rescue
<ox1eef_>
false
<ox1eef_>
end
<ox1eef_>
thats one way
gr33n7007h has quit [Ping timeout: 240 seconds]
<axisys>
ox1eef_: will that return true when there is no exception?
<ox1eef_>
yup, assuming that 'bar' is a method call that doesn't raise, true will be returned.
gr33n7007h has joined #ruby
michigan has quit [Quit: Connection closed for inactivity]
<axisys>
awesome!
<axisys>
i see some where it is written as `return true` or `return false` .. but I see just `true` or `false` works perfect for ruby since it returns the last output.. so what is recommended?
<weaksauce>
axisys whatever your company dictates :)
<weaksauce>
barring that I would just do true
<ox1eef_>
when you dig into it, it expands into different opinions and mindsets. some would argue, and i generally agree, that returning a strict true or return false value is often unneccessary - you can rely on the value being truthy, or false/nil.
szkl has quit [Quit: Connection closed for inactivity]
<ox1eef_>
if you know 'bar' will return something truthy, you could drop the 'true' altogether.
jpn has quit [Ping timeout: 256 seconds]
jpn has joined #ruby
jl- has joined #ruby
jl- has quit [Ping timeout: 272 seconds]
<axisys>
ox1eef_: yeah my case it does not. so just true or false actually worked nicely
dionysus69 has quit [Read error: Connection reset by peer]
dionysus69 has joined #ruby
ur5us has joined #ruby
dionysus69 has quit [Ping timeout: 268 seconds]
siery has quit [Ping timeout: 268 seconds]
mynameisdebian has joined #ruby
<mynameisdebian>
I just learned testing (Test::Unit) but I'm not totally sure what to do with these tests. Say I want an e-mail fired off if a test fails. Do I have to write a shell script to read the result of running the Ruby test, or is there some framework or something that allows me to do it all in Ruby? Or is that part of Test::Unit and I just don't