value_semantics 3.2.1 → 3.3.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
  SHA256:
3
- metadata.gz: f122fa566277c213c7eb2a31b38af94d4287b1688d91da91bd5eea8044a041ba
4
- data.tar.gz: 371bc15f0cc7449042b19d5064e4a28f76ec1d6c0aae2c64622adf3252621045
3
+ metadata.gz: 9917cde0bb66e10e931d39308a1d968973e10f5de4b60b15898cb3d390f77fb9
4
+ data.tar.gz: b9ab7670cc254252d357a8276c1fb98305e9c3e60634354883e078179bad7b03
5
5
  SHA512:
6
- metadata.gz: a7ebe03be2de318e43027cc4d27ed737111654a5d74c0646f62691076e0f51938eb55966a3f04105f4a4c86d242a0134ca3f5fafa27089aedd4c51f2fb45abd9
7
- data.tar.gz: ac4e7a9f938e0bd9193d4260a8c211db6a05554463b6312a6409499a8d22c7a34b281093cf2c487676fefd58915b21027a47c99a75619fb2b80c457672ced57e
6
+ metadata.gz: 40c1a0ef2a51f2e18465013660a71ca3dbd50fd615dd1e0e7dd4e6e0a65ba3fc5f742132b62467178dad75f5e14452d8ebc38742fa8928254baad8709e89dfd6
7
+ data.tar.gz: 9d1eebc8605d6aed14be4eb0fec9fb78f7eca69894e3ee3d79c34a8c41763542b4a8ffc8fd57eba2848735b0732286d8cacbb46a64d509c5fe89a519c06afbe3
@@ -5,6 +5,9 @@ Notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [3.3.0] - 2020-07-17
9
+ ### Added
10
+ - Added support for pattern matching in Ruby 2.7
8
11
 
9
12
  ## [3.2.1] - 2020-07-11
10
13
  ### Fixed
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  [![Gem Version](https://badge.fury.io/rb/value_semantics.svg)](https://badge.fury.io/rb/value_semantics)
2
2
  [![Build Status](https://travis-ci.org/tomdalling/value_semantics.svg?branch=master)](https://travis-ci.org/tomdalling/value_semantics)
3
- ![Mutation Coverage](https://img.shields.io/badge/mutation%20coverage-100%25-brightgreen.svg)
3
+ ![Mutation Coverage](https://img.shields.io/badge/mutation%20coverage-to%20the%20MAX-brightgreen.svg)
4
4
 
5
5
  ValueSemantics
6
6
  ==============
@@ -101,6 +101,15 @@ other_tom = Person.new(name: 'Tom', age: 31)
101
101
  tom == other_tom #=> true
102
102
  tom.eql?(other_tom) #=> true
103
103
  tom.hash == other_tom.hash #=> true
104
+
105
+
106
+ #
107
+ # Ruby 2.7+ pattern matching
108
+ #
109
+ case tom
110
+ in { name: "Tom", age: }
111
+ puts age # outputs: 31
112
+ end
104
113
  ```
105
114
 
106
115
 
@@ -149,6 +149,10 @@ module ValueSemantics
149
149
  end
150
150
  end
151
151
  end
152
+
153
+ def deconstruct_keys(_)
154
+ to_h
155
+ end
152
156
  end
153
157
 
154
158
  #
@@ -1,3 +1,3 @@
1
1
  module ValueSemantics
2
- VERSION = "3.2.1"
2
+ VERSION = "3.3.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: value_semantics
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.1
4
+ version: 3.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Dalling
8
8
  autorequire:
9
- bindir: exe
9
+ bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-11 00:00:00.000000000 Z
11
+ date: 2020-07-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -103,23 +103,19 @@ executables: []
103
103
  extensions: []
104
104
  extra_rdoc_files: []
105
105
  files:
106
- - ".gitignore"
107
- - ".rspec"
108
- - ".travis.yml"
109
106
  - CHANGELOG.md
110
- - Gemfile
111
107
  - LICENSE.txt
112
108
  - README.md
113
- - bin/console
114
- - bin/setup
115
- - bin/test
116
109
  - lib/value_semantics.rb
117
110
  - lib/value_semantics/version.rb
118
- - value_semantics.gemspec
119
111
  homepage: https://github.com/tomdalling/value_semantics
120
112
  licenses:
121
113
  - MIT
122
- metadata: {}
114
+ metadata:
115
+ bug_tracker_uri: https://github.com/tomdalling/value_semantics/issues
116
+ changelog_uri: https://github.com/tomdalling/value_semantics/blob/master/CHANGELOG.md
117
+ documentation_uri: https://github.com/tomdalling/value_semantics/blob/v3.3.0/README.md
118
+ source_code_uri: https://github.com/tomdalling/value_semantics
123
119
  post_install_message:
124
120
  rdoc_options: []
125
121
  require_paths:
data/.gitignore DELETED
@@ -1,12 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /Gemfile.lock
4
- /_yardoc/
5
- /coverage/
6
- /doc/
7
- /pkg/
8
- /spec/reports/
9
- /tmp/
10
-
11
- # rspec failure tracking
12
- .rspec_status
data/.rspec DELETED
@@ -1,2 +0,0 @@
1
- --format documentation
2
- --color
@@ -1,25 +0,0 @@
1
- language: ruby
2
- script: bin/test
3
-
4
- # test old Ruby versions WITHOUT mutation testing
5
- rvm:
6
- - 2.3.8
7
- - 2.4.10
8
- - 2.5.8
9
- - 2.6.6
10
- env: MUTATION_TEST=false
11
-
12
- # test the latest Ruby version WITH mutation testing
13
- matrix:
14
- include:
15
- - rvm: 2.7.1
16
- env: MUTATION_TEST=true
17
-
18
- # deploy gem on tagged commits, on the latest Ruby version only
19
- deploy:
20
- provider: rubygems
21
- on:
22
- tags: true
23
- env: MUTATION_TEST=true
24
- api_key:
25
- secure: nL74QuUczEpA0qbhSBN2zjGdviWgKB3wR6vFvwervv1MZNWmwOQUYe99Oq9kPeyc8/x2MR/H6PQm5qbrk/WAfRede01WxlZ/EBUW+9CYGrxcBsGONx9IULO8A0I8/yN/YJHW2vjo3dfR66EwVsXTVWq8U63PRRcwJIyTqnIiUm2sxauMQoPRBbXG+pD9v/EJSn3ugpdtxp0lVYDn8LDKk5Ho4/wbpY4ML11XUJa9mz9CyR/GsAzdy5FTXaDMOwuWOVEx9cab7m4qPOBhmlJY4TrmooFpxTxRwChcvByjq1IboEd2M3RT5on7Q/xDTlHSOuT0OS8mnS2AocGT4a1gC+W/xOlghgEcN+xs2V5mfucR6+iUYlCy32uz1w3ey7T2X5xN4ubut09r1xLi7eu1NisAoAc+GOJ4TIxQNqkeRhY4X/fs8j7SMfOEMDr6pPxSLKZxgSvExt+IbdcZD/uQ7rTBQkadYCbc9MX5dHazBievmar3ZsFffbIf+n13FVDXsaPgRt7DlFM5dqGrEwVwt1jFRhdFuDCjkj4QWOLn7E1uY3XqgrqGvgUBlF8Znwc6qicW8zxV4SIWhqIzCOH6L9WIZGLHNq0remoCd9sq9Ter9av3jL+6UmZRRAr+JceeZfZmsYIXKomECzleM9FXMx7FXlpjJKOlf3JnrfeCTwI=
data/Gemfile DELETED
@@ -1,8 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- source 'https://oss:fLUos7k6c7Ak7zjhwbYphPJbwBk1Uuew@gem.mutant.dev' do
4
- gem 'mutant-license'
5
- end
6
-
7
- # Specify your gem's dependencies in the gemspec
8
- gemspec
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "value_semantics"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start(__FILE__)
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here
data/bin/test DELETED
@@ -1,15 +0,0 @@
1
- #!/bin/bash
2
- set -ue
3
-
4
- MUTANT_PATTERN=${1:-ValueSemantics*}
5
-
6
- # if $MUTATION_TEST is false, just run RSpec
7
- if [[ "${MUTATION_TEST:-true}" == "false" ]] ; then
8
- bundle exec rspec
9
- else
10
- bundle exec mutant \
11
- --include lib \
12
- --require value_semantics \
13
- --use rspec "$MUTANT_PATTERN" \
14
- --ignore-subject "ValueSemantics::Struct.new" # causes unfixable failure I don't want to deal with
15
- fi
@@ -1,34 +0,0 @@
1
- # coding: utf-8
2
- lib = File.expand_path("../lib", __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require "value_semantics/version"
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = "value_semantics"
8
- spec.version = ValueSemantics::VERSION
9
- spec.authors = ["Tom Dalling"]
10
- spec.email = [["tom", "@", "tomdalling.com"].join]
11
-
12
- spec.summary = %q{Makes value classes, with lightweight validation and coercion.}
13
- spec.description = %q{
14
- Generates modules that provide conventional value semantics for a given set of attributes.
15
- The behaviour is similar to an immutable `Struct` class,
16
- plus extensible, lightweight validation and coercion.
17
- }
18
- spec.homepage = "https://github.com/tomdalling/value_semantics"
19
- spec.license = "MIT"
20
-
21
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
22
- f.match(%r{^(test|spec|features)/})
23
- end
24
- spec.bindir = "exe"
25
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
26
- spec.require_paths = ["lib"]
27
-
28
- spec.add_development_dependency "bundler", ">= 1.15"
29
- spec.add_development_dependency "rspec", "~> 3.7"
30
- spec.add_development_dependency "mutant-rspec"
31
- spec.add_development_dependency "yard"
32
- spec.add_development_dependency "byebug"
33
- spec.add_development_dependency "gem-release"
34
- end