the_help 1.1.3 → 1.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Gemfile.lock +22 -23
- data/lib/the_help/errors.rb +5 -3
- data/lib/the_help/service.rb +3 -6
- data/lib/the_help/version.rb +1 -1
- data/lib/the_help.rb +7 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 12d2ca84288d7edcf861be2115e275ea1ebbbf4e5eeb0bd1ad109334e2310b78
|
4
|
+
data.tar.gz: cbbc8bf078f9452d80488f9993dddb615a10c1fc73ffecfc81d9adf2e606309d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '00586882e22049dfc9ff1aeeed59037d0d8703346495db16a62eda8327171a9c3729d6c733dc27fb29c745ed6304338c530097de929f583331b18ec6fd99857e'
|
7
|
+
data.tar.gz: f1c932128245cf6e7c66a343ca4f815a60308d03a017d8d2f89c6f035c48f3212c5bbc577a67b9638ad1b1c14ec629b26f189b5b46cee17320c23c5e2c061c18
|
data/Gemfile.lock
CHANGED
@@ -1,41 +1,40 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
the_help (1.
|
4
|
+
the_help (1.2.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
ast (2.
|
9
|
+
ast (2.4.0)
|
10
10
|
diff-lcs (1.3)
|
11
|
-
parallel (1.12.
|
12
|
-
parser (2.
|
13
|
-
ast (~> 2.
|
11
|
+
parallel (1.12.1)
|
12
|
+
parser (2.5.0.2)
|
13
|
+
ast (~> 2.4.0)
|
14
14
|
powerpack (0.1.1)
|
15
|
-
rainbow (
|
16
|
-
rake
|
15
|
+
rainbow (3.0.0)
|
17
16
|
rake (10.5.0)
|
18
|
-
rspec (3.
|
19
|
-
rspec-core (~> 3.
|
20
|
-
rspec-expectations (~> 3.
|
21
|
-
rspec-mocks (~> 3.
|
22
|
-
rspec-core (3.
|
23
|
-
rspec-support (~> 3.
|
24
|
-
rspec-expectations (3.
|
17
|
+
rspec (3.7.0)
|
18
|
+
rspec-core (~> 3.7.0)
|
19
|
+
rspec-expectations (~> 3.7.0)
|
20
|
+
rspec-mocks (~> 3.7.0)
|
21
|
+
rspec-core (3.7.1)
|
22
|
+
rspec-support (~> 3.7.0)
|
23
|
+
rspec-expectations (3.7.0)
|
25
24
|
diff-lcs (>= 1.2.0, < 2.0)
|
26
|
-
rspec-support (~> 3.
|
27
|
-
rspec-mocks (3.
|
25
|
+
rspec-support (~> 3.7.0)
|
26
|
+
rspec-mocks (3.7.0)
|
28
27
|
diff-lcs (>= 1.2.0, < 2.0)
|
29
|
-
rspec-support (~> 3.
|
30
|
-
rspec-support (3.
|
31
|
-
rubocop (0.
|
28
|
+
rspec-support (~> 3.7.0)
|
29
|
+
rspec-support (3.7.1)
|
30
|
+
rubocop (0.52.1)
|
32
31
|
parallel (~> 1.10)
|
33
|
-
parser (>= 2.
|
32
|
+
parser (>= 2.4.0.2, < 3.0)
|
34
33
|
powerpack (~> 0.1)
|
35
|
-
rainbow (>= 2.2.2, <
|
34
|
+
rainbow (>= 2.2.2, < 4.0)
|
36
35
|
ruby-progressbar (~> 1.7)
|
37
36
|
unicode-display_width (~> 1.0, >= 1.0.1)
|
38
|
-
ruby-progressbar (1.
|
37
|
+
ruby-progressbar (1.9.0)
|
39
38
|
unicode-display_width (1.3.0)
|
40
39
|
|
41
40
|
PLATFORMS
|
@@ -48,4 +47,4 @@ DEPENDENCIES
|
|
48
47
|
the_help!
|
49
48
|
|
50
49
|
BUNDLED WITH
|
51
|
-
1.16.
|
50
|
+
1.16.1
|
data/lib/the_help/errors.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module TheHelp
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
module Errors
|
5
|
+
class AbstractClassError < StandardError; end
|
6
|
+
class ServiceNotImplementedError < StandardError; end
|
7
|
+
class NotAuthorizedError < RuntimeError; end
|
8
|
+
end
|
7
9
|
end
|
data/lib/the_help/service.rb
CHANGED
@@ -2,9 +2,6 @@
|
|
2
2
|
|
3
3
|
require 'logger'
|
4
4
|
require 'set'
|
5
|
-
require 'the_help/errors'
|
6
|
-
require 'the_help/provides_callbacks'
|
7
|
-
require 'the_help/service_caller'
|
8
5
|
|
9
6
|
module TheHelp
|
10
7
|
# An Abstract Service Class with Authorization and Logging
|
@@ -70,7 +67,7 @@ module TheHelp
|
|
70
67
|
# It will raise a TheHelp::NotAuthorizedError when the context is not
|
71
68
|
# authorized to perform the service.
|
72
69
|
CB_NOT_AUTHORIZED = ->(service:, context:) {
|
73
|
-
raise NotAuthorizedError,
|
70
|
+
raise TheHelp::NotAuthorizedError,
|
74
71
|
"Not authorized to access #{service.name} as #{context.inspect}."
|
75
72
|
}
|
76
73
|
|
@@ -189,8 +186,8 @@ module TheHelp
|
|
189
186
|
end
|
190
187
|
|
191
188
|
def validate_service_definition
|
192
|
-
raise AbstractClassError if self.class == TheHelp::Service
|
193
|
-
raise ServiceNotImplementedError unless defined?(main)
|
189
|
+
raise TheHelp::AbstractClassError if self.class == TheHelp::Service
|
190
|
+
raise TheHelp::ServiceNotImplementedError unless defined?(main)
|
194
191
|
end
|
195
192
|
|
196
193
|
def log_service_call
|
data/lib/the_help/version.rb
CHANGED
data/lib/the_help.rb
CHANGED
@@ -1,7 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'the_help/version'
|
4
|
-
|
5
3
|
module TheHelp
|
6
|
-
|
4
|
+
autoload(:Version, 'the_help/version')
|
5
|
+
autoload(:Errors, 'the_help/errors')
|
6
|
+
autoload(:ProvidesCallbacks, 'the_help/provides_callbacks')
|
7
|
+
autoload(:Service, 'the_help/service')
|
8
|
+
autoload(:ServiceCaller, 'the_help/service_caller')
|
9
|
+
|
10
|
+
include Errors
|
7
11
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: the_help
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Wilger
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-02-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -99,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
99
99
|
version: '0'
|
100
100
|
requirements: []
|
101
101
|
rubyforge_project:
|
102
|
-
rubygems_version: 2.
|
102
|
+
rubygems_version: 2.7.3
|
103
103
|
signing_key:
|
104
104
|
specification_version: 4
|
105
105
|
summary: A service layer framework
|