singularity_dsl 1.5.8 → 1.6.0

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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MDhmYzJmZmU0OGY1YWMxZjA0ZGUyMDQ1ZWQ1ZGY2ZTBlZDFjN2JlZg==
4
+ YzZjNjM3MDEwOTQ0YTZjYTNjZDdjYjI1NTEzMThiNmJiMmM3OTAwNw==
5
5
  data.tar.gz: !binary |-
6
- ZmM3MTEwMzlmYzQzYTYxZGIxZWQ3OGZjMGQwMzFiOTZmY2FjZjU5MA==
6
+ Yjc0MGYyNWE0ZjQzN2FlYzljMDA5ZDQ3YmM2MzE4ZmVmYWM3NzNhNA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- Y2ViNjUzNTE5OWJmNGNlNTI1YWExNjdmOGFkZjc1MzExNTkyMjk2MGY3MTM3
10
- ZTA0OWQyYWE0OTExZDg4MGZjZWVjMmY5YTA0ZjIyM2ZhYmExMDhjYmYyYmQ1
11
- NTUyMGYxOGQ0NmNiZDQ1OTUzMWY4MzBmZWMxZTc1MmRjMTk2MjI=
9
+ YTU3MThlYzcxYTE0OTRjYTVkYTM1ZTAzMmNmODk2OGI0MjA4MmY4ZDdkNWNj
10
+ ZjhiYjE5NWVlZDg1YTg1OWJkYjVhYzU3ZGU0NmFlYzUzMGU4YzRkNjY3YzY1
11
+ YTNmMmEyM2E1NTRlN2M4NmFiOTcwNjQzMWQ5YTc0N2QwMjUwMWI=
12
12
  data.tar.gz: !binary |-
13
- NmU2MGQ3N2RmNGFiYjc3N2JlMmNhOWM1ZWIzNzk0YjAyNDAxYTAyMTVlMWM3
14
- MGYwYjE3NjhhNjc4YzNkNWYwOTlkZTNjYTlmZmEzMzQ2Y2M1NGYzODI1ZTc0
15
- MjA0OWM5YjU2YjZiMzI5NjdjMGI1ZGU5OTgxYTQzNmJiYzllZjg=
13
+ Y2FlYTNkYzQ2ZDU3NTQxZTlhOTdlYTIzY2I1NGQ1NGU4NTNhMjk1ZmYxNjgw
14
+ NmJjOWM2MTg1NDNmY2UzZDgzYWE3NmRlYTMzYjAzYTU0ZTFjYjNiZTEwYWU0
15
+ OTI4NGU3ZWQ2ZTNjNGVjNjdhZDUwYjIyZmJhMWUxZWQyMzdhYWI=
data/.singularityrc CHANGED
@@ -1,5 +1,8 @@
1
1
  # encoding: utf-8
2
2
 
3
+
4
+ ENV['COVERALLS_REPO_TOKEN'] = 'AcPyCLj3wGg7aunnmgDTu6Wm9P8Kpy5oA'
5
+
3
6
  batch :build do
4
7
  shelltask { command 'bundle' }
5
8
  end
data/Gemfile.lock CHANGED
@@ -1,11 +1,12 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- singularity_dsl (1.5.8)
4
+ singularity_dsl (1.6.0)
5
+ coveralls (~> 0.7.9)
5
6
  json (~> 1.0)
6
- mixlib-shellout (~> 1.6.0)
7
+ mixlib-shellout (~> 2.0)
7
8
  rainbow (~> 2.0.0)
8
- rake (~> 10.3)
9
+ rake (~> 10.0)
9
10
  rspec (~> 3.0)
10
11
  rubocop (~> 0.24)
11
12
  terminal-table (~> 1.4)
@@ -17,38 +18,58 @@ GEM
17
18
  ast (2.0.0)
18
19
  astrolabe (1.3.0)
19
20
  parser (>= 2.2.0.pre.3, < 3.0)
21
+ coveralls (0.7.9)
22
+ multi_json (~> 1.10)
23
+ rest-client (~> 1.7)
24
+ simplecov (~> 0.9.1)
25
+ term-ansicolor (~> 1.3)
26
+ thor (~> 0.19.1)
20
27
  diff-lcs (1.2.5)
28
+ docile (1.1.5)
21
29
  gem-release (0.7.3)
22
- json (1.8.1)
23
- mixlib-shellout (1.6.0)
24
- parser (2.2.0.pre.7)
30
+ json (1.8.2)
31
+ mime-types (2.4.3)
32
+ mixlib-shellout (2.0.1)
33
+ multi_json (1.10.1)
34
+ netrc (0.10.2)
35
+ parser (2.2.0.2)
25
36
  ast (>= 1.1, < 3.0)
26
- slop (~> 3.4, >= 3.4.5)
27
- powerpack (0.0.9)
37
+ powerpack (0.1.0)
28
38
  rainbow (2.0.0)
29
- rake (10.3.2)
30
- rspec (3.1.0)
31
- rspec-core (~> 3.1.0)
32
- rspec-expectations (~> 3.1.0)
33
- rspec-mocks (~> 3.1.0)
34
- rspec-core (3.1.7)
35
- rspec-support (~> 3.1.0)
36
- rspec-expectations (3.1.2)
39
+ rake (10.4.2)
40
+ rest-client (1.7.2)
41
+ mime-types (>= 1.16, < 3.0)
42
+ netrc (~> 0.7)
43
+ rspec (3.2.0)
44
+ rspec-core (~> 3.2.0)
45
+ rspec-expectations (~> 3.2.0)
46
+ rspec-mocks (~> 3.2.0)
47
+ rspec-core (3.2.0)
48
+ rspec-support (~> 3.2.0)
49
+ rspec-expectations (3.2.0)
37
50
  diff-lcs (>= 1.2.0, < 2.0)
38
- rspec-support (~> 3.1.0)
39
- rspec-mocks (3.1.3)
40
- rspec-support (~> 3.1.0)
41
- rspec-support (3.1.2)
42
- rubocop (0.27.0)
51
+ rspec-support (~> 3.2.0)
52
+ rspec-mocks (3.2.0)
53
+ diff-lcs (>= 1.2.0, < 2.0)
54
+ rspec-support (~> 3.2.0)
55
+ rspec-support (3.2.1)
56
+ rubocop (0.29.0)
43
57
  astrolabe (~> 1.3)
44
- parser (>= 2.2.0.pre.6, < 3.0)
45
- powerpack (~> 0.0.6)
58
+ parser (>= 2.2.0.1, < 3.0)
59
+ powerpack (~> 0.1)
46
60
  rainbow (>= 1.99.1, < 3.0)
47
61
  ruby-progressbar (~> 1.4)
48
- ruby-progressbar (1.7.0)
49
- slop (3.6.0)
62
+ ruby-progressbar (1.7.1)
63
+ simplecov (0.9.1)
64
+ docile (~> 1.1.0)
65
+ multi_json (~> 1.0)
66
+ simplecov-html (~> 0.8.0)
67
+ simplecov-html (0.8.0)
68
+ term-ansicolor (1.3.0)
69
+ tins (~> 1.0)
50
70
  terminal-table (1.4.5)
51
71
  thor (0.19.1)
72
+ tins (1.3.4)
52
73
 
53
74
  PLATFORMS
54
75
  ruby
data/README.md CHANGED
@@ -3,6 +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
7
 
7
8
  A DSL lib for your [SingularityCI](https://github.com/behance/singularity) instance.
8
9
  Inspired by TravisCI's `.travis.yml`
data/Rakefile CHANGED
@@ -6,7 +6,6 @@ require 'rubocop/rake_task'
6
6
  require 'rspec/core/rake_task'
7
7
 
8
8
  namespace :test do
9
-
10
9
  RuboCop::RakeTask.new(:rubocop)
11
10
 
12
11
  RSpec::Core::RakeTask.new(:rspec) do |t|
@@ -8,7 +8,7 @@ module SingularityDsl
8
8
  end
9
9
 
10
10
  def validate_file(file)
11
- throw "Cannot find #{file}" unless File.exist? file
11
+ throw "Cannot find #{file}" unless ::File.exist? file
12
12
  end
13
13
 
14
14
  def execute
@@ -26,5 +26,9 @@ module SingularityDsl
26
26
  def task_name
27
27
  false
28
28
  end
29
+
30
+ def bool?(val)
31
+ val.is_a?(TrueClass) || val.is_a?(FalseClass)
32
+ end
29
33
  end
30
34
  end
@@ -0,0 +1,71 @@
1
+ # encoding: utf-8
2
+
3
+ require 'coveralls'
4
+ require 'singularity_dsl/stdout'
5
+ require 'singularity_dsl/task'
6
+
7
+ # bootstrap coveralls in the current runtime
8
+ class BootCoveralls < SingularityDsl::Task
9
+ include SingularityDsl::Stdout
10
+
11
+ attr_reader :env
12
+
13
+ def initialize(&block)
14
+ # TODO: there may be others...?
15
+ @required_envs = %w(COVERALLS_REPO_TOKEN)
16
+ @env = 'singularity-coveralls'
17
+ @no_fail = true
18
+ super(&block)
19
+ end
20
+
21
+ def token(token)
22
+ ENV['COVERALLS_REPO_TOKEN'] = token
23
+ end
24
+
25
+ def report_endpoint(endpoint)
26
+ ENV['COVERALLS_ENDPOINT'] = endpoint
27
+ end
28
+
29
+ def no_fail(switch)
30
+ fail 'no_fail must be bool' unless bool? switch
31
+ @no_fail = switch
32
+ end
33
+
34
+ def cover_all_things!
35
+ ::Coveralls.wear!
36
+ end
37
+
38
+ def execute
39
+ # never fail run!
40
+ unless env_ok
41
+ info 'Skipping coveralls'
42
+ return
43
+ end
44
+
45
+ begin
46
+ ENV['CI_NAME'] ||= env
47
+ ENV['CI'] ||= env
48
+ cover_all_things!
49
+ rescue ::StandardError => e
50
+ info e.to_s
51
+ raise e unless no_fail
52
+ end
53
+ end
54
+
55
+ def description
56
+ 'Boots a custom Coveralls ENVironment'
57
+ end
58
+
59
+ private
60
+
61
+ def env_ok
62
+ ok = true
63
+ @required_envs.each do |var|
64
+ unless ENV.key? var
65
+ info "Missing ENV variable: #{var}"
66
+ ok = false
67
+ end
68
+ end
69
+ ok
70
+ end
71
+ end
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'mixlib/shellout'
4
4
  require 'singularity_dsl/stdout'
5
+ require 'singularity_dsl/task'
5
6
 
6
7
  # shell-out resource for any ol commands
7
8
  class ShellTask < SingularityDsl::Task
@@ -65,10 +66,6 @@ class ShellTask < SingularityDsl::Task
65
66
  data(log)
66
67
  end
67
68
 
68
- def bool?(val)
69
- val.is_a?(TrueClass) || val.is_a?(FalseClass)
70
- end
71
-
72
69
  def setup_shell(cmd)
73
70
  shell = ::Mixlib::ShellOut.new cmd
74
71
  shell.live_stream = @live_stream if @live_stream
@@ -2,5 +2,5 @@
2
2
 
3
3
  # version const for gem
4
4
  module SingularityDsl
5
- VERSION = '1.5.8'
5
+ VERSION = '1.6.0'
6
6
  end
@@ -19,13 +19,14 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ['lib']
20
20
 
21
21
  spec.add_dependency 'json', '~> 1.0'
22
- spec.add_dependency 'mixlib-shellout', '~> 1.6.0'
22
+ spec.add_dependency 'mixlib-shellout', '~> 2.0'
23
23
  spec.add_dependency 'rainbow', '~> 2.0.0'
24
- spec.add_dependency 'rake', '~> 10.3'
24
+ spec.add_dependency 'rake', '~> 10.0'
25
25
  spec.add_dependency 'rspec', '~> 3.0'
26
26
  spec.add_dependency 'rubocop', '~> 0.24'
27
27
  spec.add_dependency 'terminal-table', '~> 1.4'
28
28
  spec.add_dependency 'thor', '~> 0.19'
29
+ spec.add_dependency 'coveralls', '~> 0.7.9'
29
30
 
30
31
  spec.add_development_dependency 'bundler', '~> 1.3'
31
32
  spec.add_development_dependency 'gem-release'
@@ -0,0 +1,32 @@
1
+ # encoding: utf-8
2
+
3
+ require 'singularity_dsl/tasks/boot_coveralls'
4
+
5
+ describe BootCoveralls do
6
+ let(:coveralls) { BootCoveralls.new }
7
+
8
+ context '#no_fail' do
9
+ it 'fails when non-bool given' do
10
+ expect { coveralls.no_fail [] }.to raise_error
11
+ end
12
+ end
13
+
14
+ context '#execute' do
15
+ before(:each) do
16
+ allow(coveralls).to receive(:info)
17
+ end
18
+
19
+ context 'environment not correct' do
20
+ it 'return if COVERALLS_REPO_TOKEN is not set' do
21
+ allow(ENV).to receive(:key?)
22
+ .with('COVERALLS_REPO_TOKEN').and_return false
23
+
24
+ expect(coveralls).to receive(:info)
25
+ .with('Missing ENV variable: COVERALLS_REPO_TOKEN')
26
+ expect(coveralls).to receive(:info)
27
+ .with('Skipping coveralls')
28
+ expect(coveralls.execute).to eql nil
29
+ end
30
+ end
31
+ end
32
+ 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.5.8
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - chr0n1x
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-06 00:00:00.000000000 Z
11
+ date: 2015-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ~>
32
32
  - !ruby/object:Gem::Version
33
- version: 1.6.0
33
+ version: '2.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ~>
39
39
  - !ruby/object:Gem::Version
40
- version: 1.6.0
40
+ version: '2.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rainbow
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - ~>
60
60
  - !ruby/object:Gem::Version
61
- version: '10.3'
61
+ version: '10.0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - ~>
67
67
  - !ruby/object:Gem::Version
68
- version: '10.3'
68
+ version: '10.0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -122,6 +122,20 @@ dependencies:
122
122
  - - ~>
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0.19'
125
+ - !ruby/object:Gem::Dependency
126
+ name: coveralls
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ~>
130
+ - !ruby/object:Gem::Version
131
+ version: 0.7.9
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ~>
137
+ - !ruby/object:Gem::Version
138
+ version: 0.7.9
125
139
  - !ruby/object:Gem::Dependency
126
140
  name: bundler
127
141
  requirement: !ruby/object:Gem::Requirement
@@ -187,6 +201,7 @@ files:
187
201
  - lib/singularity_dsl/runstate.rb
188
202
  - lib/singularity_dsl/stdout.rb
189
203
  - lib/singularity_dsl/task.rb
204
+ - lib/singularity_dsl/tasks/boot_coveralls.rb
190
205
  - lib/singularity_dsl/tasks/rake.rb
191
206
  - lib/singularity_dsl/tasks/rspec.rb
192
207
  - lib/singularity_dsl/tasks/rubocop.rb
@@ -206,6 +221,7 @@ files:
206
221
  - spec/singularity_dsl/git_helper_spec.rb
207
222
  - spec/singularity_dsl/runstate_spec.rb
208
223
  - spec/singularity_dsl/task_spec.rb
224
+ - spec/singularity_dsl/tasks/boot_coveralls_spec.rb
209
225
  - spec/singularity_dsl/tasks/shell_task_spec.rb
210
226
  - spec/singularity_dsl_spec.rb
211
227
  homepage: ''
@@ -246,5 +262,6 @@ test_files:
246
262
  - spec/singularity_dsl/git_helper_spec.rb
247
263
  - spec/singularity_dsl/runstate_spec.rb
248
264
  - spec/singularity_dsl/task_spec.rb
265
+ - spec/singularity_dsl/tasks/boot_coveralls_spec.rb
249
266
  - spec/singularity_dsl/tasks/shell_task_spec.rb
250
267
  - spec/singularity_dsl_spec.rb