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 +4 -4
 - data/README.md +24 -9
 - data/lib/minting/mint/registry.rb +4 -1
 - data/lib/minting/version.rb +1 -1
 - metadata +3 -3
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 3727b084cc73e39f8fb332b083cf94a4c3fb903f616afa18023f0187e713634c
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: cd3ad31a95c5f18b6dc8af91d66dd9e25ec87a5efcaf6b4d6a2203e6a2a15764
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 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 
     | 
    
         
            -
             
     | 
| 
      
 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 
     | 
    
         
            -
             
     | 
| 
      
 28 
     | 
    
         
            +
            and execute:
         
     | 
| 
       16 
29 
     | 
    
         | 
| 
       17 
     | 
    
         
            -
             
     | 
| 
      
 30 
     | 
    
         
            +
            ```shell
         
     | 
| 
      
 31 
     | 
    
         
            +
            bundle install
         
     | 
| 
      
 32 
     | 
    
         
            +
            ```
         
     | 
| 
       18 
33 
     | 
    
         | 
| 
       19 
     | 
    
         
            -
             
     | 
| 
      
 34 
     | 
    
         
            +
            Option3: Install it yourself with:
         
     | 
| 
       20 
35 
     | 
    
         | 
| 
       21 
     | 
    
         
            -
             
     | 
| 
       22 
     | 
    
         
            -
             
     | 
| 
       23 
     | 
    
         
            -
             
     | 
| 
      
 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 
     | 
    
         
            -
                 
     | 
| 
      
 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)
         
     | 
    
        data/lib/minting/version.rb
    CHANGED
    
    
    
        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. 
     | 
| 
      
 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- 
     | 
| 
      
 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. 
     | 
| 
      
 63 
     | 
    
         
            +
            rubygems_version: 3.5.10
         
     | 
| 
       64 
64 
     | 
    
         
             
            signing_key:
         
     | 
| 
       65 
65 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       66 
66 
     | 
    
         
             
            summary: Library to manipulate currency values
         
     |