vx-builder 0.0.20 → 0.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/vx/builder/script/clojure.rb +38 -0
- data/lib/vx/builder/script/scala.rb +1 -1
- data/lib/vx/builder/script.rb +2 -0
- data/lib/vx/builder/version.rb +1 -1
- data/spec/fixtures/clojure.yml +2 -0
- data/spec/lib/builder/script/clojure_spec.rb +34 -0
- metadata +6 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b11b13785a0650235f9d82f1855e4f782c99e795
|
4
|
+
data.tar.gz: fc0be305edc7fa20f19a618585dfd53dbdc6d5ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c03fbfebeed882ac2e8ff9772bde4525b4ebd8ef3fb46e94d216a2f9cd1823b69630417de22ce9c1483c3f8417bfc67b1811a9c909df605f78b91e4b36d905fb
|
7
|
+
data.tar.gz: 8b51cc49712643c0162cc1d2a5c4ffb7dcffa5c49a5fe8a5b684c8698683ea296111a651e0b3eb84f114ccce5e576fb4c907381ead2f14f6daf78e326e2df179
|
@@ -0,0 +1,38 @@
|
|
1
|
+
module Vx
|
2
|
+
module Builder
|
3
|
+
class Script
|
4
|
+
|
5
|
+
Clojure = Struct.new(:app) do
|
6
|
+
|
7
|
+
include Helper::TraceShCommand
|
8
|
+
|
9
|
+
def call(env)
|
10
|
+
if enabled?(env)
|
11
|
+
env.announce.tap do |i|
|
12
|
+
i << trace_sh_command("lein version")
|
13
|
+
end
|
14
|
+
|
15
|
+
env.install.tap do |i|
|
16
|
+
i << "lein deps"
|
17
|
+
end
|
18
|
+
|
19
|
+
if env.source.script.empty?
|
20
|
+
env.script.tap do |i|
|
21
|
+
i << "lein test"
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
app.call(env)
|
27
|
+
end
|
28
|
+
|
29
|
+
private
|
30
|
+
|
31
|
+
def enabled?(env)
|
32
|
+
env.source.language == 'clojure'
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
data/lib/vx/builder/script.rb
CHANGED
@@ -8,6 +8,7 @@ module Vx
|
|
8
8
|
autoload :Ruby, File.expand_path("../script/ruby", __FILE__)
|
9
9
|
autoload :Java, File.expand_path("../script/java", __FILE__)
|
10
10
|
autoload :Scala, File.expand_path("../script/scala", __FILE__)
|
11
|
+
autoload :Clojure, File.expand_path("../script/clojure", __FILE__)
|
11
12
|
autoload :Script, File.expand_path("../script/script", __FILE__)
|
12
13
|
autoload :Prepare, File.expand_path("../script/prepare", __FILE__)
|
13
14
|
autoload :Databases, File.expand_path("../script/databases", __FILE__)
|
@@ -23,6 +24,7 @@ module Vx
|
|
23
24
|
use Builder::Script::Prepare
|
24
25
|
use Builder::Script::Java
|
25
26
|
use Builder::Script::Scala
|
27
|
+
use Builder::Script::Clojure
|
26
28
|
use Builder::Script::Ruby
|
27
29
|
use Builder::Script::Script
|
28
30
|
end
|
data/lib/vx/builder/version.rb
CHANGED
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Vx::Builder::Script::Clojure do
|
4
|
+
let(:app) { ->(env) { env } }
|
5
|
+
let(:script) { described_class.new app }
|
6
|
+
let(:source) { create :source, name: "clojure.yml" }
|
7
|
+
let(:env) { create :env, source: source }
|
8
|
+
let(:run) { script.call env }
|
9
|
+
subject { run }
|
10
|
+
|
11
|
+
it { should eq env }
|
12
|
+
|
13
|
+
context "run it" do
|
14
|
+
subject { env }
|
15
|
+
|
16
|
+
context "should be success" do
|
17
|
+
before { run }
|
18
|
+
its(:announce) { should_not be_empty }
|
19
|
+
its(:install) { should_not be_empty }
|
20
|
+
its(:script) { should be_empty }
|
21
|
+
end
|
22
|
+
|
23
|
+
context "when script is empty" do
|
24
|
+
before do
|
25
|
+
env.source.script.clear
|
26
|
+
run
|
27
|
+
end
|
28
|
+
its(:script) { should_not be_empty }
|
29
|
+
end
|
30
|
+
|
31
|
+
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
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.
|
4
|
+
version: 0.0.21
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dmitry Galinsky
|
@@ -128,6 +128,7 @@ files:
|
|
128
128
|
- lib/vx/builder/helper/trace_sh_command.rb
|
129
129
|
- lib/vx/builder/script.rb
|
130
130
|
- lib/vx/builder/script/cache.rb
|
131
|
+
- lib/vx/builder/script/clojure.rb
|
131
132
|
- lib/vx/builder/script/env.rb
|
132
133
|
- lib/vx/builder/script/java.rb
|
133
134
|
- lib/vx/builder/script/prepare.rb
|
@@ -141,12 +142,14 @@ files:
|
|
141
142
|
- lib/vx/builder/source/serializable.rb
|
142
143
|
- lib/vx/builder/task.rb
|
143
144
|
- lib/vx/builder/version.rb
|
145
|
+
- spec/fixtures/clojure.yml
|
144
146
|
- spec/fixtures/scala.yml
|
145
147
|
- spec/fixtures/travis.yml
|
146
148
|
- spec/fixtures/travis_bug_1.yml
|
147
149
|
- spec/fixtures/travis_bug_2.yml
|
148
150
|
- spec/lib/builder/configuration_spec.rb
|
149
151
|
- spec/lib/builder/script/cache_spec.rb
|
152
|
+
- spec/lib/builder/script/clojure_spec.rb
|
150
153
|
- spec/lib/builder/script/env_spec.rb
|
151
154
|
- spec/lib/builder/script/java_spec.rb
|
152
155
|
- spec/lib/builder/script/prepare_spec.rb
|
@@ -186,12 +189,14 @@ signing_key:
|
|
186
189
|
specification_version: 4
|
187
190
|
summary: Write a gem summary
|
188
191
|
test_files:
|
192
|
+
- spec/fixtures/clojure.yml
|
189
193
|
- spec/fixtures/scala.yml
|
190
194
|
- spec/fixtures/travis.yml
|
191
195
|
- spec/fixtures/travis_bug_1.yml
|
192
196
|
- spec/fixtures/travis_bug_2.yml
|
193
197
|
- spec/lib/builder/configuration_spec.rb
|
194
198
|
- spec/lib/builder/script/cache_spec.rb
|
199
|
+
- spec/lib/builder/script/clojure_spec.rb
|
195
200
|
- spec/lib/builder/script/env_spec.rb
|
196
201
|
- spec/lib/builder/script/java_spec.rb
|
197
202
|
- spec/lib/builder/script/prepare_spec.rb
|