diff options
Diffstat (limited to 'ext/pathname/pathname.gemspec')
-rw-r--r-- | ext/pathname/pathname.gemspec | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/ext/pathname/pathname.gemspec b/ext/pathname/pathname.gemspec index 8593f9e9c7..890bc2fde9 100644 --- a/ext/pathname/pathname.gemspec +++ b/ext/pathname/pathname.gemspec @@ -1,13 +1,20 @@ +name = File.basename(__FILE__, ".gemspec") +version = ["lib", "ext/lib"].find do |dir| + break File.foreach(File.join(__dir__, dir, "#{name}.rb")) do |line| + /^\s*VERSION\s*=\s*"(.*)"/ =~ line and break $1 + end rescue nil +end + Gem::Specification.new do |spec| - spec.name = "pathname" - spec.version = "0.1.0" + spec.name = name + spec.version = version spec.authors = ["Tanaka Akira"] spec.email = ["akr@fsij.org"] spec.summary = %q{Representation of the name of a file or directory on the filesystem} spec.description = %q{Representation of the name of a file or directory on the filesystem} spec.homepage = "https://github.com/ruby/pathname" - spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0") + spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0") spec.licenses = ["Ruby", "BSD-2-Clause"] spec.metadata["homepage_uri"] = spec.homepage @@ -19,7 +26,7 @@ Gem::Specification.new do |spec| `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } end spec.bindir = "exe" - spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } + spec.executables = [] spec.require_paths = ["lib"] spec.extensions = %w[ext/pathname/extconf.rb] end |