Skip to content

Commit b13a11d

Browse files
committed
bump version
- including rubocop autocleanup - add changelog
1 parent 99d1e53 commit b13a11d

File tree

9 files changed

+30
-10
lines changed

9 files changed

+30
-10
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ Changelog
55
master
66
---
77

8+
2.2.0
9+
---
10+
11+
- also inspect `.rake` files
12+
- readme format changes
813

914
2.1.0
1015
---

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
# frozen_string_literal: true
2+
13
source 'https://rubygems.org'
24
gemspec

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2018 runtastic GmbH
3+
Copyright (c) 2019 runtastic GmbH
44

55
Permission is hereby granted, free of charge, to any person obtaining
66
a copy of this software and associated documentation files (the

Rakefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'bundler/gem_tasks'
24

35
begin

bin/console

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
23

34
require 'bundler/setup'
45
require 'rubocop_runner'

lib/rubocop_runner.rb

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'rubocop_runner/version'
24
require 'rubocop'
35

@@ -7,6 +9,7 @@ module RubocopRunner
79
# from https://github.com/djberg96/ptools/blob/master/lib/ptools.rb#L90
810
def binary?(file)
911
return true if File.ftype(file) != 'file'
12+
1013
s = (File.read(file, File.stat(file).blksize) || '').split(//)
1114
((s.size - s.grep(' '..'~').size) / s.size.to_f) > 0.30
1215
end
@@ -42,8 +45,8 @@ def files
4245
end
4346
end
4447

45-
RUBY_PATTERN = /\.(rb|gemspec|rake)$/
46-
RUBY_NAMES = %w(Guardfile Gemfile Rakefile config.ru).freeze
48+
RUBY_PATTERN = /\.(rb|gemspec|rake)$/.freeze
49+
RUBY_NAMES = %w[Guardfile Gemfile Rakefile config.ru].freeze
4750

4851
def ruby_file?(filename)
4952
RUBY_NAMES.include?(filename) || !(filename =~ RUBY_PATTERN).nil?
@@ -55,12 +58,13 @@ def staged_ruby_files
5558
end
5659
end
5760

58-
DEFAULT_ARGS = %w(--auto-correct
61+
DEFAULT_ARGS = %w[--auto-correct
5962
--format fuubar
6063
--force-exclusion
61-
--fail-level autocorrect).freeze
64+
--fail-level autocorrect].freeze
6265
def run
6366
return 0 if staged_ruby_files.empty?
67+
6468
::RuboCop::CLI.new.run(DEFAULT_ARGS + staged_ruby_files)
6569
end
6670

@@ -73,6 +77,7 @@ def root
7377

7478
def create_backup(pre_commit_path)
7579
return unless File.exist?(pre_commit_path)
80+
7681
FileUtils.mv(pre_commit_path,
7782
pre_commit_path.join('.bkp'),
7883
force: true)
@@ -82,6 +87,7 @@ def install(root = '.')
8287
require 'fileutils'
8388
git_root = Pathname.new "#{root}/.git"
8489
return false unless File.exist?(git_root)
90+
8591
pre_commit_path = git_root.join('hooks', 'pre-commit')
8692
create_backup(pre_commit_path)
8793

lib/rubocop_runner/version.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module RubocopRunner
2-
VERSION = '2.1.0'.freeze
4+
VERSION = '2.2.0'
35
end

lib/template/pre-commit

100644100755
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
23

34
begin
45
require 'bundler/setup'

rubocop_runner.gemspec

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
# coding: utf-8
2-
lib = File.expand_path('../lib', __FILE__)
1+
# frozen_string_literal: true
2+
3+
lib = File.expand_path('lib', __dir__)
34
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
45
require 'rubocop_runner/version'
56

@@ -22,9 +23,9 @@ Gem::Specification.new do |spec|
2223
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
2324
spec.require_paths = ['lib']
2425

25-
spec.add_development_dependency 'bundler', '~> 1.10'
26+
spec.add_development_dependency 'bundler', '> 1.10', '<3'
2627
spec.add_development_dependency 'rake', '~> 10.0'
2728

28-
spec.add_development_dependency 'rubocop'
2929
spec.add_development_dependency 'pry'
30+
spec.add_development_dependency 'rubocop'
3031
end

0 commit comments

Comments
 (0)