Class: Dependabot::Bundler::FileFetcher::GemspecFinder
- Inherits:
-
Object
- Object
- Dependabot::Bundler::FileFetcher::GemspecFinder
- Extended by:
- T::Sig
- Defined in:
- lib/dependabot/bundler/file_fetcher/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.
19 20 21 |
# File 'lib/dependabot/bundler/file_fetcher/gemspec_finder.rb', line 19 def initialize(gemfile:) @gemfile = gemfile end |
Instance Method Details
#gemspec_directories ⇒ Object
24 25 26 27 28 29 |
# File 'lib/dependabot/bundler/file_fetcher/gemspec_finder.rb', line 24 def gemspec_directories ast = Parser::CurrentRuby.parse(T.must(gemfile).content) find_gemspec_paths(ast) rescue Parser::SyntaxError raise Dependabot::DependencyFileNotParseable, T.must(gemfile).path end |