routemaster-client 3.1.0 → 3.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/.travis.yml +3 -3
- data/CHANGELOG.md +19 -2
- data/Gemfile.lock +32 -30
- data/README.md +103 -12
- data/exe/rtm +11 -0
- data/routemaster-client.gemspec +5 -0
- data/routemaster/cli/base.rb +134 -0
- data/routemaster/cli/helper.rb +61 -0
- data/routemaster/cli/pub.rb +23 -0
- data/routemaster/cli/sub.rb +78 -0
- data/routemaster/cli/token.rb +52 -0
- data/routemaster/cli/top_level.rb +48 -0
- data/routemaster/client.rb +49 -22
- data/routemaster/client/backends/sidekiq/worker.rb +11 -1
- data/routemaster/client/configuration.rb +6 -0
- data/routemaster/client/connection.rb +10 -4
- data/routemaster/client/errors.rb +1 -0
- data/routemaster/client/subscription.rb +32 -0
- data/routemaster/client/topic.rb +22 -0
- data/routemaster/client/version.rb +1 -1
- data/spec/cli/pub_spec.rb +21 -0
- data/spec/cli/sub_spec.rb +61 -0
- data/spec/cli/token_spec.rb +50 -0
- data/spec/client/subscription_spec.rb +19 -0
- data/spec/{topic_spec.rb → client/topic_spec.rb} +2 -2
- data/spec/client_spec.rb +134 -56
- data/spec/spec_helper.rb +28 -0
- metadata +39 -8
- data/routemaster/topic.rb +0 -17
data/spec/spec_helper.rb
CHANGED
@@ -7,6 +7,25 @@ SimpleCov.start do
|
|
7
7
|
add_filter 'routemaster/client/backends/sidekiq/configuration'
|
8
8
|
end
|
9
9
|
|
10
|
+
module CLIHelpers
|
11
|
+
def self.included(by)
|
12
|
+
by.class_eval do
|
13
|
+
require 'stringio'
|
14
|
+
|
15
|
+
let(:stderr) { StringIO.new }
|
16
|
+
let(:stdout) { StringIO.new }
|
17
|
+
let(:perform) { Routemaster::CLI::Toplevel.new(stdout: stdout, stderr: stderr).run(argv) }
|
18
|
+
let(:client) { Routemaster::Client }
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def allow_bus_pulse(host, token)
|
23
|
+
stub_request(:get, %r{^https://#{Regexp.escape host}/pulse$}).
|
24
|
+
with(basic_auth: [token, 'x']).
|
25
|
+
to_return(status: 204)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
10
29
|
# This file was generated by the `rspec --init` command. Conventionally, all
|
11
30
|
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
12
31
|
# Require this file using `require "spec_helper"` to ensure that it is only
|
@@ -24,4 +43,13 @@ RSpec.configure do |config|
|
|
24
43
|
config.order = 'random'
|
25
44
|
|
26
45
|
config.after(:suite) { WebMock.disable! }
|
46
|
+
|
47
|
+
config.include CLIHelpers, type: :cli
|
48
|
+
|
49
|
+
# Unfortunately, Client Connection and Configuration are implemented as
|
50
|
+
# pseudo-singletons, which requires a song and dance to prevent state from
|
51
|
+
# leaking across specs:
|
52
|
+
config.after { Routemaster::Client::Connection.reset_connection }
|
53
|
+
config.after { Routemaster::Client::Configuration.reset }
|
27
54
|
end
|
55
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: routemaster-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julien Letessier
|
8
8
|
autorequire:
|
9
|
-
bindir:
|
9
|
+
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -66,10 +66,25 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '2.17'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: hashie
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
69
83
|
description:
|
70
84
|
email:
|
71
85
|
- julien.letessier@gmail.com
|
72
|
-
executables:
|
86
|
+
executables:
|
87
|
+
- rtm
|
73
88
|
extensions: []
|
74
89
|
extra_rdoc_files: []
|
75
90
|
files:
|
@@ -85,7 +100,14 @@ files:
|
|
85
100
|
- LICENSE.txt
|
86
101
|
- README.md
|
87
102
|
- Rakefile
|
103
|
+
- exe/rtm
|
88
104
|
- routemaster-client.gemspec
|
105
|
+
- routemaster/cli/base.rb
|
106
|
+
- routemaster/cli/helper.rb
|
107
|
+
- routemaster/cli/pub.rb
|
108
|
+
- routemaster/cli/sub.rb
|
109
|
+
- routemaster/cli/token.rb
|
110
|
+
- routemaster/cli/top_level.rb
|
89
111
|
- routemaster/client.rb
|
90
112
|
- routemaster/client/assertion_helpers.rb
|
91
113
|
- routemaster/client/backends/missing_asynchronous.rb
|
@@ -96,16 +118,21 @@ files:
|
|
96
118
|
- routemaster/client/configuration.rb
|
97
119
|
- routemaster/client/connection.rb
|
98
120
|
- routemaster/client/errors.rb
|
121
|
+
- routemaster/client/subscription.rb
|
122
|
+
- routemaster/client/topic.rb
|
99
123
|
- routemaster/client/version.rb
|
100
124
|
- routemaster/receiver.rb
|
101
|
-
-
|
125
|
+
- spec/cli/pub_spec.rb
|
126
|
+
- spec/cli/sub_spec.rb
|
127
|
+
- spec/cli/token_spec.rb
|
102
128
|
- spec/client/backends/sidekiq/configuration_spec.rb
|
103
129
|
- spec/client/configuration_spec.rb
|
130
|
+
- spec/client/subscription_spec.rb
|
131
|
+
- spec/client/topic_spec.rb
|
104
132
|
- spec/client_spec.rb
|
105
133
|
- spec/receiver_spec.rb
|
106
134
|
- spec/spec_helper.rb
|
107
135
|
- spec/support/configuration_helper.rb
|
108
|
-
- spec/topic_spec.rb
|
109
136
|
homepage: http://github.com/deliveroo/routemaster-client
|
110
137
|
licenses:
|
111
138
|
- MIT
|
@@ -126,15 +153,19 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
126
153
|
version: '0'
|
127
154
|
requirements: []
|
128
155
|
rubyforge_project:
|
129
|
-
rubygems_version: 2.
|
156
|
+
rubygems_version: 2.6.11
|
130
157
|
signing_key:
|
131
158
|
specification_version: 4
|
132
159
|
summary: Client API for the Routemaster event bus
|
133
160
|
test_files:
|
161
|
+
- spec/cli/pub_spec.rb
|
162
|
+
- spec/cli/sub_spec.rb
|
163
|
+
- spec/cli/token_spec.rb
|
134
164
|
- spec/client/backends/sidekiq/configuration_spec.rb
|
135
165
|
- spec/client/configuration_spec.rb
|
166
|
+
- spec/client/subscription_spec.rb
|
167
|
+
- spec/client/topic_spec.rb
|
136
168
|
- spec/client_spec.rb
|
137
169
|
- spec/receiver_spec.rb
|
138
170
|
- spec/spec_helper.rb
|
139
171
|
- spec/support/configuration_helper.rb
|
140
|
-
- spec/topic_spec.rb
|
data/routemaster/topic.rb
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
module Routemaster
|
2
|
-
class Topic
|
3
|
-
|
4
|
-
attr_reader :name, :publisher, :events
|
5
|
-
|
6
|
-
def initialize(options)
|
7
|
-
@name = options.fetch('name')
|
8
|
-
@publisher = options.fetch('publisher')
|
9
|
-
@events = options.fetch('events')
|
10
|
-
end
|
11
|
-
|
12
|
-
def attributes
|
13
|
-
{ name: @name, publisher: @publisher, events: @events }
|
14
|
-
end
|
15
|
-
|
16
|
-
end
|
17
|
-
end
|