Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ jobs:
- { os: windows-latest , ruby: mingw }
- { os: windows-latest , ruby: mswin }
- { os: ubuntu-latest , ruby: jruby-9.4 }
- { os: ubuntu-latest , ruby: truffleruby-33 } # using stdlib implementation
- { os: ubuntu-latest , ruby: truffleruby-head } # using truffleruby_strscan.rb
exclude:
- { os: macos-latest , ruby: 2.4 }
- { os: ubuntu-latest , ruby: 2.5 }
- { os: macos-latest , ruby: 2.5 }
- { os: windows-latest , ruby: head }
- { os: ubuntu-latest , ruby: truffleruby }
- { os: macos-latest , ruby: truffleruby }
- { os: windows-latest , ruby: truffleruby }
- { os: windows-latest , ruby: truffleruby-head }

Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ if RUBY_ENGINE == "jruby"
ext.target_version = '1.8'
ext.ext_dir = 'ext/jruby'
end
extra_require_path = "ext/jruby/lib"
extra_require_path = "lib"
elsif RUBY_ENGINE == "ruby"
require 'rake/extensiontask'
Rake::ExtensionTask.new("strscan") do |x|
Expand Down
3 changes: 0 additions & 3 deletions ext/jruby/lib/strscan.rb

This file was deleted.

2 changes: 0 additions & 2 deletions ext/strscan/strscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -2299,6 +2299,4 @@ Init_strscan(void)
rb_define_method(StringScanner, "fixed_anchor?", strscan_fixed_anchor_p, 0);

rb_define_method(StringScanner, "named_captures", strscan_named_captures, 0);

rb_require("strscan/strscan");
}
18 changes: 18 additions & 0 deletions lib/strscan.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
case RUBY_ENGINE
when 'ruby'
require 'strscan.so'
require_relative 'strscan/strscan'
when 'jruby'
require 'strscan.jar'
JRuby::Util.load_ext('org.jruby.ext.strscan.StringScannerLibrary')
require_relative 'strscan/strscan'
when 'truffleruby'
if RUBY_ENGINE_VERSION.to_i >= 34
require 'strscan/truffleruby_strscan'
else
$LOAD_PATH.delete __dir__
require 'strscan'
end
else
raise "Unknown Ruby: #{RUBY_ENGINE}"
Copy link
Member

Choose a reason for hiding this comment

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

How about using NotImplementedError?

end
Loading