Sha256: bf1a8669cbeb3377f10d9fcd52a7d9b495ec86f8deb79a33a7640b0789fe1bb4

Contents?: true

Size: 731 Bytes

Versions: 3

Compression:

Stored size: 731 Bytes

Contents

# frozen_string_literal: true

require 'rubycritic/configuration'

module RubyCritic
  class CommandFactory
    def self.create(options = {})
      Config.set(options)
      command_class(Config.mode).new(options)
    end

    def self.command_class(mode)
      case mode
      when :version
        require 'rubycritic/commands/version'
        Command::Version
      when :help
        require 'rubycritic/commands/help'
        Command::Help
      when :ci
        require 'rubycritic/commands/ci'
        Command::Ci
      when :compare_branches
        require 'rubycritic/commands/compare'
        Command::Compare
      else
        require 'rubycritic/commands/default'
        Command::Default
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rubycritic-3.5.2 lib/rubycritic/command_factory.rb
rubycritic-3.5.1 lib/rubycritic/command_factory.rb
rubycritic-3.5.0 lib/rubycritic/command_factory.rb