Class: Dependabot::FileFetchers::Ruby::Bundler::PathGemspecFinder
- Inherits:
-
Object
- Object
- Dependabot::FileFetchers::Ruby::Bundler::PathGemspecFinder
- Defined in:
- lib/dependabot/file_fetchers/ruby/bundler/path_gemspec_finder.rb
Overview
Finds the paths of any gemspecs declared using ‘path: ` in the passed Gemfile.
Instance Method Summary collapse
-
#initialize(gemfile:) ⇒ PathGemspecFinder
constructor
A new instance of PathGemspecFinder.
- #path_gemspec_paths ⇒ Object
Constructor Details
#initialize(gemfile:) ⇒ PathGemspecFinder
Returns a new instance of PathGemspecFinder.
15 16 17 |
# File 'lib/dependabot/file_fetchers/ruby/bundler/path_gemspec_finder.rb', line 15 def initialize(gemfile:) @gemfile = gemfile end |
Instance Method Details
#path_gemspec_paths ⇒ Object
19 20 21 22 23 24 |
# File 'lib/dependabot/file_fetchers/ruby/bundler/path_gemspec_finder.rb', line 19 def path_gemspec_paths ast = Parser::CurrentRuby.parse(gemfile.content) find_path_gemspec_paths(ast) rescue Parser::SyntaxError raise Dependabot::DependencyFileNotParseable, gemfile.path end |