ambethia / recaptcha

ReCaptcha helpers for ruby apps
http://github.com/ambethia/recaptcha
MIT License
1.96k stars 439 forks source link

Add new Rubies to CI matrix #408

Closed ybiquitous closed 2 years ago

ybiquitous commented 2 years ago

Why and what is being done.

I want to ensure this gem works on new Rubies (e.g. 3.0).

This change also includes:

My fork is working: https://github.com/ybiquitous/recaptcha/pull/1

Pre-Merge Checklist

ybiquitous commented 2 years ago

The new RuboCop version complains about the following offenses:

https://github.com/ybiquitous/recaptcha/runs/6088232395?check_suite_focus=true#step:4:78

lib/recaptcha.rb:88:7: C: [Correctable] Style/RedundantReturn: Redundant return detected. To return multiple values, use an array.
      return success, reply
      ^^^^^^
lib/recaptcha.rb:90:7: C: [Correctable] Style/RedundantReturn: Redundant return detected.
      return success
      ^^^^^^
lib/recaptcha.rb:106:7: C: [Correctable] Style/RedundantReturn: Redundant return detected. To return multiple values, use an array.
      return success, reply
      ^^^^^^
lib/recaptcha.rb:108:7: C: [Correctable] Style/RedundantReturn: Redundant return detected.
      return success
      ^^^^^^
lib/recaptcha.rb:157:21: C: [Correctable] Style/StringConcatenation: Prefer string interpolation to string concatenation.
    uri = URI.parse(configuration.verify_url + '?' + query)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/recaptcha.rb:165:21: C: Style/StringConcatenation: Prefer string interpolation to string concatenation.
    uri = URI.parse(configuration.verify_url + "/#{project_id}/assessments" + '?' + query)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/recaptcha/configuration.rb:40:5: C: [Correctable] Style/AccessorGrouping: Group together all attr_accessor attributes.
    attr_accessor :default_env, :skip_verify_env, :proxy, :secret_key, :site_key, :handle_timeouts_gracefully, :hostname
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/recaptcha/configuration.rb:41:5: C: [Correctable] Style/AccessorGrouping: Group together all attr_accessor attributes.
    attr_accessor :enterprise, :enterprise_api_key, :enterprise_project_id, :response_limit
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/recaptcha/helpers.rb:13:35: C: [Correctable] Style/StringConcatenation: Prefer string interpolation to string concatenation.
      id = options.delete(:id) || "g-recaptcha-response-data-" + dasherize_action(action)
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Should we also fix the offenses in this pull request? I can do it if you hope.

grosser commented 2 years ago

... maybe best to do a separate PR that just bumps rubocop

ybiquitous commented 2 years ago

@grosser Thanks for the feedback! I'll address the reviews.

grosser commented 2 years ago

I'm doing a rubocop bump, 1 sec :)

grosser commented 2 years ago

https://github.com/ambethia/recaptcha/pull/409

grosser commented 2 years ago

please rebase :)

ybiquitous commented 2 years ago

@grosser Thanks. Rebasing is done!

grosser commented 2 years ago