Class: Chandler::Configuration
- Inherits:
-
Object
- Object
- Chandler::Configuration
- Defined in:
- lib/chandler/configuration.rb
Instance Attribute Summary collapse
-
#changelog_path ⇒ Object
Returns the value of attribute changelog_path.
-
#dry_run ⇒ Object
Returns the value of attribute dry_run.
-
#environment ⇒ Object
Returns the value of attribute environment.
-
#git_path ⇒ Object
Returns the value of attribute git_path.
-
#github_repository ⇒ Object
Returns the value of attribute github_repository.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#tag_prefix ⇒ Object
Returns the value of attribute tag_prefix.
Instance Method Summary collapse
- #changelog ⇒ Object
- #dry_run? ⇒ Boolean
- #git ⇒ Object
- #github ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #tag_mapper ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
11 12 13 14 15 16 |
# File 'lib/chandler/configuration.rb', line 11 def initialize @changelog_path = "CHANGELOG.md" @git_path = ".git" @logger = Chandler::Logger.new @dry_run = false end |
Instance Attribute Details
#changelog_path ⇒ Object
Returns the value of attribute changelog_path.
8 9 10 |
# File 'lib/chandler/configuration.rb', line 8 def changelog_path @changelog_path end |
#dry_run ⇒ Object
Returns the value of attribute dry_run.
8 9 10 |
# File 'lib/chandler/configuration.rb', line 8 def dry_run @dry_run end |
#environment ⇒ Object
Returns the value of attribute environment.
8 9 10 |
# File 'lib/chandler/configuration.rb', line 8 def environment @environment end |
#git_path ⇒ Object
Returns the value of attribute git_path.
8 9 10 |
# File 'lib/chandler/configuration.rb', line 8 def git_path @git_path end |
#github_repository ⇒ Object
Returns the value of attribute github_repository.
8 9 10 |
# File 'lib/chandler/configuration.rb', line 8 def github_repository @github_repository end |
#logger ⇒ Object
Returns the value of attribute logger.
8 9 10 |
# File 'lib/chandler/configuration.rb', line 8 def logger @logger end |
#tag_prefix ⇒ Object
Returns the value of attribute tag_prefix.
8 9 10 |
# File 'lib/chandler/configuration.rb', line 8 def tag_prefix @tag_prefix end |
Instance Method Details
#changelog ⇒ Object
33 34 35 |
# File 'lib/chandler/configuration.rb', line 33 def changelog @changelog ||= Chandler::Changelog.new(:path => changelog_path) end |
#dry_run? ⇒ Boolean
18 19 20 |
# File 'lib/chandler/configuration.rb', line 18 def dry_run? dry_run end |
#git ⇒ Object
22 23 24 |
# File 'lib/chandler/configuration.rb', line 22 def git @git ||= Chandler::Git.new(:path => git_path, :tag_mapper => tag_mapper) end |
#github ⇒ Object
26 27 28 29 30 31 |
# File 'lib/chandler/configuration.rb', line 26 def github @github ||= Chandler::GitHub.new( :repository => github_repository, :config => self ) end |
#tag_mapper ⇒ Object
41 42 43 44 |
# File 'lib/chandler/configuration.rb', line 41 def tag_mapper return ->(tag) { tag } if tag_prefix.nil? ->(tag) { tag[/^#{Regexp.escape(tag_prefix)}(.*)/, 1] } end |