Class: GitSu::CachingGit

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

Instance Method Summary collapse

Methods inherited from Git

#commit, #edit_gitsu_config, #initialize, #list_config, #list_files, #remove_config_section, #render, #render_user, #select_user, #selected_user, #set_config, #unset_config

Constructor Details

This class inherits a constructor from GitSu::Git

Instance Method Details

#clear_user(scope) ⇒ Object



142
143
144
145
# File 'lib/gitsu/git.rb', line 142

def clear_user(scope)
    # Git complains if you try to clear the user when the config file is missing
    super unless selected_user(scope).none?
end

#color_output?Boolean

Returns:

  • (Boolean)


138
139
140
# File 'lib/gitsu/git.rb', line 138

def color_output?
    @color_output.nil? ? @color_output = super : @color_output
end

#get_color(color_name) ⇒ Object



126
127
128
129
130
# File 'lib/gitsu/git.rb', line 126

def get_color(color_name)
    @colors ||= {}
    #TODO: what if it's an invalid color?
    @colors[color_name] ||= super
end

#get_config(scope, key) ⇒ Object



132
133
134
135
136
# File 'lib/gitsu/git.rb', line 132

def get_config(scope, key)
    @config ||= {}
    @config[scope] ||= {}
    @config[scope][key] ||= super
end