functional-light-service 0.3.4 → 0.5.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.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/project-build.yml +47 -0
  3. data/.rubocop.yml +103 -15
  4. data/.solargraph.yml +11 -0
  5. data/Appraisals +6 -2
  6. data/CHANGELOG.md +128 -0
  7. data/Gemfile +1 -3
  8. data/README.md +1492 -1424
  9. data/Rakefile +1 -1
  10. data/VERSION +1 -1
  11. data/functional-light-service.gemspec +19 -8
  12. data/gemfiles/dry_inflector_0_2_1.gemfile +5 -0
  13. data/gemfiles/i18n_1_8_11.gemfile +5 -0
  14. data/lib/functional-light-service/context/key_verifier.rb +2 -2
  15. data/lib/functional-light-service/context.rb +152 -154
  16. data/lib/functional-light-service/functional/enum.rb +2 -6
  17. data/lib/functional-light-service/functional/maybe.rb +1 -0
  18. data/lib/functional-light-service/functional/null.rb +1 -1
  19. data/lib/functional-light-service/functional/option.rb +0 -2
  20. data/lib/functional-light-service/functional/result.rb +2 -2
  21. data/lib/functional-light-service/organizer/with_reducer.rb +6 -0
  22. data/lib/functional-light-service/organizer/with_reducer_factory.rb +1 -1
  23. data/lib/functional-light-service/organizer/with_reducer_log_decorator.rb +5 -2
  24. data/lib/functional-light-service/organizer.rb +10 -0
  25. data/lib/functional-light-service/testing/context_factory.rb +2 -0
  26. data/lib/functional-light-service/version.rb +1 -1
  27. data/spec/acceptance/fail_spec.rb +42 -16
  28. data/spec/acceptance/organizer/add_aliases_spec.rb +28 -0
  29. data/spec/acceptance/organizer/add_to_context_spec.rb +30 -0
  30. data/spec/acceptance/organizer/iterate_spec.rb +7 -0
  31. data/spec/acceptance/organizer/reduce_if_spec.rb +38 -0
  32. data/spec/acceptance/organizer/reduce_until_spec.rb +6 -0
  33. data/spec/action_spec.rb +8 -0
  34. data/spec/context/inspect_spec.rb +6 -21
  35. data/spec/context_spec.rb +1 -1
  36. data/spec/lib/deterministic/monad_axioms.rb +2 -0
  37. data/spec/lib/deterministic/monad_spec.rb +2 -0
  38. data/spec/lib/deterministic/null_spec.rb +2 -0
  39. data/spec/lib/deterministic/option_spec.rb +18 -14
  40. data/spec/lib/enum_spec.rb +3 -1
  41. data/spec/organizer_spec.rb +21 -0
  42. data/spec/sample/looks_up_tax_percentage_action_spec.rb +3 -1
  43. data/spec/sample/provides_free_shipping_action_spec.rb +1 -1
  44. data/spec/spec_helper.rb +8 -5
  45. data/spec/test_doubles.rb +56 -9
  46. metadata +156 -26
  47. data/.travis.yml +0 -24
  48. data/gemfiles/dry_inflector_0_2.gemfile +0 -8
  49. data/gemfiles/i18n_1_8.gemfile +0 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cbd6d85820481b017787b786621b2ec4ea950a25441943178ca63ff6d1e8df09
4
- data.tar.gz: abef7ed68f213011a17d8a063e1feb56a10ac215a54e9ff5c53da1b43ca8018c
3
+ metadata.gz: 414c6227c90e74daa910411118172e82f1d10078f9cd5f86596b5e3618580016
4
+ data.tar.gz: 7780ccf972ab6b1ed15e746d5b5011fe4aeb605418406c839a976937c9a056ee
5
5
  SHA512:
6
- metadata.gz: 47ea3d6474cb79479ba662f046163df649085ebb0038308b538b733531cc34fc0ba830cb789b13e0a776269ac82063dfdec916c6a3bba659c36fec2da2a9eeda
7
- data.tar.gz: fddb927ea9f7b4ba30484093dd50966137fcb8639d6558fdde4d156e41a0e42cc37f4c1bfeb951ee99b4e10631c270fe5f16f438ae047bbf780426c9d26822f7
6
+ metadata.gz: 7df8560f4f03d7d457f51222e17eaf371a412ee73ff91f74265c25d71595b1b4367646a9655ffaed7fa1df4494e34a80f512a82c1cfb2f36c3ea61eb3f426f67
7
+ data.tar.gz: d1280e2f293a994cb4ce41b00bea1cb9065fd0107e9f3178a05c6f3b22b05d380223ef95daa65ca1a3041f43f593916bf38393432f6daf786f925a92ebed8aa0
@@ -0,0 +1,47 @@
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
+ env:
33
+ RUN_COVERAGE_REPORT: true
34
+ steps:
35
+ - uses: actions/checkout@v4
36
+ - uses: ruby/setup-ruby@v1
37
+ with:
38
+ ruby-version: 3.0.2
39
+ - run: bundle install --jobs 4 --retry 3
40
+ - run: bundle exec rspec spec
41
+ - uses: codecov/codecov-action@v5
42
+ with:
43
+ token: ${{ secrets.CODECOV_TOKEN }}
44
+ files: ./coverage/coverage.xml # optional
45
+ flags: unittests # optional
46
+ name: codecov-simplecov # optional
47
+ 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
- TargetRubyVersion: 2.6
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/UncommunicativeMethodParamName:
64
+ Naming/MethodParameterName:
64
65
  Enabled: false
65
66
 
66
- Style/Alias:
67
+ Layout/TrailingEmptyLines:
67
68
  Enabled: false
68
69
 
69
- Style/MissingRespondToMissing:
70
- Enabled: false
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
@@ -0,0 +1,11 @@
1
+ ---
2
+ include:
3
+ - "**/*.rb"
4
+ exclude:
5
+ - resources/**/*
6
+ - coverage/**/*
7
+ - spec/**/*
8
+ domains: []
9
+ reporters:
10
+ - rubocop
11
+ max_files: 5000
data/Appraisals CHANGED
@@ -1,3 +1,7 @@
1
- appraise "dry-inflector-0.2.0" do
2
- gem "dry-inflector", "~> 0.2.0"
1
+ appraise "dry-inflector-0.2.1" do
2
+ gem "dry-inflector", "~> 0.2.1"
3
+ end
4
+
5
+ appraise "i18n-1.8.11" do
6
+ gem "i18n", "~> 1.8.11"
3
7
  end
data/CHANGELOG.md CHANGED
@@ -1,3 +1,131 @@
1
+ ## 0.5.4 (2026-07-03)
2
+ ### Fixed
3
+ - Blocca rexml < 3.3 per compatibilita con simplecov-cobertura 2.1.0 (fix CI Codecov: Malformed XML No root element) ( 2026-07-03 ) [ sphynx79]
4
+
5
+
6
+ ## 0.5.3 (2026-07-03)
7
+ ### Changed
8
+ - Aggiornato il badge Download Count da herokuapp (dismesso) a shields.io ( 2026-07-03 ) [ sphynx79]
9
+ - Riformattato il README: normalizzazione markdown e line-ending ( 2026-07-03 ) [ sphynx79]
10
+
11
+
12
+ ## 0.5.2 (2022-01-30)
13
+ ### Fixed
14
+ - Risoltro problema codecov upload perche non avevo settato il token ( 2025-05-16 ) [ sphynx79]
15
+
16
+
17
+ ## 0.5.1 (2022-01-30)
18
+ ### Removed
19
+ - Rimuove supporto Travis CI, migrazione completa a GitHub Actions ( 2025-05-16 ) [ sphynx79]
20
+
21
+ ## 0.5.0 (2022-01-30)
22
+ ### GitHub
23
+ - Aggiunto variabile RUN_COVERAGE_REPORT per eseguire il coverage solo nelle azioni di github ( 2022-01-30 ) [ sphynx79]
24
+
25
+ ### Github
26
+ - Aggiornato il sistema per fare l'upload del coverage in https://docs.codecov.com/ nelle action di github ( 2022-01-30 ) [ sphynx79]
27
+
28
+ ### Test
29
+ - organized_by with TestReduceIf organizer ( 2022-01-30 ) [ sphynx79]
30
+ - amend expectation titles to be clearer ( 2022-01-30 ) [ sphynx79]
31
+ - ensure that ctx.organized_by returns correct values ( 2022-01-30 ) [ sphynx79]
32
+
33
+ ### Style
34
+ - sistemato per rubocop 2 allinemaenti parametri keyword ( 2022-01-30 ) [ sphynx79]
35
+
36
+ ### Doc
37
+ - update README with notes about organized_by re: rollback ( 2022-01-30 ) [ sphynx79]
38
+
39
+ ### Added
40
+ - ensure organized_by attr is set on context when Organizer is used ( 2022-01-30 ) [ sphynx79]
41
+ - add `Context#organized_by` attr ( 2022-01-30 ) [ sphynx79]
42
+
43
+
44
+
45
+ ## 0.4.9 (2022-01-30)
46
+ ### Added
47
+ - Agginyo altri test per #add_to_context e #add_aliases e inserito nel README l'utilizzo di add_to_context ( 2022-01-30 ) [ sphynx79]
48
+
49
+ ### Changed
50
+ - migliorato spec per #add_aliases method ( 2022-01-30 ) [ sphynx79]
51
+ - migliorato la descrizione per spec add add_to_context method ( 2022-01-30 ) [ sphynx79]
52
+
53
+
54
+
55
+ ## 0.4.8 (2022-01-30)
56
+ ### Added
57
+ - Aggiuhnto il supporto per add_to_context and add_aliases organizer methods ( 2022-01-30 ) [ sphynx79]
58
+
59
+
60
+
61
+ ## 0.4.7 (2022-01-29)
62
+ ### Fixed
63
+ - sistemato il problema di rspec che mi dava un errore su un test ho dovuto fissare rspec-mocks alla versione 3.10.2 la 3.10.3 mi dava problemi ( 2022-01-29 ) [ sphynx79]
64
+
65
+
66
+
67
+ ## 0.4.6 (2022-01-29)
68
+ ### Fixed
69
+ - sistemato problema github action non trovava i gemfile rinominati ( 2022-01-29 ) [ sphynx79]
70
+
71
+
72
+
73
+ ## 0.4.5 (2022-01-29)
74
+ ### Fixed
75
+ - corretto il problema di spec che non passava i test option_spec match ( 2022-01-29 ) [ sphynx79]
76
+ - Aggiornato Appraisals per eseguire i test rspec e rubocop con diverse versione di i18n e dry_inflector ( 2022-01-28 ) [ sphynx79]
77
+ - Fix the spec description, order <=200 should not have free shipping ( 2022-01-27 ) [ sphynx79]
78
+
79
+
80
+
81
+ ## 0.4.4 (2022-01-27)
82
+ ### Updated
83
+ - Aggiornato la versione è sistemato problema upload codeconv ( 2022-01-27 ) [ sphynx79]
84
+
85
+
86
+
87
+ ## 0.4.3 (2022-01-27)
88
+ ### Added
89
+ - Aggiunto lo stato di codecov nel file readme ( 2022-01-27 ) [ sphynx79]
90
+
91
+
92
+
93
+ ## 0.4.2 (2022-01-27)
94
+ ### Fixed
95
+ - sistemato il path dove codeconv cerca il file del coverage ( 2022-01-27 ) [ sphynx79]
96
+
97
+
98
+
99
+ ## 0.4.1 (2022-01-27)
100
+ ### Added
101
+ - aggiunto supporto per codecov.com ( 2022-01-27 ) [ sphynx79]
102
+
103
+
104
+
105
+ ## 0.4.0 (2022-01-27)
106
+ ### Aupdated
107
+ - 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]
108
+
109
+
110
+
111
+ ## 0.3.9 (2022-01-26)
112
+
113
+
114
+ ## 0.3.8 (2022-01-26)
115
+ ### Added
116
+ - Aggiunto actions per fare i test in github ( 2022-01-26 ) [ sphynx79]
117
+
118
+
119
+
120
+ ## 0.3.7 (2022-01-26)
121
+
122
+
123
+ ## 0.3.6 (2022-01-26)
124
+
125
+
126
+ ## 0.3.5 (2022-01-26)
127
+
128
+
1
129
  ## 0.3.4 (2021-12-15)
2
130
 
3
131
 
data/Gemfile CHANGED
@@ -1,6 +1,4 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- # Specify your gem's dependencies in light_service.gemspec
3
+ # Specify your gem's dependencies in functional-light-service.gemspec
4
4
  gemspec
5
-
6
- gem 'appraisal', '~> 2.0'