Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require reek with version 3.0.0 or later #276

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ source "https://rubygems.org"
if RUBY_VERSION == "1.9.2"
# because of https://github.com/railsbp/rails_best_practices/blob/master/rails_best_practices.gemspec
gem "activesupport", "~> 3.2"
# because of https://github.com/troessner/reek/issues/334
gem "reek", "~> 1.4.0"
# rbp -> as -> i18n
gem 'i18n', '0.6.11'
gem "parallel", "= 1.3.3" # 1.3.4 disallows 1.9.2
Expand Down
6 changes: 3 additions & 3 deletions lib/metric_fu/metrics/reek/generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ def emit
end
end

def run!(files, config_files)
examiner.new(files, config_files)
def run!(files, _config_files)
files.map { |file| examiner.new(Pathname.new(file), []) }
end

def analyze
@matches = @output.smells.group_by(&:source).collect do |file_path, smells|
@matches = @output.map(&:smells).flatten.group_by(&:source).collect do |file_path, smells|
{ file_path: file_path,
code_smells: analyze_smells(smells) }
end
Expand Down
2 changes: 1 addition & 1 deletion metric_fu.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Gem::Specification.new do |s|
s.add_runtime_dependency "flay", [">= 2.0.1", "~> 2.1"]
s.add_runtime_dependency "churn", ["~> 0.0.35"]
s.add_runtime_dependency "flog", [">= 4.1.1", "~> 4.1"]
s.add_runtime_dependency "reek", [">= 1.3.4", "< 3.0"]
s.add_runtime_dependency "reek", [">= 3.0.0"]
s.add_runtime_dependency "cane", [">= 2.5.2", "~> 2.5"]
s.add_runtime_dependency "rails_best_practices", [">= 1.14.3", "~> 1.14"]
s.add_runtime_dependency "metric_fu-Saikuro", [">= 1.1.3", "~> 1.1"]
Expand Down
9 changes: 6 additions & 3 deletions spec/metric_fu/metrics/reek/generator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@
lines: [6, 9])
]
@lines = instance_double(@examiner, smells: @smells)
@reek.instance_variable_set(:@output, @lines)
@output = [@lines]
@reek.instance_variable_set(:@output, @output)
@matches = @reek.analyze
end

Expand Down Expand Up @@ -144,7 +145,8 @@
lines: [2, 4]),
]
@lines = instance_double(@examiner, smells: @smells)
@reek.instance_variable_set(:@output, @lines)
@output = [@lines]
@reek.instance_variable_set(:@output, @output)
@matches = @reek.analyze
end

Expand All @@ -157,7 +159,8 @@
context "without reek warnings" do
before :each do
@lines = instance_double(@examiner, smells: [])
@reek.instance_variable_set(:@output, @lines)
@output = [@lines]
@reek.instance_variable_set(:@output, @output)
@matches = @reek.analyze
end

Expand Down