Skip to content

Commit f5cb34a

Browse files
authored
Merge pull request #340 from groddeck/fix-rubocop-issues
Update code to conform to new rubocop rules
2 parents 63e845e + 77a1f92 commit f5cb34a

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

lib/t/identicon.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def reset
3030
end
3131

3232
def bg(bit)
33-
bit == 0 ? "\033[48;5;#{@bcolor}m" : "\033[48;5;#{@fcolor}m"
33+
bit.zero? ? "\033[48;5;#{@bcolor}m" : "\033[48;5;#{@fcolor}m"
3434
end
3535
end
3636

lib/t/printable.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def print_identicon(from_user, message)
136136
# Save 6 chars for icon, ensure at least 3 lines long
137137
lines = wrapped(HTMLEntities.new.decode(message), indent: 2, width: terminal_width - (6 + 5))
138138
lines.unshift(set_color(" @#{from_user}", :bold, :yellow))
139-
lines.push(*Array.new([3 - lines.length, 0].max) { '' })
139+
lines.concat(Array.new([3 - lines.length, 0].max) { '' })
140140

141141
$stdout.puts lines.zip(icon.lines).map { |x, i| " #{i || ' '}#{x}" }
142142
end

lib/t/rcfile.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def find(username)
2020
if possibilities.size == 1
2121
possibilities.first
2222
else
23-
raise(ArgumentError.new("Username #{username} is #{possibilities.size < 1 ? 'not found.' : 'ambiguous, matching ' + possibilities.join(', ')}"))
23+
raise(ArgumentError.new("Username #{username} is #{possibilities.empty? ? 'not found.' : 'ambiguous, matching ' + possibilities.join(', ')}"))
2424
end
2525
end
2626

@@ -118,7 +118,7 @@ def default_structure
118118

119119
def write
120120
require 'yaml'
121-
File.open(@path, File::RDWR | File::TRUNC | File::CREAT, 0600) do |rcfile|
121+
File.open(@path, File::RDWR | File::TRUNC | File::CREAT, 0o0600) do |rcfile|
122122
rcfile.write @data.to_yaml
123123
end
124124
end

0 commit comments

Comments
 (0)