summaryrefslogtreecommitdiff
path: root/ext/pathname/pathname.gemspec
diff options
context:
space:
mode:
Diffstat (limited to 'ext/pathname/pathname.gemspec')
-rw-r--r--ext/pathname/pathname.gemspec11
1 files changed, 9 insertions, 2 deletions
diff --git a/ext/pathname/pathname.gemspec b/ext/pathname/pathname.gemspec
index c9c0b84e69..890bc2fde9 100644
--- a/ext/pathname/pathname.gemspec
+++ b/ext/pathname/pathname.gemspec
@@ -1,6 +1,13 @@
+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.2.0"
+ spec.name = name
+ spec.version = version
spec.authors = ["Tanaka Akira"]
spec.email = ["akr@fsij.org"]