class ThinIce::ThinManager

ThinManager is designed to help construct the exact command to be excuted by the Rake task.

Attributes

config_path[R]

@!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

env[R]

@!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

rackup_path[R]

@!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

thin_path[R]

@!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

new(options = {}) click to toggle source

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

config_path_param() click to toggle source

@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
env_param() click to toggle source

@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
rackup_path_param() click to toggle source

@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
start_cmd() click to toggle source

@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
stop_cmd() click to toggle source

@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
thin_exec_param() click to toggle source

@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