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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZmQwNTFiMTY3ODJhN2IzMDRjZTg5YzY5Y2M3MDc0NTBkODA2YzlmMA==
4
+ OTEyYmQzY2NkMDJmOTc3Yjk3NDVkMGVlNGYzNDAxM2E1ODVlZTU4NA==
5
5
  data.tar.gz: !binary |-
6
- NTFiOTkyNjVkYWMxNTFkZGI5MWVlODAxNGVlYTBkNGI5N2U3ZWI2YQ==
6
+ NTFhNzNkMjVjYThkMDJjNmQwYjAwYTMwMjNjOTE4ZjBhMTYxOWRlMQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NzBiMDQ2ZmM2MTA2M2RhY2FmNzM3MDEyYmY3MDMzMTIxMTc2ZmZiNzEyZjc5
10
- MmFjZmJmODZkZjhkNjYzZjIwNjk4YzNhZWRmZGQwN2YyMWVmYWU2MTE3NWQ2
11
- MWY0YzFjYWQ4N2FiZTNiYmZmMTU1Nzc0M2EyZTNkZDhjN2RlYmM=
9
+ MGE1MGVlZDg0MGY4NDY2ZGU2OTgxNzM4MjQzNTg5OWFhNTBmMzhlMzE1MjNi
10
+ MTVmOGQ1M2NhOWFhNzVjYzViMjIxZTkyZjY5ZDM5M2RhYWNlMzBhYTlhZWJm
11
+ NTNhNmUxZGZjOWIyODg3NTQxZjE0OTc0NGIwMDY0ZDg2M2U4MTU=
12
12
  data.tar.gz: !binary |-
13
- ZjE5ZDE2YzAwMzExZGY3YTI0ZmM2NzVmMzBmOGI2NzdhNTM2YjY4MzJiMzQy
14
- YWRhZDk2OWNlMWY2NmE2YzQyMzMyZWFjZmNiZjU3ZGI5YzU3ZTg4YTAzOGQ2
15
- MmRkYWMyMDIzODFkMTliMmUwN2VmNjk0ZmViMTkxYmNhNTMzYzQ=
13
+ Njc2OWNmNzFjMmFiMDczZTQ1ZmY1ZjFjMTQ0YmEzODRiZmViNThjM2ZiNDEw
14
+ ODA2YTU2ZDRmNDJjZjNiMGVkN2VlNzFiNWU4ZWY4YmEyMjk5OGRmMmQ5NjAy
15
+ ZTg2Y2ZlYmMzYzc1NDk2ZGZiZTk5MDVmZDg1ZWJlOWI2ZDgwNmM=
data/.gitignore CHANGED
@@ -15,3 +15,4 @@ test/tmp
15
15
  test/version_tmp
16
16
  tmp
17
17
  .vendor/
18
+ vendor/
data/.rubocop.yml CHANGED
@@ -3,7 +3,8 @@ AllCops:
3
3
  - Rakefile
4
4
  - Gemfile
5
5
  Excludes:
6
- - bin/*
6
+ - bin/**/*
7
+ - vendor/**/*
7
8
 
8
9
  MethodLength:
9
10
  Max: 15
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.1)
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.9)
21
+ coveralls (0.7.10)
22
22
  multi_json (~> 1.10)
23
- rest-client (~> 1.7)
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.2)
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.2)
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.0)
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.1)
63
+ simplecov (0.9.2)
64
64
  docile (~> 1.1.0)
65
65
  multi_json (~> 1.0)
66
- simplecov-html (~> 0.8.0)
67
- simplecov-html (0.8.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=coveralls)](https://coveralls.io/r/behance/singularity_dsl?branch=coveralls)
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? { |file| file.match("\.#{type}$") }
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 { |file| file.match("\.#{type}$") }
27
+ existing_files.select do |file|
28
+ file.match("\.#{type}$") || type == file
29
+ end
26
30
  end.sort
27
31
  end
28
32
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  # version const for gem
4
4
  module SingularityDsl
5
- VERSION = '1.6.1'
5
+ VERSION = '1.6.3'
6
6
  end
@@ -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 something.js something.css)
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 'correct eval for single file type' do
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 'correct eval for multiple file types' do
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 'correct eval for single file type' do
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 'correct eval for multiple file types' do
44
- expect(instance.changed_files %w(js css))
45
- .to eql %w(something.css something.js)
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 'filters for existing files' do
49
- expect(instance.changed_files %w(php js css))
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.1
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-07 00:00:00.000000000 Z
11
+ date: 2015-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json