pwwka 0.16.0 → 0.16.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
  SHA1:
3
- metadata.gz: a9979d197bd12e7850a2152c42d788220d11b280
4
- data.tar.gz: 4dcaaaee90025accb128ac6eb2c5676fd7dd714b
3
+ metadata.gz: d33c45520c16c18b56efbfcefd70a49252e3bd00
4
+ data.tar.gz: dac6fe4120e1dc388e49adb123330b9f8545cbcb
5
5
  SHA512:
6
- metadata.gz: 653875f4ed5231099fff06769f231cbcfa786db1bb0900364dba0928b1e4921f3cea8d4699126d7b0c80ec51438d88b924e5f863c9ec448ee940a7d4a0ff1492
7
- data.tar.gz: 40e334288cd1a6bbdb940583f4f9d50ee5f527d28ec3479eb822a78219faf33930d525859bfbb5c6a2785167ac29d669262c7caa41543da893b93055792bc821
6
+ metadata.gz: 906bc065b933a8bc13525b454f8d6e1259414272cfabd8585305d4bc793f25e01598d4413064e10742fa4a31e7dacfa963418e58975b77763940fba5d5d84519
7
+ data.tar.gz: e88311d37274c9fb54c14f516be1f2a333c302380aeb838785c544addc3e0e4543b4cec3749fb4eccd8441b20fc93480cb6696383855231d9e158d27f423670d
@@ -0,0 +1,144 @@
1
+ # DO NOT MODIFY - this is managed by Git Reduce in goro
2
+ #
3
+ ---
4
+ version: 2
5
+ jobs:
6
+ ruby-2.5.0-rails-5.1:
7
+ docker:
8
+ - image: circleci/ruby:2.5.0
9
+ environment:
10
+ BUNDLE_GEMFILE: Gemfile.rails-5.1
11
+ working_directory: "~/pwwka"
12
+ steps:
13
+ - checkout
14
+ - run: bundle install
15
+ - run: bundle exec rspec --format RspecJunitFormatter --out /tmp/test-results/rspec.xml
16
+ --format=doc
17
+ - run:
18
+ name: Notify Pager Duty
19
+ command: bundle exec y-notify eng-platform
20
+ when: on_fail
21
+ - store_test_results:
22
+ path: "/tmp/test-results"
23
+ ruby-2.4.3-rails-5.1:
24
+ docker:
25
+ - image: circleci/ruby:2.4.3
26
+ environment:
27
+ BUNDLE_GEMFILE: Gemfile.rails-5.1
28
+ working_directory: "~/pwwka"
29
+ steps:
30
+ - checkout
31
+ - run: bundle install
32
+ - run: bundle exec rspec --format RspecJunitFormatter --out /tmp/test-results/rspec.xml
33
+ --format=doc
34
+ - run:
35
+ name: Notify Pager Duty
36
+ command: bundle exec y-notify eng-platform
37
+ when: on_fail
38
+ - store_test_results:
39
+ path: "/tmp/test-results"
40
+ ruby-2.5.0-rails-5.0:
41
+ docker:
42
+ - image: circleci/ruby:2.5.0
43
+ environment:
44
+ BUNDLE_GEMFILE: Gemfile.rails-5.0
45
+ working_directory: "~/pwwka"
46
+ steps:
47
+ - checkout
48
+ - run: bundle install
49
+ - run: bundle exec rspec --format RspecJunitFormatter --out /tmp/test-results/rspec.xml
50
+ --format=doc
51
+ - run:
52
+ name: Notify Pager Duty
53
+ command: bundle exec y-notify eng-platform
54
+ when: on_fail
55
+ - store_test_results:
56
+ path: "/tmp/test-results"
57
+ ruby-2.4.3-rails-5.0:
58
+ docker:
59
+ - image: circleci/ruby:2.4.3
60
+ environment:
61
+ BUNDLE_GEMFILE: Gemfile.rails-5.0
62
+ working_directory: "~/pwwka"
63
+ steps:
64
+ - checkout
65
+ - run: bundle install
66
+ - run: bundle exec rspec --format RspecJunitFormatter --out /tmp/test-results/rspec.xml
67
+ --format=doc
68
+ - run:
69
+ name: Notify Pager Duty
70
+ command: bundle exec y-notify eng-platform
71
+ when: on_fail
72
+ - store_test_results:
73
+ path: "/tmp/test-results"
74
+ ruby-2.5.0-rails-4.2:
75
+ docker:
76
+ - image: circleci/ruby:2.5.0
77
+ environment:
78
+ BUNDLE_GEMFILE: Gemfile.rails-4.2
79
+ working_directory: "~/pwwka"
80
+ steps:
81
+ - checkout
82
+ - run: bundle install
83
+ - run: bundle exec rspec --format RspecJunitFormatter --out /tmp/test-results/rspec.xml
84
+ --format=doc
85
+ - run:
86
+ name: Notify Pager Duty
87
+ command: bundle exec y-notify eng-platform
88
+ when: on_fail
89
+ - store_test_results:
90
+ path: "/tmp/test-results"
91
+ ruby-2.4.3-rails-4.2:
92
+ docker:
93
+ - image: circleci/ruby:2.4.3
94
+ environment:
95
+ BUNDLE_GEMFILE: Gemfile.rails-4.2
96
+ working_directory: "~/pwwka"
97
+ steps:
98
+ - checkout
99
+ - run: bundle install
100
+ - run: bundle exec rspec --format RspecJunitFormatter --out /tmp/test-results/rspec.xml
101
+ --format=doc
102
+ - run:
103
+ name: Notify Pager Duty
104
+ command: bundle exec y-notify eng-platform
105
+ when: on_fail
106
+ - store_test_results:
107
+ path: "/tmp/test-results"
108
+ workflows:
109
+ version: 2
110
+ on-commit:
111
+ jobs:
112
+ - ruby-2.5.0-rails-5.1:
113
+ context: org-global
114
+ - ruby-2.4.3-rails-5.1:
115
+ context: org-global
116
+ - ruby-2.5.0-rails-5.0:
117
+ context: org-global
118
+ - ruby-2.4.3-rails-5.0:
119
+ context: org-global
120
+ - ruby-2.5.0-rails-4.2:
121
+ context: org-global
122
+ - ruby-2.4.3-rails-4.2:
123
+ context: org-global
124
+ scheduled:
125
+ triggers:
126
+ - schedule:
127
+ cron: 17 19 * * 1,2,3,4,5
128
+ filters:
129
+ branches:
130
+ only:
131
+ - master
132
+ jobs:
133
+ - ruby-2.5.0-rails-5.1:
134
+ context: org-global
135
+ - ruby-2.4.3-rails-5.1:
136
+ context: org-global
137
+ - ruby-2.5.0-rails-5.0:
138
+ context: org-global
139
+ - ruby-2.4.3-rails-5.0:
140
+ context: org-global
141
+ - ruby-2.5.0-rails-4.2:
142
+ context: org-global
143
+ - ruby-2.4.3-rails-4.2:
144
+ context: org-global
data/.gitignore CHANGED
@@ -13,3 +13,4 @@ db
13
13
  .bundle
14
14
  coverage
15
15
  Session.vim
16
+ Gemfile.lock
data/Gemfile.rails-4.2 ADDED
@@ -0,0 +1,8 @@
1
+ # DO NOT MODIFY - this is managed by Git Reduce in goro
2
+ #
3
+ source 'https://gem.fury.io/me/'
4
+ source 'https://www.rubygems.org'
5
+
6
+ gemspec
7
+
8
+ gem 'activesupport', '~> 4.2.0'
data/Gemfile.rails-5.0 ADDED
@@ -0,0 +1,8 @@
1
+ # DO NOT MODIFY - this is managed by Git Reduce in goro
2
+ #
3
+ source 'https://gem.fury.io/me/'
4
+ source 'https://www.rubygems.org'
5
+
6
+ gemspec
7
+
8
+ gem 'activesupport', '~> 5.0.0'
data/Gemfile.rails-5.1 ADDED
@@ -0,0 +1,8 @@
1
+ # DO NOT MODIFY - this is managed by Git Reduce in goro
2
+ #
3
+ source 'https://gem.fury.io/me/'
4
+ source 'https://www.rubygems.org'
5
+
6
+ gemspec
7
+
8
+ gem 'activesupport', '~> 5.1.0'
data/build-matrix.json ADDED
@@ -0,0 +1,4 @@
1
+ {
2
+ "build_matrix": {
3
+ }
4
+ }
@@ -8,6 +8,7 @@ module Pwwka
8
8
  attr_accessor :topic_exchange_name
9
9
  attr_accessor :delayed_exchange_name
10
10
  attr_accessor :logger
11
+ attr_accessor :log_level
11
12
  attr_accessor :options
12
13
  attr_accessor :async_job_klass
13
14
  attr_accessor :send_message_resque_backoff_strategy
@@ -21,6 +22,7 @@ module Pwwka
21
22
  @topic_exchange_name = "pwwka.topics.#{Pwwka.environment}"
22
23
  @delayed_exchange_name = "pwwka.delayed.#{Pwwka.environment}"
23
24
  @logger = MonoLogger.new(STDOUT)
25
+ @log_level = :info
24
26
  @options = {}
25
27
  @send_message_resque_backoff_strategy = [5, #intermittent glitch?
26
28
  60, # quick interruption
data/lib/pwwka/logging.rb CHANGED
@@ -16,7 +16,7 @@ module Pwwka
16
16
  }
17
17
 
18
18
  def logf(format,params)
19
- level = params.delete(:at) || :info
19
+ level = params.delete(:at) || Pwwka.configuration.log_level
20
20
  params[:payload] = params["payload"] if params["payload"]
21
21
  params[:payload] = "[omitted]" if params[:payload] && LEVELS[Pwwka.configuration.payload_logging.to_sym] > LEVELS[level.to_sym]
22
22
  message = format % params
data/lib/pwwka/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Pwwka
2
- VERSION = '0.16.0'
2
+ VERSION = '0.16.1'
3
3
  end
data/pwwka.gemspec CHANGED
@@ -30,4 +30,5 @@ Gem::Specification.new do |s|
30
30
  s.add_development_dependency("simplecov")
31
31
  s.add_development_dependency("resqutils")
32
32
  s.add_development_dependency("rainbow")
33
+ s.add_development_dependency('rspec_junit_formatter')
33
34
  end
@@ -25,6 +25,7 @@ describe Pwwka::Logging do
25
25
 
26
26
  before do
27
27
  @original_logger = Pwwka.configuration.logger
28
+ @original_log_level = Pwwka.configuration.log_level
28
29
  Pwwka.configuration.logger = logger
29
30
  allow(logger).to receive(:info)
30
31
  allow(logger).to receive(:error)
@@ -32,8 +33,23 @@ describe Pwwka::Logging do
32
33
 
33
34
  after do
34
35
  Pwwka.configuration.logger = @original_logger
36
+ Pwwka.configuration.log_level = @original_log_level
35
37
  Pwwka.configuration.payload_logging = @original_payload_logging
36
38
  end
39
+
40
+ it "logs a printf-style string at info" do
41
+ ForLogging.logf("This is %{test} some %{data}", test: "a test of", data: "data and stuff", ignored: :hopefully)
42
+ expect(logger).to have_received(:info).with("This is a test of some data and stuff")
43
+ end
44
+
45
+ it "logs at a different level if configured to do so" do
46
+ Pwwka.configuration.log_level = :debug
47
+ allow(logger).to receive(:debug)
48
+
49
+ ForLogging.logf("This is %{test} some %{data}", test: "a test of", data: "data and stuff", ignored: :hopefully)
50
+ expect(logger).to have_received(:debug).with("This is a test of some data and stuff")
51
+ end
52
+
37
53
  it "logs a printf-style string at info" do
38
54
  ForLogging.logf("This is %{test} some %{data}", test: "a test of", data: "data and stuff", ignored: :hopefully)
39
55
  expect(logger).to have_received(:info).with("This is a test of some data and stuff")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pwwka
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.0
4
+ version: 0.16.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stitch Fix Engineering
@@ -15,7 +15,7 @@ authors:
15
15
  autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
- date: 2017-12-18 00:00:00.000000000 Z
18
+ date: 2018-01-11 00:00:00.000000000 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: bunny
@@ -171,6 +171,20 @@ dependencies:
171
171
  - - ">="
172
172
  - !ruby/object:Gem::Version
173
173
  version: '0'
174
+ - !ruby/object:Gem::Dependency
175
+ name: rspec_junit_formatter
176
+ requirement: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
181
+ type: :development
182
+ prerelease: false
183
+ version_requirements: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - ">="
186
+ - !ruby/object:Gem::Version
187
+ version: '0'
174
188
  description: |-
175
189
  The purpose of this gem is to normalise the sending and
176
190
  receiving of messages between Rails apps using the shared RabbitMQ
@@ -188,6 +202,7 @@ executables: []
188
202
  extensions: []
189
203
  extra_rdoc_files: []
190
204
  files:
205
+ - ".circleci/config.yml"
191
206
  - ".gitignore"
192
207
  - ".ruby-gemset"
193
208
  - ".ruby-version"
@@ -195,10 +210,13 @@ files:
195
210
  - CODE_OF_CONDUCT.md
196
211
  - CONTRIBUTING.md
197
212
  - Gemfile
198
- - Gemfile.lock
213
+ - Gemfile.rails-4.2
214
+ - Gemfile.rails-5.0
215
+ - Gemfile.rails-5.1
199
216
  - LICENSE
200
217
  - README.md
201
218
  - Rakefile
219
+ - build-matrix.json
202
220
  - docker-compose.yml
203
221
  - docs/images/RabbitMQ_Management-2.png
204
222
  - docs/images/RabbitMQ_Management-3.png
@@ -268,7 +286,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
268
286
  version: '0'
269
287
  requirements: []
270
288
  rubyforge_project:
271
- rubygems_version: 2.5.1
289
+ rubygems_version: 2.6.14
272
290
  signing_key:
273
291
  specification_version: 4
274
292
  summary: Send and receive messages via RabbitMQ
data/Gemfile.lock DELETED
@@ -1,106 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- pwwka (0.16.0)
5
- activemodel
6
- activesupport
7
- bunny
8
- mono_logger
9
-
10
- GEM
11
- remote: https://www.rubygems.org/
12
- specs:
13
- activemodel (5.1.4)
14
- activesupport (= 5.1.4)
15
- activesupport (5.1.4)
16
- concurrent-ruby (~> 1.0, >= 1.0.2)
17
- i18n (~> 0.7)
18
- minitest (~> 5.1)
19
- tzinfo (~> 1.1)
20
- amq-protocol (2.2.0)
21
- bunny (2.8.0)
22
- amq-protocol (>= 2.2.0)
23
- concurrent-ruby (1.0.5)
24
- diff-lcs (1.3)
25
- docile (1.1.5)
26
- et-orbi (1.0.7)
27
- tzinfo
28
- i18n (0.9.1)
29
- concurrent-ruby (~> 1.0)
30
- json (2.1.0)
31
- minitest (5.10.3)
32
- mono_logger (1.1.0)
33
- multi_json (1.12.2)
34
- mustermann (1.0.1)
35
- rack (2.0.3)
36
- rack-protection (2.0.0)
37
- rack
38
- rainbow (2.2.2)
39
- rake
40
- rake (12.1.0)
41
- redis (3.3.5)
42
- redis-namespace (1.5.3)
43
- redis (~> 3.0, >= 3.0.4)
44
- resque (1.27.4)
45
- mono_logger (~> 1.0)
46
- multi_json (~> 1.0)
47
- redis-namespace (~> 1.3)
48
- sinatra (>= 0.9.2)
49
- vegas (~> 0.1.2)
50
- resque-retry (1.5.0)
51
- resque (~> 1.25)
52
- resque-scheduler (~> 4.0)
53
- resque-scheduler (4.3.0)
54
- mono_logger (~> 1.0)
55
- redis (~> 3.3)
56
- resque (~> 1.26)
57
- rufus-scheduler (~> 3.2)
58
- resqutils (1.2.1)
59
- resque
60
- rspec (3.7.0)
61
- rspec-core (~> 3.7.0)
62
- rspec-expectations (~> 3.7.0)
63
- rspec-mocks (~> 3.7.0)
64
- rspec-core (3.7.0)
65
- rspec-support (~> 3.7.0)
66
- rspec-expectations (3.7.0)
67
- diff-lcs (>= 1.2.0, < 2.0)
68
- rspec-support (~> 3.7.0)
69
- rspec-mocks (3.7.0)
70
- diff-lcs (>= 1.2.0, < 2.0)
71
- rspec-support (~> 3.7.0)
72
- rspec-support (3.7.0)
73
- rufus-scheduler (3.4.2)
74
- et-orbi (~> 1.0)
75
- simplecov (0.15.1)
76
- docile (~> 1.1.0)
77
- json (>= 1.8, < 3)
78
- simplecov-html (~> 0.10.0)
79
- simplecov-html (0.10.2)
80
- sinatra (2.0.0)
81
- mustermann (~> 1.0)
82
- rack (~> 2.0)
83
- rack-protection (= 2.0.0)
84
- tilt (~> 2.0)
85
- thread_safe (0.3.6)
86
- tilt (2.0.8)
87
- tzinfo (1.2.3)
88
- thread_safe (~> 0.1)
89
- vegas (0.1.11)
90
- rack (>= 1.0.0)
91
-
92
- PLATFORMS
93
- ruby
94
-
95
- DEPENDENCIES
96
- pwwka!
97
- rainbow
98
- rake
99
- resque
100
- resque-retry
101
- resqutils
102
- rspec
103
- simplecov
104
-
105
- BUNDLED WITH
106
- 1.15.4