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