php-serialization 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. data/README.rdoc +29 -0
  2. data/VERSION +1 -1
  3. data/php-serialization.gemspec +1 -1
  4. metadata +1 -1
data/README.rdoc CHANGED
@@ -2,6 +2,35 @@
2
2
 
3
3
  Ruby implementation of PHP's serialization. This is special useful for reading PHP session files.
4
4
 
5
+ == Serialization examples
6
+
7
+ Primitive values
8
+
9
+ PhpSerialization.dump(10) # => "i:10;"
10
+ PhpSerialization.dump("Name") # => "s:4:\"Name\";"
11
+ PhpSerialization.dump(true) # => "b:1;"
12
+ PhpSerialization.dump(nil) # => "N;"
13
+
14
+ Array
15
+
16
+ PhpSerialization.dump([true, "foo"]) # => "a:2:{i:0;b:1;i:1;s:3:\"foo\";};"
17
+
18
+ Hash
19
+
20
+ PhpSerialization.dump("name" => "Rodrigo", "age" => 23) # => "a:2:{s:4:\"name\";s:7:\"Rodrigo\";s:3:\"age\";i:23;};"
21
+
22
+ Object
23
+
24
+ class Person
25
+ attr_accessor :name, :age
26
+ end
27
+
28
+ person = Person.new
29
+ person.name = "Rodrigo"
30
+ person.age = 23
31
+
32
+ PhpSerialization.dump(person) # => "O:6:\"Person\":2:{s:4:\"name\";s:7:\"Rodrigo\";s:3:\"age\";i:23;};"
33
+
5
34
  == Unserialization examples
6
35
 
7
36
  Primitive values
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0
1
+ 0.3.1
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{php-serialization}
8
- s.version = "0.3.0"
8
+ s.version = "0.3.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Rodrigo Kochenburger"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: php-serialization
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodrigo Kochenburger