guard-rubocop 1.0.2 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 381f4bdd0bfd18f0421441c723f6d15b7fa60483
4
- data.tar.gz: 706e9ce598392012ba485deb21c6fc127fc333ac
3
+ metadata.gz: aa248932e68a78aa1fc24ae53d4d300b71640a11
4
+ data.tar.gz: d23806def0e10055e1aa4988dcd0138a4fa9d43a
5
5
  SHA512:
6
- metadata.gz: a2d6bc60c3f2cbe194e7a5036b1510b8a1a38d7a9c9261a17505d9af95094a84e7b97b6ce7e7fe4a3fdaf792a2990d9af317a3741500820fc1883d1c8b59f0ff
7
- data.tar.gz: 6caa97c34c3a4c380a25f0bf869a0bbc1648aef2105d774b2cb51f728a4720f039322afe40249f89919f41876855b8cd66ad19c7d3dbd5e1ce386b55bfe595f9
6
+ metadata.gz: fc9f0a685b407939a1d8ea48498d0b5be5f1886c9108281f712cb5d0cc39fb7acad86d33cf8f9fe5a0f8211c716a10178682f457c9188e6529fcfaf2a32220d5
7
+ data.tar.gz: d00ac9dee7125d9b4fa215953121376d2dcce500a5261e58066748732454574b1c5768c74c88798bf27c1a67ead7c64d3aa197b155360a73b9f5736d23cab798
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Development
4
4
 
5
+ ## v1.1.0
6
+
7
+ * Use RuboCop's `--force-exclusion` option to always ignore files specified in the `Exclude` configuration in `.rubocop.yml`
8
+
5
9
  ## v1.0.2
6
10
 
7
11
  * Support both spelling “offense” (RuboCop 0.19 or later) and “offence” (prior to RuboCop 0.19) ([rubocop#700](https://github.com/bbatsov/rubocop/issues/700))
data/README.md CHANGED
@@ -1,8 +1,12 @@
1
- [![Gem Version](https://badge.fury.io/rb/guard-rubocop.png)](http://badge.fury.io/rb/guard-rubocop) [![Dependency Status](https://gemnasium.com/yujinakayama/guard-rubocop.png)](https://gemnasium.com/yujinakayama/guard-rubocop) [![Build Status](https://travis-ci.org/yujinakayama/guard-rubocop.png?branch=master)](https://travis-ci.org/yujinakayama/guard-rubocop) [![Coverage Status](https://coveralls.io/repos/yujinakayama/guard-rubocop/badge.png?branch=master)](https://coveralls.io/r/yujinakayama/guard-rubocop) [![Code Climate](https://codeclimate.com/github/yujinakayama/guard-rubocop.png)](https://codeclimate.com/github/yujinakayama/guard-rubocop)
1
+ [![Gem Version](http://img.shields.io/gem/v/guard-rubocop.svg)](http://badge.fury.io/rb/guard-rubocop)
2
+ [![Dependency Status](http://img.shields.io/gemnasium/yujinakayama/guard-rubocop.svg)](https://gemnasium.com/yujinakayama/guard-rubocop)
3
+ [![Build Status](https://travis-ci.org/yujinakayama/guard-rubocop.svg?branch=master)](https://travis-ci.org/yujinakayama/guard-rubocop)
4
+ [![Coverage Status](http://img.shields.io/coveralls/yujinakayama/guard-rubocop/master.svg)](https://coveralls.io/r/yujinakayama/guard-rubocop)
5
+ [![Code Climate](http://img.shields.io/codeclimate/github/yujinakayama/guard-rubocop.svg)](https://codeclimate.com/github/yujinakayama/guard-rubocop)
2
6
 
3
- # Guard::Rubocop
7
+ # guard-rubocop
4
8
 
5
- Guard::Rubocop allows you to automatically check Ruby code style with [RuboCop](https://github.com/bbatsov/rubocop) when files are modified.
9
+ **guard-rubocop** allows you to automatically check Ruby code style with [RuboCop](https://github.com/bbatsov/rubocop) when files are modified.
6
10
 
7
11
  Tested on MRI 1.9, 2.0, 2.1, JRuby in 1.9 mode and Rubinius.
8
12
 
@@ -102,6 +106,6 @@ Note: You need to use `guard-rspec` 4.2.3 or later due to a [bug](https://github
102
106
 
103
107
  ## License
104
108
 
105
- Copyright (c) 2013 Yuji Nakayama
109
+ Copyright (c) 2013–2014 Yuji Nakayama
106
110
 
107
111
  See the [LICENSE.txt](LICENSE.txt) for details.
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
21
21
  spec.require_paths = ['lib']
22
22
 
23
23
  spec.add_runtime_dependency 'guard', '~> 2.0'
24
- spec.add_runtime_dependency 'rubocop', '~> 0.10'
24
+ spec.add_runtime_dependency 'rubocop', '~> 0.20'
25
25
 
26
26
  spec.add_development_dependency 'bundler', '~> 1.3'
27
27
  spec.add_development_dependency 'rake', '~> 10.0'
@@ -65,7 +65,7 @@ module Guard
65
65
  @failed_paths = runner.failed_paths
66
66
  throw :task_has_failed unless passed
67
67
  rescue => error
68
- UI.error 'The following exception occurred while running guard-rubocop: ' +
68
+ UI.error 'The following exception occurred while running guard-rubocop: ' \
69
69
  "#{error.backtrace.first} #{error.message} (#{error.class.name})"
70
70
  end
71
71
 
@@ -74,7 +74,7 @@ module Guard
74
74
  paths.map! { |path| File.expand_path(path) }
75
75
  paths.uniq!
76
76
  paths.reject! do |path|
77
- next true unless File.exists?(path)
77
+ next true unless File.exist?(path)
78
78
  included_in_other_path?(path, paths)
79
79
  end
80
80
  paths
@@ -33,6 +33,7 @@ module Guard
33
33
  end
34
34
 
35
35
  command.concat(['--format', 'json', '--out', json_file_path])
36
+ command << '--force-exclusion'
36
37
  command.concat(args_specified_by_user)
37
38
  command.concat(paths)
38
39
  end
@@ -6,8 +6,8 @@ module Guard
6
6
  module RubocopVersion
7
7
  # http://semver.org/
8
8
  MAJOR = 1
9
- MINOR = 0
10
- PATCH = 2
9
+ MINOR = 1
10
+ PATCH = 0
11
11
 
12
12
  def self.to_s
13
13
  [MAJOR, MINOR, PATCH].join('.')
@@ -112,21 +112,25 @@ describe Guard::Rubocop::Runner do
112
112
  end
113
113
  end
114
114
 
115
- it 'adds args for JSON formatter ' do
115
+ it 'adds args for JSON formatter' do
116
116
  expect(build_command[3..4]).to eq(%w(--format json))
117
117
  end
118
118
 
119
- it 'adds args for output file path of JSON formatter ' do
119
+ it 'adds args for output file path of JSON formatter' do
120
120
  expect(build_command[5]).to eq('--out')
121
121
  expect(build_command[6]).not_to be_empty
122
122
  end
123
123
 
124
+ it 'adds --force-exclusion option' do
125
+ expect(build_command[7]).to eq('--force-exclusion')
126
+ end
127
+
124
128
  it 'adds args specified by user' do
125
- expect(build_command[7..8]).to eq(%w(--debug --rails))
129
+ expect(build_command[8..9]).to eq(%w(--debug --rails))
126
130
  end
127
131
 
128
132
  it 'adds the passed paths' do
129
- expect(build_command[9..-1]).to eq(%w(file1.rb file2.rb))
133
+ expect(build_command[10..-1]).to eq(%w(file1.rb file2.rb))
130
134
  end
131
135
  end
132
136
 
@@ -319,14 +323,14 @@ describe Guard::Rubocop::Runner do
319
323
  end
320
324
 
321
325
  it 'notifies summary' do
322
- expect(Guard::Notifier).to receive(:notify) do |message, options|
326
+ expect(Guard::Notifier).to receive(:notify) do |message, _options|
323
327
  expect(message).to eq('2 files inspected, 4 offenses detected')
324
328
  end
325
329
  runner.notify(true)
326
330
  end
327
331
 
328
332
  it 'notifies with title "RuboCop results"' do
329
- expect(Guard::Notifier).to receive(:notify) do |message, options|
333
+ expect(Guard::Notifier).to receive(:notify) do |_message, options|
330
334
  expect(options[:title]).to eq('RuboCop results')
331
335
  end
332
336
  runner.notify(true)
@@ -334,7 +338,7 @@ describe Guard::Rubocop::Runner do
334
338
 
335
339
  context 'when passed' do
336
340
  it 'shows success image' do
337
- expect(Guard::Notifier).to receive(:notify) do |message, options|
341
+ expect(Guard::Notifier).to receive(:notify) do |_message, options|
338
342
  expect(options[:image]).to eq(:success)
339
343
  end
340
344
  runner.notify(true)
@@ -343,7 +347,7 @@ describe Guard::Rubocop::Runner do
343
347
 
344
348
  context 'when failed' do
345
349
  it 'shows failed image' do
346
- expect(Guard::Notifier).to receive(:notify) do |message, options|
350
+ expect(Guard::Notifier).to receive(:notify) do |_message, options|
347
351
  expect(options[:image]).to eq(:failed)
348
352
  end
349
353
  runner.notify(false)
@@ -132,10 +132,10 @@ describe Guard::Rubocop, :silence_output do
132
132
  end
133
133
 
134
134
  it 'passes cleaned paths to rubocop' do
135
- expect_any_instance_of(Guard::Rubocop::Runner).to receive(:run) do |instance, paths|
135
+ expect_any_instance_of(Guard::Rubocop::Runner).to receive(:run) do |_instance, paths|
136
136
  expect(paths).to eq([
137
- File.expand_path('some.rb'),
138
- File.expand_path('dir/another.rb')
137
+ File.expand_path('lib/guard/rubocop.rb'),
138
+ File.expand_path('spec/spec_helper.rb')
139
139
  ])
140
140
  end
141
141
  subject
@@ -159,7 +159,7 @@ describe Guard::Rubocop, :silence_output do
159
159
 
160
160
  it 'also inspects paths which are failed last time' do
161
161
  guard.failed_paths << failed_path
162
- expect_any_instance_of(Guard::Rubocop::Runner).to receive(:run) do |instance, paths|
162
+ expect_any_instance_of(Guard::Rubocop::Runner).to receive(:run) do |_instance, paths|
163
163
  expect(paths).to include failed_path
164
164
  end
165
165
  subject
@@ -171,8 +171,11 @@ describe Guard::Rubocop, :silence_output do
171
171
 
172
172
  it 'inspects just changed paths' do
173
173
  guard.failed_paths << failed_path
174
- expect_any_instance_of(Guard::Rubocop::Runner).to receive(:run) do |instance, paths|
175
- expect(paths).to eq(changed_paths)
174
+ expect_any_instance_of(Guard::Rubocop::Runner).to receive(:run) do |_instance, paths|
175
+ expect(paths).to eq([
176
+ File.expand_path('lib/guard/rubocop.rb'),
177
+ File.expand_path('spec/spec_helper.rb')
178
+ ])
176
179
  end
177
180
  subject
178
181
  end
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: 1.0.2
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuji Nakayama
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-11 00:00:00.000000000 Z
11
+ date: 2014-04-13 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.10'
33
+ version: '0.20'
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.10'
40
+ version: '0.20'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -176,7 +176,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
176
176
  version: '0'
177
177
  requirements: []
178
178
  rubyforge_project:
179
- rubygems_version: 2.2.0
179
+ rubygems_version: 2.2.2
180
180
  signing_key:
181
181
  specification_version: 4
182
182
  summary: Guard plugin for RuboCop