php-serialization 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/php_serialization/serializer.rb +2 -2
- data/php-serialization.gemspec +1 -1
- data/spec/serialization_spec.rb +4 -0
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.2
|
@@ -12,8 +12,8 @@ module PhpSerialization
|
|
12
12
|
"i:#{object};"
|
13
13
|
when Float then
|
14
14
|
"d:#{object};"
|
15
|
-
when String then
|
16
|
-
"s:#{object.length}:\"#{object}\";"
|
15
|
+
when String, Symbol then
|
16
|
+
"s:#{object.to_s.length}:\"#{object}\";"
|
17
17
|
when Array then
|
18
18
|
idx = -1
|
19
19
|
items = object.map { |item| "#{run(idx += 1)}#{run(item)}" }.join
|
data/php-serialization.gemspec
CHANGED
data/spec/serialization_spec.rb
CHANGED
@@ -9,6 +9,10 @@ describe "Serialization" do
|
|
9
9
|
PhpSerialization.dump("Name").should == 's:4:"Name";'
|
10
10
|
end
|
11
11
|
|
12
|
+
it "should serialize a symbol string" do
|
13
|
+
PhpSerialization.dump(:name).should == 's:4:"name";'
|
14
|
+
end
|
15
|
+
|
12
16
|
it "should serialize true" do
|
13
17
|
PhpSerialization.dump(true).should == 'b:1;'
|
14
18
|
end
|