| 1 |
# frozen_string_literal: true |
| 2 |
|
| 3 |
name = File.basename(__FILE__, ".gemspec") |
| 4 |
version = ["lib", Array.new(name.count("-")+1, "..").join("/")].find do |dir| |
| 5 |
break File.foreach(File.join(__dir__, dir, "#{name.tr('-', '/')}.rb")) do |line| |
| 6 |
/^\s*VERSION\s*=\s*"(.*)"/ =~ line and break $1 |
| 7 |
end rescue nil |
| 8 |
end |
| 9 |
|
| 10 |
Gem::Specification.new do |spec| |
| 11 |
spec.name = name |
| 12 |
spec.version = version |
| 13 |
spec.authors = ["Yukihiro Matsumoto"] |
| 14 |
spec.email = ["[email protected]"] |
| 15 |
|
| 16 |
spec.summary = %q{Support for the Common Gateway Interface protocol.} |
| 17 |
spec.description = %q{Support for the Common Gateway Interface protocol.} |
| 18 |
spec.homepage = "https://github.com/ruby/cgi" |
| 19 |
spec.licenses = ["Ruby", "BSD-2-Clause"] |
| 20 |
spec.required_ruby_version = ">= 2.5.0" |
| 21 |
|
| 22 |
spec.metadata["homepage_uri"] = spec.homepage |
| 23 |
spec.metadata["source_code_uri"] = spec.homepage |
| 24 |
|
| 25 |
spec.executables = [] |
| 26 |
|
| 27 |
spec.files = [ |
| 28 |
"COPYING", |
| 29 |
"BSDL", |
| 30 |
"README.md", |
| 31 |
*Dir["lib{.rb,/**/*.rb}", "bin/*"] ] |
| 32 |
|
| 33 |
spec.require_paths = ["lib"] |
| 34 |
|
| 35 |
if Gem::Platform === spec.platform and spec.platform =~ 'java' or RUBY_ENGINE == 'jruby' |
| 36 |
spec.platform = 'java' |
| 37 |
spec.require_paths << "ext/java/org/jruby/ext/cgi/escape/lib" |
| 38 |
spec.files += Dir["ext/java/**/*.{rb}", "lib/cgi/escape.jar"] |
| 39 |
else |
| 40 |
spec.files += Dir["ext/cgi/**/*.{rb,c,h,sh}", "ext/cgi/escape/depend", "lib/cgi/escape.so"] |
| 41 |
spec.extensions = ["ext/cgi/escape/extconf.rb"] |
| 42 |
end |
| 43 |
end |