diff --git a/.rubocop.yml b/.rubocop.yml index 88a73ff0f2..1122cd9b40 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -7,6 +7,12 @@ plugins: AllCops: NewCops: enable +# Bundler + +Bundler/OrderedGems: + # Sort the gemspec dependencies by logical order instead of alphabetical. + Enabled: false + # Gemspec Gemspec/OrderedDependencies: @@ -43,6 +49,11 @@ Style/Documentation: # Not all modules need a comment. Enabled: false +Style/FrozenStringLiteralComment: + # Add `# frozen_string_literal: true` to all files. + EnforcedStyle: always_true + SafeAutoCorrect: true + Style/GuardClause: # Not enforced since guard clauses can cause long lines as well. Enabled: false diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 2be7db60d6..030cd2ee8b 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -6,12 +6,6 @@ # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. -# Configuration parameters: EnforcedStyle, AllowedGems. -# SupportedStyles: Gemfile, gems.rb, gemspec -Gemspec/DevelopmentDependencies: - Exclude: - - 'money.gemspec' - # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle, IndentationWidth. # SupportedStyles: with_first_argument, with_fixed_indentation @@ -668,7 +662,6 @@ Style/EmptyMethod: Style/ExpandPathArguments: Exclude: - 'lib/money/currency/loader.rb' - - 'money.gemspec' # This cop supports safe autocorrection (--autocorrect). Style/ExplicitBlockArgument: diff --git a/Gemfile b/Gemfile index ee12ecdee6..36d9253e5f 100644 --- a/Gemfile +++ b/Gemfile @@ -2,15 +2,30 @@ source "https://rubygems.org" +# Debugger gem "pry", require: false +# Types gem "rbs", platforms: [:mri, :windows] gem "typeprof", platforms: [:mri, :windows] +# Specs +gem "rspec", "~> 3.4" + +# Spec coverage gem "simplecov", require: false +# Tasks +gem "rake" + +# Linting gem "rubocop", require: false gem "rubocop-rake", require: false gem "rubocop-rspec", require: false +# Documentation +gem "yard", "~> 0.9.38" +gem "rdoc" +gem "redcarpet" unless RUBY_PLATFORM == "java" + gemspec diff --git a/money.gemspec b/money.gemspec index 3888ba5c9c..ceae482e2b 100644 --- a/money.gemspec +++ b/money.gemspec @@ -1,6 +1,6 @@ # frozen_string_literal: true -lib = File.expand_path('../lib', __FILE__) +lib = File.expand_path("lib", __dir__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require "money/version" @@ -16,17 +16,9 @@ Gem::Specification.new do |s| s.license = "MIT" s.add_dependency "bigdecimal" - s.add_dependency 'i18n', "~> 1.9" + s.add_dependency "i18n", "~> 1.9" - s.add_development_dependency "bundler" - s.add_development_dependency "rake" - s.add_development_dependency "rspec", "~> 3.4" - # Documentation - s.add_development_dependency "yard", "~> 0.9.38" - s.add_development_dependency "rdoc" - s.add_development_dependency "redcarpet" unless RUBY_PLATFORM == "java" - - s.required_ruby_version = '>= 3.1' + s.required_ruby_version = ">= 3.1" s.files = `git ls-files -z -- config/* lib/* CHANGELOG.md LICENSE money.gemspec README.md`.split("\x0") s.require_paths = ["lib"]