dry-configurable 0.9.0 → 0.11.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +81 -21
- data/LICENSE +1 -1
- data/README.md +15 -27
- data/dry-configurable.gemspec +27 -18
- data/lib/dry-configurable.rb +2 -0
- data/lib/dry/configurable.rb +21 -146
- data/lib/dry/configurable/class_methods.rb +103 -0
- data/lib/dry/configurable/compiler.rb +45 -0
- data/lib/dry/configurable/config.rb +79 -136
- data/lib/dry/configurable/constants.rb +12 -0
- data/lib/dry/configurable/dsl.rb +62 -0
- data/lib/dry/configurable/dsl/args.rb +58 -0
- data/lib/dry/configurable/{error.rb → errors.rb} +5 -1
- data/lib/dry/configurable/instance_methods.rb +46 -0
- data/lib/dry/configurable/methods.rb +32 -0
- data/lib/dry/configurable/setting.rb +91 -17
- data/lib/dry/configurable/settings.rb +42 -87
- data/lib/dry/configurable/test_interface.rb +3 -5
- data/lib/dry/configurable/version.rb +3 -1
- metadata +30 -25
- data/.codeclimate.yml +0 -12
- data/.github/ISSUE_TEMPLATE/----please-don-t-ask-for-support-via-issues.md +0 -10
- data/.github/ISSUE_TEMPLATE/---bug-report.md +0 -34
- data/.github/ISSUE_TEMPLATE/---feature-request.md +0 -18
- data/.github/workflows/ci.yml +0 -70
- data/.github/workflows/docsite.yml +0 -34
- data/.github/workflows/sync_configs.yml +0 -30
- data/.gitignore +0 -9
- data/.rspec +0 -4
- data/.rubocop.yml +0 -89
- data/CODE_OF_CONDUCT.md +0 -13
- data/CONTRIBUTING.md +0 -29
- data/Gemfile +0 -20
- data/Rakefile +0 -12
- data/docsite/source/index.html.md +0 -55
- data/docsite/source/testing.html.md +0 -27
- data/lib/dry/configurable/settings/argument_parser.rb +0 -50
- data/rakelib/rubocop.rake +0 -18
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Dry
|
2
4
|
module Configurable
|
3
5
|
# Methods meant to be used in a testing scenario
|
@@ -8,11 +10,7 @@ module Dry
|
|
8
10
|
#
|
9
11
|
# @api public
|
10
12
|
def reset_config
|
11
|
-
@config =
|
12
|
-
_settings.create_config
|
13
|
-
else
|
14
|
-
self.class._settings.create_config
|
15
|
-
end
|
13
|
+
@config = config.pristine
|
16
14
|
end
|
17
15
|
end
|
18
16
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dry-configurable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.11.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Holland
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -44,6 +44,20 @@ dependencies:
|
|
44
44
|
- - ">="
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: 0.4.7
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: dry-equalizer
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - "~>"
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0.2'
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - "~>"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0.2'
|
47
61
|
- !ruby/object:Gem::Dependency
|
48
62
|
name: bundler
|
49
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,49 +100,40 @@ dependencies:
|
|
86
100
|
- - ">="
|
87
101
|
- !ruby/object:Gem::Version
|
88
102
|
version: '0'
|
89
|
-
description:
|
103
|
+
description: A mixin to add configuration functionality to your classes
|
90
104
|
email:
|
91
105
|
- andyholland1991@aol.com
|
92
106
|
executables: []
|
93
107
|
extensions: []
|
94
108
|
extra_rdoc_files: []
|
95
109
|
files:
|
96
|
-
- ".codeclimate.yml"
|
97
|
-
- ".github/ISSUE_TEMPLATE/----please-don-t-ask-for-support-via-issues.md"
|
98
|
-
- ".github/ISSUE_TEMPLATE/---bug-report.md"
|
99
|
-
- ".github/ISSUE_TEMPLATE/---feature-request.md"
|
100
|
-
- ".github/workflows/ci.yml"
|
101
|
-
- ".github/workflows/docsite.yml"
|
102
|
-
- ".github/workflows/sync_configs.yml"
|
103
|
-
- ".gitignore"
|
104
|
-
- ".rspec"
|
105
|
-
- ".rubocop.yml"
|
106
110
|
- CHANGELOG.md
|
107
|
-
- CODE_OF_CONDUCT.md
|
108
|
-
- CONTRIBUTING.md
|
109
|
-
- Gemfile
|
110
111
|
- LICENSE
|
111
112
|
- README.md
|
112
|
-
- Rakefile
|
113
|
-
- docsite/source/index.html.md
|
114
|
-
- docsite/source/testing.html.md
|
115
113
|
- dry-configurable.gemspec
|
116
114
|
- lib/dry-configurable.rb
|
117
115
|
- lib/dry/configurable.rb
|
116
|
+
- lib/dry/configurable/class_methods.rb
|
117
|
+
- lib/dry/configurable/compiler.rb
|
118
118
|
- lib/dry/configurable/config.rb
|
119
|
-
- lib/dry/configurable/
|
119
|
+
- lib/dry/configurable/constants.rb
|
120
|
+
- lib/dry/configurable/dsl.rb
|
121
|
+
- lib/dry/configurable/dsl/args.rb
|
122
|
+
- lib/dry/configurable/errors.rb
|
123
|
+
- lib/dry/configurable/instance_methods.rb
|
124
|
+
- lib/dry/configurable/methods.rb
|
120
125
|
- lib/dry/configurable/setting.rb
|
121
126
|
- lib/dry/configurable/settings.rb
|
122
|
-
- lib/dry/configurable/settings/argument_parser.rb
|
123
127
|
- lib/dry/configurable/test_interface.rb
|
124
128
|
- lib/dry/configurable/version.rb
|
125
|
-
-
|
126
|
-
homepage: https://github.com/dry-rb/dry-configurable
|
129
|
+
homepage: https://dry-rb.org/gems/dry-configurable
|
127
130
|
licenses:
|
128
131
|
- MIT
|
129
132
|
metadata:
|
130
|
-
|
133
|
+
allowed_push_host: https://rubygems.org
|
131
134
|
changelog_uri: https://github.com/dry-rb/dry-configurable/blob/master/CHANGELOG.md
|
135
|
+
source_code_uri: https://github.com/dry-rb/dry-configurable
|
136
|
+
bug_tracker_uri: https://github.com/dry-rb/dry-configurable/issues
|
132
137
|
post_install_message:
|
133
138
|
rdoc_options: []
|
134
139
|
require_paths:
|
@@ -144,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
144
149
|
- !ruby/object:Gem::Version
|
145
150
|
version: '0'
|
146
151
|
requirements: []
|
147
|
-
rubygems_version: 3.0.
|
152
|
+
rubygems_version: 3.0.3
|
148
153
|
signing_key:
|
149
154
|
specification_version: 4
|
150
155
|
summary: A mixin to add configuration functionality to your classes
|
data/.codeclimate.yml
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
---
|
2
|
-
name: "\U0001F41B Bug report"
|
3
|
-
about: See CONTRIBUTING.md for more information
|
4
|
-
title: ''
|
5
|
-
labels: bug
|
6
|
-
assignees: ''
|
7
|
-
|
8
|
-
---
|
9
|
-
|
10
|
-
**Before you submit this: WE ONLY ACCEPT BUG REPORTS AND FEATURE REQUESTS**
|
11
|
-
|
12
|
-
For more information see [our contribution guidelines](https://github.com/rom-rb/rom/blob/master/CONTRIBUTING.md)
|
13
|
-
|
14
|
-
**Before you report**
|
15
|
-
|
16
|
-
:warning: If you have a problem related to a schema, please **report it under [dry-schema issues](https://github.com/dry-rb/dry-schema/issues/new?assignees=&labels=bug&template=---bug-report.md&title=)** instead.
|
17
|
-
|
18
|
-
**Describe the bug**
|
19
|
-
|
20
|
-
A clear and concise description of what the bug is.
|
21
|
-
|
22
|
-
**To Reproduce**
|
23
|
-
|
24
|
-
Provide detailed steps to reproduce, an executable script would be best.
|
25
|
-
|
26
|
-
**Expected behavior**
|
27
|
-
|
28
|
-
A clear and concise description of what you expected to happen.
|
29
|
-
|
30
|
-
**Your environment**
|
31
|
-
|
32
|
-
- Affects my production application: **YES/NO**
|
33
|
-
- Ruby version: ...
|
34
|
-
- OS: ...
|
@@ -1,18 +0,0 @@
|
|
1
|
-
---
|
2
|
-
name: "\U0001F6E0 Feature request"
|
3
|
-
about: See CONTRIBUTING.md for more information
|
4
|
-
title: ''
|
5
|
-
labels: feature
|
6
|
-
assignees: ''
|
7
|
-
|
8
|
-
---
|
9
|
-
|
10
|
-
Summary of what the feature is supposed to do.
|
11
|
-
|
12
|
-
## Examples
|
13
|
-
|
14
|
-
Code examples showing how the feature could be used.
|
15
|
-
|
16
|
-
## Resources
|
17
|
-
|
18
|
-
Additional information, like a link to the discussion forum thread where the feature was discussed etc.
|
data/.github/workflows/ci.yml
DELETED
@@ -1,70 +0,0 @@
|
|
1
|
-
name: ci
|
2
|
-
|
3
|
-
on:
|
4
|
-
push:
|
5
|
-
paths:
|
6
|
-
- .github/workflows/ci.yml
|
7
|
-
- lib/**
|
8
|
-
- spec/**
|
9
|
-
|
10
|
-
jobs:
|
11
|
-
tests-mri:
|
12
|
-
runs-on: ubuntu-latest
|
13
|
-
strategy:
|
14
|
-
fail-fast: false
|
15
|
-
matrix:
|
16
|
-
ruby: ["2.6.x", "2.5.x", "2.4.x"]
|
17
|
-
include:
|
18
|
-
- ruby: "2.6.x"
|
19
|
-
coverage: "true"
|
20
|
-
steps:
|
21
|
-
- uses: actions/checkout@v1
|
22
|
-
- name: Set up Ruby
|
23
|
-
uses: actions/setup-ruby@v1
|
24
|
-
with:
|
25
|
-
ruby-version: ${{matrix.ruby}}
|
26
|
-
- name: Download test reporter
|
27
|
-
if: "matrix.coverage == 'true'"
|
28
|
-
run: |
|
29
|
-
mkdir -p tmp/
|
30
|
-
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./tmp/cc-test-reporter
|
31
|
-
chmod +x ./tmp/cc-test-reporter
|
32
|
-
./tmp/cc-test-reporter before-build
|
33
|
-
- name: Run all tests
|
34
|
-
env:
|
35
|
-
COVERAGE: ${{matrix.coverage}}
|
36
|
-
run: |
|
37
|
-
gem install bundler
|
38
|
-
bundle install --jobs 4 --retry 3 --without tools docs
|
39
|
-
bundle exec rake
|
40
|
-
- name: Send coverage results
|
41
|
-
if: "matrix.coverage == 'true'"
|
42
|
-
env:
|
43
|
-
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
|
44
|
-
GIT_COMMIT_SHA: ${{github.sha}}
|
45
|
-
GIT_BRANCH: ${{github.ref}}
|
46
|
-
GIT_COMMITTED_AT: ${{github.event.head_commit.timestamp}}
|
47
|
-
run: |
|
48
|
-
GIT_BRANCH=`ruby -e "puts ENV['GITHUB_REF'].split('/', 3).last"` \
|
49
|
-
GIT_COMMITTED_AT=`ruby -r time -e "puts Time.iso8601(ENV['GIT_COMMITTED_AT']).to_i"` \
|
50
|
-
./tmp/cc-test-reporter after-build
|
51
|
-
|
52
|
-
tests-others:
|
53
|
-
runs-on: ubuntu-latest
|
54
|
-
strategy:
|
55
|
-
fail-fast: false
|
56
|
-
matrix:
|
57
|
-
image: ["jruby:9.2.8", "ruby:rc"]
|
58
|
-
container:
|
59
|
-
image: ${{matrix.image}}
|
60
|
-
steps:
|
61
|
-
- uses: actions/checkout@v1
|
62
|
-
- name: Install git
|
63
|
-
run: |
|
64
|
-
apt-get update
|
65
|
-
apt-get install -y --no-install-recommends git
|
66
|
-
- name: Run all tests
|
67
|
-
run: |
|
68
|
-
gem install bundler
|
69
|
-
bundle install --jobs 4 --retry 3 --without tools docs
|
70
|
-
bundle exec rspec
|
@@ -1,34 +0,0 @@
|
|
1
|
-
# this file is managed by dry-rb/devtools project
|
2
|
-
|
3
|
-
name: docsite
|
4
|
-
|
5
|
-
on:
|
6
|
-
push:
|
7
|
-
paths:
|
8
|
-
- docsite/**
|
9
|
-
- .github/workflows/docsite.yml
|
10
|
-
branches:
|
11
|
-
- master
|
12
|
-
- release-**
|
13
|
-
tags:
|
14
|
-
|
15
|
-
jobs:
|
16
|
-
update-docs:
|
17
|
-
runs-on: ubuntu-latest
|
18
|
-
steps:
|
19
|
-
- uses: actions/checkout@v1
|
20
|
-
- name: Set up Ruby
|
21
|
-
uses: actions/setup-ruby@v1
|
22
|
-
with:
|
23
|
-
ruby-version: "2.6.x"
|
24
|
-
- name: Install dependencies
|
25
|
-
run: |
|
26
|
-
gem install bundler
|
27
|
-
bundle install --jobs 4 --retry 3 --without benchmarks sql
|
28
|
-
- name: Symlink ossy
|
29
|
-
run: mkdir -p bin && ln -sf "$(bundle show ossy)/bin/ossy" bin/ossy
|
30
|
-
- name: Trigger dry-rb.org deploy
|
31
|
-
env:
|
32
|
-
GITHUB_LOGIN: dry-bot
|
33
|
-
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
|
34
|
-
run: bin/ossy github workflow dry-rb/dry-rb.org ci
|
@@ -1,30 +0,0 @@
|
|
1
|
-
# this file is managed by dry-rb/devtools project
|
2
|
-
|
3
|
-
name: sync_configs
|
4
|
-
|
5
|
-
on:
|
6
|
-
repository_dispatch:
|
7
|
-
|
8
|
-
jobs:
|
9
|
-
sync-configs:
|
10
|
-
runs-on: ubuntu-latest
|
11
|
-
if: github.event.action == 'sync_configs'
|
12
|
-
steps:
|
13
|
-
- uses: actions/checkout@v1
|
14
|
-
- name: Update configuration files from devtools
|
15
|
-
env:
|
16
|
-
GITHUB_LOGIN: dry-bot
|
17
|
-
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
|
18
|
-
run: |
|
19
|
-
git clone https://github.com/dry-rb/devtools.git tmp/devtools
|
20
|
-
|
21
|
-
rsync -av tmp/devtools/shared/ .
|
22
|
-
|
23
|
-
git config --local user.email "dry-bot@dry-rb.org"
|
24
|
-
git config --local user.name "dry-bot"
|
25
|
-
git add -A
|
26
|
-
git commit -m "[devtools] config sync" || echo "nothing changed"
|
27
|
-
- name: Push changes
|
28
|
-
uses: ad-m/github-push-action@master
|
29
|
-
with:
|
30
|
-
github_token: ${{ secrets.GH_PAT }}
|
data/.gitignore
DELETED
data/.rspec
DELETED
data/.rubocop.yml
DELETED
@@ -1,89 +0,0 @@
|
|
1
|
-
# this file is managed by dry-rb/devtools project
|
2
|
-
|
3
|
-
AllCops:
|
4
|
-
TargetRubyVersion: 2.4
|
5
|
-
|
6
|
-
Style/EachWithObject:
|
7
|
-
Enabled: false
|
8
|
-
|
9
|
-
Style/StringLiterals:
|
10
|
-
Enabled: true
|
11
|
-
EnforcedStyle: single_quotes
|
12
|
-
|
13
|
-
Style/Alias:
|
14
|
-
Enabled: false
|
15
|
-
|
16
|
-
Style/LambdaCall:
|
17
|
-
Enabled: false
|
18
|
-
|
19
|
-
Style/StabbyLambdaParentheses:
|
20
|
-
Enabled: false
|
21
|
-
|
22
|
-
Style/FormatString:
|
23
|
-
Enabled: false
|
24
|
-
|
25
|
-
Style/Documentation:
|
26
|
-
Enabled: false
|
27
|
-
|
28
|
-
Layout/SpaceInLambdaLiteral:
|
29
|
-
Enabled: false
|
30
|
-
|
31
|
-
Layout/MultilineMethodCallIndentation:
|
32
|
-
Enabled: true
|
33
|
-
EnforcedStyle: indented
|
34
|
-
|
35
|
-
Metrics/LineLength:
|
36
|
-
Max: 100
|
37
|
-
|
38
|
-
Metrics/MethodLength:
|
39
|
-
Max: 22
|
40
|
-
|
41
|
-
Metrics/ClassLength:
|
42
|
-
Max: 150
|
43
|
-
|
44
|
-
Metrics/AbcSize:
|
45
|
-
Max: 20
|
46
|
-
|
47
|
-
Metrics/BlockLength:
|
48
|
-
Enabled: false
|
49
|
-
|
50
|
-
Metrics/CyclomaticComplexity:
|
51
|
-
Enabled: true
|
52
|
-
Max: 10
|
53
|
-
|
54
|
-
Lint/BooleanSymbol:
|
55
|
-
Enabled: false
|
56
|
-
|
57
|
-
Style/AccessModifierDeclarations:
|
58
|
-
Enabled: false
|
59
|
-
|
60
|
-
Style/BlockDelimiters:
|
61
|
-
Enabled: false
|
62
|
-
|
63
|
-
Layout/IndentFirstArrayElement:
|
64
|
-
EnforcedStyle: consistent
|
65
|
-
|
66
|
-
Style/ClassAndModuleChildren:
|
67
|
-
Exclude:
|
68
|
-
- "spec/**/*_spec.rb"
|
69
|
-
|
70
|
-
Lint/HandleExceptions:
|
71
|
-
Exclude:
|
72
|
-
- "spec/spec_helper.rb"
|
73
|
-
|
74
|
-
Naming/FileName:
|
75
|
-
Exclude:
|
76
|
-
- "lib/dry-*.rb"
|
77
|
-
|
78
|
-
Style/SymbolArray:
|
79
|
-
Exclude:
|
80
|
-
- "spec/**/*_spec.rb"
|
81
|
-
|
82
|
-
Style/ConditionalAssignment:
|
83
|
-
Enabled: false
|
84
|
-
|
85
|
-
Naming/MethodName:
|
86
|
-
Enabled: false
|
87
|
-
|
88
|
-
Style/AsciiComments:
|
89
|
-
Enabled: false
|