Sha256: 0979350212513b37abd5fc58c4bca50165de48a70be9f21fdca703a000beb192

Contents?: true

Size: 538 Bytes

Versions: 7

Compression:

Stored size: 538 Bytes

Contents

module Buildkite
  module Builder
    class PluginManager
      def initialize
        @plugins = {}
      end

      def add(name, uri, default_attributes = {})
        name = name.to_s

        if @plugins.key?(name)
          raise ArgumentError, "Plugin already defined: #{name}"
        end

        @plugins[name] = {
          uri: uri,
          default_attributes: default_attributes
        }
      end

      def fetch(name)
        @plugins[name]
      end

      def to_definition
        # No-op
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
buildkite-builder-3.8.3 lib/buildkite/builder/plugin_manager.rb
buildkite-builder-3.8.2 lib/buildkite/builder/plugin_manager.rb
buildkite-builder-3.8.1 lib/buildkite/builder/plugin_manager.rb
buildkite-builder-3.8.0 lib/buildkite/builder/plugin_manager.rb
buildkite-builder-3.7.0 lib/buildkite/builder/plugin_manager.rb
buildkite-builder-3.6.0 lib/buildkite/builder/plugin_manager.rb
buildkite-builder-3.5.0 lib/buildkite/builder/plugin_manager.rb