зеркало из https://github.com/github/ruby.git
[ruby/optparse] Define OptionParser::Version
https://github.com/ruby/optparse/commit/4c0021b5b2
This commit is contained in:
Родитель
cd429e68d2
Коммит
f120e65200
|
@ -419,6 +419,8 @@
|
|||
# have any questions, file a ticket at http://bugs.ruby-lang.org.
|
||||
#
|
||||
class OptionParser
|
||||
OptionParser::Version = "0.1.0"
|
||||
|
||||
# :stopdoc:
|
||||
NoArgument = [NO_ARGUMENT = :NONE, nil].freeze
|
||||
RequiredArgument = [REQUIRED_ARGUMENT = :REQUIRED, true].freeze
|
||||
|
|
|
@ -1,6 +1,14 @@
|
|||
name = File.basename(__FILE__, ".gemspec")
|
||||
version = nil
|
||||
["lib", ".."].find do |dir|
|
||||
version = File.foreach(File.join(__dir__, dir, "#{name}.rb")) do |line|
|
||||
/^\s*OptionParser::Version\s*=\s*"(.*)"/ =~ line and break $1
|
||||
end rescue nil
|
||||
end
|
||||
|
||||
Gem::Specification.new do |spec|
|
||||
spec.name = "optparse"
|
||||
spec.version = "0.1.0"
|
||||
spec.name = name
|
||||
spec.version = version
|
||||
spec.authors = ["Nobu Nakada"]
|
||||
spec.email = ["nobu@ruby-lang.org"]
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче