functional-light-service 0.3.4 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- 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 +5 -5
- data/Appraisals +2 -2
- data/CHANGELOG.md +48 -0
- data/Gemfile +2 -2
- data/README.md +3 -1
- data/VERSION +1 -1
- data/functional-light-service.gemspec +14 -8
- data/gemfiles/dry_inflector_0_2_1.gemfile +5 -0
- data/gemfiles/i18n_1_8_11.gemfile +5 -0
- data/lib/functional-light-service/context/key_verifier.rb +2 -2
- data/lib/functional-light-service/context.rb +152 -154
- data/lib/functional-light-service/functional/enum.rb +2 -6
- 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 +2 -2
- data/lib/functional-light-service/organizer/with_reducer_log_decorator.rb +2 -2
- data/lib/functional-light-service/testing/context_factory.rb +2 -0
- data/lib/functional-light-service/version.rb +1 -1
- data/spec/acceptance/fail_spec.rb +42 -16
- 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 -8
- data/spec/test_doubles.rb +21 -9
- metadata +107 -25
- data/gemfiles/dry_inflector_0_2.gemfile +0 -8
- data/gemfiles/i18n_1_8.gemfile +0 -8
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,9 +4,9 @@ env:
|
|
4
4
|
- RUN_COVERAGE_REPORT=true
|
5
5
|
|
6
6
|
rvm:
|
7
|
-
- 2.
|
8
|
-
- 2.
|
9
|
-
-
|
7
|
+
- 2.6.6
|
8
|
+
- 2.7.2
|
9
|
+
- 3.0.0
|
10
10
|
|
11
11
|
before_install:
|
12
12
|
- 'echo ''gem: --no-ri --no-rdoc'' > ~/.gemrc'
|
@@ -20,5 +20,5 @@ script:
|
|
20
20
|
- bundle exec rubocop
|
21
21
|
|
22
22
|
gemfile:
|
23
|
-
- gemfiles/
|
24
|
-
- 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 "dry-inflector-0.2.
|
2
|
-
gem "dry-inflector", "~> 0.2.
|
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,51 @@
|
|
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
|
+
|
1
49
|
## 0.3.4 (2021-12-15)
|
2
50
|
|
3
51
|
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
# FunctionalLightService
|
2
2
|
[![Gem Version](https://img.shields.io/gem/v/functional-light-service.svg)](https://rubygems.org/gems/functional-light-service)
|
3
|
-
[![
|
3
|
+
[![CI Tests](https://github.com/sphynx79/functional-light-service/actions/workflows/project-build.yml/badge.svg)](https://github.com/sphynx79/functional-light-service/actions/workflows/project-build.yml)
|
4
|
+
[![Codecov](https://codecov.io/gh/sphynx79/functional-light-service/branch/master/graph/badge.svg)](https://app.codecov.io/gh/sphynx79/functional-light-service)
|
4
5
|
[![License](https://img.shields.io/badge/license-MIT-green.svg)](http://opensource.org/licenses/MIT)
|
6
|
+
[![Download Count](https://ruby-gem-downloads-badge.herokuapp.com/functional-light-service?type=total)](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,14 +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
|
-
gem.
|
20
|
-
gem.
|
20
|
+
gem.add_runtime_dependency("dry-inflector", "~> 0.2", ">= 0.2.1")
|
21
|
+
gem.add_runtime_dependency("i18n", "~> 1.8", ">= 1.8.11")
|
21
22
|
|
22
|
-
|
23
|
-
gem.add_development_dependency("
|
24
|
-
gem.add_development_dependency("
|
25
|
-
gem.add_development_dependency("
|
26
|
-
gem.add_development_dependency("
|
27
|
-
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")
|
28
34
|
end
|
@@ -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
|