lita-onewheel-finance 0.0.0 → 0.0.1

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: a3c920ab62fdcefc8e2b6d33f16a860a1a7f6aa28260362a2adb4246bbcdebe9
4
- data.tar.gz: f9d2a039da92b283372849240591f17a7f2ba4a03853b228b3a53cc0fe076147
3
+ metadata.gz: 00f1e5670bd0eb3308b2f6d14bedb2013fc4c61cf36d7162a43663e9c8dbd099
4
+ data.tar.gz: 9d577a5c2baa823dd3ce3bd56ba269bcbed6f039b867a10e1e2b13252b0bacdc
5
5
  SHA512:
6
- metadata.gz: 01afc0dc98552d112a9164c2a5e197bd261b2feb49ab78493e5c03dab0d2676b7167cc723ffed3930e0abfebfadb64110fef9988f6765a4750832c9e1a438d99
7
- data.tar.gz: b092371ee4f72cc21986a2aaaf8d6e4080cbaa930f012443839900985f86bd888973d041166f4135df7884c02f2d9955ae8f72d96a10e45fc49d689ee8938bda
6
+ metadata.gz: d01b6df24ffbf30a0be8c394fa9a1f68de39a0e764a3f50665468aba1248558dc8f5abfc2b58c00449bf66f97b33142c9a5807899048b68df33e2b704f94ba60
7
+ data.tar.gz: d36ea075cd9cbab56f0934b8ea8e2df4d116a3a5de97aa4ec8bf0b51f7f27937ab2ec8d3fd03a1378c579a2be33047af927b58056b2fd55d570630f42d8afc82
data/.gitignore CHANGED
@@ -17,3 +17,4 @@ test/version_tmp
17
17
  tmp
18
18
  bin
19
19
  .idea
20
+ lita_config.rb
@@ -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+(\w+)/i, :handle_quote, command: true
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"
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "lita-onewheel-finance"
3
- spec.version = "0.0.0"
3
+ spec.version = "0.0.1"
4
4
  spec.authors = ["Andrew Kreps"]
5
5
  spec.email = ["andrew.kreps@gmail.com"]
6
6
  spec.description = "Wee li'l stock quote bot"
@@ -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.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