pact-foundation/pact_broker-client

(SyntaxError) while using the library. version_commands.rb:51: syntax error, unexpected '.'

Closed this issue · 3 comments

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.

branch_name: options.branch&.strip,

Hi @nithish-thomas

Could you try pact-1.88.83

pact-foundation/pact-ruby-standalone#72

We will get this sorted asap

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'

You're a champion @YOU54F