Module: Recheck

Defined in:
lib/recheck.rb,
lib/recheck/cli.rb,
lib/recheck/runner.rb,
lib/recheck/results.rb,
lib/recheck/version.rb,
lib/recheck/checkers.rb,
lib/recheck/commands.rb,
lib/recheck/reporters.rb,
lib/recheck/count_stats.rb,
lib/recheck/rails/setup.rb,
lib/recheck/rails/railtie.rb,
lib/recheck/vendor/optimist.rb,
lib/recheck/rails/validation.rb

Defined Under Namespace

Modules: Checker, Command, Optimist, Reporter Classes: Cli, CountStats, HookDidNotYield, HookYieldedTwice, Railtie, Runner, UnexpectedHookYield, UnexpectedReporterYield, Yields

Constant Summary collapse

ERROR_TYPES =
[:fail, :exception, :blanket, :no_query_methods, :no_queries, :no_check_methods, :no_checks].freeze
RESULT_TYPES =
([:pass] + ERROR_TYPES).freeze
Pass =

This doesn't track all the fields because Recheck is about finding errors and failures. If you need more data, please tell me about your use case?

Data.define do
  def type
    :pass
  end
end
Error =
Data.define(:type, :checker, :query, :check, :record, :exception) do
  def initialize(*args)
    super
    raise ArgumentError unless ERROR_TYPES.include? type
  end
end
VERSION =
'0.12.0'
Placeholder =
Data.define(:inspect, :comment)
FunctionPlaceholder =
Data.define(:inspect, :name, :comment)
Query =
Data.define(:inspect, :warning, :name, :comment, :or_clauses)
Validation =
Data.define(:class_name, :depth, :model, :model_root_filename, :queries) do
  def get_binding
    binding
  end
end

Class Method Summary collapse

Class Method Details

.unloaded_is_a?(obj, class_name) ⇒ Boolean

Check if an obj.is_a? Foo without having to depend on or load the foo gem.

Returns:

  • (Boolean)

Raises:

  • (ArgumentError)


5
6
7
8
9
# File 'lib/recheck.rb', line 5

def self.unloaded_is_a? obj, class_name
  raise ArgumentError, "unloaded_is_a? takes class_name as a String" unless class_name.is_a? String

  Object.const_defined?(class_name) && obj.is_a?(Object.const_get(class_name))
end