From bb06f68d367e9b5c1fbb9e5ccda5578737d2259c Mon Sep 17 00:00:00 2001 From: Geremia Taglialatela Date: Tue, 23 Apr 2024 12:15:41 +0200 Subject: [PATCH] Remove redundant encoding This magic comment is not needed anymore because the default encoding of source code files assumed by Ruby 2 is utf-8, and the minimum required Ruby version is 3.1 Autofixed with: ``` rubocop -a --only Style/Encoding ``` --- lib/money/currency.rb | 2 -- lib/money/currency/heuristics.rb | 2 -- lib/money/money.rb | 1 - lib/money/money/allocation.rb | 2 -- lib/money/money/formatter.rb | 1 - lib/money/money/formatting_rules.rb | 2 -- lib/money/money/locale_backend.rb | 2 -- money.gemspec | 1 - spec/currency/heuristics_spec.rb | 2 -- spec/currency/loader_spec.rb | 2 -- spec/currency_spec.rb | 2 -- spec/locale_backend/currency_spec.rb | 2 -- spec/locale_backend/i18n_spec.rb | 2 -- spec/locale_backend/legacy_spec.rb | 2 -- spec/money/allocation_spec.rb | 2 -- spec/money/arithmetic_spec.rb | 2 -- spec/money/constructors_spec.rb | 2 -- spec/money/formatting_rules_spec.rb | 2 -- spec/money/formatting_spec.rb | 2 -- spec/money/locale_backend_spec.rb | 2 -- spec/money_spec.rb | 2 -- 21 files changed, 39 deletions(-) diff --git a/lib/money/currency.rb b/lib/money/currency.rb index b4e682b55b..10cced2138 100644 --- a/lib/money/currency.rb +++ b/lib/money/currency.rb @@ -1,5 +1,3 @@ -# encoding: utf-8 - require "json" require "money/currency/loader" require "money/currency/heuristics" diff --git a/lib/money/currency/heuristics.rb b/lib/money/currency/heuristics.rb index 1cfec0d76d..59fa19bdbb 100644 --- a/lib/money/currency/heuristics.rb +++ b/lib/money/currency/heuristics.rb @@ -1,5 +1,3 @@ -# encoding: utf-8 - class Money class Currency module Heuristics diff --git a/lib/money/money.rb b/lib/money/money.rb index faa0d269db..b2876e2132 100644 --- a/lib/money/money.rb +++ b/lib/money/money.rb @@ -1,4 +1,3 @@ -# encoding: utf-8 require "money/bank/variable_exchange" require "money/bank/single_currency" require "money/money/arithmetic" diff --git a/lib/money/money/allocation.rb b/lib/money/money/allocation.rb index 768147f7cc..e131115b2f 100644 --- a/lib/money/money/allocation.rb +++ b/lib/money/money/allocation.rb @@ -1,5 +1,3 @@ -# encoding: utf-8 - class Money class Allocation # Splits a given amount in parts. The allocation is based on the parts' proportions diff --git a/lib/money/money/formatter.rb b/lib/money/money/formatter.rb index bff2b8010a..d86a00b1ce 100644 --- a/lib/money/money/formatter.rb +++ b/lib/money/money/formatter.rb @@ -1,4 +1,3 @@ -# encoding: UTF-8 require 'money/money/formatting_rules' class Money diff --git a/lib/money/money/formatting_rules.rb b/lib/money/money/formatting_rules.rb index 68c917800c..7f582f3729 100644 --- a/lib/money/money/formatting_rules.rb +++ b/lib/money/money/formatting_rules.rb @@ -1,5 +1,3 @@ -# encoding: UTF-8 - class Money class FormattingRules def initialize(currency, *raw_rules) diff --git a/lib/money/money/locale_backend.rb b/lib/money/money/locale_backend.rb index 30491301c8..72ca083a75 100644 --- a/lib/money/money/locale_backend.rb +++ b/lib/money/money/locale_backend.rb @@ -1,5 +1,3 @@ -# encoding: UTF-8 - require 'money/locale_backend/errors' require 'money/locale_backend/legacy' require 'money/locale_backend/i18n' diff --git a/money.gemspec b/money.gemspec index 695c1da447..12646bfb9a 100644 --- a/money.gemspec +++ b/money.gemspec @@ -1,4 +1,3 @@ -# -*- encoding: utf-8 -*- lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require "money/version" diff --git a/spec/currency/heuristics_spec.rb b/spec/currency/heuristics_spec.rb index 543b32a38e..80d9b2c21f 100644 --- a/spec/currency/heuristics_spec.rb +++ b/spec/currency/heuristics_spec.rb @@ -1,5 +1,3 @@ -# encoding: utf-8 - describe Money::Currency::Heuristics do describe "#analyze_string" do let(:it) { Money::Currency } diff --git a/spec/currency/loader_spec.rb b/spec/currency/loader_spec.rb index b350e65f34..f998c7f889 100644 --- a/spec/currency/loader_spec.rb +++ b/spec/currency/loader_spec.rb @@ -1,5 +1,3 @@ -# encoding: utf-8 - describe Money::Currency::Loader do it "returns a currency table hash" do expect(subject.load_currencies).to be_a Hash diff --git a/spec/currency_spec.rb b/spec/currency_spec.rb index 2e01018bbc..e7419708fe 100644 --- a/spec/currency_spec.rb +++ b/spec/currency_spec.rb @@ -1,5 +1,3 @@ -# encoding: utf-8 - describe Money::Currency do FOO = '{ "priority": 1, "iso_code": "FOO", "iso_numeric": "840", "name": "United States Dollar", "symbol": "$", "subunit": "Cent", "subunit_to_unit": 1000, "symbol_first": true, "html_entity": "$", "decimal_mark": ".", "thousands_separator": ",", "smallest_denomination": 1 }' diff --git a/spec/locale_backend/currency_spec.rb b/spec/locale_backend/currency_spec.rb index 2779cbef4a..5a66b10e61 100644 --- a/spec/locale_backend/currency_spec.rb +++ b/spec/locale_backend/currency_spec.rb @@ -1,5 +1,3 @@ -# encoding: utf-8 - describe Money::LocaleBackend::Currency do describe '#lookup' do let(:currency) { Money::Currency.new('EUR') } diff --git a/spec/locale_backend/i18n_spec.rb b/spec/locale_backend/i18n_spec.rb index 5fe7b63607..ea135aa72f 100644 --- a/spec/locale_backend/i18n_spec.rb +++ b/spec/locale_backend/i18n_spec.rb @@ -1,5 +1,3 @@ -# encoding: utf-8 - describe Money::LocaleBackend::I18n do describe '#initialize' do it 'raises an error when I18n is not defined' do diff --git a/spec/locale_backend/legacy_spec.rb b/spec/locale_backend/legacy_spec.rb index 5e0c56296d..3d917e8b28 100644 --- a/spec/locale_backend/legacy_spec.rb +++ b/spec/locale_backend/legacy_spec.rb @@ -1,5 +1,3 @@ -# encoding: utf-8 - describe Money::LocaleBackend::Legacy do after { Money.use_i18n = true } diff --git a/spec/money/allocation_spec.rb b/spec/money/allocation_spec.rb index 215c95c392..872b77079c 100644 --- a/spec/money/allocation_spec.rb +++ b/spec/money/allocation_spec.rb @@ -1,5 +1,3 @@ -# encoding: utf-8 - describe Money::Allocation do describe 'given number as argument' do it 'raises an error when invalid argument is given' do diff --git a/spec/money/arithmetic_spec.rb b/spec/money/arithmetic_spec.rb index a430caa3fc..dd18d5712d 100644 --- a/spec/money/arithmetic_spec.rb +++ b/spec/money/arithmetic_spec.rb @@ -1,5 +1,3 @@ -# encoding: utf-8 - describe Money::Arithmetic do describe "-@" do it "changes the sign of a number" do diff --git a/spec/money/constructors_spec.rb b/spec/money/constructors_spec.rb index facead47db..0a877302a6 100644 --- a/spec/money/constructors_spec.rb +++ b/spec/money/constructors_spec.rb @@ -1,5 +1,3 @@ -# encoding: utf-8 - describe Money::Constructors do describe "::empty" do diff --git a/spec/money/formatting_rules_spec.rb b/spec/money/formatting_rules_spec.rb index 17f4a365c5..046954755b 100644 --- a/spec/money/formatting_rules_spec.rb +++ b/spec/money/formatting_rules_spec.rb @@ -1,5 +1,3 @@ -# encoding: utf-8 - describe Money::FormattingRules do it 'does not modify frozen rules in place' do expect { diff --git a/spec/money/formatting_spec.rb b/spec/money/formatting_spec.rb index 45ce525997..982ab92b27 100644 --- a/spec/money/formatting_spec.rb +++ b/spec/money/formatting_spec.rb @@ -1,5 +1,3 @@ -# encoding: utf-8 - describe Money, "formatting" do BAR = '{ "priority": 1, "iso_code": "BAR", "iso_numeric": "840", "name": "Dollar with 4 decimal places", "symbol": "$", "subunit": "Cent", "subunit_to_unit": 10000, "symbol_first": true, "html_entity": "$", "decimal_mark": ".", "thousands_separator": ",", "smallest_denomination": 1 }' diff --git a/spec/money/locale_backend_spec.rb b/spec/money/locale_backend_spec.rb index ec2e4f0bac..7661963d30 100644 --- a/spec/money/locale_backend_spec.rb +++ b/spec/money/locale_backend_spec.rb @@ -1,5 +1,3 @@ -# encoding: utf-8 - describe Money::LocaleBackend do describe '.find' do it 'returns an initialized backend' do diff --git a/spec/money_spec.rb b/spec/money_spec.rb index bfba7b5255..7c232abbaa 100644 --- a/spec/money_spec.rb +++ b/spec/money_spec.rb @@ -1,5 +1,3 @@ -# encoding: utf-8 - describe Money do describe '.locale_backend' do after { Money.locale_backend = :legacy }