dry-core 0.4.8 → 0.7.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: 248dbedf379c8c7c585274a2334bd6b6347641d59d66f2348bb78990ac60d921
4
- data.tar.gz: 2abd02588d6151cbe2ce1ddb6d547b841a6a5c6dd73eeedf2adf92fb760ad06a
3
+ metadata.gz: 5bebc041fb4b4179274ef429212f91054377d05b6d4e6f353eb515a008794bff
4
+ data.tar.gz: 58401fbebb0f25c9990d5f3f7a5dad7e5bc0512c1aa2787732e7c35016d913f8
5
5
  SHA512:
6
- metadata.gz: d0a1a31e66dcac988307bbff851611773d0d8bc2b561a76b0dcdd18d17199d49e4eabcf84e42e7443fdc0e5b16bfdde86d532b6bbe78bd070f32945fc2506f3a
7
- data.tar.gz: 46afa1f06dd69b69a182f9d5cfa17cf8d0d9d419d22193d61b18f967f56fe3d0042de3c1bf38e5a41756faca5e230e246b80d5bf074666dac384ba2f93c813be
6
+ metadata.gz: da17cd2eecc9cfdc1ac6210161b94cbf46a5e572a563ab4e1173fed488ad2690fedee3c64dcb8db55285dfc3277b988de794800d21a23161b8f537c14ec6ceff
7
+ data.tar.gz: 9a7530f8bdc1e5398638562a00021d689da2de8c52b704d4dc59817f0a70ce640b1e0fcc618690ff59853e437adc8456e3d8a4830978f2b0217c8bbe845bd352
data/CHANGELOG.md CHANGED
@@ -1,27 +1,115 @@
1
- # v0.4.8 2019-06-23
1
+ <!--- DO NOT EDIT THIS FILE - IT'S AUTOMATICALLY GENERATED VIA DEVTOOLS --->
2
+
3
+ ## 0.7.0 2021-07-08
4
+
5
+
6
+ ### Fixed
7
+
8
+ - [memoizable] warnings when using keyword arguments (@flash-gordon)
9
+ - [deprecations] warnings show more relevant information about caller by default (@timriley)
10
+
11
+ ### Changed
12
+
13
+ - Minimal Ruby version is 2.6
14
+
15
+ [Compare v0.6.0...v0.7.0](https://github.com/dry-rb/dry-core/compare/v0.6.0...v0.7.0)
16
+
17
+ ## 0.6.0 2021-06-03
18
+
19
+
20
+ ### Added
21
+
22
+ - [memoizable] support for `BasicObject` (@oleander)
23
+ - [memoizable] support for methods that accept blocks (@oleander)
24
+ - [deprecations] allow printing frame info on warn when setting up Deprecation module (via #52) (@waiting-for-dev)
25
+
26
+ ### Fixed
27
+
28
+ - [memoizable] works with MRI 2.7+ keyword arguments now (@oleander)
29
+
30
+
31
+ [Compare v0.5.0...v0.6.0](https://github.com/dry-rb/dry-core/compare/v0.5.0...v0.6.0)
32
+
33
+ ## 0.5.0 2012-12-12
34
+
35
+
36
+ ### Added
37
+
38
+ - 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)
39
+
40
+
41
+ [Compare v0.4.10...v0.5.0](https://github.com/dry-rb/dry-core/compare/v0.4.10...v0.5.0)
42
+
43
+ ## 0.4.10 2020-11-19
44
+
2
45
 
3
46
  ### Added
4
47
 
5
- - `Undefined.map` for mapping non-undefined values (flash-gordon):
48
+ - `ClassAttributes.defines` gets a new option for coercing values (tallica)
49
+ ```ruby
50
+ class Builder
51
+ extend Dry::Core::ClassAttributes
6
52
 
53
+ defines :nodes, coerce: -> value { Integer(value) }
54
+ end
55
+ ```
56
+ `:coerce` works with any callable as well as types from dry-types
7
57
  ```ruby
8
- something = 1
9
- Undefined.map(something) { |v| v + 1 } # => 2
10
- something = Undefined
11
- Undefined.map(something) { |v| v + 1 } # => Undefined
58
+ defines :nodes, coerce: Dry::Types['coercible.integer']
12
59
  ```
60
+ - `Constants::IDENTITY` which is the identity function (flash-gordon)
61
+
62
+
63
+ [Compare v0.4.9...v0.4.10](https://github.com/dry-rb/dry-core/compare/v0.4.9...v0.4.10)
64
+
65
+ ## 0.4.9 2019-08-09
66
+
67
+
68
+ ### Added
69
+
70
+ - `Undefined.coalesce` takes a variable number of arguments and returns the first non-`Undefined` value (flash-gordon)
71
+
72
+ ```ruby
73
+ Undefined.coalesce(Undefined, Undefined, :foo) # => :foo
74
+ ```
75
+
76
+ ### Fixed
77
+
78
+ - `Undefined.{dup,clone}` returns `Undefined` back, `Undefined` is a singleton (flash-gordon)
79
+
80
+
81
+ [Compare v0.4.8...v0.4.9](https://github.com/dry-rb/dry-core/compare/v0.4.8...v0.4.9)
82
+
83
+ ## 0.4.8 2019-06-23
84
+
85
+
86
+ ### Added
87
+
88
+ - `Undefined.map` for mapping non-undefined values (flash-gordon)
89
+
90
+ ```ruby
91
+ something = 1
92
+ Undefined.map(something) { |v| v + 1 } # => 2
93
+
94
+ something = Undefined
95
+ Undefined.map(something) { |v| v + 1 } # => Undefined
96
+ ```
97
+
13
98
 
14
99
  [Compare v0.4.7...v0.4.8](https://github.com/dry-rb/dry-core/compare/v0.4.7...v0.4.8)
15
100
 
16
- # v0.4.7 2018-06-25
101
+ ## 0.4.7 2018-06-25
102
+
17
103
 
18
104
  ### Fixed
19
105
 
20
106
  - Fix default logger for deprecations, it now uses `$stderr` by default, as it should (flash-gordon)
21
107
 
108
+
22
109
  [Compare v0.4.6...v0.4.7](https://github.com/dry-rb/dry-core/compare/v0.4.6...v0.4.7)
23
110
 
24
- # v0.4.6 2018-05-15
111
+ ## 0.4.6 2018-05-15
112
+
25
113
 
26
114
  ### Changed
27
115
 
@@ -29,40 +117,49 @@ Undefined.map(something) { |v| v + 1 } # => Undefined
29
117
 
30
118
  [Compare v0.4.5...v0.4.6](https://github.com/dry-rb/dry-core/compare/v0.4.5...v0.4.6)
31
119
 
32
- # v0.4.5 2018-03-14
120
+ ## 0.4.5 2018-03-14
121
+
33
122
 
34
123
  ### Added
35
124
 
36
125
  - `Dry::Core::Memoizable`, which provides a `memoize` macro for memoizing results of instance methods (timriley)
37
126
 
127
+
38
128
  [Compare v0.4.4...v0.4.5](https://github.com/dry-rb/dry-core/compare/v0.4.4...v0.4.5)
39
129
 
40
- # v0.4.4 2018-02-10
130
+ ## 0.4.4 2018-02-10
131
+
41
132
 
42
133
  ### Added
43
134
 
44
135
  - `deprecate_constant` overrides `Module#deprecate_constant` and issues a labeled message on accessing a deprecated constant (flash-gordon)
45
136
  - `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)
46
137
 
138
+
47
139
  [Compare v0.4.3...v0.4.4](https://github.com/dry-rb/dry-core/compare/v0.4.3...v0.4.4)
48
140
 
49
- # v0.4.3 2018-02-03
141
+ ## 0.4.3 2018-02-03
142
+
50
143
 
51
144
  ### Added
52
145
 
53
146
  - `Dry::Core::DescendantsTracker` which is a maintained version of the [`descendants_tracker`](https://github.com/dkubb/descendants_tracker) gem (flash-gordon)
54
147
 
55
- [Compare v0.4.2...v0.4.3](https://github.com/dry-rb/dry-core/compare/v0.4.2...0.4.3)
56
148
 
57
- # v0.4.2 2017-12-16
149
+ [Compare v0.4.2...v0.4.3](https://github.com/dry-rb/dry-core/compare/v0.4.2...v0.4.3)
150
+
151
+ ## 0.4.2 2017-12-16
152
+
58
153
 
59
154
  ### Fixed
60
155
 
61
156
  - Class attributes now support private setters/getters (flash-gordon)
62
157
 
158
+
63
159
  [Compare v0.4.1...v0.4.2](https://github.com/dry-rb/dry-core/compare/v0.4.1...v0.4.2)
64
160
 
65
- # v0.4.1 2017-11-04
161
+ ## 0.4.1 2017-11-04
162
+
66
163
 
67
164
  ### Changed
68
165
 
@@ -70,56 +167,67 @@ Undefined.map(something) { |v| v + 1 } # => Undefined
70
167
 
71
168
  [Compare v0.4.0...v0.4.1](https://github.com/dry-rb/dry-core/compare/v0.4.0...v0.4.1)
72
169
 
73
- # v0.4.0 2017-11-02
170
+ ## 0.4.0 2017-11-02
171
+
74
172
 
75
173
  ### Added
76
174
 
77
175
  - 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)
78
176
 
79
177
  ```ruby
80
- class Foo
81
- extend Dry::Core::ClassAttributes
178
+ class Foo
179
+ extend Dry::Core::ClassAttributes
82
180
 
83
- defines :ruby_attr, type: Integer
84
- defines :dry_attr, type: Dry::Types['strict.int']
85
- end
181
+ defines :ruby_attr, type: Integer
182
+ defines :dry_attr, type: Dry::Types['strict.int']
183
+ end
86
184
  ```
87
185
 
186
+
88
187
  [Compare v0.3.4...v0.4.0](https://github.com/dry-rb/dry-core/compare/v0.3.4...v0.4.0)
89
188
 
90
- # v0.3.4 2017-09-29
189
+ ## 0.3.4 2017-09-29
190
+
91
191
 
92
192
  ### Fixed
93
193
 
94
194
  - `Deprecations` output is set to `$stderr` by default now (solnic)
95
195
 
196
+
96
197
  [Compare v0.3.3...v0.3.4](https://github.com/dry-rb/dry-core/compare/v0.3.3...v0.3.4)
97
198
 
98
- # v0.3.3 2017-08-31
199
+ ## 0.3.3 2017-08-31
200
+
99
201
 
100
202
  ### Fixed
101
203
 
102
204
  - The Deprecations module now shows the right caller line (flash-gordon)
103
205
 
206
+
104
207
  [Compare v0.3.2...v0.3.3](https://github.com/dry-rb/dry-core/compare/v0.3.2...v0.3.3)
105
208
 
106
- # v0.3.2 2017-08-31
209
+ ## 0.3.2 2017-08-31
210
+
107
211
 
108
212
  ### Added
109
213
 
110
214
  - Accept an existing logger object in `Dry::Core::Deprecations.set_logger!` (flash-gordon)
111
215
 
216
+
112
217
  [Compare v0.3.1...v0.3.2](https://github.com/dry-rb/dry-core/compare/v0.3.1...v0.3.2)
113
218
 
114
- # v0.3.1 2017-05-27
219
+ ## 0.3.1 2017-05-27
220
+
115
221
 
116
222
  ### Added
117
223
 
118
224
  - Support for building classes within an existing namespace (flash-gordon)
119
225
 
226
+
120
227
  [Compare v0.3.0...v0.3.1](https://github.com/dry-rb/dry-core/compare/v0.3.0...v0.3.1)
121
228
 
122
- # v0.3.0 2017-05-05
229
+ ## 0.3.0 2017-05-05
230
+
123
231
 
124
232
  ### Changed
125
233
 
@@ -127,42 +235,52 @@ Undefined.map(something) { |v| v + 1 } # => Undefined
127
235
 
128
236
  [Compare v0.2.4...v0.3.0](https://github.com/dry-rb/dry-core/compare/v0.2.4...v0.3.0)
129
237
 
130
- # v0.2.4 2017-01-26
238
+ ## 0.2.4 2017-01-26
239
+
131
240
 
132
241
  ### Fixed
133
242
 
134
243
  - Do not require deprecated method to be defined (flash-gordon)
135
244
 
245
+
136
246
  [Compare v0.2.3...v0.2.4](https://github.com/dry-rb/dry-core/compare/v0.2.3...v0.2.4)
137
247
 
138
- # v0.2.3 2016-12-30
248
+ ## 0.2.3 2016-12-30
249
+
139
250
 
140
251
  ### Fixed
141
252
 
142
253
  - Fix warnings on using uninitialized class attributes (flash-gordon)
143
254
 
255
+
144
256
  [Compare v0.2.2...v0.2.3](https://github.com/dry-rb/dry-core/compare/v0.2.2...v0.2.3)
145
257
 
146
- # v0.2.2 2016-12-30
258
+ ## 0.2.2 2016-12-30
259
+
147
260
 
148
261
  ### Added
149
262
 
150
263
  - `ClassAttributes` which provides `defines` method for defining get-or-set methods (flash-gordon)
151
264
 
265
+
152
266
  [Compare v0.2.1...v0.2.2](https://github.com/dry-rb/dry-core/compare/v0.2.1...v0.2.2)
153
267
 
154
- # v0.2.1 2016-11-18
268
+ ## 0.2.1 2016-11-18
269
+
155
270
 
156
271
  ### Added
157
272
 
158
273
  - `Constants` are now available in nested scopes (flash-gordon)
159
274
 
275
+
160
276
  [Compare v0.2.0...v0.2.1](https://github.com/dry-rb/dry-core/compare/v0.2.0...v0.2.1)
161
277
 
162
- # v0.2.0 2016-11-01
278
+ ## 0.2.0 2016-11-01
279
+
280
+
163
281
 
164
282
  [Compare v0.1.0...v0.2.0](https://github.com/dry-rb/dry-core/compare/v0.1.0...v0.2.0)
165
283
 
166
- # v0.1.0 2016-09-17
284
+ ## 0.1.0 2016-09-17
167
285
 
168
286
  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