event_people 1.0.1 → 1.0.2

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: 2b1e5ca203068a90528dffe028e28ff159fea2be235a8cb7124a27d65d9e994a
4
- data.tar.gz: '06552910da1f09062cd1a0056c9a048a05ced2fe48e8f29759c2d41dce1ea847'
3
+ metadata.gz: 2edc78cae5809676875057845aa4646b5b7c2cf10b2c0cd19a3db4303c20ed6d
4
+ data.tar.gz: f02920c4bcc5fa8851677050e33ad91fe09a647f598ae6bb5b955e0a72bafcf6
5
5
  SHA512:
6
- metadata.gz: 81234ed5232c88a4231c49d1bc0675ae9c637f99acc53e917d6fb193ddf8a6bbd0e0a9db1980009aad8abf16dc32be24d62afb455de8fd0bcfab2cdc0018c425
7
- data.tar.gz: d529f3a44d8a53f05c81a024a73ca8217e42cac3b338b58ed8015322b4c3dbe49788730560e044380fe46d2ad7e8cca42bbee36a67ad0b94e058cf62ee37f471
6
+ metadata.gz: 38b52078fbdf1dc410aba893b0269dc39bdfef91a651975100c3ec0d236e2dace74b3bda66e9d0fa9f9c0a8287cddeb0c369afe32c65a94fb00384acc41282cf
7
+ data.tar.gz: ebf453a791a7184943d92157b8bf693712e94f4fb40146cf3db4f76e10c4b35e0cf9b1de03cfe20619076226c4a3e5b546865c3d6bb2a53d5e49c386d263268e
data/.gitignore CHANGED
@@ -9,3 +9,7 @@
9
9
 
10
10
  .env*
11
11
  !.env.example
12
+
13
+ # IDE things
14
+ .idea
15
+ .vscode
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- event_people (1.0.1)
4
+ event_people (1.0.2)
5
5
  bunny (~> 2.7)
6
6
 
7
7
  GEM
@@ -53,6 +53,7 @@ GEM
53
53
 
54
54
  PLATFORMS
55
55
  arm64-darwin-21
56
+ x86_64-linux
56
57
 
57
58
  DEPENDENCIES
58
59
  bundler
data/README.md CHANGED
@@ -224,7 +224,7 @@ EventPeople::Daemon.start
224
224
 
225
225
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `bundle exec rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
226
226
 
227
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
227
+ To install this gem onto your local machine, run `bundle exec rake install`.
228
228
 
229
229
  ## Contributing
230
230
 
@@ -236,4 +236,4 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
236
236
 
237
237
  ## License
238
238
 
239
- The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
239
+ The gem is available as open source under the terms of the [LGPL 3.0 License](https://www.gnu.org/licenses/lgpl-3.0.en.html).
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
data/examples/listener.rb CHANGED
@@ -17,13 +17,18 @@ event_name = 'resource.origin.action'
17
17
 
18
18
  puts 'Start receiving messages'
19
19
 
20
- EventPeople::Listener.on(event_name) do |event|
20
+ EventPeople::Listener.on(event_name) do |event, context|
21
21
  puts ''
22
22
  puts " - Received a message from #{event.name}:"
23
23
  puts " Message: #{event.body}"
24
24
  puts ''
25
+
26
+ context.success!
25
27
  end
26
28
 
29
+ # Wait for job to finish!
30
+ sleep(0.5)
31
+
27
32
  puts 'Stop receiving messages'
28
33
 
29
34
  EventPeople::Config.broker.close_connection
@@ -29,8 +29,9 @@ module EventPeople
29
29
  event_name = delivery_info.routing_key
30
30
 
31
31
  event = EventPeople::Event.new(event_name, payload)
32
+ context = EventPeople::Listeners::Base.new(channel, delivery_info)
32
33
 
33
- block.call(event, channel, delivery_info)
34
+ block.call(event, context)
34
35
  end
35
36
 
36
37
  def topic
@@ -1,3 +1,3 @@
1
1
  module EventPeople
2
- VERSION = '1.0.1'
2
+ VERSION = '1.0.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: event_people
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pin People
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-08-13 00:00:00.000000000 Z
11
+ date: 2022-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -97,6 +97,7 @@ files:
97
97
  - LICENSE.txt
98
98
  - README.md
99
99
  - Rakefile
100
+ - bin/setup
100
101
  - event_people.gemspec
101
102
  - examples/daemon.rb
102
103
  - examples/emitter.rb