Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package rubygem-dry-core for
openSUSE:Factory checked in at 2021-01-21 21:55:33
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-dry-core (Old)
and /work/SRC/openSUSE:Factory/.rubygem-dry-core.new.28504 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-dry-core"
Thu Jan 21 21:55:33 2021 rev:2 rq:865185 version:0.5.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/rubygem-dry-core/rubygem-dry-core.changes
2020-07-01 18:22:53.913987744 +0200
+++
/work/SRC/openSUSE:Factory/.rubygem-dry-core.new.28504/rubygem-dry-core.changes
2021-01-21 21:55:34.225802915 +0100
@@ -1,0 +2,7 @@
+Wed Jan 20 12:33:29 UTC 2021 - Stephan Kulow <[email protected]>
+
+updated to version 0.5.0
+ see installed CHANGELOG.md
+
+
+-------------------------------------------------------------------
Old:
----
dry-core-0.4.9.gem
New:
----
dry-core-0.5.0.gem
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ rubygem-dry-core.spec ++++++
--- /var/tmp/diff_new_pack.fLPf8O/_old 2021-01-21 21:55:34.917803397 +0100
+++ /var/tmp/diff_new_pack.fLPf8O/_new 2021-01-21 21:55:34.917803397 +0100
@@ -1,7 +1,7 @@
#
# spec file for package rubygem-dry-core
#
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -24,15 +24,15 @@
#
Name: rubygem-dry-core
-Version: 0.4.9
+Version: 0.5.0
Release: 0
%define mod_name dry-core
%define mod_full_name %{mod_name}-%{version}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-BuildRequires: %{ruby >= 2.1.0}
+BuildRequires: %{ruby >= 2.5.0}
BuildRequires: %{rubygem gem2rpm}
BuildRequires: ruby-macros >= 5
-URL: https://github.com/dry-rb/dry-core
+URL: https://dry-rb.org/gems/dry-core
Source: https://rubygems.org/gems/%{mod_full_name}.gem
Source1: gem2rpm.yml
Summary: A toolset of small support modules used throughout the dry-rb
@@ -48,7 +48,7 @@
%install
%gem_install \
- --doc-files="CHANGELOG.md LICENSE.txt README.md" \
+ --doc-files="CHANGELOG.md LICENSE README.md" \
-f
%gem_packages
++++++ dry-core-0.4.9.gem -> dry-core-0.5.0.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/.codeclimate.yml new/.codeclimate.yml
--- old/.codeclimate.yml 2019-08-09 11:31:18.000000000 +0200
+++ new/.codeclimate.yml 1970-01-01 01:00:00.000000000 +0100
@@ -1,15 +0,0 @@
-version: "2"
-
-prepare:
- fetch:
- - url:
"https://raw.githubusercontent.com/dry-rb/devtools/master/.rubocop.yml"
- path: ".rubocop.yml"
-
-exclude_patterns:
- - "benchmarks/"
- - "examples/"
- - "spec/"
-
-plugins:
- rubocop:
- enabled: true
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/.gitignore new/.gitignore
--- old/.gitignore 2019-08-09 11:31:18.000000000 +0200
+++ new/.gitignore 1970-01-01 01:00:00.000000000 +0100
@@ -1,11 +0,0 @@
-/.bundle/
-/.yardoc
-/Gemfile.lock
-/_yardoc/
-/coverage/
-/doc/
-/pkg/
-/spec/reports/
-/tmp/
-spec/examples.txt
-.rubocop.yml
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/.inch.yml new/.inch.yml
--- old/.inch.yml 2019-08-09 11:31:18.000000000 +0200
+++ new/.inch.yml 1970-01-01 01:00:00.000000000 +0100
@@ -1,4 +0,0 @@
-files:
- excluded:
- - lib/dry/core.rb
- - lib/dry/core/version.rb
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/.rspec new/.rspec
--- old/.rspec 2019-08-09 11:31:18.000000000 +0200
+++ new/.rspec 1970-01-01 01:00:00.000000000 +0100
@@ -1,3 +0,0 @@
---format progress
---color
---require ./spec/spec_helper.rb
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/.travis.yml new/.travis.yml
--- old/.travis.yml 2019-08-09 11:31:18.000000000 +0200
+++ new/.travis.yml 1970-01-01 01:00:00.000000000 +0100
@@ -1,34 +0,0 @@
-language: ruby
-dist: trusty
-sudo: required
-cache: bundler
-bundler_args: --without benchmarks tools
-after_success:
- - '[ -d coverage ] && bundle exec codeclimate-test-reporter'
-before_install:
- - gem install bundler
-after_success:
- - '[ -d coverage ] && bundle exec codeclimate-test-reporter'
-rvm:
- - 2.4.6
- - 2.5.5
- - 2.6.3
- - truffleruby
-env:
- global:
- - COVERAGE=true
- - JRUBY_OPTS='--dev -J-Xmx1024M'
-matrix:
- allow_failures:
- - rvm: truffleruby
- include:
- - rvm: jruby-9.2.7.0
- jdk: openjdk8
-notifications:
- email: false
- webhooks:
- urls:
- - https://webhooks.gitter.im/e/19098b4253a72c9796db
- on_success: change # options: [always|never|change] default: always
- on_failure: always # options: [always|never|change] default: always
- on_start: false # default: false
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/CHANGELOG.md new/CHANGELOG.md
--- old/CHANGELOG.md 2019-08-09 11:31:18.000000000 +0200
+++ new/CHANGELOG.md 2020-12-12 11:23:10.000000000 +0100
@@ -1,8 +1,44 @@
-# v0.4.9
+<!--- DO NOT EDIT THIS FILE - IT'S AUTOMATICALLY GENERATED VIA DEVTOOLS --->
+
+## unreleased
+
+
+### Added
+
+- 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)
+
+
+[Compare
v0.4.10...master](https://github.com/dry-rb/dry-core/compare/v0.4.10...master)
+
+## 0.4.10 2020-11-19
+
+
+### Added
+
+- `ClassAttributes.defines` gets a new option for coercing values (tallica)
+```ruby
+class Builder
+ extend Dry::Core::ClassAttributes
+
+ defines :nodes, coerce: -> value { Integer(value) }
+end
+```
+`:coerce` works with any callable as well as types from dry-types
+```ruby
+defines :nodes, coerce: Dry::Types['coercible.integer']
+```
+- `Constants::IDENTITY` which is the identity function (flash-gordon)
+
+
+[Compare
v0.4.9...v0.4.10](https://github.com/dry-rb/dry-core/compare/v0.4.9...v0.4.10)
+
+## 0.4.9 2019-08-09
+
### Added
- `Undefined.coalesce` takes a variable number of arguments and returns the
first non-`Undefined` value (flash-gordon)
+
```ruby
Undefined.coalesce(Undefined, Undefined, :foo) # => :foo
```
@@ -11,32 +47,39 @@
- `Undefined.{dup,clone}` returns `Undefined` back, `Undefined` is a singleton
(flash-gordon)
+
[Compare
v0.4.8...v0.4.9](https://github.com/dry-rb/dry-core/compare/v0.4.8...v0.4.9)
-# v0.4.8 2019-06-23
+## 0.4.8 2019-06-23
+
### Added
-- `Undefined.map` for mapping non-undefined values (flash-gordon):
+- `Undefined.map` for mapping non-undefined values (flash-gordon)
+
+ ```ruby
+ something = 1
+ Undefined.map(something) { |v| v + 1 } # => 2
+
+ something = Undefined
+ Undefined.map(something) { |v| v + 1 } # => Undefined
+ ```
-```ruby
-something = 1
-Undefined.map(something) { |v| v + 1 } # => 2
-something = Undefined
-Undefined.map(something) { |v| v + 1 } # => Undefined
-```
[Compare
v0.4.7...v0.4.8](https://github.com/dry-rb/dry-core/compare/v0.4.7...v0.4.8)
-# v0.4.7 2018-06-25
+## 0.4.7 2018-06-25
+
### Fixed
- Fix default logger for deprecations, it now uses `$stderr` by default, as it
should (flash-gordon)
+
[Compare
v0.4.6...v0.4.7](https://github.com/dry-rb/dry-core/compare/v0.4.6...v0.4.7)
-# v0.4.6 2018-05-15
+## 0.4.6 2018-05-15
+
### Changed
@@ -44,40 +87,49 @@
[Compare
v0.4.5...v0.4.6](https://github.com/dry-rb/dry-core/compare/v0.4.5...v0.4.6)
-# v0.4.5 2018-03-14
+## 0.4.5 2018-03-14
+
### Added
- `Dry::Core::Memoizable`, which provides a `memoize` macro for memoizing
results of instance methods (timriley)
+
[Compare
v0.4.4...v0.4.5](https://github.com/dry-rb/dry-core/compare/v0.4.4...v0.4.5)
-# v0.4.4 2018-02-10
+## 0.4.4 2018-02-10
+
### Added
- `deprecate_constant` overrides `Module#deprecate_constant` and issues a
labeled message on accessing a deprecated constant (flash-gordon)
- `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)
+
[Compare
v0.4.3...v0.4.4](https://github.com/dry-rb/dry-core/compare/v0.4.3...v0.4.4)
-# v0.4.3 2018-02-03
+## 0.4.3 2018-02-03
+
### Added
- `Dry::Core::DescendantsTracker` which is a maintained version of the
[`descendants_tracker`](https://github.com/dkubb/descendants_tracker) gem
(flash-gordon)
-[Compare
v0.4.2...v0.4.3](https://github.com/dry-rb/dry-core/compare/v0.4.2...0.4.3)
-# v0.4.2 2017-12-16
+[Compare
v0.4.2...v0.4.3](https://github.com/dry-rb/dry-core/compare/v0.4.2...v0.4.3)
+
+## 0.4.2 2017-12-16
+
### Fixed
- Class attributes now support private setters/getters (flash-gordon)
+
[Compare
v0.4.1...v0.4.2](https://github.com/dry-rb/dry-core/compare/v0.4.1...v0.4.2)
-# v0.4.1 2017-11-04
+## 0.4.1 2017-11-04
+
### Changed
@@ -85,56 +137,67 @@
[Compare
v0.4.0...v0.4.1](https://github.com/dry-rb/dry-core/compare/v0.4.0...v0.4.1)
-# v0.4.0 2017-11-02
+## 0.4.0 2017-11-02
+
### Added
- 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)
```ruby
- class Foo
- extend Dry::Core::ClassAttributes
+ class Foo
+ extend Dry::Core::ClassAttributes
- defines :ruby_attr, type: Integer
- defines :dry_attr, type: Dry::Types['strict.int']
- end
+ defines :ruby_attr, type: Integer
+ defines :dry_attr, type: Dry::Types['strict.int']
+ end
```
+
[Compare
v0.3.4...v0.4.0](https://github.com/dry-rb/dry-core/compare/v0.3.4...v0.4.0)
-# v0.3.4 2017-09-29
+## 0.3.4 2017-09-29
+
### Fixed
- `Deprecations` output is set to `$stderr` by default now (solnic)
+
[Compare
v0.3.3...v0.3.4](https://github.com/dry-rb/dry-core/compare/v0.3.3...v0.3.4)
-# v0.3.3 2017-08-31
+## 0.3.3 2017-08-31
+
### Fixed
- The Deprecations module now shows the right caller line (flash-gordon)
+
[Compare
v0.3.2...v0.3.3](https://github.com/dry-rb/dry-core/compare/v0.3.2...v0.3.3)
-# v0.3.2 2017-08-31
+## 0.3.2 2017-08-31
+
### Added
- Accept an existing logger object in `Dry::Core::Deprecations.set_logger!`
(flash-gordon)
+
[Compare
v0.3.1...v0.3.2](https://github.com/dry-rb/dry-core/compare/v0.3.1...v0.3.2)
-# v0.3.1 2017-05-27
+## 0.3.1 2017-05-27
+
### Added
- Support for building classes within an existing namespace (flash-gordon)
+
[Compare
v0.3.0...v0.3.1](https://github.com/dry-rb/dry-core/compare/v0.3.0...v0.3.1)
-# v0.3.0 2017-05-05
+## 0.3.0 2017-05-05
+
### Changed
@@ -142,42 +205,52 @@
[Compare
v0.2.4...v0.3.0](https://github.com/dry-rb/dry-core/compare/v0.2.4...v0.3.0)
-# v0.2.4 2017-01-26
+## 0.2.4 2017-01-26
+
### Fixed
- Do not require deprecated method to be defined (flash-gordon)
+
[Compare
v0.2.3...v0.2.4](https://github.com/dry-rb/dry-core/compare/v0.2.3...v0.2.4)
-# v0.2.3 2016-12-30
+## 0.2.3 2016-12-30
+
### Fixed
- Fix warnings on using uninitialized class attributes (flash-gordon)
+
[Compare
v0.2.2...v0.2.3](https://github.com/dry-rb/dry-core/compare/v0.2.2...v0.2.3)
-# v0.2.2 2016-12-30
+## 0.2.2 2016-12-30
+
### Added
- `ClassAttributes` which provides `defines` method for defining get-or-set
methods (flash-gordon)
+
[Compare
v0.2.1...v0.2.2](https://github.com/dry-rb/dry-core/compare/v0.2.1...v0.2.2)
-# v0.2.1 2016-11-18
+## 0.2.1 2016-11-18
+
### Added
- `Constants` are now available in nested scopes (flash-gordon)
+
[Compare
v0.2.0...v0.2.1](https://github.com/dry-rb/dry-core/compare/v0.2.0...v0.2.1)
-# v0.2.0 2016-11-01
+## 0.2.0 2016-11-01
+
+
[Compare
v0.1.0...v0.2.0](https://github.com/dry-rb/dry-core/compare/v0.1.0...v0.2.0)
-# v0.1.0 2016-09-17
+## 0.1.0 2016-09-17
Initial release
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/CONTRIBUTING.md new/CONTRIBUTING.md
--- old/CONTRIBUTING.md 2019-08-09 11:31:18.000000000 +0200
+++ new/CONTRIBUTING.md 1970-01-01 01:00:00.000000000 +0100
@@ -1,29 +0,0 @@
-# Issue Guidelines
-
-## Reporting bugs
-
-If you found a bug, report an issue and describe what's the expected behavior
versus what actually happens. If the bug causes a crash, attach a full
backtrace. If possible, a reproduction script showing the problem is highly
appreciated.
-
-## Reporting feature requests
-
-Report a feature request **only after discourseing it first on
[discourse.dry-rb.org](https://discourse.dry-rb.org)** where it was accepted.
Please provide a concise description of the feature, don't link to a
discourseion thread, and instead summarize what was discourseed.
-
-## Reporting questions, support requests, ideas, concerns etc.
-
-**PLEASE DON'T** - use [discourse.dry-rb.org](https://discourse.dry-rb.org)
instead.
-
-# Pull Request Guidelines
-
-A Pull Request will only be accepted if it addresses a specific issue that was
reported previously, or fixes typos, mistakes in documentation etc.
-
-Other requirements:
-
-1) Do not open a pull request if you can't provide tests along with it. If you
have problems writing tests, ask for help in the related issue.
-2) Follow the style conventions of the surrounding code. In most cases, this
is standard ruby style.
-3) Add API documentation if it's a new feature
-4) Update API documentation if it changes an existing feature
-5) Bonus points for sending a PR to
[github.com/dry-rb/dry-rb.org](github.com/dry-rb/dry-rb.org) which updates user
documentation and guides
-
-# Asking for help
-
-If these guidelines aren't helpful, and you're stuck, please post a message on
[discourse.dry-rb.org](https://discourse.dry-rb.org).
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Gemfile new/Gemfile
--- old/Gemfile 2019-08-09 11:31:18.000000000 +0200
+++ new/Gemfile 1970-01-01 01:00:00.000000000 +0100
@@ -1,21 +0,0 @@
-source 'https://rubygems.org'
-
-gemspec
-
-group :test do
- if RUBY_VERSION >= '2.4'
- gem 'activesupport'
- else
- gem 'activesupport', '~> 4.2'
- end
- gem 'inflecto', '~> 0.0', '>= 0.0.2'
- gem 'codeclimate-test-reporter', require: false
- gem 'simplecov', require: false
- gem 'dry-types', '~> 1.0'
- gem 'dry-inflector'
-end
-
-group :tools do
- gem 'pry-byebug', platform: :mri
- gem 'pry', platform: :jruby
-end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/LICENSE new/LICENSE
--- old/LICENSE 1970-01-01 01:00:00.000000000 +0100
+++ new/LICENSE 2020-12-12 11:23:10.000000000 +0100
@@ -0,0 +1,20 @@
+The MIT License (MIT)
+
+Copyright (c) 2015-2020 dry-rb team
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/LICENSE.txt new/LICENSE.txt
--- old/LICENSE.txt 2019-08-09 11:31:18.000000000 +0200
+++ new/LICENSE.txt 1970-01-01 01:00:00.000000000 +0100
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2016 Nikita Shilnikov
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/README.md new/README.md
--- old/README.md 2019-08-09 11:31:18.000000000 +0200
+++ new/README.md 2020-12-12 11:23:10.000000000 +0100
@@ -1,62 +1,29 @@
-[gitter]: https://gitter.im/dry-rb/chat
[gem]: https://rubygems.org/gems/dry-core
-[travis]: https://travis-ci.org/dry-rb/dry-core
-[code_climate]: https://codeclimate.com/github/dry-rb/dry-core
-[inch]: http://inch-ci.org/github/dry-rb/dry-core
+[actions]: https://github.com/dry-rb/dry-core/actions
+[codacy]: https://www.codacy.com/gh/dry-rb/dry-core
[chat]: https://dry-rb.zulipchat.com
+[inchpages]: http://inch-ci.org/github/dry-rb/dry-core
# dry-core [][chat]
-[][gem]
-[][travis]
-[][code_climate]
-[][code_climate]
-[][inch]
-
-
-A collection of small modules used in the dry-rb ecosystem.
+[][gem]
+[][actions]
+[][codacy]
+[][codacy]
+[][inchpages]
## Links
-* [User docs](https://dry-rb.org/gems/dry-core)
-* [API docs](http://rubydoc.info/gems/dry-core)
+* [User documentation](http://dry-rb.org/gems/dry-core)
+* [API documentation](http://rubydoc.info/gems/dry-core)
## Supported Ruby versions
-This library officially supports following Ruby versions:
+This library officially supports the following Ruby versions:
-* MRI >= `2.4`
+* MRI >= `2.5`
* jruby >= `9.2`
-It **should** work on MRI `2.3.x` too, but there's no official support for
this version.
-
-## Installation
-
-Add this line to your application's Gemfile:
-
-```ruby
-gem 'dry-core'
-```
-
-And then execute:
-
- $ bundle
-
-Or install it yourself as:
-
- $ gem install dry-core
-
-## Development
-
-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.
-
-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).
-
-## Contributing
-
-Bug reports and pull requests are welcome on GitHub at
https://github.com/dry-rb/dry-core.
-
-
## License
-The gem is available as open source under the terms of the [MIT
License](http://opensource.org/licenses/MIT).
+See `LICENSE` file.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Rakefile new/Rakefile
--- old/Rakefile 2019-08-09 11:31:18.000000000 +0200
+++ new/Rakefile 1970-01-01 01:00:00.000000000 +0100
@@ -1,8 +0,0 @@
-# frozen_string_literal: true
-
-require 'bundler/gem_tasks'
-require 'rspec/core/rake_task'
-
-RSpec::Core::RakeTask.new(:spec)
-
-task default: :spec
Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/dry-core.gemspec new/dry-core.gemspec
--- old/dry-core.gemspec 2019-08-09 11:31:18.000000000 +0200
+++ new/dry-core.gemspec 2020-12-12 11:23:10.000000000 +0100
@@ -1,36 +1,36 @@
# frozen_string_literal: true
+# this file is managed by dry-rb/devtools project
-lib = File.expand_path('../lib', __FILE__)
+lib = File.expand_path('lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'dry/core/version'
Gem::Specification.new do |spec|
spec.name = 'dry-core'
- spec.version = Dry::Core::VERSION
- spec.authors = ['Nikita Shilnikov']
- spec.email = ['[email protected]']
-
- spec.summary = 'A toolset of small support modules used throughout the
dry-rb ecosystem.'
- spec.description = spec.summary
- spec.homepage = 'https://github.com/dry-rb/dry-core'
+ spec.authors = ["Nikita Shilnikov"]
+ spec.email = ["[email protected]"]
spec.license = 'MIT'
+ spec.version = Dry::Core::VERSION.dup
- # Prevent pushing this gem to RubyGems.org. To allow pushes either set the
'allowed_push_host'
- # to allow pushing to a single host or delete this section to allow pushing
to any host.
- if spec.respond_to?(:metadata)
- spec.metadata['allowed_push_host'] = 'https://rubygems.org'
- else
- raise 'RubyGems 2.0 or newer is required to protect against public gem
pushes.'
- end
-
- spec.files = `git ls-files -z`.split("\x0").reject { |f|
f.match(%r{^(test|spec|features|bin)/}) }
- spec.bindir = 'exe'
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
+ spec.summary = "A toolset of small support modules used throughout the
dry-rb ecosystem"
+ spec.description = spec.summary
+ spec.homepage = 'https://dry-rb.org/gems/dry-core'
+ spec.files = Dir["CHANGELOG.md", "LICENSE", "README.md",
"dry-core.gemspec", "lib/**/*"]
+ spec.bindir = 'bin'
+ spec.executables = []
spec.require_paths = ['lib']
- spec.required_ruby_version = '>= 2.1.0'
- spec.add_runtime_dependency 'concurrent-ruby', '~> 1.0'
- spec.add_development_dependency 'bundler'
- spec.add_development_dependency 'rake', '~> 10.0'
- spec.add_development_dependency 'rspec', '~> 3.0'
+ spec.metadata['allowed_push_host'] = 'https://rubygems.org'
+ spec.metadata['changelog_uri'] =
'https://github.com/dry-rb/dry-core/blob/master/CHANGELOG.md'
+ spec.metadata['source_code_uri'] = 'https://github.com/dry-rb/dry-core'
+ spec.metadata['bug_tracker_uri'] =
'https://github.com/dry-rb/dry-core/issues'
+
+ spec.required_ruby_version = ">= 2.5.0"
+
+ # to update dependencies edit project.yml
+ spec.add_runtime_dependency "concurrent-ruby", "~> 1.0"
+
+ spec.add_development_dependency "bundler"
+ spec.add_development_dependency "rake"
+ spec.add_development_dependency "rspec"
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/dry/core/cache.rb new/lib/dry/core/cache.rb
--- old/lib/dry/core/cache.rb 2019-08-09 11:31:18.000000000 +0200
+++ new/lib/dry/core/cache.rb 2020-12-12 11:23:10.000000000 +0100
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-require 'concurrent/map'
+require "concurrent/map"
module Dry
module Core
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/dry/core/class_attributes.rb
new/lib/dry/core/class_attributes.rb
--- old/lib/dry/core/class_attributes.rb 2019-08-09 11:31:18.000000000
+0200
+++ new/lib/dry/core/class_attributes.rb 2020-12-12 11:23:10.000000000
+0100
@@ -1,7 +1,7 @@
# frozen_string_literal: true
-require 'dry/core/constants'
-require 'dry/core/errors'
+require "dry/core/constants"
+require "dry/core/errors"
module Dry
module Core
@@ -51,22 +51,42 @@
# defines :one, :two, type: Dry::Types['strict.int']
# end
#
- def defines(*args, type: Object)
- mod = Module.new do
+ # @example with coercion using Proc
+ #
+ # class Bar
+ # extend Dry::Core::ClassAttributes
+ #
+ # defines :one, coerce: proc { |value| value.to_s }
+ # end
+ #
+ # @example with coercion using dry-types
+ #
+ # class Bar
+ # extend Dry::Core::ClassAttributes
+ #
+ # defines :one, coerce: Dry::Types['coercible.string']
+ # end
+ #
+ def defines(*args, type: ::Object, coerce: IDENTITY)
+ unless coerce.respond_to?(:call)
+ raise ::ArgumentError, "Non-callable coerce option:
#{coerce.inspect}"
+ end
+
+ mod = ::Module.new do
args.each do |name|
- define_method(name) do |value = Undefined|
- ivar = "@#{name}"
+ ivar = :"@#{name}"
- if value == Undefined
+ define_method(name) do |value = Undefined|
+ if Undefined.equal?(value)
if instance_variable_defined?(ivar)
instance_variable_get(ivar)
else
nil
end
+ elsif type === value
+ instance_variable_set(ivar, coerce.call(value))
else
- raise InvalidClassAttributeValue.new(name, value) unless type
=== value
-
- instance_variable_set(ivar, value)
+ raise InvalidClassAttributeValue.new(name, value)
end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/dry/core/class_builder.rb
new/lib/dry/core/class_builder.rb
--- old/lib/dry/core/class_builder.rb 2019-08-09 11:31:18.000000000 +0200
+++ new/lib/dry/core/class_builder.rb 2020-12-12 11:23:10.000000000 +0100
@@ -72,8 +72,6 @@
remove_const(name)
const_set(name, klass)
- const_get(name).name if RUBY_VERSION < '2.4'
-
remove_const(name)
const_set(name, base)
end
@@ -92,7 +90,7 @@
existing = namespace.const_get(name)
unless existing <= parent
- raise ParentClassMismatch, "#{ existing.name } must be a subclass
of #{ parent.name }"
+ raise ParentClassMismatch, "#{existing.name} must be a subclass of
#{parent.name}"
end
existing
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/dry/core/constants.rb
new/lib/dry/core/constants.rb
--- old/lib/dry/core/constants.rb 2019-08-09 11:31:18.000000000 +0200
+++ new/lib/dry/core/constants.rb 2020-12-12 11:23:10.000000000 +0100
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-require 'set'
+require "set"
module Dry
module Core
@@ -23,16 +23,18 @@
# An empty list of options
EMPTY_OPTS = {}.freeze
# An empty set
- EMPTY_SET = Set.new.freeze
+ EMPTY_SET = ::Set.new.freeze
# An empty string
- EMPTY_STRING = ''.freeze
+ EMPTY_STRING = "".freeze
+ # Identity function
+ IDENTITY = (-> x { x }).freeze
# A special value you can use as a default to know if no arguments
- # were passed to you method
+ # were passed to the method
#
# @example
# def method(value = Undefined)
- # if value == Undefined
+ # if Undefined.equal?(value)
# puts 'no args'
# else
# puts value
@@ -44,12 +46,12 @@
# @api public
def undefined.to_s
- 'Undefined'
+ "Undefined"
end
# @api public
def undefined.inspect
- 'Undefined'
+ "Undefined"
end
# Pick a value, if the first argument is not Undefined, return it back,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/dry/core/deprecations.rb
new/lib/dry/core/deprecations.rb
--- old/lib/dry/core/deprecations.rb 2019-08-09 11:31:18.000000000 +0200
+++ new/lib/dry/core/deprecations.rb 2020-12-12 11:23:10.000000000 +0100
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-require 'logger'
+require "logger"
module Dry
module Core
@@ -17,7 +17,7 @@
# def old_api; end
# def new_api; end
#
- # deprecate_method :old_api, :new_api, "old_api is no-no"
+ # deprecate :old_api, :new_api, message: "old_api is no-no"
# end
#
# @example You also can use this module for your custom messages
@@ -49,8 +49,8 @@
# @api private
def deprecation_message(name, msg)
<<-MSG
- #{ name } is deprecated and will be removed in the next major
version
- #{ msg }
+ #{name} is deprecated and will be removed in the next major version
+ #{msg}
MSG
end
@@ -97,7 +97,7 @@
@logger = output
else
@logger = Logger.new(output).tap do |logger|
- logger.formatter = proc { |_, _, _, msg| "#{ msg }\n" }
+ logger.formatter = proc { |_, _, _, msg| "#{msg}\n" }
end
end
end
@@ -155,7 +155,7 @@
undef_method old_name if method_defined?(old_name)
define_method(old_name) do |*args, &block|
- mod.warn("#{ full_msg }\n#{ STACK.() }")
+ mod.warn("#{full_msg}\n#{STACK.()}")
__send__(new_name, *args, &block)
end
else
@@ -165,7 +165,7 @@
undef_method old_name
define_method(old_name) do |*args, &block|
- mod.warn("#{ full_msg }\n#{ STACK.() }")
+ mod.warn("#{full_msg}\n#{STACK.()}")
__send__(aliased_name, *args, &block)
end
end
@@ -189,7 +189,7 @@
undef_method old_name if method_defined?(old_name)
define_method(old_name) do |*args, &block|
- warn("#{ full_msg }\n#{ STACK.() }")
+ warn("#{full_msg}\n#{STACK.()}")
meth.call(*args, &block)
end
end
@@ -210,7 +210,7 @@
mod = Module.new do
define_method(:const_missing) do |missing|
if missing == constant_name
- warn("#{ full_msg }\n#{ STACK.() }")
+ warn("#{full_msg}\n#{STACK.()}")
value
else
super(missing)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/dry/core/descendants_tracker.rb
new/lib/dry/core/descendants_tracker.rb
--- old/lib/dry/core/descendants_tracker.rb 2019-08-09 11:31:18.000000000
+0200
+++ new/lib/dry/core/descendants_tracker.rb 2020-12-12 11:23:10.000000000
+0100
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-require 'concurrent/array'
+require "concurrent/array"
module Dry
module Core
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/dry/core/equalizer.rb
new/lib/dry/core/equalizer.rb
--- old/lib/dry/core/equalizer.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/lib/dry/core/equalizer.rb 2020-12-12 11:23:10.000000000 +0100
@@ -0,0 +1,151 @@
+# frozen_string_literal: true
+
+module Dry
+ # Build an equalizer module for the inclusion in other class
+ #
+ # ## Credits
+ #
+ # Equalizer has been originally imported from the equalizer gem created by
Dan Kubb
+ #
+ # @api public
+ def self.Equalizer(*keys, **options)
+ Dry::Core::Equalizer.new(*keys, **options)
+ end
+
+ module Core
+ # Define equality, equivalence and inspection methods
+ class Equalizer < Module
+ # Initialize an Equalizer with the given keys
+ #
+ # Will use the keys with which it is initialized to define #cmp?,
+ # #hash, and #inspect
+ #
+ # @param [Array<Symbol>] keys
+ # @param [Hash] options
+ # @option options [Boolean] :inspect whether to define #inspect method
+ # @option options [Boolean] :immutable whether to memoize #hash method
+ #
+ # @return [undefined]
+ #
+ # @api private
+ def initialize(*keys, **options)
+ @keys = keys.uniq
+ define_methods(**options)
+ freeze
+ end
+
+ private
+
+ # Hook called when module is included
+ #
+ # @param [Module] descendant
+ # the module or class including Equalizer
+ #
+ # @return [self]
+ #
+ # @api private
+ def included(descendant)
+ super
+ descendant.include Methods
+ end
+
+ # Define the equalizer methods based on #keys
+ #
+ # @param [Boolean] inspect whether to define #inspect method
+ # @param [Boolean] immutable whether to memoize #hash method
+ #
+ # @return [undefined]
+ #
+ # @api private
+ def define_methods(inspect: true, immutable: false)
+ define_cmp_method
+ define_hash_method(immutable: immutable)
+ define_inspect_method if inspect
+ end
+
+ # Define an #cmp? method based on the instance's values identified by
#keys
+ #
+ # @return [undefined]
+ #
+ # @api private
+ def define_cmp_method
+ keys = @keys
+ define_method(:cmp?) do |comparator, other|
+ keys.all? do |key|
+ __send__(key).public_send(comparator, other.__send__(key))
+ end
+ end
+ private :cmp?
+ end
+
+ # Define a #hash method based on the instance's values identified by
#keys
+ #
+ # @return [undefined]
+ #
+ # @api private
+ def define_hash_method(immutable:)
+ calculate_hash = ->(obj) { @keys.map { |key| obj.__send__(key)
}.push(obj.class).hash }
+ if immutable
+ define_method(:hash) do
+ @__hash__ ||= calculate_hash.call(self)
+ end
+ define_method(:freeze) do
+ hash
+ super()
+ end
+ else
+ define_method(:hash) do
+ calculate_hash.call(self)
+ end
+ end
+ end
+
+ # Define an inspect method that reports the values of the instance's keys
+ #
+ # @return [undefined]
+ #
+ # @api private
+ def define_inspect_method
+ keys = @keys
+ define_method(:inspect) do
+ klass = self.class
+ name = klass.name || klass.inspect
+ "#<#{name}#{keys.map { |key| " #{key}=#{__send__(key).inspect}"
}.join}>"
+ end
+ end
+
+ # The comparison methods
+ module Methods
+ # Compare the object with other object for equality
+ #
+ # @example
+ # object.eql?(other) # => true or false
+ #
+ # @param [Object] other
+ # the other object to compare with
+ #
+ # @return [Boolean]
+ #
+ # @api public
+ def eql?(other)
+ instance_of?(other.class) && cmp?(__method__, other)
+ end
+
+ # Compare the object with other object for equivalency
+ #
+ # @example
+ # object == other # => true or false
+ #
+ # @param [Object] other
+ # the other object to compare with
+ #
+ # @return [Boolean]
+ #
+ # @api public
+ def ==(other)
+ other.is_a?(self.class) && cmp?(__method__, other)
+ end
+ end
+ end
+ end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/dry/core/extensions.rb
new/lib/dry/core/extensions.rb
--- old/lib/dry/core/extensions.rb 2019-08-09 11:31:18.000000000 +0200
+++ new/lib/dry/core/extensions.rb 2020-12-12 11:23:10.000000000 +0100
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-require 'set'
+require "set"
module Dry
module Core
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/dry/core/inflector.rb
new/lib/dry/core/inflector.rb
--- old/lib/dry/core/inflector.rb 2019-08-09 11:31:18.000000000 +0200
+++ new/lib/dry/core/inflector.rb 2020-12-12 11:23:10.000000000 +0100
@@ -7,15 +7,15 @@
# List of supported backends
BACKENDS = {
activesupport: [
- 'active_support/inflector',
+ "active_support/inflector",
proc { ::ActiveSupport::Inflector }
],
dry_inflector: [
- 'dry/inflector',
+ "dry/inflector",
proc { Dry::Inflector.new }
],
inflecto: [
- 'inflecto',
+ "inflecto",
proc { ::Inflecto }
]
}.freeze
@@ -49,6 +49,7 @@
if name && !BACKENDS.key?(name)
raise NameError, "Invalid inflector library selection: '#{name}'"
end
+
@inflector = name ? realize_backend(*BACKENDS[name]) : detect_backend
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/dry/core/version.rb new/lib/dry/core/version.rb
--- old/lib/dry/core/version.rb 2019-08-09 11:31:18.000000000 +0200
+++ new/lib/dry/core/version.rb 2020-12-12 11:23:10.000000000 +0100
@@ -2,6 +2,6 @@
module Dry
module Core
- VERSION = '0.4.9'.freeze
+ VERSION = "0.5.0".freeze
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/dry/core.rb new/lib/dry/core.rb
--- old/lib/dry/core.rb 2019-08-09 11:31:18.000000000 +0200
+++ new/lib/dry/core.rb 2020-12-12 11:23:10.000000000 +0100
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-require 'dry/core/version'
+require "dry/core/version"
# :nodoc:
module Dry
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/dry-core.rb new/lib/dry-core.rb
--- old/lib/dry-core.rb 2019-08-09 11:31:18.000000000 +0200
+++ new/lib/dry-core.rb 2020-12-12 11:23:10.000000000 +0100
@@ -1,3 +1,3 @@
# frozen_string_literal: true
-require 'dry/core'
+require "dry/core"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata 2019-08-09 11:31:18.000000000 +0200
+++ new/metadata 2020-12-12 11:23:10.000000000 +0100
@@ -1,14 +1,14 @@
--- !ruby/object:Gem::Specification
name: dry-core
version: !ruby/object:Gem::Version
- version: 0.4.9
+ version: 0.5.0
platform: ruby
authors:
- Nikita Shilnikov
autorequire:
-bindir: exe
+bindir: bin
cert_chain: []
-date: 2019-08-09 00:00:00.000000000 Z
+date: 2020-12-12 00:00:00.000000000 Z
dependencies:
- !ruby/object:Gem::Dependency
name: concurrent-ruby
@@ -42,48 +42,40 @@
name: rake
requirement: !ruby/object:Gem::Requirement
requirements:
- - - "~>"
+ - - ">="
- !ruby/object:Gem::Version
- version: '10.0'
+ version: '0'
type: :development
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - - "~>"
+ - - ">="
- !ruby/object:Gem::Version
- version: '10.0'
+ version: '0'
- !ruby/object:Gem::Dependency
name: rspec
requirement: !ruby/object:Gem::Requirement
requirements:
- - - "~>"
+ - - ">="
- !ruby/object:Gem::Version
- version: '3.0'
+ version: '0'
type: :development
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - - "~>"
+ - - ">="
- !ruby/object:Gem::Version
- version: '3.0'
-description: A toolset of small support modules used throughout the dry-rb
ecosystem.
+ version: '0'
+description: A toolset of small support modules used throughout the dry-rb
ecosystem
email:
- [email protected]
executables: []
extensions: []
extra_rdoc_files: []
files:
-- ".codeclimate.yml"
-- ".gitignore"
-- ".inch.yml"
-- ".rspec"
-- ".travis.yml"
- CHANGELOG.md
-- CONTRIBUTING.md
-- Gemfile
-- LICENSE.txt
+- LICENSE
- README.md
-- Rakefile
- dry-core.gemspec
- lib/dry-core.rb
- lib/dry/core.rb
@@ -93,16 +85,20 @@
- lib/dry/core/constants.rb
- lib/dry/core/deprecations.rb
- lib/dry/core/descendants_tracker.rb
+- lib/dry/core/equalizer.rb
- lib/dry/core/errors.rb
- lib/dry/core/extensions.rb
- lib/dry/core/inflector.rb
- lib/dry/core/memoizable.rb
- lib/dry/core/version.rb
-homepage: https://github.com/dry-rb/dry-core
+homepage: https://dry-rb.org/gems/dry-core
licenses:
- MIT
metadata:
allowed_push_host: https://rubygems.org
+ changelog_uri: https://github.com/dry-rb/dry-core/blob/master/CHANGELOG.md
+ source_code_uri: https://github.com/dry-rb/dry-core
+ bug_tracker_uri: https://github.com/dry-rb/dry-core/issues
post_install_message:
rdoc_options: []
require_paths:
@@ -111,15 +107,15 @@
requirements:
- - ">="
- !ruby/object:Gem::Version
- version: 2.1.0
+ version: 2.5.0
required_rubygems_version: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
version: '0'
requirements: []
-rubygems_version: 3.0.3
+rubygems_version: 3.1.4
signing_key:
specification_version: 4
-summary: A toolset of small support modules used throughout the dry-rb
ecosystem.
+summary: A toolset of small support modules used throughout the dry-rb
ecosystem
test_files: []