Skip to content

Commit b282751

Browse files
joshRpowellnunosilva800
authored andcommitted
[CHANGE] Update parser, rainbow, rubocop (#264)
* Bump parser, rainbow, rubocop * Update CHANGELOG * Rubocop Fixes
1 parent 1c242dd commit b282751

File tree

14 files changed

+27
-24
lines changed

14 files changed

+27
-24
lines changed

CHANGELOG.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
# master [(unreleased)](https://github.com/whitesmith/rubycritic/compare/v3.3.0...master)
22

3-
* [CHANGE] Update `rubocop` to 0.51.0 (by [@olleolleolle][])
3+
* [CHANGE] Update `rubocop` to 0.51.0 (by [@olleolleolle][])
4+
* [CHANGE] Update `parser` to 2.5.0 (by [@joshrpowell][])
5+
* [CHANGE] Update `rainbow` to 3.0 (by [@joshrpowell][])
6+
* [CHANGE] Update `rubocop` to 0.53.0 (by [@joshrpowell][])
47

58
# 3.3.0 / 2017-10-10 [(commits)](https://github.com/whitesmith/rubycritic/compare/v3.2.3...v3.3.0)
69

710
* [FEATURE] Add lint format similar to Golint (by [@nightscape][])
8-
* [CHANGE] Update `cucumber` to 3.0 (by [@onumis][])
11+
* [CHANGE] Update `cucumber` to 3.0 (by [@onumis][])
912
* [CHANGE] Update `rake` to 12.0 (by [@onumis][])
1013
* [CHANGE] Update `rubocop` to 0.50.0 (by [@onumis][])
1114
* [CHANGE] Accepting floating point values from Flog (by [@onumis][])
@@ -226,3 +229,4 @@
226229
[@yuku-t]: https://github.com/yuku-t
227230
[@ochagata]: https://github.com/ochagata
228231
[@nightscape]: https://github.com/nightscape
232+
[@joshrpowell]: https://github.com/joshrpowell

bin/rubycritic

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# Always look in the lib directory of this gem
55
# first when searching the load path
6-
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
6+
$LOAD_PATH.unshift File.expand_path('../lib', __dir__)
77

88
require 'rubycritic/cli/application'
99

lib/rubycritic/analysers/smells/flog.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@ def add_smells_to(analysed_module)
3535
@flog.flog(analysed_module.path)
3636
@flog.each_by_score do |class_method, original_score|
3737
score = original_score.round
38-
if score >= HIGH_COMPLEXITY_SCORE_THRESHOLD
39-
analysed_module.smells << create_smell(class_method, score)
40-
end
38+
analysed_module.smells << create_smell(class_method, score) if score >= HIGH_COMPLEXITY_SCORE_THRESHOLD
4139
end
4240
end
4341

lib/rubycritic/cli/options.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ def to_h
7676
no_browser: no_browser
7777
}
7878
end
79+
# rubocop:enable Metrics/MethodLength
7980

8081
private
8182

lib/rubycritic/core/analysed_module.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ def to_h
8787
}
8888
end
8989

90-
def to_json(*a)
91-
to_h.to_json(*a)
90+
def to_json(*options)
91+
to_h.to_json(*options)
9292
end
9393
end
9494
end

lib/rubycritic/core/location.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ def to_h
2626
}
2727
end
2828

29-
def to_json(*a)
30-
to_h.to_json(*a)
29+
def to_json(*options)
30+
to_h.to_json(*options)
3131
end
3232

3333
def ==(other)

lib/rubycritic/core/rating.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ def to_h
2323
@letter
2424
end
2525

26-
def to_json(*a)
27-
to_h.to_json(*a)
26+
def to_json(*options)
27+
to_h.to_json(*options)
2828
end
2929
end
3030
end

lib/rubycritic/core/smell.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ def to_h
4848
}
4949
end
5050

51-
def to_json(*a)
52-
to_h.to_json(*a)
51+
def to_json(*options)
52+
to_h.to_json(*options)
5353
end
5454

5555
def doc_url

lib/rubycritic/generators/html/base.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def self.erb_template(template_path)
1212
ERB.new(File.read(File.join(TEMPLATES_DIR, template_path)))
1313
end
1414

15-
TEMPLATES_DIR = File.expand_path('../templates', __FILE__)
15+
TEMPLATES_DIR = File.expand_path('templates', __dir__)
1616
LAYOUT_TEMPLATE = erb_template(File.join('layouts', 'application.html.erb'))
1717

1818
include ViewHelpers

lib/rubycritic/generators/html_report.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
module RubyCritic
1111
module Generator
1212
class HtmlReport
13-
ASSETS_DIR = File.expand_path('../html/assets', __FILE__)
13+
ASSETS_DIR = File.expand_path('html/assets', __dir__)
1414

1515
def initialize(analysed_modules)
1616
@analysed_modules = analysed_modules

0 commit comments

Comments
 (0)