matheus 0.6.2 → 0.6.4

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: 3242a48a3b7fe938a403c8e5585e3b1fa1e8c5ba444d0bd9d504410c1fb66d40
4
+ data.tar.gz: d0687724e54eb42d206c41b9d22960249b8aef9adb30538c206950fdb0fc30a3
5
5
  SHA512:
6
- metadata.gz: d962223727c2d618ca19563dc67d76c1f284b033179d75275988f28adab8a3beb10626386af929acc206e17e5c4a4f56f1b0cf1d307b4eb02b1a083dd7f3d9c1
7
- data.tar.gz: d51bd9601d956412b6ff0bbe01ae91333153cd20bb6086d5b9560502a1b79ba8c5bb763dfeb5c3ad813daebe918d22bf8148db8e5605658ebde669c3a717d762
6
+ metadata.gz: b5adab4e860c1a9948419654f467a0d7b3cace6c63d427f22906fe5c7bd63ed50944653cf0d1e63fc729ed36ca424b84252ac87694e2fb04d09372e6eb8b8ea3
7
+ data.tar.gz: 43d1385804ba40942a75aaa4bf533f77beb920bb88f67568a9cc7cb230db609680869610096c0c198a44693849afd398e0a4d62e76fd1a26f20b2410bc2cb3fe
@@ -8,7 +8,7 @@ module Matheus
8
8
  # $ alert-me "sleep 1 && echo 'Done!'"
9
9
  # Runs the command and plays a sound based on its success or failure after it finishes.
10
10
  def call(*args)
11
- if system(args.join(" "))
11
+ if system(args.join(" ").presence || "true")
12
12
  system("afplay /System/Library/Sounds/Glass.aiff")
13
13
  else
14
14
  system("afplay /System/Library/Sounds/Sosumi.aiff")
@@ -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.4"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
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.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matheus Richard
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-01-21 00:00:00.000000000 Z
11
+ date: 2025-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: zeitwerk