lib/plist4r/backend/haml.rb in plist4r-1.0.1 vs lib/plist4r/backend/haml.rb in plist4r-1.1.0
- old
+ new
@@ -1,11 +1,11 @@
require 'plist4r/backend_base'
require 'plist4r/mixin/ruby_stdlib'
require 'haml'
require 'base64'
-require 'date'
+require 'time'
# This backend uses haml to generate xml plists
# @author Dreamcat4 (dreamcat4@gmail.com)
module Plist4r::Backend::Haml
class << self
@@ -37,13 +37,10 @@
%key #{k}
%real #{v}
- when Time
%key #{k}
%date #{v.utc.strftime('%Y-%m-%dT%H:%M:%SZ')}
- - when Date
- %key #{k}
- %date #{v.strftime('%Y-%m-%dT%H:%M:%SZ')}
- when Array
%key #{k}
%array
- v.compact.each do |e|
- case e
@@ -59,11 +56,9 @@
%integer #{e}
- when Float
%real #{e}
- when Time
%date #{e.utc.strftime('%Y-%m-%dT%H:%M:%SZ')}
- - when Date
- %date #{e.strftime('%Y-%m-%dT%H:%M:%SZ')}
- when Hash
%dict
- tab_up ; block.call(e, block) ; tab_down
- when Hash
%key #{k}