Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

Add compatibility with Ruby 2.0 #32

Merged
merged 1 commit into from
May 7, 2017

Conversation

bbonamin
Copy link
Contributor

@bbonamin bbonamin commented Mar 6, 2017

First of all, let me express my gratitude for this gem.

I've been trying to add a javascript linter to a project I'm working on so we can have some standards, and by far eslint-rails has been the best suited.

Now, for this project, we need compatibility with Ruby 2.0 (yeah yeah, I know it's not receiving fixes or patches anymore, but we can't upgrade yet.)

The gemspec of eslint-rails doesn't specify a minimum ruby version, but if you try to use the gem with < 2.1, it breaks because of the required keyword arguments that were introduced in 2.1.

This minor change makes the gem compatible with Ruby 2.0 and ensures it's specified on the gemspec.

Thanks!

@@ -10,7 +10,7 @@ def self.read(force_default: false)
CONFIG_PATH = 'config/eslint.json'
private_constant :CONFIG_PATH

def initialize(force_default:)
def initialize(force_default: raise(ArgumentError, 'force_default is required'))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer it if instead of doing this inline in the declaration, we make this force_default: nil and then raise on the first line if it's nil.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done 👍

@jonkessler
Copy link
Contributor

Left one comment. Just curious.. what issues are preventing you from upgrading from 2.0? I don't recall any serious issues when we upgraded our main app, which is many hundreds of thousands of lines of code.

@bbonamin bbonamin force-pushed the ruby-2.0-compatibility branch from 54d81d0 to fcdc0b3 Compare May 7, 2017 13:25
@bbonamin
Copy link
Contributor Author

bbonamin commented May 7, 2017

We don't really have any specific issues that prevent upgrading other than allocating the resources for a few dozen ruby applications. I've used newer rubies in other projects without issues either, just improvements!

Thanks.

@jonkessler
Copy link
Contributor

For sure. Definitely worthwhile for the performance improvements in our experience. Thanks for the pull!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants