guard-rubocop 1.1.0 → 1.5.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,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: aa248932e68a78aa1fc24ae53d4d300b71640a11
4
- data.tar.gz: d23806def0e10055e1aa4988dcd0138a4fa9d43a
2
+ SHA256:
3
+ metadata.gz: f4fd50bb78f68a751f5fcc10f383377a222c9929ed882c62e44a93f15de13054
4
+ data.tar.gz: 0ec423fa69f1af3cc9e784a576ecd6c91995f3ab03afdb5ea54226a7bdf97a0e
5
5
  SHA512:
6
- metadata.gz: fc9f0a685b407939a1d8ea48498d0b5be5f1886c9108281f712cb5d0cc39fb7acad86d33cf8f9fe5a0f8211c716a10178682f457c9188e6529fcfaf2a32220d5
7
- data.tar.gz: d00ac9dee7125d9b4fa215953121376d2dcce500a5261e58066748732454574b1c5768c74c88798bf27c1a67ead7c64d3aa197b155360a73b9f5736d23cab798
6
+ metadata.gz: de52917c49a6988e46ab3c8c2a933e6c590df311252c0d0e8a5828113242448c8f0f1deeaa7c4c57a1290a91f8ae9869bafa73a36c9fdf74c840d1b199fd5f84
7
+ data.tar.gz: 8a9f56e402052cdbe167ddf27fd6f736e659a1dd864861d7aef07017e3c3f88b3395ac7b9e2ee2eecb57dc4fb84d72720845d2a86f3ae47b7b165ba603b7dd87
@@ -0,0 +1,30 @@
1
+ name: CI
2
+ on: [push, pull_request]
3
+ jobs:
4
+ rspec:
5
+ name: RSpec
6
+ runs-on: ubuntu-latest
7
+ strategy:
8
+ matrix:
9
+ ruby: ['2.5', '2.6', '2.7', '3.0']
10
+ steps:
11
+ - uses: actions/checkout@v2
12
+ - uses: ruby/setup-ruby@v1
13
+ with:
14
+ ruby-version: ${{ matrix.ruby }}
15
+ - run: bundle install
16
+ - run: bundle exec rspec
17
+ # FIXME: https://github.com/rubocop/guard-rubocop/pull/48#issuecomment-906893891
18
+ # - uses: coverallsapp/github-action@master
19
+ # with:
20
+ # github-token: ${{ secrets.GITHUB_TOKEN }}
21
+ rubocop:
22
+ name: RuboCop
23
+ runs-on: ubuntu-latest
24
+ steps:
25
+ - uses: actions/checkout@v2
26
+ - uses: ruby/setup-ruby@v1
27
+ with:
28
+ ruby-version: 2.5
29
+ - run: bundle install
30
+ - run: bundle exec rubocop
data/.gitignore CHANGED
@@ -11,6 +11,7 @@ doc/
11
11
  lib/bundler/man
12
12
  pkg
13
13
  rdoc
14
+ spec/examples.txt
14
15
  spec/reports
15
16
  test/tmp
16
17
  test/version_tmp
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --require spec_helper
data/.rubocop.yml CHANGED
@@ -1,7 +1,39 @@
1
- # The default 79 character limit is sometimes unproductive.
2
- LineLength:
1
+ inherit_from: .rubocop_todo.yml
2
+
3
+ AllCops:
4
+ TargetRubyVersion: 2.5
5
+
6
+ Layout/FirstArrayElementIndentation:
7
+ EnforcedStyle: consistent
8
+
9
+ Layout/LineLength:
3
10
  Max: 100
4
11
 
5
- # The default 10 lines limit is unrealistic.
6
- MethodLength:
12
+ Lint/MissingSuper:
13
+ Exclude:
14
+ - spec/support/silence_output.rb
15
+
16
+ Metrics/BlockLength:
17
+ Exclude:
18
+ - 'spec/**/*.rb'
19
+
20
+ Metrics/MethodLength:
7
21
  Max: 15
22
+
23
+ Naming/HeredocDelimiterNaming:
24
+ Enabled: false
25
+
26
+ Naming/RescuedExceptionsVariableName:
27
+ PreferredName: error
28
+
29
+ Style/EmptyMethod:
30
+ EnforcedStyle: expanded
31
+
32
+ Style/FrozenStringLiteralComment:
33
+ Exclude:
34
+ - lib/guard/rubocop/templates/Guardfile
35
+
36
+ Style/RegexpLiteral:
37
+ Exclude:
38
+ - '**/*.gemspec'
39
+ - '**/Guardfile'
data/.rubocop_todo.yml ADDED
@@ -0,0 +1,12 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2018-01-20 14:55:30 +0900 using RuboCop version 0.52.1.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 1
10
+ # Configuration parameters: CountComments.
11
+ Metrics/ClassLength:
12
+ Max: 103
data/CHANGELOG.md CHANGED
@@ -2,6 +2,24 @@
2
2
 
3
3
  ## Development
4
4
 
5
+ ## v1.5.0
6
+
7
+ * Drop support Ruby 2.4. [#50](https://github.com/rubocop/guard-rubocop/pull/50)
8
+ * Allow custom `cmd` option for rubocop. [#48](https://github.com/rubocop/guard-rubocop/pull/48)
9
+
10
+ ## v1.4.0
11
+
12
+ * Support RuboCop 1.0
13
+
14
+ ## v1.3.0
15
+
16
+ * Add `:launchy` option ([#21](https://github.com/yujinakayama/guard-rubocop/pull/21), [#35](https://github.com/yujinakayama/guard-rubocop/pull/35))
17
+ * Modify the `Guardfile` template so that RuboCop can be run when `.rubocop_todo.yml` is modified ([#36](https://github.com/yujinakayama/guard-rubocop/pull/36))
18
+
19
+ ## v1.2.0
20
+
21
+ * Add `:hide_stdout` option ([#15](https://github.com/yujinakayama/guard-rubocop/pull/15))
22
+
5
23
  ## v1.1.0
6
24
 
7
25
  * Use RuboCop's `--force-exclusion` option to always ignore files specified in the `Exclude` configuration in `.rubocop.yml`
data/Gemfile CHANGED
@@ -1,16 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  gemspec
4
6
 
5
7
  group :test do
6
- gem 'coveralls', '~> 0.6'
7
- gem 'simplecov-rcov', '~> 0.2'
8
- gem 'ci_reporter', '~> 1.8'
9
- end
10
-
11
- platforms :rbx do
12
- gem 'rubysl'
13
- gem 'rubinius-developer_tools'
14
- gem 'json'
15
- gem 'racc' # Needed for RuboCop
8
+ gem 'simplecov-lcov'
16
9
  end
data/Guardfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # A sample Guardfile
2
4
  # More info at https://github.com/guard/guard#readme
3
5
 
@@ -5,8 +7,8 @@ group :red_green_refactor, halt_on_fail: true do
5
7
  guard :rspec, all_after_pass: true, all_on_start: true, cmd: 'bundle exec rspec' do
6
8
  watch(%r{^spec/.+_spec\.rb$})
7
9
  watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
8
- watch('spec/spec_helper.rb') { "spec" }
9
- watch(%r{^spec/support/.+\.rb$}) { "spec" }
10
+ watch('spec/spec_helper.rb') { 'spec' }
11
+ watch(%r{^spec/support/.+\.rb$}) { 'spec' }
10
12
  end
11
13
 
12
14
  guard :rubocop do
data/README.md CHANGED
@@ -1,14 +1,13 @@
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)
1
+ [![Gem Version](https://badge.fury.io/rb/guard-rubocop.svg)](http://badge.fury.io/rb/guard-rubocop)
2
+ [![CI](https://github.com/rubocop/guard-rubocop/workflows/CI/badge.svg)](https://github.com/rubocop/guard-rubocop/actions)
3
+ [![Coverage Status](https://coveralls.io/repos/rubocop/guard-rubocop/badge.svg?branch=master&service=github)](https://coveralls.io/github/rubocop/guard-rubocop?branch=master)
4
+ [![Code Climate](https://codeclimate.com/github/rubocop/guard-rubocop/badges/gpa.svg)](https://codeclimate.com/github/rubocop/guard-rubocop)
6
5
 
7
6
  # guard-rubocop
8
7
 
9
- **guard-rubocop** allows you to automatically check Ruby code style with [RuboCop](https://github.com/bbatsov/rubocop) when files are modified.
8
+ **guard-rubocop** allows you to automatically check Ruby code style with [RuboCop](https://github.com/rubocop/rubocop) when files are modified.
10
9
 
11
- Tested on MRI 1.9, 2.0, 2.1, JRuby in 1.9 mode and Rubinius.
10
+ Tested on MRI 2.5 - 3.0.
12
11
 
13
12
  ## Installation
14
13
 
@@ -34,7 +33,7 @@ or install it yourself as:
34
33
  $ gem install guard-rubocop
35
34
  ```
36
35
 
37
- Add the default Guard::Rubocop definition to your `Guardfile` by running:
36
+ Add the default Guard::RuboCop definition to your `Guardfile` by running:
38
37
 
39
38
  ```sh
40
39
  $ guard init rubocop
@@ -62,6 +61,11 @@ all_on_start: true # Check all files at Guard startup.
62
61
  cli: '--rails' # Pass arbitrary RuboCop CLI arguments.
63
62
  # An array or string is acceptable.
64
63
  # default: nil
64
+ cmd: './bin/rubocop' # Pass custom cmd to run rubocop.
65
+ # default: rubocop
66
+
67
+ hide_stdout: false # Do not display console output (in case outputting to file).
68
+ # default: false
65
69
  keep_failed: true # Keep failed files until they pass.
66
70
  # default: true
67
71
  notification: :failed # Display Growl notification after each run.
@@ -69,6 +73,19 @@ notification: :failed # Display Growl notification after each run.
69
73
  # false - Never notify
70
74
  # :failed - Notify only when failed
71
75
  # default: :failed
76
+ launchy: nil # Filename to launch using Launchy after RuboCop runs.
77
+ # default: nil
78
+ ```
79
+
80
+ ### Using Launchy to view results
81
+
82
+ guard-rubocop can be configured to launch a results file in lieu of or in addition to outputing results to the terminal.
83
+ Configure your Guardfile with the launchy option:
84
+
85
+ ``` ruby
86
+ guard :rubocop, cli: %w(--format fuubar --format html -o ./tmp/rubocop_results.html), launchy: './tmp/rubocop_results.html' do
87
+ # ...
88
+ end
72
89
  ```
73
90
 
74
91
  ## Advanced Tips
@@ -79,7 +96,7 @@ you might be uncomfortable with the offense reports from RuboCop in the red-gree
79
96
  * In the red-green phase, you're not necessarily required to write clean code – you just focus writing code to pass the test. It means, in this phase, `guard-rspec` should be run but `guard-rubocop` should not.
80
97
  * In the refactor phase, you're required to make the code clean while keeping the test passing. In this phase, both `guard-rspec` and `guard-rubocop` should be run.
81
98
 
82
- In this case, you may think the following `Guardfile` structure useful:
99
+ In this case, you may consider making use of the [group method](https://github.com/guard/guard/wiki/Guardfile-DSL---Configuring-Guard#group) in your `Guardfile`:
83
100
 
84
101
  ```ruby
85
102
  # This group allows to skip running RuboCop when RSpec failed.
@@ -106,6 +123,6 @@ Note: You need to use `guard-rspec` 4.2.3 or later due to a [bug](https://github
106
123
 
107
124
  ## License
108
125
 
109
- Copyright (c) 2013–2014 Yuji Nakayama
126
+ Copyright (c) 2013–2020 Yuji Nakayama
110
127
 
111
128
  See the [LICENSE.txt](LICENSE.txt) for details.
data/Rakefile CHANGED
@@ -1,23 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bundler/gem_tasks'
2
4
  require 'rspec/core/rake_task'
3
5
  require 'rubocop/rake_task'
4
6
 
5
7
  RSpec::Core::RakeTask.new(:spec)
6
- Rubocop::RakeTask.new(:style)
7
-
8
- namespace :ci do
9
- task :spec do
10
- ENV['CI'] = 'true'
11
-
12
- ENV['CI_REPORTS'] = 'spec/reports'
13
- require 'ci/reporter/rake/rspec'
14
- Rake::Task['ci:setup:rspec'].invoke
15
-
16
- Rake::Task['spec'].invoke
17
- end
18
- end
19
-
20
- desc 'Run RSpec and RuboCop'
21
- task all: [:spec, :style]
8
+ RuboCop::RakeTask.new(:style)
22
9
 
23
- task default: :all
10
+ task ci: %i[spec style]
@@ -1,32 +1,35 @@
1
- # coding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
- lib = File.expand_path('../lib', __FILE__)
3
+ lib = File.expand_path('lib', __dir__)
4
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
 
6
6
  require 'guard/rubocop/version'
7
7
 
8
8
  Gem::Specification.new do |spec|
9
9
  spec.name = 'guard-rubocop'
10
- spec.version = Guard::RubocopVersion.to_s
10
+ spec.version = GuardRuboCopVersion.to_s
11
11
  spec.authors = ['Yuji Nakayama']
12
12
  spec.email = ['nkymyj@gmail.com']
13
13
  spec.summary = 'Guard plugin for RuboCop'
14
- spec.description = 'Guard::Rubocop automatically checks Ruby code style with RuboCop when files are modified.'
15
- spec.homepage = 'https://github.com/yujinakayama/guard-rubocop'
14
+ spec.description = 'Guard::RuboCop automatically checks Ruby code style with RuboCop ' \
15
+ 'when files are modified.'
16
+ spec.homepage = 'https://github.com/rubocop/guard-rubocop'
16
17
  spec.license = 'MIT'
17
18
 
18
- spec.files = `git ls-files`.split($/)
19
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
20
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.required_ruby_version = '>= 2.5'
20
+
21
+ spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
22
+ spec.executables = spec.files.grep(/^bin\//) { |f| File.basename(f) }
23
+ spec.test_files = spec.files.grep(/^spec\//)
21
24
  spec.require_paths = ['lib']
22
25
 
23
26
  spec.add_runtime_dependency 'guard', '~> 2.0'
24
- spec.add_runtime_dependency 'rubocop', '~> 0.20'
27
+ spec.add_runtime_dependency 'rubocop', '< 2.0'
25
28
 
26
- spec.add_development_dependency 'bundler', '~> 1.3'
27
- spec.add_development_dependency 'rake', '~> 10.0'
28
- spec.add_development_dependency 'rspec', '~> 3.0.0.beta1'
29
- spec.add_development_dependency 'simplecov', '~> 0.7'
29
+ spec.add_development_dependency 'bundler'
30
30
  spec.add_development_dependency 'guard-rspec', '>= 4.2.3', '< 5.0'
31
- spec.add_development_dependency 'ruby_gntp', '~> 0.3'
31
+ spec.add_development_dependency 'launchy', '~> 2.4'
32
+ spec.add_development_dependency 'rake', '>= 12.0'
33
+ spec.add_development_dependency 'rspec', '~> 3.0'
34
+ spec.add_development_dependency 'simplecov', '~> 0.7'
32
35
  end
@@ -1,9 +1,9 @@
1
- # coding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  require 'json'
4
4
 
5
5
  module Guard
6
- class Rubocop
6
+ class RuboCop
7
7
  # This class runs `rubocop` command, retrieves result and notifies.
8
8
  # An instance of this class is intended to invoke `rubocop` only once in its lifetime.
9
9
  class Runner
@@ -22,14 +22,16 @@ module Guard
22
22
  notify(passed)
23
23
  end
24
24
 
25
+ open_launchy_if_needed
26
+
25
27
  passed
26
28
  end
27
29
 
28
30
  def build_command(paths)
29
- command = ['rubocop']
31
+ command = [@options[:cmd] || 'rubocop']
30
32
 
31
- unless include_formatter_for_console?(args_specified_by_user)
32
- command.concat(%w(--format progress)) # Keep default formatter for console.
33
+ if should_add_default_formatter_for_console?
34
+ command.concat(%w[--format progress]) # Keep default formatter for console.
33
35
  end
34
36
 
35
37
  command.concat(['--format', 'json', '--out', json_file_path])
@@ -38,6 +40,10 @@ module Guard
38
40
  command.concat(paths)
39
41
  end
40
42
 
43
+ def should_add_default_formatter_for_console?
44
+ !@options[:hide_stdout] && !include_formatter_for_console?(args_specified_by_user)
45
+ end
46
+
41
47
  def args_specified_by_user
42
48
  @args_specified_by_user ||= begin
43
49
  args = @options[:cli]
@@ -45,7 +51,7 @@ module Guard
45
51
  when Array then args
46
52
  when String then args.shellsplit
47
53
  when NilClass then []
48
- else fail ':cli option must be either an array or string'
54
+ else raise ArgumentError, ':cli option must be either an array or string'
49
55
  end
50
56
  end
51
57
  end
@@ -74,11 +80,9 @@ module Guard
74
80
  end
75
81
 
76
82
  def result
77
- @result ||= begin
78
- File.open(json_file_path) do |file|
79
- # Rubinius 2.0.0.rc1 does not support `JSON.load` with 3 args.
80
- JSON.parse(file.read, symbolize_names: true)
81
- end
83
+ @result ||= File.open(json_file_path) do |file|
84
+ # Rubinius 2.0.0.rc1 does not support `JSON.load` with 3 args.
85
+ JSON.parse(file.read, symbolize_names: true)
82
86
  end
83
87
  end
84
88
 
@@ -109,19 +113,26 @@ module Guard
109
113
  end
110
114
 
111
115
  def pluralize(number, thing, options = {})
112
- text = ''
113
-
114
- if number == 0 && options[:no_for_zero]
115
- text = 'no'
116
- else
117
- text << number.to_s
118
- end
116
+ text =
117
+ if number.zero? && options[:no_for_zero]
118
+ +'no'
119
+ else
120
+ number.to_s
121
+ end
119
122
 
120
123
  text << " #{thing}"
121
124
  text << 's' unless number == 1
122
125
 
123
126
  text
124
127
  end
128
+
129
+ def open_launchy_if_needed
130
+ return unless (output_path = @options[:launchy])
131
+ return unless File.exist?(output_path)
132
+
133
+ require 'launchy'
134
+ ::Launchy.open(output_path)
135
+ end
125
136
  end
126
137
  end
127
138
  end
@@ -1,4 +1,4 @@
1
1
  guard :rubocop do
2
2
  watch(%r{.+\.rb$})
3
- watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
3
+ watch(%r{(?:.+/)?\.rubocop(?:_todo)?\.yml$}) { |m| File.dirname(m[0]) }
4
4
  end
@@ -1,16 +1,14 @@
1
- # coding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
- module Guard
4
- # A workaround for declaring `class Rubocop`
5
- # before `class Rubocop < Guard` in rubocop.rb
6
- module RubocopVersion
7
- # http://semver.org/
8
- MAJOR = 1
9
- MINOR = 1
10
- PATCH = 0
3
+ # A workaround for declaring `class RuboCop`
4
+ # before `class RuboCop < Guard` in rubocop.rb
5
+ module GuardRuboCopVersion
6
+ # http://semver.org/
7
+ MAJOR = 1
8
+ MINOR = 5
9
+ PATCH = 0
11
10
 
12
- def self.to_s
13
- [MAJOR, MINOR, PATCH].join('.')
14
- end
11
+ def self.to_s
12
+ [MAJOR, MINOR, PATCH].join('.')
15
13
  end
16
14
  end
data/lib/guard/rubocop.rb CHANGED
@@ -1,12 +1,12 @@
1
- # coding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  require 'guard'
4
4
  require 'guard/plugin'
5
5
 
6
6
  module Guard
7
- # This class gets API calls from `guard` and runs `rubocop` command via {Guard::Rubocop::Runner}.
7
+ # This class gets API calls from `guard` and runs `rubocop` command via {Guard::RuboCop::Runner}.
8
8
  # An instance of this class stays alive in a `guard` command session.
9
- class Rubocop < Plugin
9
+ class RuboCop < Plugin
10
10
  autoload :Runner, 'guard/rubocop/runner'
11
11
 
12
12
  attr_reader :options, :failed_paths
@@ -16,9 +16,10 @@ module Guard
16
16
 
17
17
  @options = {
18
18
  all_on_start: true,
19
- keep_failed: true,
19
+ keep_failed: true,
20
20
  notification: :failed,
21
- cli: nil
21
+ cli: nil,
22
+ hide_stdout: false
22
23
  }.merge(options)
23
24
 
24
25
  @failed_paths = []
@@ -64,7 +65,7 @@ module Guard
64
65
  passed = runner.run(paths)
65
66
  @failed_paths = runner.failed_paths
66
67
  throw :task_has_failed unless passed
67
- rescue => error
68
+ rescue StandardError => error
68
69
  UI.error 'The following exception occurred while running guard-rubocop: ' \
69
70
  "#{error.backtrace.first} #{error.message} (#{error.class.name})"
70
71
  end
@@ -75,6 +76,7 @@ module Guard
75
76
  paths.uniq!
76
77
  paths.reject! do |path|
77
78
  next true unless File.exist?(path)
79
+
78
80
  included_in_other_path?(path, paths)
79
81
  end
80
82
  paths
@@ -1,9 +1,9 @@
1
- # coding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
- require 'spec_helper.rb'
3
+ require 'launchy'
4
4
 
5
- describe Guard::Rubocop::Runner do
6
- subject(:runner) { Guard::Rubocop::Runner.new(options) }
5
+ RSpec.describe Guard::RuboCop::Runner do
6
+ subject(:runner) { Guard::RuboCop::Runner.new(options) }
7
7
  let(:options) { {} }
8
8
 
9
9
  describe '#run' do
@@ -77,43 +77,94 @@ describe Guard::Rubocop::Runner do
77
77
 
78
78
  context 'when :notification option is true' do
79
79
  let(:options) { { notification: true } }
80
- include_examples 'notification', { passed: true, failed: true }
80
+ include_examples 'notification', passed: true, failed: true
81
81
  end
82
82
 
83
83
  context 'when :notification option is :failed' do
84
84
  let(:options) { { notification: :failed } }
85
- include_examples 'notification', { passed: false, failed: true }
85
+ include_examples 'notification', passed: false, failed: true
86
86
  end
87
87
 
88
88
  context 'when :notification option is false' do
89
89
  let(:options) { { notification: false } }
90
- include_examples 'notification', { passed: false, failed: false }
90
+ include_examples 'notification', passed: false, failed: false
91
+ end
92
+
93
+ context 'when :launchy option is present' do
94
+ let(:options) { { launchy: 'launchy_path' } }
95
+
96
+ before do
97
+ allow(File).to receive(:exist?).with('launchy_path').and_return(true)
98
+ end
99
+
100
+ it 'opens Launchy' do
101
+ expect(Launchy).to receive(:open).with('launchy_path')
102
+ runner.run(paths)
103
+ end
91
104
  end
92
105
  end
93
106
 
94
107
  describe '#build_command' do
95
108
  subject(:build_command) { runner.build_command(paths) }
96
- let(:options) { { cli: %w(--debug --rails) } }
97
- let(:paths) { %w(file1.rb file2.rb) }
109
+ let(:options) { { cli: %w[--debug --rails] } }
110
+ let(:paths) { %w[file1.rb file2.rb] }
98
111
 
99
- context 'when :cli option includes formatter for console' do
100
- let(:options) { { cli: %w(--format simple) } }
112
+ describe ':cmd option' do
113
+ context 'when set' do
114
+ let(:options) { { cmd: 'bin/rubocop' } }
115
+
116
+ it 'uses the supplied :cmd' do
117
+ expect(build_command[0]).to eq('bin/rubocop')
118
+ end
119
+ end
101
120
 
102
- it 'does not add args for the default formatter for console' do
103
- expect(build_command[0..2]).not_to eq(%w(rubocop --format progress))
121
+ context 'when not set' do
122
+ it 'uses the default command' do
123
+ expect(build_command[0]).to eq('rubocop')
124
+ end
104
125
  end
105
126
  end
106
127
 
107
- context 'when :cli option does not include formatter for console' do
108
- let(:options) { { cli: %w(--format simple --out simple.txt) } }
128
+ context 'when :hide_stdout is not set' do
129
+ context 'and :cli option includes formatter for console' do
130
+ before { options[:cli] = %w[--format simple] }
109
131
 
110
- it 'adds args for the default formatter for console' do
111
- expect(build_command[0..2]).to eq(%w(rubocop --format progress))
132
+ it 'does not add args for the default formatter for console' do
133
+ expect(build_command[0..2]).not_to eq(%w[rubocop --format progress])
134
+ end
135
+ end
136
+
137
+ context 'and :cli option does not include formatter for console' do
138
+ before { options[:cli] = %w[--format simple --out simple.txt] }
139
+
140
+ it 'adds args for the default formatter for console' do
141
+ expect(build_command[0..2]).to eq(%w[rubocop --format progress])
142
+ end
143
+ end
144
+ end
145
+
146
+ context 'when :hide_stdout is set' do
147
+ before { options[:hide_stdout] = true }
148
+
149
+ context 'and :cli option includes formatter for console' do
150
+ before { options[:cli] = %w[--format simple] }
151
+
152
+ it 'does not add args for the default formatter for console' do
153
+ expect(build_command[0..2]).not_to eq(%w[rubocop --format progress])
154
+ end
155
+ end
156
+
157
+ context 'and :cli option does not include formatter for console' do
158
+ before { options[:cli] = %w[--format simple --out simple.txt] }
159
+
160
+ it 'does not add args for the default formatter for console' do
161
+ expect(build_command[0..2]).not_to eq(%w[rubocop --format progress])
162
+ end
112
163
  end
113
164
  end
114
165
 
115
166
  it 'adds args for JSON formatter' do
116
- expect(build_command[3..4]).to eq(%w(--format json))
167
+ expect(build_command[3..4]).to eq(%w[--format json])
117
168
  end
118
169
 
119
170
  it 'adds args for output file path of JSON formatter' do
@@ -126,11 +177,11 @@ describe Guard::Rubocop::Runner do
126
177
  end
127
178
 
128
179
  it 'adds args specified by user' do
129
- expect(build_command[8..9]).to eq(%w(--debug --rails))
180
+ expect(build_command[8..9]).to eq(%w[--debug --rails])
130
181
  end
131
182
 
132
183
  it 'adds the passed paths' do
133
- expect(build_command[10..-1]).to eq(%w(file1.rb file2.rb))
184
+ expect(build_command[10..-1]).to eq(%w[file1.rb file2.rb])
134
185
  end
135
186
  end
136
187
 
@@ -163,7 +214,7 @@ describe Guard::Rubocop::Runner do
163
214
  let(:options) { { cli: { key: 'value' } } }
164
215
 
165
216
  it 'raises error' do
166
- expect { runner.args_specified_by_user }.to raise_error
217
+ expect { runner.args_specified_by_user }.to raise_error(ArgumentError)
167
218
  end
168
219
  end
169
220
  end
@@ -173,7 +224,7 @@ describe Guard::Rubocop::Runner do
173
224
 
174
225
  context 'when the passed args include a -f/--format' do
175
226
  context 'but does not include an -o/--output' do
176
- let(:args) { %w(--format simple --debug) }
227
+ let(:args) { %w[--format simple --debug] }
177
228
 
178
229
  it 'returns true' do
179
230
  expect(include_formatter_for_console?).to be_truthy
@@ -181,7 +232,7 @@ describe Guard::Rubocop::Runner do
181
232
  end
182
233
 
183
234
  context 'and include an -o/--output just after the -f/--format' do
184
- let(:args) { %w(--format simple --out simple.txt) }
235
+ let(:args) { %w[--format simple --out simple.txt] }
185
236
 
186
237
  it 'returns false' do
187
238
  expect(include_formatter_for_console?).to be_falsey
@@ -189,7 +240,7 @@ describe Guard::Rubocop::Runner do
189
240
  end
190
241
 
191
242
  context 'and include an -o/--output after the -f/--format across another arg' do
192
- let(:args) { %w(--format simple --debug --out simple.txt) }
243
+ let(:args) { %w[--format simple --debug --out simple.txt] }
193
244
 
194
245
  it 'returns false' do
195
246
  expect(include_formatter_for_console?).to be_falsey
@@ -199,7 +250,7 @@ describe Guard::Rubocop::Runner do
199
250
 
200
251
  context 'when the passed args include a -f with its arg without separator' do
201
252
  context 'but does not include an -o/--output' do
202
- let(:args) { %w(-fs --debug) }
253
+ let(:args) { %w[-fs --debug] }
203
254
 
204
255
  it 'returns true' do
205
256
  expect(include_formatter_for_console?).to be_truthy
@@ -207,7 +258,7 @@ describe Guard::Rubocop::Runner do
207
258
  end
208
259
 
209
260
  context 'and include an -o with its arg without separator just after the -f/--format' do
210
- let(:args) { %w(-fs -osimple.txt) }
261
+ let(:args) { %w[-fs -osimple.txt] }
211
262
 
212
263
  it 'returns false' do
213
264
  expect(include_formatter_for_console?).to be_falsey
@@ -217,7 +268,7 @@ describe Guard::Rubocop::Runner do
217
268
 
218
269
  context 'when the passed args include multiple -f/--format' do
219
270
  context 'and all -f/--format have associated -o/--out' do
220
- let(:args) { %w(--format simple --out simple.txt --format emacs --out emacs.txt) }
271
+ let(:args) { %w[--format simple --out simple.txt --format emacs --out emacs.txt] }
221
272
 
222
273
  it 'returns false' do
223
274
  expect(include_formatter_for_console?).to be_falsey
@@ -225,7 +276,7 @@ describe Guard::Rubocop::Runner do
225
276
  end
226
277
 
227
278
  context 'and any -f/--format has associated -o/--out' do
228
- let(:args) { %w(--format simple --format emacs --out emacs.txt) }
279
+ let(:args) { %w[--format simple --format emacs --out emacs.txt] }
229
280
 
230
281
  it 'returns true' do
231
282
  expect(include_formatter_for_console?).to be_truthy
@@ -233,7 +284,7 @@ describe Guard::Rubocop::Runner do
233
284
  end
234
285
 
235
286
  context 'and no -f/--format has associated -o/--out' do
236
- let(:args) { %w(--format simple --format emacs) }
287
+ let(:args) { %w[--format simple --format emacs] }
237
288
 
238
289
  it 'returns true' do
239
290
  expect(include_formatter_for_console?).to be_truthy
@@ -242,7 +293,7 @@ describe Guard::Rubocop::Runner do
242
293
  end
243
294
 
244
295
  context 'when the passed args do not include -f/--format' do
245
- let(:args) { %w(--debug) }
296
+ let(:args) { %w[--debug] }
246
297
 
247
298
  it 'returns false' do
248
299
  expect(include_formatter_for_console?).to be_falsey
@@ -312,12 +363,10 @@ describe Guard::Rubocop::Runner do
312
363
  describe '#notify' do
313
364
  before do
314
365
  allow(runner).to receive(:result).and_return(
315
- {
316
- summary: {
317
- offense_count: 4,
318
- target_file_count: 3,
319
- inspected_file_count: 2
320
- }
366
+ summary: {
367
+ offense_count: 4,
368
+ target_file_count: 3,
369
+ inspected_file_count: 2
321
370
  }
322
371
  )
323
372
  end
@@ -358,12 +407,10 @@ describe Guard::Rubocop::Runner do
358
407
  describe '#summary_text' do
359
408
  before do
360
409
  allow(runner).to receive(:result).and_return(
361
- {
362
- summary: {
363
- offense_count: offense_count,
364
- target_file_count: target_file_count,
365
- inspected_file_count: inspected_file_count
366
- }
410
+ summary: {
411
+ offense_count: offense_count,
412
+ target_file_count: target_file_count,
413
+ inspected_file_count: inspected_file_count
367
414
  }
368
415
  )
369
416
  end
@@ -419,12 +466,10 @@ describe Guard::Rubocop::Runner do
419
466
  context 'with spelling "offence" in old RuboCop' do
420
467
  before do
421
468
  allow(runner).to receive(:result).and_return(
422
- {
423
- summary: {
424
- offence_count: 2,
425
- target_file_count: 1,
426
- inspected_file_count: 1
427
- }
469
+ summary: {
470
+ offence_count: 2,
471
+ target_file_count: 1,
472
+ inspected_file_count: 1
428
473
  }
429
474
  )
430
475
  end
@@ -1,9 +1,7 @@
1
- # coding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
- require 'spec_helper.rb'
4
-
5
- describe Guard::Rubocop, :silence_output do
6
- subject(:guard) { Guard::Rubocop.new(options) }
3
+ RSpec.describe Guard::RuboCop, :silence_output do
4
+ subject(:guard) { Guard::RuboCop.new(options) }
7
5
  let(:options) { {} }
8
6
 
9
7
  describe '#options' do
@@ -57,13 +55,13 @@ describe Guard::Rubocop, :silence_output do
57
55
  shared_examples 'processes after running', :processes_after_running do
58
56
  context 'when passed' do
59
57
  it 'throws nothing' do
60
- allow_any_instance_of(Guard::Rubocop::Runner).to receive(:run).and_return(true)
58
+ allow_any_instance_of(Guard::RuboCop::Runner).to receive(:run).and_return(true)
61
59
  expect { subject }.not_to throw_symbol
62
60
  end
63
61
 
64
62
  it 'clears failed paths' do
65
- allow_any_instance_of(Guard::Rubocop::Runner).to receive(:run).and_return(true)
66
- allow_any_instance_of(Guard::Rubocop::Runner).to receive(:failed_paths).and_return([])
63
+ allow_any_instance_of(Guard::RuboCop::Runner).to receive(:run).and_return(true)
64
+ allow_any_instance_of(Guard::RuboCop::Runner).to receive(:failed_paths).and_return([])
67
65
  subject
68
66
  expect(guard.failed_paths).to be_empty
69
67
  end
@@ -71,7 +69,7 @@ describe Guard::Rubocop, :silence_output do
71
69
 
72
70
  context 'when failed' do
73
71
  it 'throws symbol :task_has_failed' do
74
- allow_any_instance_of(Guard::Rubocop::Runner).to receive(:run).and_return(false)
72
+ allow_any_instance_of(Guard::RuboCop::Runner).to receive(:run).and_return(false)
75
73
  expect { subject }.to throw_symbol(:task_has_failed)
76
74
  end
77
75
 
@@ -81,8 +79,8 @@ describe Guard::Rubocop, :silence_output do
81
79
  'some_failed_file.rb',
82
80
  'dir/another_failed_file.rb'
83
81
  ]
84
- allow_any_instance_of(Guard::Rubocop::Runner).to receive(:run).and_return(false)
85
- allow_any_instance_of(Guard::Rubocop::Runner)
82
+ allow_any_instance_of(Guard::RuboCop::Runner).to receive(:run).and_return(false)
83
+ allow_any_instance_of(Guard::RuboCop::Runner)
86
84
  .to receive(:failed_paths).and_return(failed_paths)
87
85
  subject
88
86
  expect(guard.failed_paths).to eq(failed_paths)
@@ -91,7 +89,7 @@ describe Guard::Rubocop, :silence_output do
91
89
 
92
90
  context 'when an exception is raised' do
93
91
  it 'prevents itself from firing' do
94
- allow_any_instance_of(Guard::Rubocop::Runner).to receive(:run).and_raise(RuntimeError)
92
+ allow_any_instance_of(Guard::RuboCop::Runner).to receive(:run).and_raise(RuntimeError)
95
93
  expect { subject }.not_to raise_error
96
94
  end
97
95
  end
@@ -101,17 +99,17 @@ describe Guard::Rubocop, :silence_output do
101
99
  subject { super().run_all }
102
100
 
103
101
  before do
104
- allow_any_instance_of(Guard::Rubocop::Runner).to receive(:run).and_return(true)
105
- allow_any_instance_of(Guard::Rubocop::Runner).to receive(:failed_paths).and_return([])
102
+ allow_any_instance_of(Guard::RuboCop::Runner).to receive(:run).and_return(true)
103
+ allow_any_instance_of(Guard::RuboCop::Runner).to receive(:failed_paths).and_return([])
106
104
  end
107
105
 
108
106
  it 'inspects all files with rubocop' do
109
- expect_any_instance_of(Guard::Rubocop::Runner).to receive(:run).with([])
107
+ expect_any_instance_of(Guard::RuboCop::Runner).to receive(:run).with([])
110
108
  guard.run_all
111
109
  end
112
110
  end
113
111
 
114
- [:run_on_additions, :run_on_modifications].each do |method|
112
+ %i[run_on_additions run_on_modifications].each do |method|
115
113
  describe "##{method}", :processes_after_running do
116
114
  subject { super().send(method, changed_paths) }
117
115
  let(:changed_paths) do
@@ -122,17 +120,17 @@ describe Guard::Rubocop, :silence_output do
122
120
  end
123
121
 
124
122
  before do
125
- allow_any_instance_of(Guard::Rubocop::Runner).to receive(:run).and_return(true)
126
- allow_any_instance_of(Guard::Rubocop::Runner).to receive(:failed_paths).and_return([])
123
+ allow_any_instance_of(Guard::RuboCop::Runner).to receive(:run).and_return(true)
124
+ allow_any_instance_of(Guard::RuboCop::Runner).to receive(:failed_paths).and_return([])
127
125
  end
128
126
 
129
127
  it 'inspects changed files with rubocop' do
130
- expect_any_instance_of(Guard::Rubocop::Runner).to receive(:run)
128
+ expect_any_instance_of(Guard::RuboCop::Runner).to receive(:run)
131
129
  subject
132
130
  end
133
131
 
134
132
  it 'passes cleaned paths to rubocop' do
135
- expect_any_instance_of(Guard::Rubocop::Runner).to receive(:run) do |_instance, paths|
133
+ expect_any_instance_of(Guard::RuboCop::Runner).to receive(:run) do |_instance, paths|
136
134
  expect(paths).to eq([
137
135
  File.expand_path('lib/guard/rubocop.rb'),
138
136
  File.expand_path('spec/spec_helper.rb')
@@ -147,7 +145,7 @@ describe Guard::Rubocop, :silence_output do
147
145
  end
148
146
 
149
147
  it 'does nothing' do
150
- expect_any_instance_of(Guard::Rubocop::Runner).not_to receive(:run)
148
+ expect_any_instance_of(Guard::RuboCop::Runner).not_to receive(:run)
151
149
  subject
152
150
  end
153
151
  end
@@ -159,7 +157,7 @@ describe Guard::Rubocop, :silence_output do
159
157
 
160
158
  it 'also inspects paths which are failed last time' do
161
159
  guard.failed_paths << failed_path
162
- expect_any_instance_of(Guard::Rubocop::Runner).to receive(:run) do |_instance, paths|
160
+ expect_any_instance_of(Guard::RuboCop::Runner).to receive(:run) do |_instance, paths|
163
161
  expect(paths).to include failed_path
164
162
  end
165
163
  subject
@@ -171,7 +169,7 @@ describe Guard::Rubocop, :silence_output do
171
169
 
172
170
  it 'inspects just changed paths' do
173
171
  guard.failed_paths << failed_path
174
- expect_any_instance_of(Guard::Rubocop::Runner).to receive(:run) do |_instance, paths|
172
+ expect_any_instance_of(Guard::RuboCop::Runner).to receive(:run) do |_instance, paths|
175
173
  expect(paths).to eq([
176
174
  File.expand_path('lib/guard/rubocop.rb'),
177
175
  File.expand_path('spec/spec_helper.rb')
data/spec/spec_helper.rb CHANGED
@@ -1,33 +1,33 @@
1
- # coding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  RSpec.configure do |config|
4
- config.expect_with :rspec do |c|
5
- c.syntax = :expect
4
+ config.expect_with :rspec do |expectations|
5
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
6
6
  end
7
7
 
8
- config.mock_with :rspec do |c|
9
- c.syntax = :expect
8
+ config.mock_with :rspec do |mocks|
9
+ mocks.verify_partial_doubles = true
10
10
  end
11
- end
12
11
 
13
- Dir[File.join(File.dirname(__FILE__), 'support', '*')].each do |path|
14
- require path
15
- end
12
+ config.filter_run_when_matching :focus
13
+
14
+ config.example_status_persistence_file_path = 'spec/examples.txt'
16
15
 
17
- require 'simplecov'
18
- SimpleCov.coverage_dir(File.join('spec', 'coverage'))
16
+ config.disable_monkey_patching!
19
17
 
20
- if ENV['TRAVIS']
21
- require 'coveralls'
22
- SimpleCov.formatter = Coveralls::SimpleCov::Formatter
23
- elsif ENV['CI']
24
- require 'simplecov-rcov'
25
- SimpleCov.formatter = SimpleCov::Formatter::RcovFormatter
18
+ config.default_formatter = 'doc' if config.files_to_run.one?
19
+
20
+ config.order = :random
21
+
22
+ Kernel.srand config.seed
26
23
  end
27
24
 
28
- SimpleCov.start do
29
- add_filter '/spec/'
30
- add_filter '/vendor/bundle/'
25
+ Dir[File.join(File.dirname(__FILE__), 'support', '*')].sort.each do |path|
26
+ require path
31
27
  end
32
28
 
29
+ # Initialize Guard for running tests.
30
+ require 'guard'
31
+ Guard.setup(notify: false)
32
+
33
33
  require 'guard/rubocop'
@@ -1,6 +1,6 @@
1
- # coding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
- shared_context 'silence output', silence_output: true do
3
+ RSpec.shared_context 'silence output', :silence_output do
4
4
  null_object = BasicObject.new
5
5
 
6
6
  class << null_object
@@ -9,6 +9,10 @@ shared_context 'silence output', silence_output: true do
9
9
  true
10
10
  end
11
11
 
12
+ def respond_to_missing?(*)
13
+ true
14
+ end
15
+
12
16
  def method_missing(*)
13
17
  end
14
18
  end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'simplecov'
4
+
5
+ if ENV['CI']
6
+ require 'simplecov-lcov'
7
+
8
+ SimpleCov::Formatter::LcovFormatter.config do |config|
9
+ config.report_with_single_file = true
10
+ config.single_report_path = 'coverage/lcov.info'
11
+ end
12
+
13
+ SimpleCov.formatter = SimpleCov::Formatter::LcovFormatter
14
+ end
15
+
16
+ SimpleCov.start do
17
+ add_filter '/spec/'
18
+ add_filter '/vendor/bundle/'
19
+ 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.1.0
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuji Nakayama
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-13 00:00:00.000000000 Z
11
+ date: 2021-08-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: guard
@@ -28,107 +28,107 @@ dependencies:
28
28
  name: rubocop
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - "<"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.20'
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: '0.20'
40
+ version: '2.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '1.3'
47
+ version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '1.3'
54
+ version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: rake
56
+ name: guard-rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: 4.2.3
62
+ - - "<"
60
63
  - !ruby/object:Gem::Version
61
- version: '10.0'
64
+ version: '5.0'
62
65
  type: :development
63
66
  prerelease: false
64
67
  version_requirements: !ruby/object:Gem::Requirement
65
68
  requirements:
66
- - - "~>"
69
+ - - ">="
67
70
  - !ruby/object:Gem::Version
68
- version: '10.0'
71
+ version: 4.2.3
72
+ - - "<"
73
+ - !ruby/object:Gem::Version
74
+ version: '5.0'
69
75
  - !ruby/object:Gem::Dependency
70
- name: rspec
76
+ name: launchy
71
77
  requirement: !ruby/object:Gem::Requirement
72
78
  requirements:
73
79
  - - "~>"
74
80
  - !ruby/object:Gem::Version
75
- version: 3.0.0.beta1
81
+ version: '2.4'
76
82
  type: :development
77
83
  prerelease: false
78
84
  version_requirements: !ruby/object:Gem::Requirement
79
85
  requirements:
80
86
  - - "~>"
81
87
  - !ruby/object:Gem::Version
82
- version: 3.0.0.beta1
88
+ version: '2.4'
83
89
  - !ruby/object:Gem::Dependency
84
- name: simplecov
90
+ name: rake
85
91
  requirement: !ruby/object:Gem::Requirement
86
92
  requirements:
87
- - - "~>"
93
+ - - ">="
88
94
  - !ruby/object:Gem::Version
89
- version: '0.7'
95
+ version: '12.0'
90
96
  type: :development
91
97
  prerelease: false
92
98
  version_requirements: !ruby/object:Gem::Requirement
93
99
  requirements:
94
- - - "~>"
100
+ - - ">="
95
101
  - !ruby/object:Gem::Version
96
- version: '0.7'
102
+ version: '12.0'
97
103
  - !ruby/object:Gem::Dependency
98
- name: guard-rspec
104
+ name: rspec
99
105
  requirement: !ruby/object:Gem::Requirement
100
106
  requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- version: 4.2.3
104
- - - "<"
107
+ - - "~>"
105
108
  - !ruby/object:Gem::Version
106
- version: '5.0'
109
+ version: '3.0'
107
110
  type: :development
108
111
  prerelease: false
109
112
  version_requirements: !ruby/object:Gem::Requirement
110
113
  requirements:
111
- - - ">="
112
- - !ruby/object:Gem::Version
113
- version: 4.2.3
114
- - - "<"
114
+ - - "~>"
115
115
  - !ruby/object:Gem::Version
116
- version: '5.0'
116
+ version: '3.0'
117
117
  - !ruby/object:Gem::Dependency
118
- name: ruby_gntp
118
+ name: simplecov
119
119
  requirement: !ruby/object:Gem::Requirement
120
120
  requirements:
121
121
  - - "~>"
122
122
  - !ruby/object:Gem::Version
123
- version: '0.3'
123
+ version: '0.7'
124
124
  type: :development
125
125
  prerelease: false
126
126
  version_requirements: !ruby/object:Gem::Requirement
127
127
  requirements:
128
128
  - - "~>"
129
129
  - !ruby/object:Gem::Version
130
- version: '0.3'
131
- description: Guard::Rubocop automatically checks Ruby code style with RuboCop when
130
+ version: '0.7'
131
+ description: Guard::RuboCop automatically checks Ruby code style with RuboCop when
132
132
  files are modified.
133
133
  email:
134
134
  - nkymyj@gmail.com
@@ -136,9 +136,11 @@ executables: []
136
136
  extensions: []
137
137
  extra_rdoc_files: []
138
138
  files:
139
+ - ".github/workflows/ci.yml"
139
140
  - ".gitignore"
141
+ - ".rspec"
140
142
  - ".rubocop.yml"
141
- - ".travis.yml"
143
+ - ".rubocop_todo.yml"
142
144
  - ".yardopts"
143
145
  - CHANGELOG.md
144
146
  - Gemfile
@@ -151,16 +153,16 @@ files:
151
153
  - lib/guard/rubocop/runner.rb
152
154
  - lib/guard/rubocop/templates/Guardfile
153
155
  - lib/guard/rubocop/version.rb
154
- - spec/.rubocop.yml
155
156
  - spec/guard/rubocop/runner_spec.rb
156
157
  - spec/guard/rubocop_spec.rb
157
158
  - spec/spec_helper.rb
158
159
  - spec/support/silence_output.rb
159
- homepage: https://github.com/yujinakayama/guard-rubocop
160
+ - spec/support/simplecov.rb
161
+ homepage: https://github.com/rubocop/guard-rubocop
160
162
  licenses:
161
163
  - MIT
162
164
  metadata: {}
163
- post_install_message:
165
+ post_install_message:
164
166
  rdoc_options: []
165
167
  require_paths:
166
168
  - lib
@@ -168,22 +170,21 @@ required_ruby_version: !ruby/object:Gem::Requirement
168
170
  requirements:
169
171
  - - ">="
170
172
  - !ruby/object:Gem::Version
171
- version: '0'
173
+ version: '2.5'
172
174
  required_rubygems_version: !ruby/object:Gem::Requirement
173
175
  requirements:
174
176
  - - ">="
175
177
  - !ruby/object:Gem::Version
176
178
  version: '0'
177
179
  requirements: []
178
- rubyforge_project:
179
- rubygems_version: 2.2.2
180
- signing_key:
180
+ rubyforge_project:
181
+ rubygems_version: 2.7.6.3
182
+ signing_key:
181
183
  specification_version: 4
182
184
  summary: Guard plugin for RuboCop
183
185
  test_files:
184
- - spec/.rubocop.yml
185
186
  - spec/guard/rubocop/runner_spec.rb
186
187
  - spec/guard/rubocop_spec.rb
187
188
  - spec/spec_helper.rb
188
189
  - spec/support/silence_output.rb
189
- has_rdoc:
190
+ - spec/support/simplecov.rb
data/.travis.yml DELETED
@@ -1,10 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 1.9.3
4
- - 2.0.0
5
- - 2.1.0
6
- - jruby-19mode
7
- - rbx
8
- script:
9
- - bundle exec rspec
10
- - bundle exec rubocop
data/spec/.rubocop.yml DELETED
@@ -1,5 +0,0 @@
1
- inherit_from: ../.rubocop.yml
2
-
3
- # Sometimes I want to indicate that “This is a hash” explicitly with #and_return.
4
- BracesAroundHashParameters:
5
- Enabled: false