json-compare 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +11 -0
- data/lib/json-compare/comparer.rb +5 -1
- data/lib/json-compare/version.rb +1 -1
- metadata +3 -2
data/CHANGES
ADDED
@@ -3,6 +3,10 @@ module JsonCompare
|
|
3
3
|
|
4
4
|
attr_accessor :excluded_keys
|
5
5
|
|
6
|
+
def is_boolean(obj)
|
7
|
+
!!obj == obj
|
8
|
+
end
|
9
|
+
|
6
10
|
def compare_elements(old, new)
|
7
11
|
diff = {}
|
8
12
|
if old.kind_of? Hash
|
@@ -12,7 +16,7 @@ module JsonCompare
|
|
12
16
|
diff_hash = compare_hashes(old, new)
|
13
17
|
end
|
14
18
|
diff = diff_hash if diff_hash.count > 0
|
15
|
-
elsif old.class != new.class
|
19
|
+
elsif (!is_boolean(old) || !is_boolean(new)) && old.class != new.class
|
16
20
|
diff = new
|
17
21
|
elsif old.kind_of? Array
|
18
22
|
diff_arr = compare_arrays(old, new)
|
data/lib/json-compare/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: json-compare
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-02-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -69,6 +69,7 @@ files:
|
|
69
69
|
- .gitignore
|
70
70
|
- .rspec
|
71
71
|
- .travis.yml
|
72
|
+
- CHANGES
|
72
73
|
- Gemfile
|
73
74
|
- LICENSE
|
74
75
|
- README.md
|