Class: HolePicker::DirectGemfileFinder
- Inherits:
-
Object
- Object
- HolePicker::DirectGemfileFinder
- Defined in:
- lib/holepicker/direct_gemfile_finder.rb
Constant Summary collapse
- SKIPPED_DIRECTORIES =
[ "-name cached-copy", "-path '*/bundle/ruby'", "-name tmp", "-name '.*'" ]
Instance Method Summary collapse
- #find_gemfiles(path) ⇒ Object
-
#initialize(options = {}) ⇒ DirectGemfileFinder
constructor
A new instance of DirectGemfileFinder.
Constructor Details
#initialize(options = {}) ⇒ DirectGemfileFinder
Returns a new instance of DirectGemfileFinder.
12 13 14 15 |
# File 'lib/holepicker/direct_gemfile_finder.rb', line 12 def initialize( = {}) @skip_ignored = .fetch(:skip_ignored, true) @only_current = .fetch(:only_current, false) end |
Instance Method Details
#find_gemfiles(path) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/holepicker/direct_gemfile_finder.rb', line 17 def find_gemfiles(path) full_path = File.(path) gemfiles = @only_current ? "-path '*/current/Gemfile.lock'" : "-name 'Gemfile.lock'" = @skip_ignored ? "\\( #{skipped_directories} \\) -prune -or #{gemfiles} -print" : gemfiles FileFinder.find_files(full_path, ) end |