shaped 0.6.3 → 0.6.4

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
  SHA256:
3
- metadata.gz: feb705e286456a57f403fa60fa90397c107dd61eb0da767f59c448379c93076a
4
- data.tar.gz: 162b077604deddec490b40d25b7642dc5c11cb68df5fd662242691b9b1893b3b
3
+ metadata.gz: 1f6ca9518d2b3b0b55988f53d055a48c1344c54d6c8f8497877fb48e8ad621e1
4
+ data.tar.gz: c7e2be555928b918681670b803ea95b70ad97da25f0b4079be7fa6f16c4f6892
5
5
  SHA512:
6
- metadata.gz: 73194df0310f71f4037bf3751f637f261b3cc33427ab2da282d9bef22cb8c71e2f00f5525a84137f6496defab7fd01f58feb8506d699d0b8e18e6cc0e039865b
7
- data.tar.gz: b822fd85a851e383c571ecf98d4f7f1808bdead8928641fc4aa9f73c2bac6c5384325ad397ca0199e1b1c62e529be62f95e91af2cb36ebdc5d93328de3c53906
6
+ metadata.gz: 59c995d6a92d07d29b87a565924dbd175f8bce9e7ce158bdc98cf450aa5fb8e5073f78e6eeea5be0a140045e838e3562da9a2562a3263666dceeac23b7ac0368
7
+ data.tar.gz: 4c3b1e10af00279e075c7094a06b07b8624f3fc165fcea3704db18a5d52ec48b58bf9a8dffd31320465f2bad598d820f193f901be9bbe7f29e2852e7d8eda5a3
@@ -1,3 +1,10 @@
1
+ ## v0.6.4 (2020-06-22)
2
+ ### Fixed
3
+ - Make it possible to specify optional keys in a Hash shape (using an `Or` shape as the value)
4
+
5
+ ### Docs
6
+ - Remove explicit `git push` from release instructions
7
+
1
8
  ## v0.6.3 (2020-06-21)
2
9
  ### Docs
3
10
  - Add badges for Dependabot status and RubyGems version
@@ -10,7 +10,7 @@ GIT
10
10
  PATH
11
11
  remote: .
12
12
  specs:
13
- shaped (0.6.3)
13
+ shaped (0.6.4)
14
14
  activemodel (~> 6.0)
15
15
  activesupport (~> 6.0)
16
16
 
@@ -71,7 +71,7 @@ GEM
71
71
  byebug (~> 11.0)
72
72
  pry (~> 0.13.0)
73
73
  rainbow (3.0.0)
74
- rake (12.3.3)
74
+ rake (13.0.1)
75
75
  rb-fsevent (0.10.4)
76
76
  rb-inotify (0.10.1)
77
77
  ffi (~> 1.0)
data/README.md CHANGED
@@ -358,8 +358,7 @@ To release a new version:
358
358
  3. update the version number in `version.rb`
359
359
  4. `bundle install` (which will update `Gemfile.lock`)
360
360
  5. commit the changes with a message like `Prepare to release v0.1.1`
361
- 6. push the changes to `origin/master` (GitHub) via `git push`
362
- 7. run `bin/release` (which will create a git tag for the version, push git commits and
361
+ 6. run `bin/release` (which will create a git tag for the version, push git commits and
363
362
  tags to GitHub, and push the gem to RubyGems)
364
363
 
365
364
  # License
@@ -27,6 +27,7 @@ module Shaped
27
27
  end
28
28
 
29
29
  case shape_description
30
+ when Shaped::Shape then shape_description
30
31
  when Hash then Shaped::Shapes::Hash.new(shape_description)
31
32
  when Array then Shaped::Shapes::Array.new(shape_description)
32
33
  when Class then Shaped::Shapes::Class.new(shape_description, validation_options)
@@ -12,9 +12,6 @@ class Shaped::Shapes::Hash < Shaped::Shape
12
12
  def matched_by?(hash)
13
13
  return false if !hash.is_a?(Hash)
14
14
 
15
- missing_keys = expected_keys - hash.keys
16
- return false if missing_keys.any?
17
-
18
15
  @hash_description.all? do |key, expected_value_shape|
19
16
  expected_value_shape.matched_by?(hash[key])
20
17
  end
@@ -28,10 +25,4 @@ class Shaped::Shapes::Hash < Shaped::Shape
28
25
 
29
26
  "{ #{printable_shape_description} }"
30
27
  end
31
-
32
- private
33
-
34
- def expected_keys
35
- @hash_description.keys
36
- end
37
28
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Shaped
4
- VERSION = '0.6.3'
4
+ VERSION = '0.6.4'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shaped
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.3
4
+ version: 0.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Runger