-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #217 from countries/code-cleanup
Code cleanup
- Loading branch information
Showing
17 changed files
with
317 additions
and
196 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
version: "2" | ||
checks: | ||
argument-count: | ||
enabled: true | ||
config: | ||
threshold: 4 | ||
complex-logic: | ||
enabled: true | ||
config: | ||
threshold: 4 | ||
file-lines: | ||
enabled: true | ||
config: | ||
threshold: 250 | ||
method-complexity: | ||
enabled: true | ||
config: | ||
threshold: 5 | ||
method-count: | ||
enabled: true | ||
config: | ||
threshold: 20 | ||
method-lines: | ||
enabled: true | ||
config: | ||
threshold: 25 | ||
nested-control-flow: | ||
enabled: true | ||
config: | ||
threshold: 4 | ||
return-statements: | ||
enabled: true | ||
config: | ||
threshold: 4 | ||
plugins: | ||
rubocop: | ||
enabled: true | ||
channel: rubocop-1-48-1 | ||
reek: | ||
enabled: true | ||
checks: | ||
IrresponsibleModule: | ||
enabled: false | ||
TooManyStatements: | ||
max_statements: 7 | ||
flog: | ||
enabled: true | ||
bundler-audit: | ||
enabled: true | ||
exclude_patterns: | ||
- "config/" | ||
- "db/" | ||
- "dist/" | ||
- "features/" | ||
- "**/node_modules/" | ||
- "script/" | ||
- "**/spec/" | ||
- "**/test/" | ||
- "**/tests/" | ||
- "**/vendor/" | ||
- "**/*.d.ts" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
AllCops: | ||
NewCops: enable | ||
TargetRubyVersion: 2.7 | ||
|
||
Metrics/MethodLength: | ||
Enabled: false | ||
|
||
Metrics/LineLength: | ||
Max: 120 | ||
|
||
Style/Documentation: | ||
Enabled: false | ||
|
||
Bundler/OrderedGems: | ||
Enabled: false | ||
|
||
Naming/FileName: | ||
Exclude: | ||
- 'gemfiles/*' | ||
|
||
Metrics/BlockLength: | ||
Exclude: | ||
- 'spec/**/*' | ||
|
||
Style/MutableConstant: | ||
Exclude: | ||
- 'lib/country_select/defaults.rb' | ||
- 'lib/country_select/formats.rb' | ||
|
||
Style/MethodCallWithoutArgsParentheses: | ||
Exclude: | ||
- 'lib/country_select/tag_helper.rb' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
source 'https://rubygems.org' | ||
|
||
gemspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# -*- encoding: utf-8 -*- | ||
$:.push File.expand_path('../lib', __FILE__) | ||
# frozen_string_literal: true | ||
|
||
$LOAD_PATH.push File.expand_path('lib', __dir__) | ||
require 'country_select/version' | ||
|
||
Gem::Specification.new do |s| | ||
|
@@ -9,16 +10,18 @@ Gem::Specification.new do |s| | |
s.authors = ['Stefan Penner'] | ||
s.email = ['[email protected]'] | ||
s.homepage = 'https://github.com/countries/country_select' | ||
s.summary = %q{Country Select Plugin} | ||
s.description = %q{Provides a simple helper to get an HTML select list of countries. The list of countries comes from the ISO 3166 standard. While it is a relatively neutral source of country names, it will still offend some users.} | ||
s.summary = 'Country Select Plugin' | ||
s.description = 'Provides a simple helper to get an HTML select list of countries. \ | ||
The list of countries comes from the ISO 3166 standard. \ | ||
While it is a relatively neutral source of country names, it will still offend some users.' | ||
|
||
s.metadata = { 'bug_tracker_uri' => 'http://github.com/countries/country_select/issues', | ||
'changelog_uri' => 'https://github.com/countries/country_select/blob/master/CHANGELOG.md', | ||
'source_code_uri' => 'https://github.com/countries/country_select' } | ||
'changelog_uri' => 'https://github.com/countries/country_select/blob/master/CHANGELOG.md', | ||
'source_code_uri' => 'https://github.com/countries/country_select', | ||
'rubygems_mfa_required' => 'true' } | ||
|
||
s.files = `git ls-files`.split("\n") | ||
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") | ||
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } | ||
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) } | ||
s.require_paths = ['lib'] | ||
|
||
s.required_ruby_version = '>= 2.7' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
source "https://rubygems.org" | ||
# frozen_string_literal: true | ||
|
||
gemspec :path => "../" | ||
source 'https://rubygems.org' | ||
|
||
gem "railties", "~> 5.2.0" | ||
gem "actionpack", "~> 5.2.0" | ||
gemspec path: '../' | ||
|
||
gem 'railties', '~> 5.2.0' | ||
gem 'actionpack', '~> 5.2.0' | ||
gem 'nokogiri', '= 1.14.0.rc1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
source "https://rubygems.org" | ||
# frozen_string_literal: true | ||
|
||
gemspec :path => "../" | ||
source 'https://rubygems.org' | ||
|
||
gem "railties", "~> 6.0.0" | ||
gem "actionpack", "~> 6.0.0" | ||
gemspec path: '../' | ||
|
||
gem 'railties', '~> 6.0.0' | ||
gem 'actionpack', '~> 6.0.0' | ||
gem 'nokogiri', '= 1.14.0.rc1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
source "https://rubygems.org" | ||
# frozen_string_literal: true | ||
|
||
gemspec :path => "../" | ||
source 'https://rubygems.org' | ||
|
||
gem "railties", "~> 6.1.0" | ||
gem "actionpack", "~> 6.1.0" | ||
gemspec path: '../' | ||
|
||
gem 'railties', '~> 6.1.0' | ||
gem 'actionpack', '~> 6.1.0' | ||
gem 'nokogiri', '= 1.14.0.rc1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
source "https://rubygems.org" | ||
# frozen_string_literal: true | ||
|
||
gemspec :path => "../" | ||
source 'https://rubygems.org' | ||
|
||
gem "railties", "~> 7.0.0" | ||
gem "actionpack", "~> 7.0.0" | ||
gemspec path: '../' | ||
|
||
gem 'railties', '~> 7.0.0' | ||
gem 'actionpack', '~> 7.0.0' | ||
gem 'nokogiri', '= 1.14.0.rc1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# encoding: utf-8 | ||
# frozen_string_literal: true | ||
|
||
require 'countries' | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
# frozen_string_literal: true | ||
|
||
module CountrySelect | ||
DEFAULTS = { | ||
except: nil, | ||
format: :default, | ||
locale: nil, | ||
only: nil, | ||
priority_countries: nil, | ||
priority_countries_divider: "-" * 15, | ||
priority_countries_divider: '-' * 15, | ||
sort_provided: true | ||
} | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module CountrySelect | ||
FORMATS = {} | ||
|
||
|
Oops, something went wrong.