Skip to content

Commit 9fd82df

Browse files
committed
Fix rubocop offenses
1 parent c8ac0c7 commit 9fd82df

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

bin/whoisrb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ OptionParser.new do |opts|
4747
exit 1
4848
end
4949

50-
if ARGV.size.zero?
50+
if ARGV.empty?
5151
puts opts
5252
exit 1
5353
end

lib/whois.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def lookup(object)
4444
def available?(object)
4545
unless defined? Whois::Parser
4646
warn("Whois.available? requires the gem `whois-parser`")
47-
return
47+
return false
4848
end
4949

5050
deprecate(%{Whois.available? is deprecated. Call Whois.whois("#{object}").parser.available?})
@@ -61,7 +61,7 @@ def available?(object)
6161
def registered?(object)
6262
unless defined? Whois::Parser
6363
warn("Whois.registered? requires the gem `whois-parser`")
64-
return
64+
return false
6565
end
6666

6767
deprecate(%{Whois.registered? is deprecated. Call Whois.whois("#{object}").parser.registered?})
@@ -90,8 +90,8 @@ def deprecate(message = nil, callstack = caller)
9090
# @private
9191
def bug!(error, message)
9292
raise error, message.dup <<
93-
" Please report the issue at" \
94-
" http://github.com/weppos/whois/issues"
93+
" Please report the issue at " \
94+
"http://github.com/weppos/whois/issues"
9595
end
9696

9797

lib/whois/record/part.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Record
2626
def initialize(*args)
2727
if args.first.is_a? Hash
2828
initialize_with_hash(args.first)
29-
elsif args.size.zero?
29+
elsif args.empty?
3030
super
3131
else
3232
raise ArgumentError

lib/whois/server/adapters/arin.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def extract_referral(response)
4444

4545
{
4646
host: Regexp.last_match(1),
47-
port: Regexp.last_match(2) ? Regexp.last_match(2).to_i : nil,
47+
port: Regexp.last_match(2)&.to_i,
4848
}
4949
end
5050

spec/whois/record_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@
138138

139139
describe "#match?" do
140140
it "calls match and checks for match" do
141-
expect(subject.match?(/record/)).to eq(true)
142-
expect(subject.match?(/nomatch/)).to eq(false)
141+
expect(subject.match?(/record/)).to be(true)
142+
expect(subject.match?(/nomatch/)).to be(false)
143143
end
144144
end
145145

0 commit comments

Comments
 (0)