minting 0.3.0 → 0.3.1

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: c15130af9a863ae0ed77f63bd1fe5c9bf4c89e2f64bf116be16e5ace6407ede7
4
- data.tar.gz: 749015ea7226c1ea4eafaa71d25461a812b29c0ec11541d686894aa55675bfe7
3
+ metadata.gz: 3727b084cc73e39f8fb332b083cf94a4c3fb903f616afa18023f0187e713634c
4
+ data.tar.gz: cd3ad31a95c5f18b6dc8af91d66dd9e25ec87a5efcaf6b4d6a2203e6a2a15764
5
5
  SHA512:
6
- metadata.gz: 797bd7de317d1038b3b5bf154cea1f0386dd7901bc598822820a51b680f600d0fce15219f8533f5da342092378639b6c663fe979b79ce7ac07578c1c13b9e59b
7
- data.tar.gz: 0fc814e5e15fc40915baef2cef206c55a773072b67587b9e32373898bdb806194b78d63cf85e804c16939aabed753d7ad2b82e7db2948f749fa017ede7ca1172
6
+ metadata.gz: da5ec1aa13bbeedc59d38a38c8fb0c6939253f6aa3960fb5beb64501e6660c16586b3fe1f6f03d54c1771cd2b5b78f39d92087070920b8694dfcbaccf75a99d4
7
+ data.tar.gz: 9cc380513733e3f9c9db95225283c82b6c1073ce9a1d4b01b606673bd1d41fc1412fc79035ab5ed823fc80b28baa8cafbf6685e4bbd06c6817080e64ff498815
data/README.md CHANGED
@@ -6,21 +6,36 @@ Work in progress, please wait release 1.0.0
6
6
 
7
7
  ## Installation
8
8
 
9
- Add this line to your application's Gemfile:
9
+ Option 1: Via bundler command
10
+
11
+ ```shell
12
+ bundle add minting
13
+ bundle install
14
+ ```
15
+
16
+ Option 2: add the line below to your application's Gemfile:
17
+
18
+ ```ruby
19
+ gem 'minting'
20
+ ```
21
+
22
+ or, if you want latest development version from Github
10
23
 
11
24
  ```ruby
12
25
  gem 'minting', git: 'https://github.com/gferraz/minting.git'
13
26
  ```
14
27
 
15
- And then execute:
28
+ and execute:
16
29
 
17
- $ bundle
30
+ ```shell
31
+ bundle install
32
+ ```
18
33
 
19
- Or install it yourself with:
34
+ Option3: Install it yourself with:
20
35
 
21
- $ git clone https://github.com/gferraz/minting.git
22
- $ cd minting && gem build minting.gemspec
23
- $ gem install minting-0.2.0.gem
36
+ ```shell
37
+ gem install minting
38
+ ````
24
39
 
25
40
  ## Usage
26
41
 
@@ -78,15 +93,15 @@ uning Mint
78
93
  3.euros == Mint.money(2, 'EUR') #=> true
79
94
  4.mint('USD') == 4.dollars #=> true
80
95
  4.to_money('USD') == 4.dollars #=> true
96
+
81
97
  ```
82
98
 
83
99
  ## Release 1.0 Plan
84
100
 
85
- - Rails
86
101
  - Localization: I18n
87
102
  - Arithmetics: div, mod
88
103
  - Mint.parse
89
104
 
90
105
  ## Contributing
91
106
 
92
- Bug reports and pull requests are welcome on GitHub at https://github.com/gferraz/minting.
107
+ Bug reports and pull requests are welcome on GitHub at <https://github.com/gferraz/minting>.
@@ -3,7 +3,10 @@
3
3
  # :nodoc
4
4
  module Mint
5
5
  def self.money(amount, currency_code)
6
- Money.new(amount, currency(currency_code))
6
+ currency = currency(currency_code)
7
+ raise ArgumentError, "Currency [#{currency_code}] no registered" unless currency
8
+
9
+ Money.new(amount, currency)
7
10
  end
8
11
 
9
12
  def self.currency(currency)
@@ -1,3 +1,3 @@
1
1
  module Minting
2
- VERSION = '0.3.0'.freeze
2
+ VERSION = '0.3.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minting
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gilson Ferraz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-05-22 00:00:00.000000000 Z
11
+ date: 2024-05-25 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Library to manipulate currency values
14
14
  email: []
@@ -60,7 +60,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  requirements: []
63
- rubygems_version: 3.5.9
63
+ rubygems_version: 3.5.10
64
64
  signing_key:
65
65
  specification_version: 4
66
66
  summary: Library to manipulate currency values