diff options
author | SHIBATA Hiroshi <hsbt@ruby-lang.org> | 2015-08-27 18:27:23 +0900 |
---|---|---|
committer | SHIBATA Hiroshi <hsbt@ruby-lang.org> | 2015-08-27 18:27:23 +0900 |
commit | 019741ab9559bc93f79625e1af3521719efe8708 (patch) | |
tree | bb5065ca5817e5abbd8d7f84f508ca055be4bef4 /lib/psych/visitors/yaml_tree.rb | |
parent | a69101003c12d00a9b50bae515eaeb1a56c614e4 (diff) | |
download | psych-019741ab9559bc93f79625e1af3521719efe8708.zip |
removed Ruby 1.9 support
Diffstat (limited to 'lib/psych/visitors/yaml_tree.rb')
-rw-r--r-- | lib/psych/visitors/yaml_tree.rb | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/lib/psych/visitors/yaml_tree.rb b/lib/psych/visitors/yaml_tree.rb index 3087a4d..63e14da 100644 --- a/lib/psych/visitors/yaml_tree.rb +++ b/lib/psych/visitors/yaml_tree.rb @@ -510,27 +510,11 @@ module Psych def dump_list o end - # '%:z' was no defined until 1.9.3 - if RUBY_VERSION < '1.9.3' - def format_time time - formatted = time.strftime("%Y-%m-%d %H:%M:%S.%9N") - - if time.utc? - formatted += " Z" - else - zone = time.strftime('%z') - formatted += " #{zone[0,3]}:#{zone[3,5]}" - end - - formatted - end - else - def format_time time - if time.utc? - time.strftime("%Y-%m-%d %H:%M:%S.%9N Z") - else - time.strftime("%Y-%m-%d %H:%M:%S.%9N %:z") - end + def format_time time + if time.utc? + time.strftime("%Y-%m-%d %H:%M:%S.%9N Z") + else + time.strftime("%Y-%m-%d %H:%M:%S.%9N %:z") end end |