dry-core 0.4.6 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 719e6ba42598bd3ac7e39df64b0ddead36645f4890b7e90f3e310222a83737ca
4
- data.tar.gz: ca467306a42f04a7b7ffeb48bdcbc05e719b90e6d46b92e9d4a0d6fd0f110e54
3
+ metadata.gz: 455db6bceb946acab5dbe431c4ba7edf9a7344f09c2b2af9e38c0b8788e3d600
4
+ data.tar.gz: c460402f0b99fbe8ad488463cebd828a6a814d0a45f5200fbf1c90302fa66649
5
5
  SHA512:
6
- metadata.gz: 38dedf2bebde6ff93f28b8779e3d1e2ebd3c98c8941cf5b39d178955f1aebd6567a073aee4920994d243d02c8ac5bec5265cf731f5c205d476d5ed6a294187eb
7
- data.tar.gz: 83230529e9334a495e260e8a54c07a2015cffd12f94f824a8de501430bc03700aecd3da32d314558693a06b995c27f312b58d4c726e2f4ab5c634d1c4d1f7cfc
6
+ metadata.gz: c07482895edfb498acc414cc6672c2fa271cbd892f59393b4baa6b3b7ec4e115b29474be85fe42e40660fe06f926442608d693816594bdfcd910411185acad9c
7
+ data.tar.gz: c3d0966d660f09a26007e226b57e1cc2c124a420606b4de5d104730c6f5d9c54492a89788fb601722eab10f42dac4cda5d6689c79fe6c53a3df9c6510569fa7e
@@ -1,143 +1,256 @@
1
- # v0.4.6 2018-05-15
1
+ <!--- DO NOT EDIT THIS FILE - IT'S AUTOMATICALLY GENERATED VIA DEVTOOLS --->
2
2
 
3
- * Trigger constant autoloading in the class builder (radar)
3
+ ## unreleased
4
+
5
+
6
+ ### Added
7
+
8
+ - dry-equalizer has been imported into dry-core as `Dry::Core::Equalizer` but the interface remains the same, which is `include Dry.Equalizer(...)` - we'll be porting all other gems that depend on dry-equalizer to the latest dry-core with equalizer included *gradually*. Eventually dry-equalizer usage will be gone completely in rom-rb/dry-rb/hanami projects (@solnic)
9
+
10
+
11
+ [Compare v0.4.10...master](https://github.com/dry-rb/dry-core/compare/v0.4.10...master)
12
+
13
+ ## 0.4.10 2020-11-19
14
+
15
+
16
+ ### Added
17
+
18
+ - `ClassAttributes.defines` gets a new option for coercing values (tallica)
19
+ ```ruby
20
+ class Builder
21
+ extend Dry::Core::ClassAttributes
22
+
23
+ defines :nodes, coerce: -> value { Integer(value) }
24
+ end
25
+ ```
26
+ `:coerce` works with any callable as well as types from dry-types
27
+ ```ruby
28
+ defines :nodes, coerce: Dry::Types['coercible.integer']
29
+ ```
30
+ - `Constants::IDENTITY` which is the identity function (flash-gordon)
31
+
32
+
33
+ [Compare v0.4.9...v0.4.10](https://github.com/dry-rb/dry-core/compare/v0.4.9...v0.4.10)
34
+
35
+ ## 0.4.9 2019-08-09
36
+
37
+
38
+ ### Added
39
+
40
+ - `Undefined.coalesce` takes a variable number of arguments and returns the first non-`Undefined` value (flash-gordon)
41
+
42
+ ```ruby
43
+ Undefined.coalesce(Undefined, Undefined, :foo) # => :foo
44
+ ```
45
+
46
+ ### Fixed
47
+
48
+ - `Undefined.{dup,clone}` returns `Undefined` back, `Undefined` is a singleton (flash-gordon)
49
+
50
+
51
+ [Compare v0.4.8...v0.4.9](https://github.com/dry-rb/dry-core/compare/v0.4.8...v0.4.9)
52
+
53
+ ## 0.4.8 2019-06-23
54
+
55
+
56
+ ### Added
57
+
58
+ - `Undefined.map` for mapping non-undefined values (flash-gordon)
59
+
60
+ ```ruby
61
+ something = 1
62
+ Undefined.map(something) { |v| v + 1 } # => 2
63
+
64
+ something = Undefined
65
+ Undefined.map(something) { |v| v + 1 } # => Undefined
66
+ ```
67
+
68
+
69
+ [Compare v0.4.7...v0.4.8](https://github.com/dry-rb/dry-core/compare/v0.4.7...v0.4.8)
70
+
71
+ ## 0.4.7 2018-06-25
72
+
73
+
74
+ ### Fixed
75
+
76
+ - Fix default logger for deprecations, it now uses `$stderr` by default, as it should (flash-gordon)
77
+
78
+
79
+ [Compare v0.4.6...v0.4.7](https://github.com/dry-rb/dry-core/compare/v0.4.6...v0.4.7)
80
+
81
+ ## 0.4.6 2018-05-15
82
+
83
+
84
+ ### Changed
85
+
86
+ - Trigger constant autoloading in the class builder (radar)
4
87
 
5
88
  [Compare v0.4.5...v0.4.6](https://github.com/dry-rb/dry-core/compare/v0.4.5...v0.4.6)
6
89
 
7
- # v0.4.5 2018-03-14
90
+ ## 0.4.5 2018-03-14
91
+
8
92
 
9
93
  ### Added
10
94
 
11
- * `Dry::Core::Memoizable`, which provides a `memoize` macro for memoizing results of instance methods (timriley)
95
+ - `Dry::Core::Memoizable`, which provides a `memoize` macro for memoizing results of instance methods (timriley)
96
+
12
97
 
13
98
  [Compare v0.4.4...v0.4.5](https://github.com/dry-rb/dry-core/compare/v0.4.4...v0.4.5)
14
99
 
15
- # v0.4.4 2018-02-10
100
+ ## 0.4.4 2018-02-10
101
+
16
102
 
17
103
  ### Added
18
104
 
19
- * `deprecate_constant` overrides `Module#deprecate_constant` and issues a labeled message on accessing a deprecated constant (flash-gordon)
20
- * `Undefined.default` which accepts two arguments and returns the first if it's not `Undefined`; otherwise, returns the second one or yields a block (flash-gordon)
105
+ - `deprecate_constant` overrides `Module#deprecate_constant` and issues a labeled message on accessing a deprecated constant (flash-gordon)
106
+ - `Undefined.default` which accepts two arguments and returns the first if it's not `Undefined`; otherwise, returns the second one or yields a block (flash-gordon)
107
+
21
108
 
22
109
  [Compare v0.4.3...v0.4.4](https://github.com/dry-rb/dry-core/compare/v0.4.3...v0.4.4)
23
110
 
24
- # v0.4.3 2018-02-03
111
+ ## 0.4.3 2018-02-03
112
+
25
113
 
26
114
  ### Added
27
115
 
28
- * `Dry::Core::DescendantsTracker` which is a maintained version of the [`descendants_tracker`](https://github.com/dkubb/descendants_tracker) gem (flash-gordon)
116
+ - `Dry::Core::DescendantsTracker` which is a maintained version of the [`descendants_tracker`](https://github.com/dkubb/descendants_tracker) gem (flash-gordon)
29
117
 
30
- [Compare v0.4.2...v0.4.3](https://github.com/dry-rb/dry-core/compare/v0.4.2...0.4.3)
31
118
 
32
- # v0.4.2 2017-12-16
119
+ [Compare v0.4.2...v0.4.3](https://github.com/dry-rb/dry-core/compare/v0.4.2...v0.4.3)
120
+
121
+ ## 0.4.2 2017-12-16
122
+
33
123
 
34
124
  ### Fixed
35
125
 
36
- * Class attributes now support private setters/getters (flash-gordon)
126
+ - Class attributes now support private setters/getters (flash-gordon)
127
+
37
128
 
38
129
  [Compare v0.4.1...v0.4.2](https://github.com/dry-rb/dry-core/compare/v0.4.1...v0.4.2)
39
130
 
40
- # v0.4.1 2017-11-04
131
+ ## 0.4.1 2017-11-04
132
+
41
133
 
42
134
  ### Changed
43
135
 
44
- * Improved error message on invalid attribute value (GustavoCaso)
136
+ - Improved error message on invalid attribute value (GustavoCaso)
45
137
 
46
138
  [Compare v0.4.0...v0.4.1](https://github.com/dry-rb/dry-core/compare/v0.4.0...v0.4.1)
47
139
 
48
- # v0.4.0 2017-11-02
140
+ ## 0.4.0 2017-11-02
141
+
49
142
 
50
143
  ### Added
51
144
 
52
- * Added the `:type` option to class attributes, you can now restrict attribute values with a type. You can either use plain ruby types (`Integer`, `String`, etc) or `dry-types` (GustavoCaso)
145
+ - Added the `:type` option to class attributes, you can now restrict attribute values with a type. You can either use plain ruby types (`Integer`, `String`, etc) or `dry-types` (GustavoCaso)
53
146
 
54
147
  ```ruby
55
- class Foo
56
- extend Dry::Core::ClassAttributes
148
+ class Foo
149
+ extend Dry::Core::ClassAttributes
57
150
 
58
- defines :ruby_attr, type: Integer
59
- defines :dry_attr, type: Dry::Types['strict.int']
60
- end
151
+ defines :ruby_attr, type: Integer
152
+ defines :dry_attr, type: Dry::Types['strict.int']
153
+ end
61
154
  ```
62
155
 
156
+
63
157
  [Compare v0.3.4...v0.4.0](https://github.com/dry-rb/dry-core/compare/v0.3.4...v0.4.0)
64
158
 
65
- # v0.3.4 2017-09-29
159
+ ## 0.3.4 2017-09-29
160
+
66
161
 
67
162
  ### Fixed
68
163
 
69
- * `Deprecations` output is set to `$stderr` by default now (solnic)
164
+ - `Deprecations` output is set to `$stderr` by default now (solnic)
165
+
70
166
 
71
167
  [Compare v0.3.3...v0.3.4](https://github.com/dry-rb/dry-core/compare/v0.3.3...v0.3.4)
72
168
 
73
- # v0.3.3 2017-08-31
169
+ ## 0.3.3 2017-08-31
170
+
74
171
 
75
172
  ### Fixed
76
173
 
77
- * The Deprecations module now shows the right caller line (flash-gordon)
174
+ - The Deprecations module now shows the right caller line (flash-gordon)
175
+
78
176
 
79
177
  [Compare v0.3.2...v0.3.3](https://github.com/dry-rb/dry-core/compare/v0.3.2...v0.3.3)
80
178
 
81
- # v0.3.2 2017-08-31
179
+ ## 0.3.2 2017-08-31
180
+
82
181
 
83
182
  ### Added
84
183
 
85
- * Accept an existing logger object in `Dry::Core::Deprecations.set_logger!` (flash-gordon)
184
+ - Accept an existing logger object in `Dry::Core::Deprecations.set_logger!` (flash-gordon)
185
+
86
186
 
87
187
  [Compare v0.3.1...v0.3.2](https://github.com/dry-rb/dry-core/compare/v0.3.1...v0.3.2)
88
188
 
89
- # v0.3.1 2017-05-27
189
+ ## 0.3.1 2017-05-27
190
+
90
191
 
91
192
  ### Added
92
193
 
93
- * Support for building classes within an existing namespace (flash-gordon)
194
+ - Support for building classes within an existing namespace (flash-gordon)
195
+
94
196
 
95
197
  [Compare v0.3.0...v0.3.1](https://github.com/dry-rb/dry-core/compare/v0.3.0...v0.3.1)
96
198
 
97
- # v0.3.0 2017-05-05
199
+ ## 0.3.0 2017-05-05
200
+
98
201
 
99
202
  ### Changed
100
203
 
101
- * Class attributes are initialized _before_ running the `inherited` hook. It's slightly more convenient behavior and it's very unlikely anyone will be affected by this, but technically this is a breaking change (flash-gordon)
204
+ - Class attributes are initialized _before_ running the `inherited` hook. It's slightly more convenient behavior and it's very unlikely anyone will be affected by this, but technically this is a breaking change (flash-gordon)
102
205
 
103
206
  [Compare v0.2.4...v0.3.0](https://github.com/dry-rb/dry-core/compare/v0.2.4...v0.3.0)
104
207
 
105
- # v0.2.4 2017-01-26
208
+ ## 0.2.4 2017-01-26
209
+
106
210
 
107
211
  ### Fixed
108
212
 
109
- * Do not require deprecated method to be defined (flash-gordon)
213
+ - Do not require deprecated method to be defined (flash-gordon)
214
+
110
215
 
111
216
  [Compare v0.2.3...v0.2.4](https://github.com/dry-rb/dry-core/compare/v0.2.3...v0.2.4)
112
217
 
113
- # v0.2.3 2016-12-30
218
+ ## 0.2.3 2016-12-30
219
+
114
220
 
115
221
  ### Fixed
116
222
 
117
- * Fix warnings on using uninitialized class attributes (flash-gordon)
223
+ - Fix warnings on using uninitialized class attributes (flash-gordon)
224
+
118
225
 
119
226
  [Compare v0.2.2...v0.2.3](https://github.com/dry-rb/dry-core/compare/v0.2.2...v0.2.3)
120
227
 
121
- # v0.2.2 2016-12-30
228
+ ## 0.2.2 2016-12-30
229
+
122
230
 
123
231
  ### Added
124
232
 
125
- * `ClassAttributes` which provides `defines` method for defining get-or-set methods (flash-gordon)
233
+ - `ClassAttributes` which provides `defines` method for defining get-or-set methods (flash-gordon)
234
+
126
235
 
127
236
  [Compare v0.2.1...v0.2.2](https://github.com/dry-rb/dry-core/compare/v0.2.1...v0.2.2)
128
237
 
129
- # v0.2.1 2016-11-18
238
+ ## 0.2.1 2016-11-18
239
+
130
240
 
131
241
  ### Added
132
242
 
133
- * `Constants` are now available in nested scopes (flash-gordon)
243
+ - `Constants` are now available in nested scopes (flash-gordon)
244
+
134
245
 
135
246
  [Compare v0.2.0...v0.2.1](https://github.com/dry-rb/dry-core/compare/v0.2.0...v0.2.1)
136
247
 
137
- # v0.2.0 2016-11-01
248
+ ## 0.2.0 2016-11-01
249
+
250
+
138
251
 
139
252
  [Compare v0.1.0...v0.2.0](https://github.com/dry-rb/dry-core/compare/v0.1.0...v0.2.0)
140
253
 
141
- # v0.1.0 2016-09-17
254
+ ## 0.1.0 2016-09-17
142
255
 
143
256
  Initial release
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015-2020 dry-rb team
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -1,47 +1,29 @@
1
- [gitter]: https://gitter.im/dry-rb/chat
2
1
  [gem]: https://rubygems.org/gems/dry-core
3
- [travis]: https://travis-ci.org/dry-rb/dry-core
4
- [code_climate]: https://codeclimate.com/github/dry-rb/dry-core
5
- [inch]: http://inch-ci.org/github/dry-rb/dry-core
2
+ [actions]: https://github.com/dry-rb/dry-core/actions
3
+ [codacy]: https://www.codacy.com/gh/dry-rb/dry-core
4
+ [chat]: https://dry-rb.zulipchat.com
5
+ [inchpages]: http://inch-ci.org/github/dry-rb/dry-core
6
6
 
7
- # dry-core
7
+ # dry-core [![Join the chat at https://dry-rb.zulipchat.com](https://img.shields.io/badge/dry--rb-join%20chat-%23346b7a.svg)][chat]
8
8
 
9
- [![Gem Version](https://img.shields.io/gem/v/dry-core.svg)][gem]
10
- [![Build Status](https://img.shields.io/travis/dry-rb/dry-core.svg)][travis]
11
- [![Code Climate](https://api.codeclimate.com/v1/badges/eebb0e969814744231e4/maintainability)][code_climate]
12
- [![Test Coverage](https://api.codeclimate.com/v1/badges/eebb0e969814744231e4/test_coverage)][code_climate]
13
- [![API Documentation Coverage](http://inch-ci.org/github/dry-rb/dry-core.svg)][inch]
14
- ![No monkey-patches](https://img.shields.io/badge/monkey--patches-0-brightgreen.svg)
9
+ [![Gem Version](https://badge.fury.io/rb/dry-core.svg)][gem]
10
+ [![CI Status](https://github.com/dry-rb/dry-core/workflows/ci/badge.svg)][actions]
11
+ [![Codacy Badge](https://api.codacy.com/project/badge/Grade/40946292b9094624beec604a149a6023)][codacy]
12
+ [![Codacy Badge](https://api.codacy.com/project/badge/Coverage/40946292b9094624beec604a149a6023)][codacy]
13
+ [![Inline docs](http://inch-ci.org/github/dry-rb/dry-core.svg?branch=master)][inchpages]
15
14
 
16
- A collection of small modules used in the dry-rb ecosystem.
15
+ ## Links
17
16
 
18
- ## Installation
17
+ * [User documentation](http://dry-rb.org/gems/dry-core)
18
+ * [API documentation](http://rubydoc.info/gems/dry-core)
19
19
 
20
- Add this line to your application's Gemfile:
20
+ ## Supported Ruby versions
21
21
 
22
- ```ruby
23
- gem 'dry-core'
24
- ```
25
-
26
- And then execute:
27
-
28
- $ bundle
29
-
30
- Or install it yourself as:
31
-
32
- $ gem install dry-core
33
-
34
- ## Development
35
-
36
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
37
-
38
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
39
-
40
- ## Contributing
41
-
42
- Bug reports and pull requests are welcome on GitHub at https://github.com/dry-rb/dry-core.
22
+ This library officially supports the following Ruby versions:
43
23
 
24
+ * MRI >= `2.5`
25
+ * jruby >= `9.2`
44
26
 
45
27
  ## License
46
28
 
47
- The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
29
+ See `LICENSE` file.
@@ -1,34 +1,36 @@
1
- lib = File.expand_path('../lib', __FILE__)
1
+ # frozen_string_literal: true
2
+ # this file is managed by dry-rb/devtools project
3
+
4
+ lib = File.expand_path('lib', __dir__)
2
5
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
6
  require 'dry/core/version'
4
7
 
5
8
  Gem::Specification.new do |spec|
6
9
  spec.name = 'dry-core'
7
- spec.version = Dry::Core::VERSION
8
- spec.authors = ['Nikita Shilnikov']
9
- spec.email = ['fg@flashgordon.ru']
10
+ spec.authors = ["Nikita Shilnikov"]
11
+ spec.email = ["fg@flashgordon.ru"]
12
+ spec.license = 'MIT'
13
+ spec.version = Dry::Core::VERSION.dup
10
14
 
11
- spec.summary = 'A toolset of small support modules used throughout the dry-rb ecosystem.'
15
+ spec.summary = "A toolset of small support modules used throughout the dry-rb ecosystem"
12
16
  spec.description = spec.summary
13
- spec.homepage = 'https://github.com/dry-rb/dry-core'
14
- spec.license = 'MIT'
17
+ spec.homepage = 'https://dry-rb.org/gems/dry-core'
18
+ spec.files = Dir["CHANGELOG.md", "LICENSE", "README.md", "dry-core.gemspec", "lib/**/*"]
19
+ spec.bindir = 'bin'
20
+ spec.executables = []
21
+ spec.require_paths = ['lib']
15
22
 
16
- # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
17
- # to allow pushing to a single host or delete this section to allow pushing to any host.
18
- if spec.respond_to?(:metadata)
19
- spec.metadata['allowed_push_host'] = 'https://rubygems.org'
20
- else
21
- raise 'RubyGems 2.0 or newer is required to protect against public gem pushes.'
22
- end
23
+ spec.metadata['allowed_push_host'] = 'https://rubygems.org'
24
+ spec.metadata['changelog_uri'] = 'https://github.com/dry-rb/dry-core/blob/master/CHANGELOG.md'
25
+ spec.metadata['source_code_uri'] = 'https://github.com/dry-rb/dry-core'
26
+ spec.metadata['bug_tracker_uri'] = 'https://github.com/dry-rb/dry-core/issues'
23
27
 
24
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features|bin)/}) }
25
- spec.bindir = 'exe'
26
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
27
- spec.require_paths = ['lib']
28
- spec.required_ruby_version = '>= 2.1.0'
29
- spec.add_runtime_dependency 'concurrent-ruby', '~> 1.0'
28
+ spec.required_ruby_version = ">= 2.5.0"
29
+
30
+ # to update dependencies edit project.yml
31
+ spec.add_runtime_dependency "concurrent-ruby", "~> 1.0"
30
32
 
31
- spec.add_development_dependency 'bundler', '~> 1.12'
32
- spec.add_development_dependency 'rake', '~> 10.0'
33
- spec.add_development_dependency 'rspec', '~> 3.0'
33
+ spec.add_development_dependency "bundler"
34
+ spec.add_development_dependency "rake"
35
+ spec.add_development_dependency "rspec"
34
36
  end