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

Instance Method Summary collapse

Methods inherited from Rule

#initialize

Constructor Details

This class inherits a constructor from Rule

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

Instance Method Details

#matches?(framework_name, repository) ⇒ Boolean

Returns:

  • (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