lita-onewheel-finance 0.7.1 → 0.7.2

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: 15c662356a8c3af7ef1ddc3d9e2593e1f97407f14715342e9a4bb8b6e9eb1d6f
4
- data.tar.gz: a06245525f9266e6d0860175a994399b8e9049c80ef7c5c90bec1244fd29b5e5
3
+ metadata.gz: 705648b5037494e24e403eff8e89f00041e4df73fe32a1948b2a4483a07360ee
4
+ data.tar.gz: cd5a3b83ae4a98f140d824061c2433146481cec08ce0879c0cd668055cb3d043
5
5
  SHA512:
6
- metadata.gz: 6c88a85f9a6b5dc86bc2a9683398c734debab9a5f7fdf9c8f0be8cd6e2bfd69aa9da16798318b7a7b05a73b5facd9a99b89c003363628629a3f92dfb2ab352c7
7
- data.tar.gz: 91f5c5cc47f9690698faa731b7b7e93eaea9b16ec22badae7293dd075275861e072d5b331d2ef7b687c6c54160d6fe390cf120bb1cf673a743d22513ca1b1609
6
+ metadata.gz: 12fa54d511e7bc069bd475d9de53bdae53aa0990fd4790c794b50d36aeaec2f93b1594c609bd5d58de9ab1c5d4b1e99b33814bbb066537b961937196e4f3ccab
7
+ data.tar.gz: 965db07646a717a3adf927a7c94897ad2c21c93d3e5bc691cb173ca3db1d204eccbc5e4958fcfbc7a73277115e849873fffd90897420321f7dfb337b4f9ef148
@@ -41,24 +41,32 @@ module Lita
41
41
 
42
42
  # IRC mode
43
43
  if config.mode == 'irc'
44
- str = "#{IrcColors::grey}#{stock.exchange} - #{IrcColors::reset}#{stock.symbol}: #{IrcColors::blue}#{dollar_sign}#{stock.price}#{IrcColors::reset} "
44
+ str = "#{IrcColors::grey}#{stock.exchange} - #{IrcColors::reset}#{stock.symbol}: #{IrcColors::blue}#{dollar_sign}#{"%.2f" % stock.price}#{IrcColors::reset} "
45
45
  if stock.change >= 0
46
46
  # if irc
47
- str += "#{IrcColors::green} ⬆#{dollar_sign}#{stock.change}#{IrcColors::reset}, #{IrcColors::green}#{stock.change_percent}%#{IrcColors::reset} "
48
- str += "#{IrcColors::grey}(#{stock.name})#{IrcColors::reset}"
47
+ str += "#{IrcColors::green} ⬆#{dollar_sign}#{"%.2f" % stock.change}#{IrcColors::reset}, #{IrcColors::green}#{stock.change_percent}%#{IrcColors::reset} "
48
+ if stock.name
49
+ str += "#{IrcColors::grey}(#{stock.name})#{IrcColors::reset}"
50
+ end
49
51
  else
50
- str += "#{IrcColors::red} ↯#{dollar_sign}#{stock.change}#{IrcColors::reset}, #{IrcColors::red}#{stock.change_percent}%#{IrcColors::reset} "
51
- str += "#{IrcColors::grey}(#{stock.name})#{IrcColors::reset}"
52
+ str += "#{IrcColors::red} ↯#{dollar_sign}#{"%.2f" % stock.change}#{IrcColors::reset}, #{IrcColors::red}#{stock.change_percent}%#{IrcColors::reset} "
53
+ if stock.name
54
+ str += "#{IrcColors::grey}(#{stock.name})#{IrcColors::reset}"
55
+ end
52
56
  end
53
57
  else
54
- str = "#{stock.exchange} - #{stock.symbol}: #{dollar_sign}#{stock.price} "
58
+ str = "#{stock.exchange} - #{stock.symbol}: #{dollar_sign}#{"%.2f" % stock.price} "
55
59
  if stock.change >= 0
56
60
  # if irc
57
- str += " :arrow_up:#{dollar_sign}#{stock.change}, :heavy_plus_sign:#{stock.change_percent}% "
58
- str += "(#{stock.name})"
61
+ str += " :arrow_up:#{dollar_sign}#{"%.2f" % stock.change}, :heavy_plus_sign:#{stock.change_percent}% "
62
+ if stock.name
63
+ str += "(#{stock.name})"
64
+ end
59
65
  else
60
- str += " :chart_with_downwards_trend:#{dollar_sign}#{stock.change}, :heavy_minus_sign:#{stock.change_percent}% "
61
- str += "(#{stock.name})"
66
+ str += " :chart_with_downwards_trend:#{dollar_sign}#{"%.2f" % stock.change}, :heavy_minus_sign:#{stock.change_percent}% "
67
+ if stock.name
68
+ str += "(#{stock.name})"
69
+ end
62
70
  end
63
71
  end
64
72
  end
@@ -35,9 +35,8 @@ class YahooQuote
35
35
  @change_percent = self.fix_number ((@change / @price) * 100)
36
36
  end
37
37
 
38
- # Apparently rounding stopped working at some point for trailing 0's
39
38
  def fix_number(price_str)
40
- "%.2f" % price_str.to_f.round(2)
39
+ price_str.to_f.round(2)
41
40
  end
42
41
 
43
42
  def is_index?
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "lita-onewheel-finance"
3
- spec.version = "0.7.1"
3
+ spec.version = "0.7.2"
4
4
  spec.authors = ["Andrew Kreps"]
5
5
  spec.email = ["andrew.kreps@gmail.com"]
6
6
  spec.description = "Wee li'l stock quote bot"
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.7.1
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kreps