Skip to content

Commit

Permalink
Fix Rubocop Style/RedundantCondition
Browse files Browse the repository at this point in the history
  • Loading branch information
archanaserver authored and ekohl committed Sep 22, 2023
1 parent 6f996d6 commit 9221551
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
3 changes: 0 additions & 3 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,3 @@ Style/TrailingCommaInHashLiteral:
#Allow both ['a', 'b'], %w[a b] and %w(a b) style arrays
Style/WordArray:
Enabled: false

Style/RedundantCondition:
Enabled: false
7 changes: 2 additions & 5 deletions modules/dns/dns_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,8 @@ class Api < ::Sinatra::Base

delete '/:value/?:type?' do
name = params[:value]
if params[:type]
type = params[:type]
else
type = (name =~ /\.(in-addr|ip6)\.arpa$/) ? "PTR" : "A"
end
type = params[:type]
type ||= name.end_with?('.in-addr.arpa', '.ip6.arpa') ? 'PTR' : 'A'

begin
validate_dns_name!(name, type)
Expand Down

0 comments on commit 9221551

Please sign in to comment.