rubocop_runner 2.0.1 → 2.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: a492ee2b4a83e2b0e2f46c4e09e40e8c05244695
4
- data.tar.gz: bb94e192b2be4636c354462573e004fcb73830a9
3
+ metadata.gz: 6496eae0006789063c795fdb605512ea77a818f7
4
+ data.tar.gz: ad9196ee1bcb21cce83302616a0e697cacc65ca9
5
5
  SHA512:
6
- metadata.gz: e2dbcc328b443101307ded35d1540d548d9d05f93bafe7e53c1a410b9e4701390f9ae490108f478bdc9922c1517892bc1ce7c32674bae0e716c9faff401359fa
7
- data.tar.gz: f9400980a9f1a1d5f3d657e5a969f8238a69668fb3b197b9a26624b2798391b0d65ca3d0df77356823d691a39b6b21d4635812d1739afa811e83c3001dae2836
6
+ metadata.gz: c1bc3c7d665d73db37cd303bca169baf5136dbf4c3d92f29a958611e775004a0669de1090ac803480c82e6a60ba27ca5b84649b0e20ea591c69b3d7f4b06f01c
7
+ data.tar.gz: 105b51b7973490909180f69aa17224429c30af58cc408504e1e0707e2c9696c3a54e268df985057dd1ac04fbd551ce346a9462e22a08361b5c1682bfb129363a
data/CHANGELOG.md ADDED
@@ -0,0 +1,17 @@
1
+ Changelog
2
+ ===
3
+
4
+
5
+ master
6
+ ---
7
+
8
+
9
+ 2.1.0
10
+ ---
11
+
12
+ - package rake task within gem [#2](https://github.com/runtastic/rubocop_runner/pull/2)
13
+
14
+ 2.0.1
15
+ ---
16
+
17
+ - initial open source release
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # RubocopRunner
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/rubocop_runner.svg)](https://badge.fury.io/rb/rubocop_runner)
4
+
3
5
  This gem provides means of running rubocop including auto-correct on all files
4
6
  which are currently staged in git. This can be easily used as pre-commit hook
5
7
  with the included template.
@@ -8,7 +10,7 @@ If rubocop can fix all detected issues itself via autocorrect it will will do
8
10
  so. The commit will abort in this situation.
9
11
  In case rubocop accepts all code changes the commit continues.
10
12
 
11
- _Although this gem has no tests it's pretty battle tested and is in use internally since years._
13
+ _Although this gem has no tests it's pretty battle tested and is in use at runtastic since years._
12
14
 
13
15
  ## Installation
14
16
 
@@ -32,33 +34,25 @@ To create a rubocop runner pre-commit hook once just run
32
34
  ruby -rrubocop_runner -e "RubocopRunner.install"
33
35
  ```
34
36
 
35
- To make it easy for every developer on the project you can also add the following rake task
37
+ To make it easy for every developer on the project you can also add this to your
38
+ `Rakefile`:
36
39
 
37
40
  ```ruby
38
- begin
39
- require 'rubocop/rake_task'
40
- RuboCop::RakeTask.new
41
- namespace :rubocop do
42
- desc 'Install Rubocop as pre-commit hook'
43
- task :install do
44
- require 'rubocop_runner'
45
- RubocopRunner.install
46
- end
47
- end
48
- rescue LoadError
49
- p 'rubocop not installed'
50
- end
41
+ require 'rubocop_runner/rake_task'
42
+ RubocopRunner::RakeTask.new
51
43
  ```
52
44
 
45
+ Afterwards, just run the `rake rubocop:install` task to install the pre-commit
46
+ hook.
47
+
53
48
  ## ToDo
54
49
 
55
- - add the install rake task itself to the gem
56
50
  - add tests
57
51
  - improve gem structure
58
52
 
59
53
  ## Development
60
54
 
61
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
55
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
62
56
 
63
57
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
64
58
 
@@ -90,5 +90,6 @@ module RubocopRunner
90
90
  'pre-commit')
91
91
  FileUtils.cp(pre_commit_template_path, pre_commit_path)
92
92
  FileUtils.chmod('+x', pre_commit_path)
93
+ puts 'RubocopRunner installed!'
93
94
  end
94
95
  end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'rake'
4
+ require 'rake/tasklib'
5
+
6
+ module RubocopRunner
7
+ # Provides a custom rake task.
8
+ #
9
+ # require "rubocop_runner/rake_task"
10
+ # RubocopRunner::RakeTask.new
11
+ class RakeTask < Rake::TaskLib
12
+ def initialize(name = 'rubocop:install')
13
+ require 'rubocop/rake_task'
14
+ RuboCop::RakeTask.new
15
+
16
+ desc 'Install Rubocop as pre-commit hook'
17
+ task(name) do
18
+ require 'rubocop_runner'
19
+ RubocopRunner.install
20
+ end
21
+ rescue LoadError
22
+ warn 'rubocop_runner install task disabled due to rubocop not being '\
23
+ 'installed'
24
+ end
25
+ end
26
+ end
@@ -1,3 +1,3 @@
1
1
  module RubocopRunner
2
- VERSION = '2.0.1'.freeze
2
+ VERSION = '2.1.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop_runner
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andreas Eger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-10 00:00:00.000000000 Z
11
+ date: 2018-01-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -80,6 +80,7 @@ extra_rdoc_files: []
80
80
  files:
81
81
  - ".gitignore"
82
82
  - ".rubocop.yml"
83
+ - CHANGELOG.md
83
84
  - Gemfile
84
85
  - LICENSE.txt
85
86
  - README.md
@@ -87,6 +88,7 @@ files:
87
88
  - bin/console
88
89
  - bin/setup
89
90
  - lib/rubocop_runner.rb
91
+ - lib/rubocop_runner/rake_task.rb
90
92
  - lib/rubocop_runner/version.rb
91
93
  - lib/template/pre-commit
92
94
  - rubocop_runner.gemspec
@@ -110,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
110
112
  version: '0'
111
113
  requirements: []
112
114
  rubyforge_project:
113
- rubygems_version: 2.5.2
115
+ rubygems_version: 2.6.13
114
116
  signing_key:
115
117
  specification_version: 4
116
118
  summary: runs rubocop for all changed files