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 +4 -4
- data/lib/matheus/alert_me.rb +1 -1
- data/lib/matheus/convert_currency.rb +3 -1
- data/lib/matheus/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3242a48a3b7fe938a403c8e5585e3b1fa1e8c5ba444d0bd9d504410c1fb66d40
|
4
|
+
data.tar.gz: d0687724e54eb42d206c41b9d22960249b8aef9adb30538c206950fdb0fc30a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5adab4e860c1a9948419654f467a0d7b3cace6c63d427f22906fe5c7bd63ed50944653cf0d1e63fc729ed36ca424b84252ac87694e2fb04d09372e6eb8b8ea3
|
7
|
+
data.tar.gz: 43d1385804ba40942a75aaa4bf533f77beb920bb88f67568a9cc7cb230db609680869610096c0c198a44693849afd398e0a4d62e76fd1a26f20b2410bc2cb3fe
|
data/lib/matheus/alert_me.rb
CHANGED
@@ -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} = #{
|
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
|
data/lib/matheus/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2025-02-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: zeitwerk
|