aptible-tasks 0.3.0 → 0.3.1
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/aptible/tasks/rubocop.rb +13 -0
- data/lib/aptible/tasks/version.rb +1 -1
- data/spec/aptible/tasks/rubocop_spec.rb +20 -2
- data/spec/tasks/rubocob_spec.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 782b492bc0392d17b93b628c4595ec9a13abaea7
|
4
|
+
data.tar.gz: bb8fb404236f673d30739285f30e3636060233c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4afa304ff676316ca4f94d07daa2905578503e5b656b56b10662a07f6bf8f37df4851d5beddfcc4429b3e14d02b23ec1b3c9d448b3ba3aa0ffdaeaa38a3aceb7
|
7
|
+
data.tar.gz: 546c7f578b0a8366bdb75e88525609dd645e1c92ed4619275b7e61657a76397c1d3bc9ccfec4b64347bc28e16082ad6042ae551602fa60754377485a75e26e27
|
@@ -4,9 +4,22 @@ module Aptible
|
|
4
4
|
module Tasks
|
5
5
|
class Rubocop
|
6
6
|
def config_file
|
7
|
+
project_config_file ||
|
7
8
|
File.join(File.dirname(__FILE__), '..', '..', '..', '.rubocop.yml')
|
8
9
|
end
|
9
10
|
|
11
|
+
def project_config_file(dir = Dir.pwd)
|
12
|
+
previous = File.expand_path('..', dir)
|
13
|
+
local_rubocop_yml = File.join(dir, '.rubocop.yml')
|
14
|
+
if File.exist?(local_rubocop_yml)
|
15
|
+
local_rubocop_yml
|
16
|
+
elsif previous == dir
|
17
|
+
nil
|
18
|
+
else
|
19
|
+
project_config_file(previous)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
10
23
|
def config
|
11
24
|
::Rubocop::ConfigLoader.load_file(config_file)
|
12
25
|
end
|
@@ -7,10 +7,28 @@ describe Aptible::Tasks::Rubocop do
|
|
7
7
|
|
8
8
|
its(:config) { should be_a ::Rubocop::Config }
|
9
9
|
|
10
|
+
describe :project_config_file do
|
11
|
+
let!(:rubocop_yml) { File.join(Dir.pwd, '.rubocop.yml') }
|
12
|
+
|
13
|
+
it 'should return a local .rubocop.yml if present' do
|
14
|
+
expect(subject.project_config_file).to eq rubocop_yml
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'should return a .rubocop.yml in a parent directory' do
|
18
|
+
FileUtils.cd 'spec'
|
19
|
+
expect(subject.project_config_file).to eq rubocop_yml
|
20
|
+
end
|
21
|
+
|
22
|
+
it 'should return nil if no file exists' do
|
23
|
+
File.stub(:exist?) { false }
|
24
|
+
expect(subject.project_config_file).to be_nil
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
10
28
|
describe :config do
|
11
29
|
it 'contains sane values' do
|
12
|
-
subject.config['Documentation']['Enabled'].
|
13
|
-
subject.config['AllCops']['Exclude'].
|
30
|
+
expect(subject.config['Documentation']['Enabled']).to be_false
|
31
|
+
expect(subject.config['AllCops']['Exclude']).not_to be_empty
|
14
32
|
end
|
15
33
|
end
|
16
34
|
end
|
data/spec/tasks/rubocob_spec.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aptible-tasks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Frank Macreery
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -116,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
116
116
|
version: '0'
|
117
117
|
requirements: []
|
118
118
|
rubyforge_project:
|
119
|
-
rubygems_version: 2.2.
|
119
|
+
rubygems_version: 2.2.2
|
120
120
|
signing_key:
|
121
121
|
specification_version: 4
|
122
122
|
summary: Shared Rake tasks for Aptible projects.
|