Sha256: aed5eacec4e4092ae66fd079cf3eb4bceb2ebe2193d342746a20be581a17ba21

Contents?: true

Size: 983 Bytes

Versions: 31

Compression:

Stored size: 983 Bytes

Contents

module AutomateIt
  class Plugin
    # == Plugin::Base
    #
    # An AutomateIt Plugin provides the Interpreter with the functionality that
    # users actually care about, such as installing packages or adding users.
    # The Plugin::Base class isn't useful by itself but provides behavior
    # that's inherited by the Plugin::Manager and Plugin::Driver classes.
    class Base < Common
      def setup(opts={}) # :nodoc:
        super(opts)
        @interpreter ||= opts[:interpreter] \
          || AutomateIt::Interpreter.new(:parent => self)
      end

      # Get token for the plugin. The token is a symbol that represents the
      # classname of the underlying object.
      #
      # Example:
      #   AddressManager.token # => :address_manager
      #   AddressManager::Portable.token => :portable
      def token
        self.class.token
      end

      # See #token.
      def self.token
        return to_s.demodulize.underscore.to_sym
      end
    end
  end
end

Version data entries

31 entries across 31 versions & 2 rubygems

Version Path
automate-it-0.9.2 lib/automateit/plugin/base.rb
automate-it-0.9.1 lib/automateit/plugin/base.rb
automate-it-0.9.0 lib/automateit/plugin/base.rb
automateit-0.70923 lib/automateit/plugin/base.rb
automateit-0.70930 lib/automateit/plugin/base.rb
automateit-0.70928 lib/automateit/plugin/base.rb
automateit-0.71003 lib/automateit/plugin/base.rb
automateit-0.71030 lib/automateit/plugin/base.rb
automateit-0.71021 lib/automateit/plugin/base.rb
automateit-0.71017 lib/automateit/plugin/base.rb
automateit-0.71031.1 lib/automateit/plugin/base.rb
automateit-0.71006 lib/automateit/plugin/base.rb
automateit-0.71012 lib/automateit/plugin/base.rb
automateit-0.71031.2 lib/automateit/plugin/base.rb
automateit-0.71031 lib/automateit/plugin/base.rb
automateit-0.71101 lib/automateit/plugin/base.rb
automateit-0.71101.1 lib/automateit/plugin/base.rb
automateit-0.71101.2 lib/automateit/plugin/base.rb
automateit-0.71102 lib/automateit/plugin/base.rb
automateit-0.71103 lib/automateit/plugin/base.rb