http-signatures-ruby icon indicating copy to clipboard operation
http-signatures-ruby copied to clipboard

support for ruby 2.0

Open tbarbugli opened this issue 10 years ago • 1 comments

Hi, the gem is using required keywords arguments which is a feature introduced in 2.1. Would you consider merging a PR that switches to "normal" keywords arguments?

tbarbugli avatar Feb 05 '15 14:02 tbarbugli

I'm much more open to supporting 2.0 than I was to 1.9.x. What would that look like?

  1. foo(arg:) becomes foo(arg: nil)
    • :+1: simple.
    • :-1: we lose the assurance that the argument was passed.
  2. foo(arg:) becomes foo(arg: nil) with argument assertion in the method body.
    • :+1: can replicate the current behavior.
    • :-1: method bodies become verbose, boilerplate.
    • :-1: can't distinguish between argument passed as nil and argument not passed.
    • not bad overall.
  3. foo(arg:) becomes foo(arg: raise(ArgumentError, :arg))
    • :+1: can replicate the current behavior.
    • :+1: method bodies don't need to change.
    • :-1: method declarations become very long with multiple arguments.
  4. Something else…?

pda avatar Mar 08 '15 00:03 pda