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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/bin/stock-gains +1 -2
- data/config/environment.rb +5 -0
- data/lib/stock-gains/cli.rb +4 -4
- data/lib/stock-gains/stock_lookup.rb +2 -2
- data/lib/stock-gains/version.rb +1 -1
- data/lib/stock_gains.rb +1 -8
- data/screenshots/{port_table.png → portfolio_table.png} +0 -0
- data/screenshots/stock_lookup.png +0 -0
- data/spec/spec_helper.rb +1 -2
- data/{stock-gains-gem.gemspec → stock-gains.gemspec} +1 -1
- metadata +6 -8
- data/stock-gains-0.1.4.gem +0 -0
- data/stock-gains-0.1.5.gem +0 -0
- data/stock-gains-gem-0.1.2.gem +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: de4cfd6bbe80a4fc548c7273064d4043a95e9729
|
|
4
|
+
data.tar.gz: 23854415f07f0b24a6f1f2ff3afa5d9b804f43cc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6cae7f2741f332e72115e9f6025bd1ecc5e1884ff06e6d5e29b768b8e6cbff5c0242f3b0b3334d60b4fadce5e6498be765c000c4c1d20a5c5525e0bd3db4a2f3
|
|
7
|
+
data.tar.gz: 11873a9384ad186e6e30ad20fce11544e3ac2d69fa737e3b0c993d216b2b9eea9aeec944cdbed90607c336bf644dd213a671768b11dfb9d91d42db47a52a389b
|
data/Gemfile.lock
CHANGED
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
|
-

|
|
18
18
|
|
|
19
19
|
### Stock Information
|
|
20
20
|
|
data/bin/stock-gains
CHANGED
data/lib/stock-gains/cli.rb
CHANGED
|
@@ -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(
|
|
35
|
-
print_stock_info(
|
|
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'
|
|
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 == "
|
|
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
|
data/lib/stock-gains/version.rb
CHANGED
data/lib/stock_gains.rb
CHANGED
|
File without changes
|
|
Binary file
|
data/spec/spec_helper.rb
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
require_relative '../
|
|
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/
|
|
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.
|
|
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-
|
|
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
|
|
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/
|
|
160
|
+
- lib/stock_gains
|
|
163
161
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
164
162
|
requirements:
|
|
165
163
|
- - ">="
|
data/stock-gains-0.1.4.gem
DELETED
|
Binary file
|
data/stock-gains-0.1.5.gem
DELETED
|
Binary file
|
data/stock-gains-gem-0.1.2.gem
DELETED
|
Binary file
|