lita-onewheel-finance 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d7c63c6ec509d0f13881f0219acb7f1bff0b4fc7c3fac642e4156dffa60ec95e
|
4
|
+
data.tar.gz: 1ae954736d137e0be01f10e9bd019686c63d6aa373d144fc6863ccdf01692dae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a75061d1d8a3e4a6edcc73a1191e3696491d0a7b4e9d2d7ec538de17969ed200c287569b37123f5ea6cee392ce6654975110917140be0aa5e338d66abe3b9016
|
7
|
+
data.tar.gz: 4aad8b4f39180a2c7499c89d80d756c01d526d0e47ccc5c4ff850bcfa8f0bc09b908a39fd0d85363384926d1cd80866fb23e398520066ac8c3f4b1505991285a
|
@@ -68,7 +68,7 @@ class AlphaVantageQuote
|
|
68
68
|
end
|
69
69
|
|
70
70
|
class WorldTradeDataQuote
|
71
|
-
attr_reader :open, :high, :low, :price, :volume, :trading_day, :prev_close, :change, :change_percent, :exchange, :error
|
71
|
+
attr_reader :open, :high, :low, :price, :volume, :trading_day, :prev_close, :change, :change_percent, :exchange, :error, :name
|
72
72
|
attr_accessor :symbol
|
73
73
|
|
74
74
|
def initialize(json_blob)
|
@@ -108,6 +108,8 @@ class WorldTradeDataQuote
|
|
108
108
|
@change_percent = self.fix_number quote[key]
|
109
109
|
when 'stock_exchange_short'
|
110
110
|
@exchange = quote[key].sub /NYSEARCA/, 'NYSE'
|
111
|
+
when 'name'
|
112
|
+
@name = quote[key]
|
111
113
|
end
|
112
114
|
end
|
113
115
|
end
|
@@ -133,8 +135,10 @@ module Lita
|
|
133
135
|
if stock.change >= 0
|
134
136
|
# if irc
|
135
137
|
str += "#{IrcColors::green} ⬆$#{stock.change}#{IrcColors::reset}, #{IrcColors::green}#{stock.change_percent}%#{IrcColors::reset} "
|
138
|
+
str += "#{IrcColors::grey}(#{stock.name})#{IrcColors::reset}"
|
136
139
|
else
|
137
140
|
str += "#{IrcColors::red} ↯$#{stock.change}#{IrcColors::reset}, #{IrcColors::red}#{stock.change_percent}%#{IrcColors::reset} "
|
141
|
+
str += "(#{stock.name})"
|
138
142
|
end
|
139
143
|
end
|
140
144
|
|
@@ -14,6 +14,7 @@ describe Lita::Handlers::OnewheelFinance, lita_handler: true do
|
|
14
14
|
mock_up 'worldtradedata-quote-up'
|
15
15
|
send_command 'quote lulu'
|
16
16
|
expect(replies.last).to include("\u000314NASDAQ - \u0003LULU: \u000302$233.01\u0003")
|
17
|
+
expect(replies.last).to include('(Lululemon Athletica Inc.)')
|
17
18
|
end
|
18
19
|
|
19
20
|
it 'quotes down' do
|
@@ -21,6 +22,7 @@ describe Lita::Handlers::OnewheelFinance, lita_handler: true do
|
|
21
22
|
send_command 'quote xlp'
|
22
23
|
expect(replies.last).to include("\u000314NYSE - \u0003XLP: \u000302$62.51\u0003")
|
23
24
|
expect(replies.last).to include('↯$-0.47')
|
25
|
+
expect(replies.last).to include('(Consumer Staples Select Sector SPDR Fund)')
|
24
26
|
end
|
25
27
|
|
26
28
|
it 'errors' do
|