jackhammer 1.2.0 → 1.3.4

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: b05bbadd40bdcdbf69d7ed079f5da3b5ef7494e5cfab42288b0e114aa1effb7c
4
- data.tar.gz: 4db8060a85601dae226889a134531c48bf4b2b389b399f9bf782985f6909dd03
3
+ metadata.gz: 38bd9a7e8b2be82da0c8751c93a24c77b40a580de54b40041479e7585487d160
4
+ data.tar.gz: 06b2c035650f92b9bf48297107457d99820bd54bb80f97a63463b462cc52e320
5
5
  SHA512:
6
- metadata.gz: 3685542942aa0dcb6568bfa408a44015eeeade76268f610bd7a119feb8d6092e6c588dc846c7699325646ca86e6e242c7935b5eac1efa2e6334bdef1bfafcdd2
7
- data.tar.gz: 16300121a91938775bf6f4a6e7e89cae0a4764653fc64e4e92f8c7a655be7e2953ff8a473a95f8d5205909150ac2226a641c7c687b06f30abff8e412c87a919e
6
+ metadata.gz: 380993eadd3d1fc75491dda76684bed6192c9b5761b838d681f81258c844413ee70a07a2a1594a67374c45958e3c6fe3eeaf8cc54657e3ce652421e039910b42
7
+ data.tar.gz: 18cd2e224c838c1efaad1c80720792af77e68efd1c52b962d272e7824401398ee81ef3acae8eb92c69947b6a25728023b95eb6064381e5cd8c5e43306b1f5e73
@@ -0,0 +1,33 @@
1
+ ---
2
+ name: Bug report
3
+ about: Create a report to track an issue that has been identified
4
+ title: ''
5
+ labels: ''
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Describe the bug**
11
+ A clear and concise description of what the bug is.
12
+
13
+ **To Reproduce**
14
+ Steps to reproduce the behavior:
15
+ 1. Go to '...'
16
+ 2. Click on '....'
17
+ 3. Scroll down to '....'
18
+ 4. See error
19
+
20
+ **Expected behavior**
21
+ A clear and concise description of what you expected to happen.
22
+
23
+ **Mutation/Query**
24
+
25
+ **URL and HTTP method (for non-GQL):**
26
+
27
+ **Sentry or Logs URL:**
28
+
29
+ **User/authentication details**
30
+ Impacted user name or service account
31
+
32
+ **Additional context**
33
+ Add any other context about the problem here.
@@ -0,0 +1 @@
1
+ blank_issues_enabled: false
@@ -0,0 +1,22 @@
1
+ ---
2
+ name: New story
3
+ about: Add a new story for implementation
4
+ title: ''
5
+ labels: ''
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Describe the solution**
11
+ A clear and concise description of what you want to happen.
12
+ When will this feature be done?
13
+
14
+ **Describe the users**
15
+ Who are we building this feature for?
16
+
17
+ **Additional context**
18
+ Add any other context or screenshots about the feature request here.
19
+ Link to any applicable documents describing the feature.
20
+
21
+ **Designs**
22
+ Link to any applicable designs on Invision.
@@ -0,0 +1,18 @@
1
+ ## Description
2
+ <!--- Describe your changes in detail -->
3
+
4
+ ## Related issue(s)
5
+ <!--- GH issue number -->
6
+
7
+ ## Motivation and Context
8
+ <!--- Why is this change required? What problem does it solve? -->
9
+ <!--- If it fixes an open issue, please link to the issue here. -->
10
+
11
+ ## How Has This Been Tested?
12
+ <!--- Please describe in detail how you tested your changes. -->
13
+
14
+ ## Screenshots (if appropriate):
15
+ <!--- Please add any screenshots of the feature. -->
16
+
17
+ ## Related PRs
18
+ <!--- Please add links to any related PRs (backend, component packages, etc). -->
@@ -0,0 +1,16 @@
1
+ # automatically approve PRs submitted by Dependabot
2
+ # this will allow Dependabot to automatically merge dependency update PRs where CI passes
3
+ # from: https://github.com/hmarr/auto-approve-action
4
+ name: Auto approve Dependabot PRs
5
+
6
+ on:
7
+ pull_request
8
+
9
+ jobs:
10
+ auto-approve:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: hmarr/auto-approve-action@v2.0.0
14
+ if: github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]'
15
+ with:
16
+ github-token: "${{ secrets.GITHUB_TOKEN }}"
@@ -3,8 +3,9 @@ sudo: false
3
3
  language: ruby
4
4
  cache: bundler
5
5
  rvm:
6
- - 2.5
7
6
  - 2.6
7
+ - 2.7
8
8
  before_install: gem install bundler
9
9
  script:
10
- - bundle exec rake
10
+ - bundle exec rake spec
11
+ - bundle exec rake rubocop
@@ -1,55 +1,80 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- jackhammer (1.2.0)
4
+ jackhammer (1.3.4)
5
5
  bunny (~> 2.14)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- amq-protocol (2.3.0)
10
+ activemodel (6.0.3.1)
11
+ activesupport (= 6.0.3.1)
12
+ activerecord (6.0.3.1)
13
+ activemodel (= 6.0.3.1)
14
+ activesupport (= 6.0.3.1)
15
+ activesupport (6.0.3.1)
16
+ concurrent-ruby (~> 1.0, >= 1.0.2)
17
+ i18n (>= 0.7, < 2)
18
+ minitest (~> 5.1)
19
+ tzinfo (~> 1.1)
20
+ zeitwerk (~> 2.2, >= 2.2.2)
21
+ amq-protocol (2.3.1)
11
22
  ast (2.4.0)
12
- bunny (2.14.3)
13
- amq-protocol (~> 2.3, >= 2.3.0)
23
+ bunny (2.15.0)
24
+ amq-protocol (~> 2.3, >= 2.3.1)
14
25
  bunny-mock (1.7.0)
15
26
  bunny (>= 1.7)
16
- byebug (11.1.1)
27
+ byebug (11.1.3)
28
+ concurrent-ruby (1.1.6)
17
29
  diff-lcs (1.3)
18
- jaro_winkler (1.5.4)
30
+ i18n (1.8.2)
31
+ concurrent-ruby (~> 1.0)
32
+ minitest (5.14.1)
19
33
  parallel (1.19.1)
20
- parser (2.7.0.2)
34
+ parser (2.7.1.2)
21
35
  ast (~> 2.4.0)
22
36
  rainbow (3.0.0)
23
37
  rake (13.0.1)
38
+ rexml (3.2.4)
24
39
  rspec (3.9.0)
25
40
  rspec-core (~> 3.9.0)
26
41
  rspec-expectations (~> 3.9.0)
27
42
  rspec-mocks (~> 3.9.0)
28
- rspec-core (3.9.1)
29
- rspec-support (~> 3.9.1)
30
- rspec-expectations (3.9.0)
43
+ rspec-core (3.9.2)
44
+ rspec-support (~> 3.9.3)
45
+ rspec-expectations (3.9.2)
31
46
  diff-lcs (>= 1.2.0, < 2.0)
32
47
  rspec-support (~> 3.9.0)
33
48
  rspec-mocks (3.9.1)
34
49
  diff-lcs (>= 1.2.0, < 2.0)
35
50
  rspec-support (~> 3.9.0)
36
- rspec-support (3.9.2)
37
- rubocop (0.79.0)
38
- jaro_winkler (~> 1.5.1)
51
+ rspec-support (3.9.3)
52
+ rubocop (0.84.0)
39
53
  parallel (~> 1.10)
40
54
  parser (>= 2.7.0.1)
41
55
  rainbow (>= 2.2.2, < 4.0)
56
+ rexml
57
+ rubocop-ast (>= 0.0.3)
42
58
  ruby-progressbar (~> 1.7)
43
- unicode-display_width (>= 1.4.0, < 1.7)
44
- rubocop-performance (1.5.2)
59
+ unicode-display_width (>= 1.4.0, < 2.0)
60
+ rubocop-ast (0.0.3)
61
+ parser (>= 2.7.0.1)
62
+ rubocop-performance (1.6.0)
45
63
  rubocop (>= 0.71.0)
64
+ rubocop-rspec (1.39.0)
65
+ rubocop (>= 0.68.1)
46
66
  ruby-progressbar (1.10.1)
47
- unicode-display_width (1.6.1)
67
+ thread_safe (0.3.6)
68
+ tzinfo (1.2.7)
69
+ thread_safe (~> 0.1)
70
+ unicode-display_width (1.7.0)
71
+ zeitwerk (2.3.0)
48
72
 
49
73
  PLATFORMS
50
74
  ruby
51
75
 
52
76
  DEPENDENCIES
77
+ activerecord
53
78
  bundler
54
79
  bunny-mock
55
80
  byebug
@@ -58,6 +83,7 @@ DEPENDENCIES
58
83
  rspec
59
84
  rubocop
60
85
  rubocop-performance
86
+ rubocop-rspec
61
87
 
62
88
  BUNDLED WITH
63
89
  2.1.4
data/README.md CHANGED
@@ -1,10 +1,9 @@
1
+ [![Gem Version](https://badge.fury.io/rb/jackhammer.svg)](https://rubygems.org/gems/jackhammer)
1
2
  [![Build Status](https://travis-ci.org/RenoFi/jackhammer.svg?branch=master)](https://travis-ci.org/RenoFi/jackhammer)
2
- [![GitHub issues](https://img.shields.io/github/issues/renofi/jackhammer)](https://github.com/renofi/jackhammer/issues)
3
- [![GitHub license](https://img.shields.io/github/license/renofi/jackhammer)](https://github.com/RenoFi/jackhammer/blob/master/LICENSE.txt)
4
3
 
5
- # Jackhammer
4
+ # jackhammer
6
5
 
7
- Jackhammer is an opinionated, configurable facade over the RabbitMQ Bunny
6
+ `jackhammer` is an opinionated, configurable facade over the RabbitMQ Bunny
8
7
  module.
9
8
 
10
9
  ## Installation
@@ -180,7 +179,3 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/renofi
180
179
  ## License
181
180
 
182
181
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
183
-
184
- ## Code of Conduct
185
-
186
- Everyone interacting in the Jackhammer project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/renofi/jackhammer/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile CHANGED
@@ -5,4 +5,4 @@ require 'rubocop/rake_task'
5
5
  RSpec::Core::RakeTask.new(:spec)
6
6
  RuboCop::RakeTask.new
7
7
 
8
- task default: %i[rubocop spec]
8
+ task default: %i[rubocop:auto_correct spec]
@@ -3,27 +3,28 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
  require 'jackhammer/version'
4
4
 
5
5
  Gem::Specification.new do |spec|
6
- spec.name = 'jackhammer'
7
- spec.version = Jackhammer::VERSION
8
- spec.authors = ['Scott Serok']
9
- spec.email = ['scott@renofi.com']
6
+ spec.name = 'jackhammer'
7
+ spec.version = Jackhammer::VERSION
8
+ spec.authors = ['Scott Serok']
9
+ spec.email = ['scott@renofi.com']
10
10
 
11
- spec.summary = 'Jackhammer is an opinionated facade over RabbitMQ Bunny'
12
- spec.homepage = 'https://github.com/renofi/jackhammer'
13
- spec.license = 'MIT'
11
+ spec.summary = 'Jackhammer is an opinionated facade over RabbitMQ Bunny'
12
+ spec.homepage = 'https://github.com/renofi/jackhammer'
13
+ spec.license = 'MIT'
14
14
 
15
- spec.metadata['homepage_uri'] = spec.homepage
16
- spec.metadata['source_code_uri'] = spec.homepage
15
+ spec.metadata['homepage_uri'] = spec.homepage
16
+ spec.metadata['source_code_uri'] = spec.homepage
17
17
 
18
18
  spec.files = Dir.chdir(File.expand_path(__dir__)) do
19
19
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(bin/|spec/|\.rub)}) }
20
20
  end
21
- spec.bindir = 'exe'
22
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
+ spec.bindir = 'exe'
22
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
23
  spec.require_paths = ['lib']
24
24
 
25
25
  spec.add_dependency 'bunny', '~> 2.14'
26
26
 
27
+ spec.add_development_dependency 'activerecord'
27
28
  spec.add_development_dependency 'bundler'
28
29
  spec.add_development_dependency 'bunny-mock'
29
30
  spec.add_development_dependency 'byebug'
@@ -31,4 +32,5 @@ Gem::Specification.new do |spec|
31
32
  spec.add_development_dependency 'rspec'
32
33
  spec.add_development_dependency 'rubocop'
33
34
  spec.add_development_dependency 'rubocop-performance'
35
+ spec.add_development_dependency 'rubocop-rspec'
34
36
  end
@@ -37,5 +37,14 @@ module Jackhammer
37
37
  def topics
38
38
  @topics ||= TopicManager.topics
39
39
  end
40
+
41
+ def publish_options(options = {}, time = Time.now.utc)
42
+ configuration.publish_options.dup.merge(options).tap do |opts|
43
+ opts[:timestamp] = time.to_i
44
+ opts[:app_id] ||= configuration.app_name
45
+ opts[:headers] ||= {}
46
+ opts[:headers][:time] ||= time.iso8601
47
+ end
48
+ end
40
49
  end
41
50
  end
@@ -15,6 +15,8 @@ module Jackhammer
15
15
  else
16
16
  handler.call message
17
17
  end
18
+ ensure
19
+ ActiveRecord::Base.clear_active_connections! if defined?(ActiveRecord::Base)
18
20
  end
19
21
  end
20
22
  end
@@ -15,8 +15,7 @@ module Jackhammer
15
15
  # We're expecting the client to specify at least the routing_key in options
16
16
  # for each message published.
17
17
  def publish(message, options)
18
- full_options = Jackhammer.configuration.publish_options.dup.merge options
19
- topic.publish message, full_options
18
+ topic.publish message, Jackhammer.publish_options(options)
20
19
  end
21
20
 
22
21
  def queues
@@ -1,3 +1,3 @@
1
1
  module Jackhammer
2
- VERSION = '1.2.0'.freeze
2
+ VERSION = '1.3.4'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jackhammer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Serok
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-01-29 00:00:00.000000000 Z
11
+ date: 2020-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bunny
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '2.14'
27
+ - !ruby/object:Gem::Dependency
28
+ name: activerecord
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: bundler
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -122,6 +136,20 @@ dependencies:
122
136
  - - ">="
123
137
  - !ruby/object:Gem::Version
124
138
  version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: rubocop-rspec
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
125
153
  description:
126
154
  email:
127
155
  - scott@renofi.com
@@ -131,10 +159,14 @@ extensions: []
131
159
  extra_rdoc_files: []
132
160
  files:
133
161
  - ".dependabot/config.yml"
162
+ - ".github/ISSUE_TEMPLATE/bug_report.md"
163
+ - ".github/ISSUE_TEMPLATE/config.yml"
164
+ - ".github/ISSUE_TEMPLATE/story.md"
165
+ - ".github/PULL_REQUEST_TEMPLATE.md"
166
+ - ".github/workflows/auto-approve.yml"
134
167
  - ".gitignore"
135
168
  - ".rspec"
136
169
  - ".travis.yml"
137
- - CODE_OF_CONDUCT.md
138
170
  - Gemfile
139
171
  - Gemfile.lock
140
172
  - LICENSE.txt
@@ -175,7 +207,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
175
207
  - !ruby/object:Gem::Version
176
208
  version: '0'
177
209
  requirements: []
178
- rubygems_version: 3.0.6
210
+ rubygems_version: 3.1.2
179
211
  signing_key:
180
212
  specification_version: 4
181
213
  summary: Jackhammer is an opinionated facade over RabbitMQ Bunny
@@ -1,74 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- In the interest of fostering an open and welcoming environment, we as
6
- contributors and maintainers pledge to making participation in our project and
7
- our community a harassment-free experience for everyone, regardless of age, body
8
- size, disability, ethnicity, gender identity and expression, level of experience,
9
- nationality, personal appearance, race, religion, or sexual identity and
10
- orientation.
11
-
12
- ## Our Standards
13
-
14
- Examples of behavior that contributes to creating a positive environment
15
- include:
16
-
17
- * Using welcoming and inclusive language
18
- * Being respectful of differing viewpoints and experiences
19
- * Gracefully accepting constructive criticism
20
- * Focusing on what is best for the community
21
- * Showing empathy towards other community members
22
-
23
- Examples of unacceptable behavior by participants include:
24
-
25
- * The use of sexualized language or imagery and unwelcome sexual attention or
26
- advances
27
- * Trolling, insulting/derogatory comments, and personal or political attacks
28
- * Public or private harassment
29
- * Publishing others' private information, such as a physical or electronic
30
- address, without explicit permission
31
- * Other conduct which could reasonably be considered inappropriate in a
32
- professional setting
33
-
34
- ## Our Responsibilities
35
-
36
- Project maintainers are responsible for clarifying the standards of acceptable
37
- behavior and are expected to take appropriate and fair corrective action in
38
- response to any instances of unacceptable behavior.
39
-
40
- Project maintainers have the right and responsibility to remove, edit, or
41
- reject comments, commits, code, wiki edits, issues, and other contributions
42
- that are not aligned to this Code of Conduct, or to ban temporarily or
43
- permanently any contributor for other behaviors that they deem inappropriate,
44
- threatening, offensive, or harmful.
45
-
46
- ## Scope
47
-
48
- This Code of Conduct applies both within project spaces and in public spaces
49
- when an individual is representing the project or its community. Examples of
50
- representing a project or community include using an official project e-mail
51
- address, posting via an official social media account, or acting as an appointed
52
- representative at an online or offline event. Representation of a project may be
53
- further defined and clarified by project maintainers.
54
-
55
- ## Enforcement
56
-
57
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
- reported by contacting the project team at scott@renofi.com. All
59
- complaints will be reviewed and investigated and will result in a response that
60
- is deemed necessary and appropriate to the circumstances. The project team is
61
- obligated to maintain confidentiality with regard to the reporter of an incident.
62
- Further details of specific enforcement policies may be posted separately.
63
-
64
- Project maintainers who do not follow or enforce the Code of Conduct in good
65
- faith may face temporary or permanent repercussions as determined by other
66
- members of the project's leadership.
67
-
68
- ## Attribution
69
-
70
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
- available at [http://contributor-covenant.org/version/1/4][version]
72
-
73
- [homepage]: http://contributor-covenant.org
74
- [version]: http://contributor-covenant.org/version/1/4/