invoker 1.2.0.pre2 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/contrib/completion/invoker-completion.zsh +62 -0
- data/invoker.gemspec +1 -1
- data/lib/invoker/version.rb +1 -1
- data/spec/invoker/cli/pinger_spec.rb +2 -2
- data/spec/invoker/event/manager_spec.rb +1 -1
- data/spec/invoker/invoker_spec.rb +7 -7
- data/spec/invoker/ipc/message/list_response_spec.rb +1 -1
- data/spec/invoker/power/config_spec.rb +1 -1
- data/spec/invoker/power/setup/osx_setup_spec.rb +1 -1
- data/spec/invoker/process_manager_spec.rb +3 -3
- data/spec/spec_helper.rb +0 -1
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a011067582381c326c0336b90527418663f120c
|
4
|
+
data.tar.gz: 9f460abe90192e73f05d1bf65aa6420f51744f49
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db67b1cb15a417511292aca216b298de317d9dda92a85537e69f5e877c697a3e313efdf5461dda0661bcad553f6efee19cf0a2af7b94aec8d8bc6825057a1720
|
7
|
+
data.tar.gz: 82eefa017bd91c908eaba440372a22894f2768c0d95fdead183eabcfcbcf09ffd9b5b695b79b38d67cb69e199ae94ca092c0bc742b8be5080c783565f54eb5cb
|
@@ -0,0 +1,62 @@
|
|
1
|
+
#compdef invoker
|
2
|
+
|
3
|
+
# ZSH completion function for Invoker
|
4
|
+
#
|
5
|
+
# Drop this file somewhere in your $fpath
|
6
|
+
# and rename it _invoker
|
7
|
+
#
|
8
|
+
# The recommended way to install this script is to copy to '~/.zsh/_invoker'
|
9
|
+
# and then add the following to your ~/.zshrc file:
|
10
|
+
#
|
11
|
+
# fpath=(~/.zsh $fpath)
|
12
|
+
#
|
13
|
+
# You may also need to force rebuild 'zcompdump':
|
14
|
+
#
|
15
|
+
# rm -f ~/.zcompdump*; compinit
|
16
|
+
|
17
|
+
local curcontext="$curcontext" state line ret=1
|
18
|
+
|
19
|
+
_arguments -C \
|
20
|
+
'1: :->cmds' \
|
21
|
+
'*:: :->args' && ret=0
|
22
|
+
|
23
|
+
case $state in
|
24
|
+
cmds)
|
25
|
+
_values 'invoker command' \
|
26
|
+
'add[Add a program to Invoker server]' \
|
27
|
+
'add_http[Add an external process to Invoker DNS server]' \
|
28
|
+
'help[Describe available commands or one specific command]' \
|
29
|
+
'list[List all running processes]' \
|
30
|
+
'reload[Reload a process managed by Invoker]' \
|
31
|
+
'remove[Stop a process managed by Invoker]' \
|
32
|
+
'setup[Run Invoker setup]' \
|
33
|
+
'start[Start Invoker server]' \
|
34
|
+
'stop[Stop Invoker daemon]' \
|
35
|
+
'tail[Tail a particular process]' \
|
36
|
+
'uninstall[Uninstall Invoker and all installed files]' \
|
37
|
+
'version[Print Invoker version]'
|
38
|
+
ret=0
|
39
|
+
;;
|
40
|
+
|
41
|
+
args)
|
42
|
+
case $line[1] in
|
43
|
+
help)
|
44
|
+
if (( CURRENT == 2 )); then
|
45
|
+
_values 'commands' \
|
46
|
+
'add' 'add_http' 'list' 'reload' 'remove' 'setup' 'start' 'stop' 'tail' 'uninstall' 'version'
|
47
|
+
fi
|
48
|
+
ret=0
|
49
|
+
;;
|
50
|
+
|
51
|
+
start)
|
52
|
+
_arguments \
|
53
|
+
'(-d --daemon)'{-d,--daemon}'[Daemonize the server into the background]' \
|
54
|
+
'(--port)--port[Port series to be used for starting rack servers]' \
|
55
|
+
'1:config file:_path_files'
|
56
|
+
ret=0
|
57
|
+
;;
|
58
|
+
esac
|
59
|
+
;;
|
60
|
+
esac
|
61
|
+
|
62
|
+
return ret
|
data/invoker.gemspec
CHANGED
@@ -36,7 +36,7 @@ Gem::Specification.new do |s|
|
|
36
36
|
s.add_dependency("facter", "~> 2.0")
|
37
37
|
s.add_dependency("http-parser-lite", "~> 0.6")
|
38
38
|
s.add_dependency("dotenv", "~> 0.9")
|
39
|
-
s.add_development_dependency("rspec")
|
39
|
+
s.add_development_dependency("rspec", "~> 3.0")
|
40
40
|
s.add_development_dependency("mocha")
|
41
41
|
s.add_development_dependency("rake")
|
42
42
|
end
|
data/lib/invoker/version.rb
CHANGED
@@ -8,7 +8,7 @@ describe Invoker::CLI::Pinger do
|
|
8
8
|
context "If Invoker is running" do
|
9
9
|
it "should return true" do
|
10
10
|
unix_client.expects(:send_and_receive).returns(pong)
|
11
|
-
expect(pinger.invoker_running?).to
|
11
|
+
expect(pinger.invoker_running?).to be_truthy
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
@@ -16,7 +16,7 @@ describe Invoker::CLI::Pinger do
|
|
16
16
|
it "should return false" do
|
17
17
|
unix_client.expects(:send_and_receive).returns(nil)
|
18
18
|
unix_client.expects(:abort).never
|
19
|
-
expect(pinger.invoker_running?).to
|
19
|
+
expect(pinger.invoker_running?).to be_falsey
|
20
20
|
end
|
21
21
|
end
|
22
22
|
end
|
@@ -4,25 +4,25 @@ describe "Invoker" do
|
|
4
4
|
describe "#darwin?" do
|
5
5
|
it "should return true on osx" do
|
6
6
|
Invoker.expects(:ruby_platform).returns("x86_64-darwin12.4.0")
|
7
|
-
expect(Invoker.darwin?).to
|
7
|
+
expect(Invoker.darwin?).to be_truthy
|
8
8
|
end
|
9
9
|
|
10
10
|
it "should return false on linux" do
|
11
11
|
Invoker.expects(:ruby_platform).returns("i686-linux")
|
12
|
-
expect(Invoker.darwin?).to
|
12
|
+
expect(Invoker.darwin?).to be_falsey
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
16
|
describe "#can_run_balancer?" do
|
17
17
|
it "should return false if setup command was not run" do
|
18
|
-
expect(Invoker.can_run_balancer?).to
|
18
|
+
expect(Invoker.can_run_balancer?).to be_falsey
|
19
19
|
end
|
20
20
|
|
21
21
|
it "should return true if setup was run properly" do
|
22
22
|
File.open(Invoker::Power::Config.config_file, "w") {|fl|
|
23
23
|
fl.write("hello")
|
24
24
|
}
|
25
|
-
expect(Invoker.can_run_balancer?).to
|
25
|
+
expect(Invoker.can_run_balancer?).to be_truthy
|
26
26
|
end
|
27
27
|
|
28
28
|
it "should not print warning if setup is not run when flag is false" do
|
@@ -41,7 +41,7 @@ describe "Invoker" do
|
|
41
41
|
context "when the old config file does not exist" do
|
42
42
|
it "creates the new config directory" do
|
43
43
|
Invoker.setup_config_location
|
44
|
-
expect(Dir.exist?(@config_location)).to
|
44
|
+
expect(Dir.exist?(@config_location)).to be_truthy
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
@@ -54,9 +54,9 @@ describe "Invoker" do
|
|
54
54
|
|
55
55
|
it "moves the file to the new directory" do
|
56
56
|
Invoker.setup_config_location
|
57
|
-
expect(Dir.exist?(@config_location)).to
|
57
|
+
expect(Dir.exist?(@config_location)).to be_truthy
|
58
58
|
new_config_file = File.join(@config_location, 'config')
|
59
|
-
expect(File.exist?(new_config_file)).to
|
59
|
+
expect(File.exist?(new_config_file)).to be_truthy
|
60
60
|
expect(File.read(new_config_file)).to match('invoker config')
|
61
61
|
end
|
62
62
|
end
|
@@ -14,7 +14,7 @@ describe MM::ListResponse do
|
|
14
14
|
it "should prepare proper json" do
|
15
15
|
json_hash = message.as_json
|
16
16
|
expect(json_hash[:type]).to eql "list_response"
|
17
|
-
expect(json_hash[:processes]).to
|
17
|
+
expect(json_hash[:processes].length).to eql 2
|
18
18
|
expect(json_hash[:processes][0]).to be_a(Hash)
|
19
19
|
expect(json_hash[:processes][1]).to be_a(Hash)
|
20
20
|
end
|
@@ -6,7 +6,7 @@ describe "Invoker Power configuration" do
|
|
6
6
|
config = Invoker::Power::Config.create(
|
7
7
|
dns_port: 1200, http_port: 1201, ipfw_rule_number: 010
|
8
8
|
)
|
9
|
-
expect(File.exist?(Invoker::Power::Config.config_file)).to
|
9
|
+
expect(File.exist?(Invoker::Power::Config.config_file)).to be_truthy
|
10
10
|
|
11
11
|
config = Invoker::Power::Config.load_config()
|
12
12
|
expect(config.dns_port).to eq(1200)
|
@@ -89,7 +89,7 @@ describe Invoker::Power::OsxSetup do
|
|
89
89
|
@setup.expects(:install_firewall).once()
|
90
90
|
|
91
91
|
@setup.setup_invoker
|
92
|
-
expect(Dir.exist?(Invoker::Power::OsxSetup::RESOLVER_DIR)).to
|
92
|
+
expect(Dir.exist?(Invoker::Power::OsxSetup::RESOLVER_DIR)).to be_truthy
|
93
93
|
end
|
94
94
|
end
|
95
95
|
end
|
@@ -13,7 +13,7 @@ describe Invoker::ProcessManager do
|
|
13
13
|
|
14
14
|
it "should not start already running process" do
|
15
15
|
process_manager.workers.expects(:[]).returns(OpenStruct.new(:pid => "bogus"))
|
16
|
-
expect(process_manager.start_process_by_name("resque")).to
|
16
|
+
expect(process_manager.start_process_by_name("resque")).to be_falsey
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
@@ -28,7 +28,7 @@ describe Invoker::ProcessManager do
|
|
28
28
|
let(:options) { { process_name: 'bogus', signal: 'HUP' } }
|
29
29
|
it "should use that signal to kill the worker" do
|
30
30
|
process_manager.expects(:process_kill).with("bogus", "HUP").returns(true)
|
31
|
-
expect(process_manager.stop_process(message)).to
|
31
|
+
expect(process_manager.stop_process(message)).to be_truthy
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
@@ -36,7 +36,7 @@ describe Invoker::ProcessManager do
|
|
36
36
|
let(:options) { { process_name: 'bogus' } }
|
37
37
|
it "should use INT signal" do
|
38
38
|
process_manager.expects(:process_kill).with("bogus", "INT").returns(true)
|
39
|
-
expect(process_manager.stop_process(message)).to
|
39
|
+
expect(process_manager.stop_process(message)).to be_truthy
|
40
40
|
end
|
41
41
|
end
|
42
42
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -12,7 +12,6 @@ require "mock_setup_file"
|
|
12
12
|
MM = Invoker::IPC::Message
|
13
13
|
|
14
14
|
RSpec.configure do |config|
|
15
|
-
config.treat_symbols_as_metadata_keys_with_true_values = true
|
16
15
|
config.run_all_when_everything_filtered = true
|
17
16
|
config.filter_run :focus
|
18
17
|
config.mock_framework = :mocha
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: invoker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.0
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hemant Kumar
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-06-
|
12
|
+
date: 2014-06-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|
@@ -169,16 +169,16 @@ dependencies:
|
|
169
169
|
name: rspec
|
170
170
|
requirement: !ruby/object:Gem::Requirement
|
171
171
|
requirements:
|
172
|
-
- - "
|
172
|
+
- - "~>"
|
173
173
|
- !ruby/object:Gem::Version
|
174
|
-
version: '0'
|
174
|
+
version: '3.0'
|
175
175
|
type: :development
|
176
176
|
prerelease: false
|
177
177
|
version_requirements: !ruby/object:Gem::Requirement
|
178
178
|
requirements:
|
179
|
-
- - "
|
179
|
+
- - "~>"
|
180
180
|
- !ruby/object:Gem::Version
|
181
|
-
version: '0'
|
181
|
+
version: '3.0'
|
182
182
|
- !ruby/object:Gem::Dependency
|
183
183
|
name: mocha
|
184
184
|
requirement: !ruby/object:Gem::Requirement
|
@@ -224,6 +224,7 @@ files:
|
|
224
224
|
- Rakefile
|
225
225
|
- TODO
|
226
226
|
- bin/invoker
|
227
|
+
- contrib/completion/invoker-completion.zsh
|
227
228
|
- invoker.gemspec
|
228
229
|
- lib/invoker.rb
|
229
230
|
- lib/invoker/cli.rb
|