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: c568aa3b22327ac83c1843240346d573bfc39bddb566d996b1f45a331a4a78d4
4
- data.tar.gz: 010df09b6c0300e4b6bd9239cb6b3659f22fdfcaddae9f96ff98c04dc70824a1
3
+ metadata.gz: d7c63c6ec509d0f13881f0219acb7f1bff0b4fc7c3fac642e4156dffa60ec95e
4
+ data.tar.gz: 1ae954736d137e0be01f10e9bd019686c63d6aa373d144fc6863ccdf01692dae
5
5
  SHA512:
6
- metadata.gz: bbbeb50ba629938ec07f6573b0960eb9b59768ed8ef48eead012f13e70eb9d4c8c6fbd71bad5d2f360a264afbadc834c0e86455222bda9ff5839d4ca0a70d61a
7
- data.tar.gz: 05bd71d499ef21b7cddcd66594d9542f0dad95af560a7c02f429caa20cd493240671c05b81ac87e4e3e441a0c266e3c6bf5f79d3df5a6549dec77bb6d85a3641
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
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "lita-onewheel-finance"
3
- spec.version = "0.2.1"
3
+ spec.version = "0.3.0"
4
4
  spec.authors = ["Andrew Kreps"]
5
5
  spec.email = ["andrew.kreps@gmail.com"]
6
6
  spec.description = "Wee li'l stock quote bot"
@@ -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
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.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kreps