joost / phony_rails

This Gem adds useful methods to your Rails app to validate, display and save phone numbers. It uses the super awesome Phony gem (https://github.com/floere/phony).
MIT License
555 stars 111 forks source link

Make CI Green Again #201

Closed amatsuda closed 4 years ago

amatsuda commented 4 years ago

Here's an attempt to make the CI pass.

First of all, bundleing with the current Gemfile bundles both rails 6.0 and sqlite 1.3.6, but rails 6.0 internally requires sqlite3 1.4, and so it fails with a LoadError on runtime. The first commit fixes this dependency conflict. And with this fix, bundle e rspec spec now successfully runs on my local environment.

Next, running bundle e rubocop emits an error that says

Error: unrecognized cop Performance/StartWith found in .rubocop_todo.yml

The second commit fixes this by bundling rubocop-performance gem that has been extracted from the main rubocop gem since rubocop version 0.68.

Another error from rubocop is that the current newest 0.82 rubocop says it doesn't support current TargetRubyVersion. So the third commit updates the TargetRubyVersion from 2.3 to 2.4.

Then next, we're seeing an offence from RuboCop that suggests to use public version of Module#include instead of traditional idiom send :include. It's been 7 years since I introduced public version of Module#include to Ruby 2.1, but I'm still not sure whether all gem libraries should follow this cop and deliberately drop Ruby < 2.1 support. So instead of applying this rule, I just turned off the RuboCop offence via the fourth commit.

Lastly, since I added rubocop-performance gem, now we get another offence named Performance/RegexpMatch. Again, in order not to drop support for those who are running old versions of Ruby that do not implement Regexp#match? (< 2.4), I added a .rubocop_todo entry as the fifth commit.

This is everything that I packed in this PR. Hope this patch helps.

coveralls commented 4 years ago

Coverage Status

Coverage increased (+3.9%) to 99.83% when pulling 0bf2db04511ace00de20d8b857689e8f13bf1506 on amatsuda:make_ci_green_again into 594052de63350512c500a41b2b16194eb21d4591 on joost:master.

amatsuda commented 4 years ago

All checks have passed 👀