Class: Gitx::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/gitx/configuration.rb

Constant Summary collapse

CONFIG_FILE =
'.gitx.yml'

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#configObject (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_scriptsObject



43
44
45
# File 'lib/gitx/configuration.rb', line 43

def after_release_scripts
  config[:after_release]
end

#aggregate_branch?(branch) ⇒ Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/gitx/configuration.rb', line 23

def aggregate_branch?(branch)
  aggregate_branches.include?(branch)
end

#aggregate_branchesObject



19
20
21
# File 'lib/gitx/configuration.rb', line 19

def aggregate_branches
  config[:aggregate_branches]
end

#base_branchObject



15
16
17
# File 'lib/gitx/configuration.rb', line 15

def base_branch
  config[:base_branch]
end

#reserved_branch?(branch) ⇒ Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/gitx/configuration.rb', line 31

def reserved_branch?(branch)
  reserved_branches.include?(branch)
end

#reserved_branchesObject



27
28
29
# File 'lib/gitx/configuration.rb', line 27

def reserved_branches
  config[:reserved_branches]
end

#taggable_branch?(branch) ⇒ Boolean

Returns:

  • (Boolean)


39
40
41
# File 'lib/gitx/configuration.rb', line 39

def taggable_branch?(branch)
  taggable_branches.include?(branch)
end

#taggable_branchesObject



35
36
37
# File 'lib/gitx/configuration.rb', line 35

def taggable_branches
  config[:taggable_branches]
end