From de4fde9095c5380e8cef0a188d244a10f9184d6d Mon Sep 17 00:00:00 2001 From: hsbt Date: Wed, 7 Sep 2016 22:23:38 +0000 Subject: * lib/rdoc/*, test/rdoc/*: Update rdoc-5.0.0.beta2 Fixed ri parse defect with left-hand matched classes. https://github.com/rdoc/rdoc/pull/420 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rdoc/options.rb | 38 +++++++++++++------------------------- 1 file changed, 13 insertions(+), 25 deletions(-) (limited to 'lib/rdoc/options.rb') diff --git a/lib/rdoc/options.rb b/lib/rdoc/options.rb index 17b0bb105d..2bc7474eb0 100644 --- a/lib/rdoc/options.rb +++ b/lib/rdoc/options.rb @@ -379,23 +379,15 @@ class RDoc::Options @visibility = :protected @webcvs = nil @write_options = false - - if Object.const_defined? :Encoding then - @encoding = Encoding::UTF_8 - @charset = @encoding.name - else - @encoding = nil - @charset = 'UTF-8' - end + @encoding = Encoding::UTF_8 + @charset = @encoding.name end def init_with map # :nodoc: init_ivars encoding = map['encoding'] - @encoding = if Object.const_defined? :Encoding then - encoding ? Encoding.find(encoding) : encoding - end + @encoding = encoding ? Encoding.find(encoding) : encoding @charset = map['charset'] @exclude = map['exclude'] @@ -689,19 +681,16 @@ Usage: #{opt.program_name} [options] [names...] opt.separator "Parsing options:" opt.separator nil - if Object.const_defined? :Encoding then - opt.on("--encoding=ENCODING", "-e", Encoding.list.map { |e| e.name }, - "Specifies the output encoding. All files", - "read will be converted to this encoding.", - "The default encoding is UTF-8.", - "--encoding is preferred over --charset") do |value| - @encoding = Encoding.find value - @charset = @encoding.name # may not be valid value - end - - opt.separator nil - end + opt.on("--encoding=ENCODING", "-e", Encoding.list.map { |e| e.name }, + "Specifies the output encoding. All files", + "read will be converted to this encoding.", + "The default encoding is UTF-8.", + "--encoding is preferred over --charset") do |value| + @encoding = Encoding.find value + @charset = @encoding.name # may not be valid value + end + opt.separator nil opt.on("--locale=NAME", "Specifies the output locale.") do |value| @@ -1242,11 +1231,10 @@ Usage: #{opt.program_name} [options] [names...] RDoc.load_yaml open '.rdoc_options', 'w' do |io| - io.set_encoding Encoding::UTF_8 if Object.const_defined? :Encoding + io.set_encoding Encoding::UTF_8 YAML.dump self, io end end end - -- cgit v1.2.3