class ThinIce::ThinManager
ThinManager
is designed to help construct the exact command to be excuted by the Rake task.
Attributes
@!attribute env [String] Environment @!attribute config_path
[String] Path to YML configuration file @!attribute thin_path
[String] Path to Thin executable @!attribute rackup_path
[String] Path to Rackup configuration
@!attribute env [String] Environment @!attribute config_path
[String] Path to YML configuration file @!attribute thin_path
[String] Path to Thin executable @!attribute rackup_path
[String] Path to Rackup configuration
@!attribute env [String] Environment @!attribute config_path
[String] Path to YML configuration file @!attribute thin_path
[String] Path to Thin executable @!attribute rackup_path
[String] Path to Rackup configuration
@!attribute env [String] Environment @!attribute config_path
[String] Path to YML configuration file @!attribute thin_path
[String] Path to Thin executable @!attribute rackup_path
[String] Path to Rackup configuration
Public Class Methods
Creates a [ThinManager] object that is used to to aid rake task
generation
@param options [Hash] Hash containing various configuration
options
@return [ThinManager] ThinManager
object
# File lib/thin-ice/core.rb, line 41 def initialize(options = {}) @env = options[:env] @thin_path = options[:thin_path] @config_path = options[:config_path] @rackup_path = options[:rackup_path] end
Public Instance Methods
@return [Array] An Array cotaining the path to a YML configuration file.
Empty by default
# File lib/thin-ice/core.rb, line 62 def config_path_param (config_path) ? ['-C', config_path] : [] end
@return [Array] An Array cotaining the environment string. May be
empty
# File lib/thin-ice/core.rb, line 50 def env_param (env) ? [env] : [] end
@return [Array] An Array cotaining the path to a Rackup configuration file.
Empty by default
# File lib/thin-ice/core.rb, line 68 def rackup_path_param (rackup_path) ? ['-R', rackup_path] : [] end
@return [String] A concatination of strings resulting in the Thin
start command to be invoked by Rake
# File lib/thin-ice/core.rb, line 74 def start_cmd env_param + thin_exec_param + rackup_path_param + config_path_param + ['start'] end
@return [String] A concatination of strings resulting in the Thin
stop command to be invoked by Rake
# File lib/thin-ice/core.rb, line 80 def stop_cmd env_param + thin_exec_param + rackup_path_param + config_path_param + ['stop'] end
@return [Array] An Array cotaining the Thin executable location. Uses
local Thin gem by default
# File lib/thin-ice/core.rb, line 56 def thin_exec_param [thin_path || 'thin'] end