diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2023-03-30 13:14:25 +0900 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2023-04-13 09:47:40 +0000 |
commit | 61bd69470a68354b77fad65119c56cbf19f2c152 (patch) | |
tree | c3a26823c7f3a250c23ee80b94031f48285a0a6a /lib | |
parent | 76aaaf6434752b5dc407878a5268892f859b2bf5 (diff) | |
download | ruby-61bd69470a68354b77fad65119c56cbf19f2c152.tar.gz |
[ruby/open-uri] Expose OpenURI::VERSION
https://github.com/ruby/open-uri/commit/666768d960
Diffstat (limited to 'lib')
-rw-r--r-- | lib/open-uri.gemspec | 11 | ||||
-rw-r--r-- | lib/open-uri.rb | 3 |
2 files changed, 12 insertions, 2 deletions
diff --git a/lib/open-uri.gemspec b/lib/open-uri.gemspec index cad63e4d80..b6aaf35200 100644 --- a/lib/open-uri.gemspec +++ b/lib/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"] diff --git a/lib/open-uri.rb b/lib/open-uri.rb index 93e8cfcdb7..0052bb49fb 100644 --- a/lib/open-uri.rb +++ b/lib/open-uri.rb @@ -89,6 +89,9 @@ end # Author:: Tanaka Akira <akr@m17n.org> module OpenURI + + VERSION = "0.3.0" + Options = { :proxy => true, :proxy_http_basic_authentication => true, |