buildkite-builder 2.0.0.beta3 → 2.0.0.beta4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a4927ec61e94b42ab3c54f0cdafa0c9773b24876e9f5fd067eed495269db3e08
4
- data.tar.gz: c730432ae672df3893b03e1ee0a6097f0f525c2f5236df642159ae93882cdbbc
3
+ metadata.gz: 41faf27b8584ef0a615dfafb727dcac55254a4a2d95107518f550130bc470e0a
4
+ data.tar.gz: 2e778aca984b052a3b4be40c015a969b9fc7d329ad0ca8a28ef9eb605d42457b
5
5
  SHA512:
6
- metadata.gz: 92fe3fea6d81dabd5da1eacb55445e54845ba6d53c6b059f17e665de6e794341367cdedcad6d89d14cd47a229e8503bf59120bbb6e0ccad40c2e49fa49f51589
7
- data.tar.gz: fb4b849e2987e39c6bef52c3896822900151e1c8f12a00b4e825e405348bba62c3dc91275ecc93ae2ac892a96efbcb1d7b12a5962723e8b84664d96249908630
6
+ metadata.gz: 638f4fe0bf8638a2525b6eea0cc778bb078cdc44d81b23b73dd8c29364404cb0a70bc08441b04ab5eb10f670de33cc1d55ff8e2136684679f4499326b9d77c27
7
+ data.tar.gz: 4408c929ec57aaef0159a1966d7d6dd10d33bc05ce43b382f94a29c12a4eb719418360e4a18717c4324377a424e73b9840186a6b1cc894c368d5ba21e389e59f
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.0.beta3
1
+ 2.0.0.beta4
@@ -33,13 +33,17 @@ module Buildkite
33
33
  case source
34
34
  when String then source
35
35
  when Plugin then source.source
36
- else raise ArgumentError, "Unknown source #{source.inpect}"
36
+ else raise ArgumentError, "Unknown source #{source.inspect}"
37
37
  end
38
38
 
39
39
  @collection.select do |plugin|
40
40
  plugin.source == source_string
41
41
  end
42
42
  end
43
+
44
+ def to_definition
45
+ @collection.map(&:to_h)
46
+ end
43
47
  end
44
48
  end
45
49
  end
@@ -48,7 +48,9 @@ module Buildkite
48
48
 
49
49
  def to_h
50
50
  permitted_attributes.each_with_object({}) do |attr, hash|
51
- hash[attr] = get(attr) if has?(attr)
51
+ next unless has?(attr)
52
+
53
+ hash[attr] = get(attr).respond_to?(:to_definition) ? get(attr).to_definition : get(attr)
52
54
  end
53
55
  end
54
56
 
@@ -5,17 +5,12 @@ module Buildkite
5
5
  module Helpers
6
6
  module Plugins
7
7
  def plugin(name_or_source, options = nil)
8
- append(:plugins, plugin_collection.add(name_or_source, options).to_h)
8
+ attributes['plugins'] ||= Buildkite::Builder::PluginCollection.new(step_collection.plugins)
9
+ attributes['plugins'].add(name_or_source, options)
9
10
  end
10
11
 
11
12
  def plugins
12
- plugin_collection
13
- end
14
-
15
- private
16
-
17
- def plugin_collection
18
- @plugin_collection ||= Buildkite::Builder::PluginCollection.new(step_collection.plugins)
13
+ attributes['plugins']
19
14
  end
20
15
  end
21
16
  end
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: 2.0.0.beta3
4
+ version: 2.0.0.beta4
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: 2021-08-24 00:00:00.000000000 Z
12
+ date: 2021-08-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sorted_set