mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/optparse.rb, lib/optparse/version.rb: search also all
capital versions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
78ff3833fb
commit
22bb1debf9
3 changed files with 29 additions and 9 deletions
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,8 @@
|
|||
Mon Sep 8 20:00:12 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* lib/optparse.rb, lib/optparse/version.rb: search also all
|
||||
capital versions.
|
||||
|
||||
Mon Sep 8 19:26:33 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
|
||||
|
||||
* ext/openssl/ossl.h: include openssl/conf.h and openssl/conf_api.h.
|
||||
|
@ -15,7 +20,7 @@ Mon Sep 8 19:26:33 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
|
|||
|
||||
* ext/openssl/ossl_x509ext.c (ossl_x509_set_config): add for config=.
|
||||
|
||||
* ext/openssl/ossl_x509ext.c (Xossl_x509extfactory_initialize):
|
||||
* ext/openssl/ossl_x509ext.c (Xossl_x509extfactory_initialize):
|
||||
add attr readers: issuer_certificate, subject_certificate,
|
||||
subject_request, crl and config.
|
||||
|
||||
|
@ -28,7 +33,7 @@ Mon Sep 8 18:26:41 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
|
|||
|
||||
* lib/webrick/httpservlet/filehandler.rb (FileHandler#dir_list): ditto.
|
||||
|
||||
* lib/webrick/config.rb: :Listen option never be used.
|
||||
* lib/webrick/config.rb: :Listen option never be used.
|
||||
|
||||
* lib/webrick/server.rb (GenericServer#initialize): don't use :Listen
|
||||
option and add warning message.
|
||||
|
@ -54,7 +59,7 @@ Sat Sep 6 18:45:46 2003 Mauricio Fernandez <batsman.geo@yahoo.com>
|
|||
|
||||
Sat Sep 6 17:40:41 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
|
||||
|
||||
* ext/openssl/ruby_missing.c: rid of unnecessary backward
|
||||
* ext/openssl/ruby_missing.c: rid of unnecessary backward
|
||||
compatibility stuff. and remove DEFINE_ALLOC_WRAPPER from
|
||||
all sources.
|
||||
|
||||
|
|
|
@ -786,11 +786,11 @@ Default options, which never appear in option summary.
|
|||
attr_writer :version, :release
|
||||
|
||||
def version
|
||||
@version || (defined?(::Version) && ::Version)
|
||||
@version || (defined?(::Version) && ::Version) || (defined?(::VERSION) && ::VERSION)
|
||||
end
|
||||
|
||||
def release
|
||||
@release || (defined?(::Release) && ::Release)
|
||||
@release || (defined?(::Release) && ::Release) || (defined?(::RELEASE) && ::RELEASE)
|
||||
end
|
||||
|
||||
def ver
|
||||
|
|
|
@ -8,19 +8,34 @@ class << OptionParser
|
|||
str = "#{progname}"
|
||||
str << ": #{klass}" unless klass == Object
|
||||
str << " version #{version}"
|
||||
if klass.const_defined?(:Release)
|
||||
case
|
||||
when klass.const_defined?(:Release)
|
||||
str << " (#{klass.const_get(:Release)})"
|
||||
when klass.const_defined?(:RELEASE)
|
||||
str << " (#{klass.const_get(:Release)})"
|
||||
end
|
||||
puts str
|
||||
end
|
||||
if pkg.size == 1 and pkg[0] == "all"
|
||||
self.search_const(::Object, "Version", &show)
|
||||
self.search_const(::Object, /\AV(?:ERSION|ersion)\z/) do |klass, cname, version|
|
||||
unless cname[1] == ?e and klass.const_defined?(:Version)
|
||||
show.call(klass, version)
|
||||
end
|
||||
end
|
||||
else
|
||||
pkg.each do |pkg|
|
||||
/\A[A-Z]\w*((::|\/)[A-Z]\w*)*\z/ni =~ pkg or next
|
||||
begin
|
||||
pkg = eval(pkg)
|
||||
show.call(pkg, pkg.const_defined?(:Version) ? pkg.const_get(:Version) : "unknown")
|
||||
v = case
|
||||
when pkg.const_defined?(:Version)
|
||||
pkg.const_get(:Version)
|
||||
when pkg.const_defined?(:VERSION)
|
||||
pkg.const_get(:VERSION)
|
||||
else
|
||||
"unknown"
|
||||
end
|
||||
show.call(pkg, v)
|
||||
rescue NameError
|
||||
puts "#{progname}: #$!"
|
||||
end
|
||||
|
@ -45,7 +60,7 @@ class << OptionParser
|
|||
klass.constants.each do |cname|
|
||||
klass.const_defined?(cname) or next
|
||||
const = klass.const_get(cname)
|
||||
yield klass, const if cname == name
|
||||
yield klass, cname, const if name === cname
|
||||
klasses << const if Module === const and const != ::Object
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue