diff --git a/lib/open-uri.rb b/lib/open-uri.rb index 93e8cfc..0052bb4 100644 --- a/lib/open-uri.rb +++ b/lib/open-uri.rb @@ -89,6 +89,9 @@ def self.open(name, *rest, &block) # Author:: Tanaka Akira module OpenURI + + VERSION = "0.3.0" + Options = { :proxy => true, :proxy_http_basic_authentication => true, diff --git a/open-uri.gemspec b/open-uri.gemspec index cad63e4..b6aaf35 100644 --- a/open-uri.gemspec +++ b/open-uri.gemspec @@ -1,6 +1,13 @@ +name = File.basename(__FILE__, ".gemspec") +version = ["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 = "open-uri" - spec.version = "0.3.0" + spec.name = name + spec.version = version spec.authors = ["Tanaka Akira"] spec.email = ["akr@fsij.org"]