(SyntaxError) while using the library. version_commands.rb:51: syntax error, unexpected '.'
Closed this issue · 3 comments
nithish-thomas commented
Our build system is throwing the below error while trying to use the library
/07 04:42:37 [ERROR] service: branch_name: options.branch&.strip,
/07 04:42:37 [ERROR] service: ^
No idea on ruby syntax but is the '&' supposed to be there.
YOU54F commented
YOU54F commented
Hey,
This is fixed now, tested in the ruby standalone
**curl -LO https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v1.88.85/pact-1.88.84-osx.tar.gz
tar xzf pact-1.88.84-osx.tar.gz
cd pact/bin
./pact-broker can-i-deploy
Result:
/Users/yousaf.nabi/dev/pact-foundation/pact_broker-client/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/pact_broker-client-1.61.0/lib/pact_broker/client/cli/broker.rb:8:in `require': /Users/yousaf.nabi/dev/pact-foundation/pact_broker-client/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/pact_broker-client-1.61.0/lib/pact_broker/client/cli/version_commands.rb:51: syntax error, unexpected '.' (SyntaxError)
branch_name: options.branch&.strip,
^
/Users/yousaf.nabi/dev/pact-foundation/pact_broker-client/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/pact_broker-client-1.61.0/lib/pact_broker/client/cli/version_commands.rb:52: syntax error, unexpected '.'
tags: options.tag&.collect(&:strip)
^
/Users/yousaf.nabi/dev/pact-foundation/pact_broker-client/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/pact_broker-client-1.61.0/lib/pact_broker/client/cli/version_commands.rb:53: syntax error, unexpected '}', expecting keyword_end
from /Users/yousaf.nabi/dev/pact-foundation/pact_broker-client/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/pact_broker-client-1.61.0/lib/pact_broker/client/cli/broker.rb:8:in `<top (required)>'
from /Users/yousaf.nabi/dev/pact-foundation/pact_broker-client/pact/bin/pact/lib/app/pact-broker.rb:1:in `require'
from /Users/yousaf.nabi/dev/pact-foundation/pact_broker-client/pact/bin/pact/lib/app/pact-broker.rb:1:in `<main>
Post
curl -LO https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v1.88.85/pact-1.88.85-osx.tar.gz
tar xzf pact-1.88.85-osx.tar.gz
cd pact/bin
./pact-broker can-i-deploy
Result
No value provided for required options '--pacticipant'