Class: Pact::MockService::CLI
- Inherits:
-
Thor
- Object
- Thor
- Pact::MockService::CLI
show all
- Defined in:
- lib/pact/mock_service/cli.rb,
lib/pact/mock_service/cli/pidfile.rb,
lib/pact/mock_service/cli/custom_thor.rb
Defined Under Namespace
Classes: CustomThor, Pidfile
Constant Summary
collapse
- PACT_FILE_WRITE_MODE_DESC =
"`overwrite` or `merge`. Use `merge` when running multiple mock service instances in parallel for the same consumer/provider pair." +
" Ensure the pact file is deleted before running tests when using this option so that interactions deleted from the code are not maintained in the file."
Instance Method Summary
collapse
Instance Method Details
#control ⇒ Object
50
51
52
53
|
# File 'lib/pact/mock_service/cli.rb', line 50
def control
require 'pact/mock_service/control_server/run'
ControlServer::Run.(options)
end
|
#control_restart ⇒ Object
148
149
150
151
152
|
# File 'lib/pact/mock_service/cli.rb', line 148
def control_restart
restart_server(control_server_pidfile) do
control
end
end
|
#control_start ⇒ Object
121
122
123
124
125
|
# File 'lib/pact/mock_service/cli.rb', line 121
def control_start
start_server(control_server_pidfile) do
control
end
end
|
#control_stop ⇒ Object
131
132
133
|
# File 'lib/pact/mock_service/cli.rb', line 131
def control_stop
control_server_pidfile.kill_process
end
|
#restart ⇒ Object
102
103
104
105
106
|
# File 'lib/pact/mock_service/cli.rb', line 102
def restart
restart_server(mock_service_pidfile) do
service
end
end
|
#service ⇒ Object
32
33
34
35
|
# File 'lib/pact/mock_service/cli.rb', line 32
def service
require 'pact/mock_service/run'
Run.(options)
end
|
#start ⇒ Object
72
73
74
75
76
|
# File 'lib/pact/mock_service/cli.rb', line 72
def start
start_server(mock_service_pidfile) do
service
end
end
|
#stop ⇒ Object
82
83
84
|
# File 'lib/pact/mock_service/cli.rb', line 82
def stop
mock_service_pidfile.kill_process
end
|
#version ⇒ Object
156
157
158
159
|
# File 'lib/pact/mock_service/cli.rb', line 156
def version
require 'pact/mock_service/version.rb'
puts Pact::MockService::VERSION
end
|