Skip to content

strscan incorrect version #6414

@marcandre

Description

@marcandre

I need to use StringScanner#captures (introduced in MRI 2.5) in rubocop-ast, which is a core dependency of RuboCop.

It appears that the version included in JRuby has it (great!), yet the version states 0.7.0 (same as Ruby 2.4 which doesn't have captures) and adding a >= 1.0.0 dependency in my gemspec will fail on JRuby

Is there a way for me to publish rubocop-ast so that it works with Ruby 2.4 (i.e. by upgrading strscan to >= 1.0.0) and be compatible with JRuby?

Sadly, I already published the gem 😓 (clearly, I need to add JRuby on the CI...), so a quick response would be greatly appreciated.

Details
$ rvm use 2.4
Using /Users/work/.rvm/gems/ruby-2.4.10
$ ruby -v -r strscan -e 'p StringScanner::Version, StringScanner.method_defined?(:captures)'
ruby 2.4.10p364 (2020-03-31 revision 67879) [x86_64-darwin17]
"0.7.0"
false
$ rvm use 2.5
Using /Users/work/.rvm/gems/ruby-2.5.8
$ ruby -v -r strscan -e 'p StringScanner::Version, StringScanner.method_defined?(:captures)'
ruby 2.5.8p224 (2020-03-31 revision 67882) [x86_64-darwin17]
"1.0.3"
true
$ rvm use jruby
Using /Users/work/.rvm/gems/jruby-9.2.9.0
$ ruby -v -r strscan -e 'p StringScanner::Version, StringScanner.method_defined?
jruby 9.2.9.0 (2.5.7) 2019-10-30 458ad3e Java HotSpot(TM) 64-Bit Server VM 9.0.1+11 on 9.0.1+11 +jit [darwin-x86_64]
"0.7.0"
true
$ ruby -v -r strscan -e 'p StringScanner::Version, StringScanner.method_defined?(:captures)'
jruby 9.3.0.0-SNAPSHOT (2.6.5) 2020-09-28 8c1a64a66f Java HotSpot(TM) 64-Bit Server VM 9.0.1+11 on 9.0.1+11 +jit [darwin-x86_64]
"0.7.0"
true

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions