vx-builder 0.0.16 → 0.0.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vx/builder/script/cache.rb +1 -1
- data/lib/vx/builder/script/prepare.rb +1 -0
- data/lib/vx/builder/script/ruby.rb +12 -5
- data/lib/vx/builder/source.rb +4 -0
- data/lib/vx/builder/version.rb +1 -1
- data/spec/fixtures/travis.yml +2 -0
- data/spec/lib/builder/source_spec.rb +3 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 595e992a1dd450009a45d6b454d8c373ca9f0343
|
4
|
+
data.tar.gz: 5e57530da8bbce538e77996df2d88d4916077cc8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9fc0af12b7aacfc32d4c4f14d32277742445afa624008ae4b93c0de815ca375f78d60ca81c785c21ae0dc4c4d3846f02b6d6f4e57baacadaf776f96e0b4e7192
|
7
|
+
data.tar.gz: 356cce5b8ea9fbbbcc07c107b8edabe98cdaa6f8a2406184ca68409c56f97aa7d3e55ce81f68f47c519b942b5f04ad33f698fb995142c161373c9d55b525b959
|
@@ -6,9 +6,12 @@ module Vx
|
|
6
6
|
|
7
7
|
include Helper::TraceShCommand
|
8
8
|
|
9
|
+
DEFAULT_RUBY = '1.9.3'
|
10
|
+
|
9
11
|
def call(env)
|
10
|
-
if
|
11
|
-
env.cache_key << "rvm-#{
|
12
|
+
if enabled?(env)
|
13
|
+
env.cache_key << "rvm-#{ruby env}"
|
14
|
+
env.cache_key << gemfile(env)
|
12
15
|
|
13
16
|
env.before_install.tap do |i|
|
14
17
|
i << "source /etc/profile.d/rbenv.sh"
|
@@ -39,8 +42,12 @@ module Vx
|
|
39
42
|
|
40
43
|
private
|
41
44
|
|
42
|
-
def
|
43
|
-
env.source.rvm.first
|
45
|
+
def enabled?(env)
|
46
|
+
env.source.rvm.first || env.source.language == 'ruby'
|
47
|
+
end
|
48
|
+
|
49
|
+
def ruby(env)
|
50
|
+
env.source.rvm.first || DEFAULT_RUBY
|
44
51
|
end
|
45
52
|
|
46
53
|
def gemfile(env)
|
@@ -57,7 +64,7 @@ module Vx
|
|
57
64
|
sed -e 's/^\*/ /' |
|
58
65
|
awk '{print $1}' |
|
59
66
|
grep -v 'system' |
|
60
|
-
grep '#{
|
67
|
+
grep '#{ruby env}' |
|
61
68
|
tail -n1)
|
62
69
|
}.gsub(/\n/, ' ').gsub(/ +/, ' ').strip
|
63
70
|
end
|
data/lib/vx/builder/source.rb
CHANGED
data/lib/vx/builder/version.rb
CHANGED
data/spec/fixtures/travis.yml
CHANGED
@@ -11,6 +11,7 @@ describe Vx::Builder::Source do
|
|
11
11
|
its(:gemfile) { should eq %w{ Gemfile } }
|
12
12
|
its(:before_script) { should eq ["echo before_script"] }
|
13
13
|
its(:script) { should eq ["RAILS_ENV=test ls -1 && echo DONE!"] }
|
14
|
+
its(:language) { should eq 'ruby' }
|
14
15
|
|
15
16
|
context "merge" do
|
16
17
|
let(:new_attrs) { { rvm: "replaced" } }
|
@@ -58,6 +59,7 @@ describe Vx::Builder::Source do
|
|
58
59
|
"cache" => {
|
59
60
|
"directories"=>["~/.cache"]
|
60
61
|
},
|
62
|
+
"language" => "ruby",
|
61
63
|
"before_install" => ["echo before_install"],
|
62
64
|
"script" => ["RAILS_ENV=test ls -1 && echo DONE!"],
|
63
65
|
"env" => {
|
@@ -83,6 +85,7 @@ describe Vx::Builder::Source do
|
|
83
85
|
gemfile: "Gemfile",
|
84
86
|
before_script: "echo before_script",
|
85
87
|
after_success: "echo after success",
|
88
|
+
language: "ruby",
|
86
89
|
before_install: "echo before_install",
|
87
90
|
script: "RAILS_ENV=test ls -1 && echo DONE!",
|
88
91
|
cache: {
|