lita-onewheel-finance 0.0.0 → 0.0.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 00f1e5670bd0eb3308b2f6d14bedb2013fc4c61cf36d7162a43663e9c8dbd099
|
4
|
+
data.tar.gz: 9d577a5c2baa823dd3ce3bd56ba269bcbed6f039b867a10e1e2b13252b0bacdc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d01b6df24ffbf30a0be8c394fa9a1f68de39a0e764a3f50665468aba1248558dc8f5abfc2b58c00449bf66f97b33142c9a5807899048b68df33e2b704f94ba60
|
7
|
+
data.tar.gz: d36ea075cd9cbab56f0934b8ea8e2df4d116a3a5de97aa4ec8bf0b51f7f27937ab2ec8d3fd03a1378c579a2be33047af927b58056b2fd55d570630f42d8afc82
|
data/.gitignore
CHANGED
@@ -71,7 +71,7 @@ module Lita
|
|
71
71
|
module Handlers
|
72
72
|
class OnewheelFinance < Handler
|
73
73
|
config :apikey, required: true
|
74
|
-
route /quote\s+(
|
74
|
+
route /quote\s+(.+)/i, :handle_quote, command: true
|
75
75
|
|
76
76
|
def handle_quote(response)
|
77
77
|
url = "https://www.alphavantage.co/query"
|
@@ -0,0 +1,14 @@
|
|
1
|
+
{
|
2
|
+
"Global Quote": {
|
3
|
+
"01. symbol": "CLB",
|
4
|
+
"02. open": "39.4000",
|
5
|
+
"03. high": "39.5000",
|
6
|
+
"04. low": "36.5000",
|
7
|
+
"05. price": "37.6700",
|
8
|
+
"06. volume": "4216163",
|
9
|
+
"07. latest trading day": "2019-12-31",
|
10
|
+
"08. previous close": "47.4600",
|
11
|
+
"09. change": "-9.7900",
|
12
|
+
"10. change percent": "-20.6279%"
|
13
|
+
}
|
14
|
+
}
|
@@ -10,10 +10,18 @@ describe Lita::Handlers::OnewheelFinance, lita_handler: true do
|
|
10
10
|
#
|
11
11
|
#end
|
12
12
|
|
13
|
-
it 'quotes' do
|
13
|
+
it 'quotes up' do
|
14
14
|
mock_up 'alphavantage-global-quote'
|
15
15
|
send_command 'quote lulu'
|
16
16
|
puts replies.last
|
17
17
|
expect(replies.last).to include('LULU: $230.83')
|
18
18
|
end
|
19
|
+
|
20
|
+
it 'quotes down' do
|
21
|
+
mock_up 'alphavantage-quote-down'
|
22
|
+
send_command 'quote clb'
|
23
|
+
puts replies.last
|
24
|
+
expect(replies.last).to include('CLB: $37.67')
|
25
|
+
expect(replies.last).to include('$-9.79')
|
26
|
+
end
|
19
27
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-onewheel-finance
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kreps
|
@@ -139,6 +139,7 @@ files:
|
|
139
139
|
- lib/lita/handlers/onewheel_finance.rb
|
140
140
|
- lita-onewheel-finance.gemspec
|
141
141
|
- spec/fixtures/alphavantage-global-quote.json
|
142
|
+
- spec/fixtures/alphavantage-quote-down.json
|
142
143
|
- spec/fixtures/effr.html
|
143
144
|
- spec/lita/handlers/onewheel_finance_spec.rb
|
144
145
|
- spec/spec_helper.rb
|
@@ -168,6 +169,7 @@ specification_version: 4
|
|
168
169
|
summary: Wee li'l stock quote bot
|
169
170
|
test_files:
|
170
171
|
- spec/fixtures/alphavantage-global-quote.json
|
172
|
+
- spec/fixtures/alphavantage-quote-down.json
|
171
173
|
- spec/fixtures/effr.html
|
172
174
|
- spec/lita/handlers/onewheel_finance_spec.rb
|
173
175
|
- spec/spec_helper.rb
|