stock-gains 0.1.7 → 0.1.8
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/lib/stock-gains/cli.rb +10 -4
- data/lib/stock-gains/portfolio.rb +1 -1
- data/lib/stock-gains/stock_lookup.rb +2 -2
- data/lib/stock-gains/version.rb +1 -1
- data/screenshots/stock_lookup.png +0 -0
- data/spec/01_cli_spec.rb +7 -0
- data/stock-gains-0.1.7.gem +0 -0
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c3c1ac60d21ba67fdc8bb677b811af4bc10c75c7
|
|
4
|
+
data.tar.gz: df81a7f2c2b052d9ac9f657ba6d9aa2d5a59bba4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 93eb159d973c6c8c9db3dd982eef1e0332ddf621dff3d610701bba22de4bdc54db23e22137574f25be7974c889cafc4130215735df31d4139ead1c915e605140
|
|
7
|
+
data.tar.gz: 29c21177de1e04c58d51587f8c593e684cf0e3cf58cba78e618a654a25c58a06f0d5a4631189439c329970ac11346ff79df203efa06b5b3afc585dd8d21cafd0
|
data/Gemfile.lock
CHANGED
data/lib/stock-gains/cli.rb
CHANGED
|
@@ -2,15 +2,22 @@ module StockGains
|
|
|
2
2
|
class StockGains::CLI
|
|
3
3
|
|
|
4
4
|
def call
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
begin
|
|
6
|
+
StockGains::Portfolio.new.call
|
|
7
|
+
start
|
|
8
|
+
rescue
|
|
9
|
+
puts "\n\nTo upload your portfolio to Stock Gains, see installation at:"
|
|
10
|
+
puts "https://github.com/frankNowinski/stock-gains\n\n"
|
|
11
|
+
stock_lookup
|
|
12
|
+
end
|
|
13
|
+
puts "\nGoodbye!"
|
|
7
14
|
end
|
|
8
15
|
|
|
9
16
|
def start
|
|
10
17
|
input = ""
|
|
11
18
|
begin
|
|
12
19
|
puts "\nTo view more stock information, enter the number associated with"
|
|
13
|
-
puts "the stock or enter 'all' to
|
|
20
|
+
puts "the stock name in your portfolio or enter 'all' to display all."
|
|
14
21
|
puts "Separate digits with a space to view multiple stocks."
|
|
15
22
|
puts "(Enter 'e' at anytime throughout the program to exit)\n\n"
|
|
16
23
|
input = gets.strip.downcase.scan(/\w+/)
|
|
@@ -20,7 +27,6 @@ module StockGains
|
|
|
20
27
|
input.first == "all" ? find_all : find(input)
|
|
21
28
|
stock_lookup
|
|
22
29
|
end
|
|
23
|
-
puts "\nGoodbye!"
|
|
24
30
|
end
|
|
25
31
|
|
|
26
32
|
def valid_input?(input)
|
|
@@ -8,8 +8,8 @@ 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
|
|
12
|
-
puts "
|
|
11
|
+
puts "Enter the stock ticker(s) of any stock you would like to view."
|
|
12
|
+
puts "Separate stock tickers with a space.\n\n"
|
|
13
13
|
input = gets.strip.downcase
|
|
14
14
|
break if input == "e" || input == ""
|
|
15
15
|
tickers << input.strip.scan(/\S[a-zA-Z]+/).join("+").upcase
|
data/lib/stock-gains/version.rb
CHANGED
|
Binary file
|
data/spec/01_cli_spec.rb
CHANGED
|
@@ -23,4 +23,11 @@ describe 'StockGains::CLI' do
|
|
|
23
23
|
expect(cli.valid_input?(["none"])).to be_falsey
|
|
24
24
|
end
|
|
25
25
|
end
|
|
26
|
+
|
|
27
|
+
describe 'user inputs' do
|
|
28
|
+
it 'responds to "e"' do
|
|
29
|
+
expect(self).to receive(:gets).and_return('e')
|
|
30
|
+
expect {cli.start}.to output(/Goodbye!/).to_stdout
|
|
31
|
+
end
|
|
32
|
+
end
|
|
26
33
|
end
|
|
Binary file
|
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.8
|
|
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-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -148,6 +148,7 @@ files:
|
|
|
148
148
|
- spec/03_stock_spec.rb
|
|
149
149
|
- spec/04_stock_lookup_spec.rb
|
|
150
150
|
- spec/spec_helper.rb
|
|
151
|
+
- stock-gains-0.1.7.gem
|
|
151
152
|
- stock-gains.gemspec
|
|
152
153
|
homepage: https://learn.co
|
|
153
154
|
licenses:
|