cpi-event-connector 0.0.7 → 0.0.8
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.
- data/Gemfile +1 -0
- data/Gemfile.lock +11 -3
- data/cpi-event-connector.gemspec +1 -0
- data/lib/cpi_event_connector/event.rb +3 -0
- data/lib/cpi_event_connector/version.rb +1 -1
- data/spec/connector_spec.rb +1 -1
- data/spec/event_spec.rb +7 -1
- data/spec/generator_spec.rb +2 -1
- data/spec/integration_spec.rb +1 -1
- metadata +25 -11
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,13 @@
|
|
1
|
+
GIT
|
2
|
+
remote: https://github.com/ruby-amqp/bunny.git
|
3
|
+
revision: af6d5e35c7fcd5667807b595c8eb22f08780c0aa
|
4
|
+
specs:
|
5
|
+
bunny (0.8.0.pre1)
|
6
|
+
|
1
7
|
PATH
|
2
8
|
remote: .
|
3
9
|
specs:
|
4
|
-
cpi-event-connector (0.0.
|
10
|
+
cpi-event-connector (0.0.8)
|
5
11
|
activesupport (~> 3.1.4)
|
6
12
|
bunny
|
7
13
|
uuidtools (~> 2.1.2)
|
@@ -11,10 +17,10 @@ GEM
|
|
11
17
|
specs:
|
12
18
|
activesupport (3.1.4)
|
13
19
|
multi_json (~> 1.0)
|
14
|
-
|
20
|
+
backports (2.5.1)
|
15
21
|
diff-lcs (1.1.3)
|
16
22
|
justinf-unification_assertion (0.0.2)
|
17
|
-
multi_json (1.
|
23
|
+
multi_json (1.3.2)
|
18
24
|
rspec (2.8.0)
|
19
25
|
rspec-core (~> 2.8.0)
|
20
26
|
rspec-expectations (~> 2.8.0)
|
@@ -29,6 +35,8 @@ PLATFORMS
|
|
29
35
|
ruby
|
30
36
|
|
31
37
|
DEPENDENCIES
|
38
|
+
backports
|
39
|
+
bunny!
|
32
40
|
cpi-event-connector!
|
33
41
|
justinf-unification_assertion
|
34
42
|
rspec
|
data/cpi-event-connector.gemspec
CHANGED
@@ -18,6 +18,7 @@ Gem::Specification.new do |s|
|
|
18
18
|
|
19
19
|
# specify any dependencies here; for example:
|
20
20
|
s.add_development_dependency "rspec"
|
21
|
+
s.add_development_dependency "backports"
|
21
22
|
s.add_development_dependency "justinf-unification_assertion"
|
22
23
|
|
23
24
|
s.add_runtime_dependency "bunny"
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'active_support'
|
2
|
+
|
1
3
|
module Cpi
|
2
4
|
class Event
|
3
5
|
|
@@ -11,6 +13,7 @@ module Cpi
|
|
11
13
|
|
12
14
|
def self.transmit(event_type, tenant_uid, root_path)
|
13
15
|
return unless @@enabled
|
16
|
+
raise ArgumentError, "Tenant UID must be specified" if tenant_uid.blank?
|
14
17
|
event_json = Cpi::Generator.create_event(event_type, tenant_uid, root_path)
|
15
18
|
@@connector.transmit(event_json)
|
16
19
|
end
|
data/spec/connector_spec.rb
CHANGED
data/spec/event_spec.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'spec_helper'
|
2
|
-
|
2
|
+
require_relative '../lib/cpi_event_connector'
|
3
3
|
require 'yaml'
|
4
4
|
require 'active_support'
|
5
5
|
require 'unification_assertion'
|
@@ -71,5 +71,11 @@ enabled: false"
|
|
71
71
|
Cpi::Generator.should_not_receive(:create_event)
|
72
72
|
Cpi::Event.transmit("message", "tenant_uid", "content")
|
73
73
|
end
|
74
|
+
|
75
|
+
it "raises exception when no tenant_uid is passed in" do
|
76
|
+
Cpi::Event.configure(YAML::load(yaml_config).symbolize_keys!)
|
77
|
+
Cpi::Generator.should_not_receive(:create_event)
|
78
|
+
expect {Cpi::Event.transmit("message", nil, "content")}.to raise_error(ArgumentError)
|
79
|
+
end
|
74
80
|
end
|
75
81
|
end
|
data/spec/generator_spec.rb
CHANGED
data/spec/integration_spec.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cpi-event-connector
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 15
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 8
|
10
|
+
version: 0.0.8
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Nulogy
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-
|
18
|
+
date: 2012-04-23 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: rspec
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
type: :development
|
33
33
|
version_requirements: *id001
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
|
-
name:
|
35
|
+
name: backports
|
36
36
|
prerelease: false
|
37
37
|
requirement: &id002 !ruby/object:Gem::Requirement
|
38
38
|
none: false
|
@@ -46,7 +46,7 @@ dependencies:
|
|
46
46
|
type: :development
|
47
47
|
version_requirements: *id002
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
|
-
name:
|
49
|
+
name: justinf-unification_assertion
|
50
50
|
prerelease: false
|
51
51
|
requirement: &id003 !ruby/object:Gem::Requirement
|
52
52
|
none: false
|
@@ -57,12 +57,26 @@ dependencies:
|
|
57
57
|
segments:
|
58
58
|
- 0
|
59
59
|
version: "0"
|
60
|
-
type: :
|
60
|
+
type: :development
|
61
61
|
version_requirements: *id003
|
62
62
|
- !ruby/object:Gem::Dependency
|
63
|
-
name:
|
63
|
+
name: bunny
|
64
64
|
prerelease: false
|
65
65
|
requirement: &id004 !ruby/object:Gem::Requirement
|
66
|
+
none: false
|
67
|
+
requirements:
|
68
|
+
- - ">="
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
hash: 3
|
71
|
+
segments:
|
72
|
+
- 0
|
73
|
+
version: "0"
|
74
|
+
type: :runtime
|
75
|
+
version_requirements: *id004
|
76
|
+
- !ruby/object:Gem::Dependency
|
77
|
+
name: activesupport
|
78
|
+
prerelease: false
|
79
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
66
80
|
none: false
|
67
81
|
requirements:
|
68
82
|
- - ~>
|
@@ -74,11 +88,11 @@ dependencies:
|
|
74
88
|
- 4
|
75
89
|
version: 3.1.4
|
76
90
|
type: :runtime
|
77
|
-
version_requirements: *
|
91
|
+
version_requirements: *id005
|
78
92
|
- !ruby/object:Gem::Dependency
|
79
93
|
name: uuidtools
|
80
94
|
prerelease: false
|
81
|
-
requirement: &
|
95
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
82
96
|
none: false
|
83
97
|
requirements:
|
84
98
|
- - ~>
|
@@ -90,7 +104,7 @@ dependencies:
|
|
90
104
|
- 2
|
91
105
|
version: 2.1.2
|
92
106
|
type: :runtime
|
93
|
-
version_requirements: *
|
107
|
+
version_requirements: *id006
|
94
108
|
description: see summary
|
95
109
|
email:
|
96
110
|
- engineering@nulogy.com
|