buildkite-builder 2.0.0.beta1 → 2.0.0.beta2

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: 7a9777c2d258caf0ee500fee89d04fe9385a9357f2df66f007b60c88bd361afa
4
- data.tar.gz: f8a8e77e07fe770231f00bc7d3a693524cb5495f45c0529313737152dd44be1f
3
+ metadata.gz: 671edc2f2b7a65af8d8c8d1390485c9591fb4814c1f9d1acb49e82fd3d648c27
4
+ data.tar.gz: 78f6374f0b352172d61185ed5bb9c9054dbf20581001d634d5474ffdaf13afdb
5
5
  SHA512:
6
- metadata.gz: 824bb77591ec310cace0138dd32269cd379ba244ec0283b53cd86d1e6001b24bd0a208c5662bf1b4d171c773e85c0053decfe619431cccbe6c38e24e7badb32d
7
- data.tar.gz: 30502c1de926f6e48423b4d254dc82b86248f2bf5c7e290f50bd972b63ef9d9702bbdd0dd4c81f3cd37aa0da5b3f4076402d72d3f6eb5531b662a96cfdbfa3a4
6
+ metadata.gz: 8be88ac275466dc0dec40db8ce78f752b488b568ed7b32403977e53905fc4fd8518298716cb1864a5bb9ab6a51ea3ed3572051a839f215c76cf7b6e6efdbf218
7
+ data.tar.gz: 013a0a8e0ea3a56671088a1ec32994d456e83f49fd64b1b8d802b4fce53f54048581d10f21db56d213a8f9057797f494627b14e7390df83bc0b19ee6aceefb19
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.0.beta1
1
+ 2.0.0.beta2
@@ -9,7 +9,7 @@ module Buildkite
9
9
  self.description = 'Outputs the pipeline YAML.'
10
10
 
11
11
  def run
12
- puts Pipeline.build(pipeline_path).to_yaml
12
+ puts Pipeline.new(pipeline_path).to_yaml
13
13
  end
14
14
  end
15
15
  end
@@ -6,7 +6,11 @@ module Buildkite
6
6
  attr_reader :context
7
7
 
8
8
  def extend(mod)
9
- mod < Extension ? super(mod.dsl) : super
9
+ if mod < Extension
10
+ super(mod.dsl) if mod.dsl
11
+ else
12
+ super
13
+ end
10
14
  end
11
15
 
12
16
  def initialize(context)
@@ -28,6 +28,10 @@ module Buildkite
28
28
 
29
29
  private
30
30
 
31
+ def log
32
+ context.logger
33
+ end
34
+
31
35
  def buildkite
32
36
  @buildkite ||= begin
33
37
  unless Buildkite.env
@@ -43,8 +47,7 @@ module Buildkite
43
47
  end
44
48
 
45
49
  def pipeline(&block)
46
- context.dsl.instance_eval(&block) if block_given?
47
- context
50
+ context.dsl.instance_eval(&block)
48
51
  end
49
52
  end
50
53
  end
@@ -8,10 +8,10 @@ module Buildkite
8
8
  @context = context
9
9
  @extensions = []
10
10
 
11
- Loaders::Extensions.load(@context.root)
11
+ @loader = Loaders::Extensions.load(@context.root)
12
12
  end
13
13
 
14
- def use(extension, **args)
14
+ def use(extension, native: false, **args)
15
15
  unless extension < Buildkite::Builder::Extension
16
16
  raise "#{extension} must subclass Buildkite::Builder::Extension"
17
17
  end
@@ -25,7 +25,8 @@ module Buildkite
25
25
  @dsl = Dsl.new(self)
26
26
  @dsl.extend(Extensions::Steps)
27
27
  @dsl.extend(Extensions::Notify)
28
- instance_eval(&block)
28
+ instance_eval(&block) if block_given?
29
+ self
29
30
  end
30
31
 
31
32
  def to_h
@@ -33,8 +34,8 @@ module Buildkite
33
34
  { group: label }.merge(attributes).merge(data.to_definition)
34
35
  end
35
36
 
36
- def method_missing(method_name, *_args, &_block)
37
- @dsl.public_send(method_name, *_args, &_block)
37
+ def method_missing(method_name, *args, **kwargs, &_block)
38
+ @dsl.public_send(method_name, *args, **kwargs, &_block)
38
39
  end
39
40
  end
40
41
  end
@@ -23,10 +23,6 @@ module Buildkite
23
23
  :dsl,
24
24
  :data
25
25
 
26
- def self.build(root, logger: nil)
27
- new(root, logger: logger)
28
- end
29
-
30
26
  def initialize(root, logger: nil)
31
27
  @root = root
32
28
  @logger = logger || Logger.new(File::NULL)
@@ -17,12 +17,12 @@ module Buildkite
17
17
  @steps.each do |step|
18
18
  if types.include?(step.class.to_sym)
19
19
  yield step
20
- end
21
-
22
- if step.is_a?(Group)
20
+ elsif step.is_a?(Group)
23
21
  step.data.steps.each(*types) do |step|
24
22
  yield step
25
23
  end
24
+ elsif types.empty?
25
+ yield step
26
26
  end
27
27
  end
28
28
  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.beta1
4
+ version: 2.0.0.beta2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ngan Pham