rest_my_case 1.1.0 → 1.2.0
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/lib/rest_my_case.rb +9 -9
- data/lib/rest_my_case/base.rb +5 -4
- data/lib/rest_my_case/configuration/base.rb +24 -0
- data/lib/rest_my_case/configuration/shared.rb +12 -0
- data/lib/rest_my_case/defense_attorney.rb +37 -13
- data/lib/rest_my_case/judges/base.rb +9 -15
- data/lib/rest_my_case/version.rb +3 -1
- data/spec/rest_my_case/base_spec.rb +26 -20
- data/spec/rest_my_case/defense_attorney_spec.rb +155 -12
- metadata +4 -35
- data/lib/rest_my_case/configuration.rb +0 -13
- data/spec/support/_send_email/base.rb +0 -14
- data/spec/support/_send_email/fetch_admins.rb +0 -6
- data/spec/support/_send_email/one_more_dependency.rb +0 -6
- data/spec/support/_send_email/to_admins.rb +0 -11
- data/spec/support/_send_email/to_user.rb +0 -6
- data/spec/support/_send_email/use_case.rb +0 -11
- data/spec/support/comments/create/base.rb +0 -18
- data/spec/support/comments/create/build_comment.rb +0 -8
- data/spec/support/comments/create/send_email.rb +0 -13
- data/spec/support/comments/find_one.rb +0 -8
- data/spec/support/comments/save_comment.rb +0 -6
- data/spec/support/comments/use_case.rb +0 -11
- data/spec/support/posts/create/base.rb +0 -16
- data/spec/support/posts/create/build_post.rb +0 -8
- data/spec/support/posts/save_post.rb +0 -6
- data/spec/support/posts/use_case.rb +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d0c344e572726b96515f59752258d4073b89937
|
4
|
+
data.tar.gz: aa11435140ce2d8f8b37092b8ad80700194114dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28dfb80a2170e238e2c1298887f3bf7c49b21ff0ea3f2ec99060ea937423cf4d45a79ef9a6aff3fb68eb83da1bdb7041270ec9298c0a71ef02a4b6936628b022
|
7
|
+
data.tar.gz: d18a6ace349f311fcf3ce082fd1bb6608593ccd9019d54ac3b3fc9010a45c8fe5cd80f279de2a3a84f831a319192cec7fb4dda2c9c48901744f46884300dde37
|
data/lib/rest_my_case.rb
CHANGED
@@ -1,24 +1,24 @@
|
|
1
|
-
require "rest_my_case/configuration"
|
1
|
+
require "rest_my_case/configuration/base"
|
2
2
|
require "rest_my_case/version"
|
3
3
|
require "rest_my_case/errors"
|
4
4
|
require "rest_my_case/base"
|
5
5
|
|
6
6
|
module RestMyCase
|
7
7
|
|
8
|
-
def self.configure
|
9
|
-
yield
|
8
|
+
def self.configure
|
9
|
+
yield config
|
10
10
|
end
|
11
11
|
|
12
|
-
def self.
|
13
|
-
|
12
|
+
def self.config
|
13
|
+
@config ||= Configuration::Base.new
|
14
14
|
end
|
15
15
|
|
16
|
-
def self.
|
17
|
-
@
|
16
|
+
def self.reset_config
|
17
|
+
@config = Configuration::Base.new
|
18
18
|
end
|
19
19
|
|
20
|
-
def self.
|
21
|
-
|
20
|
+
def self.get_config(attribute, use_case)
|
21
|
+
config.get(attribute, use_case)
|
22
22
|
end
|
23
23
|
|
24
24
|
end
|
data/lib/rest_my_case/base.rb
CHANGED
@@ -1,9 +1,12 @@
|
|
1
|
+
require "rest_my_case/defense_attorney"
|
1
2
|
require "rest_my_case/judges/base"
|
2
3
|
|
3
4
|
module RestMyCase
|
4
5
|
|
5
6
|
class Base
|
6
7
|
|
8
|
+
extend Configuration::Shared
|
9
|
+
|
7
10
|
def self.depends(*use_cases)
|
8
11
|
dependencies.push *use_cases
|
9
12
|
end
|
@@ -13,11 +16,9 @@ module RestMyCase
|
|
13
16
|
end
|
14
17
|
|
15
18
|
def self.perform(attributes = {})
|
16
|
-
|
17
|
-
raise ArgumentError.new('Must respond_to method #to_hash')
|
18
|
-
end
|
19
|
+
new_trial_case = DefenseAttorney.new(self, attributes).build_trial_case
|
19
20
|
|
20
|
-
Judges::Base.
|
21
|
+
Judges::Base.new(trial_case).execute_the_sentence
|
21
22
|
end
|
22
23
|
|
23
24
|
def self.context_accessor(*methods)
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require "rest_my_case/configuration/shared"
|
2
|
+
|
3
|
+
module RestMyCase
|
4
|
+
module Configuration
|
5
|
+
|
6
|
+
class Base
|
7
|
+
|
8
|
+
include Shared
|
9
|
+
|
10
|
+
def initialize
|
11
|
+
@dependencies_first = true
|
12
|
+
@parent_dependencies_first = true
|
13
|
+
end
|
14
|
+
|
15
|
+
def get(attribute, use_case)
|
16
|
+
custom_config = use_case.send(attribute)
|
17
|
+
|
18
|
+
custom_config.nil? ? send(attribute) : custom_config
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
@@ -2,31 +2,55 @@ require "rest_my_case/context"
|
|
2
2
|
|
3
3
|
module RestMyCase
|
4
4
|
|
5
|
-
|
5
|
+
class DefenseAttorney
|
6
6
|
|
7
|
-
def
|
8
|
-
|
7
|
+
def initialize(starting_point_use_case, attributes)
|
8
|
+
unless attributes.respond_to?(:to_hash)
|
9
|
+
raise ArgumentError.new('Must respond_to method #to_hash')
|
10
|
+
end
|
11
|
+
|
12
|
+
@shared_context = Context.new attributes.to_hash
|
13
|
+
@starting_point_use_case = starting_point_use_case
|
14
|
+
end
|
9
15
|
|
10
|
-
|
11
|
-
|
16
|
+
def build_trial_case
|
17
|
+
all_dependencies(@starting_point_use_case).map do |use_case|
|
18
|
+
use_case.new(@shared_context)
|
12
19
|
end
|
13
20
|
end
|
14
21
|
|
15
|
-
|
22
|
+
protected ###################### PROTECTED #########################
|
23
|
+
|
24
|
+
def all_dependencies(use_case)
|
16
25
|
return [] unless use_case.respond_to?(:dependencies)
|
17
26
|
|
18
|
-
if parent_dependencies_first
|
19
|
-
|
27
|
+
if RestMyCase.get_config(:parent_dependencies_first, use_case)
|
28
|
+
all_dependencies(use_case.superclass) | deep_dependencies(use_case)
|
20
29
|
else
|
21
|
-
use_case
|
30
|
+
deep_dependencies(use_case) | all_dependencies(use_case.superclass)
|
22
31
|
end
|
23
32
|
end
|
24
33
|
|
25
|
-
|
34
|
+
def deep_dependencies(use_case)
|
35
|
+
deep_dependencies = []
|
36
|
+
|
37
|
+
use_case.dependencies.each do |use_case|
|
38
|
+
deep_dependencies.push *all_dependencies(use_case)
|
39
|
+
end
|
40
|
+
|
41
|
+
include_current_use_case(deep_dependencies, use_case)
|
42
|
+
end
|
43
|
+
|
44
|
+
private ####################### PRIVATE ###########################
|
26
45
|
|
27
|
-
def
|
28
|
-
|
29
|
-
|
46
|
+
def include_current_use_case(dependencies, use_case)
|
47
|
+
return dependencies unless use_case.superclass.respond_to?(:dependencies)
|
48
|
+
|
49
|
+
if RestMyCase.get_config(:dependencies_first, use_case)
|
50
|
+
dependencies.push(use_case)
|
51
|
+
else
|
52
|
+
dependencies.unshift(use_case)
|
53
|
+
end
|
30
54
|
end
|
31
55
|
|
32
56
|
end
|
@@ -1,27 +1,21 @@
|
|
1
|
-
require "rest_my_case/defense_attorney"
|
2
|
-
|
3
1
|
module RestMyCase
|
4
2
|
module Judges
|
5
3
|
|
6
4
|
class Base
|
7
5
|
|
8
|
-
def
|
9
|
-
|
10
|
-
|
11
|
-
new_trial.run_setup_methods
|
12
|
-
new_trial.run_perform_methods
|
13
|
-
new_trial.run_rollback_methods
|
14
|
-
new_trial.run_final_methods
|
15
|
-
end
|
16
|
-
|
17
|
-
def initialize(defendant, attributes)
|
18
|
-
@use_cases =
|
19
|
-
DefenseAttorney.build_use_cases_for_the(defendant, attributes)
|
20
|
-
|
6
|
+
def initialize(use_cases)
|
7
|
+
@use_cases = use_cases
|
21
8
|
@performed_use_cases = []
|
22
9
|
@use_case_that_aborted = false
|
23
10
|
end
|
24
11
|
|
12
|
+
def execute_the_sentence
|
13
|
+
run_setup_methods
|
14
|
+
run_perform_methods
|
15
|
+
run_rollback_methods
|
16
|
+
run_final_methods
|
17
|
+
end
|
18
|
+
|
25
19
|
protected #################### PROTECTED ####################
|
26
20
|
|
27
21
|
def run_setup_methods
|
data/lib/rest_my_case/version.rb
CHANGED
@@ -2,27 +2,38 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe RestMyCase::Base do
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
5
|
+
module RestMyCaseBase
|
6
|
+
class LogEvents < RestMyCase::Base; end
|
7
|
+
class AnalyseEvents < RestMyCase::Base; end
|
8
|
+
class BuildPost < RestMyCase::Base; end
|
9
|
+
class SavePost < RestMyCase::Base; end
|
10
|
+
class BuildComments < RestMyCase::Base; end
|
11
|
+
class SaveComments < RestMyCase::Base; end
|
12
|
+
|
13
|
+
class UseCaseWrapper < RestMyCase::Base
|
14
|
+
context_writer :id
|
15
|
+
context_reader :session
|
16
|
+
context_accessor :comment
|
17
|
+
depends LogEvents, AnalyseEvents
|
18
|
+
end
|
19
|
+
class CreatePost < UseCaseWrapper
|
20
|
+
depends BuildPost, SavePost
|
21
|
+
end
|
22
|
+
class CreatePostWithComments < CreatePost
|
23
|
+
depends BuildComments, SaveComments
|
10
24
|
end
|
11
|
-
|
12
25
|
end
|
13
26
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
27
|
+
describe ".dependencies" do
|
28
|
+
it " should only list the class's dependencies" do
|
29
|
+
expect(RestMyCaseBase::CreatePostWithComments.dependencies).to \
|
30
|
+
eq [RestMyCaseBase::BuildComments, RestMyCaseBase::SaveComments]
|
18
31
|
end
|
19
|
-
|
20
32
|
end
|
21
33
|
|
22
34
|
describe ".context_accessor" do
|
23
|
-
|
24
35
|
let(:context) { RestMyCase::Context.new(id: 1, comment: 'my comment', session: -1) }
|
25
|
-
let(:use_case) {
|
36
|
+
let(:use_case) { RestMyCaseBase::CreatePostWithComments.new(context) }
|
26
37
|
|
27
38
|
it "Should create getters targeting to context" do
|
28
39
|
expect(use_case.respond_to?(:comment)).to be true
|
@@ -40,12 +51,10 @@ describe RestMyCase::Base do
|
|
40
51
|
use_case.comment = 'your comment'
|
41
52
|
expect(use_case.context.comment).to eq 'your comment'
|
42
53
|
end
|
43
|
-
|
44
54
|
end
|
45
55
|
|
46
56
|
describe ".context_writer" do
|
47
|
-
|
48
|
-
let(:use_case) { Comments::FindOne.new(RestMyCase::Context.new) }
|
57
|
+
let(:use_case) { RestMyCaseBase::CreatePostWithComments.new(RestMyCase::Context.new) }
|
49
58
|
|
50
59
|
it "Should create setters targeting to context" do
|
51
60
|
expect(use_case.respond_to?(:id)).to be false
|
@@ -57,13 +66,11 @@ describe RestMyCase::Base do
|
|
57
66
|
|
58
67
|
expect(use_case.context.id).to eq 2
|
59
68
|
end
|
60
|
-
|
61
69
|
end
|
62
70
|
|
63
71
|
describe ".context_reader" do
|
64
|
-
|
65
72
|
let(:context) { RestMyCase::Context.new(id: 1, comment: 'my comment', session: -1) }
|
66
|
-
let(:use_case) {
|
73
|
+
let(:use_case) { RestMyCaseBase::CreatePostWithComments.new(context) }
|
67
74
|
|
68
75
|
it "Should create getters targeting to context" do
|
69
76
|
expect(use_case.respond_to?(:session)).to be true
|
@@ -73,7 +80,6 @@ describe RestMyCase::Base do
|
|
73
80
|
it "Getter should delegate to context" do
|
74
81
|
expect(use_case.session).to eq context.session
|
75
82
|
end
|
76
|
-
|
77
83
|
end
|
78
84
|
|
79
85
|
end
|
@@ -2,33 +2,176 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe RestMyCase::DefenseAttorney do
|
4
4
|
|
5
|
-
|
5
|
+
module DefenseAttorney
|
6
|
+
class BuilEvent < RestMyCase::Base; end
|
7
|
+
class SaveEvent < RestMyCase::Base; end
|
8
|
+
class CreateEvent < RestMyCase::Base
|
9
|
+
depends SaveEvent
|
10
|
+
end
|
11
|
+
class LogEvents < RestMyCase::Base
|
12
|
+
depends BuilEvent, CreateEvent
|
13
|
+
end
|
14
|
+
class AnalyseEvents < RestMyCase::Base; end
|
15
|
+
class BuildPost < RestMyCase::Base; end
|
16
|
+
class SavePost < RestMyCase::Base; end
|
17
|
+
class BuildComments < RestMyCase::Base; end
|
18
|
+
class SaveComments < RestMyCase::Base; end
|
19
|
+
class CreateComments < RestMyCase::Base
|
20
|
+
depends SaveComments
|
21
|
+
end
|
6
22
|
|
7
|
-
|
23
|
+
class UseCaseWrapper < RestMyCase::Base
|
24
|
+
depends LogEvents, AnalyseEvents
|
25
|
+
end
|
26
|
+
class CreatePost < UseCaseWrapper
|
27
|
+
depends BuildPost, SavePost
|
28
|
+
end
|
29
|
+
class CreatePostWithComments < CreatePost
|
30
|
+
depends BuildComments, CreateComments
|
31
|
+
end
|
32
|
+
end
|
8
33
|
|
9
|
-
|
10
|
-
|
34
|
+
shared_examples "a porper shepherd" do |dependencies|
|
35
|
+
it "use_cases should be in the proper order" do
|
36
|
+
dependencies.each_with_index do |dependency, index|
|
37
|
+
expect(use_cases[index]).to be_a dependency
|
11
38
|
end
|
39
|
+
end
|
12
40
|
|
13
|
-
|
14
|
-
|
41
|
+
it "use_cases should share the same context" do
|
42
|
+
use_cases.each do |use_case1|
|
43
|
+
use_cases.each do |use_case2|
|
44
|
+
expect(use_case1.context).to be use_case2.context
|
45
|
+
end
|
15
46
|
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
context "When a use case depends on other use cases" do
|
51
|
+
let(:use_cases) do
|
52
|
+
described_class.new(DefenseAttorney::UseCaseWrapper, id: 1).build_trial_case
|
53
|
+
end
|
16
54
|
|
55
|
+
it_behaves_like "a porper shepherd", [
|
56
|
+
DefenseAttorney::BuilEvent,
|
57
|
+
DefenseAttorney::SaveEvent,
|
58
|
+
DefenseAttorney::CreateEvent,
|
59
|
+
DefenseAttorney::LogEvents,
|
60
|
+
DefenseAttorney::AnalyseEvents,
|
61
|
+
DefenseAttorney::UseCaseWrapper
|
62
|
+
]
|
63
|
+
end
|
64
|
+
|
65
|
+
context "When a use case inherits from another that also has its own dependencies" do
|
66
|
+
let(:use_cases) do
|
67
|
+
described_class.new(DefenseAttorney::CreatePostWithComments, id: 1).build_trial_case
|
17
68
|
end
|
18
69
|
|
19
|
-
|
70
|
+
it_behaves_like "a porper shepherd", [
|
71
|
+
DefenseAttorney::BuilEvent,
|
72
|
+
DefenseAttorney::SaveEvent,
|
73
|
+
DefenseAttorney::CreateEvent,
|
74
|
+
DefenseAttorney::LogEvents,
|
75
|
+
DefenseAttorney::AnalyseEvents,
|
76
|
+
DefenseAttorney::UseCaseWrapper,
|
77
|
+
DefenseAttorney::BuildPost,
|
78
|
+
DefenseAttorney::SavePost,
|
79
|
+
DefenseAttorney::CreatePost,
|
80
|
+
DefenseAttorney::BuildComments,
|
81
|
+
DefenseAttorney::SaveComments,
|
82
|
+
DefenseAttorney::CreateComments,
|
83
|
+
DefenseAttorney::CreatePostWithComments
|
84
|
+
]
|
85
|
+
end
|
20
86
|
|
21
|
-
|
22
|
-
|
87
|
+
context "When general configuration has parent_dependencies_first = false" do
|
88
|
+
before do
|
89
|
+
RestMyCase.configure do |config|
|
90
|
+
config.parent_dependencies_first = false
|
23
91
|
end
|
92
|
+
end
|
24
93
|
|
25
|
-
|
26
|
-
|
27
|
-
|
94
|
+
after { RestMyCase.reset_config }
|
95
|
+
|
96
|
+
let(:use_cases) do
|
97
|
+
described_class.new(DefenseAttorney::CreatePostWithComments, id: 1).build_trial_case
|
98
|
+
end
|
99
|
+
|
100
|
+
it_behaves_like "a porper shepherd", [
|
101
|
+
DefenseAttorney::BuildComments,
|
102
|
+
DefenseAttorney::SaveComments,
|
103
|
+
DefenseAttorney::CreateComments,
|
104
|
+
DefenseAttorney::CreatePostWithComments,
|
105
|
+
|
106
|
+
DefenseAttorney::BuildPost,
|
107
|
+
DefenseAttorney::SavePost,
|
108
|
+
DefenseAttorney::CreatePost,
|
109
|
+
|
110
|
+
DefenseAttorney::BuilEvent,
|
111
|
+
DefenseAttorney::SaveEvent,
|
112
|
+
DefenseAttorney::CreateEvent,
|
113
|
+
DefenseAttorney::LogEvents,
|
114
|
+
DefenseAttorney::AnalyseEvents,
|
115
|
+
DefenseAttorney::UseCaseWrapper
|
116
|
+
]
|
117
|
+
end
|
118
|
+
|
119
|
+
context "When general configuration has dependencies_first = false" do
|
120
|
+
before do
|
121
|
+
RestMyCase.configure do |config|
|
122
|
+
config.dependencies_first = false
|
28
123
|
end
|
124
|
+
end
|
125
|
+
|
126
|
+
after { RestMyCase.reset_config }
|
127
|
+
|
128
|
+
let(:use_cases) do
|
129
|
+
described_class.new(DefenseAttorney::CreatePostWithComments, id: 1).build_trial_case
|
130
|
+
end
|
131
|
+
|
132
|
+
it_behaves_like "a porper shepherd", [
|
133
|
+
DefenseAttorney::UseCaseWrapper,
|
134
|
+
DefenseAttorney::LogEvents,
|
135
|
+
DefenseAttorney::BuilEvent,
|
136
|
+
DefenseAttorney::CreateEvent,
|
137
|
+
DefenseAttorney::SaveEvent,
|
138
|
+
DefenseAttorney::AnalyseEvents,
|
139
|
+
DefenseAttorney::CreatePost,
|
140
|
+
DefenseAttorney::BuildPost,
|
141
|
+
DefenseAttorney::SavePost,
|
142
|
+
DefenseAttorney::CreatePostWithComments,
|
143
|
+
DefenseAttorney::BuildComments,
|
144
|
+
DefenseAttorney::CreateComments,
|
145
|
+
DefenseAttorney::SaveComments
|
146
|
+
]
|
147
|
+
end
|
148
|
+
|
149
|
+
context "When an use case class configuration has dependencies_first = false" do
|
150
|
+
before do
|
151
|
+
DefenseAttorney::UseCaseWrapper.dependencies_first = false
|
152
|
+
end
|
153
|
+
|
154
|
+
after { DefenseAttorney::UseCaseWrapper.dependencies_first = nil }
|
29
155
|
|
156
|
+
let(:use_cases) do
|
157
|
+
described_class.new(DefenseAttorney::CreatePostWithComments, id: 1).build_trial_case
|
30
158
|
end
|
31
159
|
|
160
|
+
it_behaves_like "a porper shepherd", [
|
161
|
+
DefenseAttorney::UseCaseWrapper,
|
162
|
+
DefenseAttorney::BuilEvent,
|
163
|
+
DefenseAttorney::SaveEvent,
|
164
|
+
DefenseAttorney::CreateEvent,
|
165
|
+
DefenseAttorney::LogEvents,
|
166
|
+
DefenseAttorney::AnalyseEvents,
|
167
|
+
DefenseAttorney::BuildPost,
|
168
|
+
DefenseAttorney::SavePost,
|
169
|
+
DefenseAttorney::CreatePost,
|
170
|
+
DefenseAttorney::BuildComments,
|
171
|
+
DefenseAttorney::SaveComments,
|
172
|
+
DefenseAttorney::CreateComments,
|
173
|
+
DefenseAttorney::CreatePostWithComments
|
174
|
+
]
|
32
175
|
end
|
33
176
|
|
34
177
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rest_my_case
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- goncalvesjoao
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|
@@ -83,7 +83,8 @@ files:
|
|
83
83
|
- Rakefile
|
84
84
|
- lib/rest_my_case.rb
|
85
85
|
- lib/rest_my_case/base.rb
|
86
|
-
- lib/rest_my_case/configuration.rb
|
86
|
+
- lib/rest_my_case/configuration/base.rb
|
87
|
+
- lib/rest_my_case/configuration/shared.rb
|
87
88
|
- lib/rest_my_case/context.rb
|
88
89
|
- lib/rest_my_case/defense_attorney.rb
|
89
90
|
- lib/rest_my_case/errors.rb
|
@@ -94,22 +95,6 @@ files:
|
|
94
95
|
- spec/rest_my_case/defense_attorney_spec.rb
|
95
96
|
- spec/rest_my_case/judges/base_spec.rb
|
96
97
|
- spec/spec_helper.rb
|
97
|
-
- spec/support/_send_email/base.rb
|
98
|
-
- spec/support/_send_email/fetch_admins.rb
|
99
|
-
- spec/support/_send_email/one_more_dependency.rb
|
100
|
-
- spec/support/_send_email/to_admins.rb
|
101
|
-
- spec/support/_send_email/to_user.rb
|
102
|
-
- spec/support/_send_email/use_case.rb
|
103
|
-
- spec/support/comments/create/base.rb
|
104
|
-
- spec/support/comments/create/build_comment.rb
|
105
|
-
- spec/support/comments/create/send_email.rb
|
106
|
-
- spec/support/comments/find_one.rb
|
107
|
-
- spec/support/comments/save_comment.rb
|
108
|
-
- spec/support/comments/use_case.rb
|
109
|
-
- spec/support/posts/create/base.rb
|
110
|
-
- spec/support/posts/create/build_post.rb
|
111
|
-
- spec/support/posts/save_post.rb
|
112
|
-
- spec/support/posts/use_case.rb
|
113
98
|
homepage: https://github.com/goncalvesjoao/rest_my_case
|
114
99
|
licenses:
|
115
100
|
- MIT
|
@@ -139,19 +124,3 @@ test_files:
|
|
139
124
|
- spec/rest_my_case/defense_attorney_spec.rb
|
140
125
|
- spec/rest_my_case/judges/base_spec.rb
|
141
126
|
- spec/spec_helper.rb
|
142
|
-
- spec/support/_send_email/base.rb
|
143
|
-
- spec/support/_send_email/fetch_admins.rb
|
144
|
-
- spec/support/_send_email/one_more_dependency.rb
|
145
|
-
- spec/support/_send_email/to_admins.rb
|
146
|
-
- spec/support/_send_email/to_user.rb
|
147
|
-
- spec/support/_send_email/use_case.rb
|
148
|
-
- spec/support/comments/create/base.rb
|
149
|
-
- spec/support/comments/create/build_comment.rb
|
150
|
-
- spec/support/comments/create/send_email.rb
|
151
|
-
- spec/support/comments/find_one.rb
|
152
|
-
- spec/support/comments/save_comment.rb
|
153
|
-
- spec/support/comments/use_case.rb
|
154
|
-
- spec/support/posts/create/base.rb
|
155
|
-
- spec/support/posts/create/build_post.rb
|
156
|
-
- spec/support/posts/save_post.rb
|
157
|
-
- spec/support/posts/use_case.rb
|
@@ -1,18 +0,0 @@
|
|
1
|
-
require_relative '../use_case'
|
2
|
-
require_relative 'build_comment'
|
3
|
-
require_relative 'send_email'
|
4
|
-
require_relative '../save_comment'
|
5
|
-
|
6
|
-
module Comments
|
7
|
-
module Create
|
8
|
-
|
9
|
-
class Base < UseCase
|
10
|
-
|
11
|
-
depends BuildComment,
|
12
|
-
SaveComment,
|
13
|
-
SendEmail
|
14
|
-
|
15
|
-
end
|
16
|
-
|
17
|
-
end
|
18
|
-
end
|