File: json.gemspec

package info (click to toggle)
ruby-json 2.9.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,616 kB
  • sloc: ansic: 4,201; java: 3,457; ruby: 3,343; sh: 22; makefile: 11
file content (64 lines) | stat: -rw-r--r-- 1,771 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# 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'

  s.name = "json"
  s.version = version

  s.summary = "JSON Implementation for Ruby"
  s.homepage = "https://ruby.github.io/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://ruby.github.io/json/doc/index.html',
    'homepage_uri'      => s.homepage,
    'source_code_uri'   => 'https://github.com/ruby/json',
    'wiki_uri'          => 'https://github.com/ruby/json/wiki'
  }

  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.extra_rdoc_files = ["README.md"]
  s.rdoc_options = ["--title", "JSON implementation for Ruby", "--main", "README.md"]

  s.files = [
    "CHANGES.md",
    "COPYING",
    "BSDL",
    "LEGAL",
    "README.md",
    "json.gemspec",
    *Dir["lib/**/*.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,rl}"]
  end
end

if RUBY_ENGINE == 'jruby' && $0 == __FILE__
  Gem::Builder.new(spec).build
else
  spec
end