Module: PreCommit::Utils::StagedFiles

Includes:
Configuration::TopLevel
Included in:
Runner
Defined in:
lib/pre-commit/utils/staged_files.rb

Instance Method Summary collapse

Methods included from Configuration::TopLevel

#top_level

Instance Method Details

#set_staged_files(*args) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/pre-commit/utils/staged_files.rb', line 8

def set_staged_files(*args)
  case args[0].to_s
  when "all" then staged_files_all
  when "git" then staged_files_git_all
  when "" then staged_files
  else self.staged_files=args
  end
end

#staged_filesObject



21
22
23
# File 'lib/pre-commit/utils/staged_files.rb', line 21

def staged_files
  @staged_files ||= filter_files(staged_from_git)
end

#staged_files=(args) ⇒ Object



17
18
19
# File 'lib/pre-commit/utils/staged_files.rb', line 17

def staged_files=(args)
  @staged_files = args
end

#staged_files_allObject



25
26
27
# File 'lib/pre-commit/utils/staged_files.rb', line 25

def staged_files_all
  @staged_files = filter_files(staged_from_dir)
end

#staged_files_git_allObject



29
30
31
# File 'lib/pre-commit/utils/staged_files.rb', line 29

def staged_files_git_all
  @staged_files = filter_files(staged_from_git_all)
end