Class: Buildkite::Builder::Extensions::Plugins

Inherits:
Buildkite::Builder::Extension show all
Defined in:
lib/buildkite/builder/extensions/plugins.rb

Instance Attribute Summary collapse

Attributes inherited from Buildkite::Builder::Extension

#context, #options, #options_block

Instance Method Summary collapse

Methods inherited from Buildkite::Builder::Extension

dsl, #initialize

Constructor Details

This class inherits a constructor from Buildkite::Builder::Extension

Instance Attribute Details

#managerObject (readonly)

Returns the value of attribute manager.



5
6
7
# File 'lib/buildkite/builder/extensions/plugins.rb', line 5

def manager
  @manager
end

Instance Method Details

#buildObject



17
18
19
20
21
22
23
24
25
26
# File 'lib/buildkite/builder/extensions/plugins.rb', line 17

def build
  context.data.steps.each(:command) do |step|
    next unless step.has?(:plugins)

    step.get(:plugins).map! do |plugin|
      resource, attributes = extract_resource_and_attributes(plugin)
      resource.is_a?(Symbol) ? manager.build(resource, attributes) : plugin
    end
  end
end

#prepareObject



13
14
15
# File 'lib/buildkite/builder/extensions/plugins.rb', line 13

def prepare
  @manager = PluginManager.new
end