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
Attributes inherited from Rule
Instance Method Summary collapse
-
#initialize(framework, attributes = {}) ⇒ GemRule
constructor
A new instance of GemRule.
Methods inherited from FileContentRule
Methods inherited from Rule
Constructor Details
#initialize(framework, attributes = {}) ⇒ GemRule
Returns a new instance of GemRule.
6 7 8 9 10 11 12 |
# File 'lib/technologist/rules/gem_rule.rb', line 6 def initialize(framework, attributes = {}) super self.file_name = 'Gemfile' self.gem_name ||= framework.downcase self.file_content_pattern = /^\s*gem ["']#{gem_name}["']/ end |
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 |