vx-builder 0.0.20 → 0.0.21

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: 2bce64f5a07f07f85e69c4e2a06bd6272655a194
4
- data.tar.gz: af49c36800d203b3b15c9762087b9fe6d422ec19
3
+ metadata.gz: b11b13785a0650235f9d82f1855e4f782c99e795
4
+ data.tar.gz: fc0be305edc7fa20f19a618585dfd53dbdc6d5ed
5
5
  SHA512:
6
- metadata.gz: 757258ee2404c837ffa54d054897369ddffb996a09383c1840181c8d94c1b6b08892852dab6d5e0c0e4f0625025053b624d67264f5ef35efab84b142a0cb6bff
7
- data.tar.gz: ea554caf02ca0b128b3fba0215f5e45fa6453ecfada438384aeb1f5fb8230e33f8e78d013452523c498d3d18c46df3e91fbd278d5d8906074bf9afd69024e901
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
@@ -34,7 +34,7 @@ module Vx
34
34
  private
35
35
 
36
36
  def enabled?(env)
37
- env.source.scala.first || env.language == 'scala'
37
+ env.source.scala.first || env.source.language == 'scala'
38
38
  end
39
39
 
40
40
  def scala(env)
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Vx
2
2
  module Builder
3
- VERSION = "0.0.20"
3
+ VERSION = "0.0.21"
4
4
  end
5
5
  end
@@ -0,0 +1,2 @@
1
+ language: clojure
2
+ script: "lein midje"
@@ -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.20
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