Class: Calcifer::Finders::FilesBranchDiffFinder
- Inherits:
-
Object
- Object
- Calcifer::Finders::FilesBranchDiffFinder
- Defined in:
- lib/calcifer/finders/files_branch_diff_finder.rb
Instance Method Summary collapse
- #execute ⇒ Object
- #git_files ⇒ Object
-
#initialize(branch) ⇒ FilesBranchDiffFinder
constructor
A new instance of FilesBranchDiffFinder.
Constructor Details
#initialize(branch) ⇒ FilesBranchDiffFinder
Returns a new instance of FilesBranchDiffFinder.
6 7 8 |
# File 'lib/calcifer/finders/files_branch_diff_finder.rb', line 6 def initialize(branch) @branch = branch end |
Instance Method Details
#execute ⇒ Object
10 11 12 13 14 15 |
# File 'lib/calcifer/finders/files_branch_diff_finder.rb', line 10 def execute @file_list = git_files.split.map(&lambda { |file_path| file = File.open(file_path) file if file.size.positive? && File.extname(file.path) == '.rb' }).compact end |
#git_files ⇒ Object
17 18 19 |
# File 'lib/calcifer/finders/files_branch_diff_finder.rb', line 17 def git_files `git diff --name-only #{@branch}...` end |