Class: TestServer::ServerCommands::Puma
- Inherits:
-
Object
- Object
- TestServer::ServerCommands::Puma
- Defined in:
- lib/test_server/server_commands/puma.rb
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Puma
constructor
A new instance of Puma.
- #to_s ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Puma
Returns a new instance of Puma.
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/test_server/server_commands/puma.rb', line 12 def initialize( = {}) @environment = .fetch(:environment, :development) @pid_file = .fetch(:pid_file, TestServer.config.pid_file) @config_file = .fetch(:config_file, ::File.('../../../../config.ru', __FILE__)) @listen = .fetch(:listen, 'tcp://127.0.0.1:8080') @worker_count = .fetch(:worker_count, nil) rescue KeyError => e raise ArgumentError, e. end |
Instance Method Details
#to_s ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/test_server/server_commands/puma.rb', line 23 def to_s cmd = [] cmd << 'puma' cmd << "-e #{environment}" if environment cmd << "--pidfile #{pid_file}" if pid_file cmd << "-b #{listen}" if listen cmd << "-w #{worker_count}" if worker_count cmd << config_file if config_file cmd.join(" ") end |