Skip to content

Commit f298dd1

Browse files
committed
fix code style (.zero? instead of == 0)
1 parent 6994fe4 commit f298dd1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/image_optim/space.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def self.space(size)
1515
else
1616
log_denominator = Math.log(size.abs) / Math.log(BASE)
1717
degree = [log_denominator.floor, SIZE_SYMBOLS.length - 1].min
18-
number_string = if degree == 0
18+
number_string = if degree.zero?
1919
size.to_s
2020
else
2121
denominator = BASE**degree

spec/spec_helper.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,12 @@ module CapabilityCheckHelpers
7878
def any_file_modes_allowed?
7979
Tempfile.open 'posix' do |f|
8080
File.chmod(0, f.path)
81-
File.stat(f.path).mode & 0o777 == 0
81+
(File.stat(f.path).mode & 0o777).zero?
8282
end
8383
end
8484

8585
def inodes_supported?
86-
File.stat(__FILE__).ino != 0
86+
!File.stat(__FILE__).ino.zero?
8787
end
8888

8989
def signals_supported?

0 commit comments

Comments
 (0)