stock-gains 0.1.6 → 0.1.7

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
  SHA1:
3
- metadata.gz: d0a0980d2625ce22e1b66d3716cc5e7c80770a26
4
- data.tar.gz: 386b520776ff47d19776fa60fcce5c8a27c10a9b
3
+ metadata.gz: de4cfd6bbe80a4fc548c7273064d4043a95e9729
4
+ data.tar.gz: 23854415f07f0b24a6f1f2ff3afa5d9b804f43cc
5
5
  SHA512:
6
- metadata.gz: 734ae96cbf0204f22af550683d7a7866630936c0e80a113514fabb34f4a8831c5385cd359294fbf25fdf898a10da5984ff94a0518c1b115219f7e37ac5316071
7
- data.tar.gz: 5917d0051ceb65ee06555ce1146765e3953bc9281d14f42eb36b9c10d0cda0aa93e29dd665c5837a85312be75a3e11c0e4d8dacb9952620af398b25674cb82a5
6
+ metadata.gz: 6cae7f2741f332e72115e9f6025bd1ecc5e1884ff06e6d5e29b768b8e6cbff5c0242f3b0b3334d60b4fadce5e6498be765c000c4c1d20a5c5525e0bd3db4a2f3
7
+ data.tar.gz: 11873a9384ad186e6e30ad20fce11544e3ac2d69fa737e3b0c993d216b2b9eea9aeec944cdbed90607c336bf644dd213a671768b11dfb9d91d42db47a52a389b
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- stock-gains (0.1.4)
4
+ stock-gains (0.1.6)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -14,7 +14,7 @@ You can install this gem via `gem install stock-gains`. Before you run this app
14
14
 
15
15
  What makes Stock Gains useful is that not only does it compute what each individual stock in your portfolio has earned/lost for that day, it computes the total balance your *portfolio* has earned/lost for that day. These calculations are displayed for the user in the following table:
16
16
 
17
- ![](screenshots/port_table.png)
17
+ ![](screenshots/portfolio_table.png)
18
18
 
19
19
  ### Stock Information
20
20
 
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- # require 'stock-gains'
4
- require_relative '../lib/stock_gains'
3
+ require_relative '../config/environment'
5
4
 
6
5
  StockGains::CLI.new.call
@@ -0,0 +1,5 @@
1
+ require 'pry'
2
+ require 'open-uri'
3
+ require 'csv'
4
+
5
+ Dir[File.join(File.dirname(__FILE__), "../lib/stock-gains", "*.rb")].each {|f| require f}
@@ -13,10 +13,10 @@ module StockGains
13
13
  puts "the stock or enter 'all' to view all of the stocks in your portfolio."
14
14
  puts "Separate digits with a space to view multiple stocks."
15
15
  puts "(Enter 'e' at anytime throughout the program to exit)\n\n"
16
- input = gets.strip.scan(/\w+/)
16
+ input = gets.strip.downcase.scan(/\w+/)
17
17
  end until valid_input?(input) || input.first == "e"
18
18
 
19
- if input.first != "e"
19
+ if input.first != "e"
20
20
  input.first == "all" ? find_all : find(input)
21
21
  stock_lookup
22
22
  end
@@ -31,8 +31,8 @@ module StockGains
31
31
  print_stock_info(StockGains::Stock.all)
32
32
  end
33
33
 
34
- def find(stock)
35
- print_stock_info(stock.map(&:to_i).collect{ |s| StockGains::Stock.all[s-1] })
34
+ def find(input)
35
+ print_stock_info(input.map(&:to_i).collect{ |s| StockGains::Stock.all[s-1] })
36
36
  end
37
37
 
38
38
  def print_stock_info(stocks)
@@ -8,10 +8,10 @@ class StockGains::StockLookup
8
8
  def call
9
9
  input = ""
10
10
  loop do
11
- puts "Enter the stock ticker(s) of any stock you'll like to view."
11
+ puts "Enter the stock ticker(s) of any stock you'd like to view."
12
12
  puts "Separated stock tickers with a space.\n\n"
13
13
  input = gets.strip.downcase
14
- break if input == "e" || input == "exit" || input == ""
14
+ break if input == "e" || input == ""
15
15
  tickers << input.strip.scan(/\S[a-zA-Z]+/).join("+").upcase
16
16
  StockGains::CLI.new.print_stock_info(retrieve_stock_info(tickers))
17
17
  tickers.clear
@@ -1,3 +1,3 @@
1
1
  module StockGains
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
@@ -1,8 +1 @@
1
- require 'pry'
2
- require 'open-uri'
3
- require 'csv'
4
-
5
- Dir[File.join(File.dirname(__FILE__), "stock-gains", "*.rb")].each {|f| require f}
6
-
7
- module StockGains
8
- end
1
+ require_relative "../config/environment"
Binary file
@@ -1,2 +1 @@
1
- require_relative '../lib/stock_gains'
2
- require 'pry'
1
+ require_relative '../config/environment'
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
14
14
  spec.executables = ["stock-gains"]
15
15
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
16
16
  spec.name = "stock-gains"
17
- spec.require_paths = ["lib", "lib/stock-gains"]
17
+ spec.require_paths = ["lib", "lib/stock_gains"]
18
18
  spec.version = StockGains::VERSION
19
19
  spec.license = "MIT"
20
20
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stock-gains
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Frank Nowinski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-15 00:00:00.000000000 Z
11
+ date: 2015-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -131,6 +131,7 @@ files:
131
131
  - bin/console
132
132
  - bin/setup
133
133
  - bin/stock-gains
134
+ - config/environment.rb
134
135
  - lib/stock-gains/cli.rb
135
136
  - lib/stock-gains/portfolio.rb
136
137
  - lib/stock-gains/stock.rb
@@ -138,19 +139,16 @@ files:
138
139
  - lib/stock-gains/version.rb
139
140
  - lib/stock_gains.rb
140
141
  - portfolio.csv
141
- - screenshots/port_table.png
142
142
  - screenshots/portfolio_csv.png
143
143
  - screenshots/portfolio_data.png
144
+ - screenshots/portfolio_table.png
144
145
  - screenshots/stock_lookup.png
145
146
  - spec/01_cli_spec.rb
146
147
  - spec/02_portfolio_spec.rb
147
148
  - spec/03_stock_spec.rb
148
149
  - spec/04_stock_lookup_spec.rb
149
150
  - spec/spec_helper.rb
150
- - stock-gains-0.1.4.gem
151
- - stock-gains-0.1.5.gem
152
- - stock-gains-gem-0.1.2.gem
153
- - stock-gains-gem.gemspec
151
+ - stock-gains.gemspec
154
152
  homepage: https://learn.co
155
153
  licenses:
156
154
  - MIT
@@ -159,7 +157,7 @@ post_install_message:
159
157
  rdoc_options: []
160
158
  require_paths:
161
159
  - lib
162
- - lib/stock-gains
160
+ - lib/stock_gains
163
161
  required_ruby_version: !ruby/object:Gem::Requirement
164
162
  requirements:
165
163
  - - ">="
Binary file
Binary file
Binary file