Module: Shuttle::Support::Thin
Instance Method Summary collapse
- #thin_config ⇒ Object
- #thin_env ⇒ Object
- #thin_host ⇒ Object
- #thin_options ⇒ Object
- #thin_port ⇒ Object
- #thin_restart ⇒ Object
- #thin_servers ⇒ Object
- #thin_start ⇒ Object
- #thin_stop ⇒ Object
Instance Method Details
#thin_config ⇒ Object
3 4 5 |
# File 'lib/shuttle/support/thin.rb', line 3 def thin_config config.thin || Hashr.new end |
#thin_env ⇒ Object
19 20 21 |
# File 'lib/shuttle/support/thin.rb', line 19 def thin_env environment end |
#thin_host ⇒ Object
7 8 9 |
# File 'lib/shuttle/support/thin.rb', line 7 def thin_host thin_config.host || "127.0.0.1" end |
#thin_options ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/shuttle/support/thin.rb', line 23 def [ "-a #{thin_host}", "-p #{thin_port}", "-e #{thin_env}", "-s #{thin_servers}", "-l #{shared_path('log/thin.log')}", "-P #{shared_path('pids/thin.pid')}", "-d" ].join(' ') end |
#thin_port ⇒ Object
11 12 13 |
# File 'lib/shuttle/support/thin.rb', line 11 def thin_port thin_config.port || "9000" end |
#thin_restart ⇒ Object
51 52 53 54 55 56 57 |
# File 'lib/shuttle/support/thin.rb', line 51 def thin_restart if ssh.file_exists?(shared_path("pids/thin.#{thin_port}.pid")) thin_stop end thin_start end |
#thin_servers ⇒ Object
15 16 17 |
# File 'lib/shuttle/support/thin.rb', line 15 def thin_servers thin_config.servers || 1 end |
#thin_start ⇒ Object
35 36 37 38 39 40 41 42 43 |
# File 'lib/shuttle/support/thin.rb', line 35 def thin_start log "Starting thin" res = ssh.run("cd #{release_path} && ./bin/thin #{} start") unless res.success? error "Unable to start thin: #{res.output}" end end |
#thin_stop ⇒ Object
45 46 47 48 49 |
# File 'lib/shuttle/support/thin.rb', line 45 def thin_stop log "Stopping thin" ssh.run("cd #{release_path} && ./bin/thin #{} stop") end |