Class: PreCommit::Configuration::Providers::GitOld

Inherits:
Git
  • Object
show all
Defined in:
lib/plugins/pre_commit/configuration/providers/git_old.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Git

#update

Methods included from Utils::GitConversions

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

Class Method Details

.priorityObject


9
10
11
# File 'lib/plugins/pre_commit/configuration/providers/git_old.rb', line 9

def self.priority
  11
end

Instance Method Details

#[](name) ⇒ Object


13
14
15
16
17
18
19
20
21
22
# File 'lib/plugins/pre_commit/configuration/providers/git_old.rb', line 13

def [](name)
  value = super(name)
  if
    name == :checks && value && ! value.kind_of?(Array)
  then
    value = value.chomp.split(/,\s*/).map(&:to_sym) || []
    update(name, value) unless value.empty?
  end
  value
end