Class: PreCommit::Configuration::Providers::Git

Inherits:
Object
  • Object
show all
Includes:
Utils::GitConversions
Defined in:
lib/plugins/pre_commit/configuration/providers/git.rb

Direct Known Subclasses

GitOld

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Utils::GitConversions

#arr2str, #git_to_ruby, #ruby_to_git, #str2arr, #str_symbolize, #sym_symbolize

Class Method Details

.priorityObject



10
11
12
# File 'lib/plugins/pre_commit/configuration/providers/git.rb', line 10

def self.priority
  10
end

Instance Method Details

#[](name) ⇒ Object



14
15
16
# File 'lib/plugins/pre_commit/configuration/providers/git.rb', line 14

def [](name)
  git_to_ruby(`git config pre-commit.#{name.to_s.gsub(/_/,".")} 2>/dev/null`)
end

#update(name, value) ⇒ Object



18
19
20
# File 'lib/plugins/pre_commit/configuration/providers/git.rb', line 18

def update(name, value)
  `git config pre-commit.#{name.to_s.gsub(/_/,".")} "#{ruby_to_git(value)}" 2>/dev/null`
end