Skip to content

Commit dcd4f95

Browse files
authored
Merge pull request #195 from RubyMoney/jl-bump-to-2.0.0
Bump to 2.0.0
2 parents 6288094 + fcb8ff7 commit dcd4f95

File tree

16 files changed

+62
-112
lines changed

16 files changed

+62
-112
lines changed

.github/workflows/ruby.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,26 @@ on:
1313
pull_request:
1414
branches: [ main ]
1515

16+
permissions:
17+
contents: read
18+
1619
jobs:
1720
test:
1821

1922
runs-on: ubuntu-latest
2023
strategy:
2124
matrix:
22-
ruby-version: ['2.6', '2.7', '3.0', '3.1', '3.2', '3.3', '3.4']
25+
ruby-version: ['3.1', '3.2', '3.3', '3.4', 'jruby-9.4', 'jruby-10.0']
2326

2427
steps:
25-
- uses: actions/checkout@v4
28+
- name: Set up Java for JRuby 10.0
29+
if: matrix.ruby-version == 'jruby-10.0'
30+
uses: actions/setup-java@v5
31+
with:
32+
distribution: 'temurin'
33+
java-version: '21'
34+
- uses: actions/checkout@v6
2635
- name: Set up Ruby
27-
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
28-
# change this to (see https://github.com/ruby/setup-ruby#versioning):
2936
uses: ruby/setup-ruby@v1
3037
with:
3138
ruby-version: ${{ matrix.ruby-version }}

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# Changelog
22

3-
## Current
3+
## Unreleased
4+
5+
## 2.0.0
6+
- **Breaking change**: Remove deprecated `Monetize.extract_cents`.
7+
- **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)
8+
- **Breaking change**: Drop support for Ruby < 3.1
49
- Fix parsing multiple delimeters in the amount, after BigDecimal updates
510
- Fix unused variable `possible_major` Ruby warning.
611

Gemfile

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
1-
source 'https://rubygems.org'
1+
source "https://rubygems.org"
22

3-
# JSON and I18n gem no longer supports ruby < 2.0.0
4-
if defined?(JRUBY_VERSION)
5-
gem 'json'
6-
elsif RUBY_VERSION =~ /^1/
7-
gem 'json', '~> 1.8.3'
8-
gem 'tins', '~> 1.6.0'
9-
gem 'term-ansicolor', '~> 1.3.0'
10-
gem 'i18n', '~> 0.9'
11-
end
12-
13-
if RUBY_VERSION >= '3.4.0'
14-
gem 'bigdecimal'
15-
end
3+
gem "rake"
4+
gem "rspec", "~> 3.0"
165

176
gemspec

lib/monetize.rb

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
require 'money'
42
require 'monetize/core_extensions'
53
require 'monetize/errors'
@@ -21,8 +19,8 @@ class << self
2119
attr_accessor :enforce_currency_delimiters
2220

2321

24-
# Where this set to true, the behavior for parsing thousands separators is changed to
25-
# expect that eg. €10.000 is EUR 10 000 and not EUR 10.000 - it's incredibly rare when parsing
22+
# Where this set to true, the behavior for parsing thousands separators is changed to
23+
# expect that eg. €10.000 is EUR 10 000 and not EUR 10.000 - it's incredibly rare when parsing
2624
# human text that we're dealing with fractions of cents.
2725
attr_accessor :expect_whole_subunits
2826

@@ -70,12 +68,5 @@ def from_numeric(value, currency = Money.default_currency)
7068
fail ArgumentError, "'value' should be a type of Numeric" unless value.is_a?(Numeric)
7169
Money.from_amount(value, currency)
7270
end
73-
74-
def extract_cents(input, currency = Money.default_currency)
75-
warn '[DEPRECATION] Monetize.extract_cents is deprecated. Use Monetize.parse().cents'
76-
77-
money = parse(input, currency)
78-
money.cents if money
79-
end
8071
end
8172
end

lib/monetize/collection.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
require 'forwardable'
42

53
module Monetize

lib/monetize/core_extensions.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
require 'monetize/core_extensions/nil_class'
42
require 'monetize/core_extensions/numeric'
53
require 'monetize/core_extensions/string'

lib/monetize/core_extensions/hash.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
class Hash
42
def to_money(currency = nil)
53
money_hash = self.respond_to?(:with_indifferent_access) ? self.with_indifferent_access : self

lib/monetize/core_extensions/numeric.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
class Numeric
42
def to_money(currency = nil)
53
Monetize.from_numeric(self, currency || Money.default_currency)

lib/monetize/core_extensions/string.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
class String
42
def to_money(currency = nil)
53
Monetize.parse!(self, currency)

lib/monetize/core_extensions/symbol.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
class Symbol
42
def to_currency
53
Money::Currency.new(self)

0 commit comments

Comments
 (0)