value_semantics 3.0.1 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -0
- data/Gemfile +3 -1
- data/README.md +5 -0
- data/lib/value_semantics.rb +10 -0
- data/lib/value_semantics/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4ff5d3aeb6f4aed20276acec36dd859f5fc1e7e8836d3d5414208d70ef9216f
|
4
|
+
data.tar.gz: bb73f5257fcd66d69029cbaf080e52a53d8dd5e3101e540bb0eb48be5891ede7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d8db67bb3b5c5c083a0d7f8a42ce1ff0419409b44c8c45feb15865d4853253401a252fd9f550e320db5e4eda62993d3527088a094682dfcf1a7125e0d518552
|
7
|
+
data.tar.gz: ea6e43b825c9e5d17f63a050122435fce3e98c8fc3f488a088f8df1f70e91abe6b24c08e676caec9dbb82a4ae14fc0f326135ac647254052b83de6772f820d56
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
Notable changes to this project will be documented in this file.
|
4
|
+
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
7
|
+
|
8
|
+
## [3.1.0] - 2019-06-30
|
9
|
+
### Added
|
10
|
+
- Built-in PP support for value classes
|
11
|
+
|
12
|
+
## [3.0.0] - 2019-01-27
|
13
|
+
|
14
|
+
First public release
|
data/Gemfile
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
source "https://rubygems.org"
|
2
2
|
|
3
|
-
|
3
|
+
source 'https://oss:fLUos7k6c7Ak7zjhwbYphPJbwBk1Uuew@gem.mutant.dev' do
|
4
|
+
gem 'mutant-license'
|
5
|
+
end
|
4
6
|
|
5
7
|
# Specify your gem's dependencies in the gemspec
|
6
8
|
gemspec
|
data/README.md
CHANGED
@@ -15,6 +15,11 @@ These are intended for internal use, as opposed to validating user input like Ac
|
|
15
15
|
Invalid or missing attributes cause an exception for developers,
|
16
16
|
not an error message intended for application users.
|
17
17
|
|
18
|
+
See the [announcement blog post][] for some of the rationale behind the gem, and some [discussion on Reddit].
|
19
|
+
|
20
|
+
[announcement blog post]: https://www.rubypigeon.com/posts/value-semantics-gem-for-making-value-classes/
|
21
|
+
[discussion on Reddit]: https://www.reddit.com/r/ruby/comments/akz4fs/valuesemanticsa_gem_for_making_value_classes/
|
22
|
+
|
18
23
|
|
19
24
|
Defining and Creating Value Objects
|
20
25
|
-----------------------------------
|
data/lib/value_semantics.rb
CHANGED
@@ -139,6 +139,16 @@ module ValueSemantics
|
|
139
139
|
|
140
140
|
"#<#{self.class} #{attrs}>"
|
141
141
|
end
|
142
|
+
|
143
|
+
def pretty_print(pp)
|
144
|
+
pp.object_group(self) do
|
145
|
+
to_h.each do |attr, value|
|
146
|
+
pp.breakable
|
147
|
+
pp.text("#{attr}=")
|
148
|
+
pp.pp(value)
|
149
|
+
end
|
150
|
+
end
|
151
|
+
end
|
142
152
|
end
|
143
153
|
|
144
154
|
#
|
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.0
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Dalling
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-06-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -106,6 +106,7 @@ files:
|
|
106
106
|
- ".gitignore"
|
107
107
|
- ".rspec"
|
108
108
|
- ".travis.yml"
|
109
|
+
- CHANGELOG.md
|
109
110
|
- Gemfile
|
110
111
|
- LICENSE.txt
|
111
112
|
- README.md
|
@@ -134,8 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
134
135
|
- !ruby/object:Gem::Version
|
135
136
|
version: '0'
|
136
137
|
requirements: []
|
137
|
-
|
138
|
-
rubygems_version: 2.7.7
|
138
|
+
rubygems_version: 3.0.4
|
139
139
|
signing_key:
|
140
140
|
specification_version: 4
|
141
141
|
summary: Makes value classes, with lightweight validation and coercion.
|