Module: Rpr::Parser::Rubocop

Defined in:
lib/rpr/parser/rubocop.rb

Class Method Summary collapse

Class Method Details

.parse(code) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/rpr/parser/rubocop.rb', line 6

def self.parse(code)
  version = RUBY_VERSION.to_f
  # XXX: Parser gem does not support Ruby 2.6
  version = 2.5 if version == 2.6
  r = RuboCop::ProcessedSource.new(code, version)
  return r.ast
end