undo-serializer-primitive 0.0.2 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: f54db446ef6baa794b8631db3faaefe56d19a747
4
+ data.tar.gz: 0192e4a46f012baedb9c4cef0729622fa90379db
5
+ SHA512:
6
+ metadata.gz: b8fc7352df2fd282bd75b54d519946e7c2b07e795499b877252a1aec24a13db3cb8afd58f651872f5874ed86d1e2266422cf132ae19c554acc943ec2be1e2a4d
7
+ data.tar.gz: 3f92223d32253b645b24dbeeb4bfd7d7d423ca64b01d35f2adf79a5e17932828ef849b4b92b8d40d4775190d26e869d75d6e50fec757e6ebb9121806f414a8cc
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.2
1
+ 0.1.0
@@ -37,7 +37,7 @@ module Undo
37
37
  end
38
38
 
39
39
  def deserialize?(hash)
40
- name == (hash[:serializer] || hash["serializer"])
40
+ name == (hash[:serializer] || hash["serializer"]) rescue false
41
41
  end
42
42
 
43
43
  private
@@ -22,4 +22,34 @@ describe Undo::Serializer::Primitive do
22
22
  end
23
23
  end
24
24
  end
25
+
26
+ describe ".serialize?" do
27
+ it "is true for primitives" do
28
+ [true, nil, 1, 1.0, "hello", :hello].each do |primitive|
29
+ expect(subject.serialize? primitive).to be true
30
+ end
31
+ end
32
+
33
+ it "is true for empty array and hash" do
34
+ [[], {}].each do |primitive|
35
+ expect(subject.serialize? primitive).to be true
36
+ end
37
+ end
38
+
39
+ it "is false for objects" do
40
+ expect(subject.serialize? Object.new).to be false
41
+ end
42
+ end
43
+
44
+ describe ".deserialize?" do
45
+ it "is true when was serialized by subject" do
46
+ data = subject.serialize "hello"
47
+ expect(subject.deserialize? data).to be true
48
+ end
49
+
50
+ it "is false otherwise" do
51
+ data = "hello".to_json
52
+ expect(subject.deserialize? data).to be false
53
+ end
54
+ end
25
55
  end
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
17
17
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
18
  spec.require_paths = ["lib"]
19
19
 
20
- spec.add_dependency "undo", "~> 1.0.0.beta3"
20
+ spec.add_dependency "undo", "~> 1.0"
21
21
  spec.add_development_dependency "bundler", "~> 1.0"
22
22
  spec.add_development_dependency "rake"
23
23
  spec.add_development_dependency "rspec", ">= 3.0.0.beta1"
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: undo-serializer-primitive
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
5
- prerelease:
4
+ version: 0.1.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Alexander Paramonov
@@ -14,65 +13,57 @@ dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: undo
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ~>
17
+ - - "~>"
20
18
  - !ruby/object:Gem::Version
21
- version: 1.0.0.beta3
19
+ version: '1.0'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ~>
24
+ - - "~>"
28
25
  - !ruby/object:Gem::Version
29
- version: 1.0.0.beta3
26
+ version: '1.0'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: bundler
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ~>
31
+ - - "~>"
36
32
  - !ruby/object:Gem::Version
37
33
  version: '1.0'
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ~>
38
+ - - "~>"
44
39
  - !ruby/object:Gem::Version
45
40
  version: '1.0'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: rake
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - ">="
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - ">="
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: rspec
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ! '>='
59
+ - - ">="
68
60
  - !ruby/object:Gem::Version
69
61
  version: 3.0.0.beta1
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ! '>='
66
+ - - ">="
76
67
  - !ruby/object:Gem::Version
77
68
  version: 3.0.0.beta1
78
69
  description: Serializer for primitives for Undo gem.
@@ -82,12 +73,12 @@ executables: []
82
73
  extensions: []
83
74
  extra_rdoc_files: []
84
75
  files:
85
- - .coveralls.yml
86
- - .gitignore
87
- - .rspec
88
- - .ruby-gemset
89
- - .ruby-version
90
- - .travis.yml
76
+ - ".coveralls.yml"
77
+ - ".gitignore"
78
+ - ".rspec"
79
+ - ".ruby-gemset"
80
+ - ".ruby-version"
81
+ - ".travis.yml"
91
82
  - Gemfile
92
83
  - LICENSE.txt
93
84
  - README.md
@@ -102,27 +93,26 @@ files:
102
93
  homepage: http://github.com/AlexParamonov/undo-serializer-primitive
103
94
  licenses:
104
95
  - MIT
96
+ metadata: {}
105
97
  post_install_message:
106
98
  rdoc_options: []
107
99
  require_paths:
108
100
  - lib
109
101
  required_ruby_version: !ruby/object:Gem::Requirement
110
- none: false
111
102
  requirements:
112
- - - ! '>='
103
+ - - ">="
113
104
  - !ruby/object:Gem::Version
114
105
  version: '0'
115
106
  required_rubygems_version: !ruby/object:Gem::Requirement
116
- none: false
117
107
  requirements:
118
- - - ! '>='
108
+ - - ">="
119
109
  - !ruby/object:Gem::Version
120
110
  version: '0'
121
111
  requirements: []
122
112
  rubyforge_project:
123
- rubygems_version: 1.8.25
113
+ rubygems_version: 2.1.11
124
114
  signing_key:
125
- specification_version: 3
115
+ specification_version: 4
126
116
  summary: Serializer for primitives for Undo gem.
127
117
  test_files:
128
118
  - spec/integration/undo_spec.rb