Skip to content
Merged
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: 3 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ jobs:
name: build (${{ matrix.ruby }} / ${{ matrix.os }})
strategy:
matrix:
ruby: [ '3.0', 2.7, 2.6, 2.5, head ]
ruby: [ '3.0', 2.7, 2.6, 2.5, head, jruby ]
os: [ ubuntu-latest, macos-latest, windows-latest ]
exclude:
- { os: windows-latest, ruby: head }
- { os: macos-latest, ruby: jruby }
- { os: windows-latest, ruby: jruby }
include:
- { os: windows-latest, ruby: mingw }
- { os: windows-latest, ruby: mswin }
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
/tmp/
/ChangeLog
/Gemfile.lock
*.jar
*.bundle
*.so
*.dll
24 changes: 20 additions & 4 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,30 @@
require "bundler/gem_tasks"
require "rake/testtask"

require 'rake/extensiontask'
extask = Rake::ExtensionTask.new("cgi/escape") do |x|
x.lib_dir.sub!(%r[(?=/|\z)], "/#{RUBY_VERSION}/#{x.platform}")
require 'rake/javaextensiontask'
Rake::JavaExtensionTask.new("escape") do |ext|
ext.source_version = '1.8'
ext.target_version = '1.8'
ext.ext_dir = 'ext/java'
ext.lib_dir = 'lib/cgi'

task :build => :compile
end

unless RUBY_ENGINE == 'jruby'
require 'rake/extensiontask'
extask = Rake::ExtensionTask.new("cgi/escape") do |x|
x.lib_dir.sub!(%r[(?=/|\z)], "/#{RUBY_VERSION}/#{x.platform}")
end
end

Rake::TestTask.new(:test) do |t|
t.libs << "lib/#{RUBY_VERSION}/#{extask.platform}"
t.libs << "test/lib"
if RUBY_ENGINE == 'jruby'
t.libs << "ext/java/org/jruby/ext/cgi/escape/lib"
else
t.libs << "lib/#{RUBY_VERSION}/#{extask.platform}"
end
t.ruby_opts << "-rhelper"
t.test_files = FileList['test/**/test_*.rb']
end
Expand Down
19 changes: 15 additions & 4 deletions cgi.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,21 @@ Gem::Specification.new do |spec|
spec.metadata["homepage_uri"] = spec.homepage
spec.metadata["source_code_uri"] = spec.homepage

spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
`git ls-files -z 2>/dev/null`.split("\x0").reject { |f| f.match(%r{\A(?:(?:test|spec|features)/|\.git)}) }
end
spec.extensions = ["ext/cgi/escape/extconf.rb"]
spec.executables = []

spec.files = [
"LICENSE.txt",
"README.md",
*Dir["lib{.rb,/**/*.rb}", "bin/*"] ]

spec.require_paths = ["lib"]

if Gem::Platform === spec.platform and spec.platform =~ 'java' or RUBY_ENGINE == 'jruby'
spec.platform = 'java'
spec.require_paths << "ext/java/org/jruby/ext/cgi/escape/lib"
spec.files += Dir["ext/java/**/*.{rb}", "lib/cgi/escape.jar"]
else
spec.files += Dir["ext/cgi/**/*.{rb,c,h,sh}", "ext/cgi/escape/depend", "lib/cgi/escape.so"]
spec.extensions = ["ext/cgi/escape/extconf.rb"]
end
end
Loading