Skip to content

Commit

Permalink
Fix rubocop offenses
Browse files Browse the repository at this point in the history
  • Loading branch information
weppos committed Nov 8, 2023
1 parent c8ac0c7 commit 9fd82df
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion bin/whoisrb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ OptionParser.new do |opts|
exit 1
end

if ARGV.size.zero?
if ARGV.empty?
puts opts
exit 1
end
Expand Down
8 changes: 4 additions & 4 deletions lib/whois.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def lookup(object)
def available?(object)
unless defined? Whois::Parser
warn("Whois.available? requires the gem `whois-parser`")
return
return false
end

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

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


Expand Down
2 changes: 1 addition & 1 deletion lib/whois/record/part.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Record
def initialize(*args)
if args.first.is_a? Hash
initialize_with_hash(args.first)
elsif args.size.zero?
elsif args.empty?
super
else
raise ArgumentError
Expand Down
2 changes: 1 addition & 1 deletion lib/whois/server/adapters/arin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def extract_referral(response)

{
host: Regexp.last_match(1),
port: Regexp.last_match(2) ? Regexp.last_match(2).to_i : nil,
port: Regexp.last_match(2)&.to_i,
}
end

Expand Down
4 changes: 2 additions & 2 deletions spec/whois/record_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@

describe "#match?" do
it "calls match and checks for match" do
expect(subject.match?(/record/)).to eq(true)
expect(subject.match?(/nomatch/)).to eq(false)
expect(subject.match?(/record/)).to be(true)
expect(subject.match?(/nomatch/)).to be(false)
end
end

Expand Down

0 comments on commit 9fd82df

Please sign in to comment.