class Chandler::Configuration

Attributes

changelog_path[RW]
dry_run[RW]
environment[RW]
git_path[RW]
github_repository[W]
logger[RW]
tag_prefix[RW]

Public Class Methods

new() click to toggle source
# File lib/chandler/configuration.rb, line 12
def initialize
  @changelog_path = "CHANGELOG.md"
  @git_path = ".git"
  @logger = Chandler::Logger.new
  @dry_run = false
  @github_repository = nil
end

Public Instance Methods

changelog() click to toggle source
# File lib/chandler/configuration.rb, line 35
def changelog
  @changelog ||= Chandler::Changelog.new(:path => changelog_path)
end
dry_run?() click to toggle source
# File lib/chandler/configuration.rb, line 20
def dry_run?
  dry_run
end
git() click to toggle source
# File lib/chandler/configuration.rb, line 24
def git
  @git ||= Chandler::Git.new(:path => git_path, :tag_mapper => tag_mapper)
end
github() click to toggle source
# File lib/chandler/configuration.rb, line 28
def github
  @github ||= Chandler::GitHub.new(
    :repository => github_repository,
    :config => self
  )
end
github_repository() click to toggle source
# File lib/chandler/configuration.rb, line 39
def github_repository
  @github_repository || git.origin_remote
end
tag_mapper() click to toggle source
# File lib/chandler/configuration.rb, line 43
def tag_mapper
  return ->(tag) { tag } if tag_prefix.nil?
  ->(tag) { tag[/^#{Regexp.escape(tag_prefix)}(.*)/, 1] }
end