dry-core 0.4.6 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +154 -41
- data/LICENSE +20 -0
- data/README.md +18 -36
- data/dry-core.gemspec +25 -23
- data/lib/dry-core.rb +3 -1
- data/lib/dry/core.rb +3 -1
- data/lib/dry/core/cache.rb +3 -1
- data/lib/dry/core/class_attributes.rb +32 -10
- data/lib/dry/core/class_builder.rb +3 -3
- data/lib/dry/core/constants.rb +52 -12
- data/lib/dry/core/deprecations.rb +12 -10
- data/lib/dry/core/descendants_tracker.rb +3 -1
- data/lib/dry/core/equalizer.rb +151 -0
- data/lib/dry/core/errors.rb +2 -0
- data/lib/dry/core/extensions.rb +3 -1
- data/lib/dry/core/inflector.rb +6 -3
- data/lib/dry/core/memoizable.rb +2 -0
- data/lib/dry/core/version.rb +3 -1
- metadata +25 -30
- data/.gitignore +0 -10
- data/.inch.yml +0 -4
- data/.rspec +0 -3
- data/.rubocop.yml +0 -31
- data/.travis.yml +0 -31
- data/CONTRIBUTING.md +0 -29
- data/Gemfile +0 -22
- data/LICENSE.txt +0 -21
- data/Rakefile +0 -6
data/lib/dry/core/errors.rb
CHANGED
data/lib/dry/core/extensions.rb
CHANGED
data/lib/dry/core/inflector.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Dry
|
2
4
|
module Core
|
3
5
|
# Helper module providing thin interface around an inflection backend.
|
@@ -5,15 +7,15 @@ module Dry
|
|
5
7
|
# List of supported backends
|
6
8
|
BACKENDS = {
|
7
9
|
activesupport: [
|
8
|
-
|
10
|
+
"active_support/inflector",
|
9
11
|
proc { ::ActiveSupport::Inflector }
|
10
12
|
],
|
11
13
|
dry_inflector: [
|
12
|
-
|
14
|
+
"dry/inflector",
|
13
15
|
proc { Dry::Inflector.new }
|
14
16
|
],
|
15
17
|
inflecto: [
|
16
|
-
|
18
|
+
"inflecto",
|
17
19
|
proc { ::Inflecto }
|
18
20
|
]
|
19
21
|
}.freeze
|
@@ -47,6 +49,7 @@ module Dry
|
|
47
49
|
if name && !BACKENDS.key?(name)
|
48
50
|
raise NameError, "Invalid inflector library selection: '#{name}'"
|
49
51
|
end
|
52
|
+
|
50
53
|
@inflector = name ? realize_backend(*BACKENDS[name]) : detect_backend
|
51
54
|
end
|
52
55
|
|
data/lib/dry/core/memoizable.rb
CHANGED
data/lib/dry/core/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dry-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nikita Shilnikov
|
8
8
|
autorequire:
|
9
|
-
bindir:
|
9
|
+
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -28,62 +28,54 @@ dependencies:
|
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rspec
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
69
|
-
description: A toolset of small support modules used throughout the dry-rb ecosystem
|
68
|
+
version: '0'
|
69
|
+
description: A toolset of small support modules used throughout the dry-rb ecosystem
|
70
70
|
email:
|
71
71
|
- fg@flashgordon.ru
|
72
72
|
executables: []
|
73
73
|
extensions: []
|
74
74
|
extra_rdoc_files: []
|
75
75
|
files:
|
76
|
-
- ".gitignore"
|
77
|
-
- ".inch.yml"
|
78
|
-
- ".rspec"
|
79
|
-
- ".rubocop.yml"
|
80
|
-
- ".travis.yml"
|
81
76
|
- CHANGELOG.md
|
82
|
-
-
|
83
|
-
- Gemfile
|
84
|
-
- LICENSE.txt
|
77
|
+
- LICENSE
|
85
78
|
- README.md
|
86
|
-
- Rakefile
|
87
79
|
- dry-core.gemspec
|
88
80
|
- lib/dry-core.rb
|
89
81
|
- lib/dry/core.rb
|
@@ -93,16 +85,20 @@ files:
|
|
93
85
|
- lib/dry/core/constants.rb
|
94
86
|
- lib/dry/core/deprecations.rb
|
95
87
|
- lib/dry/core/descendants_tracker.rb
|
88
|
+
- lib/dry/core/equalizer.rb
|
96
89
|
- lib/dry/core/errors.rb
|
97
90
|
- lib/dry/core/extensions.rb
|
98
91
|
- lib/dry/core/inflector.rb
|
99
92
|
- lib/dry/core/memoizable.rb
|
100
93
|
- lib/dry/core/version.rb
|
101
|
-
homepage: https://
|
94
|
+
homepage: https://dry-rb.org/gems/dry-core
|
102
95
|
licenses:
|
103
96
|
- MIT
|
104
97
|
metadata:
|
105
98
|
allowed_push_host: https://rubygems.org
|
99
|
+
changelog_uri: https://github.com/dry-rb/dry-core/blob/master/CHANGELOG.md
|
100
|
+
source_code_uri: https://github.com/dry-rb/dry-core
|
101
|
+
bug_tracker_uri: https://github.com/dry-rb/dry-core/issues
|
106
102
|
post_install_message:
|
107
103
|
rdoc_options: []
|
108
104
|
require_paths:
|
@@ -111,16 +107,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
111
107
|
requirements:
|
112
108
|
- - ">="
|
113
109
|
- !ruby/object:Gem::Version
|
114
|
-
version: 2.
|
110
|
+
version: 2.5.0
|
115
111
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
116
112
|
requirements:
|
117
113
|
- - ">="
|
118
114
|
- !ruby/object:Gem::Version
|
119
115
|
version: '0'
|
120
116
|
requirements: []
|
121
|
-
|
122
|
-
rubygems_version: 2.7.6
|
117
|
+
rubygems_version: 3.1.4
|
123
118
|
signing_key:
|
124
119
|
specification_version: 4
|
125
|
-
summary: A toolset of small support modules used throughout the dry-rb ecosystem
|
120
|
+
summary: A toolset of small support modules used throughout the dry-rb ecosystem
|
126
121
|
test_files: []
|
data/.gitignore
DELETED
data/.inch.yml
DELETED
data/.rspec
DELETED
data/.rubocop.yml
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
AllCops:
|
2
|
-
TargetRubyVersion: 2.1
|
3
|
-
Exclude:
|
4
|
-
- 'dry-core.gemspec'
|
5
|
-
- 'spec/spec_helper.rb'
|
6
|
-
|
7
|
-
Style/SignalException:
|
8
|
-
Exclude:
|
9
|
-
- 'spec/**/*'
|
10
|
-
|
11
|
-
Style/RedundantSelf:
|
12
|
-
Exclude:
|
13
|
-
- 'lib/dry/core/deprecations.rb'
|
14
|
-
|
15
|
-
Metrics/LineLength:
|
16
|
-
Max: 110
|
17
|
-
|
18
|
-
Metrics/MethodLength:
|
19
|
-
Enabled: false
|
20
|
-
|
21
|
-
Style/FileName:
|
22
|
-
Exclude:
|
23
|
-
- 'lib/dry-core.rb'
|
24
|
-
|
25
|
-
Lint/AmbiguousRegexpLiteral:
|
26
|
-
Exclude:
|
27
|
-
- 'spec/**/*'
|
28
|
-
|
29
|
-
Style/BlockDelimiters:
|
30
|
-
Exclude:
|
31
|
-
- 'spec/**/*'
|
data/.travis.yml
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
dist: trusty
|
3
|
-
sudo: required
|
4
|
-
cache: bundler
|
5
|
-
bundler_args: --without benchmarks tools
|
6
|
-
after_success:
|
7
|
-
- '[ -d coverage ] && bundle exec codeclimate-test-reporter'
|
8
|
-
script:
|
9
|
-
- bundle exec rake
|
10
|
-
before_install:
|
11
|
-
- gem update --system
|
12
|
-
after_success:
|
13
|
-
- '[ -d coverage ] && bundle exec codeclimate-test-reporter'
|
14
|
-
rvm:
|
15
|
-
- 2.2.9
|
16
|
-
- 2.3.6
|
17
|
-
- 2.4.3
|
18
|
-
- 2.5.0
|
19
|
-
- jruby-9.1.15.0
|
20
|
-
env:
|
21
|
-
global:
|
22
|
-
- COVERAGE=true
|
23
|
-
- JRUBY_OPTS='--dev -J-Xmx1024M'
|
24
|
-
notifications:
|
25
|
-
email: false
|
26
|
-
webhooks:
|
27
|
-
urls:
|
28
|
-
- https://webhooks.gitter.im/e/19098b4253a72c9796db
|
29
|
-
on_success: change # options: [always|never|change] default: always
|
30
|
-
on_failure: always # options: [always|never|change] default: always
|
31
|
-
on_start: false # default: false
|
data/CONTRIBUTING.md
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
# Issue Guidelines
|
2
|
-
|
3
|
-
## Reporting bugs
|
4
|
-
|
5
|
-
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.
|
6
|
-
|
7
|
-
## Reporting feature requests
|
8
|
-
|
9
|
-
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.
|
10
|
-
|
11
|
-
## Reporting questions, support requests, ideas, concerns etc.
|
12
|
-
|
13
|
-
**PLEASE DON'T** - use [discourse.dry-rb.org](https://discourse.dry-rb.org) instead.
|
14
|
-
|
15
|
-
# Pull Request Guidelines
|
16
|
-
|
17
|
-
A Pull Request will only be accepted if it addresses a specific issue that was reported previously, or fixes typos, mistakes in documentation etc.
|
18
|
-
|
19
|
-
Other requirements:
|
20
|
-
|
21
|
-
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.
|
22
|
-
2) Follow the style conventions of the surrounding code. In most cases, this is standard ruby style.
|
23
|
-
3) Add API documentation if it's a new feature
|
24
|
-
4) Update API documentation if it changes an existing feature
|
25
|
-
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
|
26
|
-
|
27
|
-
# Asking for help
|
28
|
-
|
29
|
-
If these guidelines aren't helpful, and you're stuck, please post a message on [discourse.dry-rb.org](https://discourse.dry-rb.org).
|
data/Gemfile
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
source 'https://rubygems.org'
|
2
|
-
|
3
|
-
gemspec
|
4
|
-
|
5
|
-
group :test do
|
6
|
-
if RUBY_VERSION >= '2.4'
|
7
|
-
gem 'activesupport'
|
8
|
-
else
|
9
|
-
gem 'activesupport', '~> 4.2'
|
10
|
-
end
|
11
|
-
gem 'inflecto', '~> 0.0', '>= 0.0.2'
|
12
|
-
gem 'codeclimate-test-reporter', require: false
|
13
|
-
gem 'simplecov', require: false
|
14
|
-
gem 'dry-types'
|
15
|
-
gem 'dry-inflector', git: 'https://github.com/dry-rb/dry-inflector', branch: 'master'
|
16
|
-
end
|
17
|
-
|
18
|
-
group :tools do
|
19
|
-
gem 'pry-byebug', platform: :mri
|
20
|
-
gem 'pry', platform: :jruby
|
21
|
-
gem 'rubocop'
|
22
|
-
end
|
data/LICENSE.txt
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
The MIT License (MIT)
|
2
|
-
|
3
|
-
Copyright (c) 2016 Nikita Shilnikov
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
13
|
-
all 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,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
THE SOFTWARE.
|