guard-rubocop 0.2.1 → 0.2.2
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/CHANGELOG.md +7 -1
- data/Rakefile +3 -6
- data/guard-rubocop.gemspec +2 -2
- data/lib/guard/rubocop/runner.rb +2 -4
- data/lib/guard/rubocop/version.rb +5 -2
- data/spec/guard/rubocop/runner_spec.rb +18 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 00fdd1e9bc5751c2c6d979b21ef8d8ee0a1415a4
|
4
|
+
data.tar.gz: 52575f61a0ea2b94bf02e332d97a25cfb7f29a65
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 397b15f12ade915b254c5f8232fdce7e1d105c735fe156d86526511d99232fbe3264ac956883fbfab7778aed7a8aeace06bfb77d1b9b3334e94a76e1d2381534
|
7
|
+
data.tar.gz: a67ec286c5d22d1ffcd5c67317ac00755853d677cdf2fdb0691f36f8655f0d47cd127751bb02888db30b3a69fbd7883e947039b73cb6506fa828010efb758bfd
|
data/CHANGELOG.md
CHANGED
data/Rakefile
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
require 'bundler/gem_tasks'
|
2
2
|
require 'rspec/core/rake_task'
|
3
|
+
require 'rubocop/rake_task'
|
3
4
|
|
4
5
|
RSpec::Core::RakeTask.new(:spec)
|
6
|
+
Rubocop::RakeTask.new(:style)
|
5
7
|
|
6
8
|
namespace :ci do
|
7
9
|
task :spec do
|
@@ -15,12 +17,7 @@ namespace :ci do
|
|
15
17
|
end
|
16
18
|
end
|
17
19
|
|
18
|
-
desc '
|
19
|
-
task :style do
|
20
|
-
sh('rubocop')
|
21
|
-
end
|
22
|
-
|
23
|
-
desc 'Run RSpec code examples and check code style with RuboCop'
|
20
|
+
desc 'Run RSpec and RuboCop'
|
24
21
|
task all: [:spec, :style]
|
25
22
|
|
26
23
|
task default: :all
|
data/guard-rubocop.gemspec
CHANGED
@@ -7,7 +7,7 @@ require 'guard/rubocop/version'
|
|
7
7
|
|
8
8
|
Gem::Specification.new do |spec|
|
9
9
|
spec.name = 'guard-rubocop'
|
10
|
-
spec.version = Guard::RubocopVersion
|
10
|
+
spec.version = Guard::RubocopVersion.to_s
|
11
11
|
spec.authors = ['Yuji Nakayama']
|
12
12
|
spec.email = ['nkymyj@gmail.com']
|
13
13
|
spec.summary = 'Guard plugin for RuboCop'
|
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.require_paths = ['lib']
|
22
22
|
|
23
23
|
spec.add_runtime_dependency 'guard', '~> 1.8'
|
24
|
-
spec.add_runtime_dependency 'rubocop', '~> 0.
|
24
|
+
spec.add_runtime_dependency 'rubocop', '~> 0.10'
|
25
25
|
|
26
26
|
spec.add_development_dependency 'bundler', '~> 1.3'
|
27
27
|
spec.add_development_dependency 'rake', '~> 10.0'
|
data/lib/guard/rubocop/runner.rb
CHANGED
@@ -56,15 +56,13 @@ module Guard
|
|
56
56
|
def include_formatter_for_console?(cli_args)
|
57
57
|
index = -1
|
58
58
|
formatter_args = cli_args.group_by do |arg|
|
59
|
-
if
|
60
|
-
index += 1
|
61
|
-
end
|
59
|
+
index += 1 if arg == '--format' || arg.start_with?('-f')
|
62
60
|
index
|
63
61
|
end
|
64
62
|
formatter_args.delete(-1)
|
65
63
|
|
66
64
|
formatter_args.each_value.any? do |args|
|
67
|
-
args.none? { |a|
|
65
|
+
args.none? { |a| a == '--out' || a.start_with?('-o') }
|
68
66
|
end
|
69
67
|
end
|
70
68
|
|
@@ -193,6 +193,24 @@ describe Guard::Rubocop::Runner do
|
|
193
193
|
end
|
194
194
|
end
|
195
195
|
|
196
|
+
context 'when the passed args include a -f with its arg without separator' do
|
197
|
+
context 'but does not include an -o/--output' do
|
198
|
+
let(:args) { %w(-fs --debug) }
|
199
|
+
|
200
|
+
it 'returns true' do
|
201
|
+
expect(include_formatter_for_console?).to be_true
|
202
|
+
end
|
203
|
+
end
|
204
|
+
|
205
|
+
context 'and include an -o with its arg without separator just after the -f/--format' do
|
206
|
+
let(:args) { %w(-fs -osimple.txt) }
|
207
|
+
|
208
|
+
it 'returns false' do
|
209
|
+
expect(include_formatter_for_console?).to be_false
|
210
|
+
end
|
211
|
+
end
|
212
|
+
end
|
213
|
+
|
196
214
|
context 'when the passed args include multiple -f/--format' do
|
197
215
|
context 'and all -f/--format have associated -o/--out' do
|
198
216
|
let(:args) { %w(--format simple --out simple.txt --format emacs --out emacs.txt) }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: guard-rubocop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuji Nakayama
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-09-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: guard
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0.
|
33
|
+
version: '0.10'
|
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: '0.
|
40
|
+
version: '0.10'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|