buildkite-builder 3.7.0 → 3.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/buildkite/builder/extension.rb +3 -1
- data/lib/buildkite/builder/extension_manager.rb +14 -6
- data/lib/buildkite/builder/extensions/use.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07cfaad01e1707290fd929b02cdad2b8b0510cfbebbb1ebbed60e6fd81c17fae
|
4
|
+
data.tar.gz: a521689c32580d0240f9cc545b8bcce09749ea09eb9922d716bd7d26c7fa0294
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33e4b16b7ec06ee1be8573a6b0ab71503a3311b29bb75e4e0ab7b37a97858a0932654dfae5cf05aa2612db20dc3bebe9d9f9ad444889625ef6bfd1da1107ec27
|
7
|
+
data.tar.gz: feeff303efbe6e5aa742da8bd2b540a7518a823ce4d3d9f030a82ffcf6cb77704d74a556c77d0deedc1647230ac5186abad7ba2daa505b6a5dbba788b4e54ef1
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.
|
1
|
+
3.8.0
|
@@ -14,10 +14,12 @@ module Buildkite
|
|
14
14
|
|
15
15
|
attr_reader :context
|
16
16
|
attr_reader :options
|
17
|
+
attr_reader :option_block
|
17
18
|
|
18
|
-
def initialize(context, **options)
|
19
|
+
def initialize(context, **options, &block)
|
19
20
|
@context = context
|
20
21
|
@options = options
|
22
|
+
@option_block = block
|
21
23
|
|
22
24
|
prepare
|
23
25
|
end
|
@@ -6,26 +6,34 @@ module Buildkite
|
|
6
6
|
|
7
7
|
def initialize(context)
|
8
8
|
@context = context
|
9
|
-
@extensions =
|
9
|
+
@extensions = {}
|
10
10
|
|
11
11
|
@loader = Loaders::Extensions.load(@context.root)
|
12
12
|
end
|
13
13
|
|
14
|
-
def use(extension, native: false, **args)
|
14
|
+
def use(extension, native: false, **args, &block)
|
15
15
|
unless extension < Buildkite::Builder::Extension
|
16
|
-
raise "#{extension} must subclass Buildkite::Builder::Extension"
|
16
|
+
raise "#{extension.name} must subclass Buildkite::Builder::Extension"
|
17
17
|
end
|
18
18
|
|
19
|
-
@extensions
|
19
|
+
if @extensions[extension]
|
20
|
+
raise "#{extension.name} already registered"
|
21
|
+
end
|
22
|
+
|
23
|
+
@extensions[extension] = extension.new(@context, **args, &block)
|
20
24
|
@context.dsl.extend(extension)
|
21
25
|
end
|
22
26
|
|
23
27
|
def build
|
24
|
-
@extensions.each do |extension|
|
25
|
-
log_build(
|
28
|
+
@extensions.each do |extension_class, extension|
|
29
|
+
log_build(extension_class.name) { extension.build }
|
26
30
|
end
|
27
31
|
end
|
28
32
|
|
33
|
+
def find(klass)
|
34
|
+
@extensions.fetch(klass)
|
35
|
+
end
|
36
|
+
|
29
37
|
private
|
30
38
|
|
31
39
|
def log
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: buildkite-builder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ngan Pham
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2022-11-
|
12
|
+
date: 2022-11-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rainbow
|