rest_my_case 1.11.4 → 1.11.5
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/base.rb +4 -2
- data/lib/rest_my_case/version.rb +1 -1
- data/spec/rest_my_case/base/required_context_spec.rb +5 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c5660e340fca5a2c72493838b568106de58b8b7
|
4
|
+
data.tar.gz: 6cdf81465f94361d5a360032a7bd7e7886846685
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd3046f196683afef78a77e4dd3e0f67db3f035ab5f6f6ab0888546a42ee47e47606fd963608c45efc8f443c37157522d5647267a4269a52fcdf435a5c9e5078
|
7
|
+
data.tar.gz: 4f9f36ef7279fc9f354a09cd7b75d530a329bf8d09764185f5e1c9169466990134d6a67a397ed952ba32ad248cd47f9138ef8a5f994a9560292a6052a0feba17
|
data/lib/rest_my_case/base.rb
CHANGED
@@ -10,11 +10,13 @@ module RestMyCase
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def self.required_context(*schema)
|
13
|
+
@required_context_schema = schema
|
14
|
+
|
13
15
|
if schema.length == 1 && (schema[0].is_a?(Hash) || schema[0].is_a?(Array))
|
14
16
|
@required_context_schema = schema[0]
|
15
|
-
else
|
16
|
-
@required_context_schema = schema
|
17
17
|
end
|
18
|
+
|
19
|
+
@required_context_schema.each { |context_key| context_reader context_key }
|
18
20
|
end
|
19
21
|
|
20
22
|
def self.required_context_schema
|
data/lib/rest_my_case/version.rb
CHANGED
@@ -10,6 +10,11 @@ describe RestMyCase::Base do
|
|
10
10
|
it "context should be ok" do
|
11
11
|
expect(@context.ok?).to be true
|
12
12
|
end
|
13
|
+
|
14
|
+
it "use_case instance should have a delegating method to that required_context" do
|
15
|
+
use_case = RequiredContext::Users::GetCurrentUser.new({})
|
16
|
+
expect(use_case).to respond_to(:current_user)
|
17
|
+
end
|
13
18
|
end
|
14
19
|
|
15
20
|
context "When the required_context of a class fails, its dependencies shouldn't run" do
|
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.11.
|
4
|
+
version: 1.11.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- goncalvesjoao
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|