From d7a6d22d7859fcf1e8beab01dad0e668e3630bde Mon Sep 17 00:00:00 2001 From: Ivan Samsonov Date: Fri, 22 Jan 2010 18:39:16 +0300 Subject: Ruby 1.9 compatibility: removes ':' from when statements --- lib/plist/binary.rb | 10 +++++----- lib/plist/generator.rb | 6 +++--- 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 -- cgit v1.2.1