singularity_dsl 1.6.1 → 1.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/.gitignore +1 -0
- data/.rubocop.yml +2 -1
- data/.singularityrc +5 -4
- data/Gemfile.lock +9 -9
- data/README.md +1 -1
- data/lib/singularity_dsl/dsl/changeset.rb +6 -2
- data/lib/singularity_dsl/version.rb +1 -1
- data/spec/singularity_dsl/dsl/changeset_spec.rb +35 -11
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OTEyYmQzY2NkMDJmOTc3Yjk3NDVkMGVlNGYzNDAxM2E1ODVlZTU4NA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NTFhNzNkMjVjYThkMDJjNmQwYjAwYTMwMjNjOTE4ZjBhMTYxOWRlMQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MGE1MGVlZDg0MGY4NDY2ZGU2OTgxNzM4MjQzNTg5OWFhNTBmMzhlMzE1MjNi
|
10
|
+
MTVmOGQ1M2NhOWFhNzVjYzViMjIxZTkyZjY5ZDM5M2RhYWNlMzBhYTlhZWJm
|
11
|
+
NTNhNmUxZGZjOWIyODg3NTQxZjE0OTc0NGIwMDY0ZDg2M2U4MTU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
Njc2OWNmNzFjMmFiMDczZTQ1ZmY1ZjFjMTQ0YmEzODRiZmViNThjM2ZiNDEw
|
14
|
+
ODA2YTU2ZDRmNDJjZjNiMGVkN2VlNzFiNWU4ZWY4YmEyMjk5OGRmMmQ5NjAy
|
15
|
+
ZTg2Y2ZlYmMzYzc1NDk2ZGZiZTk5MDVmZDg1ZWJlOWI2ZDgwNmM=
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
data/.singularityrc
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
|
-
batch :build do
|
4
|
-
shelltask { command 'bundle' }
|
5
|
-
end
|
6
|
-
|
7
3
|
batch :test do
|
8
4
|
rubocop
|
9
5
|
bootcoveralls if flag? 'coveralls'
|
10
6
|
rspec
|
11
7
|
end
|
12
8
|
|
9
|
+
batch :ci do
|
10
|
+
shelltask { command 'bundle install --path ./vendor' }
|
11
|
+
shelltask { command 'bundle exec singularity_runner batch test --flags coveralls' }
|
12
|
+
end
|
13
|
+
|
13
14
|
invoke_batch :test
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
singularity_dsl (1.6.
|
4
|
+
singularity_dsl (1.6.3)
|
5
5
|
coveralls (~> 0.7.9)
|
6
6
|
json (~> 1.0)
|
7
7
|
mixlib-shellout (~> 2.0)
|
@@ -18,9 +18,9 @@ GEM
|
|
18
18
|
ast (2.0.0)
|
19
19
|
astrolabe (1.3.0)
|
20
20
|
parser (>= 2.2.0.pre.3, < 3.0)
|
21
|
-
coveralls (0.7.
|
21
|
+
coveralls (0.7.10)
|
22
22
|
multi_json (~> 1.10)
|
23
|
-
rest-client (
|
23
|
+
rest-client (>= 1.6.8, < 2)
|
24
24
|
simplecov (~> 0.9.1)
|
25
25
|
term-ansicolor (~> 1.3)
|
26
26
|
thor (~> 0.19.1)
|
@@ -32,12 +32,12 @@ GEM
|
|
32
32
|
mixlib-shellout (2.0.1)
|
33
33
|
multi_json (1.10.1)
|
34
34
|
netrc (0.10.2)
|
35
|
-
parser (2.2.0.
|
35
|
+
parser (2.2.0.3)
|
36
36
|
ast (>= 1.1, < 3.0)
|
37
37
|
powerpack (0.1.0)
|
38
38
|
rainbow (2.0.0)
|
39
39
|
rake (10.4.2)
|
40
|
-
rest-client (1.7.
|
40
|
+
rest-client (1.7.3)
|
41
41
|
mime-types (>= 1.16, < 3.0)
|
42
42
|
netrc (~> 0.7)
|
43
43
|
rspec (3.2.0)
|
@@ -53,18 +53,18 @@ GEM
|
|
53
53
|
diff-lcs (>= 1.2.0, < 2.0)
|
54
54
|
rspec-support (~> 3.2.0)
|
55
55
|
rspec-support (3.2.1)
|
56
|
-
rubocop (0.29.
|
56
|
+
rubocop (0.29.1)
|
57
57
|
astrolabe (~> 1.3)
|
58
58
|
parser (>= 2.2.0.1, < 3.0)
|
59
59
|
powerpack (~> 0.1)
|
60
60
|
rainbow (>= 1.99.1, < 3.0)
|
61
61
|
ruby-progressbar (~> 1.4)
|
62
62
|
ruby-progressbar (1.7.1)
|
63
|
-
simplecov (0.9.
|
63
|
+
simplecov (0.9.2)
|
64
64
|
docile (~> 1.1.0)
|
65
65
|
multi_json (~> 1.0)
|
66
|
-
simplecov-html (~> 0.
|
67
|
-
simplecov-html (0.
|
66
|
+
simplecov-html (~> 0.9.0)
|
67
|
+
simplecov-html (0.9.0)
|
68
68
|
term-ansicolor (1.3.0)
|
69
69
|
tins (~> 1.0)
|
70
70
|
terminal-table (1.4.5)
|
data/README.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/singularity_dsl.svg)](http://badge.fury.io/rb/singularity_dsl)
|
4
4
|
[![Dependency Status](https://gemnasium.com/behance/singularity_dsl.svg)](https://gemnasium.com/behance/singularity_dsl)
|
5
5
|
[![Code Climate](https://codeclimate.com/github/behance/singularity_dsl/badges/gpa.svg)](https://codeclimate.com/github/behance/singularity_dsl)
|
6
|
-
[![Coverage Status](https://coveralls.io/repos/behance/singularity_dsl/badge.svg?branch=
|
6
|
+
[![Coverage Status](https://coveralls.io/repos/behance/singularity_dsl/badge.svg?branch=master)](https://coveralls.io/r/behance/singularity_dsl?branch=master)
|
7
7
|
|
8
8
|
A DSL lib for your [SingularityCI](https://github.com/behance/singularity) instance.
|
9
9
|
Inspired by TravisCI's `.travis.yml`
|
@@ -14,7 +14,9 @@ module SingularityDsl
|
|
14
14
|
types = [*types]
|
15
15
|
@changeset ||= []
|
16
16
|
types.any? do |type|
|
17
|
-
@changeset.any?
|
17
|
+
@changeset.any? do |file|
|
18
|
+
file.match("\.#{type}$") || type == file
|
19
|
+
end
|
18
20
|
end
|
19
21
|
end
|
20
22
|
|
@@ -22,7 +24,9 @@ module SingularityDsl
|
|
22
24
|
types = [*types]
|
23
25
|
@changeset ||= []
|
24
26
|
types.flat_map do |type|
|
25
|
-
existing_files.select
|
27
|
+
existing_files.select do |file|
|
28
|
+
file.match("\.#{type}$") || type == file
|
29
|
+
end
|
26
30
|
end.sort
|
27
31
|
end
|
28
32
|
|
@@ -10,17 +10,32 @@ end
|
|
10
10
|
describe 'DslChangeset' do
|
11
11
|
let(:instance) { ChangesetTest.new }
|
12
12
|
before :each do
|
13
|
-
instance.changeset = %w(something.php
|
13
|
+
instance.changeset = %w(something.php
|
14
|
+
something.js
|
15
|
+
something.css
|
16
|
+
a/file/path)
|
14
17
|
end
|
15
18
|
|
16
19
|
context '#files_changed?' do
|
17
|
-
it '
|
20
|
+
it 'correctly evals for single file type' do
|
18
21
|
expect(instance.files_changed? 'php').to eql true
|
19
22
|
end
|
20
23
|
|
21
|
-
it '
|
24
|
+
it 'returns false when file type not in changeset' do
|
25
|
+
expect(instance.files_changed? %w(golang py)).to eql false
|
26
|
+
end
|
27
|
+
|
28
|
+
it 'correctly evals for multiple file types' do
|
22
29
|
expect(instance.files_changed? %w(js css)).to eql true
|
23
30
|
end
|
31
|
+
|
32
|
+
it 'correctly detects literal file paths' do
|
33
|
+
expect(instance.files_changed? %w(a/file/path)).to eql true
|
34
|
+
end
|
35
|
+
|
36
|
+
it 'returns false for non-existing literal file paths' do
|
37
|
+
expect(instance.files_changed? %w(another/file/path)).to eql false
|
38
|
+
end
|
24
39
|
end
|
25
40
|
|
26
41
|
context '#changed_files' do
|
@@ -31,24 +46,33 @@ describe 'DslChangeset' do
|
|
31
46
|
allow(::File).to receive(:exist?)
|
32
47
|
.with('something.js')
|
33
48
|
.and_return(true)
|
49
|
+
allow(::File).to receive(:exist?)
|
50
|
+
.with('a/file/path')
|
51
|
+
.and_return(true)
|
34
52
|
allow(::File).to receive(:exist?)
|
35
53
|
.with('something.php')
|
36
54
|
.and_return(false)
|
37
55
|
end
|
38
56
|
|
39
|
-
it '
|
57
|
+
it 'correctly evals for single file type' do
|
40
58
|
expect(instance.changed_files 'css').to eql %w(something.css)
|
41
59
|
end
|
42
60
|
|
43
|
-
it '
|
44
|
-
expect(instance.changed_files %w(
|
45
|
-
|
61
|
+
it 'returns [] when file type not in changeset' do
|
62
|
+
expect(instance.changed_files %w(golang py)).to eql []
|
63
|
+
end
|
64
|
+
|
65
|
+
it 'filters for existing files & sorts' do
|
66
|
+
expect(instance.changed_files %w(php js css a/file/path))
|
67
|
+
.to eql %w(a/file/path something.css something.js)
|
68
|
+
end
|
69
|
+
|
70
|
+
it 'correctly detects literal file paths' do
|
71
|
+
expect(instance.changed_files %w(a/file/path)).to eql %w(a/file/path)
|
46
72
|
end
|
47
73
|
|
48
|
-
it '
|
49
|
-
expect(instance.changed_files %w(
|
50
|
-
.to eql %w(something.css something.js)
|
51
|
-
expect(instance.changed_files 'php').to eql []
|
74
|
+
it 'returns false for non-existing literal file paths' do
|
75
|
+
expect(instance.changed_files %w(another/file/path)).to eql []
|
52
76
|
end
|
53
77
|
end
|
54
78
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: singularity_dsl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- chr0n1x
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|