summaryrefslogtreecommitdiff
path: root/ext/json/json.gemspec
diff options
context:
space:
mode:
Diffstat (limited to 'ext/json/json.gemspec')
-rw-r--r--ext/json/json.gemspec105
1 files changed, 47 insertions, 58 deletions
diff --git a/ext/json/json.gemspec b/ext/json/json.gemspec
index d5f0a4de1d..5575731025 100644
--- a/ext/json/json.gemspec
+++ b/ext/json/json.gemspec
@@ -1,73 +1,62 @@
-# -*- encoding: utf-8 -*-
+# frozen_string_literal: true
+
+version = File.foreach(File.join(__dir__, "lib/json/version.rb")) do |line|
+ /^\s*VERSION\s*=\s*'(.*)'/ =~ line and break $1
+end rescue nil
+
+spec = Gem::Specification.new do |s|
+ java_ext = Gem::Platform === s.platform && s.platform =~ 'java' || RUBY_ENGINE == 'jruby'
-Gem::Specification.new do |s|
s.name = "json"
- s.version = File.read(File.expand_path('../VERSION', __FILE__)).chomp
+ s.version = version
s.summary = "JSON Implementation for Ruby"
- s.description = "This is a JSON implementation as a Ruby extension in C."
+ s.homepage = "https://github.com/ruby/json"
+ s.metadata = {
+ 'bug_tracker_uri' => 'https://github.com/ruby/json/issues',
+ 'changelog_uri' => 'https://github.com/ruby/json/blob/master/CHANGES.md',
+ 'documentation_uri' => 'https://docs.ruby-lang.org/en/master/JSON.html',
+ 'homepage_uri' => s.homepage,
+ 'source_code_uri' => 'https://github.com/ruby/json',
+ }
+
+ s.required_ruby_version = Gem::Requirement.new(">= 2.7")
+
+ if java_ext
+ s.description = "A JSON implementation as a JRuby extension."
+ s.author = "Daniel Luz"
+ s.email = "dev+ruby@mernen.com"
+ else
+ s.description = "This is a JSON implementation as a Ruby extension in C."
+ s.authors = ["Florian Frank"]
+ s.email = "flori@ping.de"
+ end
+
s.licenses = ["Ruby"]
- s.authors = ["Florian Frank"]
- s.email = "flori@ping.de"
- s.extensions = ["ext/json/ext/generator/extconf.rb", "ext/json/ext/parser/extconf.rb", "ext/json/extconf.rb"]
s.extra_rdoc_files = ["README.md"]
s.rdoc_options = ["--title", "JSON implementation for Ruby", "--main", "README.md"]
+
s.files = [
"CHANGES.md",
- "Gemfile",
- "LICENSE",
+ "COPYING",
+ "BSDL",
+ "LEGAL",
"README.md",
- "VERSION",
- "ext/json/ext/fbuffer/fbuffer.h",
- "ext/json/ext/generator/depend",
- "ext/json/ext/generator/extconf.rb",
- "ext/json/ext/generator/generator.c",
- "ext/json/ext/generator/generator.h",
- "ext/json/ext/parser/depend",
- "ext/json/ext/parser/extconf.rb",
- "ext/json/ext/parser/parser.c",
- "ext/json/ext/parser/parser.h",
- "ext/json/ext/parser/parser.rl",
- "ext/json/extconf.rb",
"json.gemspec",
- "lib/json.rb",
- "lib/json/add/bigdecimal.rb",
- "lib/json/add/complex.rb",
- "lib/json/add/core.rb",
- "lib/json/add/date.rb",
- "lib/json/add/date_time.rb",
- "lib/json/add/exception.rb",
- "lib/json/add/ostruct.rb",
- "lib/json/add/range.rb",
- "lib/json/add/rational.rb",
- "lib/json/add/regexp.rb",
- "lib/json/add/set.rb",
- "lib/json/add/struct.rb",
- "lib/json/add/symbol.rb",
- "lib/json/add/time.rb",
- "lib/json/common.rb",
- "lib/json/ext.rb",
- "lib/json/ext/.keep",
- "lib/json/generic_object.rb",
- "lib/json/pure.rb",
- "lib/json/pure/generator.rb",
- "lib/json/pure/parser.rb",
- "lib/json/version.rb",
- ] + Dir["tests/**/*"]
- s.homepage = "http://flori.github.com/json"
- s.metadata = {
- 'bug_tracker_uri' => 'https://github.com/flori/json/issues',
- 'changelog_uri' => 'https://github.com/flori/json/blob/master/CHANGES.md',
- 'documentation_uri' => 'http://flori.github.io/json/doc/index.html',
- 'homepage_uri' => 'http://flori.github.io/json/',
- 'source_code_uri' => 'https://github.com/flori/json',
- 'wiki_uri' => 'https://github.com/flori/json/wiki'
- }
+ ] + Dir.glob("lib/**/*.rb", base: File.expand_path("..", __FILE__))
- s.required_ruby_version = Gem::Requirement.new(">= 2.0")
- s.test_files = ["tests/test_helper.rb"]
+ if java_ext
+ s.platform = 'java'
+ s.files += Dir["lib/json/ext/**/*.jar"]
+ else
+ s.extensions = Dir["ext/json/**/extconf.rb"]
+ s.files += Dir["ext/json/**/*.{c,h,rb}"]
+ end
+end
- s.add_development_dependency "rake"
- s.add_development_dependency "test-unit"
+if RUBY_ENGINE == 'jruby' && $0 == __FILE__
+ Gem::Builder.new(spec).build
+else
+ spec
end