matheus 0.6.2 → 0.6.3

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: 8eeb312b4e07d2801d71514f900030fedc708460118e4edc12bcda8a54e0232f
4
- data.tar.gz: 6cb596e1958269fdb0d5a9ff7be6db0e799fd18992530fe091250b901fd3be57
3
+ metadata.gz: f8b7ae705faac28863e66c70a5c908c53a2fe180aa14c0878aef57ae82ca8421
4
+ data.tar.gz: e89436cbe02bbc48261114ff617a39d42f52f0d2aae1b178ddd55036ace7d92d
5
5
  SHA512:
6
- metadata.gz: d962223727c2d618ca19563dc67d76c1f284b033179d75275988f28adab8a3beb10626386af929acc206e17e5c4a4f56f1b0cf1d307b4eb02b1a083dd7f3d9c1
7
- data.tar.gz: d51bd9601d956412b6ff0bbe01ae91333153cd20bb6086d5b9560502a1b79ba8c5bb763dfeb5c3ad813daebe918d22bf8148db8e5605658ebde669c3a717d762
6
+ metadata.gz: d8dd9bbb999502ef1689a75115844a32eaa131b92e41c665f00f9d9337e1d9a80669ad1c475ca5ddcb1313c4bfdd53bcfe31763a99b823a00bac96e4de46a49a
7
+ data.tar.gz: fe9f27e3980c294dbb6e06b17f9f66c214432fceae199725caf33de20e1998037d2716266238465c90567996ddae14fd88820c7f2e90672b442120af92a0000d
@@ -8,6 +8,8 @@ module Matheus
8
8
  # $ convert-currency 100 usd eur 2024-03-06
9
9
  # $ convert-currency usd eur # defaults to 1
10
10
  class ConvertCurrency < Command
11
+ include ActiveSupport::NumberHelper
12
+
11
13
  def call(args)
12
14
  amount, source, target, date = parse_args(args)
13
15
 
@@ -17,7 +19,7 @@ module Matheus
17
19
 
18
20
  if rate
19
21
  converted = amount * rate
20
- puts "#{amount} #{source.upcase} = #{ActiveSupport::NumberHelper.number_to_currency(converted, unit: "")} #{target.upcase}"
22
+ puts "#{number_to_currency(amount, unit: "")} #{source.upcase} = #{number_to_currency(converted, unit: "")} #{target.upcase}"
21
23
  else
22
24
  Failure("Conversion rate from #{source.upcase} to #{target.upcase} not found")
23
25
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Matheus
4
- VERSION = "0.6.2"
4
+ VERSION = "0.6.3"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: matheus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matheus Richard