hexx 3.2.1 → 4.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1ff06793590de1cf0454ae00e819af7743846bb5
4
- data.tar.gz: 451ec8528f33174f8e115a37e162f0b5a90686ca
3
+ metadata.gz: eaff6d822dd7f231f89ffba298094e1a311d1e26
4
+ data.tar.gz: f01924567547d0783d8b115a704bd3db1df2712d
5
5
  SHA512:
6
- metadata.gz: 1e06adaa3721ecedef8e8c02375aef4ae9e88ad71aed0b51c89153bd211084460170f4ed9f33d31a1de60954b8f6e3bdf2323b83ffdcb2a41eb6db4097066be0
7
- data.tar.gz: d2d5ebbe8cda6dcdae090d3214dad875dfd55b32011cd967344bd4fecac0760e322b8bde1deed6945a947978ffad9f24bb506966274a5a24ee19ae8efd0923ef
6
+ metadata.gz: 120122ede3804bc647773a57acb7c77cd5f12e68400a4e9bc75a5c1aef7779bc20c2e02c963577c3fb54a4fddb074900bb7e9492ef799f64f88893cd878c6c66
7
+ data.tar.gz: 2491a49115d87e35d4d6c0d3ec06ae8a1291c49e5a57ac10d931e863f75b2e1bb19fff4f09b565d7b1a2de22a339cfc67add03d0ecf9a83cd655de9962b571de
@@ -25,6 +25,9 @@ Style/Documentation:
25
25
  Exclude:
26
26
  - 'spec/**/*'
27
27
 
28
+ Style/EmptyLinesAroundBlockBody:
29
+ Enabled: false
30
+
28
31
  Style/EmptyLinesAroundClassBody:
29
32
  Enabled: false
30
33
 
@@ -35,8 +38,7 @@ Style/EmptyLinesAroundModuleBody:
35
38
  Enabled: false
36
39
 
37
40
  Style/EmptyLineBetweenDefs:
38
- Exclude:
39
- - 'spec/**/*'
41
+ Enabled: false
40
42
 
41
43
  Style/RaiseArgs:
42
44
  EnforcedStyle: compact
@@ -62,11 +62,12 @@ A typical service object is shown below:
62
62
 
63
63
  # runs a service
64
64
  def run
65
- # a wrapper sends :error notification to listeners in case of any exception raised.
66
- escape
67
- MyModel.save! name: name # name is defined by allow_params helper.
68
- publish :success # notifies its listeners.
69
- end
65
+ # re-raises StandardErrors as Hexx::Service::Invalid
66
+ escape { MyModel.save! }
67
+ rescue => err # Hexx::Service::Invalid only
68
+ publish :error, err.messages
69
+ else
70
+ publish :success
70
71
  end
71
72
  end
72
73
 
@@ -7,7 +7,7 @@ module Hexx
7
7
  # The intro to null object pattern from Dan Croak.
8
8
  # @see http://devblog.avdi.org/2011/05/30/null-objects-and-falsiness/
9
9
  # The post of Avdi Grimm on null object falsiness problem.
10
- #
10
+ #
11
11
  # Except for some special cases (see examples below) calling any method
12
12
  # returns the +Null+ itself.
13
13
  #
@@ -32,8 +32,8 @@ module Hexx
32
32
  #
33
33
  # @param [Hash] options The options to be assigned to the {#params}.
34
34
  # @return [Hexx::Service] The service object.
35
- def initialize(*)
36
- super
35
+ def initialize(options = {})
36
+ super(options)
37
37
  @messages = []
38
38
  end
39
39
 
@@ -2,5 +2,5 @@
2
2
  module Hexx
3
3
 
4
4
  # Current release.
5
- VERSION = "3.2.1"
5
+ VERSION = "4.0.0"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hexx
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.1
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kozin