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
# 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 "" then staged_files
  else staged_files=args
  end
end

#staged_filesObject



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

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

#staged_files=(args) ⇒ Object



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

def staged_files=(args)
  @staged_files = args
end

#staged_files_allObject



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

def staged_files_all
  @staged_files = filter_files(staged_from_dir)
end