functional-light-service 0.2.5 → 0.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/project-build.yml +39 -0
- data/.rubocop.yml +103 -15
- data/.solargraph.yml +11 -0
- data/.travis.yml +7 -5
- data/Appraisals +2 -2
- data/CHANGELOG.md +108 -0
- data/Gemfile +2 -2
- data/README.md +3 -1
- data/VERSION +1 -1
- data/functional-light-service.gemspec +14 -6
- data/gemfiles/dry_inflector_0_2_1.gemfile +5 -0
- data/gemfiles/i18n_1_8_11.gemfile +5 -0
- data/lib/functional-light-service/action.rb +3 -4
- data/lib/functional-light-service/configuration.rb +1 -1
- data/lib/functional-light-service/context/key_verifier.rb +2 -2
- data/lib/functional-light-service/context.rb +152 -165
- data/lib/functional-light-service/functional/enum.rb +3 -7
- data/lib/functional-light-service/functional/maybe.rb +1 -0
- data/lib/functional-light-service/functional/null.rb +1 -1
- data/lib/functional-light-service/functional/option.rb +0 -2
- data/lib/functional-light-service/functional/result.rb +4 -10
- data/lib/functional-light-service/localization_adapter.rb +5 -2
- data/lib/functional-light-service/organizer/iterate.rb +4 -1
- data/lib/functional-light-service/organizer/verify_call_method_exists.rb +3 -2
- data/lib/functional-light-service/organizer/with_reducer_log_decorator.rb +2 -2
- data/lib/functional-light-service/organizer.rb +4 -5
- data/lib/functional-light-service/testing/context_factory.rb +2 -0
- data/lib/functional-light-service/version.rb +1 -1
- data/lib/functional-light-service.rb +0 -1
- data/spec/acceptance/fail_spec.rb +42 -16
- data/spec/acceptance/include_warning_spec.rb +14 -14
- data/spec/acceptance/not_having_call_method_warning_spec.rb +4 -11
- data/spec/acceptance/organizer/reduce_if_spec.rb +32 -0
- data/spec/context/inspect_spec.rb +6 -21
- data/spec/context_spec.rb +1 -1
- data/spec/lib/deterministic/monad_axioms.rb +2 -0
- data/spec/lib/deterministic/monad_spec.rb +2 -0
- data/spec/lib/deterministic/null_spec.rb +2 -0
- data/spec/lib/enum_spec.rb +3 -1
- data/spec/sample/looks_up_tax_percentage_action_spec.rb +3 -1
- data/spec/spec_helper.rb +9 -12
- data/spec/test_doubles.rb +21 -9
- metadata +144 -22
- data/gemfiles/activesupport_5.gemfile +0 -8
- data/gemfiles/activesupport_5.gemfile.lock +0 -82
- data/spec/acceptance/skip_all_warning_spec.rb +0 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: abc2dc23dfcaceae6802c421d5c4231debc7d9fb056ea7901da835ee7c998e4c
|
4
|
+
data.tar.gz: fac3e050fff1ae34b5cff4d366b81db0f7ee49748e95d79061a26c47353758a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc75d56878d79463fdadd24ccc9ff404c043cca3372f996a9c5d3ab3e72cc85037204d839bdd7ed3d84a2b93d5b348d7f53af192ec05f47c373397a25617ab92
|
7
|
+
data.tar.gz: ea0679e575006d6804f4b3c825c4cbf569b611877f00a136821d49b700abd45d651c4cb38b05fb2483c318ab474bd7d3108bd5032dda3a8e80009a91d677e355
|
@@ -0,0 +1,39 @@
|
|
1
|
+
name: CI Tests
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ main, master ]
|
6
|
+
pull_request:
|
7
|
+
branches: [ main, master ]
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
test:
|
11
|
+
runs-on: ${{ matrix.os }}-latest
|
12
|
+
strategy:
|
13
|
+
fail-fast: false
|
14
|
+
matrix:
|
15
|
+
os: [ubuntu, macos, windows]
|
16
|
+
ruby: [2.6.8, 2.7.4, 3.0.2]
|
17
|
+
gemfile: [dry_inflector_0_2_1, i18n_1_8_11]
|
18
|
+
continue-on-error: ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'debug' }}
|
19
|
+
env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
|
20
|
+
BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
|
21
|
+
steps:
|
22
|
+
- uses: actions/checkout@v2
|
23
|
+
- uses: ruby/setup-ruby@v1
|
24
|
+
with:
|
25
|
+
ruby-version: ${{ matrix.ruby }}
|
26
|
+
- run: bundle install --jobs 4 --retry 3
|
27
|
+
- run: bundle exec rspec spec
|
28
|
+
- run: bundle exec rubocop
|
29
|
+
codecov:
|
30
|
+
name: Codecov
|
31
|
+
runs-on: ubuntu-latest
|
32
|
+
steps:
|
33
|
+
- uses: actions/checkout@v2
|
34
|
+
- uses: codecov/codecov-action@v2
|
35
|
+
with:
|
36
|
+
files: ./coverage/coverage.xml # optional
|
37
|
+
flags: unittests # optional
|
38
|
+
name: codecov-simplecov # optional
|
39
|
+
verbose: true # optional (default = false)
|
data/.rubocop.yml
CHANGED
@@ -1,13 +1,17 @@
|
|
1
|
+
# require: rubocop-performance
|
2
|
+
|
1
3
|
AllCops:
|
4
|
+
TargetRubyVersion: 2.7
|
2
5
|
Exclude:
|
3
6
|
- 'lib/functional-light-service.rb'
|
4
7
|
- 'vendor/bundle/**/*'
|
5
8
|
- 'gemfiles/vendor/bundle/**/*'
|
6
9
|
- 'bin/*'
|
7
10
|
- 'functional-light-service.gemspec'
|
8
|
-
|
11
|
+
NewCops: enable
|
12
|
+
SuggestExtensions: false
|
9
13
|
|
10
|
-
Documentation:
|
14
|
+
Style/Documentation:
|
11
15
|
Enabled: false
|
12
16
|
|
13
17
|
Style/FrozenStringLiteralComment:
|
@@ -34,6 +38,12 @@ Style/HashSyntax:
|
|
34
38
|
Style/TrivialAccessors:
|
35
39
|
AllowPredicates: true
|
36
40
|
|
41
|
+
Style/MissingRespondToMissing:
|
42
|
+
Enabled: false
|
43
|
+
|
44
|
+
Style/Alias:
|
45
|
+
Enabled: false
|
46
|
+
|
37
47
|
Style/Lambda:
|
38
48
|
EnforcedStyle: literal
|
39
49
|
|
@@ -48,25 +58,103 @@ Metrics/BlockLength:
|
|
48
58
|
Exclude:
|
49
59
|
- 'spec/**/*.rb'
|
50
60
|
|
51
|
-
Layout/TrailingBlankLines:
|
52
|
-
Enabled: false
|
53
|
-
|
54
|
-
Layout/EndOfLine:
|
55
|
-
EnforcedStyle: lf
|
56
|
-
|
57
|
-
Metrics/LineLength:
|
58
|
-
Max: 100
|
59
|
-
|
60
61
|
Metrics/AbcSize:
|
61
62
|
Max: 24
|
62
63
|
|
63
|
-
Naming/
|
64
|
+
Naming/MethodParameterName:
|
64
65
|
Enabled: false
|
65
66
|
|
66
|
-
|
67
|
+
Layout/TrailingEmptyLines:
|
67
68
|
Enabled: false
|
68
69
|
|
69
|
-
|
70
|
-
|
70
|
+
Layout/LineLength:
|
71
|
+
Max: 100
|
72
|
+
|
73
|
+
Layout/EndOfLine:
|
74
|
+
Enabled: False
|
75
|
+
|
76
|
+
Lint/ConstantDefinitionInBlock:
|
77
|
+
Exclude:
|
78
|
+
- 'spec/**/*.rb'
|
71
79
|
|
80
|
+
Lint/EmptyClass:
|
81
|
+
Exclude:
|
82
|
+
- 'spec/**/*.rb'
|
72
83
|
|
84
|
+
# Defaults after the Rubocop upgrade
|
85
|
+
Gemspec/DateAssignment: # new in 1.10
|
86
|
+
Enabled: true
|
87
|
+
Layout/LineEndStringConcatenationIndentation: # new in 1.18
|
88
|
+
Enabled: true
|
89
|
+
Layout/SpaceBeforeBrackets: # new in 1.7
|
90
|
+
Enabled: true
|
91
|
+
Lint/AmbiguousAssignment: # new in 1.7
|
92
|
+
Enabled: true
|
93
|
+
Lint/AmbiguousOperatorPrecedence: # new in 1.21
|
94
|
+
Enabled: true
|
95
|
+
Lint/AmbiguousRange: # new in 1.19
|
96
|
+
Enabled: true
|
97
|
+
Lint/DeprecatedConstants: # new in 1.8
|
98
|
+
Enabled: true
|
99
|
+
Lint/DuplicateBranch: # new in 1.3
|
100
|
+
Enabled: true
|
101
|
+
Lint/DuplicateRegexpCharacterClassElement: # new in 1.1
|
102
|
+
Enabled: true
|
103
|
+
Lint/EmptyBlock: # new in 1.1
|
104
|
+
Enabled: true
|
105
|
+
Lint/EmptyInPattern: # new in 1.16
|
106
|
+
Enabled: true
|
107
|
+
Lint/IncompatibleIoSelectWithFiberScheduler: # new in 1.21
|
108
|
+
Enabled: true
|
109
|
+
Lint/LambdaWithoutLiteralBlock: # new in 1.8
|
110
|
+
Enabled: true
|
111
|
+
Lint/NoReturnInBeginEndBlocks: # new in 1.2
|
112
|
+
Enabled: true
|
113
|
+
Lint/NumberedParameterAssignment: # new in 1.9
|
114
|
+
Enabled: true
|
115
|
+
Lint/OrAssignmentToConstant: # new in 1.9
|
116
|
+
Enabled: true
|
117
|
+
Lint/RedundantDirGlobSort: # new in 1.8
|
118
|
+
Enabled: true
|
119
|
+
Lint/SymbolConversion: # new in 1.9
|
120
|
+
Enabled: true
|
121
|
+
Lint/ToEnumArguments: # new in 1.1
|
122
|
+
Enabled: true
|
123
|
+
Lint/TripleQuotes: # new in 1.9
|
124
|
+
Enabled: true
|
125
|
+
Lint/UnexpectedBlockArity: # new in 1.5
|
126
|
+
Enabled: true
|
127
|
+
Lint/UnmodifiedReduceAccumulator: # new in 1.1
|
128
|
+
Enabled: true
|
129
|
+
Style/ArgumentsForwarding: # new in 1.1
|
130
|
+
Enabled: true
|
131
|
+
Style/CollectionCompact: # new in 1.2
|
132
|
+
Enabled: true
|
133
|
+
Style/DocumentDynamicEvalDefinition: # new in 1.1
|
134
|
+
Enabled: true
|
135
|
+
Style/EndlessMethod: # new in 1.8
|
136
|
+
Enabled: true
|
137
|
+
Style/HashConversion: # new in 1.10
|
138
|
+
Enabled: true
|
139
|
+
Style/HashExcept: # new in 1.7
|
140
|
+
Enabled: true
|
141
|
+
Style/IfWithBooleanLiteralBranches: # new in 1.9
|
142
|
+
Enabled: true
|
143
|
+
Style/InPatternThen: # new in 1.16
|
144
|
+
Enabled: true
|
145
|
+
Style/MultilineInPatternThen: # new in 1.16
|
146
|
+
Enabled: true
|
147
|
+
Style/NegatedIfElseCondition: # new in 1.2
|
148
|
+
Enabled: true
|
149
|
+
Style/NilLambda: # new in 1.3
|
150
|
+
Enabled: true
|
151
|
+
Style/QuotedSymbols: # new in 1.16
|
152
|
+
Enabled: true
|
153
|
+
Style/RedundantArgument: # new in 1.4
|
154
|
+
Enabled: true
|
155
|
+
Style/RedundantSelfAssignmentBranch: # new in 1.19
|
156
|
+
Enabled: true
|
157
|
+
Style/StringChars: # new in 1.12
|
158
|
+
Enabled: true
|
159
|
+
Style/SwapValues: # new in 1.1
|
160
|
+
Enabled: true
|
data/.solargraph.yml
ADDED
data/.travis.yml
CHANGED
@@ -4,14 +4,15 @@ env:
|
|
4
4
|
- RUN_COVERAGE_REPORT=true
|
5
5
|
|
6
6
|
rvm:
|
7
|
-
- 2.
|
8
|
-
- 2.
|
7
|
+
- 2.6.6
|
8
|
+
- 2.7.2
|
9
|
+
- 3.0.0
|
9
10
|
|
10
11
|
before_install:
|
11
12
|
- 'echo ''gem: --no-ri --no-rdoc'' > ~/.gemrc'
|
13
|
+
- yes | gem update --system --force
|
12
14
|
- gem install bundler
|
13
|
-
- bundle
|
14
|
-
- bundle install --path vendor/bundle
|
15
|
+
- bundle install --gemfile=Gemfile --clean --path vendor/bundle
|
15
16
|
|
16
17
|
# uncomment this line if your project needs to run something other than `rake`:
|
17
18
|
script:
|
@@ -19,4 +20,5 @@ script:
|
|
19
20
|
- bundle exec rubocop
|
20
21
|
|
21
22
|
gemfile:
|
22
|
-
- gemfiles/
|
23
|
+
- gemfiles/dry_inflector_0_2_1.gemfile
|
24
|
+
- gemfiles/i18n_1_8_11.gemfile
|
data/Appraisals
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
appraise "
|
2
|
-
gem "
|
1
|
+
appraise "dry-inflector-0.2.1" do
|
2
|
+
gem "dry-inflector", "~> 0.2.1"
|
3
3
|
end
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,111 @@
|
|
1
|
+
## 0.4.4 (2022-01-27)
|
2
|
+
### Updated
|
3
|
+
- Aggiornato la versione è sistemato problema upload codeconv ( 2022-01-27 ) [ sphynx79]
|
4
|
+
|
5
|
+
|
6
|
+
|
7
|
+
## 0.4.3 (2022-01-27)
|
8
|
+
### Added
|
9
|
+
- Aggiunto lo stato di codecov nel file readme ( 2022-01-27 ) [ sphynx79]
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
## 0.4.2 (2022-01-27)
|
14
|
+
### Fixed
|
15
|
+
- sistemato il path dove codeconv cerca il file del coverage ( 2022-01-27 ) [ sphynx79]
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
## 0.4.1 (2022-01-27)
|
20
|
+
### Added
|
21
|
+
- aggiunto supporto per codecov.com ( 2022-01-27 ) [ sphynx79]
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
## 0.4.0 (2022-01-27)
|
26
|
+
### Aupdated
|
27
|
+
- Aggioranto il readme, invece di travis uso il simbolo di github actions per vedere se tutti i test hanno dato esito positivo (rubocop,rspec) ( 2022-01-27 ) [ sphynx79]
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
## 0.3.9 (2022-01-26)
|
32
|
+
|
33
|
+
|
34
|
+
## 0.3.8 (2022-01-26)
|
35
|
+
### Added
|
36
|
+
- Aggiunto actions per fare i test in github ( 2022-01-26 ) [ sphynx79]
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
## 0.3.7 (2022-01-26)
|
41
|
+
|
42
|
+
|
43
|
+
## 0.3.6 (2022-01-26)
|
44
|
+
|
45
|
+
|
46
|
+
## 0.3.5 (2022-01-26)
|
47
|
+
|
48
|
+
|
49
|
+
## 0.3.4 (2021-12-15)
|
50
|
+
|
51
|
+
|
52
|
+
## 0.3.3 (2021-12-15)
|
53
|
+
### Fixed
|
54
|
+
- Corretto il problema di passare un hash per avere il dettaglio dell'errore quando fallisce ( 2021-12-15 ) [ sphynx]
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
## 0.3.2 (2020-07-17)
|
59
|
+
### Changed
|
60
|
+
- Ottimizzato performance di Deterministic [enum,result] ( 2020-07-17 ) [ sphynx79]
|
61
|
+
|
62
|
+
|
63
|
+
|
64
|
+
## 0.3.1 (2020-02-16)
|
65
|
+
|
66
|
+
|
67
|
+
## 0.3.0 (2020-02-16)
|
68
|
+
### Removed
|
69
|
+
- Rimosso completamente activesupport ( 2020-02-16 ) [ sphynx79]
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
## 0.2.9.2 (2020-02-16)
|
74
|
+
### Removed
|
75
|
+
- Rimosso ActiveSupport::Deprecation per i warning di deprecation ( 2020-02-16 ) [ sphynx79]
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
## 0.2.9.1 (2020-02-16)
|
80
|
+
### Fixed
|
81
|
+
- Sto cercando di sistemate il problema di travis che da errore per activesupport ( 2020-02-16 ) [ sphynx79]
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
## 0.2.9 (2020-02-16)
|
86
|
+
### Fixed
|
87
|
+
- Travis va in errore aggiunt activesupport al mio gemfile ( 2020-02-16 ) [ sphynx79]
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
## 0.2.8 (2020-02-16)
|
92
|
+
### Removed
|
93
|
+
- rimosso supporto a activesupport 5 ( 2020-02-16 ) [ sphynx79]
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
## 0.2.7 (2020-02-16)
|
98
|
+
### Fix
|
99
|
+
- Risolto problema travis bundle update ( 2020-02-16 ) [ sphynx79]
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
## 0.2.6 (2020-02-16)
|
104
|
+
### Fixed
|
105
|
+
- FiFix problem /dev/null windows, e corretto il bug sul metodo failure? ( 2020-02-16 ) [ sphynx79]
|
106
|
+
|
107
|
+
|
108
|
+
|
1
109
|
## 0.2.5 (2019-02-24)
|
2
110
|
|
3
111
|
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
# FunctionalLightService
|
2
2
|
[](https://rubygems.org/gems/functional-light-service)
|
3
|
-
[](https://github.com/sphynx79/functional-light-service/actions/workflows/project-build.yml)
|
4
|
+
[](https://app.codecov.io/gh/sphynx79/functional-light-service)
|
4
5
|
[](http://opensource.org/licenses/MIT)
|
6
|
+
[](https://rubygems.org/gems/functional-light-service)
|
5
7
|
|
6
8
|
## Table of Content
|
7
9
|
* [Requirements](#requirements)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.4.4
|
@@ -15,12 +15,20 @@ Gem::Specification.new do |gem|
|
|
15
15
|
gem.name = "functional-light-service"
|
16
16
|
gem.require_paths = ["lib"]
|
17
17
|
gem.version = FunctionalLightService::VERSION
|
18
|
+
gem.required_ruby_version = '>= 2.6.0'
|
18
19
|
|
19
|
-
|
20
|
+
gem.add_runtime_dependency("dry-inflector", "~> 0.2", ">= 0.2.1")
|
21
|
+
gem.add_runtime_dependency("i18n", "~> 1.8", ">= 1.8.11")
|
20
22
|
|
21
|
-
|
22
|
-
gem.add_development_dependency("
|
23
|
-
gem.add_development_dependency("
|
24
|
-
gem.add_development_dependency("
|
25
|
-
gem.add_development_dependency("
|
23
|
+
|
24
|
+
gem.add_development_dependency("i18n", "~> 1.8", ">= 1.8.11")
|
25
|
+
gem.add_development_dependency("dry-inflector", "~> 0.2", ">= 0.2.1")
|
26
|
+
gem.add_development_dependency("rspec", "~> 3.10.0")
|
27
|
+
gem.add_development_dependency("simplecov", "~> 0.21.2")
|
28
|
+
gem.add_development_dependency("simplecov-cobertura", "~> 2.1.0")
|
29
|
+
gem.add_development_dependency("rubocop", "~> 1.25.0")
|
30
|
+
gem.add_development_dependency("rubocop-performance", "~> 1.13.2")
|
31
|
+
gem.add_development_dependency("pry", "~> 0.14.1")
|
32
|
+
gem.add_development_dependency("solargraph", "~> 0.44.2")
|
33
|
+
gem.add_development_dependency("nokogiri", "~> 1.12.5")
|
26
34
|
end
|
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'active_support/deprecation'
|
2
|
-
|
3
1
|
module FunctionalLightService
|
4
2
|
module Action
|
5
3
|
def self.extended(base_class)
|
@@ -8,9 +6,10 @@ module FunctionalLightService
|
|
8
6
|
end
|
9
7
|
|
10
8
|
def self.included(base_class)
|
11
|
-
msg = "
|
9
|
+
msg = "DEPRECATION WARNING:\n" \
|
10
|
+
"Including FunctionalLightService::Action is deprecated\n" \
|
12
11
|
"Please use `extend FunctionalLightService::Action` instead"
|
13
|
-
|
12
|
+
print msg
|
14
13
|
base_class.extend Macros
|
15
14
|
end
|
16
15
|
|
@@ -24,7 +24,7 @@ module FunctionalLightService
|
|
24
24
|
|
25
25
|
def error_message
|
26
26
|
"#{type_name} #{format_keys(keys_not_found(keys))} " \
|
27
|
-
|
27
|
+
"to be in the context during #{action}"
|
28
28
|
end
|
29
29
|
|
30
30
|
def throw_error_predicate(_keys)
|
@@ -95,7 +95,7 @@ module FunctionalLightService
|
|
95
95
|
|
96
96
|
def error_message
|
97
97
|
"promised or expected keys cannot be a " \
|
98
|
-
|
98
|
+
"reserved key: [#{format_keys(violated_keys)}]"
|
99
99
|
end
|
100
100
|
|
101
101
|
def keys
|