Class: Rsm::Base
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- Rsm::Base
- Includes:
- Actions, Thor::Actions
- Defined in:
- lib/rsm/base.rb
Direct Known Subclasses
Rsm::Bundle::Install, Rsm::Bundle::Update, Install::Nginx, Install::Rails, Thin::Restart, Thin::Start, Thin::Stop, Unicorn::Restart, Unicorn::Start, Unicorn::Stop
Constant Summary collapse
- SERVERS =
[:unicorn, :thin]
Constants included from Actions
Instance Attribute Summary collapse
-
#server ⇒ Object
readonly
Returns the value of attribute server.
-
#socket_per_worker ⇒ Object
readonly
Returns the value of attribute socket_per_worker.
-
#worker_processes ⇒ Object
readonly
Returns the value of attribute worker_processes.
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Actions
#application_root, #downloaded_file, #fetch_temporary_archive, #ruby_binary, #run_ruby_binary, #run_with_bundler, #unpack_compressed_archive
Instance Attribute Details
#server ⇒ Object (readonly)
Returns the value of attribute server.
10 11 12 |
# File 'lib/rsm/base.rb', line 10 def server @server end |
#socket_per_worker ⇒ Object (readonly)
Returns the value of attribute socket_per_worker.
10 11 12 |
# File 'lib/rsm/base.rb', line 10 def socket_per_worker @socket_per_worker end |
#worker_processes ⇒ Object (readonly)
Returns the value of attribute worker_processes.
10 11 12 |
# File 'lib/rsm/base.rb', line 10 def worker_processes @worker_processes end |
Class Method Details
.source_root ⇒ Object
27 28 29 |
# File 'lib/rsm/base.rb', line 27 def self.source_root File.("../../../templates/#{template_path}", __FILE__) end |
.template_path ⇒ Object
23 24 25 |
# File 'lib/rsm/base.rb', line 23 def self.template_path Thor::Util.snake_case(name.to_s).squeeze(":").gsub(":", "/") end |
Instance Method Details
#set_destination_root ⇒ Object
31 32 33 |
# File 'lib/rsm/base.rb', line 31 def set_destination_root self.destination_root = application_root.to_s end |
#set_server ⇒ Object
35 36 37 38 39 |
# File 'lib/rsm/base.rb', line 35 def set_server @server = [:server].to_sym raise "Unknown server #{[:server].inspect}. Available is #{SERVERS}" unless SERVERS.include?(server) @socket_per_worker = (server == :thin) end |
#set_worker_processes ⇒ Object
41 42 43 |
# File 'lib/rsm/base.rb', line 41 def set_worker_processes @worker_processes = [:worker_processes] end |