Issues with named parameters for generate CLI command
rmorlok opened this issue · 0 comments
rmorlok commented
Environment
$ ruby --version
ruby 2.3.7p456 (2018-03-28 revision 63024) [x86_64-darwin17]
$ rails --version
Rails 4.2.1
$ gem list symmetric-encryption
symmetric-encryption (4.1.1)
Expected Behavior
Generate command works
Actual Behavior
When I run the following command:
$ bin/symmetric-encryption --generate --app-name app_name --environments "development,test,staging,production" --keystore heroku
I get the following exception:
/code/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/symmetric-encryption-4.1.1/lib/symmetric_encryption/keystore.rb:13:in `generate_data_keys': wrong number of arguments (given 1, expected 0) (ArgumentError)
from /code/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/symmetric-encryption-4.1.1/lib/symmetric_encryption/cli.rb:224:in `generate_new_config'
from /code/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/symmetric-encryption-4.1.1/lib/symmetric_encryption/cli.rb:66:in `run!'
from /code/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/symmetric-encryption-4.1.1/lib/symmetric_encryption/cli.rb:14:in `run!'
from /code/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/symmetric-encryption-4.1.1/bin/symmetric-encryption:5:in `<top (required)>'
from bin/symmetric-encryption:29:in `load'
from bin/symmetric-encryption:29:in `<main>'
It appears to be a problem with named parameters. Fixing the initial error, I get the following exception:
/code/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/symmetric-encryption-4.1.1/lib/symmetric_encryption/keystore/environment.rb:10:in `generate_data_key': unknown keyword: key_path (ArgumentError)
from /code/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/symmetric-encryption-4.1.1/lib/symmetric_encryption/keystore/heroku.rb:7:in `generate_data_key'
from /code/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/symmetric-encryption-4.1.1/lib/symmetric_encryption/keystore.rb:23:in `block in generate_data_keys'
from /code/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/symmetric-encryption-4.1.1/lib/symmetric_encryption/keystore.rb:17:in `each'
from /code/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/symmetric-encryption-4.1.1/lib/symmetric_encryption/keystore.rb:17:in `generate_data_keys'
from /code/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/symmetric-encryption-4.1.1/lib/symmetric_encryption/cli.rb:224:in `generate_new_config'
from /code/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/symmetric-encryption-4.1.1/lib/symmetric_encryption/cli.rb:66:in `run!'
from /code/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/symmetric-encryption-4.1.1/lib/symmetric_encryption/cli.rb:14:in `run!'
from /code/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/symmetric-encryption-4.1.1/bin/symmetric-encryption:5:in `<top (required)>'
from bin/symmetric-encryption:29:in `load'
from bin/symmetric-encryption:29:in `<main>'