Class: Heroku::Forward::Backends::Thin
- Defined in:
- lib/heroku/forward/backends/thin.rb
Instance Attribute Summary collapse
-
#ssl ⇒ Object
Returns the value of attribute ssl.
-
#ssl_cert_file ⇒ Object
Returns the value of attribute ssl_cert_file.
-
#ssl_key_file ⇒ Object
Returns the value of attribute ssl_key_file.
-
#ssl_verify ⇒ Object
Returns the value of attribute ssl_verify.
Attributes inherited from Base
#application, #environment, #pid, #socket
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Thin
constructor
options: application: passed with -R, eg.
- #spawn! ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(options = {}) ⇒ Thin
options:
application: passed with -R, eg. app.ru
socket: passed with --socket, eg. /tmp/thin.sock
env: passed with -e, defaults to 'development'
ssl: activated with --ssl
ssl_key_file: passed with ssl_key_file PATH
ssl_cert_file: passed with ssl_cert_file PATH
ssl_verify: activated with ssl_verify
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/heroku/forward/backends/thin.rb', line 20 def initialize( = {}) @application = [:application] @socket = [:socket] || Heroku::Forward::Utils::Dir.tmp_filename('thin-', '.sock') @env = [:env] || :development @ssl = [:ssl] || false @ssl_key_file = [:ssl_key_file] || false @ssl_cert_file = [:ssl_cert_file] || false @ssl_verify = [:ssl_verify] || false end |
Instance Attribute Details
#ssl ⇒ Object
Returns the value of attribute ssl.
7 8 9 |
# File 'lib/heroku/forward/backends/thin.rb', line 7 def ssl @ssl end |
#ssl_cert_file ⇒ Object
Returns the value of attribute ssl_cert_file.
9 10 11 |
# File 'lib/heroku/forward/backends/thin.rb', line 9 def ssl_cert_file @ssl_cert_file end |
#ssl_key_file ⇒ Object
Returns the value of attribute ssl_key_file.
8 9 10 |
# File 'lib/heroku/forward/backends/thin.rb', line 8 def ssl_key_file @ssl_key_file end |
#ssl_verify ⇒ Object
Returns the value of attribute ssl_verify.
10 11 12 |
# File 'lib/heroku/forward/backends/thin.rb', line 10 def ssl_verify @ssl_verify end |
Instance Method Details
#spawn! ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/heroku/forward/backends/thin.rb', line 31 def spawn! return false if spawned? check! spawn_with = [ "thin" ] spawn_with.push "start" spawn_with.push "-R", @application spawn_with.push "--socket", @socket spawn_with.push "-e", @env.to_s spawn_with.push "--ssl" if @ssl spawn_with.push "--ssl-key-file", @ssl_key_file if @ssl_key_file spawn_with.push "--ssl-cert-file", @ssl_cert_file if @ssl_cert_file spawn_with.push "--ssl-verify" if @ssl_verify @pid = Spoon.spawnp(* spawn_with) @spawned = true end |