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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: df888e087c9fd9f43ae488326b28cdacc0590e04
4
- data.tar.gz: 4f1e983579323bcddb9de6679c00d84a1342f345
3
+ metadata.gz: 00fdd1e9bc5751c2c6d979b21ef8d8ee0a1415a4
4
+ data.tar.gz: 52575f61a0ea2b94bf02e332d97a25cfb7f29a65
5
5
  SHA512:
6
- metadata.gz: 64a073b7cb937839c493b97380185a3e286dc6cc41e741c662ae02231ec633ccf76484edc9382707eb29a0698d656405bf0b7025da87ab4f237f4a8e9d05d6ef
7
- data.tar.gz: 9c8e163eb4a1e510adf4dab87b370ec9a59e4acaac16ff32e252beb450852099cf0e1cb80edf95b61e2bfe72c51fa5ef46bdfef484279bf9d58ddb2343776d7a
6
+ metadata.gz: 397b15f12ade915b254c5f8232fdce7e1d105c735fe156d86526511d99232fbe3264ac956883fbfab7778aed7a8aeace06bfb77d1b9b3334e94a76e1d2381534
7
+ data.tar.gz: a67ec286c5d22d1ffcd5c67317ac00755853d677cdf2fdb0691f36f8655f0d47cd127751bb02888db30b3a69fbd7883e947039b73cb6506fa828010efb758bfd
@@ -1,4 +1,10 @@
1
- # CHANGELOG
1
+ # Changelog
2
+
3
+ ## Master
4
+
5
+ ## v0.2.2
6
+
7
+ * Fix a bug where `progress` formatter was used when `-f` and its argument were specified without separator in `:cli` option in `Guardfile` (e.g. `-fs`)
2
8
 
3
9
  ## v0.2.1
4
10
 
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 'Check code style with RuboCop'
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
@@ -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::VERSION
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.9'
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'
@@ -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 %w(-f --format).include?(arg)
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| %w(-o --out).include?(a) }
65
+ args.none? { |a| a == '--out' || a.start_with?('-o') }
68
66
  end
69
67
  end
70
68
 
@@ -7,7 +7,10 @@ module Guard
7
7
  # http://semver.org/
8
8
  MAJOR = 0
9
9
  MINOR = 2
10
- PATCH = 1
11
- VERSION = [MAJOR, MINOR, PATCH].join('.')
10
+ PATCH = 2
11
+
12
+ def self.to_s
13
+ [MAJOR, MINOR, PATCH].join('.')
14
+ end
12
15
  end
13
16
  end
@@ -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.1
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-07-25 00:00:00.000000000 Z
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.9'
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.9'
40
+ version: '0.10'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement