[rubygems/rubygems] Fix indentation in case statement

https://github.com/rubygems/rubygems/commit/8ac0647659
This commit is contained in:
bronzdoc 2019-05-29 20:23:59 -06:00 коммит произвёл Hiroshi SHIBATA
Родитель 8f2379b0c5
Коммит 2e9c078707
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: F9CF13417264FAC2
1 изменённых файлов: 10 добавлений и 10 удалений

Просмотреть файл

@ -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}"