Class: Contextizer::Analyzers::RubyAnalyzer
- Defined in:
- lib/contextizer/analyzers/ruby_analyzer.rb
Constant Summary collapse
- LANGUAGE =
:ruby- SIGNALS =
[ { type: :file, path: "Gemfile", weight: 10 }, { type: :file, path: "*.gemspec", weight: 20 }, { type: :dir, path: "app/controllers", weight: 5 } ].freeze
- FRAMEWORK_SIGNALS =
{ rails: [{ type: :file, path: "bin/rails", weight: 15 }] }.freeze
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from Contextizer::Analyzers::Base
Instance Method Details
#analyze ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/contextizer/analyzers/ruby_analyzer.rb', line 18 def analyze SIGNALS.each { |signal| @score += signal[:weight] if check_signal(signal) } return nil if @score.zero? { language: LANGUAGE, framework: detect_framework, score: @score } end |