Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 0 additions & 48 deletions .rubocop_todo.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions lib/money/bank/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ def initialize(&block)
# +Money::Bank+ class.
#
# @return [self]
def setup
end
def setup; end

# Exchanges the given +Money+ object to a new +Money+ object in
# +to_currency+.
Expand Down
2 changes: 1 addition & 1 deletion lib/money/money/allocation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def self.generate(amount, parts, decimal_cutoff = true)

parts_sum = parts.sum

until parts.empty? do
until parts.empty?
part = parts.pop

current_split = 0
Expand Down
2 changes: 1 addition & 1 deletion lib/money/money/arithmetic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ def zero?
# Money.new(100).nonzero? #=> #<Money @fractional=100>
# Money.new(0).nonzero? #=> nil
def nonzero?
fractional != 0 ? self : nil
fractional == 0 ? nil : self
end

# Used to make Money instance handle the operations when arguments order is reversed
Expand Down
2 changes: 1 addition & 1 deletion lib/money/money/formatting_rules.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def has_key?(key)
#
# @return [Hash]
def normalize_formatting_rules(rules)
if rules.size == 0
if rules.empty?
rules = {}
elsif rules.size == 1
rules = rules.pop
Expand Down
16 changes: 9 additions & 7 deletions spec/currency_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ def to_s
end
end

# rubocop:disable Style/MapIntoArray
describe ".each" do
it "yields each currency to the block" do
expect(described_class).to respond_to(:each)
Expand All @@ -257,6 +258,7 @@ def to_s
expect(currencies[-1]).to eq described_class.all[-1]
end
end
# rubocop:enable Style/MapIntoArray

it "implements Enumerable" do
expect(described_class).to respond_to(:all?)
Expand Down Expand Up @@ -483,13 +485,13 @@ def to_s
cad = described_class.find(:cad)

described_class.register(
:priority => 100,
:iso_code => cad.iso_code,
:name => cad.name,
:subunit => cad.subunit,
:subunit_to_unit => cad.subunit_to_unit,
:thousands_separator => cad.thousands_separator,
:decimal_mark => modified_mark,
priority: 100,
iso_code: cad.iso_code,
name: cad.name,
subunit: cad.subunit,
subunit_to_unit: cad.subunit_to_unit,
thousands_separator: cad.thousands_separator,
decimal_mark: modified_mark,
)
end

Expand Down
2 changes: 1 addition & 1 deletion spec/money/arithmetic_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@
end
end

%w(+ - / divmod remainder).each do |op|
%w[+ - / divmod remainder].each do |op|
describe "##{op}" do
let(:instance) { Money.usd(1) }

Expand Down
2 changes: 1 addition & 1 deletion spec/money_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,7 @@

it "keeps subclasses intact" do
special_money_class = Class.new(Money)
expect(special_money_class.new(005).allocate([1]).first).to be_a special_money_class
expect(special_money_class.new(5).allocate([1]).first).to be_a special_money_class
end

context "with infinite_precision", :default_infinite_precision_true do
Expand Down