Sha256: 4138d684600ae68601bc3af4a990cf21d9c45ce7f8464f3bd129504581973ef8

Contents?: true

Size: 611 Bytes

Versions: 2

Compression:

Stored size: 611 Bytes

Contents

# frozen_string_literal: true

module Buildkite
  module Pipelines
    module Helpers
      module Plugins
        def plugin(plugin_name, options = nil)
          plugin_name = plugin_name.to_s
          @plugins ||= {}

          if @plugins.key?(plugin_name)
            raise ArgumentError, "Plugin already used for command step: #{plugin_name}"
          end

          uri, version = step_collection.plugins.fetch(plugin_name)
          new_plugin = Plugin.new(uri, version, options)
          @plugins[plugin_name] = new_plugin

          plugins(new_plugin.to_h)
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
buildkite-builder-2.0.0.beta2 lib/buildkite/pipelines/helpers/plugins.rb
buildkite-builder-2.0.0.beta1 lib/buildkite/pipelines/helpers/plugins.rb