diff options
Diffstat (limited to 'lib/find.gemspec')
| -rw-r--r-- | lib/find.gemspec | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/find.gemspec b/lib/find.gemspec index 3f0aadcdae..aef24a5028 100644 --- a/lib/find.gemspec +++ b/lib/find.gemspec @@ -1,6 +1,13 @@ +name = File.basename(__FILE__, ".gemspec") +version = ["lib", Array.new(name.count("-")+1).join("/")].find do |dir| + break File.foreach(File.join(__dir__, dir, "#{name.tr('-', '/')}.rb")) do |line| + /^\s*VERSION\s*=\s*"(.*)"/ =~ line and break $1 + end rescue nil +end + Gem::Specification.new do |spec| - spec.name = "find" - spec.version = "0.1.1" + spec.name = name + spec.version = version spec.authors = ['Kazuki Tsujimoto'] spec.email = ['kazuki@callcc.net'] @@ -18,7 +25,5 @@ Gem::Specification.new do |spec| spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do `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.require_paths = ["lib"] end |
