substation 0.0.10.beta2 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (167) hide show
  1. data/.travis.yml +7 -3
  2. data/Changelog.md +99 -24
  3. data/Gemfile +8 -1
  4. data/Gemfile.devtools +37 -21
  5. data/Guardfile +1 -1
  6. data/README.md +118 -46
  7. data/TODO.md +1 -0
  8. data/config/flay.yml +2 -2
  9. data/config/flog.yml +1 -1
  10. data/config/reek.yml +41 -16
  11. data/config/rubocop.yml +44 -0
  12. data/config/yardstick.yml +1 -1
  13. data/lib/substation.rb +41 -5
  14. data/lib/substation/chain.rb +73 -84
  15. data/lib/substation/chain/definition.rb +147 -0
  16. data/lib/substation/chain/dsl.rb +150 -112
  17. data/lib/substation/chain/dsl/config.rb +55 -0
  18. data/lib/substation/chain/dsl/module_builder.rb +84 -0
  19. data/lib/substation/dispatcher.rb +20 -229
  20. data/lib/substation/dsl/guard.rb +96 -0
  21. data/lib/substation/dsl/registry.rb +181 -0
  22. data/lib/substation/environment.rb +126 -23
  23. data/lib/substation/environment/dsl.rb +31 -12
  24. data/lib/substation/processor.rb +238 -7
  25. data/lib/substation/processor/builder.rb +26 -0
  26. data/lib/substation/processor/config.rb +24 -0
  27. data/lib/substation/processor/evaluator.rb +66 -42
  28. data/lib/substation/processor/evaluator/handler.rb +54 -0
  29. data/lib/substation/processor/evaluator/result.rb +24 -0
  30. data/lib/substation/processor/executor.rb +46 -0
  31. data/lib/substation/processor/nest.rb +40 -0
  32. data/lib/substation/processor/transformer.rb +46 -0
  33. data/lib/substation/processor/wrapper.rb +16 -5
  34. data/lib/substation/request.rb +29 -27
  35. data/lib/substation/response.rb +19 -34
  36. data/lib/substation/response/api.rb +37 -0
  37. data/lib/substation/response/exception.rb +20 -0
  38. data/lib/substation/response/exception/output.rb +59 -0
  39. data/lib/substation/response/failure.rb +11 -0
  40. data/lib/substation/response/success.rb +11 -0
  41. data/lib/substation/version.rb +3 -1
  42. data/spec/demo/core.rb +64 -0
  43. data/spec/demo/core/action.rb +49 -0
  44. data/spec/demo/core/action/create_person.rb +28 -0
  45. data/spec/demo/core/errors.rb +16 -0
  46. data/spec/demo/core/facade.rb +38 -0
  47. data/spec/demo/core/handler.rb +21 -0
  48. data/spec/demo/core/handler/acceptor.rb +47 -0
  49. data/spec/demo/core/handler/authenticator.rb +36 -0
  50. data/spec/demo/core/handler/authorizer.rb +38 -0
  51. data/spec/demo/core/input.rb +15 -0
  52. data/spec/demo/core/observers.rb +10 -0
  53. data/spec/demo/core/validator.rb +21 -0
  54. data/spec/demo/domain/actor.rb +29 -0
  55. data/spec/demo/domain/dto/person.rb +18 -0
  56. data/spec/demo/domain/environment.rb +55 -0
  57. data/spec/demo/domain/storage.rb +49 -0
  58. data/spec/demo/web.rb +26 -0
  59. data/spec/demo/web/errors.rb +9 -0
  60. data/spec/demo/web/facade.rb +60 -0
  61. data/spec/demo/web/handler/deserializer.rb +36 -0
  62. data/spec/demo/web/presenter.rb +38 -0
  63. data/spec/demo/web/presenter/person.rb +19 -0
  64. data/spec/demo/web/renderer.rb +45 -0
  65. data/spec/demo/web/sanitizer.rb +35 -0
  66. data/spec/demo/web/sanitizer/person.rb +20 -0
  67. data/spec/demo/web/views.rb +28 -0
  68. data/spec/integration/demo/core_spec.rb +97 -0
  69. data/spec/integration/demo/web_spec.rb +114 -0
  70. data/spec/shared/context/integration/demo.rb +33 -0
  71. data/spec/shared/context/unit/chain.rb +13 -0
  72. data/spec/shared/context/unit/processor.rb +58 -0
  73. data/spec/shared/context/unit/request.rb +8 -0
  74. data/spec/shared/examples/integration/demo.rb +35 -0
  75. data/spec/shared/examples/unit/processor.rb +72 -0
  76. data/spec/spec_helper.rb +52 -23
  77. data/spec/unit/substation/chain/definition_spec.rb +141 -0
  78. data/spec/unit/substation/chain/dsl/config/dsl_module_spec.rb +13 -0
  79. data/spec/unit/substation/chain/dsl/config/registry_spec.rb +13 -0
  80. data/spec/unit/substation/chain/dsl/config_spec.rb +18 -0
  81. data/spec/unit/substation/chain/dsl/module_builder_spec.rb +77 -0
  82. data/spec/unit/substation/chain/dsl_spec.rb +175 -0
  83. data/spec/unit/substation/chain_spec.rb +303 -0
  84. data/spec/unit/substation/dispatcher_spec.rb +68 -0
  85. data/spec/unit/substation/dsl/guard_spec.rb +72 -0
  86. data/spec/unit/substation/dsl/registry_spec.rb +181 -0
  87. data/spec/unit/substation/environment/dsl_spec.rb +156 -0
  88. data/spec/unit/substation/environment_spec.rb +259 -0
  89. data/spec/unit/substation/processor/builder_spec.rb +21 -0
  90. data/spec/unit/substation/processor/config_spec.rb +40 -0
  91. data/spec/unit/substation/processor/evaluator/handler_spec.rb +20 -0
  92. data/spec/unit/substation/processor/evaluator/pivot_spec.rb +42 -0
  93. data/spec/unit/substation/processor/evaluator/request_spec.rb +11 -0
  94. data/spec/unit/substation/processor/evaluator/result/failure_spec.rb +14 -0
  95. data/spec/unit/substation/processor/evaluator/result/success_spec.rb +14 -0
  96. data/spec/unit/substation/processor/evaluator/result_spec.rb +13 -0
  97. data/spec/unit/substation/processor/evaluator_spec.rb +18 -0
  98. data/spec/unit/substation/processor/executor/null_spec.rb +25 -0
  99. data/spec/unit/substation/processor/executor_spec.rb +32 -0
  100. data/spec/unit/substation/processor/fallible_spec.rb +24 -0
  101. data/spec/unit/substation/processor/incoming_spec.rb +17 -0
  102. data/spec/unit/substation/processor/nest/incoming_spec.rb +56 -0
  103. data/spec/unit/substation/processor/nest_spec.rb +6 -0
  104. data/spec/unit/substation/processor/outgoing_spec.rb +47 -0
  105. data/spec/unit/substation/processor/transformer/incoming_spec.rb +17 -0
  106. data/spec/unit/substation/processor/transformer/outgoing_spec.rb +17 -0
  107. data/spec/unit/substation/processor/wrapper/incoming_spec.rb +15 -0
  108. data/spec/unit/substation/processor/wrapper/outgoing_spec.rb +15 -0
  109. data/spec/unit/substation/processor/wrapper_spec.rb +24 -0
  110. data/spec/unit/substation/processor_spec.rb +68 -0
  111. data/spec/unit/substation/request_spec.rb +70 -0
  112. data/spec/unit/substation/response/api_spec.rb +22 -0
  113. data/spec/unit/substation/response/exception/output_spec.rb +46 -0
  114. data/spec/unit/substation/response/exception_spec.rb +25 -0
  115. data/spec/unit/substation/response/failure_spec.rb +25 -0
  116. data/spec/unit/substation/response/success_spec.rb +24 -0
  117. data/spec/unit/substation/response_spec.rb +73 -0
  118. data/substation.gemspec +7 -6
  119. metadata +157 -67
  120. checksums.yaml +0 -7
  121. data/TODO +0 -0
  122. data/lib/substation/observer.rb +0 -66
  123. data/lib/substation/processor/pivot.rb +0 -25
  124. data/lib/substation/utils.rb +0 -68
  125. data/spec/integration/substation/dispatcher/call_spec.rb +0 -260
  126. data/spec/unit/substation/chain/call_spec.rb +0 -63
  127. data/spec/unit/substation/chain/dsl/builder/class_methods/call_spec.rb +0 -19
  128. data/spec/unit/substation/chain/dsl/builder/dsl_spec.rb +0 -21
  129. data/spec/unit/substation/chain/dsl/builder/failure_chain_spec.rb +0 -30
  130. data/spec/unit/substation/chain/dsl/chain_spec.rb +0 -15
  131. data/spec/unit/substation/chain/dsl/class_methods/processors_spec.rb +0 -24
  132. data/spec/unit/substation/chain/dsl/initialize_spec.rb +0 -19
  133. data/spec/unit/substation/chain/dsl/processors_spec.rb +0 -42
  134. data/spec/unit/substation/chain/dsl/use_spec.rb +0 -14
  135. data/spec/unit/substation/chain/each_spec.rb +0 -46
  136. data/spec/unit/substation/chain/incoming/result_spec.rb +0 -21
  137. data/spec/unit/substation/chain/outgoing/call_spec.rb +0 -25
  138. data/spec/unit/substation/chain/outgoing/result_spec.rb +0 -21
  139. data/spec/unit/substation/dispatcher/action/call_spec.rb +0 -23
  140. data/spec/unit/substation/dispatcher/action/class_methods/coerce_spec.rb +0 -61
  141. data/spec/unit/substation/dispatcher/action_names_spec.rb +0 -14
  142. data/spec/unit/substation/dispatcher/call_spec.rb +0 -47
  143. data/spec/unit/substation/dispatcher/class_methods/coerce_spec.rb +0 -20
  144. data/spec/unit/substation/environment/chain_spec.rb +0 -50
  145. data/spec/unit/substation/environment/class_methods/build_spec.rb +0 -11
  146. data/spec/unit/substation/environment/dsl/class_methods/registry_spec.rb +0 -18
  147. data/spec/unit/substation/environment/dsl/register_spec.rb +0 -14
  148. data/spec/unit/substation/environment/dsl/registry_spec.rb +0 -19
  149. data/spec/unit/substation/observer/chain/call_spec.rb +0 -26
  150. data/spec/unit/substation/observer/class_methods/coerce_spec.rb +0 -33
  151. data/spec/unit/substation/observer/null/call_spec.rb +0 -12
  152. data/spec/unit/substation/processor/evaluator/call_spec.rb +0 -49
  153. data/spec/unit/substation/processor/pivot/call_spec.rb +0 -17
  154. data/spec/unit/substation/processor/wrapper/call_spec.rb +0 -20
  155. data/spec/unit/substation/request/env_spec.rb +0 -14
  156. data/spec/unit/substation/request/error_spec.rb +0 -15
  157. data/spec/unit/substation/request/input_spec.rb +0 -14
  158. data/spec/unit/substation/request/success_spec.rb +0 -15
  159. data/spec/unit/substation/response/env_spec.rb +0 -16
  160. data/spec/unit/substation/response/failure/success_predicate_spec.rb +0 -15
  161. data/spec/unit/substation/response/input_spec.rb +0 -16
  162. data/spec/unit/substation/response/output_spec.rb +0 -16
  163. data/spec/unit/substation/response/request_spec.rb +0 -16
  164. data/spec/unit/substation/response/success/success_predicate_spec.rb +0 -15
  165. data/spec/unit/substation/utils/class_methods/coerce_callable_spec.rb +0 -46
  166. data/spec/unit/substation/utils/class_methods/const_get_spec.rb +0 -46
  167. data/spec/unit/substation/utils/class_methods/symbolize_keys_spec.rb +0 -20
@@ -0,0 +1,68 @@
1
+ # encoding: utf-8
2
+
3
+ require 'spec_helper'
4
+
5
+ describe Processor do
6
+ describe '#call' do
7
+
8
+ context 'when the processor is no evaluator' do
9
+ it_behaves_like 'Processor::Call::Incoming#call' do
10
+ before do
11
+ expect(handler).to receive(:call).with(decomposed).and_return(handler_result)
12
+ expect(observers).to receive(:each).with(no_args).and_yield(observer)
13
+ expect(observer).to receive(:call).with(handler_result)
14
+ end
15
+
16
+ let(:klass) {
17
+ Class.new {
18
+ include Processor::Incoming
19
+
20
+ def call(request)
21
+ request.success(execute(request))
22
+ end
23
+ }
24
+ }
25
+ end
26
+ end
27
+
28
+ # needed for rspec-dm2 to cover all processor ivars
29
+ context 'when the processor is an evaluator' do
30
+ it_behaves_like 'Processor::Evaluator#call' do
31
+ let(:klass) { Processor::Evaluator::Request }
32
+ end
33
+ end
34
+ end
35
+
36
+ describe '#result' do
37
+
38
+ subject { object.result(response) }
39
+
40
+ include_context 'Request#initialize'
41
+ include_context 'Processor#initialize'
42
+
43
+ let(:klass) { Class.new { include Substation::Processor } }
44
+ let(:response) { Response::Success.new(request, input) }
45
+
46
+ it { should be(response) }
47
+ end
48
+
49
+ describe '#success?' do
50
+ subject { object.success?(response) }
51
+
52
+ include_context 'Processor#initialize'
53
+
54
+ let(:klass) { Class.new { include Substation::Processor } }
55
+
56
+ context 'with a successful response' do
57
+ let(:response) { double(:success? => true) }
58
+
59
+ it { should be(true) }
60
+ end
61
+
62
+ context 'with a failure response' do
63
+ let(:response) { double(:success? => false) }
64
+
65
+ it { should be(false) }
66
+ end
67
+ end
68
+ end
@@ -0,0 +1,70 @@
1
+ # encoding: utf-8
2
+
3
+ require 'spec_helper'
4
+
5
+ describe Request do
6
+ describe '#env' do
7
+ subject { request.env }
8
+
9
+ include_context 'Request#initialize'
10
+
11
+ it { should be(env) }
12
+ end
13
+
14
+ describe '#error' do
15
+ subject { request.error(output) }
16
+
17
+ include_context 'Request#initialize'
18
+
19
+ let(:output) { double }
20
+
21
+ it { should eql(Response::Failure.new(request, output)) }
22
+ end
23
+
24
+ describe '#input' do
25
+ subject { request.input }
26
+
27
+ include_context 'Request#initialize'
28
+
29
+ it { should be(input) }
30
+ end
31
+
32
+ describe '#name' do
33
+ subject { request.name }
34
+
35
+ include_context 'Request#initialize'
36
+
37
+ it { should be(name) }
38
+ end
39
+
40
+ describe '#success' do
41
+ subject { request.success(output) }
42
+
43
+ include_context 'Request#initialize'
44
+
45
+ let(:output) { double }
46
+
47
+ it { should eql(Response::Success.new(request, output)) }
48
+ end
49
+
50
+ describe '#to_request' do
51
+ include_context 'Request#initialize'
52
+
53
+ let(:object) { request }
54
+
55
+ context 'when no input is given' do
56
+ subject { object.to_request }
57
+
58
+ it { should be(object) }
59
+ end
60
+
61
+ context 'when input is given' do
62
+ subject { object.to_request(new_input) }
63
+
64
+ let(:expected) { described_class.new(name, env, new_input) }
65
+ let(:new_input) { double('new_input') }
66
+
67
+ it { should eql(expected) }
68
+ end
69
+ end
70
+ end
@@ -0,0 +1,22 @@
1
+ # encoding: utf-8
2
+
3
+ require 'spec_helper'
4
+
5
+ describe Response::API::Failure do
6
+ describe '#success?' do
7
+ subject { object.success? }
8
+
9
+ context 'in case of failure' do
10
+
11
+ let(:object) { Class.new { include Response::API::Failure }.new }
12
+
13
+ it { should be(false) }
14
+ end
15
+
16
+ context 'in case of success' do
17
+ let(:object) { Class.new { include Response::API::Success }.new }
18
+
19
+ it { should be(true) }
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,46 @@
1
+ # encoding: utf-8
2
+
3
+ require 'spec_helper'
4
+
5
+ describe Response::Exception::Output do
6
+ subject { object == other }
7
+
8
+ let(:object) { described_class.new(data, exception) }
9
+ let(:data) { double }
10
+ let(:exception) { RuntimeError.new }
11
+
12
+ let(:other) { described_class.new(other_data, other_exception) }
13
+
14
+ context 'with equal data associated' do
15
+
16
+ let(:other_data) { data }
17
+
18
+ context 'and equal exception classes' do
19
+ let(:other_exception) { RuntimeError.new }
20
+
21
+ it { should be(true) }
22
+ end
23
+
24
+ context 'and different exception classes' do
25
+ let(:other_exception) { StandardError.new }
26
+
27
+ it { should be(false) }
28
+ end
29
+ end
30
+
31
+ context 'with different data associated' do
32
+ let(:other_data) { double }
33
+
34
+ context 'and equal exception classes' do
35
+ let(:other_exception) { RuntimeError.new }
36
+
37
+ it { should be(false) }
38
+ end
39
+
40
+ context 'and different exception classes' do
41
+ let(:other_exception) { StandardError.new }
42
+
43
+ it { should be(false) }
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,25 @@
1
+ # encoding: utf-8
2
+
3
+ require 'spec_helper'
4
+
5
+ describe Response::Exception do
6
+
7
+ let(:object) { described_class.new(request, output) }
8
+ let(:output) { double }
9
+
10
+ describe '#exception?' do
11
+ subject { object.exception? }
12
+
13
+ include_context 'Request#initialize'
14
+
15
+ it { should be(true) }
16
+ end
17
+
18
+ describe '#success?' do
19
+ subject { object.success? }
20
+
21
+ include_context 'Request#initialize'
22
+
23
+ it { should be(false) }
24
+ end
25
+ end
@@ -0,0 +1,25 @@
1
+ # encoding: utf-8
2
+
3
+ require 'spec_helper'
4
+
5
+ describe Response::Failure do
6
+
7
+ let(:object) { described_class.new(request, output) }
8
+ let(:output) { double }
9
+
10
+ describe '#exception?' do
11
+ subject { object.exception? }
12
+
13
+ include_context 'Request#initialize'
14
+
15
+ it { should be(false) }
16
+ end
17
+
18
+ describe '#success?' do
19
+ subject { object.success? }
20
+
21
+ include_context 'Request#initialize'
22
+
23
+ it { should be(false) }
24
+ end
25
+ end
@@ -0,0 +1,24 @@
1
+ # encoding: utf-8
2
+
3
+ require 'spec_helper'
4
+
5
+ describe Response::Success do
6
+ let(:object) { described_class.new(request, output) }
7
+ let(:output) { double }
8
+
9
+ describe '#exception?' do
10
+ subject { object.exception? }
11
+
12
+ include_context 'Request#initialize'
13
+
14
+ it { should be(false) }
15
+ end
16
+
17
+ describe '#success?' do
18
+ subject { object.success? }
19
+
20
+ include_context 'Request#initialize'
21
+
22
+ it { should be(true) }
23
+ end
24
+ end
@@ -0,0 +1,73 @@
1
+ # encoding: utf-8
2
+
3
+ require 'spec_helper'
4
+
5
+ describe Response, '#env' do
6
+ let(:object) { Class.new(described_class).new(request, output) }
7
+ let(:output) { double }
8
+
9
+ describe '#env' do
10
+ subject { object.env }
11
+
12
+ include_context 'Request#initialize'
13
+
14
+ it { should be(env) }
15
+ end
16
+
17
+ describe Response::Failure, '#exception?' do
18
+ subject { object.exception? }
19
+
20
+ include_context 'Request#initialize'
21
+
22
+ it { should be(false) }
23
+ end
24
+
25
+ describe '#input' do
26
+ subject { object.input }
27
+
28
+ include_context 'Request#initialize'
29
+
30
+ it { should be(input) }
31
+ end
32
+
33
+ describe '#output' do
34
+ subject { object.output }
35
+
36
+ include_context 'Request#initialize'
37
+
38
+ it { should equal(output) }
39
+ end
40
+
41
+ describe '#request' do
42
+ subject { object.request }
43
+
44
+ include_context 'Request#initialize'
45
+
46
+ it { should be(request) }
47
+ end
48
+
49
+ describe '#to_request' do
50
+
51
+ include_context 'Request#initialize'
52
+
53
+ let(:object) { Class.new(described_class).new(request, output) }
54
+ let(:output) { double('output') }
55
+ let(:response) { Request.new(name, env, new_input) }
56
+
57
+ context 'when no new input is given' do
58
+ subject { object.to_request }
59
+
60
+ let(:new_input) { output }
61
+
62
+ it { should eql(response) }
63
+ end
64
+
65
+ context 'when new input is given' do
66
+ subject { object.to_request(new_input) }
67
+
68
+ let(:new_input) { double('new_input') }
69
+
70
+ it { should eql(response) }
71
+ end
72
+ end
73
+ end
@@ -10,16 +10,17 @@ Gem::Specification.new do |gem|
10
10
  gem.description = "Implement application boundary interfaces with dedicated classes"
11
11
  gem.summary = "Think of it as a domain level request router. It assumes that every usecase in your application has a name and is implemented in a dedicated action handler (class)."
12
12
  gem.homepage = "https://github.com/snusnu/substation"
13
+ gem.license = 'MIT'
13
14
 
14
15
  gem.require_paths = [ "lib" ]
15
16
  gem.files = `git ls-files`.split("\n")
16
17
  gem.test_files = `git ls-files -- {spec}/*`.split("\n")
17
- gem.extra_rdoc_files = %w[LICENSE README.md TODO]
18
+ gem.extra_rdoc_files = %w[LICENSE README.md TODO.md]
18
19
 
19
- gem.add_dependency 'adamantium', '~> 0.1.0'
20
- gem.add_dependency 'equalizer', '~> 0.0.5'
21
- gem.add_dependency 'abstract_type', '~> 0.0.5'
22
- gem.add_dependency 'concord', '~> 0.1.0'
20
+ gem.add_dependency 'adamantium', '~> 0.2', '>= 0.2.0'
21
+ gem.add_dependency 'equalizer', '~> 0.0', '>= 0.0.9'
22
+ gem.add_dependency 'abstract_type', '~> 0.0', '>= 0.0.7'
23
+ gem.add_dependency 'concord', '~> 0.1', '>= 0.1.5'
23
24
 
24
- gem.add_development_dependency 'bundler', '~> 1.3.5'
25
+ gem.add_development_dependency 'bundler', '~> 1.6', '>= 1.6.5'
25
26
  end
metadata CHANGED
@@ -1,85 +1,126 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: substation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10.beta2
4
+ version: 0.0.10
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Martin Gamsjaeger (snusnu)
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2013-09-13 00:00:00.000000000 Z
12
+ date: 2014-08-11 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: adamantium
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
19
  - - ~>
18
20
  - !ruby/object:Gem::Version
19
- version: 0.1.0
21
+ version: '0.2'
22
+ - - ! '>='
23
+ - !ruby/object:Gem::Version
24
+ version: 0.2.0
20
25
  type: :runtime
21
26
  prerelease: false
22
27
  version_requirements: !ruby/object:Gem::Requirement
28
+ none: false
23
29
  requirements:
24
30
  - - ~>
25
31
  - !ruby/object:Gem::Version
26
- version: 0.1.0
32
+ version: '0.2'
33
+ - - ! '>='
34
+ - !ruby/object:Gem::Version
35
+ version: 0.2.0
27
36
  - !ruby/object:Gem::Dependency
28
37
  name: equalizer
29
38
  requirement: !ruby/object:Gem::Requirement
39
+ none: false
30
40
  requirements:
31
41
  - - ~>
32
42
  - !ruby/object:Gem::Version
33
- version: 0.0.5
43
+ version: '0.0'
44
+ - - ! '>='
45
+ - !ruby/object:Gem::Version
46
+ version: 0.0.9
34
47
  type: :runtime
35
48
  prerelease: false
36
49
  version_requirements: !ruby/object:Gem::Requirement
50
+ none: false
37
51
  requirements:
38
52
  - - ~>
39
53
  - !ruby/object:Gem::Version
40
- version: 0.0.5
54
+ version: '0.0'
55
+ - - ! '>='
56
+ - !ruby/object:Gem::Version
57
+ version: 0.0.9
41
58
  - !ruby/object:Gem::Dependency
42
59
  name: abstract_type
43
60
  requirement: !ruby/object:Gem::Requirement
61
+ none: false
44
62
  requirements:
45
63
  - - ~>
46
64
  - !ruby/object:Gem::Version
47
- version: 0.0.5
65
+ version: '0.0'
66
+ - - ! '>='
67
+ - !ruby/object:Gem::Version
68
+ version: 0.0.7
48
69
  type: :runtime
49
70
  prerelease: false
50
71
  version_requirements: !ruby/object:Gem::Requirement
72
+ none: false
51
73
  requirements:
52
74
  - - ~>
53
75
  - !ruby/object:Gem::Version
54
- version: 0.0.5
76
+ version: '0.0'
77
+ - - ! '>='
78
+ - !ruby/object:Gem::Version
79
+ version: 0.0.7
55
80
  - !ruby/object:Gem::Dependency
56
81
  name: concord
57
82
  requirement: !ruby/object:Gem::Requirement
83
+ none: false
58
84
  requirements:
59
85
  - - ~>
60
86
  - !ruby/object:Gem::Version
61
- version: 0.1.0
87
+ version: '0.1'
88
+ - - ! '>='
89
+ - !ruby/object:Gem::Version
90
+ version: 0.1.5
62
91
  type: :runtime
63
92
  prerelease: false
64
93
  version_requirements: !ruby/object:Gem::Requirement
94
+ none: false
65
95
  requirements:
66
96
  - - ~>
67
97
  - !ruby/object:Gem::Version
68
- version: 0.1.0
98
+ version: '0.1'
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: 0.1.5
69
102
  - !ruby/object:Gem::Dependency
70
103
  name: bundler
71
104
  requirement: !ruby/object:Gem::Requirement
105
+ none: false
72
106
  requirements:
73
107
  - - ~>
74
108
  - !ruby/object:Gem::Version
75
- version: 1.3.5
109
+ version: '1.6'
110
+ - - ! '>='
111
+ - !ruby/object:Gem::Version
112
+ version: 1.6.5
76
113
  type: :development
77
114
  prerelease: false
78
115
  version_requirements: !ruby/object:Gem::Requirement
116
+ none: false
79
117
  requirements:
80
118
  - - ~>
81
119
  - !ruby/object:Gem::Version
82
- version: 1.3.5
120
+ version: '1.6'
121
+ - - ! '>='
122
+ - !ruby/object:Gem::Version
123
+ version: 1.6.5
83
124
  description: Implement application boundary interfaces with dedicated classes
84
125
  email:
85
126
  - gamsnjaga@gmail.com
@@ -88,7 +129,7 @@ extensions: []
88
129
  extra_rdoc_files:
89
130
  - LICENSE
90
131
  - README.md
91
- - TODO
132
+ - TODO.md
92
133
  files:
93
134
  - .gitignore
94
135
  - .rspec
@@ -103,95 +144,144 @@ files:
103
144
  - LICENSE
104
145
  - README.md
105
146
  - Rakefile
106
- - TODO
147
+ - TODO.md
107
148
  - config/devtools.yml
108
149
  - config/flay.yml
109
150
  - config/flog.yml
110
151
  - config/mutant.yml
111
152
  - config/reek.yml
153
+ - config/rubocop.yml
112
154
  - config/yardstick.yml
113
155
  - lib/substation.rb
114
156
  - lib/substation/chain.rb
157
+ - lib/substation/chain/definition.rb
115
158
  - lib/substation/chain/dsl.rb
159
+ - lib/substation/chain/dsl/config.rb
160
+ - lib/substation/chain/dsl/module_builder.rb
116
161
  - lib/substation/dispatcher.rb
162
+ - lib/substation/dsl/guard.rb
163
+ - lib/substation/dsl/registry.rb
117
164
  - lib/substation/environment.rb
118
165
  - lib/substation/environment/dsl.rb
119
- - lib/substation/observer.rb
120
166
  - lib/substation/processor.rb
167
+ - lib/substation/processor/builder.rb
168
+ - lib/substation/processor/config.rb
121
169
  - lib/substation/processor/evaluator.rb
122
- - lib/substation/processor/pivot.rb
170
+ - lib/substation/processor/evaluator/handler.rb
171
+ - lib/substation/processor/evaluator/result.rb
172
+ - lib/substation/processor/executor.rb
173
+ - lib/substation/processor/nest.rb
174
+ - lib/substation/processor/transformer.rb
123
175
  - lib/substation/processor/wrapper.rb
124
176
  - lib/substation/request.rb
125
177
  - lib/substation/response.rb
126
- - lib/substation/utils.rb
178
+ - lib/substation/response/api.rb
179
+ - lib/substation/response/exception.rb
180
+ - lib/substation/response/exception/output.rb
181
+ - lib/substation/response/failure.rb
182
+ - lib/substation/response/success.rb
127
183
  - lib/substation/version.rb
128
- - spec/integration/substation/dispatcher/call_spec.rb
184
+ - spec/demo/core.rb
185
+ - spec/demo/core/action.rb
186
+ - spec/demo/core/action/create_person.rb
187
+ - spec/demo/core/errors.rb
188
+ - spec/demo/core/facade.rb
189
+ - spec/demo/core/handler.rb
190
+ - spec/demo/core/handler/acceptor.rb
191
+ - spec/demo/core/handler/authenticator.rb
192
+ - spec/demo/core/handler/authorizer.rb
193
+ - spec/demo/core/input.rb
194
+ - spec/demo/core/observers.rb
195
+ - spec/demo/core/validator.rb
196
+ - spec/demo/domain/actor.rb
197
+ - spec/demo/domain/dto/person.rb
198
+ - spec/demo/domain/environment.rb
199
+ - spec/demo/domain/storage.rb
200
+ - spec/demo/web.rb
201
+ - spec/demo/web/errors.rb
202
+ - spec/demo/web/facade.rb
203
+ - spec/demo/web/handler/deserializer.rb
204
+ - spec/demo/web/presenter.rb
205
+ - spec/demo/web/presenter/person.rb
206
+ - spec/demo/web/renderer.rb
207
+ - spec/demo/web/sanitizer.rb
208
+ - spec/demo/web/sanitizer/person.rb
209
+ - spec/demo/web/views.rb
210
+ - spec/integration/demo/core_spec.rb
211
+ - spec/integration/demo/web_spec.rb
212
+ - spec/shared/context/integration/demo.rb
213
+ - spec/shared/context/unit/chain.rb
214
+ - spec/shared/context/unit/processor.rb
215
+ - spec/shared/context/unit/request.rb
216
+ - spec/shared/examples/integration/demo.rb
217
+ - spec/shared/examples/unit/processor.rb
129
218
  - spec/spec_helper.rb
130
- - spec/unit/substation/chain/call_spec.rb
131
- - spec/unit/substation/chain/dsl/builder/class_methods/call_spec.rb
132
- - spec/unit/substation/chain/dsl/builder/dsl_spec.rb
133
- - spec/unit/substation/chain/dsl/builder/failure_chain_spec.rb
134
- - spec/unit/substation/chain/dsl/chain_spec.rb
135
- - spec/unit/substation/chain/dsl/class_methods/processors_spec.rb
136
- - spec/unit/substation/chain/dsl/initialize_spec.rb
137
- - spec/unit/substation/chain/dsl/processors_spec.rb
138
- - spec/unit/substation/chain/dsl/use_spec.rb
139
- - spec/unit/substation/chain/each_spec.rb
140
- - spec/unit/substation/chain/incoming/result_spec.rb
141
- - spec/unit/substation/chain/outgoing/call_spec.rb
142
- - spec/unit/substation/chain/outgoing/result_spec.rb
143
- - spec/unit/substation/dispatcher/action/call_spec.rb
144
- - spec/unit/substation/dispatcher/action/class_methods/coerce_spec.rb
145
- - spec/unit/substation/dispatcher/action_names_spec.rb
146
- - spec/unit/substation/dispatcher/call_spec.rb
147
- - spec/unit/substation/dispatcher/class_methods/coerce_spec.rb
148
- - spec/unit/substation/environment/chain_spec.rb
149
- - spec/unit/substation/environment/class_methods/build_spec.rb
150
- - spec/unit/substation/environment/dsl/class_methods/registry_spec.rb
151
- - spec/unit/substation/environment/dsl/register_spec.rb
152
- - spec/unit/substation/environment/dsl/registry_spec.rb
153
- - spec/unit/substation/observer/chain/call_spec.rb
154
- - spec/unit/substation/observer/class_methods/coerce_spec.rb
155
- - spec/unit/substation/observer/null/call_spec.rb
156
- - spec/unit/substation/processor/evaluator/call_spec.rb
157
- - spec/unit/substation/processor/pivot/call_spec.rb
158
- - spec/unit/substation/processor/wrapper/call_spec.rb
159
- - spec/unit/substation/request/env_spec.rb
160
- - spec/unit/substation/request/error_spec.rb
161
- - spec/unit/substation/request/input_spec.rb
162
- - spec/unit/substation/request/success_spec.rb
163
- - spec/unit/substation/response/env_spec.rb
164
- - spec/unit/substation/response/failure/success_predicate_spec.rb
165
- - spec/unit/substation/response/input_spec.rb
166
- - spec/unit/substation/response/output_spec.rb
167
- - spec/unit/substation/response/request_spec.rb
168
- - spec/unit/substation/response/success/success_predicate_spec.rb
169
- - spec/unit/substation/utils/class_methods/coerce_callable_spec.rb
170
- - spec/unit/substation/utils/class_methods/const_get_spec.rb
171
- - spec/unit/substation/utils/class_methods/symbolize_keys_spec.rb
219
+ - spec/unit/substation/chain/definition_spec.rb
220
+ - spec/unit/substation/chain/dsl/config/dsl_module_spec.rb
221
+ - spec/unit/substation/chain/dsl/config/registry_spec.rb
222
+ - spec/unit/substation/chain/dsl/config_spec.rb
223
+ - spec/unit/substation/chain/dsl/module_builder_spec.rb
224
+ - spec/unit/substation/chain/dsl_spec.rb
225
+ - spec/unit/substation/chain_spec.rb
226
+ - spec/unit/substation/dispatcher_spec.rb
227
+ - spec/unit/substation/dsl/guard_spec.rb
228
+ - spec/unit/substation/dsl/registry_spec.rb
229
+ - spec/unit/substation/environment/dsl_spec.rb
230
+ - spec/unit/substation/environment_spec.rb
231
+ - spec/unit/substation/processor/builder_spec.rb
232
+ - spec/unit/substation/processor/config_spec.rb
233
+ - spec/unit/substation/processor/evaluator/handler_spec.rb
234
+ - spec/unit/substation/processor/evaluator/pivot_spec.rb
235
+ - spec/unit/substation/processor/evaluator/request_spec.rb
236
+ - spec/unit/substation/processor/evaluator/result/failure_spec.rb
237
+ - spec/unit/substation/processor/evaluator/result/success_spec.rb
238
+ - spec/unit/substation/processor/evaluator/result_spec.rb
239
+ - spec/unit/substation/processor/evaluator_spec.rb
240
+ - spec/unit/substation/processor/executor/null_spec.rb
241
+ - spec/unit/substation/processor/executor_spec.rb
242
+ - spec/unit/substation/processor/fallible_spec.rb
243
+ - spec/unit/substation/processor/incoming_spec.rb
244
+ - spec/unit/substation/processor/nest/incoming_spec.rb
245
+ - spec/unit/substation/processor/nest_spec.rb
246
+ - spec/unit/substation/processor/outgoing_spec.rb
247
+ - spec/unit/substation/processor/transformer/incoming_spec.rb
248
+ - spec/unit/substation/processor/transformer/outgoing_spec.rb
249
+ - spec/unit/substation/processor/wrapper/incoming_spec.rb
250
+ - spec/unit/substation/processor/wrapper/outgoing_spec.rb
251
+ - spec/unit/substation/processor/wrapper_spec.rb
252
+ - spec/unit/substation/processor_spec.rb
253
+ - spec/unit/substation/request_spec.rb
254
+ - spec/unit/substation/response/api_spec.rb
255
+ - spec/unit/substation/response/exception/output_spec.rb
256
+ - spec/unit/substation/response/exception_spec.rb
257
+ - spec/unit/substation/response/failure_spec.rb
258
+ - spec/unit/substation/response/success_spec.rb
259
+ - spec/unit/substation/response_spec.rb
172
260
  - substation.gemspec
173
261
  homepage: https://github.com/snusnu/substation
174
- licenses: []
175
- metadata: {}
262
+ licenses:
263
+ - MIT
176
264
  post_install_message:
177
265
  rdoc_options: []
178
266
  require_paths:
179
267
  - lib
180
268
  required_ruby_version: !ruby/object:Gem::Requirement
269
+ none: false
181
270
  requirements:
182
- - - '>='
271
+ - - ! '>='
183
272
  - !ruby/object:Gem::Version
184
273
  version: '0'
185
274
  required_rubygems_version: !ruby/object:Gem::Requirement
275
+ none: false
186
276
  requirements:
187
- - - '>'
277
+ - - ! '>='
188
278
  - !ruby/object:Gem::Version
189
- version: 1.3.1
279
+ version: '0'
190
280
  requirements: []
191
281
  rubyforge_project:
192
- rubygems_version: 2.0.2
282
+ rubygems_version: 1.8.23
193
283
  signing_key:
194
- specification_version: 4
284
+ specification_version: 3
195
285
  summary: Think of it as a domain level request router. It assumes that every usecase
196
286
  in your application has a name and is implemented in a dedicated action handler
197
287
  (class).