summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Samsonov <hronya@gmail.com>2010-01-22 18:39:16 +0300
committerIvan Samsonov <hronya@gmail.com>2010-01-22 18:39:16 +0300
commitd7a6d22d7859fcf1e8beab01dad0e668e3630bde (patch)
treef236299311c85e8c031859e6b6518c58f749dfa1
parent9f72ddd502d03e782d5fbcf9d0d6b90c6571d1e0 (diff)
downloadplist-dd_master.tar.gz
Ruby 1.9 compatibility: removes ':' from when statementsdd_master
-rw-r--r--lib/plist/binary.rb10
-rw-r--r--lib/plist/generator.rb6
2 files changed, 8 insertions, 8 deletions
diff --git a/lib/plist/binary.rb b/lib/plist/binary.rb
index 7bf0932..3f6eefa 100644
--- a/lib/plist/binary.rb
+++ b/lib/plist/binary.rb
@@ -310,15 +310,15 @@ module Plist
raise(ArgumentError, "negative integers require 8 or 16 bytes of storage")
end
case num_bytes
- when 1:
+ when 1
[i].pack("c")
- when 2:
+ when 2
[i].pack("n")
- when 4:
+ when 4
[i].pack("N")
- when 8:
+ when 8
[(i >> 32) & 0xffffffff, i & 0xffffffff].pack("NN")
- when 16:
+ when 16
[i >> 96, (i >> 64) & 0xffffffff, (i >> 32) & 0xffffffff,
i & 0xffffffff].pack("NNNN")
else
diff --git a/lib/plist/generator.rb b/lib/plist/generator.rb
index 882d4d8..4f46b50 100644
--- a/lib/plist/generator.rb
+++ b/lib/plist/generator.rb
@@ -213,9 +213,9 @@ module Plist
def self.element_type(item)
return case item
- when String, Symbol: 'string'
- when Fixnum, Bignum, Integer: 'integer'
- when Float: 'real'
+ when String, Symbol then 'string'
+ when Fixnum, Bignum, Integer then 'integer'
+ when Float then 'real'
else
raise "Don't know about this data type... something must be wrong!"
end