From b794b7b262e78609f32df598eae34c4e1aff0358 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julia=20Lo=CC=81pez?= Date: Thu, 4 Dec 2025 19:21:44 +0100 Subject: [PATCH 1/9] bump to 2.0.0 --- CHANGELOG.md | 5 ++++- lib/monetize/version.rb | 2 +- monetize.gemspec | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d93908f71c..4859401e53 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # Changelog -## Current +## Unreleased + +## 2.0.0 +- **Breaking change**: Update Money gem dependency to ~> 7.0. See the [Money 7.0 upgrading guide](https://github.com/RubyMoney/money/blob/main/UPGRADING-7.0.md) - Fix parsing multiple delimeters in the amount, after BigDecimal updates - Fix unused variable `possible_major` Ruby warning. diff --git a/lib/monetize/version.rb b/lib/monetize/version.rb index 7a7d8eb6cf..b0e83bf800 100644 --- a/lib/monetize/version.rb +++ b/lib/monetize/version.rb @@ -1,5 +1,5 @@ # encoding: utf-8 module Monetize - VERSION = '1.13.0' + VERSION = '2.0.0' end diff --git a/monetize.gemspec b/monetize.gemspec index 9467b2a52f..91221068d8 100644 --- a/monetize.gemspec +++ b/monetize.gemspec @@ -19,7 +19,7 @@ Gem::Specification.new do |spec| spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ['lib'] - spec.add_dependency 'money', '~> 6.12' + spec.add_dependency 'money', '~> 7.0' spec.add_development_dependency 'bundler' spec.add_development_dependency 'rake' From 58d261d0c0398742400498fc43f131cd38d7eb0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julia=20Lo=CC=81pez?= Date: Thu, 4 Dec 2025 19:25:42 +0100 Subject: [PATCH 2/9] drop support for Ruby < 3.1 and add jruby ruby-versions for tests --- .github/workflows/ruby.yml | 15 +++++++++++---- CHANGELOG.md | 1 + 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 809ddb16cb..cc5ee0d187 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -13,19 +13,26 @@ on: pull_request: branches: [ main ] +permissions: + contents: read + jobs: test: runs-on: ubuntu-latest strategy: matrix: - ruby-version: ['2.6', '2.7', '3.0', '3.1', '3.2', '3.3', '3.4'] + ruby-version: ['3.1', '3.2', '3.3', '3.4', 'jruby-9.4', 'jruby-10.0'] steps: - - uses: actions/checkout@v4 + - name: Set up Java for JRuby 10.0 + if: matrix.ruby-version == 'jruby-10.0' + uses: actions/setup-java@v5 + with: + distribution: 'temurin' + java-version: '21' + - uses: actions/checkout@v6 - name: Set up Ruby - # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby, - # change this to (see https://github.com/ruby/setup-ruby#versioning): uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby-version }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 4859401e53..29d24d2bf5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ## 2.0.0 - **Breaking change**: Update Money gem dependency to ~> 7.0. See the [Money 7.0 upgrading guide](https://github.com/RubyMoney/money/blob/main/UPGRADING-7.0.md) +- **Breaking change**: Drop support for Ruby < 3.1 - Fix parsing multiple delimeters in the amount, after BigDecimal updates - Fix unused variable `possible_major` Ruby warning. From 4a2bc2cf4aab05c56bf09be1e3b3d21896fcb24e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julia=20Lo=CC=81pez?= Date: Thu, 4 Dec 2025 19:31:47 +0100 Subject: [PATCH 3/9] fixes after bumping money to 7.0.0 --- spec/core_extensions_spec.rb | 12 ++++++------ spec/monetize_spec.rb | 6 +++--- spec/spec_helper.rb | 2 ++ 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/spec/core_extensions_spec.rb b/spec/core_extensions_spec.rb index 96b0633594..639a3812e2 100644 --- a/spec/core_extensions_spec.rb +++ b/spec/core_extensions_spec.rb @@ -67,8 +67,8 @@ '-1,000' => Money.new(-1_000_00), '1,000.5' => Money.new(1_000_50), '1,000.51' => Money.new(1_000_51), - '1,000.505' => Money.new(1_000_50), # ROUND_HALF_EVEN default bankers rounding - '1,000.515' => Money.new(1_000_52), # ROUND_HALF_EVEN default bankers rounding + '1,000.505' => Money.new(1_000_51), # ROUND_HALF_UP default rounding + '1,000.515' => Money.new(1_000_52), # ROUND_HALF_UP default rounding '1,000.504' => Money.new(1_000_50), '1,000.0000' => Money.new(1_000_00), '1,000.5000' => Money.new(1_000_50), @@ -151,16 +151,16 @@ expect('1.5'.to_money('KWD').cents).to eq 1_500 end - it 'respects Money.rounding_mode' do + it 'respects Money.with_rounding_mode' do expect('1.009'.to_money).to eq(Money.new(1_01)) - Money.rounding_mode(BigDecimal::ROUND_DOWN) do + Money.with_rounding_mode(BigDecimal::ROUND_DOWN) do expect('1.009'.to_money).to eq(Money.new(1_00)) end expect('1.001'.to_money).to eq(Money.new(1_00)) - Money.rounding_mode(BigDecimal::ROUND_UP) do + Money.with_rounding_mode(BigDecimal::ROUND_UP) do expect('1.001'.to_money).to eq(Money.new(1_01)) end end @@ -230,7 +230,7 @@ expect(hash.to_money).to eq(Money.new(100, 'USD')) end end - + context 'when Money to_hash is used' do subject(:hash) { { cents: 100, currency_iso: 'SGD' } } diff --git a/spec/monetize_spec.rb b/spec/monetize_spec.rb index 00aad80025..290e3f202f 100644 --- a/spec/monetize_spec.rb +++ b/spec/monetize_spec.rb @@ -545,13 +545,13 @@ expect(m.currency).to eq Money::Currency.wrap('EUR') end - context 'infinite_precision = true' do + context 'default_infinite_precision = true' do before do - Money.infinite_precision = true + Money.default_infinite_precision = true end after do - Money.infinite_precision = false + Money.default_infinite_precision = false end it 'keeps precision' do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 51f6235e25..1176c3e9a6 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -2,6 +2,8 @@ require 'money' +Money.default_currency = 'USD' + RSpec.configure do |config| config.order = 'random' end From 4f6cae17493b52537fb49d957552c0d2ff8ca33c Mon Sep 17 00:00:00 2001 From: Sunny Ripert Date: Thu, 4 Dec 2025 19:31:57 +0100 Subject: [PATCH 4/9] Remove extra cents --- CHANGELOG.md | 1 + lib/monetize.rb | 11 ++--------- spec/monetize_spec.rb | 20 -------------------- spec/spec_helper.rb | 2 +- 4 files changed, 4 insertions(+), 30 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 29d24d2bf5..16b5377283 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Unreleased ## 2.0.0 +- **Breaking change**: Remove deprecated `Monetize.extract_cents`. - **Breaking change**: Update Money gem dependency to ~> 7.0. See the [Money 7.0 upgrading guide](https://github.com/RubyMoney/money/blob/main/UPGRADING-7.0.md) - **Breaking change**: Drop support for Ruby < 3.1 - Fix parsing multiple delimeters in the amount, after BigDecimal updates diff --git a/lib/monetize.rb b/lib/monetize.rb index dfedaba7de..6dbd0505b1 100644 --- a/lib/monetize.rb +++ b/lib/monetize.rb @@ -21,8 +21,8 @@ class << self attr_accessor :enforce_currency_delimiters - # Where this set to true, the behavior for parsing thousands separators is changed to - # expect that eg. €10.000 is EUR 10 000 and not EUR 10.000 - it's incredibly rare when parsing + # Where this set to true, the behavior for parsing thousands separators is changed to + # expect that eg. €10.000 is EUR 10 000 and not EUR 10.000 - it's incredibly rare when parsing # human text that we're dealing with fractions of cents. attr_accessor :expect_whole_subunits @@ -70,12 +70,5 @@ def from_numeric(value, currency = Money.default_currency) fail ArgumentError, "'value' should be a type of Numeric" unless value.is_a?(Numeric) Money.from_amount(value, currency) end - - def extract_cents(input, currency = Money.default_currency) - warn '[DEPRECATION] Monetize.extract_cents is deprecated. Use Monetize.parse().cents' - - money = parse(input, currency) - money.cents if money - end end end diff --git a/spec/monetize_spec.rb b/spec/monetize_spec.rb index 290e3f202f..085a5d52b1 100644 --- a/spec/monetize_spec.rb +++ b/spec/monetize_spec.rb @@ -605,26 +605,6 @@ end end - describe '.extract_cents' do - it 'is deprecated' do - allow(Monetize).to receive(:warn) - - Monetize.extract_cents('100') - - expect(Monetize) - .to have_received(:warn) - .with('[DEPRECATION] Monetize.extract_cents is deprecated. Use Monetize.parse().cents') - end - - it 'extracts cents from a given string' do - expect(Monetize.extract_cents('10.99')).to eq(1099) - end - - it "correctly treats pipe marks '|' in input (regression test)" do - expect(Monetize.extract_cents('100|0')).to eq Monetize.extract_cents('100!0') - end - end - context 'given the same inputs to .parse and .from_*' do it 'gives the same results' do expect(4.635.to_money).to eq '4.635'.to_money diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 1176c3e9a6..ec2253600d 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -2,7 +2,7 @@ require 'money' -Money.default_currency = 'USD' +Money.default_currency = Money::Currency.new("USD") RSpec.configure do |config| config.order = 'random' From 016b6d3dd68d78f5614c2a885c7fa52fc1216af0 Mon Sep 17 00:00:00 2001 From: Sunny Ripert Date: Thu, 4 Dec 2025 19:45:03 +0100 Subject: [PATCH 5/9] Spec fix --- lib/monetize/parser.rb | 7 ++++--- spec/monetize_spec.rb | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/monetize/parser.rb b/lib/monetize/parser.rb index bace626ade..b4e6b0f96e 100644 --- a/lib/monetize/parser.rb +++ b/lib/monetize/parser.rb @@ -30,7 +30,7 @@ class Parser 'NT$'=> 'TWD', '₱' => 'PHP', } - + CURRENCY_SYMBOL_REGEX = /(? 3, 'M' => 6, 'B' => 9, 'T' => 12 } MULTIPLIER_SUFFIXES.default = 0 @@ -80,8 +80,9 @@ def parse_currency computed_currency = nil unless Monetize::Parser::CURRENCY_SYMBOLS.value?(computed_currency) computed_currency ||= compute_currency if assume_from_symbol? - - computed_currency || fallback_currency || Money.default_currency + found = computed_currency || fallback_currency || Money.default_currency + raise Money::Currency::UnknownCurrency unless found + found end def assume_from_symbol? diff --git a/spec/monetize_spec.rb b/spec/monetize_spec.rb index 085a5d52b1..2b7081f6b0 100644 --- a/spec/monetize_spec.rb +++ b/spec/monetize_spec.rb @@ -192,7 +192,7 @@ end it 'raises an error if currency code is invalid' do - expect { '20.00 OMG'.to_money }.to raise_error + expect { '20.00 OMG'.to_money }.to raise_error(Monetize::ParseError) end end end From 7e97b2d64f169eacd95c5bce1c8a1fd12b96797d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julia=20Lo=CC=81pez?= Date: Wed, 10 Dec 2025 18:42:53 +0100 Subject: [PATCH 6/9] remove unnecessary encoding declarations --- lib/monetize.rb | 2 -- lib/monetize/collection.rb | 2 -- lib/monetize/core_extensions.rb | 2 -- lib/monetize/core_extensions/hash.rb | 2 -- lib/monetize/core_extensions/numeric.rb | 2 -- lib/monetize/core_extensions/string.rb | 2 -- lib/monetize/core_extensions/symbol.rb | 2 -- lib/monetize/parser.rb | 2 -- lib/monetize/version.rb | 2 -- monetize.gemspec | 1 - spec/core_extensions_spec.rb | 2 -- spec/monetize_spec.rb | 2 -- spec/spec_helper.rb | 2 -- 13 files changed, 25 deletions(-) diff --git a/lib/monetize.rb b/lib/monetize.rb index 6dbd0505b1..1ec63d360f 100644 --- a/lib/monetize.rb +++ b/lib/monetize.rb @@ -1,5 +1,3 @@ -# encoding: utf-8 - require 'money' require 'monetize/core_extensions' require 'monetize/errors' diff --git a/lib/monetize/collection.rb b/lib/monetize/collection.rb index 9e288728f4..7c79ff9e4a 100644 --- a/lib/monetize/collection.rb +++ b/lib/monetize/collection.rb @@ -1,5 +1,3 @@ -# encoding: utf-8 - require 'forwardable' module Monetize diff --git a/lib/monetize/core_extensions.rb b/lib/monetize/core_extensions.rb index 510c6b7d42..98908c0659 100644 --- a/lib/monetize/core_extensions.rb +++ b/lib/monetize/core_extensions.rb @@ -1,5 +1,3 @@ -# encoding: utf-8 - require 'monetize/core_extensions/nil_class' require 'monetize/core_extensions/numeric' require 'monetize/core_extensions/string' diff --git a/lib/monetize/core_extensions/hash.rb b/lib/monetize/core_extensions/hash.rb index a34826aa58..3dec40fc90 100644 --- a/lib/monetize/core_extensions/hash.rb +++ b/lib/monetize/core_extensions/hash.rb @@ -1,5 +1,3 @@ -# encoding: utf-8 - class Hash def to_money(currency = nil) money_hash = self.respond_to?(:with_indifferent_access) ? self.with_indifferent_access : self diff --git a/lib/monetize/core_extensions/numeric.rb b/lib/monetize/core_extensions/numeric.rb index 4ed2908260..3dea284e6a 100644 --- a/lib/monetize/core_extensions/numeric.rb +++ b/lib/monetize/core_extensions/numeric.rb @@ -1,5 +1,3 @@ -# encoding: utf-8 - class Numeric def to_money(currency = nil) Monetize.from_numeric(self, currency || Money.default_currency) diff --git a/lib/monetize/core_extensions/string.rb b/lib/monetize/core_extensions/string.rb index 812defd182..c8daa6f1e4 100644 --- a/lib/monetize/core_extensions/string.rb +++ b/lib/monetize/core_extensions/string.rb @@ -1,5 +1,3 @@ -# encoding: utf-8 - class String def to_money(currency = nil) Monetize.parse!(self, currency) diff --git a/lib/monetize/core_extensions/symbol.rb b/lib/monetize/core_extensions/symbol.rb index a5d1a2ac0d..f5d6f90c86 100644 --- a/lib/monetize/core_extensions/symbol.rb +++ b/lib/monetize/core_extensions/symbol.rb @@ -1,5 +1,3 @@ -# encoding: utf-8 - class Symbol def to_currency Money::Currency.new(self) diff --git a/lib/monetize/parser.rb b/lib/monetize/parser.rb index b4e6b0f96e..a91810c2cf 100644 --- a/lib/monetize/parser.rb +++ b/lib/monetize/parser.rb @@ -1,5 +1,3 @@ -# encoding: utf-8 - module Monetize class Parser CURRENCY_SYMBOLS = { diff --git a/lib/monetize/version.rb b/lib/monetize/version.rb index b0e83bf800..e48b66a49c 100644 --- a/lib/monetize/version.rb +++ b/lib/monetize/version.rb @@ -1,5 +1,3 @@ -# encoding: utf-8 - module Monetize VERSION = '2.0.0' end diff --git a/monetize.gemspec b/monetize.gemspec index 91221068d8..99c6c53c13 100644 --- a/monetize.gemspec +++ b/monetize.gemspec @@ -1,4 +1,3 @@ -# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'monetize/version' diff --git a/spec/core_extensions_spec.rb b/spec/core_extensions_spec.rb index 639a3812e2..612cf91724 100644 --- a/spec/core_extensions_spec.rb +++ b/spec/core_extensions_spec.rb @@ -1,5 +1,3 @@ -# encoding: utf-8 - require 'spec_helper' require 'monetize' require 'monetize/core_extensions' diff --git a/spec/monetize_spec.rb b/spec/monetize_spec.rb index 2b7081f6b0..f717793877 100644 --- a/spec/monetize_spec.rb +++ b/spec/monetize_spec.rb @@ -1,5 +1,3 @@ -# encoding: utf-8 - require 'spec_helper' require 'monetize' diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index ec2253600d..186a076759 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,5 +1,3 @@ -# encoding: utf-8 - require 'money' Money.default_currency = Money::Currency.new("USD") From 2e8218e8df74849486c2697c8eb1168bba837e97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julia=20Lo=CC=81pez?= Date: Wed, 10 Dec 2025 18:44:27 +0100 Subject: [PATCH 7/9] simplify Gemfile since we dropped support for old ruby versions --- Gemfile | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/Gemfile b/Gemfile index 14dee0295b..c3de619789 100644 --- a/Gemfile +++ b/Gemfile @@ -1,15 +1,5 @@ source 'https://rubygems.org' -# JSON and I18n gem no longer supports ruby < 2.0.0 -if defined?(JRUBY_VERSION) - gem 'json' -elsif RUBY_VERSION =~ /^1/ - gem 'json', '~> 1.8.3' - gem 'tins', '~> 1.6.0' - gem 'term-ansicolor', '~> 1.3.0' - gem 'i18n', '~> 0.9' -end - if RUBY_VERSION >= '3.4.0' gem 'bigdecimal' end From e1383a33ccc38ba5d6e16b9e8ca505abc29211a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julia=20Lo=CC=81pez?= Date: Wed, 10 Dec 2025 18:50:48 +0100 Subject: [PATCH 8/9] move dev dependencies to the Gemfile and :nail_care: changes --- Gemfile | 7 +++---- monetize.gemspec | 37 ++++++++++++++++++------------------- 2 files changed, 21 insertions(+), 23 deletions(-) diff --git a/Gemfile b/Gemfile index c3de619789..500ec730b1 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,6 @@ -source 'https://rubygems.org' +source "https://rubygems.org" -if RUBY_VERSION >= '3.4.0' - gem 'bigdecimal' -end +gem "rake" +gem "rspec", "~> 3.0" gemspec diff --git a/monetize.gemspec b/monetize.gemspec index 99c6c53c13..72c6d5aed2 100644 --- a/monetize.gemspec +++ b/monetize.gemspec @@ -1,33 +1,32 @@ -lib = File.expand_path('../lib', __FILE__) +lib = File.expand_path("../lib", __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) -require 'monetize/version' -require 'English' +require "monetize/version" +require "English" Gem::Specification.new do |spec| - spec.name = 'monetize' + spec.name = "monetize" spec.version = Monetize::VERSION - spec.authors = ['Shane Emmons', 'Anthony Dmitriyev'] - spec.email = ['shane@emmons.io', 'anthony.dmitriyev@gmail.com'] - spec.description = 'A library for converting various objects into `Money` objects.' - spec.summary = 'A library for converting various objects into `Money` objects.' - spec.homepage = 'https://github.com/RubyMoney/monetize' - spec.license = 'MIT' + spec.platform = Gem::Platform::RUBY + spec.authors = ["Shane Emmons", "Anthony Dmitriyev"] + spec.email = ["shane@emmons.io", "anthony.dmitriyev@gmail.com"] + spec.description = "A library for converting various objects into `Money` objects." + spec.summary = "A library for converting various objects into `Money` objects." + spec.homepage = "https://github.com/RubyMoney/monetize" + spec.license = "MIT" spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR) spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) - spec.require_paths = ['lib'] + spec.require_paths = ["lib"] - spec.add_dependency 'money', '~> 7.0' + spec.add_dependency "money", "~> 7.0" - spec.add_development_dependency 'bundler' - spec.add_development_dependency 'rake' - spec.add_development_dependency 'rspec', '~> 3.0' + spec.required_ruby_version = ">= 3.1" if spec.respond_to?(:metadata) - spec.metadata['changelog_uri'] = 'https://github.com/RubyMoney/monetize/blob/master/CHANGELOG.md' - spec.metadata['source_code_uri'] = 'https://github.com/RubyMoney/monetize/' - spec.metadata['bug_tracker_uri'] = 'https://github.com/RubyMoney/monetize/issues' - spec.metadata['rubygems_mfa_required'] = 'true' + spec.metadata["changelog_uri"] = "https://github.com/RubyMoney/monetize/blob/master/CHANGELOG.md" + spec.metadata["source_code_uri"] = "https://github.com/RubyMoney/monetize/" + spec.metadata["bug_tracker_uri"] = "https://github.com/RubyMoney/monetize/issues" + spec.metadata["rubygems_mfa_required"] = "true" end end From fcb8ff7803493f31aae6fb0bb11af8b721a3d655 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julia=20Lo=CC=81pez?= Date: Wed, 10 Dec 2025 18:55:24 +0100 Subject: [PATCH 9/9] align gemspec style to the one of the money gem --- monetize.gemspec | 45 ++++++++++++++++++++++----------------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/monetize.gemspec b/monetize.gemspec index 72c6d5aed2..9827951db7 100644 --- a/monetize.gemspec +++ b/monetize.gemspec @@ -1,32 +1,31 @@ -lib = File.expand_path("../lib", __FILE__) +# frozen_string_literal: true + +lib = File.expand_path("lib", __dir__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require "monetize/version" -require "English" -Gem::Specification.new do |spec| - spec.name = "monetize" - spec.version = Monetize::VERSION - spec.platform = Gem::Platform::RUBY - spec.authors = ["Shane Emmons", "Anthony Dmitriyev"] - spec.email = ["shane@emmons.io", "anthony.dmitriyev@gmail.com"] - spec.description = "A library for converting various objects into `Money` objects." - spec.summary = "A library for converting various objects into `Money` objects." - spec.homepage = "https://github.com/RubyMoney/monetize" - spec.license = "MIT" +Gem::Specification.new do |s| + s.name = "monetize" + s.version = Monetize::VERSION + s.platform = Gem::Platform::RUBY + s.authors = ["Shane Emmons", "Anthony Dmitriyev"] + s.email = ["shane@emmons.io", "anthony.dmitriyev@gmail.com"] + s.homepage = "https://github.com/RubyMoney/monetize" + s.summary = "A library for converting various objects into `Money` objects." + s.description = "A library for converting various objects into `Money` objects." + s.license = "MIT" - spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR) - spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } - spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) - spec.require_paths = ["lib"] + s.add_dependency "money", "~> 7.0" - spec.add_dependency "money", "~> 7.0" + s.required_ruby_version = ">= 3.1" - spec.required_ruby_version = ">= 3.1" + s.files = `git ls-files -z -- lib/* CHANGELOG.md LICENSE monetize.gemspec README.md`.split("\x0") + s.require_paths = ["lib"] - if spec.respond_to?(:metadata) - spec.metadata["changelog_uri"] = "https://github.com/RubyMoney/monetize/blob/master/CHANGELOG.md" - spec.metadata["source_code_uri"] = "https://github.com/RubyMoney/monetize/" - spec.metadata["bug_tracker_uri"] = "https://github.com/RubyMoney/monetize/issues" - spec.metadata["rubygems_mfa_required"] = "true" + if s.respond_to?(:metadata) + s.metadata["changelog_uri"] = "https://github.com/RubyMoney/monetize/blob/master/CHANGELOG.md" + s.metadata["source_code_uri"] = "https://github.com/RubyMoney/monetize/" + s.metadata["bug_tracker_uri"] = "https://github.com/RubyMoney/monetize/issues" + s.metadata["rubygems_mfa_required"] = "true" end end