Module: Git::Repository::Configuring
- Included in:
- Git::Repository
- Defined in:
- lib/git/repository/configuring.rb
Overview
Facade methods for reading and writing git configuration
Provides the #config method, which dispatches to read a single entry, list all entries, or write a value depending on the arguments supplied.
Included by Git::Repository.
Instance Method Summary collapse
-
#config(name = nil, value = nil, options = {})
Read or write a git configuration entry.
Instance Method Details
#config ⇒ Hash{String => String} #config(name) ⇒ String #config(name, value, options = {}) ⇒ Git::CommandLineResult
Read or write a git configuration entry
Dispatches to one of three modes depending on the arguments supplied:
- List —
config()returns all visible config entries as aHash. - Get —
config(name)returns the value for a single key as aString. - Set —
config(name, value)writes a value and returns the raw command result.
74 75 76 77 78 79 80 81 82 |
# File 'lib/git/repository/configuring.rb', line 74 def config(name = nil, value = nil, = {}) if name && value Private.config_set(@execution_context, name, value, **) elsif name Private.config_get(@execution_context, name) else Private.config_list(@execution_context) end end |