Class: GemRule
- Inherits:
-
FileContentRule
- Object
- Rule
- FileContentRule
- GemRule
- Defined in:
- lib/technologist/rules/gem_rule.rb
Instance Attribute Summary collapse
-
#gem_name ⇒ Object
Returns the value of attribute gem_name.
Attributes inherited from FileContentRule
#file_content_pattern, #file_name
Instance Method Summary collapse
Methods inherited from Rule
Constructor Details
This class inherits a constructor from Rule
Instance Attribute Details
#gem_name ⇒ Object
Returns the value of attribute gem_name.
4 5 6 |
# File 'lib/technologist/rules/gem_rule.rb', line 4 def gem_name @gem_name end |
Instance Method Details
#matches?(framework_name, repository) ⇒ Boolean
6 7 8 9 10 11 12 |
# File 'lib/technologist/rules/gem_rule.rb', line 6 def matches?(framework_name, repository) self.file_name = 'Gemfile' self.gem_name ||= framework_name.downcase self.file_content_pattern = /^\s*gem ["']#{gem_name}["']/ super end |