Sha256: 0f3cb6d447e9d2324007268dfac1be77333d0e68353e10d631ae157d795494fd

Contents?: true

Size: 889 Bytes

Versions: 3

Compression:

Stored size: 889 Bytes

Contents

# frozen_string_literal: true

require 'attractor/version'
require 'attractor/calculators/base_calculator'
require 'attractor/calculators/ruby_calculator'
require 'attractor/calculators/js_calculator'
require 'attractor/reporters/base_reporter'
require 'attractor/reporters/console_reporter'
require 'attractor/reporters/html_reporter'
require 'attractor/reporters/sinatra_reporter'
require 'attractor/suggester'
require 'attractor/watcher'

module Attractor
  class Error < StandardError; end

  def calculators_for_type(type, file_prefix)
    case type
    when 'js'
      { 'js' => JsCalculator.new(file_prefix: file_prefix) }
    when 'rb'
      { 'rb' => RubyCalculator.new(file_prefix: file_prefix) }
    else
      { 'rb' => RubyCalculator.new(file_prefix: file_prefix), 'js' => JsCalculator.new(file_prefix: file_prefix)}
    end
  end

  module_function :calculators_for_type
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
attractor-1.0.2 lib/attractor.rb
attractor-1.0.1 lib/attractor.rb
attractor-1.0.0 lib/attractor.rb