mirror of
https://github.com/ruby/ruby.git
synced 2026-01-27 04:24:23 +00:00
[ruby/optparse] We should use VERSION instead of Version constant
https://github.com/ruby/optparse/commit/94de48b47e
This commit is contained in:
parent
5b2707f39b
commit
2eae704938
@ -426,7 +426,8 @@ require 'set' unless defined?(Set)
|
||||
#
|
||||
class OptionParser
|
||||
# The version string
|
||||
OptionParser::Version = "0.7.0.dev.2"
|
||||
VERSION = "0.7.0.dev.2"
|
||||
Version = VERSION # for compatibility
|
||||
|
||||
# :stopdoc:
|
||||
NoArgument = [NO_ARGUMENT = :NONE, nil].freeze
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
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*OptionParser::Version\s*=\s*"(.*)"/ =~ line and break $1
|
||||
/^\s*VERSION\s*=\s*"(.*)"/ =~ line and break $1
|
||||
end rescue nil
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user