party_bus 0.2.0 → 0.4.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
  SHA256:
3
- metadata.gz: a35c124322fb4164c6ad19fc6617a4bfdfa6f176c41653e6570aabd0bf38854d
4
- data.tar.gz: 9f76b8c375ca124460a38f4ca33eb21630034bd615e45ae2d7a66d51338c2e71
3
+ metadata.gz: c484de78eda6cdad24bcbe12acc92afb139ebf046aa91539944e83568a68759b
4
+ data.tar.gz: 638499cd363796d5b93c801e5ed20b3e0e0781acb812253d3fec43fa9952a2f3
5
5
  SHA512:
6
- metadata.gz: '097f076dc927a87e0938f2f6d53b302bc86aff677211b39a849623989adadf4edae244ef1bcb3eb275e6a70288544d27c930fc1fd80cb1f0b3e42e488bc234c0'
7
- data.tar.gz: 85e86b6f85a1bfa12a33ce22d1d92a3921e72d25e046a960ecd00018fe66d30a2eedea4c83fb97fceda4ec610fef12a3dc353a777cb284fbc3ca1cd5bfa96bb8
6
+ metadata.gz: 1c7cb41f8793bf7a5ae6196dae85459dc94f50636a8e19070f78e93426aa2201a26041aa03aa7aad7a6a6832131b2b054956bc744bfed16d38d101732c7cfe09
7
+ data.tar.gz: 3b3110e0ab2e70e21e57622da6fae956d442f22e6ce2e2c470f419aa5a837562ee8657c78d9aafeb09885aacd9f3629a94cf7bc9ec49399cc02594d44ae7f547
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- party_bus (0.2.0)
4
+ party_bus (0.4.0)
5
5
  activerecord (>= 6.0, <= 8.0)
6
6
  after_do (~> 0.4.0)
7
7
  httparty (~> 0.20.0)
@@ -9,21 +9,21 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- activemodel (7.0.3.1)
13
- activesupport (= 7.0.3.1)
14
- activerecord (7.0.3.1)
15
- activemodel (= 7.0.3.1)
16
- activesupport (= 7.0.3.1)
17
- activesupport (7.0.3.1)
12
+ activemodel (7.0.4.3)
13
+ activesupport (= 7.0.4.3)
14
+ activerecord (7.0.4.3)
15
+ activemodel (= 7.0.4.3)
16
+ activesupport (= 7.0.4.3)
17
+ activesupport (7.0.4.3)
18
18
  concurrent-ruby (~> 1.0, >= 1.0.2)
19
19
  i18n (>= 1.6, < 2)
20
20
  minitest (>= 5.1)
21
21
  tzinfo (~> 2.0)
22
- addressable (2.8.0)
23
- public_suffix (>= 2.0.2, < 5.0)
22
+ addressable (2.8.1)
23
+ public_suffix (>= 2.0.2, < 6.0)
24
24
  after_do (0.4.0)
25
25
  byebug (11.1.3)
26
- concurrent-ruby (1.1.10)
26
+ concurrent-ruby (1.2.2)
27
27
  crack (0.4.5)
28
28
  rexml
29
29
  diff-lcs (1.5.0)
@@ -36,29 +36,29 @@ GEM
36
36
  concurrent-ruby (~> 1.0)
37
37
  mime-types (3.4.1)
38
38
  mime-types-data (~> 3.2015)
39
- mime-types-data (3.2022.0105)
40
- minitest (5.16.2)
39
+ mime-types-data (3.2023.0218.1)
40
+ minitest (5.18.0)
41
41
  multi_xml (0.6.0)
42
- pg (1.4.3)
43
- public_suffix (4.0.7)
42
+ pg (1.4.6)
43
+ public_suffix (5.0.1)
44
44
  rake (12.3.3)
45
45
  rexml (3.2.5)
46
- rspec (3.10.0)
47
- rspec-core (~> 3.10.0)
48
- rspec-expectations (~> 3.10.0)
49
- rspec-mocks (~> 3.10.0)
50
- rspec-core (3.10.1)
51
- rspec-support (~> 3.10.0)
52
- rspec-expectations (3.10.2)
46
+ rspec (3.12.0)
47
+ rspec-core (~> 3.12.0)
48
+ rspec-expectations (~> 3.12.0)
49
+ rspec-mocks (~> 3.12.0)
50
+ rspec-core (3.12.1)
51
+ rspec-support (~> 3.12.0)
52
+ rspec-expectations (3.12.2)
53
53
  diff-lcs (>= 1.2.0, < 2.0)
54
- rspec-support (~> 3.10.0)
55
- rspec-mocks (3.10.2)
54
+ rspec-support (~> 3.12.0)
55
+ rspec-mocks (3.12.4)
56
56
  diff-lcs (>= 1.2.0, < 2.0)
57
- rspec-support (~> 3.10.0)
58
- rspec-support (3.10.3)
59
- tzinfo (2.0.5)
57
+ rspec-support (~> 3.12.0)
58
+ rspec-support (3.12.0)
59
+ tzinfo (2.0.6)
60
60
  concurrent-ruby (~> 1.0)
61
- webmock (3.14.0)
61
+ webmock (3.18.1)
62
62
  addressable (>= 2.8.0)
63
63
  crack (>= 0.3.2)
64
64
  hashdiff (>= 0.4.0, < 2.0.0)
data/README.md CHANGED
@@ -26,7 +26,7 @@ And then execute:
26
26
 
27
27
  Generate project initializer.
28
28
 
29
- $ bin/rails generate party_bus <api key>
29
+ $ bin/rails generate party_bus <connection id> <connection secret>
30
30
 
31
31
  Add the helper to any object you would like to observe events. To add the helper to every model in your rails application.
32
32
 
@@ -7,7 +7,7 @@ module PartyBus
7
7
  attr_accessor :stripped_attributes
8
8
 
9
9
  def initialize
10
- self.api_url = "https://party-bus.gigalixirapp.com"
10
+ self.api_url = "https://partybus-api.aridsoftware.com"
11
11
  self.connection_id = nil
12
12
  self.enabled = ENV['RUBY_ENV'] != 'test' && ENV['RAILS_ENV'] != 'test'
13
13
  self.secret = nil
@@ -4,17 +4,15 @@ module PartyBus
4
4
  def self.perform_using(
5
5
  connection_id:,
6
6
  payload:,
7
- resource_action:,
8
- resource_type:,
9
- timestamp: Time.now
7
+ timestamp: Time.now,
8
+ topic:
10
9
  )
11
- new(connection_id, payload, resource_type, resource_action, timestamp).perform
10
+ new(connection_id, payload, topic, timestamp).perform
12
11
  end
13
12
 
14
- def initialize(connection_id, payload, resource_type, resource_action, timestamp)
13
+ def initialize(connection_id, payload, topic, timestamp)
15
14
  @connection_id = connection_id
16
- @resource_type = resource_type
17
- @resource_action = resource_action
15
+ @topic = topic
18
16
  @payload = payload
19
17
  @timestamp = timestamp
20
18
  end
@@ -24,8 +22,7 @@ module PartyBus
24
22
  body: {
25
23
  event: {
26
24
  payload: @payload,
27
- resource_action: @resource_action,
28
- resource_type: @resource_type
25
+ topic: @topic,
29
26
  }
30
27
  },
31
28
  path: "/api/v1/connections/#{@connection_id}/events",
@@ -49,8 +49,7 @@ module Publishable
49
49
  {
50
50
  connection_id: pb_connection_id,
51
51
  payload: pb_payload,
52
- resource_type: pb_resource_name,
53
- resource_action: action,
52
+ topic: "#{pb_resource_name}.#{action}"
54
53
  }
55
54
  end
56
55
 
@@ -1,3 +1,3 @@
1
1
  module PartyBus
2
- VERSION = "0.2.0"
2
+ VERSION = "0.4.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: party_bus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - corey jergensen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-09-28 00:00:00.000000000 Z
11
+ date: 2023-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: after_do