Class: Git::Config
- Inherits:
-
Object
- Object
- Git::Config
- Defined in:
- lib/git/config.rb
Overview
The global configuration for this gem
Instance Attribute Summary collapse
Class Method Summary collapse
-
.instance ⇒ Git::Config
Returns the process-wide singleton Config instance.
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
25 26 27 28 29 |
# File 'lib/git/config.rb', line 25 def initialize @binary_path = nil @git_ssh = nil @timeout = nil end |
Instance Attribute Details
#binary_path
31 32 33 |
# File 'lib/git/config.rb', line 31 def binary_path @binary_path || (ENV.fetch('GIT_PATH', nil) && File.join(ENV.fetch('GIT_PATH', nil), 'git')) || 'git' end |
#git_ssh
35 36 37 |
# File 'lib/git/config.rb', line 35 def git_ssh @git_ssh || ENV.fetch('GIT_SSH', nil) end |
#timeout
39 40 41 |
# File 'lib/git/config.rb', line 39 def timeout @timeout || (ENV.fetch('GIT_TIMEOUT', nil) && ENV['GIT_TIMEOUT'].to_i) end |
Class Method Details
.instance ⇒ Git::Config
Returns the process-wide singleton Git::Config instance
All calls to Git.configure, Git.config, and the ExecutionContext classes resolve global configuration through this method.
19 20 21 |
# File 'lib/git/config.rb', line 19 def self.instance @instance ||= new end |