logjam_agent 0.22.0 → 0.22.1

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
  SHA1:
3
- metadata.gz: e060a1fcd946ce3bc723bb408a90a08c16e650fb
4
- data.tar.gz: 6aba597f82bca08b2ba2d6e67969d2602909f902
3
+ metadata.gz: 0cca5098317b3d3338b67eb29ee6a1989acd7faf
4
+ data.tar.gz: 41338b77ab2e005017455c9f26a9518a76d3ccb2
5
5
  SHA512:
6
- metadata.gz: 36af34ac3b7cfae7f7e031fb24c2e14c8792c356688660b1df9f52cfcf837e81122ae341c5959f4462f5f657b302326a548ba3f499eb7d2c839368d168219653
7
- data.tar.gz: 64c1a12ef9d4cce56fa863b5e002c46e2ace95c4f744df8199124c849f4b9590cdc1e099453409dee25cba82d368c04bcadae06c1b85862346f1363c176677a8
6
+ metadata.gz: d348f5ca4f773be3539c7be4bb6ac973eb1b1fbb013447b1ad454cb19fff9bd331120a666bcb492544360672ea5636a8518908830fc13ef10a00b44a211268a4
7
+ data.tar.gz: f26426cf92bac9d176ceacfed0c8bc8ac74df8d4c68cf1725627a0eddde98f5fefbbcb37119eb2f30e332c22d875c47a643e82a76b29347bc4be43ccaabf5a07
@@ -78,16 +78,17 @@ module LogjamAgent
78
78
  # patch controller testing to create a logjam request, because middlewares aren't executed
79
79
  if Rails.env.test?
80
80
  ActiveSupport.on_load(:action_controller) do
81
- module TestWithLogjamStartRequest
82
- def process(*args)
81
+ require 'action_controller/test_case'
82
+ module ActionController::TestCase::Behavior
83
+ def process_with_logjam(*args)
83
84
  LogjamAgent.start_request
84
- super
85
+ process_without_logjam(*args)
85
86
  ensure
86
87
  LogjamAgent.finish_request
87
88
  end
89
+ alias_method :process_without_logjam, :process
90
+ alias_method :process, :process_with_logjam
88
91
  end
89
- require 'action_controller/test_case'
90
- ActionController::TestCase.prepend TestWithLogjamStartRequest
91
92
  end
92
93
  end
93
94
  end
@@ -1,3 +1,3 @@
1
1
  module LogjamAgent
2
- VERSION = "0.22.0"
2
+ VERSION = "0.22.1"
3
3
  end
@@ -1,6 +1,6 @@
1
1
  module LogjamAgent
2
2
  class ZMQForwarder
3
- attr_reader :app, :env, :connection_specs
3
+ attr_reader :app, :env
4
4
 
5
5
  include Util
6
6
 
@@ -7,14 +7,24 @@ module LogjamAgent
7
7
  LogjamAgent.compression_method = NO_COMPRESSION
8
8
  end
9
9
 
10
- test "sets up single connection with default port" do
10
+ test "sets up single push connection with default port" do
11
11
  f = ZMQForwarder.new(:host => "a.b.c", :port => 3001)
12
- assert_equal ["tcp://a.b.c:3001"], f.connection_specs
12
+ assert_equal ["tcp://a.b.c:3001"], f.push_connection_specs
13
13
  end
14
14
 
15
- test "sets up multiple connections" do
15
+ test "sets up multiple push connections" do
16
16
  f = ZMQForwarder.new(:host => "a.b.c,tcp://x.y.z:9000,zmq.gnu.org:600")
17
- assert_equal %w(tcp://a.b.c:9605 tcp://x.y.z:9000 tcp://zmq.gnu.org:600), f.connection_specs
17
+ assert_equal %w(tcp://a.b.c:9605 tcp://x.y.z:9000 tcp://zmq.gnu.org:600), f.push_connection_specs
18
+ end
19
+
20
+ test "sets up single req connection with default port" do
21
+ f = ZMQForwarder.new(:host => "a.b.c", :req_port => 3001)
22
+ assert_equal ["tcp://a.b.c:3001"], f.req_connection_specs
23
+ end
24
+
25
+ test "sets up multiple req connections" do
26
+ f = ZMQForwarder.new(:host => "a.b.c,tcp://x.y.z:9000,zmq.gnu.org:600")
27
+ assert_equal %w(tcp://a.b.c:9604 tcp://x.y.z:9000 tcp://zmq.gnu.org:600).sort, f.req_connection_specs.sort
18
28
  end
19
29
 
20
30
  test "encodes the payload" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logjam_agent
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.22.0
4
+ version: 0.22.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Kaes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-11 00:00:00.000000000 Z
11
+ date: 2016-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake