kitco 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/bin/kitco +4 -3
  2. metadata +3 -3
data/bin/kitco CHANGED
@@ -3,7 +3,7 @@ require 'kitco'
3
3
  require 'optparse'
4
4
 
5
5
  options = { :color => true }
6
- symbols = [:gold, :sliver, :palladium, :rhodium]
6
+ symbols = [:gold, :silver, :palladium, :rhodium]
7
7
 
8
8
  optparse = OptionParser.new do |opts|
9
9
  opts.banner << "usage: kitco [options] symbol\n"
@@ -34,10 +34,11 @@ if Kitco.public_methods.include? symbol
34
34
  puts "High #{body[:high]}\tLow #{body[:low]}"
35
35
  puts "Bid #{body[:bid]}\tAsk #{body[:ask]}"
36
36
 
37
+ change = "#{body[:change] >= 0 ? '32m+' : '31m'}#{body[:change]} (#{(body[:percentage] * 100.0).round(4)}%)"
37
38
  if options[:color]
38
- puts "Change: \e[#{body[:change] >= 0 ? '32m+' : '31m-'}#{body[:change]} (#{body[:percentage] * 100}%)\e[0m"
39
+ puts "Change: \e[#{change}\e[0m"
39
40
  else
40
- puts "Change #{body[:change] >= 0 ? '32m+' : '31m-'}#{body[:change]} (#{body[:percentage] * 100}%)"
41
+ puts "Change #{change}"
41
42
  end
42
43
 
43
44
  rescue Exception => e
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitco
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -14,7 +14,7 @@ default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: httparty
17
- requirement: &12403280 !ruby/object:Gem::Requirement
17
+ requirement: &11969000 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,7 +22,7 @@ dependencies:
22
22
  version: 0.7.8
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *12403280
25
+ version_requirements: *11969000
26
26
  description: An API for accessing data from Kitco Charts. Also includes a command
27
27
  line utility
28
28
  email: mikeycgto@gmail.com