diff options
author | bronzdoc <lsagastume1990@gmail.com> | 2019-05-29 20:23:59 -0600 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2019-09-26 17:48:00 +0900 |
commit | 2e9c078707b8c87511c9fe45b7057086e214f6fb (patch) | |
tree | dc8e6fcb8c9b196d6d37df19901a42b6f20b1493 /lib | |
parent | 8f2379b0c5e182eb6e417431cbdcf2a0edfba71a (diff) | |
download | ruby-2e9c078707b8c87511c9fe45b7057086e214f6fb.tar.gz |
[rubygems/rubygems] Fix indentation in case statement
https://github.com/rubygems/rubygems/commit/8ac0647659
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rubygems/specification.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb index ff54400c3b..a41cbde948 100644 --- a/lib/rubygems/specification.rb +++ b/lib/rubygems/specification.rb @@ -2293,19 +2293,19 @@ class Gem::Specification < Gem::BasicSpecification def ruby_code(obj) case obj - when String then obj.dump + ".freeze" - when Array then '[' + obj.map { |x| ruby_code x }.join(", ") + ']' - when Hash then + when String then obj.dump + ".freeze" + when Array then '[' + obj.map { |x| ruby_code x }.join(", ") + ']' + when Hash then seg = obj.keys.sort.map { |k| "#{k.to_s.dump} => #{obj[k].to_s.dump}" } "{ #{seg.join(', ')} }" - when Gem::Version then obj.to_s.dump - when DateLike then obj.strftime('%Y-%m-%d').dump - when Time then obj.strftime('%Y-%m-%d').dump - when Numeric then obj.inspect - when true, false, nil then obj.inspect + when Gem::Version then obj.to_s.dump + when DateLike then obj.strftime('%Y-%m-%d').dump + when Time then obj.strftime('%Y-%m-%d').dump + when Numeric then obj.inspect + when true, false, nil then obj.inspect when OpenSSL::PKey::RSA then obj.class - when Gem::Platform then "Gem::Platform.new(#{obj.to_a.inspect})" - when Gem::Requirement then + when Gem::Platform then "Gem::Platform.new(#{obj.to_a.inspect})" + when Gem::Requirement then list = obj.as_list "Gem::Requirement.new(#{ruby_code(list.size == 1 ? obj.to_s : list)})" else raise Gem::Exception, "ruby_code case not handled: #{obj.class}" |