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

Parser error with required keyword arguments #38

Open
codelion opened this issue May 7, 2015 · 1 comment
Open

Parser error with required keyword arguments #38

codelion opened this issue May 7, 2015 · 1 comment

Comments

@codelion
Copy link

codelion commented May 7, 2015

The following code gives no syntax error when using ruby, but fails to parse with jruby parser (in all compat modes).

     def initialize(access_key_id:, secret_access_key:, bucket:, max_size: nil, prefix: nil, hasher: Refile::RandomHasher.new)
        @access_key_id = access_key_id
        @secret_access_key = secret_access_key
        @s3 = AWS::S3.new(access_key_id: access_key_id, secret_access_key: secret_access_key)
        @bucket_name = bucket
        @bucket = @s3.buckets[@bucket_name]
        @hasher = hasher
        @prefix = prefix
        @max_size = max_size
      end
@codelion codelion changed the title Parser error with missing default arguments Parser error with required keyword arguments May 13, 2015
@codelion
Copy link
Author

On further investigation I realized this is a feature introduced in Ruby 2.1 so may not be handled by jruby-parser in compat 2.0 mode.

https://robots.thoughtbot.com/ruby-2-keyword-arguments

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

1 participant