json_expressions 0.8.3 → 0.9.0

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: 90c0f305959d6a5fcf0e47a839d8021724a0d790
4
- data.tar.gz: 60da4f8a6b32c87aa62e077e3ef4669cd2e0b585
3
+ metadata.gz: bac6dbc750fd14835c229c59f74a73ec1c6ff911
4
+ data.tar.gz: 256d95feb9c16c2cd88d0eb34334fbd633381d37
5
5
  SHA512:
6
- metadata.gz: 7bb2a32202011bca76df60a933992b5136c58e3ca83db04b7c5cca21831c77d249b6d43140c44a02555a13235451bb1d14b1c2d30e18057c48bb3f814bb00739
7
- data.tar.gz: cdce635eddc34a5f1027ae472ac726ddeda98c7238cf677916374b8e3bd3dff9d8907a6c4d374592e102532f0339c035e7bed0447c55f4972fffcb2d48ce0b9c
6
+ metadata.gz: ad4148de4d82bdaa27772c16576e007ec1a854f9be53afa8ca5a40b4f9658d66115ea508969ccd5cddd8b5c44ed7444d3b1fad8478ecf09c1565e86980f94678
7
+ data.tar.gz: bacd6ff650194838845b9ba7e9b9bbaa97678fb4b992277bce537b54e70227c1bf90b0e1b5931fc2466455c9edee9cdbbf43a521d44d3be58733c627cc1c2f41
@@ -1,3 +1,7 @@
1
+ ### v0.9.0 [view commit logs](https://github.com/chancancode/json_expressions/compare/0.8.3...0.9.0)
2
+
3
+ * Support for unified Integer class in Ruby 2.4+ (#39 from @iamliamnorton)
4
+
1
5
  ### v0.8.3 [view commit logs](https://github.com/chancancode/json_expressions/compare/0.8.2...0.8.3)
2
6
 
3
7
  * Print more detailed error message when matching arrays (#26 from @Maxim-Filimonov)
data/README.md CHANGED
@@ -22,19 +22,19 @@ class UsersControllerTest < MiniTest::Unit::TestCase
22
22
  assert_equal 'Godfrey Chan', user['full_name']
23
23
  assert_equal 'godfrey@example.com', user['email']
24
24
  assert_equal 'Administrator', user['type']
25
- assert_kind_of Fixnum, user['points']
25
+ assert_kind_of Integer, user['points']
26
26
  assert_match /\Ahttps?\:\/\/.*\z/i, user['homepage']
27
27
 
28
28
  assert posts = user['posts']
29
29
 
30
- assert_kind_of Fixnum, posts[0]['id']
30
+ assert_kind_of Integer, posts[0]['id']
31
31
  assert_equal 'Hello world!', posts[0]['subject']
32
32
  assert_equal user_id, posts[0]['user_id']
33
33
  assert_include posts[0]['tags'], 'announcement'
34
34
  assert_include posts[0]['tags'], 'welcome'
35
35
  assert_include posts[0]['tags'], 'introduction'
36
36
 
37
- assert_kind_of Fixnum, posts[1]['id']
37
+ assert_kind_of Integer, posts[1]['id']
38
38
  assert_equal 'An awesome blog post', posts[1]['subject']
39
39
  assert_equal user_id, posts[1]['user_id']
40
40
  assert_include posts[0]['tags'], 'blog'
@@ -89,13 +89,13 @@ class UsersControllerTest < MiniTest::Unit::TestCase
89
89
  full_name: 'Godfrey Chan',
90
90
  email: 'godfrey@example.com',
91
91
  type: 'Administrator',
92
- points: Fixnum, # Any integer value
92
+ points: Integer, # Any integer value
93
93
  homepage: /\Ahttps?\:\/\/.*\z/i, # Let's get serious
94
94
  created_at: wildcard_matcher, # Don't care as long as it exists
95
95
  updated_at: wildcard_matcher,
96
96
  posts: [
97
97
  {
98
- id: Fixnum,
98
+ id: Integer,
99
99
  subject: 'Hello world!',
100
100
  user_id: :user_id, # Match against the captured value
101
101
  tags: [
@@ -105,7 +105,7 @@ class UsersControllerTest < MiniTest::Unit::TestCase
105
105
  ] # Ordering of elements does not matter by default
106
106
  }.ignore_extra_keys!, # Skip the uninteresting stuff
107
107
  {
108
- id: Fixnum,
108
+ id: Integer,
109
109
  subject: 'An awesome blog post',
110
110
  user_id: :user_id,
111
111
  tags: ['blog' , 'life']
@@ -226,7 +226,7 @@ but not
226
226
  `Module` (and by inheritance, `Class`) overrides `===` to mean `instance of`. You can exploit this behavior to do type matching:
227
227
  ```ruby
228
228
  {
229
- integer: Fixnum,
229
+ integer: Integer,
230
230
  float: Float,
231
231
  string: String,
232
232
  boolean: Boolean, # See http://stackoverflow.com/questions/3028243/check-if-ruby-object-is-a-boolean#answer-3028378
@@ -172,7 +172,7 @@ module JsonExpressions
172
172
 
173
173
  def make_path(path, segment)
174
174
  if path
175
- segment.is_a?(Fixnum) ? path + "[#{segment}]" : path + ".#{segment.to_s}"
175
+ segment.is_a?(0.class) ? path + "[#{segment}]" : path + ".#{segment.to_s}"
176
176
  end
177
177
  end
178
178
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: json_expressions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.3
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Godfrey Chan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-14 00:00:00.000000000 Z
11
+ date: 2017-04-10 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: JSON matchmaking for all your API testing needs.
14
14
  email:
@@ -39,17 +39,17 @@ require_paths:
39
39
  - lib
40
40
  required_ruby_version: !ruby/object:Gem::Requirement
41
41
  requirements:
42
- - - '>='
42
+ - - ">="
43
43
  - !ruby/object:Gem::Version
44
44
  version: '0'
45
45
  required_rubygems_version: !ruby/object:Gem::Requirement
46
46
  requirements:
47
- - - '>='
47
+ - - ">="
48
48
  - !ruby/object:Gem::Version
49
49
  version: 1.3.6
50
50
  requirements: []
51
51
  rubyforge_project:
52
- rubygems_version: 2.2.1
52
+ rubygems_version: 2.6.10
53
53
  signing_key:
54
54
  specification_version: 4
55
55
  summary: JSON Expressions