invoker 1.5.3 → 1.5.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/invoker.rb +5 -6
- data/lib/invoker/cli.rb +47 -14
- data/lib/invoker/command_worker.rb +6 -2
- data/lib/invoker/commander.rb +8 -2
- data/lib/invoker/ipc/unix_client.rb +2 -2
- data/lib/invoker/parsers/config.rb +3 -3
- data/lib/invoker/power/balancer.rb +6 -4
- data/lib/invoker/power/setup.rb +9 -6
- data/lib/invoker/power/setup/distro/base.rb +36 -13
- data/lib/invoker/power/setup/distro/ubuntu.rb +36 -0
- data/lib/invoker/power/setup/linux_setup.rb +11 -19
- data/lib/invoker/power/setup/osx_setup.rb +4 -4
- data/lib/invoker/process_manager.rb +7 -4
- data/lib/invoker/process_printer.rb +16 -0
- data/lib/invoker/reactor/reader.rb +17 -6
- data/lib/invoker/version.rb +1 -1
- data/spec/invoker/config_spec.rb +4 -4
- data/spec/invoker/power/balancer_spec.rb +31 -0
- data/spec/invoker/power/setup/linux_setup_spec.rb +97 -34
- data/spec/invoker/power/url_rewriter_spec.rb +24 -25
- data/spec/spec_helper.rb +3 -3
- metadata +56 -69
- data/.coveralls.yml +0 -1
- data/.gitignore +0 -16
- data/.rspec +0 -2
- data/.rubocop.yml +0 -29
- data/.travis.yml +0 -10
- data/Dockerfile +0 -7
- data/Gemfile +0 -13
- data/MIT-LICENSE +0 -20
- data/Rakefile +0 -15
- data/TODO +0 -5
- data/contrib/completion/invoker-completion.bash +0 -70
- data/contrib/completion/invoker-completion.zsh +0 -62
- data/examples/hello_sinatra.rb +0 -26
- data/examples/sample.ini +0 -3
- data/invoker.gemspec +0 -43
- data/lib/invoker/power/pf_migrate.rb +0 -64
- data/lib/invoker/power/setup/distro/mint.rb +0 -10
- data/readme.md +0 -25
- data/spec/invoker/power/pf_migrate_spec.rb +0 -87
@@ -3,55 +3,58 @@ require 'spec_helper'
|
|
3
3
|
describe Invoker::Power::UrlRewriter do
|
4
4
|
let(:rewriter) { Invoker::Power::UrlRewriter.new }
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
before(:all) do
|
7
|
+
@original_invoker_config = Invoker.config
|
8
|
+
end
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
def mock_invoker_tld_as(domain)
|
11
|
+
Invoker.config = mock
|
12
|
+
Invoker.config.stubs(:tld).returns(domain)
|
13
|
+
end
|
14
|
+
|
15
|
+
after(:all) do
|
16
|
+
Invoker.config = @original_invoker_config
|
17
|
+
end
|
13
18
|
|
14
|
-
|
15
|
-
|
19
|
+
context "matching domain part of incoming request" do
|
20
|
+
before(:each) do
|
21
|
+
mock_invoker_tld_as("test")
|
16
22
|
end
|
17
23
|
|
18
|
-
it "should match foo.
|
19
|
-
match = rewriter.extract_host_from_domain("foo.
|
24
|
+
it "should match foo.test" do
|
25
|
+
match = rewriter.extract_host_from_domain("foo.test")
|
20
26
|
expect(match).to_not be_empty
|
21
27
|
|
22
28
|
matching_string = match[0]
|
23
29
|
expect(matching_string).to eq("foo")
|
24
30
|
end
|
25
31
|
|
26
|
-
it "should match foo.
|
27
|
-
match = rewriter.extract_host_from_domain("foo.
|
32
|
+
it "should match foo.test:1080" do
|
33
|
+
match = rewriter.extract_host_from_domain("foo.test:1080")
|
28
34
|
expect(match).to_not be_empty
|
29
35
|
|
30
36
|
matching_string = match[0]
|
31
37
|
expect(matching_string).to eq("foo")
|
32
38
|
end
|
33
39
|
|
34
|
-
it "should match emacs.bar.
|
35
|
-
match = rewriter.extract_host_from_domain("emacs.bar.
|
40
|
+
it "should match emacs.bar.test" do
|
41
|
+
match = rewriter.extract_host_from_domain("emacs.bar.test")
|
36
42
|
expect(match).to_not be_empty
|
37
43
|
|
38
44
|
expect(match[0]).to eq("emacs.bar")
|
39
45
|
expect(match[1]).to eq("bar")
|
40
46
|
end
|
41
47
|
|
42
|
-
it "should match hello-world.
|
43
|
-
match = rewriter.extract_host_from_domain("hello-world.
|
48
|
+
it "should match hello-world.test" do
|
49
|
+
match = rewriter.extract_host_from_domain("hello-world.test")
|
44
50
|
expect(match).to_not be_nil
|
45
51
|
|
46
52
|
expect(match[0]).to eq("hello-world")
|
47
53
|
end
|
48
54
|
|
49
55
|
context 'user sets up a custom top level domain' do
|
50
|
-
before(:
|
51
|
-
|
52
|
-
|
53
|
-
Invoker.config = mock
|
54
|
-
Invoker.config.stubs(:tld).returns("local")
|
56
|
+
before(:each) do
|
57
|
+
mock_invoker_tld_as("local")
|
55
58
|
end
|
56
59
|
|
57
60
|
it 'should match domain part of incoming request correctly' do
|
@@ -61,10 +64,6 @@ describe Invoker::Power::UrlRewriter do
|
|
61
64
|
matching_string = match[0]
|
62
65
|
expect(matching_string).to eq("foo")
|
63
66
|
end
|
64
|
-
|
65
|
-
after(:all) do
|
66
|
-
Invoker.config = @original_invoker_config
|
67
|
-
end
|
68
67
|
end
|
69
68
|
end
|
70
69
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
|
-
require "pry"
|
2
1
|
require "simplecov"
|
2
|
+
require 'coveralls'
|
3
3
|
require 'fakefs/spec_helpers'
|
4
4
|
|
5
|
+
SimpleCov.formatter = Coveralls::SimpleCov::Formatter
|
5
6
|
SimpleCov.start do
|
6
7
|
add_filter "/spec/"
|
7
8
|
end
|
8
9
|
|
9
|
-
|
10
10
|
require "invoker"
|
11
11
|
require "invoker/power/power"
|
12
12
|
MM = Invoker::IPC::Message
|
@@ -14,7 +14,7 @@ MM = Invoker::IPC::Message
|
|
14
14
|
RSpec.configure do |config|
|
15
15
|
config.run_all_when_everything_filtered = true
|
16
16
|
config.filter_run :focus
|
17
|
-
config.
|
17
|
+
config.mock_with :mocha
|
18
18
|
config.include FakeFS::SpecHelpers, fakefs: true
|
19
19
|
|
20
20
|
# Run specs in random order to surface order dependencies. If you find an
|
metadata
CHANGED
@@ -1,44 +1,50 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: invoker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hemant Kumar
|
8
8
|
- Amitava Basak
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2021-05-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- - "
|
18
|
+
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
20
|
version: '0.19'
|
21
|
+
- - "<"
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: '2'
|
21
24
|
type: :runtime
|
22
25
|
prerelease: false
|
23
26
|
version_requirements: !ruby/object:Gem::Requirement
|
24
27
|
requirements:
|
25
|
-
- - "
|
28
|
+
- - ">="
|
26
29
|
- !ruby/object:Gem::Version
|
27
30
|
version: '0.19'
|
31
|
+
- - "<"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '2'
|
28
34
|
- !ruby/object:Gem::Dependency
|
29
|
-
name:
|
35
|
+
name: colorize
|
30
36
|
requirement: !ruby/object:Gem::Requirement
|
31
37
|
requirements:
|
32
38
|
- - "~>"
|
33
39
|
- !ruby/object:Gem::Version
|
34
|
-
version:
|
40
|
+
version: 0.8.1
|
35
41
|
type: :runtime
|
36
42
|
prerelease: false
|
37
43
|
version_requirements: !ruby/object:Gem::Requirement
|
38
44
|
requirements:
|
39
45
|
- - "~>"
|
40
46
|
- !ruby/object:Gem::Version
|
41
|
-
version:
|
47
|
+
version: 0.8.1
|
42
48
|
- !ruby/object:Gem::Dependency
|
43
49
|
name: iniparse
|
44
50
|
requirement: !ruby/object:Gem::Requirement
|
@@ -123,20 +129,6 @@ dependencies:
|
|
123
129
|
- - "~>"
|
124
130
|
- !ruby/object:Gem::Version
|
125
131
|
version: '2.3'
|
126
|
-
- !ruby/object:Gem::Dependency
|
127
|
-
name: facter
|
128
|
-
requirement: !ruby/object:Gem::Requirement
|
129
|
-
requirements:
|
130
|
-
- - "~>"
|
131
|
-
- !ruby/object:Gem::Version
|
132
|
-
version: '2.2'
|
133
|
-
type: :runtime
|
134
|
-
prerelease: false
|
135
|
-
version_requirements: !ruby/object:Gem::Requirement
|
136
|
-
requirements:
|
137
|
-
- - "~>"
|
138
|
-
- !ruby/object:Gem::Version
|
139
|
-
version: '2.2'
|
140
132
|
- !ruby/object:Gem::Dependency
|
141
133
|
name: http-parser-lite
|
142
134
|
requirement: !ruby/object:Gem::Requirement
|
@@ -158,6 +150,12 @@ dependencies:
|
|
158
150
|
- - "~>"
|
159
151
|
- !ruby/object:Gem::Version
|
160
152
|
version: '2.0'
|
153
|
+
- - "!="
|
154
|
+
- !ruby/object:Gem::Version
|
155
|
+
version: 2.3.0
|
156
|
+
- - "!="
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
version: 2.4.0
|
161
159
|
type: :runtime
|
162
160
|
prerelease: false
|
163
161
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -165,6 +163,12 @@ dependencies:
|
|
165
163
|
- - "~>"
|
166
164
|
- !ruby/object:Gem::Version
|
167
165
|
version: '2.0'
|
166
|
+
- - "!="
|
167
|
+
- !ruby/object:Gem::Version
|
168
|
+
version: 2.3.0
|
169
|
+
- - "!="
|
170
|
+
- !ruby/object:Gem::Version
|
171
|
+
version: 2.4.0
|
168
172
|
- !ruby/object:Gem::Dependency
|
169
173
|
name: rspec
|
170
174
|
requirement: !ruby/object:Gem::Requirement
|
@@ -228,22 +232,7 @@ executables:
|
|
228
232
|
extensions: []
|
229
233
|
extra_rdoc_files: []
|
230
234
|
files:
|
231
|
-
- ".coveralls.yml"
|
232
|
-
- ".gitignore"
|
233
|
-
- ".rspec"
|
234
|
-
- ".rubocop.yml"
|
235
|
-
- ".travis.yml"
|
236
|
-
- Dockerfile
|
237
|
-
- Gemfile
|
238
|
-
- MIT-LICENSE
|
239
|
-
- Rakefile
|
240
|
-
- TODO
|
241
235
|
- bin/invoker
|
242
|
-
- contrib/completion/invoker-completion.bash
|
243
|
-
- contrib/completion/invoker-completion.zsh
|
244
|
-
- examples/hello_sinatra.rb
|
245
|
-
- examples/sample.ini
|
246
|
-
- invoker.gemspec
|
247
236
|
- lib/invoker.rb
|
248
237
|
- lib/invoker/cli.rb
|
249
238
|
- lib/invoker/cli/pinger.rb
|
@@ -280,7 +269,6 @@ files:
|
|
280
269
|
- lib/invoker/power/dns.rb
|
281
270
|
- lib/invoker/power/http_parser.rb
|
282
271
|
- lib/invoker/power/http_response.rb
|
283
|
-
- lib/invoker/power/pf_migrate.rb
|
284
272
|
- lib/invoker/power/port_finder.rb
|
285
273
|
- lib/invoker/power/power.rb
|
286
274
|
- lib/invoker/power/powerup.rb
|
@@ -288,7 +276,6 @@ files:
|
|
288
276
|
- lib/invoker/power/setup/distro/arch.rb
|
289
277
|
- lib/invoker/power/setup/distro/base.rb
|
290
278
|
- lib/invoker/power/setup/distro/debian.rb
|
291
|
-
- lib/invoker/power/setup/distro/mint.rb
|
292
279
|
- lib/invoker/power/setup/distro/opensuse.rb
|
293
280
|
- lib/invoker/power/setup/distro/redhat.rb
|
294
281
|
- lib/invoker/power/setup/distro/ubuntu.rb
|
@@ -305,7 +292,6 @@ files:
|
|
305
292
|
- lib/invoker/reactor.rb
|
306
293
|
- lib/invoker/reactor/reader.rb
|
307
294
|
- lib/invoker/version.rb
|
308
|
-
- readme.md
|
309
295
|
- spec/invoker/cli/pinger_spec.rb
|
310
296
|
- spec/invoker/cli/tail_watcher_spec.rb
|
311
297
|
- spec/invoker/cli_spec.rb
|
@@ -324,7 +310,6 @@ files:
|
|
324
310
|
- spec/invoker/power/config_spec.rb
|
325
311
|
- spec/invoker/power/http_parser_spec.rb
|
326
312
|
- spec/invoker/power/http_response_spec.rb
|
327
|
-
- spec/invoker/power/pf_migrate_spec.rb
|
328
313
|
- spec/invoker/power/port_finder_spec.rb
|
329
314
|
- spec/invoker/power/setup/linux_setup_spec.rb
|
330
315
|
- spec/invoker/power/setup/osx_setup_spec.rb
|
@@ -334,11 +319,15 @@ files:
|
|
334
319
|
- spec/invoker/process_manager_spec.rb
|
335
320
|
- spec/invoker/reactor_spec.rb
|
336
321
|
- spec/spec_helper.rb
|
337
|
-
homepage:
|
322
|
+
homepage: https://invoker.codemancers.com
|
338
323
|
licenses:
|
339
324
|
- MIT
|
340
|
-
metadata:
|
341
|
-
|
325
|
+
metadata:
|
326
|
+
bug_tracker_uri: https://github.com/code-mancers/invoker/issues
|
327
|
+
changelog_uri: https://github.com/code-mancers/invoker/blob/master/CHANGELOG.md
|
328
|
+
documentation_uri: https://invoker.codemancers.com/
|
329
|
+
source_code_uri: https://github.com/code-mancers/invoker/tree/v1.5.8
|
330
|
+
post_install_message:
|
342
331
|
rdoc_options: []
|
343
332
|
require_paths:
|
344
333
|
- lib
|
@@ -353,37 +342,35 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
353
342
|
- !ruby/object:Gem::Version
|
354
343
|
version: '0'
|
355
344
|
requirements: []
|
356
|
-
|
357
|
-
|
358
|
-
signing_key:
|
345
|
+
rubygems_version: 3.1.4
|
346
|
+
signing_key:
|
359
347
|
specification_version: 4
|
360
348
|
summary: Something small for Process management
|
361
349
|
test_files:
|
362
|
-
- spec/
|
363
|
-
- spec/invoker/
|
350
|
+
- spec/spec_helper.rb
|
351
|
+
- spec/invoker/power/port_finder_spec.rb
|
352
|
+
- spec/invoker/power/config_spec.rb
|
353
|
+
- spec/invoker/power/setup_spec.rb
|
354
|
+
- spec/invoker/power/setup/osx_setup_spec.rb
|
355
|
+
- spec/invoker/power/setup/linux_setup_spec.rb
|
356
|
+
- spec/invoker/power/http_parser_spec.rb
|
357
|
+
- spec/invoker/power/url_rewriter_spec.rb
|
358
|
+
- spec/invoker/power/balancer_spec.rb
|
359
|
+
- spec/invoker/power/web_sockets_spec.rb
|
360
|
+
- spec/invoker/power/http_response_spec.rb
|
361
|
+
- spec/invoker/config_spec.rb
|
362
|
+
- spec/invoker/invoker_spec.rb
|
364
363
|
- spec/invoker/cli_spec.rb
|
365
364
|
- spec/invoker/command_worker_spec.rb
|
366
|
-
- spec/invoker/
|
367
|
-
- spec/invoker/
|
365
|
+
- spec/invoker/reactor_spec.rb
|
366
|
+
- spec/invoker/cli/pinger_spec.rb
|
367
|
+
- spec/invoker/cli/tail_watcher_spec.rb
|
368
368
|
- spec/invoker/daemon_spec.rb
|
369
|
-
- spec/invoker/
|
370
|
-
- spec/invoker/invoker_spec.rb
|
371
|
-
- spec/invoker/ipc/client_handler_spec.rb
|
372
|
-
- spec/invoker/ipc/dns_check_command_spec.rb
|
369
|
+
- spec/invoker/ipc/unix_client_spec.rb
|
373
370
|
- spec/invoker/ipc/message/list_response_spec.rb
|
374
371
|
- spec/invoker/ipc/message_spec.rb
|
375
|
-
- spec/invoker/ipc/
|
376
|
-
- spec/invoker/
|
377
|
-
- spec/invoker/
|
378
|
-
- spec/invoker/power/http_parser_spec.rb
|
379
|
-
- spec/invoker/power/http_response_spec.rb
|
380
|
-
- spec/invoker/power/pf_migrate_spec.rb
|
381
|
-
- spec/invoker/power/port_finder_spec.rb
|
382
|
-
- spec/invoker/power/setup/linux_setup_spec.rb
|
383
|
-
- spec/invoker/power/setup/osx_setup_spec.rb
|
384
|
-
- spec/invoker/power/setup_spec.rb
|
385
|
-
- spec/invoker/power/url_rewriter_spec.rb
|
386
|
-
- spec/invoker/power/web_sockets_spec.rb
|
372
|
+
- spec/invoker/ipc/dns_check_command_spec.rb
|
373
|
+
- spec/invoker/ipc/client_handler_spec.rb
|
374
|
+
- spec/invoker/event/manager_spec.rb
|
387
375
|
- spec/invoker/process_manager_spec.rb
|
388
|
-
- spec/invoker/
|
389
|
-
- spec/spec_helper.rb
|
376
|
+
- spec/invoker/commander_spec.rb
|
data/.coveralls.yml
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
service_name: travis-ci
|
data/.gitignore
DELETED
data/.rspec
DELETED
data/.rubocop.yml
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
AllCops:
|
2
|
-
Excludes:
|
3
|
-
- db/**
|
4
|
-
|
5
|
-
HashSyntax:
|
6
|
-
Description: 'Use either hash rocket or 1.9 styled hashes.'
|
7
|
-
Enabled: false
|
8
|
-
|
9
|
-
LineLength:
|
10
|
-
Max: 100
|
11
|
-
|
12
|
-
# Disable Certain Tests
|
13
|
-
|
14
|
-
Documentation:
|
15
|
-
Description: 'Document classes and non-namespace modules.'
|
16
|
-
Enabled: false
|
17
|
-
|
18
|
-
StringLiterals:
|
19
|
-
Description: 'Checks if uses of quotes match the configured preference.'
|
20
|
-
Enabled: false
|
21
|
-
|
22
|
-
Encoding:
|
23
|
-
Description: 'Use UTF-8 as the source file encoding.'
|
24
|
-
Enabled: false
|
25
|
-
|
26
|
-
SignalException:
|
27
|
-
Description: 'Do not enforce use of fail when raising exceptions.'
|
28
|
-
# Valid values are: semantic, only_raise and only_fail
|
29
|
-
EnforcedStyle: only_raise
|
data/.travis.yml
DELETED
data/Dockerfile
DELETED
data/Gemfile
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
source "https://rubygems.org"
|
2
|
-
|
3
|
-
gemspec
|
4
|
-
|
5
|
-
gem 'websocket-eventmachine-server', require: false
|
6
|
-
gem 'websocket-eventmachine-client', require: false
|
7
|
-
|
8
|
-
group :development do
|
9
|
-
gem 'pry'
|
10
|
-
gem 'tins', '~>1.4.0'
|
11
|
-
gem 'coveralls', require: false
|
12
|
-
gem "simplecov", require: false
|
13
|
-
end
|
data/MIT-LICENSE
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
Copyright (c) 2013-2014 Hemant Kumar
|
2
|
-
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
-
a copy of this software and associated documentation files (the
|
5
|
-
"Software"), to deal in the Software without restriction, including
|
6
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
-
permit persons to whom the Software is furnished to do so, subject to
|
9
|
-
the following conditions:
|
10
|
-
|
11
|
-
The above copyright notice and this permission notice shall be
|
12
|
-
included in all copies or substantial portions of the Software.
|
13
|
-
|
14
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|