Class: GemRule

Inherits:
FileContentRule show all
Defined in:
lib/technologist/rules/gem_rule.rb

Instance Attribute Summary collapse

Attributes inherited from FileContentRule

#file_content_pattern, #file_name

Attributes inherited from Rule

#framework

Instance Method Summary collapse

Methods inherited from FileContentRule

#matches?

Methods inherited from Rule

#matches?

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_nameObject

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