decouplio 1.0.0alpha

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 (136) hide show
  1. checksums.yaml +7 -0
  2. data/.circleci/config.yml +53 -0
  3. data/.dockerignore +12 -0
  4. data/.gitignore +13 -0
  5. data/.rspec +3 -0
  6. data/.rubocop.yml +106 -0
  7. data/.rubocop_todo.yml +147 -0
  8. data/.ruby-version +1 -0
  9. data/.vscode/settings.json +3 -0
  10. data/Dockerfile +12 -0
  11. data/Gemfile +8 -0
  12. data/LICENSE +21 -0
  13. data/LICENSE.txt +21 -0
  14. data/README.md +29 -0
  15. data/Rakefile +8 -0
  16. data/benchmarks/.ruby-version +1 -0
  17. data/benchmarks/Dockerfile +12 -0
  18. data/benchmarks/Gemfile +11 -0
  19. data/benchmarks/benchmarks.rb +527 -0
  20. data/bin/console +15 -0
  21. data/bin/setup +8 -0
  22. data/decouplio.gemspec +40 -0
  23. data/docker-compose.yml +18 -0
  24. data/docs/_config.yml +1 -0
  25. data/docs/benchmarks.md +1 -0
  26. data/docs/context.md +74 -0
  27. data/docs/context.rb +62 -0
  28. data/docs/doby.md +80 -0
  29. data/docs/doby.rb +38 -0
  30. data/docs/error_store.md +347 -0
  31. data/docs/error_store.rb +202 -0
  32. data/docs/fail.md +1016 -0
  33. data/docs/fail.rb +762 -0
  34. data/docs/index.md +25 -0
  35. data/docs/inner_action.md +63 -0
  36. data/docs/inner_action.rb +43 -0
  37. data/docs/logic_block.md +25 -0
  38. data/docs/octo.md +269 -0
  39. data/docs/octo.rb +164 -0
  40. data/docs/pass.md +309 -0
  41. data/docs/pass.rb +213 -0
  42. data/docs/quick_start.md +71 -0
  43. data/docs/quick_start.rb +38 -0
  44. data/docs/resq.md +263 -0
  45. data/docs/resq.rb +176 -0
  46. data/docs/step.md +737 -0
  47. data/docs/step.rb +526 -0
  48. data/docs/step_as_a_service.md +109 -0
  49. data/docs/step_as_a_service.rb +77 -0
  50. data/docs/wrap.md +232 -0
  51. data/docs/wrap.rb +137 -0
  52. data/lib/decouplio/action.rb +111 -0
  53. data/lib/decouplio/composer.rb +599 -0
  54. data/lib/decouplio/const/colors.rb +25 -0
  55. data/lib/decouplio/const/reserved_methods.rb +18 -0
  56. data/lib/decouplio/const/results.rb +13 -0
  57. data/lib/decouplio/const/types.rb +173 -0
  58. data/lib/decouplio/const/validations/action_option_class.rb +17 -0
  59. data/lib/decouplio/const/validations/common.rb +14 -0
  60. data/lib/decouplio/const/validations/fail.rb +34 -0
  61. data/lib/decouplio/const/validations/logic.rb +15 -0
  62. data/lib/decouplio/const/validations/octo.rb +44 -0
  63. data/lib/decouplio/const/validations/palp.rb +20 -0
  64. data/lib/decouplio/const/validations/pass.rb +32 -0
  65. data/lib/decouplio/const/validations/resq.rb +67 -0
  66. data/lib/decouplio/const/validations/step.rb +35 -0
  67. data/lib/decouplio/const/validations/wrap.rb +41 -0
  68. data/lib/decouplio/default_error_handler.rb +24 -0
  69. data/lib/decouplio/errors/action_class_error.rb +26 -0
  70. data/lib/decouplio/errors/base_error.rb +30 -0
  71. data/lib/decouplio/errors/error_store_error.rb +17 -0
  72. data/lib/decouplio/errors/extra_key_for_fail_error.rb +26 -0
  73. data/lib/decouplio/errors/extra_key_for_octo_error.rb +26 -0
  74. data/lib/decouplio/errors/extra_key_for_pass_error.rb +26 -0
  75. data/lib/decouplio/errors/extra_key_for_resq_error.rb +29 -0
  76. data/lib/decouplio/errors/extra_key_for_step_error.rb +23 -0
  77. data/lib/decouplio/errors/extra_key_for_wrap_error.rb +23 -0
  78. data/lib/decouplio/errors/fail_controversial_keys_error.rb +26 -0
  79. data/lib/decouplio/errors/fail_finish_him_error.rb +26 -0
  80. data/lib/decouplio/errors/fail_is_first_step_error.rb +18 -0
  81. data/lib/decouplio/errors/invalid_error_class_error.rb +29 -0
  82. data/lib/decouplio/errors/invalid_wrap_name_error.rb +23 -0
  83. data/lib/decouplio/errors/logic_is_not_defined_error.rb +23 -0
  84. data/lib/decouplio/errors/logic_redefinition_error.rb +23 -0
  85. data/lib/decouplio/errors/octo_block_is_not_defined_error.rb +18 -0
  86. data/lib/decouplio/errors/octo_controversial_keys_error.rb +26 -0
  87. data/lib/decouplio/errors/options_validation_error.rb +7 -0
  88. data/lib/decouplio/errors/palp_block_is_not_defined_error.rb +18 -0
  89. data/lib/decouplio/errors/palp_is_not_defined_error.rb +26 -0
  90. data/lib/decouplio/errors/palp_validation_error.rb +21 -0
  91. data/lib/decouplio/errors/pass_controversial_keys_error.rb +26 -0
  92. data/lib/decouplio/errors/pass_finish_him_error.rb +26 -0
  93. data/lib/decouplio/errors/required_options_is_missing_for_octo_error.rb +25 -0
  94. data/lib/decouplio/errors/resq_definition_error.rb +21 -0
  95. data/lib/decouplio/errors/resq_error_class_error.rb +29 -0
  96. data/lib/decouplio/errors/resq_handler_method_error.rb +26 -0
  97. data/lib/decouplio/errors/step_controversial_keys_error.rb +26 -0
  98. data/lib/decouplio/errors/step_finish_him_error.rb +26 -0
  99. data/lib/decouplio/errors/step_is_not_defined_for_fail_error.rb +26 -0
  100. data/lib/decouplio/errors/step_is_not_defined_for_step_error.rb +27 -0
  101. data/lib/decouplio/errors/step_is_not_defined_for_wrap_error.rb +26 -0
  102. data/lib/decouplio/errors/step_name_error.rb +20 -0
  103. data/lib/decouplio/errors/wrap_block_is_not_defined_error.rb +18 -0
  104. data/lib/decouplio/errors/wrap_controversial_keys_error.rb +26 -0
  105. data/lib/decouplio/errors/wrap_finish_him_error.rb +26 -0
  106. data/lib/decouplio/errors/wrap_klass_method_error.rb +23 -0
  107. data/lib/decouplio/flow.rb +17 -0
  108. data/lib/decouplio/logic_dsl.rb +96 -0
  109. data/lib/decouplio/octo_hash_case.rb +31 -0
  110. data/lib/decouplio/octo_options_validator.rb +89 -0
  111. data/lib/decouplio/options_validator.rb +566 -0
  112. data/lib/decouplio/processor.rb +20 -0
  113. data/lib/decouplio/steps/base_resq.rb +31 -0
  114. data/lib/decouplio/steps/base_step.rb +16 -0
  115. data/lib/decouplio/steps/doby.rb +32 -0
  116. data/lib/decouplio/steps/fail.rb +50 -0
  117. data/lib/decouplio/steps/if_condition_fail.rb +28 -0
  118. data/lib/decouplio/steps/if_condition_pass.rb +26 -0
  119. data/lib/decouplio/steps/inner_action_fail.rb +55 -0
  120. data/lib/decouplio/steps/inner_action_pass.rb +38 -0
  121. data/lib/decouplio/steps/inner_action_step.rb +51 -0
  122. data/lib/decouplio/steps/octo.rb +22 -0
  123. data/lib/decouplio/steps/pass.rb +35 -0
  124. data/lib/decouplio/steps/resq_fail.rb +10 -0
  125. data/lib/decouplio/steps/resq_pass.rb +10 -0
  126. data/lib/decouplio/steps/service_fail.rb +51 -0
  127. data/lib/decouplio/steps/service_pass.rb +36 -0
  128. data/lib/decouplio/steps/service_step.rb +47 -0
  129. data/lib/decouplio/steps/step.rb +43 -0
  130. data/lib/decouplio/steps/unless_condition_fail.rb +28 -0
  131. data/lib/decouplio/steps/unless_condition_pass.rb +26 -0
  132. data/lib/decouplio/steps/wrap.rb +62 -0
  133. data/lib/decouplio/validators/condition.rb +49 -0
  134. data/lib/decouplio/version.rb +5 -0
  135. data/lib/decouplio.rb +7 -0
  136. metadata +266 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: afefc75848ee14208adf083e6b83fc8e2427f55632228aa473ea2d3d408b4eb7
4
+ data.tar.gz: 78d7a9cd4707a737349f2c1d2cfde11ba556f53099ae7d1af2059d212e340fc6
5
+ SHA512:
6
+ metadata.gz: c4e97739d4fd9da01f4d73b8e0c41131c9799e3e538f1acf76d2b7b5784ee6a9929bac2d813c4233ad11f91ad583b8c5af44118287e28c60db176e10b25ee930
7
+ data.tar.gz: 709c075259f47063a2ea0751ab1bdc6d7ad39d35b57650da5ace8c30c6992300c67229e446f784686f61fc32c64db75c03812dbba8f677487dfb6bd498003684
@@ -0,0 +1,53 @@
1
+ version: 2.1
2
+
3
+ executors:
4
+ test_executor:
5
+ docker:
6
+ - image: circleci/ruby:${RUBY_VERSION}
7
+ working_directory: ~/decouplio
8
+
9
+ jobs:
10
+ build:
11
+ environment:
12
+ RUBY_VERSION: << parameters.ruby_version >>
13
+ working_directory: ~/decouplio
14
+ executor: test_executor
15
+ parameters:
16
+ ruby_version:
17
+ type: string
18
+ bundler_version:
19
+ type: string
20
+ steps:
21
+ - checkout
22
+
23
+ - run:
24
+ name: Install bundler
25
+ command: gem install bundler:<< parameters.bundler_version >>
26
+
27
+ - run:
28
+ name: Install dependencies
29
+ command: bundle check --path=vendor/bundle || bundle install --path=vendor/bundle --jobs 4 --retry 3
30
+
31
+ - run:
32
+ name: Run Rubocop
33
+ command: bundle exec rubocop -P
34
+
35
+ - run:
36
+ name: Run Tests
37
+ command: bundle exec rspec
38
+
39
+ workflows:
40
+ build_and_test:
41
+ jobs:
42
+ - build:
43
+ name: 'ruby 2.7.0'
44
+ ruby_version: 2.7.0
45
+ bundler_version: 2.1.4
46
+ - build:
47
+ name: 'ruby 2.7.5'
48
+ ruby_version: 2.7.5
49
+ bundler_version: 2.1.4
50
+ - build:
51
+ name: 'ruby 3.0.3'
52
+ ruby_version: 3.0.3
53
+ bundler_version: 2.2.32
data/.dockerignore ADDED
@@ -0,0 +1,12 @@
1
+ .circleci
2
+ .vscode
3
+ examples
4
+ vendor
5
+
6
+ .rspec_status
7
+ .rubocop_todo.yml
8
+ .ruby-version
9
+ .travis.yml
10
+ LICENSE
11
+ LICENSE.txt
12
+ README.md
data/.gitignore ADDED
@@ -0,0 +1,13 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
12
+ .ruby-gemset
13
+ Gemfile.lock
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,106 @@
1
+ inherit_from: .rubocop_todo.yml
2
+
3
+ require: rubocop-rspec
4
+
5
+ AllCops:
6
+ NewCops: enable
7
+ SuggestExtensions: false
8
+ Exclude:
9
+ - 'decouplio.gemspec'
10
+ - vendor/**/*
11
+ - docs/**/*
12
+
13
+ Style/Documentation:
14
+ Enabled: false
15
+
16
+ Style/SignalException:
17
+ Enabled: false
18
+
19
+ Layout/LineLength:
20
+ Max: 120
21
+
22
+ Lint/Void:
23
+ Exclude:
24
+ - spec/support/matchers/error_matcher.rb
25
+
26
+ Lint/UnusedBlockArgument:
27
+ Exclude:
28
+ - spec/support/matchers/error_matcher.rb
29
+ - spec/support/matchers/decouplio_action_matcher.rb
30
+
31
+ Lint/NestedMethodDefinition:
32
+ Exclude:
33
+ - spec/**/*
34
+
35
+ Lint/UnreachableCode:
36
+ Exclude:
37
+ - spec/**/*
38
+
39
+ Style/FrozenStringLiteralComment:
40
+ Enabled: true
41
+
42
+ Metrics/BlockLength:
43
+ IgnoredMethods: ['describe','context', 'lambda', 'logic', 'define', 'it', 'let']
44
+
45
+ Metrics/ModuleLength:
46
+ Exclude:
47
+ - lib/decouplio/const/types.rb
48
+ - spec/**/*
49
+
50
+ Lint/NonLocalExitFromIterator:
51
+ Exclude:
52
+ - spec/support/matchers/error_matcher.rb
53
+
54
+ Metrics/MethodLength:
55
+ Exclude:
56
+ - spec/**/*
57
+
58
+ RSpec/DescribeClass:
59
+ Enabled: false
60
+
61
+ RSpec/NestedGroups:
62
+ Max: 10
63
+
64
+ Lint/EmptyBlock:
65
+ Exclude:
66
+ - spec/action_logic_block_spec.rb
67
+ - spec/fail_spec.rb
68
+ - spec/palp_block_spec.rb
69
+ - spec/wrap_block_spec.rb
70
+ - spec/support/cases/octo_cases_palps.rb
71
+
72
+ Lint/ConstantDefinitionInBlock:
73
+ Exclude:
74
+ - spec/action_logic_block_spec.rb
75
+ - spec/fail_spec.rb
76
+ - spec/palp_block_spec.rb
77
+ - spec/wrap_block_spec.rb
78
+ - spec/error_store_for_inner_step_spec.rb
79
+
80
+ RSpec/LeakyConstantDeclaration:
81
+ Exclude:
82
+ - spec/action_logic_block_spec.rb
83
+ - spec/fail_spec.rb
84
+ - spec/palp_block_spec.rb
85
+ - spec/wrap_block_spec.rb
86
+ - spec/error_store_for_inner_step_spec.rb
87
+
88
+ RSpec/FilePath:
89
+ Exclude:
90
+ - spec/default_error_handler_spec.rb
91
+
92
+ RSpec/ExampleLength:
93
+ Max: 15
94
+ Exclude:
95
+ - spec/default_error_handler_spec.rb
96
+
97
+ RSpec/MultipleExpectations:
98
+ Enabled: false
99
+
100
+ RSpec/MultipleMemoizedHelpers:
101
+ Exclude:
102
+ - spec/**/*
103
+
104
+ Naming/PredicateName:
105
+ Exclude:
106
+ - lib/decouplio/step.rb
data/.rubocop_todo.yml ADDED
@@ -0,0 +1,147 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2022-04-06 20:52:30 UTC using RuboCop version 1.26.1.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 4
10
+ Lint/MissingSuper:
11
+ Exclude:
12
+ - 'lib/decouplio/action.rb'
13
+ - 'lib/decouplio/errors/undefined_step_method_error.rb'
14
+ - 'lib/decouplio/logic_dsl.rb'
15
+ - 'lib/decouplio/strategy_hash_case.rb'
16
+
17
+ # Offense count: 1
18
+ # This cop supports safe auto-correction (--auto-correct).
19
+ # Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods.
20
+ Lint/UnusedMethodArgument:
21
+ Exclude:
22
+ - 'lib/decouplio/action.rb'
23
+
24
+ # Offense count: 4
25
+ # This cop supports unsafe auto-correction (--auto-correct-all).
26
+ Lint/UselessSetterCall:
27
+ Exclude:
28
+ - 'benchmarks/benchmark_active_interaction_vs_decouplio.rb'
29
+ - 'benchmarks/benchmark_mutations_vs_decouplio.rb'
30
+ - 'benchmarks/benchmarks.rb'
31
+
32
+ # Offense count: 30
33
+ # Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
34
+ Metrics/AbcSize:
35
+ Max: 111
36
+
37
+ # Offense count: 2
38
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
39
+ # IgnoredMethods: refine
40
+ Metrics/BlockLength:
41
+ Max: 42
42
+
43
+ # Offense count: 4
44
+ # Configuration parameters: CountComments, CountAsOne.
45
+ Metrics/ClassLength:
46
+ Max: 798
47
+
48
+ # Offense count: 7
49
+ # Configuration parameters: IgnoredMethods.
50
+ Metrics/CyclomaticComplexity:
51
+ Max: 25
52
+
53
+ # Offense count: 46
54
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
55
+ Metrics/MethodLength:
56
+ Max: 44
57
+
58
+ # Offense count: 3
59
+ # Configuration parameters: CountKeywordArgs, MaxOptionalParameters.
60
+ Metrics/ParameterLists:
61
+ Max: 15
62
+
63
+ # Offense count: 7
64
+ # Configuration parameters: IgnoredMethods.
65
+ Metrics/PerceivedComplexity:
66
+ Max: 27
67
+
68
+ # Offense count: 81
69
+ # Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers.
70
+ # SupportedStyles: snake_case, normalcase, non_integer
71
+ # AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339
72
+ Naming/VariableNumber:
73
+ Exclude:
74
+ - 'spec/resq_spec.rb'
75
+ - 'spec/octo_palps_spec.rb'
76
+ - 'spec/strategy_step_spec.rb'
77
+ - 'spec/support/cases/resq_cases.rb'
78
+ - 'spec/support/cases/strategy_cases_palps.rb'
79
+ - 'spec/support/cases/strategy_cases_steps.rb'
80
+
81
+ # Offense count: 139
82
+ # Configuration parameters: AllowSubject.
83
+ RSpec/MultipleMemoizedHelpers:
84
+ Max: 15
85
+
86
+ # Offense count: 3
87
+ # This cop supports safe auto-correction (--auto-correct).
88
+ # Configuration parameters: EnforcedStyle.
89
+ # SupportedStyles: empty, nil, both
90
+ Style/EmptyElse:
91
+ Exclude:
92
+ - 'lib/decouplio/action.rb'
93
+ - 'lib/decouplio/logic_dsl.rb'
94
+
95
+ # Offense count: 18
96
+ # Configuration parameters: MinBodyLength.
97
+ Style/GuardClause:
98
+ Exclude:
99
+ - 'lib/decouplio/logic_composer.rb'
100
+ - 'lib/decouplio/options_validator.rb'
101
+
102
+ # Offense count: 1
103
+ # This cop supports unsafe auto-correction (--auto-correct-all).
104
+ Style/HashTransformValues:
105
+ Exclude:
106
+ - 'lib/decouplio/logic_composer.rb'
107
+
108
+ # Offense count: 7
109
+ # This cop supports safe auto-correction (--auto-correct).
110
+ Style/KeywordParametersOrder:
111
+ Exclude:
112
+ - 'lib/decouplio/action.rb'
113
+ - 'lib/decouplio/step.rb'
114
+
115
+ # Offense count: 2
116
+ # This cop supports unsafe auto-correction (--auto-correct-all).
117
+ Style/MapToHash:
118
+ Exclude:
119
+ - 'lib/decouplio/logic_composer.rb'
120
+ - 'lib/decouplio/logic_container.rb'
121
+
122
+ # Offense count: 5
123
+ # This cop supports unsafe auto-correction (--auto-correct-all).
124
+ Style/SingleArgumentDig:
125
+ Exclude:
126
+ - 'lib/decouplio/options_validator.rb'
127
+
128
+ # Offense count: 4
129
+ # This cop supports unsafe auto-correction (--auto-correct-all).
130
+ Style/SlicingWithRange:
131
+ Exclude:
132
+ - 'lib/decouplio/logic_composer.rb'
133
+
134
+ # Offense count: 1
135
+ # This cop supports unsafe auto-correction (--auto-correct-all).
136
+ # Configuration parameters: Mode.
137
+ Style/StringConcatenation:
138
+ Exclude:
139
+ - 'spec/spec_helper.rb'
140
+
141
+ # Offense count: 1
142
+ # This cop supports unsafe auto-correction (--auto-correct-all).
143
+ # Configuration parameters: AllowMethodsWithArguments, IgnoredMethods.
144
+ # IgnoredMethods: respond_to, define_method
145
+ Style/SymbolProc:
146
+ Exclude:
147
+ - 'lib/decouplio/logic_composer.rb'
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.7.0
@@ -0,0 +1,3 @@
1
+ {
2
+ "editor.tabSize": 2
3
+ }
data/Dockerfile ADDED
@@ -0,0 +1,12 @@
1
+ ARG RUBY_VERSION=2.7.0
2
+
3
+ FROM ruby:${RUBY_VERSION}-slim
4
+
5
+ RUN apt-get update
6
+ RUN apt-get install -y git make gcc
7
+
8
+ COPY . /decouplio
9
+
10
+ WORKDIR /decouplio
11
+
12
+ RUN bundle check || bundle install
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
6
+
7
+ # Specify your gem's dependencies in decouplio.gemspec
8
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2019 differencialx
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 all
13
+ 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 THE
21
+ SOFTWARE.
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2019 Alex Bal
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.
data/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # Decouplio
2
+
3
+ Decouplio is a zero dependency, thread safe and framework agnostic gem designed to encapsulate application business logic. It's reverse engineered through TDD and inspired by such frameworks and gems like Trailblazer, Interactor.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'decouplio'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install decouplio
20
+
21
+ # [>>>>>>>DOCS HERE<<<<<<<](https://github.com/differencialx/decouplio/blob/master/docs/index.md)
22
+
23
+ ## Contributing
24
+
25
+ Bug reports and pull requests are welcome on GitHub at https://github.com/differencialx/decouplio.
26
+
27
+ ## License
28
+
29
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/gem_tasks'
4
+ require 'rspec/core/rake_task'
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ task default: :spec
@@ -0,0 +1 @@
1
+ 2.7.0
@@ -0,0 +1,12 @@
1
+ ARG RUBY_VERSION=2.7.0
2
+
3
+ FROM ruby:${RUBY_VERSION}-slim
4
+
5
+ RUN apt-get update
6
+ RUN apt-get install -y git make gcc
7
+
8
+ COPY . /decouplio
9
+
10
+ WORKDIR /decouplio/benchmarks
11
+
12
+ RUN bundle check || bundle install
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ gem 'active_interaction', '~> 4.1'
6
+ gem 'decouplio', path: '../'
7
+ gem 'interactor', '~> 3.0'
8
+ gem 'mutations'
9
+ gem 'pry-byebug'
10
+ gem 'ruby-prof'
11
+ gem 'trailblazer', '~> 2.1'