diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-09-07 22:23:38 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-09-07 22:23:38 +0000 |
commit | ba6ae341bab83dfc7a624c5bf20d8d162dacaff9 (patch) | |
tree | 540581a54cefcdc817577f646f09372f7e9936d1 /lib/rdoc/options.rb | |
parent | bf51c067b92361007a57909c539591d3d00cdbd8 (diff) |
* 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
Diffstat (limited to 'lib/rdoc/options.rb')
-rw-r--r-- | lib/rdoc/options.rb | 38 |
1 files changed, 13 insertions, 25 deletions
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 - |