Class: Cbratest::GemfileScraper
- Inherits:
-
Object
- Object
- Cbratest::GemfileScraper
- Defined in:
- lib/cobratest/gemfile_scraper.rb
Instance Method Summary collapse
-
#initialize(root_path) ⇒ GemfileScraper
constructor
A new instance of GemfileScraper.
- #name ⇒ Object
- #to_s ⇒ Object
- #transitive_cobra_dependencies ⇒ Object
Constructor Details
#initialize(root_path) ⇒ GemfileScraper
Returns a new instance of GemfileScraper.
5 6 7 |
# File 'lib/cobratest/gemfile_scraper.rb', line 5 def initialize(root_path) @root_path = root_path end |
Instance Method Details
#name ⇒ Object
9 10 11 |
# File 'lib/cobratest/gemfile_scraper.rb', line 9 def name Pathname.new(@root_path).basename.to_s end |
#to_s ⇒ Object
13 14 15 |
# File 'lib/cobratest/gemfile_scraper.rb', line 13 def to_s {name: name, options: {path: @root_path}} end |
#transitive_cobra_dependencies ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/cobratest/gemfile_scraper.rb', line 17 def transitive_cobra_dependencies gem_dependencies.inject([]) do |memo, dep| if !!dep[:options][:path] absolute_dep = dep.clone absolute_dep[:options][:path] = File.(File.join(@root_path, dep[:options][:path])) memo << dep end memo end end |