lita-spendo 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lita/handlers/spendo.rb +10 -10
- data/lita-spendo.gemspec +1 -1
- data/spec/lita/handlers/spendo_spec.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 903c08d38803e5588fee8a7fa1b46d2cdba3f333
|
4
|
+
data.tar.gz: f4782ea88ba4602f7fe5a46007a9cd0a19f9c8ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bfaa4ff6c6f8f07273442e1d765ab8a0467a11c5ff2f37429774a87ee811fdaa11214afb8a22b62882ecc2deedfb37e2d7e3e633c2a49ec57a2412430bd7f291
|
7
|
+
data.tar.gz: e856c937f9f4debe417cc99b11454e2b86b1a8b979e17371c8d4e69ea61cf5c95f7013de21e4ef4fc853c01c0a3ea1a16811c4ead65af1f552c61dbc0d7c7f3b
|
data/lib/lita/handlers/spendo.rb
CHANGED
@@ -43,23 +43,23 @@ module Lita
|
|
43
43
|
alert_level = data['AlertLevel'].to_i
|
44
44
|
categorized_fees = data['FeesByCategory']
|
45
45
|
|
46
|
-
message = "@all The current fees alert threshold has been reached
|
47
|
-
message << "
|
48
|
-
message << "
|
49
|
-
message << "
|
50
|
-
message << "
|
51
|
-
message << "
|
46
|
+
message = "@all The current fees alert threshold has been reached.\n"
|
47
|
+
message << "\nAccount: #{account}"
|
48
|
+
message << "\nCurrent fees: $#{current_fees}"
|
49
|
+
message << "\nExpected monthly fees: $#{expected_fees}" # TODO
|
50
|
+
message << "\nFee level is at #{alert_level * 25}% of expected"
|
51
|
+
message << "\n\n Fee Category Breakdown\n\n"
|
52
52
|
|
53
|
-
message << "<table>"
|
54
53
|
categorized_fees.each_pair do |k,v|
|
55
54
|
value = v.to_f
|
56
|
-
|
55
|
+
next if value == 0.0
|
56
|
+
message << "#{k.ljust(20)}: $#{sprintf('%8.2f', value.round(2))}\n"
|
57
57
|
end
|
58
|
-
message << "</table>"
|
59
58
|
|
60
|
-
|
59
|
+
url = config.base_image_url + "/#{alert_level}.jpg"
|
61
60
|
|
62
61
|
response.reply message
|
62
|
+
response.reply url
|
63
63
|
end
|
64
64
|
|
65
65
|
attr_writer :billing_history
|
data/lita-spendo.gemspec
CHANGED
@@ -25,11 +25,11 @@ describe Lita::Handlers::Spendo, lita_handler: true do
|
|
25
25
|
end
|
26
26
|
|
27
27
|
it 'shows the account' do
|
28
|
-
expect(replies.first).to include("
|
28
|
+
expect(replies.first).to include("Account: foo")
|
29
29
|
end
|
30
30
|
|
31
31
|
it 'shows the url' do
|
32
|
-
expect(replies
|
32
|
+
expect(replies).to include("http://foo.com/3.jpg")
|
33
33
|
end
|
34
34
|
|
35
35
|
end
|