Class: GitSu::ConfigRepository

Inherits:
Object
  • Object
show all
Defined in:
lib/gitsu/config_repository.rb

Defined Under Namespace

Classes: InvalidConfigError

Instance Method Summary collapse

Constructor Details

#initialize(git) ⇒ ConfigRepository

Returns a new instance of ConfigRepository.



22
23
24
# File 'lib/gitsu/config_repository.rb', line 22

def initialize(git)
    @git = git
end

Instance Method Details

#default_select_scopeObject



30
31
32
33
34
35
36
37
# File 'lib/gitsu/config_repository.rb', line 30

def default_select_scope
    scope_string = get_gitsu_config "defaultSelectScope", "local"
    if scope_string =~ /^(local|global|system)$/
        scope_string.to_sym
    else
        raise InvalidConfigError, "Invalid configuration value found for gitsu.defaultSelectScope: '#{scope_string}'. Expected one of 'local', 'global', or 'system'."
    end
end

#get(key) ⇒ Object



26
27
28
# File 'lib/gitsu/config_repository.rb', line 26

def get(key)
    @git.get_config(:derived, key) 
end

#group_email_addressObject



39
40
41
# File 'lib/gitsu/config_repository.rb', line 39

def group_email_address
    get_gitsu_config  "groupEmailAddress", "[email protected]"
end