Class: RubyChecker::RubyChecker

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_checker/ruby_checker.rb

Overview

RubyChecker is the main class for this gem. See the README.md on how to use it.

Instance Method Summary collapse

Constructor Details

#initialize(interpreter: ::RubyChecker::ANY, supported: nil) ⇒ RubyChecker

Returns a new instance of RubyChecker.



30
31
32
33
34
# File 'lib/ruby_checker/ruby_checker.rb', line 30

def initialize(interpreter: ::RubyChecker::ANY, supported: nil)
  @interpreter = interpreter
  @supported   = supported
  @current     = Gem::Version.new(RUBY_VERSION)
end

Instance Method Details

#check!Object

check! performs all the checks that are required.



37
38
39
40
41
42
43
44
# File 'lib/ruby_checker/ruby_checker.rb', line 37

def check!
  @supported = parsed_supported_version
  raise MissingSupportedVersionError if @supported.nil?

  res = perform_checks!
  Logger.new.debug "OK!" if res
  res
end