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

unexpected token kDO for Ruby 2.3 #514

Closed
bdewater opened this issue Jun 23, 2018 · 3 comments
Closed

unexpected token kDO for Ruby 2.3 #514

bdewater opened this issue Jun 23, 2018 · 3 comments
Assignees

Comments

@bdewater
Copy link

bdewater commented Jun 23, 2018

Similar to reports #466, #447 and #507

We want to add Rubocop to ActiveMerchant: activemerchant/active_merchant#2894 but right now we need to exclude a few files since they break.

lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb breaks:

lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb:384:29: E: Lint/Syntax: unexpected token kDO_BLOCK
(Using Ruby 2.3 parser; configure using TargetRubyVersion parameter, under AllCops)
            recipients.each do |money, recipient, options|
                            ^^
lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb:384:58: E: Lint/Syntax: unexpected token tPIPE
(Using Ruby 2.3 parser; configure using TargetRubyVersion parameter, under AllCops)
            recipients.each do |money, recipient, options|
                                                         ^
lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb:386:39: E: Lint/Syntax: unexpected token kDO_BLOCK
(Using Ruby 2.3 parser; configure using TargetRubyVersion parameter, under AllCops)
              xml.tag!('MassPayItem') do
                                      ^^
lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb:716:3: E: Lint/Syntax: unexpected token kEND
(Using Ruby 2.3 parser; configure using TargetRubyVersion parameter, under AllCops)
  end
  ^^^

and lib/active_merchant/billing/gateways/paypal_express.rb:

lib/active_merchant/billing/gateways/paypal_express.rb:175:49: E: Lint/Syntax: unexpected token kDO_BLOCK
(Using Ruby 2.3 parser; configure using TargetRubyVersion parameter, under AllCops)
                options[:shipping_options].each do |shipping_option|
                                                ^^
lib/active_merchant/billing/gateways/paypal_express.rb:176:28: E: Lint/Syntax: unexpected token tSTRING
(Using Ruby 2.3 parser; configure using TargetRubyVersion parameter, under AllCops)
                  xml.tag! 'n2:FlatRateShippingOptions' do
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/active_merchant/billing/gateways/paypal_express.rb:266:3: E: Lint/Syntax: unexpected token kEND
(Using Ruby 2.3 parser; configure using TargetRubyVersion parameter, under AllCops)
  end
  ^^^

Switching the TargetRubyVersion setting to 2.4 makes the problem go away. This is with parser 2.5.1.0.

cc @bpollack

@bdewater bdewater changed the title unexpected token kDO for 2.3 unexpected token kDO for Ruby 2.3 Jun 23, 2018
@iliabylich
Copy link
Collaborator

I can't reproduce it using the latest mater. @whitequark could you cut a release please? There are a few unreleased changes, one of them is related to cmdarg logic.

@whitequark
Copy link
Owner

Ah, will do soon.

@whitequark whitequark assigned whitequark and unassigned iliabylich Jun 24, 2018
@whitequark
Copy link
Owner

2.5.1.1, sorry for the delay.

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

3 participants