monetize 1.13.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 07adb2e223118b56f5944a6b90b8c51901df761f6b5ecebea8fd8ee8dea3343e
4
- data.tar.gz: a61b3fda9d0c22fefb028043db74625c91083787068b31ecf639a05286f92cff
3
+ metadata.gz: 77ba1cf94643805ce15012361fda9aaadf3d029483b7c5e557dae4a0cd220c2f
4
+ data.tar.gz: 8b9d5c77362a24cb9483d2cd02a0f35e5382a289c0eaacc8e44716408ef2a228
5
5
  SHA512:
6
- metadata.gz: 6d4774d81cc075b5c68849cd07c69f2311683f16adfbb00075d85e7530f4a1cb052a82a1b772b812b9b029fbe47b8b4400aabb0588ce27a35ef6e9d6340122cb
7
- data.tar.gz: c5e7266b20bf556a2619974f8d97a690e6817eec1a56e9cd0497c6569bc36c681fc417c19900fa95c1ae7fcf7c10569867bec072d4a25e8c99d6f49c0b9901e1
6
+ metadata.gz: 528b67577977e7fb1300cac86a086cc16d9a1941bb93270ed913b83c898b35b3c853583113ece518aeee68f099c0d5ee03bf559a68dffbabc4ed52aa3aaefdce
7
+ data.tar.gz: d64891590b9c964dc7324f57e45262471922be81248914f8c4430649a9ee17a23e019ae99171762d27b07c1888db51d23f0be580cc0977fd0fa069e3aa7a6563
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
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
9
+ - Fix parsing multiple delimeters in the amount, after BigDecimal updates
10
+ - Fix unused variable `possible_major` Ruby warning.
11
+
12
+ ## 1.13.0
13
+ - **Breaking change**: check ISO currency code validity when parsing strings with `to_money`
14
+ - Adds `expect_whole_subunits` option when fractional subunits are expected
15
+ - Add MYR, IDR, SGD, HKD, TWD, and PHP symbol to currency conversion
16
+
3
17
  ## 1.12.0
4
18
  - Update `to_money` to match money-rails to_hash.
5
19
 
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2024 Shane Emmons
3
+ Copyright (c) 2025 Shane Emmons
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1,9 +1,7 @@
1
1
  # Monetize
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/monetize.svg)](http://badge.fury.io/rb/monetize)
4
- [![Build Status](https://travis-ci.org/RubyMoney/monetize.svg?branch=master)](https://travis-ci.org/RubyMoney/monetize)
5
- [![Code Climate](https://codeclimate.com/github/RubyMoney/monetize.svg)](https://codeclimate.com/github/RubyMoney/monetize)
6
- [![Dependency Status](https://gemnasium.com/RubyMoney/monetize.svg)](https://gemnasium.com/RubyMoney/monetize)
4
+ [![Ruby](https://github.com/RubyMoney/monetize/actions/workflows/ruby.yml/badge.svg)](https://github.com/RubyMoney/monetize/actions/workflows/ruby.yml)
7
5
  [![License](https://img.shields.io/badge/license-MIT-green.svg)](http://opensource.org/licenses/MIT)
8
6
 
9
7
  A library for converting various objects into `Money` objects.
@@ -28,16 +26,6 @@ Monetize.parse("GBP 100") == Money.new(100_00, "GBP")
28
26
  "100".to_money == Money.new(100_00, "USD")
29
27
  ```
30
28
 
31
- `parse` will return `nil` if it is unable to parse the input. Use `parse!` instead if you want a `Monetize::Error` (or one of the subclasses) to be raised instead:
32
-
33
- ```ruby
34
- >> Monetize.parse('OMG 100')
35
- => nil
36
-
37
- >> Monetize.parse!('OMG 100')
38
- Monetize::ParseError: Unknown currency 'omg'
39
- ```
40
-
41
29
  Optionally, enable the ability to assume the currency from a passed symbol. Otherwise, currency symbols will be ignored, and USD used as the default currency:
42
30
 
43
31
  ```ruby
@@ -49,7 +37,7 @@ Monetize.parse("£100") == Money.new(100_00, "GBP")
49
37
  "€100".to_money == Money.new(100_00, "EUR")
50
38
  ```
51
39
 
52
- Parsing can be improved where the input is not expected to contain fractonal subunits.
40
+ Parsing can be improved where the input is not expected to contain fractional subunits.
53
41
  To do this, set `Monetize.expect_whole_subunits = true`
54
42
 
55
43
  ```ruby
@@ -60,7 +48,7 @@ Monetize.parse('EUR 10,000') == Money.new(10_000_00, "EUR")
60
48
  ```
61
49
 
62
50
  Why does this work? If we expect fractional subunits then the parser will treat a single
63
- delimiter as a decimal marker if it matches the currency's decimal marker. But often
51
+ delimiter as a decimal marker if it matches the currency's decimal marker. But often
64
52
  this is not the case - a European site will show $10.000 because that's the local format.
65
53
  As a human, if this was a stock ticker we might expect fractional cents. If it's a retail price we know it's actually an incorrect thousands separator.
66
54
 
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  require 'forwardable'
4
2
 
5
3
  module Monetize
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  class Hash
4
2
  def to_money(currency = nil)
5
3
  money_hash = self.respond_to?(:with_indifferent_access) ? self.with_indifferent_access : self
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  class Numeric
4
2
  def to_money(currency = nil)
5
3
  Monetize.from_numeric(self, currency || Money.default_currency)
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  class String
4
2
  def to_money(currency = nil)
5
3
  Monetize.parse!(self, currency)
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  class Symbol
4
2
  def to_currency
5
3
  Money::Currency.new(self)
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  require 'monetize/core_extensions/nil_class'
4
2
  require 'monetize/core_extensions/numeric'
5
3
  require 'monetize/core_extensions/string'
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  module Monetize
4
2
  class Parser
5
3
  CURRENCY_SYMBOLS = {
@@ -31,6 +29,7 @@ module Monetize
31
29
  '₱' => 'PHP',
32
30
  }
33
31
 
32
+ CURRENCY_SYMBOL_REGEX = /(?<![A-Z])(#{CURRENCY_SYMBOLS.keys.map { |key| Regexp.escape(key) }.join('|')})(?![A-Z])/i
34
33
  MULTIPLIER_SUFFIXES = { 'K' => 3, 'M' => 6, 'B' => 9, 'T' => 12 }
35
34
  MULTIPLIER_SUFFIXES.default = 0
36
35
  MULTIPLIER_REGEXP = Regexp.new(format('^(.*?\d)(%s)\b([^\d]*)$', MULTIPLIER_SUFFIXES.keys.join('|')), 'i')
@@ -79,8 +78,9 @@ module Monetize
79
78
  computed_currency = nil unless Monetize::Parser::CURRENCY_SYMBOLS.value?(computed_currency)
80
79
  computed_currency ||= compute_currency if assume_from_symbol?
81
80
 
82
-
83
- computed_currency || fallback_currency || Money.default_currency
81
+ found = computed_currency || fallback_currency || Money.default_currency
82
+ raise Money::Currency::UnknownCurrency unless found
83
+ found
84
84
  end
85
85
 
86
86
  def assume_from_symbol?
@@ -100,7 +100,7 @@ module Monetize
100
100
  end
101
101
 
102
102
  def compute_currency
103
- match = input.match(currency_symbol_regex)
103
+ match = input.match(CURRENCY_SYMBOL_REGEX)
104
104
  CURRENCY_SYMBOLS[match.to_s] if match
105
105
  end
106
106
 
@@ -126,7 +126,7 @@ module Monetize
126
126
 
127
127
  def extract_major_minor_with_single_delimiter(num, currency, delimiter)
128
128
  if expect_whole_subunits?
129
- possible_major, possible_minor = split_major_minor(num, delimiter)
129
+ _possible_major, possible_minor = split_major_minor(num, delimiter)
130
130
  if minor_has_correct_dp_for_currency_subunit?(possible_minor, currency)
131
131
  split_major_minor(num, delimiter)
132
132
  else
@@ -179,17 +179,11 @@ module Monetize
179
179
  result
180
180
  end
181
181
 
182
- def regex_safe_symbols
183
- CURRENCY_SYMBOLS.keys.map { |key| Regexp.escape(key) }.join('|')
184
- end
185
-
186
182
  def split_major_minor(num, delimiter)
187
- major, minor = num.split(delimiter)
188
- [major, minor || '00']
189
- end
183
+ splits = num.split(delimiter)
184
+ fail ParseError, 'Invalid amount (multiple delimiters)' if splits.length > 2
190
185
 
191
- def currency_symbol_regex
192
- /(?<![A-Z])(#{regex_safe_symbols})(?![A-Z])/i
186
+ [splits[0], splits[1] || '00']
193
187
  end
194
188
  end
195
189
  end
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  module Monetize
4
- VERSION = '1.13.0'
2
+ VERSION = '2.0.0'
5
3
  end
data/lib/monetize.rb CHANGED
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  require 'money'
4
2
  require 'monetize/core_extensions'
5
3
  require 'monetize/errors'
@@ -21,8 +19,8 @@ module Monetize
21
19
  attr_accessor :enforce_currency_delimiters
22
20
 
23
21
 
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
26
24
  # human text that we're dealing with fractions of cents.
27
25
  attr_accessor :expect_whole_subunits
28
26
 
@@ -70,12 +68,5 @@ module Monetize
70
68
  fail ArgumentError, "'value' should be a type of Numeric" unless value.is_a?(Numeric)
71
69
  Money.from_amount(value, currency)
72
70
  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
80
71
  end
81
72
  end
data/monetize.gemspec CHANGED
@@ -1,33 +1,31 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
1
+ # frozen_string_literal: true
2
+
3
+ lib = File.expand_path("lib", __dir__)
3
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'monetize/version'
5
- require 'English'
5
+ require "monetize/version"
6
6
 
7
- Gem::Specification.new do |spec|
8
- spec.name = 'monetize'
9
- spec.version = Monetize::VERSION
10
- spec.authors = ['Shane Emmons', 'Anthony Dmitriyev']
11
- spec.email = ['shane@emmons.io', 'anthony.dmitriyev@gmail.com']
12
- spec.description = 'A library for converting various objects into `Money` objects.'
13
- spec.summary = 'A library for converting various objects into `Money` objects.'
14
- spec.homepage = 'https://github.com/RubyMoney/monetize'
15
- spec.license = 'MIT'
7
+ Gem::Specification.new do |s|
8
+ s.name = "monetize"
9
+ s.version = Monetize::VERSION
10
+ s.platform = Gem::Platform::RUBY
11
+ s.authors = ["Shane Emmons", "Anthony Dmitriyev"]
12
+ s.email = ["shane@emmons.io", "anthony.dmitriyev@gmail.com"]
13
+ s.homepage = "https://github.com/RubyMoney/monetize"
14
+ s.summary = "A library for converting various objects into `Money` objects."
15
+ s.description = "A library for converting various objects into `Money` objects."
16
+ s.license = "MIT"
16
17
 
17
- spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
18
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
19
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
- spec.require_paths = ['lib']
18
+ s.add_dependency "money", "~> 7.0"
21
19
 
22
- spec.add_dependency 'money', '~> 6.12'
20
+ s.required_ruby_version = ">= 3.1"
23
21
 
24
- spec.add_development_dependency 'bundler'
25
- spec.add_development_dependency 'rake', '~> 10.2'
26
- spec.add_development_dependency 'rspec', '~> 3.0'
22
+ s.files = `git ls-files -z -- lib/* CHANGELOG.md LICENSE monetize.gemspec README.md`.split("\x0")
23
+ s.require_paths = ["lib"]
27
24
 
28
- if spec.respond_to?(:metadata)
29
- spec.metadata['changelog_uri'] = 'https://github.com/RubyMoney/monetize/blob/master/CHANGELOG.md'
30
- spec.metadata['source_code_uri'] = 'https://github.com/RubyMoney/monetize/'
31
- spec.metadata['bug_tracker_uri'] = 'https://github.com/RubyMoney/monetize/issues'
25
+ if s.respond_to?(:metadata)
26
+ s.metadata["changelog_uri"] = "https://github.com/RubyMoney/monetize/blob/master/CHANGELOG.md"
27
+ s.metadata["source_code_uri"] = "https://github.com/RubyMoney/monetize/"
28
+ s.metadata["bug_tracker_uri"] = "https://github.com/RubyMoney/monetize/issues"
29
+ s.metadata["rubygems_mfa_required"] = "true"
32
30
  end
33
31
  end
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: monetize
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.13.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shane Emmons
8
8
  - Anthony Dmitriyev
9
- autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2024-01-29 00:00:00.000000000 Z
11
+ date: 1980-01-02 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: money
@@ -17,56 +16,14 @@ dependencies:
17
16
  requirements:
18
17
  - - "~>"
19
18
  - !ruby/object:Gem::Version
20
- version: '6.12'
19
+ version: '7.0'
21
20
  type: :runtime
22
21
  prerelease: false
23
22
  version_requirements: !ruby/object:Gem::Requirement
24
23
  requirements:
25
24
  - - "~>"
26
25
  - !ruby/object:Gem::Version
27
- version: '6.12'
28
- - !ruby/object:Gem::Dependency
29
- name: bundler
30
- requirement: !ruby/object:Gem::Requirement
31
- requirements:
32
- - - ">="
33
- - !ruby/object:Gem::Version
34
- version: '0'
35
- type: :development
36
- prerelease: false
37
- version_requirements: !ruby/object:Gem::Requirement
38
- requirements:
39
- - - ">="
40
- - !ruby/object:Gem::Version
41
- version: '0'
42
- - !ruby/object:Gem::Dependency
43
- name: rake
44
- requirement: !ruby/object:Gem::Requirement
45
- requirements:
46
- - - "~>"
47
- - !ruby/object:Gem::Version
48
- version: '10.2'
49
- type: :development
50
- prerelease: false
51
- version_requirements: !ruby/object:Gem::Requirement
52
- requirements:
53
- - - "~>"
54
- - !ruby/object:Gem::Version
55
- version: '10.2'
56
- - !ruby/object:Gem::Dependency
57
- name: rspec
58
- requirement: !ruby/object:Gem::Requirement
59
- requirements:
60
- - - "~>"
61
- - !ruby/object:Gem::Version
62
- version: '3.0'
63
- type: :development
64
- prerelease: false
65
- version_requirements: !ruby/object:Gem::Requirement
66
- requirements:
67
- - - "~>"
68
- - !ruby/object:Gem::Version
69
- version: '3.0'
26
+ version: '7.0'
70
27
  description: A library for converting various objects into `Money` objects.
71
28
  email:
72
29
  - shane@emmons.io
@@ -75,15 +32,9 @@ executables: []
75
32
  extensions: []
76
33
  extra_rdoc_files: []
77
34
  files:
78
- - ".github/workflows/ruby.yml"
79
- - ".gitignore"
80
- - ".rubocop.yml"
81
35
  - CHANGELOG.md
82
- - CONTRIBUTING.md
83
- - Gemfile
84
36
  - LICENSE
85
37
  - README.md
86
- - Rakefile
87
38
  - lib/monetize.rb
88
39
  - lib/monetize/collection.rb
89
40
  - lib/monetize/core_extensions.rb
@@ -96,9 +47,6 @@ files:
96
47
  - lib/monetize/parser.rb
97
48
  - lib/monetize/version.rb
98
49
  - monetize.gemspec
99
- - spec/core_extensions_spec.rb
100
- - spec/monetize_spec.rb
101
- - spec/spec_helper.rb
102
50
  homepage: https://github.com/RubyMoney/monetize
103
51
  licenses:
104
52
  - MIT
@@ -106,7 +54,7 @@ metadata:
106
54
  changelog_uri: https://github.com/RubyMoney/monetize/blob/master/CHANGELOG.md
107
55
  source_code_uri: https://github.com/RubyMoney/monetize/
108
56
  bug_tracker_uri: https://github.com/RubyMoney/monetize/issues
109
- post_install_message:
57
+ rubygems_mfa_required: 'true'
110
58
  rdoc_options: []
111
59
  require_paths:
112
60
  - lib
@@ -114,18 +62,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
114
62
  requirements:
115
63
  - - ">="
116
64
  - !ruby/object:Gem::Version
117
- version: '0'
65
+ version: '3.1'
118
66
  required_rubygems_version: !ruby/object:Gem::Requirement
119
67
  requirements:
120
68
  - - ">="
121
69
  - !ruby/object:Gem::Version
122
70
  version: '0'
123
71
  requirements: []
124
- rubygems_version: 3.5.3
125
- signing_key:
72
+ rubygems_version: 4.0.0
126
73
  specification_version: 4
127
74
  summary: A library for converting various objects into `Money` objects.
128
- test_files:
129
- - spec/core_extensions_spec.rb
130
- - spec/monetize_spec.rb
131
- - spec/spec_helper.rb
75
+ test_files: []
@@ -1,34 +0,0 @@
1
- # This workflow uses actions that are not certified by GitHub.
2
- # They are provided by a third-party and are governed by
3
- # separate terms of service, privacy policy, and support
4
- # documentation.
5
- # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
- # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
-
8
- name: Ruby
9
-
10
- on:
11
- push:
12
- branches: [ main ]
13
- pull_request:
14
- branches: [ main ]
15
-
16
- jobs:
17
- test:
18
-
19
- runs-on: ubuntu-latest
20
- strategy:
21
- matrix:
22
- ruby-version: ['2.6', '2.7', '3.0', '3.1', '3.2']
23
-
24
- steps:
25
- - uses: actions/checkout@v3
26
- - 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):
29
- uses: ruby/setup-ruby@v1
30
- with:
31
- ruby-version: ${{ matrix.ruby-version }}
32
- bundler-cache: true # runs 'bundle install' and caches installed gems automatically
33
- - name: Run tests
34
- run: bundle exec rspec spec
data/.gitignore DELETED
@@ -1,18 +0,0 @@
1
- *.gem
2
- *.rbc
3
- .bundle
4
- .config
5
- .yardoc
6
- Gemfile.lock
7
- InstalledFiles
8
- _yardoc
9
- coverage
10
- doc/
11
- lib/bundler/man
12
- pkg
13
- rdoc
14
- spec/reports
15
- test/tmp
16
- test/version_tmp
17
- tmp
18
- .ruby-version
data/.rubocop.yml DELETED
@@ -1,32 +0,0 @@
1
- Documentation:
2
- Enabled: false
3
- Metrics/AbcSize:
4
- Enabled: false
5
- Metrics/ClassLength:
6
- Enabled: false
7
- Metrics/MethodLength:
8
- Enabled: false
9
- Metrics/ModuleLength:
10
- Enabled: false
11
- Style/AndOr:
12
- Enabled: false
13
- Style/ClassAndModuleChildren:
14
- Enabled: false
15
- Style/PerlBackrefs:
16
- Enabled: false
17
-
18
- Style/CollectionMethods:
19
- Enabled: yes
20
- Lint/LiteralInInterpolation:
21
- Enabled: yes
22
-
23
- Metrics/LineLength:
24
- Max: 120
25
- Metrics/ParameterLists:
26
- CountKeywordArgs: false
27
- Style/DotPosition:
28
- EnforcedStyle: trailing
29
- Style/EmptyElse:
30
- EnforcedStyle: empty
31
- Style/SpaceInsideHashLiteralBraces:
32
- EnforcedStyle: no_space
data/CONTRIBUTING.md DELETED
@@ -1,20 +0,0 @@
1
- # Contribution Guidelines
2
-
3
- ## Steps
4
-
5
- 1. Fork [the repo](https://github.com/RubyMoney/monetize)
6
- 2. Grab dependencies: `bundle install`
7
- 3. Make sure everything is working: `bundle exec rspec spec`
8
- 4. Create your feature branch (`git checkout -b my-new-feature`)
9
- 5. Make your changes
10
- 6. Test your changes
11
- 7. Commit your changes (`git commit -am 'Add some feature'`)
12
- 8. Push to the branch (`git push origin my-new-feature`)
13
- 9. Create a Pull Request
14
- 10. Celebrate!!!!!
15
-
16
- ## Notes
17
-
18
- When contributing, please make sure to update the [CHANGELOG.md](CHANGELOG.md) when you submit
19
- your pull request. Upon merging of your first pull request, you will be
20
- given commit access to the repository.
data/Gemfile DELETED
@@ -1,13 +0,0 @@
1
- source 'https://rubygems.org'
2
-
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
- gemspec
data/Rakefile DELETED
@@ -1,18 +0,0 @@
1
- require 'bundler/gem_tasks'
2
- require 'rspec/core/rake_task'
3
-
4
- task default: :spec
5
-
6
- RSpec::Core::RakeTask.new
7
-
8
- task :environment do
9
- require_relative 'lib/monetize'
10
- end
11
-
12
- desc 'Start a console with library loaded'
13
- task console: :environment do
14
- require 'irb'
15
- require 'irb/completion'
16
- ARGV.clear
17
- IRB.start
18
- end