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