Sha256: 0cabb84f7416a36c7a280d040db5785426e1ec84e044c48c2c22d49b1d2ec7ad

Contents?: true

Size: 896 Bytes

Versions: 76

Compression:

Stored size: 896 Bytes

Contents

module Inch
  module CLI
    module Command
      # Base class for Command objects concerned with clearly specified
      # objects.
      #
      # Commands subclassing from this class are called with a list of object
      # names (most commonly only one) in the form:
      #
      #   $ inch COMMAND [paths] OBJECT_NAME [, OBJECT_NAME2, ...] [options]
      #
      # @abstract
      class BaseObject < BaseList
        attr_accessor :object

        # Prepares the given objects, parsing arguments and
        # running the source parser.
        #
        # @param *args [Array<String>] the list of arguments
        # @return [void]
        def prepare_objects(*args)
          prepare_codebase(*args)

          context = API::Get.new(codebase, @options.object_names)
          self.objects = context.objects
          self.object = context.object
        end
      end
    end
  end
end

Version data entries

76 entries across 76 versions & 1 rubygems

Version Path
inch-0.3.3 lib/inch/cli/command/base_object.rb
inch-0.3.3.rc1 lib/inch/cli/command/base_object.rb
inch-0.3.2 lib/inch/cli/command/base_object.rb
inch-0.3.2.rc2 lib/inch/cli/command/base_object.rb
inch-0.3.2.rc1 lib/inch/cli/command/base_object.rb
inch-0.3.1 lib/inch/cli/command/base_object.rb
inch-0.3.1.rc6 lib/inch/cli/command/base_object.rb
inch-0.3.1.rc5 lib/inch/cli/command/base_object.rb
inch-0.3.1.rc4 lib/inch/cli/command/base_object.rb
inch-0.3.1.rc3 lib/inch/cli/command/base_object.rb
inch-0.3.1.rc2 lib/inch/cli/command/base_object.rb
inch-0.3.1.rc1 lib/inch/cli/command/base_object.rb
inch-0.3.0 lib/inch/cli/command/base_object.rb
inch-0.3.0.rc3 lib/inch/cli/command/base_object.rb
inch-0.3.0.rc2 lib/inch/cli/command/base_object.rb
inch-0.3.0.rc1 lib/inch/cli/command/base_object.rb