activerecord-msgpack_serializer 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f3fb3f1dba7bda0293b49ed36dad027a05550e6
|
4
|
+
data.tar.gz: 642ed0ca7469e70ca46eb90d1c714bc8848de8f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 40079825410ff372c6fb07477dfd6f4b8e0ca000b327acb7e7fe8aca72637dbe978b23dc04b7c2aa567c47999ccbd33934814818b4fcb1e678ccffd2d4be5857
|
7
|
+
data.tar.gz: 9d434698f18fdcad0e7c83e92cfa81e21aaa98e05dbeef5cf90961c29415bbda0bcf45c33296593654f13e7710677880772c4c51ed192404842d6b6335bed3c2
|
data/Rakefile
CHANGED
@@ -5,12 +5,12 @@ module Serializers
|
|
5
5
|
class MessagePackSerializer
|
6
6
|
class << self
|
7
7
|
def load(binary)
|
8
|
-
return nil if binary.match(/\A[[:space:]]*\z/)
|
9
|
-
MessagePack.unpack(binary.
|
8
|
+
return nil if binary.nil? || binary.match(/\A[[:space:]]*\z/)
|
9
|
+
MessagePack.unpack(binary.force_encoding("ASCII-8BIT"))
|
10
10
|
end
|
11
11
|
|
12
12
|
def dump(obj)
|
13
|
-
MessagePack.pack(obj).
|
13
|
+
MessagePack.pack(obj).force_encoding("ASCII-8BIT")
|
14
14
|
end
|
15
15
|
end
|
16
16
|
end
|
@@ -6,6 +6,14 @@ describe ActiveRecord::Serializers::MessagePackSerializer do
|
|
6
6
|
described_class.load(binary)
|
7
7
|
end
|
8
8
|
|
9
|
+
context "with nil" do
|
10
|
+
let(:binary) do
|
11
|
+
nil
|
12
|
+
end
|
13
|
+
|
14
|
+
it { should be_nil }
|
15
|
+
end
|
16
|
+
|
9
17
|
context "with blank data" do
|
10
18
|
let(:binary) do
|
11
19
|
""
|
@@ -16,7 +24,7 @@ describe ActiveRecord::Serializers::MessagePackSerializer do
|
|
16
24
|
|
17
25
|
context "with valid binary string" do
|
18
26
|
let(:binary) do
|
19
|
-
"\x92\xA3foo*".
|
27
|
+
"\x92\xA3foo*".force_encoding("ASCII-8BIT") # == ["foo", 42].to_smgpack
|
20
28
|
end
|
21
29
|
|
22
30
|
it "returns valid data" do
|
@@ -35,7 +43,7 @@ describe ActiveRecord::Serializers::MessagePackSerializer do
|
|
35
43
|
end
|
36
44
|
|
37
45
|
it "returns valid binary string" do
|
38
|
-
should == "\x92\xA3foo*".
|
46
|
+
should == "\x92\xA3foo*".force_encoding("ASCII-8BIT")
|
39
47
|
end
|
40
48
|
end
|
41
49
|
end
|
metadata
CHANGED
@@ -1,97 +1,97 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-msgpack_serializer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shimpei Makimoto
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-12-
|
11
|
+
date: 2013-12-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.3'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: pry
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rspec
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: activerecord
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - ~>
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '4.0'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - ~>
|
80
|
+
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '4.0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: msgpack
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '0'
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
description:
|
@@ -101,7 +101,8 @@ executables: []
|
|
101
101
|
extensions: []
|
102
102
|
extra_rdoc_files: []
|
103
103
|
files:
|
104
|
-
- .gitignore
|
104
|
+
- ".gitignore"
|
105
|
+
- ".travis.yml"
|
105
106
|
- Gemfile
|
106
107
|
- README.md
|
107
108
|
- Rakefile
|
@@ -120,21 +121,20 @@ require_paths:
|
|
120
121
|
- lib
|
121
122
|
required_ruby_version: !ruby/object:Gem::Requirement
|
122
123
|
requirements:
|
123
|
-
- -
|
124
|
+
- - ">="
|
124
125
|
- !ruby/object:Gem::Version
|
125
126
|
version: '0'
|
126
127
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
127
128
|
requirements:
|
128
|
-
- -
|
129
|
+
- - ">="
|
129
130
|
- !ruby/object:Gem::Version
|
130
131
|
version: '0'
|
131
132
|
requirements: []
|
132
133
|
rubyforge_project:
|
133
|
-
rubygems_version: 2.0
|
134
|
+
rubygems_version: 2.2.0
|
134
135
|
signing_key:
|
135
136
|
specification_version: 4
|
136
137
|
summary: A custom ActiveRecord serializer using MessagePack
|
137
138
|
test_files:
|
138
139
|
- spec/activerecord/serializers/message_pack_serializer_spec.rb
|
139
140
|
- spec/spec_helper.rb
|
140
|
-
has_rdoc:
|