Sha256: a19d05bdabc9be1b22d0450d44a3f9dfe0d49e0afef6932c90df512c0d71c508
Contents?: true
Size: 493 Bytes
Versions: 23
Compression:
Stored size: 493 Bytes
Contents
class Utils def self.staged_files(*dirs) dirs = reject_missing(dirs) @staged_files ||= {} @staged_files[dirs.join(' ')] ||= `git diff --cached --name-only --diff-filter=ACM #{dirs.join(' ')} | xargs`.chomp end def self.new_files(*dirs) @new_files ||= {} @new_files[dirs.join(' ')] ||= `git status --short #{dirs.join(' ')} | grep ^A | xargs`.chomp.split("A ").join(" ") end def self.reject_missing(dirs) dirs.reject { |dir| !File.exist?(dir) } end end
Version data entries
23 entries across 23 versions & 1 rubygems