vx-builder 0.0.2 → 0.0.3

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
  SHA1:
3
- metadata.gz: 4463ec3cf51845d96e765e1d95ce53f3b441dde7
4
- data.tar.gz: 48345183e7243df3c183d729ebc353c4efa92eeb
3
+ metadata.gz: 73e96e0bf3f8cc5311180c68c24f8ce2b91b2cb5
4
+ data.tar.gz: de07a671e32eaecfca0ffc59bebcf0334ae673ad
5
5
  SHA512:
6
- metadata.gz: f0d39166126c30871d0dddb025a697b5d1f50826392d1fb898a215ca14bbcbafa1a7707622577e29b73c6474e3f7c56594b1ba23ef2c0f41f1564a8330e1c70f
7
- data.tar.gz: 237711b5424643c4fa88a1a967727e6e3fdf3a6d4ccaa5d2d2fcdfe6e0ff052b8212477048134309cd8a50aab15f770d6c8f5a88729c015636434a78f8125cf4
6
+ metadata.gz: 4391e8339e7f1250acddf347442cfcbfe64bc6f04523f4edfe8805120cfec41a69ad127e59ec1c49e493bb52e0a5e461da2aec82c6eccd00452af0b63e2e784b
7
+ data.tar.gz: a8b3b91466510b7bfc586a3993e1a40478a8338c4c3f45b4e7c6ad77ed1ce99720d606eba264b1a73986f8fe24398a68f77926cb4fdfd66f1560417400d6946f
@@ -7,6 +7,9 @@ module Vx
7
7
  include Helper::TraceShCommand
8
8
 
9
9
  def call(env)
10
+ env.source.before_install.each do |c|
11
+ env.before_install << trace_sh_command(c)
12
+ end
10
13
  env.source.before_script.each do |c|
11
14
  env.before_script << trace_sh_command(c)
12
15
  end
@@ -3,7 +3,7 @@ module Vx
3
3
  class Source
4
4
 
5
5
  LANGS = %w{ rvm scala java go }.freeze
6
- KEYS = %w{ services before_script script }.freeze
6
+ KEYS = %w{ services before_script script before_install }.freeze
7
7
  AS_ARRAY = (KEYS + LANGS).freeze
8
8
 
9
9
  end
@@ -4,7 +4,7 @@ module Vx
4
4
  class Matrix
5
5
 
6
6
  KEYS = (Source::LANGS + %w{ matrix_env:env }).freeze
7
- NOT_MATRIX_KEYS = %w{ script before_script services }
7
+ NOT_MATRIX_KEYS = %w{ script before_script services before_install }
8
8
 
9
9
  attr_reader :source
10
10
 
@@ -1,5 +1,5 @@
1
1
  module Vx
2
2
  module Builder
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
@@ -2,4 +2,6 @@ rvm:
2
2
  - 2.0.0
3
3
  before_script:
4
4
  - "echo before_script"
5
+ before_install:
6
+ - "echo before_install"
5
7
  script: "RAILS_ENV=test ls -1 && echo DONE!"
@@ -7,6 +7,7 @@ describe Vx::Builder::Source::Matrix do
7
7
  rvm: %w{ 1.8.7 1.9.3 2.0.0 },
8
8
  scala: %w{ 2.9.2 2.10.1 },
9
9
  before_script: "echo before_script",
10
+ before_install: "echo before_install",
10
11
  script: "echo script"
11
12
  } }
12
13
  let(:config) { Vx::Builder::Source.from_attributes attributes }
@@ -32,11 +33,15 @@ describe Vx::Builder::Source::Matrix do
32
33
  subject { matrix.configurations }
33
34
 
34
35
  it "should copy script from source" do
35
- expect(subject.map(&:script).uniq).to eq [["echo script"]]
36
+ expect(subject.map(&:script).flatten).to eq ["echo script"] * 12
36
37
  end
37
38
 
38
39
  it "should copy before_script from source" do
39
- expect(subject.map(&:before_script).uniq).to eq [["echo before_script"]]
40
+ expect(subject.map(&:before_script).flatten).to eq ["echo before_script"] * 12
41
+ end
42
+
43
+ it "should copy before_install from source" do
44
+ expect(subject.map(&:before_install).flatten).to eq ["echo before_install"] * 12
40
45
  end
41
46
 
42
47
  context "without any matrix keys" do
@@ -50,9 +55,10 @@ describe Vx::Builder::Source::Matrix do
50
55
  "matrix" => [],
51
56
  "global" => []
52
57
  },
53
- "script" =>["/bin/true"],
54
- "before_script" =>[],
55
- "services" => []
58
+ "script" =>["/bin/true"],
59
+ "before_script" =>[],
60
+ "services" => [],
61
+ "before_install" => []
56
62
  )}
57
63
  end
58
64
 
@@ -27,9 +27,10 @@ describe Vx::Builder::Source do
27
27
 
28
28
  context "build new instance" do
29
29
  let(:expected) { {
30
- "rvm" => ["2.0.0"],
31
- "before_script" => ["echo before_script"],
32
- "script" => ["RAILS_ENV=test ls -1 && echo DONE!"],
30
+ "rvm" => ["2.0.0"],
31
+ "before_script" => ["echo before_script"],
32
+ "before_install" => ["echo before_install"],
33
+ "script" => ["RAILS_ENV=test ls -1 && echo DONE!"],
33
34
  "env" => {
34
35
  "matrix" => [],
35
36
  "global" => []
@@ -50,6 +51,7 @@ describe Vx::Builder::Source do
50
51
  let(:attrs) {{
51
52
  rvm: "2.0.0",
52
53
  before_script: "echo before_script",
54
+ before_install: "echo before_install",
53
55
  script: "RAILS_ENV=test ls -1 && echo DONE!"
54
56
  }}
55
57
  subject { described_class.from_attributes(attrs).attributes }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vx-builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Galinsky