Skip to content

Commit 404c152

Browse files
committed
rubocop -A
1 parent 9c3669e commit 404c152

File tree

3 files changed

+16
-18
lines changed

3 files changed

+16
-18
lines changed

gemdiff.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ Gem::Specification.new do |spec|
1919

2020
spec.required_ruby_version = ">= 3.0.0"
2121

22+
spec.add_dependency "faraday-retry", "~> 2.2"
2223
spec.add_dependency "launchy", "~> 3.0"
2324
spec.add_dependency "octokit", "~> 9.0"
24-
spec.add_dependency "faraday-retry", "~> 2.2"
2525
spec.add_dependency "thor", "~> 1.0"
2626

2727
spec.metadata["rubygems_mfa_required"] = "true"

lib/gemdiff/colorize.rb

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,20 @@ module Colorize
1313

1414
# works with `git show` and `git diff`
1515
def colorize_git_output(lines)
16-
out = []
17-
lines.split("\n").each do |line|
18-
out <<
19-
if line.start_with?("---", "+++", "diff", "index")
20-
colorize line, :blue
21-
elsif line.start_with?("@@")
22-
colorize line, :magenta
23-
elsif line.start_with?("commit")
24-
colorize line, :yellow
25-
elsif line.start_with?("-")
26-
colorize line, :red
27-
elsif line.start_with?("+")
28-
colorize line, :green
29-
else
30-
line
31-
end
16+
out = lines.split("\n").map do |line|
17+
if line.start_with?("---", "+++", "diff", "index")
18+
colorize line, :blue
19+
elsif line.start_with?("@@")
20+
colorize line, :magenta
21+
elsif line.start_with?("commit")
22+
colorize line, :yellow
23+
elsif line.start_with?("-")
24+
colorize line, :red
25+
elsif line.start_with?("+")
26+
colorize line, :green
27+
else
28+
line
29+
end
3230
end
3331
out.join("\n")
3432
end

test/gem_updater_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
it "adds a git commit for an update with dependencies" do
3535
updater = Gemdiff::GemUpdater.new("activejob")
3636
updater.stubs git_removed_line: "- activejob (4.2.2)"
37-
updater.stubs git_added_line: \
37+
updater.stubs git_added_line:
3838
"+ activejob (= 4.2.3)\n+ activejob (4.2.3)\n+ activejob (= 4.2.3)"
3939
assert_equal "Update activejob to 4.2.3\n\nhttps://github.com/rails/rails/compare/v4.2.2...v4.2.3",
4040
updater.send(:commit_message)

0 commit comments

Comments
 (0)