| 1 |
source_version = ["", "ext/nkf/"].find do |dir| |
| 2 |
begin |
| 3 |
break File.open(File.join(__dir__, "#{dir}nkf.c")) {|f| |
| 4 |
f.gets("\n#define NKF_GEM_VERSION ") |
| 5 |
f.gets[/\s*"(.+)"/, 1] |
| 6 |
} |
| 7 |
rescue Errno::ENOENT |
| 8 |
end |
| 9 |
end |
| 10 |
|
| 11 |
Gem::Specification.new do |spec| |
| 12 |
spec.name = "nkf" |
| 13 |
spec.version = source_version |
| 14 |
spec.authors = ["NARUSE Yui"] |
| 15 |
spec.email = ["[email protected]"] |
| 16 |
|
| 17 |
spec.summary = %q{Ruby extension for Network Kanji Filter} |
| 18 |
spec.description = %q{Ruby extension for Network Kanji Filter} |
| 19 |
spec.homepage = "https://github.com/ruby/nkf" |
| 20 |
spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0") |
| 21 |
spec.licenses = ["Ruby", "BSD-2-Clause"] |
| 22 |
|
| 23 |
spec.metadata["homepage_uri"] = spec.homepage |
| 24 |
spec.metadata["source_code_uri"] = spec.homepage |
| 25 |
|
| 26 |
# Specify which files should be added to the gem when it is released. |
| 27 |
# The `git ls-files -z` loads the files in the RubyGem that have been added into git. |
| 28 |
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do |
| 29 |
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } |
| 30 |
end |
| 31 |
spec.bindir = "exe" |
| 32 |
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } |
| 33 |
spec.require_paths = ["lib"] |
| 34 |
spec.extensions = ["ext/nkf/extconf.rb"] |
| 35 |
end |