diff options
-rw-r--r-- | lib/yaml.rb | 1 | ||||
-rw-r--r-- | lib/yaml/yaml.gemspec | 11 |
2 files changed, 10 insertions, 2 deletions
diff --git a/lib/yaml.rb b/lib/yaml.rb index 6d5d5ebd4c..cdacfaf69e 100644 --- a/lib/yaml.rb +++ b/lib/yaml.rb @@ -66,4 +66,5 @@ YAML = Psych # :nodoc: # # Syck can also be found on github: https://github.com/ruby/syck module YAML + VERSION = "0.2.1" end diff --git a/lib/yaml/yaml.gemspec b/lib/yaml/yaml.gemspec index 80554d8a7a..afe65a2c64 100644 --- a/lib/yaml/yaml.gemspec +++ b/lib/yaml/yaml.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 = "yaml" - spec.version = "0.2.1" + spec.name = name + spec.version = version spec.authors = ["Aaron Patterson", "SHIBATA Hiroshi"] spec.email = ["[email protected]", "[email protected]"] |