dry-struct 1.1.0 → 1.1.1

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: 9e2aaf63cecd9545e3b19c763209b1dc4d2a2c1dec53e2050cf02e5e9c29d97a
4
- data.tar.gz: b7464679f32b3d861bd63b31a24926a8806158bef3d2b99fc5199aa8c7f0db78
3
+ metadata.gz: 699389c318f69ba426a40f87002f2003470f2b5b5f4fe552a8e9951d233f66b8
4
+ data.tar.gz: adae078b67653286ce7f930d5a5f105be42ac4783775de11091ba63a4db44094
5
5
  SHA512:
6
- metadata.gz: 2003c10114e1aa03a19f21c68a1f3e3d684d2e4500cd22782c261ec935491668e56ce4916cd98ee1a9fbb64222dcf2f1061c9d6f90360bac351f0cd352c935a3
7
- data.tar.gz: 45d7b302ba157d73ae9d5039675dc6153b8b68b0739626d3db799bd8255be8ef3a2528db6b370ca6f4fde7dec2cc597950b710b3f84bcbee3cc889d9b444f664
6
+ metadata.gz: f97d383c6e7c6da04d71fb15ae37dd3e5a99a77d572edf19f5deee75422a03012985c1234f17dd24ed67927ca56dad5da668c3e3596dbc1f18f50f3b72436990
7
+ data.tar.gz: 2034ae0d33585fca5386ab7271c0e7699b570ea813b1cad26b6662fc6621c770fbce5a08b5fb7a983841a1dbc5285cf8547071f7e0b7a318f332ea9b7ccb5fc3
@@ -7,18 +7,17 @@ script:
7
7
  after_success:
8
8
  - "[ -d coverage ] && bundle exec codeclimate-test-reporter"
9
9
  rvm:
10
- - 2.4.5
11
- - 2.5.5
12
- - 2.6.3
13
- - jruby-9.2.7.0
10
+ - 2.4.9
11
+ - 2.5.7
12
+ - 2.6.5
13
+ - 2.7
14
+ - jruby-9.2.8.0
14
15
  - truffleruby
15
16
  env:
16
17
  global:
17
18
  - COVERAGE=true
18
19
  - JRUBY_OPTS='--dev -J-Xmx1024M'
19
20
  matrix:
20
- include:
21
- - rvm: 2.7
22
21
  allow_failures:
23
22
  - rvm: truffleruby
24
23
  notifications:
@@ -1,8 +1,8 @@
1
- # 1.1.0 2019-10-07
1
+ # 1.1.1 2019-10-13
2
2
 
3
- ## Added
3
+ ## Changed
4
4
 
5
- - Experimental support for pattern matching :tada: (flash-gordon)
5
+ - Pattern matching syntax is simplified with `deconstruct_keys` (k-tsj)
6
6
 
7
7
  ```ruby
8
8
  User = Dry.Struct(name: 'string', email: 'string')
@@ -10,14 +10,22 @@
10
10
  user = User.new(name: 'John Doe', email: 'john@acme.org')
11
11
 
12
12
  case user
13
- in User({ name: 'John Doe', email: })
13
+ in User(name: 'John Doe', email:)
14
14
  puts email
15
15
  else
16
16
  puts 'Not John'
17
17
  end
18
18
  ```
19
19
 
20
- See more examples in the [specs](https://github.com/dry-rb/dry-struct/blob/956fff208296731c40f1fea04b36106ea01b56d0/spec/dry/struct/pattern_matching_spec.rb).
20
+ See more examples in the [specs](https://github.com/dry-rb/dry-struct/blob/8112772eb08d22ff2cd3e6997514d79a9b124968/spec/dry/struct/pattern_matching_spec.rb).
21
+
22
+ [Compare v1.1.0...v1.1.1](https://github.com/dry-rb/dry-struct/compare/v1.1.0...v1.1.1)
23
+
24
+ # 1.1.0 2019-10-07
25
+
26
+ ## Added
27
+
28
+ - Experimental support for pattern matching :tada: (flash-gordon)
21
29
 
22
30
  [Compare v1.0.0...v1.1.0](https://github.com/dry-rb/dry-struct/compare/v1.0.0...v1.1.0)
23
31
 
@@ -188,8 +188,8 @@ module Dry
188
188
  # Pattern matching support
189
189
  #
190
190
  # @api private
191
- def deconstruct
192
- [attributes]
191
+ def deconstruct_keys(keys)
192
+ attributes
193
193
  end
194
194
  end
195
195
  end
@@ -1,6 +1,6 @@
1
1
  module Dry
2
2
  class Struct
3
3
  # @private
4
- VERSION = '1.1.0'.freeze
4
+ VERSION = '1.1.1'.freeze
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dry-struct
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Solnica
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-10-07 00:00:00.000000000 Z
11
+ date: 2019-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-equalizer