Module: PreCommit::Utils::StagedFiles

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

Instance Method Summary collapse

Instance Method Details

#set_staged_files(*args) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/pre-commit/utils/staged_files.rb', line 5

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



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

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

#staged_files=(args) ⇒ Object



14
15
16
# File 'lib/pre-commit/utils/staged_files.rb', line 14

def staged_files=(args)
  @staged_files = args
end

#staged_files_allObject



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

def staged_files_all
  @staged_files = filter_files(staged_from_dir)
end

#staged_files_git_allObject



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

def staged_files_git_all
  @staged_files = filter_files(staged_from_git_all)
end