Class: Gemnasium::Parser::Gemfile
- Inherits:
-
Object
- Object
- Gemnasium::Parser::Gemfile
- Defined in:
- lib/gemnasium/parser/gemfile.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
Instance Method Summary collapse
- #dependencies ⇒ Object
- #gemspec ⇒ Object
- #gemspec? ⇒ Boolean
-
#initialize(content) ⇒ Gemfile
constructor
A new instance of Gemfile.
Constructor Details
#initialize(content) ⇒ Gemfile
Returns a new instance of Gemfile.
9 10 11 |
# File 'lib/gemnasium/parser/gemfile.rb', line 9 def initialize(content) @content = content end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
7 8 9 |
# File 'lib/gemnasium/parser/gemfile.rb', line 7 def content @content end |
Instance Method Details
#dependencies ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/gemnasium/parser/gemfile.rb', line 13 def dependencies @dependencies ||= [].tap do |deps| gem_matches.each do |match| dep = dependency(match) deps << dep if dep end end end |
#gemspec ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/gemnasium/parser/gemfile.rb', line 22 def gemspec @gemspec = if gemspec_match opts = Patterns.(gemspec_match["opts"]) path = opts["path"] name = opts["name"] || "*" File.join(*[path, "#{name}.gemspec"].compact) end end |
#gemspec? ⇒ Boolean
31 32 33 |
# File 'lib/gemnasium/parser/gemfile.rb', line 31 def gemspec? !!gemspec end |