the_help 3.2.1 → 3.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 711fd970c5d6dc6b725ed9f5d06a60e8ecfbd3b67e5f68da46dc2df0b9f6c5db
4
- data.tar.gz: 44f90a526470701bc45139a15154292b1f259eea4cfed01d3ac7d15223e07470
3
+ metadata.gz: a75d7a8941930a8c0364a9ab46feb9d84ed033854f6f00f7c94b2edd7835a37a
4
+ data.tar.gz: 7a1155356c2e5d7b41aa7abae90cbf75debd78cfb2213cd1a73bf8e68250dc3d
5
5
  SHA512:
6
- metadata.gz: b02d2e42c3952da05f4fca955e56a65032db761a025654112c0d1e7192d02b5a3b36a30188e34bcb672043cbb2ed4f6c6a7ffd3089134b2699e6f079c765febf
7
- data.tar.gz: db0f2c5c0044f6f9b1f8929ae31ce04dcc1682d41d7de7e53ed31eecf466b4641e13f1d940153665a5b0484153ac2464391f36f806a45c2e462b2e39662c83be
6
+ metadata.gz: 8b41c62f81ccca29c73cbdce4973c1fc7cbb9fd51c55e6b387cd7015c0280e5db1d38fd34d6b288ecca318782e53144364c0486df73ea15cebf66269a2b1c2dd
7
+ data.tar.gz: 339df6294d38b60184704eabdc219e8f5c960a3fd898d461aa4d7f885e0e13de0a2db1be9098a87510e9f2ce4e2c84f741f3d316ce5281c18c875bdf13fdcd46
@@ -0,0 +1,11 @@
1
+ # TheHelp Changelog #
2
+
3
+ ## 3.3.0 ##
4
+
5
+ * Calling `#stop!` with no arguments in a service definition will now check that a result was set
6
+ with either `#result.success` or `#result.error` and raise `TheHelp::NoResultError` if no result
7
+ was set.
8
+
9
+ * You can now call `#stop!` with both a `type:` and `value:` argument. `type:` can be either
10
+ `:error` (the default) or `:success`, and `value:` can be any object. Calling in this manner
11
+ will set the service result to the specified type and value.
@@ -1,50 +1,55 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- the_help (3.2.1)
4
+ the_help (3.3.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- ast (2.4.0)
10
- byebug (11.0.1)
11
- diff-lcs (1.3)
12
- jaro_winkler (1.5.3)
13
- parallel (1.18.0)
14
- parser (2.6.5.0)
15
- ast (~> 2.4.0)
9
+ ast (2.4.1)
10
+ byebug (11.1.3)
11
+ diff-lcs (1.4.4)
12
+ parallel (1.19.2)
13
+ parser (2.7.2.0)
14
+ ast (~> 2.4.1)
16
15
  rainbow (3.0.0)
17
- rake (10.5.0)
16
+ rake (13.0.1)
17
+ regexp_parser (1.8.2)
18
+ rexml (3.2.4)
18
19
  rspec (3.9.0)
19
20
  rspec-core (~> 3.9.0)
20
21
  rspec-expectations (~> 3.9.0)
21
22
  rspec-mocks (~> 3.9.0)
22
- rspec-core (3.9.0)
23
- rspec-support (~> 3.9.0)
24
- rspec-expectations (3.9.0)
23
+ rspec-core (3.9.3)
24
+ rspec-support (~> 3.9.3)
25
+ rspec-expectations (3.9.3)
25
26
  diff-lcs (>= 1.2.0, < 2.0)
26
27
  rspec-support (~> 3.9.0)
27
- rspec-mocks (3.9.0)
28
+ rspec-mocks (3.9.1)
28
29
  diff-lcs (>= 1.2.0, < 2.0)
29
30
  rspec-support (~> 3.9.0)
30
- rspec-support (3.9.0)
31
- rubocop (0.75.1)
32
- jaro_winkler (~> 1.5.1)
31
+ rspec-support (3.9.4)
32
+ rubocop (0.93.1)
33
33
  parallel (~> 1.10)
34
- parser (>= 2.6)
34
+ parser (>= 2.7.1.5)
35
35
  rainbow (>= 2.2.2, < 4.0)
36
+ regexp_parser (>= 1.8)
37
+ rexml
38
+ rubocop-ast (>= 0.6.0)
36
39
  ruby-progressbar (~> 1.7)
37
- unicode-display_width (>= 1.4.0, < 1.7)
40
+ unicode-display_width (>= 1.4.0, < 2.0)
41
+ rubocop-ast (1.1.0)
42
+ parser (>= 2.7.1.5)
38
43
  ruby-progressbar (1.10.1)
39
- unicode-display_width (1.6.0)
40
- yard (0.9.20)
44
+ unicode-display_width (1.7.0)
45
+ yard (0.9.25)
41
46
 
42
47
  PLATFORMS
43
48
  ruby
44
49
 
45
50
  DEPENDENCIES
46
51
  byebug
47
- rake (~> 10.0)
52
+ rake (~> 13.0)
48
53
  rspec (~> 3.0)
49
54
  rubocop (~> 0.50)
50
55
  the_help!
@@ -320,11 +320,18 @@ module TheHelp
320
320
  return if authorized?
321
321
  logger.warn("Unauthorized attempt to access #{self.class.name}/#{__id__} " \
322
322
  "as #{context.inspect}")
323
- run_callback(not_authorized, service: self.class, context: context)
323
+ result.error run_callback(not_authorized, service: self.class, context: context)
324
324
  stop!
325
325
  end
326
326
 
327
- def stop!
327
+ def stop!(type: :error, value: nil)
328
+ if value.nil?
329
+ check_result!
330
+ elsif type == :success
331
+ result.success value
332
+ else
333
+ result.error value
334
+ end
328
335
  throw :stop
329
336
  end
330
337
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TheHelp
4
- VERSION = '3.2.1'
4
+ VERSION = '3.3.0'
5
5
  end
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
23
23
  spec.require_paths = ['lib']
24
24
 
25
25
  spec.add_development_dependency 'byebug'
26
- spec.add_development_dependency 'rake', '~> 10.0'
26
+ spec.add_development_dependency 'rake', '~> 13.0'
27
27
  spec.add_development_dependency 'rspec', '~> 3.0'
28
28
  spec.add_development_dependency 'rubocop', '~> 0.50'
29
29
  spec.add_development_dependency 'yard'
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: 3.2.1
4
+ version: 3.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Wilger
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-12-04 00:00:00.000000000 Z
11
+ date: 2020-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: '13.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: '13.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -93,6 +93,7 @@ files:
93
93
  - ".rubocop.yml"
94
94
  - ".tool-versions"
95
95
  - ".travis.yml"
96
+ - CHANGELOG.md
96
97
  - CODE_OF_CONDUCT.md
97
98
  - Gemfile
98
99
  - Gemfile.lock