Class: Dependabot::Bundler::FileFetcher::ChildGemfileFinder
- Inherits:
-
Object
- Object
- Dependabot::Bundler::FileFetcher::ChildGemfileFinder
- Extended by:
- T::Sig
- Defined in:
- lib/dependabot/bundler/file_fetcher/child_gemfile_finder.rb
Overview
Finds the paths of any Gemfiles declared using ‘eval_gemfile` in the passed Gemfile.
Instance Method Summary collapse
- #child_gemfile_paths ⇒ Object
-
#initialize(gemfile:) ⇒ ChildGemfileFinder
constructor
A new instance of ChildGemfileFinder.
Constructor Details
#initialize(gemfile:) ⇒ ChildGemfileFinder
Returns a new instance of ChildGemfileFinder.
19 20 21 |
# File 'lib/dependabot/bundler/file_fetcher/child_gemfile_finder.rb', line 19 def initialize(gemfile:) @gemfile = gemfile end |
Instance Method Details
#child_gemfile_paths ⇒ Object
24 25 26 27 28 29 |
# File 'lib/dependabot/bundler/file_fetcher/child_gemfile_finder.rb', line 24 def child_gemfile_paths ast = Parser::CurrentRuby.parse(gemfile&.content) find_child_gemfile_paths(ast) rescue Parser::SyntaxError raise Dependabot::DependencyFileNotParseable, T.must(gemfile&.path) end |