Sha256: bc7970acee241ef2b0e0650d74a35bdd3033a48ea45824a10337d218481b578e

Contents?: true

Size: 785 Bytes

Versions: 12

Compression:

Stored size: 785 Bytes

Contents

module CandyCheck
  module CLI
    module Commands
      # Base for all commands providing simple support for running a single
      # command and printing to an {Out} instance
      class Base
        # Initialize a new command and prepare options for the run
        # @param options [Object]
        def initialize(options = nil)
          @options = options
        end

        # Run a single instance of a command
        # @param args [Array] arguments for the command
        # @return [Base] the command after the run
        def self.run(*args)
          new(*args).tap(&:run)
        end

        protected

        # @return [Object] configuration for the run
        attr_reader :options

        def out
          @out ||= Out.new
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
candy_check-0.6.0 lib/candy_check/cli/commands/base.rb
candy_check-0.5.0 lib/candy_check/cli/commands/base.rb
candy_check-0.4.0 lib/candy_check/cli/commands/base.rb
candy_check-0.3.0 lib/candy_check/cli/commands/base.rb
candy_check-0.2.1 lib/candy_check/cli/commands/base.rb
candy_check-0.2.0 lib/candy_check/cli/commands/base.rb
candy_check-0.1.2 lib/candy_check/cli/commands/base.rb
candy_check-0.1.1 lib/candy_check/cli/commands/base.rb
candy_check-0.1.0.pre lib/candy_check/cli/commands/base.rb
candy_check-0.0.5 lib/candy_check/cli/commands/base.rb
candy_check-0.0.3 lib/candy_check/cli/commands/base.rb
candy_check-0.0.2 lib/candy_check/cli/commands/base.rb