From 95c4911bb8256b128f137c5e7f22d9e3625af272 Mon Sep 17 00:00:00 2001 From: Simon Neutert Date: Sat, 20 Jan 2024 23:15:19 +0100 Subject: [PATCH 1/4] specs are green again :tada: --- spec/money/formatting_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/money/formatting_spec.rb b/spec/money/formatting_spec.rb index 1842195d95..d8da80c77f 100644 --- a/spec/money/formatting_spec.rb +++ b/spec/money/formatting_spec.rb @@ -759,7 +759,7 @@ context 'when symbol_position is passed' do it "inserts currency symbol before the amount when set to :before" do - expect(Money.new(100_00, 'CHF').format(symbol_position: :before)).to eq "CHF 100.00" + expect(Money.new(100_00, 'CHF').format(symbol_position: :before)).to eq "CHF100.00" end it "inserts currency symbol after the amount when set to :after" do From ca6940d96247d2d935ead12876d265eb1e0516d9 Mon Sep 17 00:00:00 2001 From: Simon Neutert Date: Sat, 20 Jan 2024 23:18:43 +0100 Subject: [PATCH 2/4] when using the gem, the following deprecation warning is thrown: warning: bigdecimal was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.4.0. Add bigdecimal to your Gemfile or gemspec. --- money.gemspec | 1 + 1 file changed, 1 insertion(+) diff --git a/money.gemspec b/money.gemspec index 4edaa800a9..59d100064b 100644 --- a/money.gemspec +++ b/money.gemspec @@ -14,6 +14,7 @@ Gem::Specification.new do |s| s.description = "A Ruby Library for dealing with money and currency conversion." s.license = "MIT" + s.add_dependency "bigdecimal", "~> 3.1" s.add_dependency 'i18n', [">= 0.6.4", '<= 2'] s.add_development_dependency "bundler" From 447bdb7b0ca50c1ba40d9975605716cadfacf47b Mon Sep 17 00:00:00 2001 From: Simon Neutert Date: Sat, 20 Jan 2024 23:21:05 +0100 Subject: [PATCH 3/4] adds bigdecimal as a dependency for future versions --- money.gemspec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/money.gemspec b/money.gemspec index 59d100064b..e1e0c2946d 100644 --- a/money.gemspec +++ b/money.gemspec @@ -14,7 +14,8 @@ Gem::Specification.new do |s| s.description = "A Ruby Library for dealing with money and currency conversion." s.license = "MIT" - s.add_dependency "bigdecimal", "~> 3.1" + + s.add_dependency "bigdecimal", "~> 3.1" if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('6.19.0') s.add_dependency 'i18n', [">= 0.6.4", '<= 2'] s.add_development_dependency "bundler" From f2fd3372b7dc253c1a7b3a025437fb0c11152886 Mon Sep 17 00:00:00 2001 From: Simon Neutert Date: Sat, 20 Jan 2024 23:21:17 +0100 Subject: [PATCH 4/4] changelog and author entry --- AUTHORS | 1 + CHANGELOG.md | 1 + 2 files changed, 2 insertions(+) diff --git a/AUTHORS b/AUTHORS index 78e72b95d6..c5b4d1d1a1 100644 --- a/AUTHORS +++ b/AUTHORS @@ -139,3 +139,4 @@ Yuusuke Takizawa Zubin Henner Бродяной Александр Nicolay Hvidsten +Simon Neutert diff --git a/CHANGELOG.md b/CHANGELOG.md index df9b064756..d9d9a815c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Upcoming - Change Peruvian Sol (PEN) decimal mark and thousands separator. +- Fix deprecation warning for BigDecimal being moved out from stdlib. ## 6.18.0