Class: Rsm::Base

Inherits:
Thor::Group
  • Object
show all
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

SERVERS =
[:unicorn, :thin]

Constants included from Actions

Actions::TAR_OPTS

Instance Attribute Summary (collapse)

Class Method Summary (collapse)

Instance Method Summary (collapse)

Methods included from Actions

#application_root, #downloaded_file, #fetch_temporary_archive, #run_ruby_binary, #unpack_compressed_archive

Instance Attribute Details

- (Object) server (readonly)

Returns the value of attribute server



10
11
12
# File 'lib/rsm/base.rb', line 10

def server
  @server
end

- (Object) socket_per_worker (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

- (Object) worker_processes (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

+ (Object) source_root



27
28
29
# File 'lib/rsm/base.rb', line 27

def self.source_root
  File.expand_path("../../../templates/#{template_path}", __FILE__)
end

+ (Object) template_path



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

- (Object) set_destination_root



31
32
33
# File 'lib/rsm/base.rb', line 31

def set_destination_root
  self.destination_root = application_root.to_s
end

- (Object) set_server



35
36
37
38
39
# File 'lib/rsm/base.rb', line 35

def set_server
  @server = options[:server].to_sym
  raise "Unknown server #{options[:server].inspect}. Available is #{SERVERS}" unless SERVERS.include?(server)
  @socket_per_worker = (server == :thin)
end

- (Object) set_worker_processes



41
42
43
# File 'lib/rsm/base.rb', line 41

def set_worker_processes
  @worker_processes = options[:worker_processes]
end