bizness 0.3.2 → 0.3.3

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
  SHA1:
3
- metadata.gz: 43040dbc20489a24603976f0c3a8317122334b98
4
- data.tar.gz: ca714a63fac174994ac0f854945235f37a73751c
3
+ metadata.gz: 58e5f8d83a30e855fdc66fd073da2dfd8e618607
4
+ data.tar.gz: 11a82527d7502d42cbe4fb2170f4b013cdd9c0d1
5
5
  SHA512:
6
- metadata.gz: fae39adf5736bc0cee09795e35dc77735f7334fa999c7dc7ab8dfd82bab938462d72e173055bb2458a259cb91abe1e8031b8512d7fdd5fa7de8ef9b5f8998708
7
- data.tar.gz: 9820b9635012efcd52dbd3de12d4cca7e58f08b34f536265c3dd0176c1d1d8fbc048cfd3892cb919d126eeaec3be981637666fbf7532eb42ab2b107ed6cbf3d9
6
+ metadata.gz: 7566b9564a3c1d05605639ef7e074b8ab99d3d6eb954ce766350058070fee043075f31d92985ed8d0bd4a385851c6d514c508a7dcff109951d94bc7064546da7
7
+ data.tar.gz: 6c5e178e9dc68a4318bc42a46d9310097f8dcd718bd7893f9ac2171ddd8c3e3a11ea8b6b0e015d5d7a7a7ce46bb7b20ed7d065448319c2a5bd93a845e699c5d8
@@ -1,10 +1,8 @@
1
1
  module Bizness::Filters
2
2
  class EventFilter < Bizness::Filters::BaseFilter
3
3
  def call
4
- Hey.context(namespace: event_name) do
5
- Hey.publish!("executed", payload) do
6
- evented_call
7
- end
4
+ Hey.publish!("#{event_name}#{delimiter}executed", payload) do
5
+ evented_call
8
6
  end
9
7
  end
10
8
 
@@ -12,14 +10,14 @@ module Bizness::Filters
12
10
 
13
11
  def evented_call
14
12
  result = filtered_operation.call
15
- Hey.publish!(successful? ? "succeeded" : "aborted", payload(result))
13
+ Hey.publish!("#{event_name}#{delimiter}#{successful? ? "succeeded" : "aborted"}", payload(result))
16
14
  rescue Exception => e
17
- Hey.publish!("aborted", payload.merge(error: e.message, stacktrace: e.backtrace, exception: e.class.name))
15
+ Hey.publish!("#{event_name}#{delimiter}aborted", payload.merge(error: e.message, stacktrace: e.backtrace, exception: e.class.name))
18
16
  raise e
19
17
  end
20
18
 
21
19
  def event_name
22
- __original_operation__.class.name.underscore.gsub("/", Hey.configuration.delimiter)
20
+ __original_operation__.class.name.underscore.gsub("/", delimiter)
23
21
  end
24
22
 
25
23
  def payload(result = nil)
@@ -31,5 +29,9 @@ module Bizness::Filters
31
29
  Hash.new
32
30
  end
33
31
  end
32
+
33
+ def delimiter
34
+ Hey.configuration.delimiter
35
+ end
34
36
  end
35
37
  end
@@ -1,3 +1,3 @@
1
1
  module Bizness
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bizness
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - ShippingEasy
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-09-17 00:00:00.000000000 Z
11
+ date: 2015-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord