Class: Gitx::Configuration
- Inherits:
-
Object
- Object
- Gitx::Configuration
- Defined in:
- lib/gitx/configuration.rb
Constant Summary collapse
- CONFIG_FILE =
'.gitx.yml'.freeze
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.
10 11 12 13 14 |
# File 'lib/gitx/configuration.rb', line 10 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.
8 9 10 |
# File 'lib/gitx/configuration.rb', line 8 def config @config end |
Instance Method Details
#after_release_scripts ⇒ Object
44 45 46 |
# File 'lib/gitx/configuration.rb', line 44 def after_release_scripts config[:after_release] end |
#aggregate_branch?(branch) ⇒ Boolean
24 25 26 |
# File 'lib/gitx/configuration.rb', line 24 def aggregate_branch?(branch) aggregate_branches.include?(branch) end |
#aggregate_branches ⇒ Object
20 21 22 |
# File 'lib/gitx/configuration.rb', line 20 def aggregate_branches config[:aggregate_branches] end |
#base_branch ⇒ Object
16 17 18 |
# File 'lib/gitx/configuration.rb', line 16 def base_branch config[:base_branch] end |
#reserved_branch?(branch) ⇒ Boolean
32 33 34 |
# File 'lib/gitx/configuration.rb', line 32 def reserved_branch?(branch) reserved_branches.include?(branch) end |
#reserved_branches ⇒ Object
28 29 30 |
# File 'lib/gitx/configuration.rb', line 28 def reserved_branches config[:reserved_branches] end |
#taggable_branch?(branch) ⇒ Boolean
40 41 42 |
# File 'lib/gitx/configuration.rb', line 40 def taggable_branch?(branch) taggable_branches.include?(branch) end |
#taggable_branches ⇒ Object
36 37 38 |
# File 'lib/gitx/configuration.rb', line 36 def taggable_branches config[:taggable_branches] end |