dry-core 0.4.9 → 0.7.1

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: dfe5b98793bc0e200a3a226a60d8c0f5234de170f033c9c3f06fc779979a1f63
4
- data.tar.gz: de24e4b5d0bead8d577c3594bea81986ea7e7cf8124f17ce471f734d143d7319
3
+ metadata.gz: cb330574bba6050e9a3d0fd466fdbd276ce76749b2661b8091ebf6178a2ef6c9
4
+ data.tar.gz: c1319b83600515df992a91556000989aa092d4229f69669b8f544368d93d21a8
5
5
  SHA512:
6
- metadata.gz: 46141cc708525532152db4c692b8d5ac413ded55ee6484d672c6974a41a6487776ef2aeba3bb3abde5e22fcf4c4d8ac42900a391dcd7a38a5ff95fd4c5d9b717
7
- data.tar.gz: 4871d4b68086c1521424d2510b47ab0448fbe344beed3bc7fd1ee1f9115306d3893b751f882a942f9321183724c8aecea1b7e69b81cb2fe7794dbec07d5222a6
6
+ metadata.gz: 2b1967bb0c991637ea01da5d267df78daa12e4801288932372eca2ecf8aff0c5933ef2cb9cdc06d978d6223da963a31dc5e362f1ad1052490e10ebbc2b39fae6
7
+ data.tar.gz: 22662f066d46742cfd12d79eddcfb1e76811ab00b0080be8bac8fef53a1229fa91f5501b9f0b34f09182f5843c7bf995332fc16d1fe192daeadff186cd543cb7
data/CHANGELOG.md CHANGED
@@ -1,8 +1,87 @@
1
- # v0.4.9
1
+ <!--- DO NOT EDIT THIS FILE - IT'S AUTOMATICALLY GENERATED VIA DEVTOOLS --->
2
+
3
+ ## 0.7.1 2021-07-10
4
+
5
+
6
+ ### Fixed
7
+
8
+ - [memoizable] memoizable correctly handles cases where a method
9
+ has unnamed params (e.g. happens when the new `...` syntax is used) (@flash-gordon)
10
+
11
+
12
+
13
+ [Compare v0.7.0...v0.7.1](https://github.com/dry-rb/dry-core/compare/v0.7.0...v0.7.1)
14
+
15
+ ## 0.7.0 2021-07-08
16
+
17
+
18
+ ### Fixed
19
+
20
+ - [memoizable] warnings when using keyword arguments (@flash-gordon)
21
+ - [deprecations] warnings show more relevant information about caller by default (@timriley)
22
+
23
+ ### Changed
24
+
25
+ - Minimal Ruby version is 2.6
26
+ - [memoizable] memoization of block-accepting methods is deprecated (@flash-gordon)
27
+
28
+ [Compare v0.6.0...v0.7.0](https://github.com/dry-rb/dry-core/compare/v0.6.0...v0.7.0)
29
+
30
+ ## 0.6.0 2021-06-03
31
+
32
+
33
+ ### Added
34
+
35
+ - [memoizable] support for `BasicObject` (@oleander)
36
+ - [memoizable] support for methods that accept blocks (@oleander)
37
+ - [deprecations] allow printing frame info on warn when setting up Deprecation module (via #52) (@waiting-for-dev)
38
+
39
+ ### Fixed
40
+
41
+ - [memoizable] works with MRI 2.7+ keyword arguments now (@oleander)
42
+
43
+
44
+ [Compare v0.5.0...v0.6.0](https://github.com/dry-rb/dry-core/compare/v0.5.0...v0.6.0)
45
+
46
+ ## 0.5.0 2012-12-12
47
+
48
+
49
+ ### Added
50
+
51
+ - 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)
52
+
53
+
54
+ [Compare v0.4.10...v0.5.0](https://github.com/dry-rb/dry-core/compare/v0.4.10...v0.5.0)
55
+
56
+ ## 0.4.10 2020-11-19
57
+
58
+
59
+ ### Added
60
+
61
+ - `ClassAttributes.defines` gets a new option for coercing values (tallica)
62
+ ```ruby
63
+ class Builder
64
+ extend Dry::Core::ClassAttributes
65
+
66
+ defines :nodes, coerce: -> value { Integer(value) }
67
+ end
68
+ ```
69
+ `:coerce` works with any callable as well as types from dry-types
70
+ ```ruby
71
+ defines :nodes, coerce: Dry::Types['coercible.integer']
72
+ ```
73
+ - `Constants::IDENTITY` which is the identity function (flash-gordon)
74
+
75
+
76
+ [Compare v0.4.9...v0.4.10](https://github.com/dry-rb/dry-core/compare/v0.4.9...v0.4.10)
77
+
78
+ ## 0.4.9 2019-08-09
79
+
2
80
 
3
81
  ### Added
4
82
 
5
83
  - `Undefined.coalesce` takes a variable number of arguments and returns the first non-`Undefined` value (flash-gordon)
84
+
6
85
  ```ruby
7
86
  Undefined.coalesce(Undefined, Undefined, :foo) # => :foo
8
87
  ```
@@ -11,32 +90,39 @@
11
90
 
12
91
  - `Undefined.{dup,clone}` returns `Undefined` back, `Undefined` is a singleton (flash-gordon)
13
92
 
93
+
14
94
  [Compare v0.4.8...v0.4.9](https://github.com/dry-rb/dry-core/compare/v0.4.8...v0.4.9)
15
95
 
16
- # v0.4.8 2019-06-23
96
+ ## 0.4.8 2019-06-23
97
+
17
98
 
18
99
  ### Added
19
100
 
20
- - `Undefined.map` for mapping non-undefined values (flash-gordon):
101
+ - `Undefined.map` for mapping non-undefined values (flash-gordon)
102
+
103
+ ```ruby
104
+ something = 1
105
+ Undefined.map(something) { |v| v + 1 } # => 2
106
+
107
+ something = Undefined
108
+ Undefined.map(something) { |v| v + 1 } # => Undefined
109
+ ```
21
110
 
22
- ```ruby
23
- something = 1
24
- Undefined.map(something) { |v| v + 1 } # => 2
25
- something = Undefined
26
- Undefined.map(something) { |v| v + 1 } # => Undefined
27
- ```
28
111
 
29
112
  [Compare v0.4.7...v0.4.8](https://github.com/dry-rb/dry-core/compare/v0.4.7...v0.4.8)
30
113
 
31
- # v0.4.7 2018-06-25
114
+ ## 0.4.7 2018-06-25
115
+
32
116
 
33
117
  ### Fixed
34
118
 
35
119
  - Fix default logger for deprecations, it now uses `$stderr` by default, as it should (flash-gordon)
36
120
 
121
+
37
122
  [Compare v0.4.6...v0.4.7](https://github.com/dry-rb/dry-core/compare/v0.4.6...v0.4.7)
38
123
 
39
- # v0.4.6 2018-05-15
124
+ ## 0.4.6 2018-05-15
125
+
40
126
 
41
127
  ### Changed
42
128
 
@@ -44,40 +130,49 @@ Undefined.map(something) { |v| v + 1 } # => Undefined
44
130
 
45
131
  [Compare v0.4.5...v0.4.6](https://github.com/dry-rb/dry-core/compare/v0.4.5...v0.4.6)
46
132
 
47
- # v0.4.5 2018-03-14
133
+ ## 0.4.5 2018-03-14
134
+
48
135
 
49
136
  ### Added
50
137
 
51
138
  - `Dry::Core::Memoizable`, which provides a `memoize` macro for memoizing results of instance methods (timriley)
52
139
 
140
+
53
141
  [Compare v0.4.4...v0.4.5](https://github.com/dry-rb/dry-core/compare/v0.4.4...v0.4.5)
54
142
 
55
- # v0.4.4 2018-02-10
143
+ ## 0.4.4 2018-02-10
144
+
56
145
 
57
146
  ### Added
58
147
 
59
148
  - `deprecate_constant` overrides `Module#deprecate_constant` and issues a labeled message on accessing a deprecated constant (flash-gordon)
60
149
  - `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)
61
150
 
151
+
62
152
  [Compare v0.4.3...v0.4.4](https://github.com/dry-rb/dry-core/compare/v0.4.3...v0.4.4)
63
153
 
64
- # v0.4.3 2018-02-03
154
+ ## 0.4.3 2018-02-03
155
+
65
156
 
66
157
  ### Added
67
158
 
68
159
  - `Dry::Core::DescendantsTracker` which is a maintained version of the [`descendants_tracker`](https://github.com/dkubb/descendants_tracker) gem (flash-gordon)
69
160
 
70
- [Compare v0.4.2...v0.4.3](https://github.com/dry-rb/dry-core/compare/v0.4.2...0.4.3)
71
161
 
72
- # v0.4.2 2017-12-16
162
+ [Compare v0.4.2...v0.4.3](https://github.com/dry-rb/dry-core/compare/v0.4.2...v0.4.3)
163
+
164
+ ## 0.4.2 2017-12-16
165
+
73
166
 
74
167
  ### Fixed
75
168
 
76
169
  - Class attributes now support private setters/getters (flash-gordon)
77
170
 
171
+
78
172
  [Compare v0.4.1...v0.4.2](https://github.com/dry-rb/dry-core/compare/v0.4.1...v0.4.2)
79
173
 
80
- # v0.4.1 2017-11-04
174
+ ## 0.4.1 2017-11-04
175
+
81
176
 
82
177
  ### Changed
83
178
 
@@ -85,56 +180,67 @@ Undefined.map(something) { |v| v + 1 } # => Undefined
85
180
 
86
181
  [Compare v0.4.0...v0.4.1](https://github.com/dry-rb/dry-core/compare/v0.4.0...v0.4.1)
87
182
 
88
- # v0.4.0 2017-11-02
183
+ ## 0.4.0 2017-11-02
184
+
89
185
 
90
186
  ### Added
91
187
 
92
188
  - 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)
93
189
 
94
190
  ```ruby
95
- class Foo
96
- extend Dry::Core::ClassAttributes
191
+ class Foo
192
+ extend Dry::Core::ClassAttributes
97
193
 
98
- defines :ruby_attr, type: Integer
99
- defines :dry_attr, type: Dry::Types['strict.int']
100
- end
194
+ defines :ruby_attr, type: Integer
195
+ defines :dry_attr, type: Dry::Types['strict.int']
196
+ end
101
197
  ```
102
198
 
199
+
103
200
  [Compare v0.3.4...v0.4.0](https://github.com/dry-rb/dry-core/compare/v0.3.4...v0.4.0)
104
201
 
105
- # v0.3.4 2017-09-29
202
+ ## 0.3.4 2017-09-29
203
+
106
204
 
107
205
  ### Fixed
108
206
 
109
207
  - `Deprecations` output is set to `$stderr` by default now (solnic)
110
208
 
209
+
111
210
  [Compare v0.3.3...v0.3.4](https://github.com/dry-rb/dry-core/compare/v0.3.3...v0.3.4)
112
211
 
113
- # v0.3.3 2017-08-31
212
+ ## 0.3.3 2017-08-31
213
+
114
214
 
115
215
  ### Fixed
116
216
 
117
217
  - The Deprecations module now shows the right caller line (flash-gordon)
118
218
 
219
+
119
220
  [Compare v0.3.2...v0.3.3](https://github.com/dry-rb/dry-core/compare/v0.3.2...v0.3.3)
120
221
 
121
- # v0.3.2 2017-08-31
222
+ ## 0.3.2 2017-08-31
223
+
122
224
 
123
225
  ### Added
124
226
 
125
227
  - Accept an existing logger object in `Dry::Core::Deprecations.set_logger!` (flash-gordon)
126
228
 
229
+
127
230
  [Compare v0.3.1...v0.3.2](https://github.com/dry-rb/dry-core/compare/v0.3.1...v0.3.2)
128
231
 
129
- # v0.3.1 2017-05-27
232
+ ## 0.3.1 2017-05-27
233
+
130
234
 
131
235
  ### Added
132
236
 
133
237
  - Support for building classes within an existing namespace (flash-gordon)
134
238
 
239
+
135
240
  [Compare v0.3.0...v0.3.1](https://github.com/dry-rb/dry-core/compare/v0.3.0...v0.3.1)
136
241
 
137
- # v0.3.0 2017-05-05
242
+ ## 0.3.0 2017-05-05
243
+
138
244
 
139
245
  ### Changed
140
246
 
@@ -142,42 +248,52 @@ Undefined.map(something) { |v| v + 1 } # => Undefined
142
248
 
143
249
  [Compare v0.2.4...v0.3.0](https://github.com/dry-rb/dry-core/compare/v0.2.4...v0.3.0)
144
250
 
145
- # v0.2.4 2017-01-26
251
+ ## 0.2.4 2017-01-26
252
+
146
253
 
147
254
  ### Fixed
148
255
 
149
256
  - Do not require deprecated method to be defined (flash-gordon)
150
257
 
258
+
151
259
  [Compare v0.2.3...v0.2.4](https://github.com/dry-rb/dry-core/compare/v0.2.3...v0.2.4)
152
260
 
153
- # v0.2.3 2016-12-30
261
+ ## 0.2.3 2016-12-30
262
+
154
263
 
155
264
  ### Fixed
156
265
 
157
266
  - Fix warnings on using uninitialized class attributes (flash-gordon)
158
267
 
268
+
159
269
  [Compare v0.2.2...v0.2.3](https://github.com/dry-rb/dry-core/compare/v0.2.2...v0.2.3)
160
270
 
161
- # v0.2.2 2016-12-30
271
+ ## 0.2.2 2016-12-30
272
+
162
273
 
163
274
  ### Added
164
275
 
165
276
  - `ClassAttributes` which provides `defines` method for defining get-or-set methods (flash-gordon)
166
277
 
278
+
167
279
  [Compare v0.2.1...v0.2.2](https://github.com/dry-rb/dry-core/compare/v0.2.1...v0.2.2)
168
280
 
169
- # v0.2.1 2016-11-18
281
+ ## 0.2.1 2016-11-18
282
+
170
283
 
171
284
  ### Added
172
285
 
173
286
  - `Constants` are now available in nested scopes (flash-gordon)
174
287
 
288
+
175
289
  [Compare v0.2.0...v0.2.1](https://github.com/dry-rb/dry-core/compare/v0.2.0...v0.2.1)
176
290
 
177
- # v0.2.0 2016-11-01
291
+ ## 0.2.0 2016-11-01
292
+
293
+
178
294
 
179
295
  [Compare v0.1.0...v0.2.0](https://github.com/dry-rb/dry-core/compare/v0.1.0...v0.2.0)
180
296
 
181
- # v0.1.0 2016-09-17
297
+ ## 0.1.0 2016-09-17
182
298
 
183
299
  Initial release
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015-2021 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,62 +1,30 @@
1
- [gitter]: https://gitter.im/dry-rb/chat
1
+ <!--- this file is synced from dry-rb/template-gem project -->
2
2
  [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
3
+ [actions]: https://github.com/dry-rb/dry-core/actions
4
+ [codacy]: https://www.codacy.com/gh/dry-rb/dry-core
6
5
  [chat]: https://dry-rb.zulipchat.com
6
+ [inchpages]: http://inch-ci.org/github/dry-rb/dry-core
7
7
 
8
8
  # dry-core [![Join the chat at https://dry-rb.zulipchat.com](https://img.shields.io/badge/dry--rb-join%20chat-%23346b7a.svg)][chat]
9
9
 
10
- [![Gem Version](https://img.shields.io/gem/v/dry-core.svg)][gem]
11
- [![Build Status](https://img.shields.io/travis/dry-rb/dry-core.svg)][travis]
12
- [![Code Climate](https://api.codeclimate.com/v1/badges/eebb0e969814744231e4/maintainability)][code_climate]
13
- [![Test Coverage](https://api.codeclimate.com/v1/badges/eebb0e969814744231e4/test_coverage)][code_climate]
14
- [![API Documentation Coverage](http://inch-ci.org/github/dry-rb/dry-core.svg)][inch]
15
- ![No monkey-patches](https://img.shields.io/badge/monkey--patches-0-brightgreen.svg)
16
-
17
- A collection of small modules used in the dry-rb ecosystem.
10
+ [![Gem Version](https://badge.fury.io/rb/dry-core.svg)][gem]
11
+ [![CI Status](https://github.com/dry-rb/dry-core/workflows/ci/badge.svg)][actions]
12
+ [![Codacy Badge](https://api.codacy.com/project/badge/Grade/40946292b9094624beec604a149a6023)][codacy]
13
+ [![Codacy Badge](https://api.codacy.com/project/badge/Coverage/40946292b9094624beec604a149a6023)][codacy]
14
+ [![Inline docs](http://inch-ci.org/github/dry-rb/dry-core.svg?branch=master)][inchpages]
18
15
 
19
16
  ## Links
20
17
 
21
- * [User docs](https://dry-rb.org/gems/dry-core)
22
- * [API docs](http://rubydoc.info/gems/dry-core)
18
+ * [User documentation](https://dry-rb.org/gems/dry-core)
19
+ * [API documentation](http://rubydoc.info/gems/dry-core)
23
20
 
24
21
  ## Supported Ruby versions
25
22
 
26
- This library officially supports following Ruby versions:
27
-
28
- * MRI >= `2.4`
29
- * jruby >= `9.2`
30
-
31
- It **should** work on MRI `2.3.x` too, but there's no official support for this version.
32
-
33
- ## Installation
34
-
35
- Add this line to your application's Gemfile:
36
-
37
- ```ruby
38
- gem 'dry-core'
39
- ```
40
-
41
- And then execute:
42
-
43
- $ bundle
44
-
45
- Or install it yourself as:
46
-
47
- $ gem install dry-core
48
-
49
- ## Development
50
-
51
- 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.
52
-
53
- 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).
54
-
55
- ## Contributing
56
-
57
- Bug reports and pull requests are welcome on GitHub at https://github.com/dry-rb/dry-core.
23
+ This library officially supports the following Ruby versions:
58
24
 
25
+ * MRI `>= 2.6.0`
26
+ * ~~jruby~~ `>= 9.3` (we are waiting for [2.6 support](https://github.com/jruby/jruby/issues/6161))
59
27
 
60
28
  ## License
61
29
 
62
- The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
30
+ See `LICENSE` file.
data/dry-core.gemspec CHANGED
@@ -1,36 +1,37 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- lib = File.expand_path('../lib', __FILE__)
3
+ # this file is synced from dry-rb/template-gem project
4
+
5
+ lib = File.expand_path("lib", __dir__)
4
6
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
- require 'dry/core/version'
7
+ require "dry/core/version"
6
8
 
7
9
  Gem::Specification.new do |spec|
8
- spec.name = 'dry-core'
9
- spec.version = Dry::Core::VERSION
10
- spec.authors = ['Nikita Shilnikov']
11
- spec.email = ['fg@flashgordon.ru']
10
+ spec.name = "dry-core"
11
+ spec.authors = ["Nikita Shilnikov"]
12
+ spec.email = ["fg@flashgordon.ru"]
13
+ spec.license = "MIT"
14
+ spec.version = Dry::Core::VERSION.dup
12
15
 
13
- spec.summary = 'A toolset of small support modules used throughout the dry-rb ecosystem.'
16
+ spec.summary = "A toolset of small support modules used throughout the dry-rb ecosystem"
14
17
  spec.description = spec.summary
15
- spec.homepage = 'https://github.com/dry-rb/dry-core'
16
- spec.license = 'MIT'
17
-
18
- # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
19
- # to allow pushing to a single host or delete this section to allow pushing to any host.
20
- if spec.respond_to?(:metadata)
21
- spec.metadata['allowed_push_host'] = 'https://rubygems.org'
22
- else
23
- raise 'RubyGems 2.0 or newer is required to protect against public gem pushes.'
24
- end
25
-
26
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features|bin)/}) }
27
- spec.bindir = 'exe'
28
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
29
- spec.require_paths = ['lib']
30
- spec.required_ruby_version = '>= 2.1.0'
31
- spec.add_runtime_dependency 'concurrent-ruby', '~> 1.0'
32
-
33
- spec.add_development_dependency 'bundler'
34
- spec.add_development_dependency 'rake', '~> 10.0'
35
- spec.add_development_dependency 'rspec', '~> 3.0'
18
+ spec.homepage = "https://dry-rb.org/gems/dry-core"
19
+ spec.files = Dir["CHANGELOG.md", "LICENSE", "README.md", "dry-core.gemspec", "lib/**/*"]
20
+ spec.bindir = "bin"
21
+ spec.executables = []
22
+ spec.require_paths = ["lib"]
23
+
24
+ spec.metadata["allowed_push_host"] = "https://rubygems.org"
25
+ spec.metadata["changelog_uri"] = "https://github.com/dry-rb/dry-core/blob/master/CHANGELOG.md"
26
+ spec.metadata["source_code_uri"] = "https://github.com/dry-rb/dry-core"
27
+ spec.metadata["bug_tracker_uri"] = "https://github.com/dry-rb/dry-core/issues"
28
+
29
+ spec.required_ruby_version = ">= 2.6.0"
30
+
31
+ # to update dependencies edit project.yml
32
+ spec.add_runtime_dependency "concurrent-ruby", "~> 1.0"
33
+
34
+ spec.add_development_dependency "bundler"
35
+ spec.add_development_dependency "rake"
36
+ spec.add_development_dependency "rspec"
36
37
  end