zaikio-loom 1.1.0 → 1.3.1

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
  SHA256:
3
- metadata.gz: f5c0f9cb5244311b411a7024d1214aa0b885bb642a5b4c116aaf18e6642dc4d4
4
- data.tar.gz: 95d524d358afba55493c097b4fe2c48096b7f089ed8f151e71592ba1b79af1e9
3
+ metadata.gz: f1726071bcfc562e515cb666886cd6c2f1115a8e45e936a0cba4f24369a61c7c
4
+ data.tar.gz: 221fac1ee2179ef715cb0c00dfd4600e018d7c501339c10bb1dcae44396bb5c4
5
5
  SHA512:
6
- metadata.gz: a14d784c822c8ecb98a783aec551aa13fe2e1a59b453f249711d121935f139fda3bf5114d480ca2b8516794e63b33c7e91e3cb6450f67a9de45456029c7f5c5f
7
- data.tar.gz: 8c8c28cc2d2a7203d21067be3b2c17fd1005492fde9ab8704d6d952bd63e2bc3d5cb908d87e884c61edd3ebf81e1d62cb0a0e6398875f13526c1b8ed7d360f49
6
+ metadata.gz: c0913c9a4e144f94467f57ec49f30ee7fe9dde081c9cb67de2bc0fc89678c4f3632848806cb35b0f12237502f2ade6060a62a9f6f4b3113bf4b6b36d0a7f832f
7
+ data.tar.gz: 505627a9530b3b2f7dd299f886f674c81344ce2fef1fb11dce2dee0c3fe95220111e9e7b915fda1ec59eb4ffb410ba18e0ab6c507580eb7b39303e5af0a0f141
data/.circleci/config.yml CHANGED
@@ -1,9 +1,12 @@
1
- version: 2
1
+ version: 2.1
2
2
  jobs:
3
- build:
3
+ test:
4
4
  docker:
5
- - image: circleci/ruby:3.0.0
6
- - image: circleci/redis:3.2-alpine
5
+ - image: cimg/ruby:3.0.3
6
+ environment:
7
+ BUNDLE_JOBS: 4
8
+ BUNDLE_RETRY: 3
9
+ BUNDLE_PATH: vendor/bundle
7
10
 
8
11
  working_directory: ~/repo
9
12
 
@@ -12,22 +15,53 @@ jobs:
12
15
 
13
16
  - restore_cache:
14
17
  keys:
15
- - v1-dependencies-{{ checksum "Gemfile.lock" }}
18
+ - v1-dependencies-{{ checksum "zaikio-loom.gemspec" }}
16
19
  # fallback to using the latest cache if no exact match is found
17
20
  - v1-dependencies-
18
21
 
19
22
  - run:
20
23
  name: install dependencies
21
- command: |
22
- gem install bundler:2.1.4 && bundle install --jobs=4 --retry=3 --path vendor/bundle
24
+ command: gem install bundler && bundle install
23
25
 
24
26
  - save_cache:
25
27
  paths:
26
28
  - ./vendor/bundle
27
- key: v1-dependencies-{{ checksum "Gemfile.lock" }}
29
+ key: v1-dependencies-{{ checksum "zaikio-loom.gemspec" }}
30
+
31
+ - run: bundle exec rake test
32
+
33
+ publish:
34
+ docker:
35
+ - image: cimg/ruby:3.0.3
36
+
37
+ working_directory: ~/repo
28
38
 
29
- # run tests!
39
+ steps:
40
+ - checkout
30
41
  - run:
31
- name: run tests
42
+ name: Build package
43
+ command: gem build zaikio-loom.gemspec
44
+ - run:
45
+ name: Push package
32
46
  command: |
33
- bundle exec rake test
47
+ VERSION=$(ruby -r "./lib/zaikio/loom/version.rb" -e "print Zaikio::Loom::VERSION")
48
+ gem push zaikio-loom-${VERSION}.gem
49
+
50
+ workflows:
51
+ default:
52
+ jobs:
53
+ - test:
54
+ filters:
55
+ tags:
56
+ only: /.*/
57
+ branches:
58
+ only: /.*/
59
+ - publish:
60
+ context:
61
+ - rubygems-push
62
+ requires: [test]
63
+ filters:
64
+ tags:
65
+ only: /^v.*/
66
+ branches:
67
+ ignore: /.*/
@@ -0,0 +1,11 @@
1
+ version: 2
2
+
3
+ updates:
4
+ - package-ecosystem: bundler
5
+ directory: "/"
6
+ reviewers:
7
+ - jalyna
8
+ schedule:
9
+ interval: daily
10
+ time: "04:00"
11
+ open-pull-requests-limit: 10
data/.gitignore CHANGED
@@ -8,5 +8,6 @@
8
8
  /tmp/
9
9
  .gem
10
10
  .DS_Store
11
+ Gemfile.lock
11
12
  test/dummy/tmp
12
13
  test/dummy/log
data/CHANGELOG.md CHANGED
@@ -1,6 +1,22 @@
1
1
  # Zaikio Loom Ruby Gem Changelog
2
2
 
3
- ## master
3
+ ## [Unreleased]
4
+
5
+ ## 1.3.1 - 2022-01-07
6
+
7
+ - Permit Rails 7
8
+
9
+ ## 1.3.0 - 2021-11-22
10
+
11
+ - Support configuration of `queue` for FireEventJob
12
+
13
+ ## 1.2.0 - 2021-10-18
14
+
15
+ - **BREAKING** Fixed: Throw new `Zaikio::Loom::Error` when posting events fails (e.g. 422)
16
+
17
+ ## 1.1.1 - 2021-03-25
18
+
19
+ * Replace dependency on `rails` with a more specific dependency on `railties` and friends
4
20
 
5
21
  ## 1.1.0 - 2021-01-05
6
22
 
data/Gemfile CHANGED
@@ -2,3 +2,8 @@ source "https://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in zaikio-loom.gemspec
4
4
  gemspec
5
+
6
+ gem "actionpack"
7
+ gem "actionview"
8
+ gem "activemodel"
9
+ gem "sprockets-rails"
data/README.md CHANGED
@@ -136,7 +136,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
136
136
 
137
137
  ## Contributing
138
138
 
139
- Bug reports and pull requests are welcome on GitHub at https://github.com/crispymtn/zai-loom-ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
139
+ Bug reports and pull requests are welcome on GitHub at https://github.com/zaikio/zaikio-loom-ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
140
140
 
141
141
  ## License
142
142
 
@@ -144,4 +144,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
144
144
 
145
145
  ## Code of Conduct
146
146
 
147
- Everyone interacting in the Zaikio Loom Ruby gem project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/crispymtn/zai-loom-ruby/blob/master/CODE_OF_CONDUCT.md).
147
+ Everyone interacting in the Zaikio Loom Ruby gem project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/zaikio/zaikio-loom-ruby/blob/master/CODE_OF_CONDUCT.md).
@@ -10,7 +10,7 @@ module Zaikio
10
10
  }.freeze
11
11
 
12
12
  attr_accessor :version
13
- attr_reader :environment, :host, :apps
13
+ attr_reader :environment, :host, :apps, :queue
14
14
  attr_writer :logger
15
15
 
16
16
  def initialize
@@ -27,6 +27,10 @@ module Zaikio
27
27
  @host = HOSTS[environment]
28
28
  end
29
29
 
30
+ def queue=(name)
31
+ Zaikio::Loom::FireEventJob.queue_as(name)
32
+ end
33
+
30
34
  def application(name)
31
35
  @apps[name.to_s] = AppConfiguration.new(name.to_s)
32
36
  yield(@apps[name.to_s])
@@ -0,0 +1,14 @@
1
+ module Zaikio
2
+ module Loom
3
+ class Error < StandardError
4
+ attr_reader :body, :status_code
5
+
6
+ def initialize(message = nil, body:, status_code:)
7
+ super(message)
8
+
9
+ @body = body
10
+ @status_code = status_code
11
+ end
12
+ end
13
+ end
14
+ end
@@ -37,6 +37,14 @@ module Zaikio
37
37
  @status_code = response.code.to_i
38
38
  @response_body = response.body
39
39
 
40
+ unless response.is_a?(Net::HTTPSuccess)
41
+ raise Zaikio::Loom::Error.new(
42
+ "Sending event failed (#{@status_code}): #{@response_body}",
43
+ body: @response_body,
44
+ status_code: @status_code
45
+ )
46
+ end
47
+
40
48
  response.is_a?(Net::HTTPSuccess)
41
49
  end
42
50
 
@@ -1,5 +1,5 @@
1
1
  module Zaikio
2
2
  module Loom
3
- VERSION = "1.1.0".freeze
3
+ VERSION = "1.3.1".freeze
4
4
  end
5
5
  end
data/lib/zaikio/loom.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require "zaikio/loom/app_configuration"
2
2
  require "zaikio/loom/configuration"
3
+ require "zaikio/loom/error"
3
4
  require "zaikio/loom/event"
4
5
  require "zaikio/loom/event_serializer"
5
6
  require "zaikio/loom/railtie"
data/zaikio-loom.gemspec CHANGED
@@ -8,11 +8,11 @@ Gem::Specification.new do |spec|
8
8
 
9
9
  spec.authors = ["crispymtn", "Martin Spickermann"]
10
10
  spec.email = ["op@crispymtn.com", "spickermann@gmail.com"]
11
- spec.homepage = "https://github.com/crispymtn/zai-loom-ruby"
11
+ spec.homepage = "https://github.com/zaikio/zaikio-loom-ruby"
12
12
  spec.license = "MIT"
13
13
  spec.summary = "The Zaikio Loom Ruby Gem simplifies publishing events on the Zaikio Loom event system."
14
14
 
15
- spec.metadata["changelog_uri"] = "https://github.com/crispymtn/zai-loom-ruby/blob/master/CHANGELOG.md"
15
+ spec.metadata["changelog_uri"] = "https://github.com/zaikio/zaikio-loom-ruby/blob/master/CHANGELOG.md"
16
16
  spec.metadata["homepage_uri"] = spec.homepage
17
17
  spec.metadata["source_code_uri"] = spec.homepage
18
18
 
@@ -23,8 +23,9 @@ Gem::Specification.new do |spec|
23
23
  end
24
24
  spec.require_paths = ["lib"]
25
25
 
26
+ spec.add_dependency "activejob"
26
27
  spec.add_dependency "nokogiri", ">= 1.11.0"
27
- spec.add_dependency "rails", "~> 6.0", ">= 6.0.2.3"
28
+ spec.add_dependency "railties", ">= 6.0.2.3", "< 8"
28
29
  spec.add_runtime_dependency "oj"
29
30
  spec.required_ruby_version = ">= 2.7.1"
30
31
 
metadata CHANGED
@@ -1,16 +1,30 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zaikio-loom
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - crispymtn
8
8
  - Martin Spickermann
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-01-05 00:00:00.000000000 Z
12
+ date: 2022-01-07 00:00:00.000000000 Z
13
13
  dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: activejob
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ">="
19
+ - !ruby/object:Gem::Version
20
+ version: '0'
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ version: '0'
14
28
  - !ruby/object:Gem::Dependency
15
29
  name: nokogiri
16
30
  requirement: !ruby/object:Gem::Requirement
@@ -26,25 +40,25 @@ dependencies:
26
40
  - !ruby/object:Gem::Version
27
41
  version: 1.11.0
28
42
  - !ruby/object:Gem::Dependency
29
- name: rails
43
+ name: railties
30
44
  requirement: !ruby/object:Gem::Requirement
31
45
  requirements:
32
- - - "~>"
33
- - !ruby/object:Gem::Version
34
- version: '6.0'
35
46
  - - ">="
36
47
  - !ruby/object:Gem::Version
37
48
  version: 6.0.2.3
49
+ - - "<"
50
+ - !ruby/object:Gem::Version
51
+ version: '8'
38
52
  type: :runtime
39
53
  prerelease: false
40
54
  version_requirements: !ruby/object:Gem::Requirement
41
55
  requirements:
42
- - - "~>"
43
- - !ruby/object:Gem::Version
44
- version: '6.0'
45
56
  - - ">="
46
57
  - !ruby/object:Gem::Version
47
58
  version: 6.0.2.3
59
+ - - "<"
60
+ - !ruby/object:Gem::Version
61
+ version: '8'
48
62
  - !ruby/object:Gem::Dependency
49
63
  name: oj
50
64
  requirement: !ruby/object:Gem::Requirement
@@ -185,7 +199,7 @@ dependencies:
185
199
  - - ">="
186
200
  - !ruby/object:Gem::Version
187
201
  version: '0'
188
- description:
202
+ description:
189
203
  email:
190
204
  - op@crispymtn.com
191
205
  - spickermann@gmail.com
@@ -194,12 +208,12 @@ extensions: []
194
208
  extra_rdoc_files: []
195
209
  files:
196
210
  - ".circleci/config.yml"
211
+ - ".github/dependabot.yml"
197
212
  - ".gitignore"
198
213
  - ".rubocop.yml"
199
214
  - CHANGELOG.md
200
215
  - CODE_OF_CONDUCT.md
201
216
  - Gemfile
202
- - Gemfile.lock
203
217
  - LICENSE.txt
204
218
  - README.md
205
219
  - Rakefile
@@ -211,19 +225,20 @@ files:
211
225
  - lib/zaikio/loom/app_configuration.rb
212
226
  - lib/zaikio/loom/configuration.rb
213
227
  - lib/zaikio/loom/engine.rb
228
+ - lib/zaikio/loom/error.rb
214
229
  - lib/zaikio/loom/event.rb
215
230
  - lib/zaikio/loom/event_serializer.rb
216
231
  - lib/zaikio/loom/railtie.rb
217
232
  - lib/zaikio/loom/version.rb
218
233
  - zaikio-loom.gemspec
219
- homepage: https://github.com/crispymtn/zai-loom-ruby
234
+ homepage: https://github.com/zaikio/zaikio-loom-ruby
220
235
  licenses:
221
236
  - MIT
222
237
  metadata:
223
- changelog_uri: https://github.com/crispymtn/zai-loom-ruby/blob/master/CHANGELOG.md
224
- homepage_uri: https://github.com/crispymtn/zai-loom-ruby
225
- source_code_uri: https://github.com/crispymtn/zai-loom-ruby
226
- post_install_message:
238
+ changelog_uri: https://github.com/zaikio/zaikio-loom-ruby/blob/master/CHANGELOG.md
239
+ homepage_uri: https://github.com/zaikio/zaikio-loom-ruby
240
+ source_code_uri: https://github.com/zaikio/zaikio-loom-ruby
241
+ post_install_message:
227
242
  rdoc_options: []
228
243
  require_paths:
229
244
  - lib
@@ -238,8 +253,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
238
253
  - !ruby/object:Gem::Version
239
254
  version: '0'
240
255
  requirements: []
241
- rubygems_version: 3.2.3
242
- signing_key:
256
+ rubygems_version: 3.2.32
257
+ signing_key:
243
258
  specification_version: 4
244
259
  summary: The Zaikio Loom Ruby Gem simplifies publishing events on the Zaikio Loom
245
260
  event system.
data/Gemfile.lock DELETED
@@ -1,196 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- zaikio-loom (1.1.0)
5
- nokogiri (>= 1.11.0)
6
- oj
7
- rails (~> 6.0, >= 6.0.2.3)
8
-
9
- GEM
10
- remote: https://rubygems.org/
11
- specs:
12
- actioncable (6.1.0)
13
- actionpack (= 6.1.0)
14
- activesupport (= 6.1.0)
15
- nio4r (~> 2.0)
16
- websocket-driver (>= 0.6.1)
17
- actionmailbox (6.1.0)
18
- actionpack (= 6.1.0)
19
- activejob (= 6.1.0)
20
- activerecord (= 6.1.0)
21
- activestorage (= 6.1.0)
22
- activesupport (= 6.1.0)
23
- mail (>= 2.7.1)
24
- actionmailer (6.1.0)
25
- actionpack (= 6.1.0)
26
- actionview (= 6.1.0)
27
- activejob (= 6.1.0)
28
- activesupport (= 6.1.0)
29
- mail (~> 2.5, >= 2.5.4)
30
- rails-dom-testing (~> 2.0)
31
- actionpack (6.1.0)
32
- actionview (= 6.1.0)
33
- activesupport (= 6.1.0)
34
- rack (~> 2.0, >= 2.0.9)
35
- rack-test (>= 0.6.3)
36
- rails-dom-testing (~> 2.0)
37
- rails-html-sanitizer (~> 1.0, >= 1.2.0)
38
- actiontext (6.1.0)
39
- actionpack (= 6.1.0)
40
- activerecord (= 6.1.0)
41
- activestorage (= 6.1.0)
42
- activesupport (= 6.1.0)
43
- nokogiri (>= 1.8.5)
44
- actionview (6.1.0)
45
- activesupport (= 6.1.0)
46
- builder (~> 3.1)
47
- erubi (~> 1.4)
48
- rails-dom-testing (~> 2.0)
49
- rails-html-sanitizer (~> 1.1, >= 1.2.0)
50
- activejob (6.1.0)
51
- activesupport (= 6.1.0)
52
- globalid (>= 0.3.6)
53
- activemodel (6.1.0)
54
- activesupport (= 6.1.0)
55
- activerecord (6.1.0)
56
- activemodel (= 6.1.0)
57
- activesupport (= 6.1.0)
58
- activestorage (6.1.0)
59
- actionpack (= 6.1.0)
60
- activejob (= 6.1.0)
61
- activerecord (= 6.1.0)
62
- activesupport (= 6.1.0)
63
- marcel (~> 0.3.1)
64
- mimemagic (~> 0.3.2)
65
- activesupport (6.1.0)
66
- concurrent-ruby (~> 1.0, >= 1.0.2)
67
- i18n (>= 1.6, < 2)
68
- minitest (>= 5.1)
69
- tzinfo (~> 2.0)
70
- zeitwerk (~> 2.3)
71
- addressable (2.7.0)
72
- public_suffix (>= 2.0.2, < 5.0)
73
- ast (2.4.1)
74
- builder (3.2.4)
75
- concurrent-ruby (1.1.7)
76
- crack (0.4.5)
77
- rexml
78
- crass (1.0.6)
79
- erubi (1.10.0)
80
- globalid (0.4.2)
81
- activesupport (>= 4.2.0)
82
- hashdiff (1.0.1)
83
- i18n (1.8.7)
84
- concurrent-ruby (~> 1.0)
85
- loofah (2.8.0)
86
- crass (~> 1.0.2)
87
- nokogiri (>= 1.5.9)
88
- mail (2.7.1)
89
- mini_mime (>= 0.1.1)
90
- marcel (0.3.3)
91
- mimemagic (~> 0.3.2)
92
- method_source (1.0.0)
93
- mimemagic (0.3.5)
94
- mini_mime (1.0.2)
95
- mini_portile2 (2.5.0)
96
- minitest (5.14.2)
97
- mocha (1.12.0)
98
- nio4r (2.5.4)
99
- nokogiri (1.11.0)
100
- mini_portile2 (~> 2.5.0)
101
- racc (~> 1.4)
102
- oj (3.10.18)
103
- parallel (1.20.1)
104
- parser (3.0.0.0)
105
- ast (~> 2.4.1)
106
- public_suffix (4.0.6)
107
- racc (1.5.2)
108
- rack (2.2.3)
109
- rack-test (1.1.0)
110
- rack (>= 1.0, < 3)
111
- rails (6.1.0)
112
- actioncable (= 6.1.0)
113
- actionmailbox (= 6.1.0)
114
- actionmailer (= 6.1.0)
115
- actionpack (= 6.1.0)
116
- actiontext (= 6.1.0)
117
- actionview (= 6.1.0)
118
- activejob (= 6.1.0)
119
- activemodel (= 6.1.0)
120
- activerecord (= 6.1.0)
121
- activestorage (= 6.1.0)
122
- activesupport (= 6.1.0)
123
- bundler (>= 1.15.0)
124
- railties (= 6.1.0)
125
- sprockets-rails (>= 2.0.0)
126
- rails-dom-testing (2.0.3)
127
- activesupport (>= 4.2.0)
128
- nokogiri (>= 1.6)
129
- rails-html-sanitizer (1.3.0)
130
- loofah (~> 2.3)
131
- railties (6.1.0)
132
- actionpack (= 6.1.0)
133
- activesupport (= 6.1.0)
134
- method_source
135
- rake (>= 0.8.7)
136
- thor (~> 1.0)
137
- rainbow (3.0.0)
138
- rake (13.0.3)
139
- regexp_parser (2.0.3)
140
- rexml (3.2.4)
141
- rubocop (1.7.0)
142
- parallel (~> 1.10)
143
- parser (>= 2.7.1.5)
144
- rainbow (>= 2.2.2, < 4.0)
145
- regexp_parser (>= 1.8, < 3.0)
146
- rexml
147
- rubocop-ast (>= 1.2.0, < 2.0)
148
- ruby-progressbar (~> 1.7)
149
- unicode-display_width (>= 1.4.0, < 2.0)
150
- rubocop-ast (1.4.0)
151
- parser (>= 2.7.1.5)
152
- rubocop-minitest (0.10.2)
153
- rubocop (>= 0.87, < 2.0)
154
- rubocop-performance (1.9.2)
155
- rubocop (>= 0.90.0, < 2.0)
156
- rubocop-ast (>= 0.4.0)
157
- rubocop-rake (0.5.1)
158
- rubocop
159
- ruby-progressbar (1.11.0)
160
- sprockets (4.0.2)
161
- concurrent-ruby (~> 1.0)
162
- rack (> 1, < 3)
163
- sprockets-rails (3.2.2)
164
- actionpack (>= 4.0)
165
- activesupport (>= 4.0)
166
- sprockets (>= 3.0.0)
167
- thor (1.0.1)
168
- tzinfo (2.0.4)
169
- concurrent-ruby (~> 1.0)
170
- unicode-display_width (1.7.0)
171
- webmock (3.11.0)
172
- addressable (>= 2.3.6)
173
- crack (>= 0.3.2)
174
- hashdiff (>= 0.4.0, < 2.0.0)
175
- websocket-driver (0.7.3)
176
- websocket-extensions (>= 0.1.0)
177
- websocket-extensions (0.1.5)
178
- zeitwerk (2.4.2)
179
-
180
- PLATFORMS
181
- ruby
182
-
183
- DEPENDENCIES
184
- bundler
185
- minitest
186
- mocha
187
- rake
188
- rubocop
189
- rubocop-minitest
190
- rubocop-performance
191
- rubocop-rake
192
- webmock
193
- zaikio-loom!
194
-
195
- BUNDLED WITH
196
- 2.2.3