Class: Harbinger::Analyzers::RailsAnalyzer
- Inherits:
-
Object
- Object
- Harbinger::Analyzers::RailsAnalyzer
- Defined in:
- lib/harbinger/analyzers/rails_analyzer.rb
Instance Method Summary collapse
- #detect ⇒ Object
-
#initialize(project_path) ⇒ RailsAnalyzer
constructor
A new instance of RailsAnalyzer.
- #rails_detected? ⇒ Boolean
Constructor Details
#initialize(project_path) ⇒ RailsAnalyzer
Returns a new instance of RailsAnalyzer.
6 7 8 |
# File 'lib/harbinger/analyzers/rails_analyzer.rb', line 6 def initialize(project_path) @project_path = project_path end |
Instance Method Details
#detect ⇒ Object
10 11 12 |
# File 'lib/harbinger/analyzers/rails_analyzer.rb', line 10 def detect detect_from_gemfile_lock end |
#rails_detected? ⇒ Boolean
14 15 16 17 18 19 20 21 22 |
# File 'lib/harbinger/analyzers/rails_analyzer.rb', line 14 def rails_detected? gemfile_lock = File.join(project_path, "Gemfile.lock") return false unless File.exist?(gemfile_lock) content = File.read(gemfile_lock) content.match?(/^\s*rails\s+\(/) rescue StandardError false end |