Class: Degem::GitLsFiles

Inherits:
Object
  • Object
show all
Defined in:
lib/degem/git_ls_files.rb

Instance Method Summary collapse

Instance Method Details

#call(fallback) ⇒ Object



7
8
9
10
11
12
# File 'lib/degem/git_ls_files.rb', line 7

def call(fallback)
  out, _err, status = git_ls
  return fallback unless status.zero?

  out.split("\x0").select { _1.end_with?(".rb") }.map { File.expand_path(_1) }
end