Class: Harbinger::Analyzers::RubyDetector
- Inherits:
-
Object
- Object
- Harbinger::Analyzers::RubyDetector
- Defined in:
- lib/harbinger/analyzers/ruby_detector.rb
Instance Method Summary collapse
- #detect ⇒ Object
-
#initialize(project_path) ⇒ RubyDetector
constructor
A new instance of RubyDetector.
- #ruby_detected? ⇒ Boolean
Constructor Details
#initialize(project_path) ⇒ RubyDetector
Returns a new instance of RubyDetector.
8 9 10 |
# File 'lib/harbinger/analyzers/ruby_detector.rb', line 8 def initialize(project_path) @project_path = project_path end |
Instance Method Details
#detect ⇒ Object
12 13 14 15 16 17 |
# File 'lib/harbinger/analyzers/ruby_detector.rb', line 12 def detect detect_from_ruby_version || detect_from_gemfile || detect_from_gemfile_lock || detect_from_dockerfile end |
#ruby_detected? ⇒ Boolean
19 20 21 22 23 |
# File 'lib/harbinger/analyzers/ruby_detector.rb', line 19 def ruby_detected? File.exist?(File.join(project_path, "Gemfile")) || File.exist?(File.join(project_path, "Gemfile.lock")) || File.exist?(File.join(project_path, ".ruby-version")) end |