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

Change Rubies to target for testing #1115

Closed

Conversation

pyrmont
Copy link
Contributor

@pyrmont pyrmont commented May 17, 2019

The purpose of #1110 is to get tests to work on Travis again as quickly as possible. To that end, it seeks to maintain as much as possible the current testing environment so as to avoid a longer policy discussion about what versions of Ruby to test.

This PR is intended to be a complement to #1110. It does propose a policy change: namely, that Rouge should drop support for Rubies prior to 2.3. It removes older Rubies from those tested by Travis and removes cruft from Gemfile that is no longer needed once older Rubies are dropped. It also adds 2.6 as a target.

The rationale for dropping support is, essentially, that Rubies prior to 2.3 are too old. Ruby 2.3 is itself no longer supported but since this support only ended in March 2019, it seems reasonable to keep it in the rotation for a little longer.

The counterargument is that Rouge is an important library and that, since we are not depending on features that are not in prior Rubies, we should maintain support as long as possible. As @mojavelinux said in #269 in the context of removing Ruby 1.9 from the Travis builds:

Rouge is a pretty fundamental library, so we want to be sure that no downstream programs still have a Ruby 1.9.3 requirement. Otherwise Rouge forces that decision, which I don't think is appropriate.

If accepted, this would close #1062 as it would no longer be necessary. It would also close #1081.

This commit is intended to be compatible with rouge-ruby#1110 (ie. it can be
applied after that PR). It removes older Rubies from those tested by
Travis and removes cruft from Gemfile that is no longer needed once
older Rubies are dropped.
@ashmaroli
Copy link
Contributor

IMO, a change in policy / contract would occur when Rouge enforces the upgrade via the gemspec:
https://github.com/jneen/rouge/blob/e957c740ca85b3a96f2cea1e8e1eafbf9cb2abc4/rouge.gemspec#L20

Until then, users still on those outdated Ruby versions will be able to use Rouge but effectively outside Rouge's support circle: Any new issue ticket opened to report a bug with those Ruby versions can be promptly closed with / without a recommendation to move to a newer Ruby version.

Either ways, hope to see this project returning to active development soon.. 🤞

@johnfairh
Copy link
Contributor

Just as a data point, sass/sassc-ruby#106 is about some user needs for Ruby pre-2.3 -- that project is restoring their support (which amounts to just test matrix + gemspec).

@jneen
Copy link
Member

jneen commented May 18, 2019

Is there a practical reason (other than "too old") to stop supporting older rubies? Are there features in newer rubies that are required for rouge to work properly?

@ashmaroli
Copy link
Contributor

Are there features in newer rubies that are required for rouge to work properly?

Not exactly in the "work properly" territory, but in the "work optimally" territory, Rouge could switch to Regexp#match? from Ruby 2.4 instead of String#=~ in situations where the matchdata is not consequently used..

That said, the switch wouldn't make much of a difference because such regexps may lie in just the lexers that not everyone uses...

However, the need of the hour is to get CI builds passing again (#1110 or #1062) so that the new maintainers can make an informed decision regarding the merge of remaining PRs..

@pyrmont
Copy link
Contributor Author

pyrmont commented May 18, 2019

First, I agree with @ashmaroli that #1110 should be merged as soon as possible. It doesn't change the status quo at all but merely gets Travis building properly again.

As for the question of whether we should drop support for older Rubies in Travis, I don't actually think the argument is that compelling. @ashmaroli commented in the discussion of #1062:

The advantage with this is that then the gem could move to using newer syntaxes like the safe navigation operator (&.), squiggly heredocs (<<~) from Ruby 2.3 and also using the faster Regexp#match? etc from Ruby 2.4.

These seem beneficial, albeit somewhat abstract. Given the points raised in the discussion linked to by @johnfairh, even though I submitted this PR, I tend to think it should be rejected (this implies #1062 should also be rejected).

@jneen
Copy link
Member

jneen commented May 18, 2019

I leave #1110 and #1062 to the maintainers. I don't believe we actually have a need for Regexp#match?, as we rely on the StringScanner library from stdlib, which is implemented in C.

@pyrmont
Copy link
Contributor Author

pyrmont commented May 19, 2019

Some of the source detection methods (be they in a lexer's self.detect? method or in the Disambiguation class) are areas where I think Regexp#match? could be used. But they seem like kind of an edge case and not areas which significantly affect most uses of Rouge.

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

Successfully merging this pull request may close these issues.

Drop support of unmaintained Ruby versions
4 participants