Class: Gitx::Configuration
- Inherits:
-
Object
- Object
- Gitx::Configuration
- Defined in:
- lib/gitx/configuration.rb
Constant Summary collapse
- CONFIG_FILE =
'.gitx.yml'
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
- #after_release_scripts ⇒ Object
- #aggregate_branch?(branch) ⇒ Boolean
- #aggregate_branches ⇒ Object
- #base_branch ⇒ Object
-
#initialize(root_dir) ⇒ Configuration
constructor
A new instance of Configuration.
- #reserved_branch?(branch) ⇒ Boolean
- #reserved_branches ⇒ Object
- #taggable_branch?(branch) ⇒ Boolean
- #taggable_branches ⇒ Object
Constructor Details
#initialize(root_dir) ⇒ Configuration
Returns a new instance of Configuration.
9 10 11 12 13 |
# File 'lib/gitx/configuration.rb', line 9 def initialize(root_dir) @config = Thor::CoreExt::HashWithIndifferentAccess.new @config.merge!(load_config(File.join(__dir__, 'defaults.yml'))) @config.merge!(load_config(File.join(root_dir, CONFIG_FILE))) end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
7 8 9 |
# File 'lib/gitx/configuration.rb', line 7 def config @config end |
Instance Method Details
#after_release_scripts ⇒ Object
43 44 45 |
# File 'lib/gitx/configuration.rb', line 43 def after_release_scripts config[:after_release] end |
#aggregate_branch?(branch) ⇒ Boolean
23 24 25 |
# File 'lib/gitx/configuration.rb', line 23 def aggregate_branch?(branch) aggregate_branches.include?(branch) end |
#aggregate_branches ⇒ Object
19 20 21 |
# File 'lib/gitx/configuration.rb', line 19 def aggregate_branches config[:aggregate_branches] end |
#base_branch ⇒ Object
15 16 17 |
# File 'lib/gitx/configuration.rb', line 15 def base_branch config[:base_branch] end |
#reserved_branch?(branch) ⇒ Boolean
31 32 33 |
# File 'lib/gitx/configuration.rb', line 31 def reserved_branch?(branch) reserved_branches.include?(branch) end |
#reserved_branches ⇒ Object
27 28 29 |
# File 'lib/gitx/configuration.rb', line 27 def reserved_branches config[:reserved_branches] end |
#taggable_branch?(branch) ⇒ Boolean
39 40 41 |
# File 'lib/gitx/configuration.rb', line 39 def taggable_branch?(branch) taggable_branches.include?(branch) end |
#taggable_branches ⇒ Object
35 36 37 |
# File 'lib/gitx/configuration.rb', line 35 def taggable_branches config[:taggable_branches] end |