Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for ruby 2.0 #4

Open
tbarbugli opened this issue Feb 5, 2015 · 1 comment
Open

support for ruby 2.0 #4

tbarbugli opened this issue Feb 5, 2015 · 1 comment

Comments

@tbarbugli
Copy link

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?

@pda
Copy link
Collaborator

pda commented Mar 8, 2015

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants