class Startling::Configuration

Constants

DEFAULT_BODY
DEFAULT_COMMAND_PATH
DEFAULT_COMMIT_MESSAGE
DEFAULT_HANDLER_PATH
DEFAULT_STARTLINGFILES
DEFAULT_VALID_ESTIMATES

Pivotal

DEFAULT_WIP_LIMIT

Attributes

cache_dir[RW]
cli_options[RW]
developer_public_key[RW]

Trello

doing_list_id[RW]

Trello

pull_request_body[RW]
pull_request_commit_message[RW]
pull_request_handler[RW]
pull_request_labels[RW]
repos[RW]
root_dir[RW]
story_handler[RW]
valid_estimates[RW]
validate_branch_name[RW]
wip_labels[RW]
wip_limit[RW]

Public Class Methods

load_commands(path=DEFAULT_COMMAND_PATH) click to toggle source
# File lib/startling/configuration.rb, line 65
def self.load_commands(path=DEFAULT_COMMAND_PATH)
  load_path(path)
end
load_configuration() click to toggle source
# File lib/startling/configuration.rb, line 55
def self.load_configuration
  DEFAULT_STARTLINGFILES.each do |file_name|
    if Dir.entries(Startling::GitLocal.new.project_root).include? file_name
      load "#{Startling::GitLocal.new.project_root}/#{file_name}"
      return file_name
    end
  end
  nil
end
load_handlers(path=DEFAULT_HANDLER_PATH) click to toggle source
# File lib/startling/configuration.rb, line 69
def self.load_handlers(path=DEFAULT_HANDLER_PATH)
  load_path(path)
end
load_path(path) click to toggle source
# File lib/startling/configuration.rb, line 73
def self.load_path(path)
  directory = File.join(Startling::GitLocal.new.project_root, path, "*")
  return unless directory
  Dir.glob(directory).each do |file|
    load "#{file}"
  end
  directory
end
new() click to toggle source
# File lib/startling/configuration.rb, line 33
def initialize
  @cache_dir = Dir.pwd
  @root_dir = Dir.pwd
  @wip_limit = DEFAULT_WIP_LIMIT
  @wip_labels = []
  @repos = [GitLocal.new.repo_name]
  @story_handler = nil
  @validate_branch_name = nil
  @pull_request_handler = nil
  @pull_request_body = DEFAULT_BODY
  @pull_request_commit_message = DEFAULT_COMMIT_MESSAGE
  @pull_request_labels = []
  @cli_options = []

  # Pivotal
  @valid_estimates = DEFAULT_VALID_ESTIMATES

  # Trello
  @developer_public_key = nil
  @doing_list_id = nil
end

Public Instance Methods

add_cli_option(abbr_switch, full_switch, description, required=false) click to toggle source
# File lib/startling/configuration.rb, line 86
def add_cli_option(abbr_switch, full_switch, description, required=false)
  @cli_options << CliOption.new(abbr_switch, full_switch, description, required)
end
hook_commands() click to toggle source
# File lib/startling/configuration.rb, line 82
def hook_commands
  @hooks ||= HookCommands.new
end