model icon indicating copy to clipboard operation
model copied to clipboard

[Hanami Issue 921] Support for Ruby version 2.4

Open iagus opened this issue 6 years ago • 3 comments

Hello!

Just started with Hanami and I thought this issue would be a good opportunity for a first dive-in! And the JRuby version 9.2.0.0 was just released! 💃

I also made this PR for the Devtools repo, so I could check the tests with the rubocop unstable's TargetRubyVersion changed.

To provide as much information as possible:

  • To check the tests with the new TargetRubyVersion I modified (not committed) the inherit_form in Devtools' .rubocop-unstable.yml.
  • Run the tests! However, got 1 offense:
.....................C..................................................................................................................

Offenses:

lib/hanami/model/migrator/mysql_adapter.rb:26:24: C: Performance/RegexpMatch: Use match? instead of match when MatchData is not used.
          message = if e.message.match(/database exists/) # rubocop:disable Performance/RedundantMatch
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/hanami/model/migrator/mysql_adapter.rb:40:24: C: Performance/RegexpMatch: Use match? instead of match when MatchData is not used.
          message = if e.message.match(/doesn\'t exist/) # rubocop:disable Performance/RedundantMatch
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  • I made the changes requested and re-run the tests:
.....................W..................................................................................................................

Offenses:

lib/hanami/model/migrator/mysql_adapter.rb:26:60: W: Lint/UnneededCopDisableDirective: Unnecessary disabling of Performance/RedundantMatch.
          message = if e.message.match?(/database exists/) # rubocop:disable Performance/RedundantMatch
                                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/hanami/model/migrator/mysql_adapter.rb:40:59: W: Lint/UnneededCopDisableDirective: Unnecessary disabling of Performance/RedundantMatch.
          message = if e.message.match?(/doesn\'t exist/) # rubocop:disable Performance/RedundantMatch
                                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I did as Rubocop commands and removed the directive!

The next tests run looked fine! 🍻 So I understand the last two changes make sense but let me know.

Thank you! 🌷

iagus avatar May 25 '18 21:05 iagus

@iagus Hi and thanks for this first stab. We can't merge your PRs yet, until Travis won't make JRuby 9.2.0.0 available.

jodosha avatar Jun 14 '18 10:06 jodosha

@iagus FYI https://github.com/hanami/devtools/pull/2 has been merged

AlfonsoUceda avatar Aug 05 '18 11:08 AlfonsoUceda

@iagus @AlfonsoUceda Please hold on with this. We need first to reach JRuby 9.2 compat for JRuby and then we'll be able to proceed.

jodosha avatar Aug 06 '18 13:08 jodosha