Skip to content

Commit

Permalink
Upgrade to Rubocop 0.70
Browse files Browse the repository at this point in the history
  • Loading branch information
weppos committed May 27, 2019
1 parent 2803479 commit d3ea96c
Show file tree
Hide file tree
Showing 18 changed files with 40 additions and 14 deletions.
9 changes: 2 additions & 7 deletions .rubocop_defaults.yml
Expand Up @@ -63,11 +63,6 @@ Metrics/ParameterLists:
Metrics/PerceivedComplexity:
Enabled: false

# [codesmell]
# I don't really get the point of this cop.
Performance/RedundantMerge:
Enabled: false

# Do not use "and" or "or" in conditionals, but for readability we can use it
# to chain executions. Just beware of operator order.
Style/AndOr:
Expand Down Expand Up @@ -123,12 +118,12 @@ Style/RescueStandardError:

# Array indentation should be considered like MultilineMethodCallIndentation indentation
# and use 4 spaces instead of 2.
Layout/IndentArray:
Layout/IndentFirstArrayElement:
IndentationWidth: 4

# Hash indentation should be considered like MultilineMethodCallIndentation indentation
# and use 4 spaces instead of 2.
Layout/IndentHash:
Layout/IndentFirstHashElement:
IndentationWidth: 4

# Multi-line differs from standard indentation, they are indented twice.
Expand Down
2 changes: 2 additions & 0 deletions Gemfile
@@ -1,3 +1,5 @@
# frozen_string_literal: true

source "https://rubygems.org"

gemspec
Expand Down
4 changes: 3 additions & 1 deletion Rakefile
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "bundler/gem_tasks"

# By default, run tests and linter.
Expand Down Expand Up @@ -39,7 +41,7 @@ desc "Downloads the Public Suffix List file from the repository and stores it lo
task :"update-list" do
require "net/http"

DEFINITION_URL = "https://raw.githubusercontent.com/publicsuffix/list/master/public_suffix_list.dat".freeze
DEFINITION_URL = "https://raw.githubusercontent.com/publicsuffix/list/master/public_suffix_list.dat"

File.open("data/list.txt", "w+") do |f|
response = Net::HTTP.get_response(URI.parse(DEFINITION_URL))
Expand Down
1 change: 1 addition & 0 deletions bin/console
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

require "bundler/setup"
require "public_suffix"
Expand Down
8 changes: 5 additions & 3 deletions lib/public_suffix.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# = Public Suffix
#
# Domain name parser based on the Public Suffix List.
Expand All @@ -20,9 +22,9 @@
# but was originally created to meet the needs of browser manufacturers.
module PublicSuffix

DOT = ".".freeze
BANG = "!".freeze
STAR = "*".freeze
DOT = "."
BANG = "!"
STAR = "*"

# Parses +name+ and returns the {PublicSuffix::Domain} instance.
#
Expand Down
2 changes: 2 additions & 0 deletions lib/public_suffix/domain.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# = Public Suffix
#
# Domain name parser based on the Public Suffix List.
Expand Down
2 changes: 2 additions & 0 deletions lib/public_suffix/errors.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# = Public Suffix
#
# Domain name parser based on the Public Suffix List.
Expand Down
6 changes: 4 additions & 2 deletions lib/public_suffix/list.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# = Public Suffix
#
# Domain name parser based on the Public Suffix List.
Expand Down Expand Up @@ -65,8 +67,8 @@ def self.default=(value)
# @param private_domains [Boolean] whether to ignore the private domains section
# @return [PublicSuffix::List]
def self.parse(input, private_domains: true)
comment_token = "//".freeze
private_token = "===BEGIN PRIVATE DOMAINS===".freeze
comment_token = "//"
private_token = "===BEGIN PRIVATE DOMAINS==="
section = nil # 1 == ICANN, 2 == PRIVATE

new do |list|
Expand Down
2 changes: 2 additions & 0 deletions lib/public_suffix/rule.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# = Public Suffix
#
# Domain name parser based on the Public Suffix List.
Expand Down
2 changes: 1 addition & 1 deletion lib/public_suffix/version.rb
Expand Up @@ -9,5 +9,5 @@

module PublicSuffix
# The current library version.
VERSION = "3.0.3".freeze
VERSION = "3.0.3"
end
2 changes: 2 additions & 0 deletions test/acceptance_test.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "test_helper"

class AcceptanceTest < Minitest::Test
Expand Down
2 changes: 2 additions & 0 deletions test/psl_test.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "test_helper"
require "public_suffix"

Expand Down
2 changes: 2 additions & 0 deletions test/test_helper.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

if ENV["COVERAGE"]
require "simplecov"
SimpleCov.start
Expand Down
2 changes: 2 additions & 0 deletions test/unit/domain_test.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "test_helper"

class PublicSuffix::DomainTest < Minitest::Test
Expand Down
2 changes: 2 additions & 0 deletions test/unit/errors_test.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "test_helper"

class ErrorsTest < Minitest::Test
Expand Down
2 changes: 2 additions & 0 deletions test/unit/list_test.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "test_helper"

class PublicSuffix::ListTest < Minitest::Test
Expand Down
2 changes: 2 additions & 0 deletions test/unit/public_suffix_test.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "test_helper"

class PublicSuffixTest < Minitest::Test
Expand Down
2 changes: 2 additions & 0 deletions test/unit/rule_test.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "test_helper"

class PublicSuffix::RuleTest < Minitest::Test
Expand Down

0 comments on commit d3ea96c

Please sign in to comment.