stock-gains 0.1.3
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 +7 -0
- data/.rspec +2 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +59 -0
- data/LICENSE.txt +9 -0
- data/README.md +50 -0
- data/Rakefile +0 -0
- data/bin/console +10 -0
- data/bin/setup +7 -0
- data/bin/stock-gains +6 -0
- data/lib/stock-gains/cli.rb +56 -0
- data/lib/stock-gains/portfolio.rb +43 -0
- data/lib/stock-gains/stock.rb +40 -0
- data/lib/stock-gains/stock_lookup.rb +26 -0
- data/lib/stock-gains/version.rb +3 -0
- data/lib/stock_gains.rb +11 -0
- data/portfolio.csv +3 -0
- data/screenshots/portfolio_csv.png +0 -0
- data/screenshots/portfolio_data.png +0 -0
- data/screenshots/portfolio_table.png +0 -0
- data/screenshots/stock_lookup.png +0 -0
- data/spec/01_cli_spec.rb +26 -0
- data/spec/02_portfolio_spec.rb +15 -0
- data/spec/03_stock_spec.rb +32 -0
- data/spec/04_stock_lookup_spec.rb +11 -0
- data/spec/spec_helper.rb +2 -0
- data/stock-gains-gem-0.1.0.gem +0 -0
- data/stock-gains-gem.gemspec +28 -0
- metadata +182 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: f87b34aaaa2e3acf9123c235b5aff0559fdad122
|
|
4
|
+
data.tar.gz: 92517ef6a7503405f28ec2dae76fd3a0a812e611
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 25099e9b827fff901b32019a22cb38d20003e45f21c83910b90496bd08e2afff14539d3111d20d88cb17492c5171869c5dfd47b51f2db6c0f8b70f45bba37418
|
|
7
|
+
data.tar.gz: 58f84499f3832b0faf158b72d54ea0a7c08de3c613559f6c2c49c8f12d301a0e9a2ae9df0144108f017883c270b597014b02ac8d8f5759083af123fa2ec593f1
|
data/.rspec
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
stock-gains-gem (0.1.1)
|
|
5
|
+
|
|
6
|
+
GEM
|
|
7
|
+
remote: https://rubygems.org/
|
|
8
|
+
specs:
|
|
9
|
+
addressable (2.3.8)
|
|
10
|
+
coderay (1.1.0)
|
|
11
|
+
crack (0.4.2)
|
|
12
|
+
safe_yaml (~> 1.0.0)
|
|
13
|
+
diff-lcs (1.2.5)
|
|
14
|
+
hashdiff (0.2.3)
|
|
15
|
+
method_source (0.8.2)
|
|
16
|
+
mini_portile2 (2.0.0)
|
|
17
|
+
nokogiri (1.6.7)
|
|
18
|
+
mini_portile2 (~> 2.0.0.rc2)
|
|
19
|
+
pry (0.10.3)
|
|
20
|
+
coderay (~> 1.1.0)
|
|
21
|
+
method_source (~> 0.8.1)
|
|
22
|
+
slop (~> 3.4)
|
|
23
|
+
rake (10.4.2)
|
|
24
|
+
rspec (3.4.0)
|
|
25
|
+
rspec-core (~> 3.4.0)
|
|
26
|
+
rspec-expectations (~> 3.4.0)
|
|
27
|
+
rspec-mocks (~> 3.4.0)
|
|
28
|
+
rspec-core (3.4.1)
|
|
29
|
+
rspec-support (~> 3.4.0)
|
|
30
|
+
rspec-expectations (3.4.0)
|
|
31
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
32
|
+
rspec-support (~> 3.4.0)
|
|
33
|
+
rspec-mocks (3.4.0)
|
|
34
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
35
|
+
rspec-support (~> 3.4.0)
|
|
36
|
+
rspec-support (3.4.1)
|
|
37
|
+
safe_yaml (1.0.4)
|
|
38
|
+
slop (3.6.0)
|
|
39
|
+
vcr (2.9.3)
|
|
40
|
+
webmock (1.22.3)
|
|
41
|
+
addressable (>= 2.3.6)
|
|
42
|
+
crack (>= 0.3.2)
|
|
43
|
+
hashdiff
|
|
44
|
+
|
|
45
|
+
PLATFORMS
|
|
46
|
+
ruby
|
|
47
|
+
|
|
48
|
+
DEPENDENCIES
|
|
49
|
+
bundler (~> 1.10)
|
|
50
|
+
nokogiri
|
|
51
|
+
pry
|
|
52
|
+
rake (~> 10.0)
|
|
53
|
+
rspec
|
|
54
|
+
stock-gains-gem!
|
|
55
|
+
vcr
|
|
56
|
+
webmock
|
|
57
|
+
|
|
58
|
+
BUNDLED WITH
|
|
59
|
+
1.10.6
|
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2015 Frank Nowinski
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
## Stock-Gains-Gem
|
|
2
|
+
|
|
3
|
+
This Ruby gem uses the Yahoo Finance API to provide three valuable stock market functions for the user. First, it imports the users portoflio from a `CSV` file, calculates each stocks earnings/losses for the day, then returns the total balance your portfolio has earned/lost. Next, it gives the user the option to display generic stock information of any or all of the stocks in their portfolio. Lastly, it allows the user to lookup stock data of any stock(s) of their choosing.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
You can install this gem via `gem install stock-gains-gem`. Before you run this app you'll need to set up a `CSV` file containing all of the stocks in your portfolio so they can be imported into the app. Start by cloning the respository to your local computer. Then, on the top-level of the directory, create a file called `portfolio.csv` and insert the stock ticker followed by the quantity of shares you hold for each stock in your portfolio. Be sure to input each stock on a new line and separate the two values by a comma (see the diagram below). Now run `stock-gains` in the CLI to view your gains!
|
|
8
|
+
|
|
9
|
+

|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
### Today's Gain/Loss
|
|
14
|
+
|
|
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
|
+
|
|
17
|
+

|
|
18
|
+
|
|
19
|
+
### Stock Information
|
|
20
|
+
|
|
21
|
+
The user then has the option to view additional stock information regarding any stock in their portfolio. There are four possible entries:
|
|
22
|
+
|
|
23
|
+
* Enter `all` to display stock data on all of the stocks in your portfolio
|
|
24
|
+
* Enter the digit, or digits, corresponding to the stocks you want to look up, separated by a space
|
|
25
|
+
* Enter `e` to exit the program
|
|
26
|
+
* Press enter to move onto the next stage
|
|
27
|
+
|
|
28
|
+

|
|
29
|
+
|
|
30
|
+
### Stock Lookup
|
|
31
|
+
|
|
32
|
+
Finally, look up any stock on the market by entering the stock ticker. To view multiple stocks, separate the stock tickers with a space.
|
|
33
|
+
|
|
34
|
+

|
|
35
|
+
|
|
36
|
+
## Contributing
|
|
37
|
+
|
|
38
|
+
1. Fork it!
|
|
39
|
+
2. Create your feature branch: git checkout -b my-new-feature
|
|
40
|
+
3. Commit your changes: git commit -am 'Add some feature'
|
|
41
|
+
4. Push to the branch: git push origin my-new-feature
|
|
42
|
+
5. Submit a pull request :D
|
|
43
|
+
|
|
44
|
+
## Development
|
|
45
|
+
|
|
46
|
+
After checking out the repo, run `bundle exec bin/setup` to install dependencies.
|
|
47
|
+
|
|
48
|
+
## License
|
|
49
|
+
|
|
50
|
+
The gem is available as open source under the terms of the MIT License.
|
data/Rakefile
ADDED
|
File without changes
|
data/bin/console
ADDED
data/bin/setup
ADDED
data/bin/stock-gains
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
module StockGains
|
|
2
|
+
class StockGains::CLI
|
|
3
|
+
|
|
4
|
+
def call
|
|
5
|
+
StockGains::Portfolio.new.call
|
|
6
|
+
start
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def start
|
|
10
|
+
input = ""
|
|
11
|
+
begin
|
|
12
|
+
puts "\nTo view more stock information, enter the number associated with"
|
|
13
|
+
puts "the stock or enter 'all' to view all of the stocks in your portfolio."
|
|
14
|
+
puts "Separate digits with a space to view multiple stocks."
|
|
15
|
+
puts "(Enter 'e' at anytime throughout the program to exit)\n\n"
|
|
16
|
+
input = gets.strip.scan(/\w+/)
|
|
17
|
+
end until valid_input?(input) || input.first == "e"
|
|
18
|
+
|
|
19
|
+
if input.first != "e"
|
|
20
|
+
input.first == "all" ? find_all : find(input)
|
|
21
|
+
stock_lookup
|
|
22
|
+
end
|
|
23
|
+
puts "\nGoodbye!"
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def valid_input?(input)
|
|
27
|
+
input.first == "all" || input.map(&:to_i).all?{ |n| n.between?(1, StockGains::Stock.all.count)}
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def find_all
|
|
31
|
+
print_stock_info(StockGains::Stock.all)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def find(stock)
|
|
35
|
+
print_stock_info(stock.map(&:to_i).collect{ |s| StockGains::Stock.all[s-1] })
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def print_stock_info(stocks)
|
|
39
|
+
puts "\n"
|
|
40
|
+
stocks.each do |s|
|
|
41
|
+
puts "#{s.name}".center(67)
|
|
42
|
+
puts " " + "-" * 68
|
|
43
|
+
puts " Asking Price: $#{s.cur_price}".ljust(37, " ") + "Day's Range: $#{s.d_range}"
|
|
44
|
+
puts " Previous Close: $#{s.prev_close}".ljust(37, " ") + "52 Week Range: $#{s.y_range}"
|
|
45
|
+
puts " Open: $#{s.open}".ljust(37, " ") + "1 Year Target: $#{s.year_trgt}"
|
|
46
|
+
puts " P/E Ratio: $#{s.pe}".ljust(37, " ") + "EPS: $#{s.eps}"
|
|
47
|
+
puts " Day's +/-: $#{s.days_value}".ljust(37, " ") + "Shares: #{s.shares}"
|
|
48
|
+
puts "\n\n"
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def stock_lookup
|
|
53
|
+
StockGains::StockLookup.new.call
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
class StockGains::Portfolio
|
|
2
|
+
attr_accessor :total
|
|
3
|
+
|
|
4
|
+
def initialize
|
|
5
|
+
@total = 0
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
def call
|
|
9
|
+
list
|
|
10
|
+
calculate_gains
|
|
11
|
+
print_gains
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def list
|
|
15
|
+
puts "\n"
|
|
16
|
+
puts "Stocks in Your Portfolio".center(68)
|
|
17
|
+
puts "\n"
|
|
18
|
+
puts " Stock Name" + " " * 46 + "Today's +/-"
|
|
19
|
+
puts " " + "-" * 67
|
|
20
|
+
StockGains::Stock.all.each.with_index(1) do |stock, i|
|
|
21
|
+
name = stock.name.ljust(55, " ")
|
|
22
|
+
puts " #{i}. #{name} $#{stock.days_value}"
|
|
23
|
+
end
|
|
24
|
+
puts
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def calculate_gains
|
|
28
|
+
StockGains::Stock.all.each{ |stock| @total += stock.days_value }
|
|
29
|
+
@total = @total.round(2).to_f
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def print_gains
|
|
33
|
+
puts "\n"
|
|
34
|
+
puts " " * 20 + ":" + "-" * 29 + ":"
|
|
35
|
+
puts " " * 20 + "| TODAY'S #{total > 0 ? "GAIN:" : "LOSS:"} $#{total} #{extra_spaces}|"
|
|
36
|
+
puts " " * 20 + ":" + "-" * 29 + ":"
|
|
37
|
+
puts "\n"
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def extra_spaces
|
|
41
|
+
" " * (9 - total.to_s.each_char.count)
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
class StockGains::Stock
|
|
2
|
+
attr_accessor :name, :cur_price, :prev_close, :open, :year_trgt
|
|
3
|
+
attr_accessor :d_range, :y_range,:days_value, :pe, :eps, :shares
|
|
4
|
+
|
|
5
|
+
def initialize(name, cur_price, prev_close, open, year_trgt, d_range, y_range, pe, eps, shares)
|
|
6
|
+
@name = name
|
|
7
|
+
@cur_price = cur_price
|
|
8
|
+
@prev_close = prev_close
|
|
9
|
+
@open = open
|
|
10
|
+
@year_trgt = year_trgt
|
|
11
|
+
@d_range = d_range
|
|
12
|
+
@y_range = y_range
|
|
13
|
+
@pe = pe
|
|
14
|
+
@eps = eps
|
|
15
|
+
@shares = shares
|
|
16
|
+
calculate_days_value
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def self.all
|
|
20
|
+
@@all ||= create_stock_from_portfolio
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def calculate_days_value
|
|
24
|
+
@days_value = ((cur_price.to_f * shares.to_f) - (prev_close.to_f * shares.to_f)).round(2).to_f
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def self.create_stock_from_portfolio
|
|
28
|
+
CSV.foreach("portfolio.csv").collect do |stock|
|
|
29
|
+
s = (retrieve_stock(stock) << stock[1]).flatten
|
|
30
|
+
new(s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7], s[8], s[9])
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def self.retrieve_stock(stock)
|
|
35
|
+
url = "http://finance.yahoo.com/d/quotes.csv?s=#{stock.first}&f=napot8mwre"
|
|
36
|
+
open(url) do |csv|
|
|
37
|
+
CSV.parse(csv).collect{ |row| row }
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
class StockGains::StockLookup
|
|
2
|
+
attr_accessor :tickers
|
|
3
|
+
|
|
4
|
+
def initialize
|
|
5
|
+
@tickers = []
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
def call
|
|
9
|
+
input = ""
|
|
10
|
+
loop do
|
|
11
|
+
puts "Enter the stock ticker(s) of any stock you'll like to view."
|
|
12
|
+
puts "Separated stock tickers with a space.\n\n"
|
|
13
|
+
input = gets.strip.downcase
|
|
14
|
+
break if input == "e" || input == "exit" || input == ""
|
|
15
|
+
tickers << input.strip.scan(/\S[a-zA-Z]+/).join("+").upcase
|
|
16
|
+
StockGains::CLI.new.print_stock_info(retrieve_stock_info(tickers))
|
|
17
|
+
tickers.clear
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def retrieve_stock_info(tickers)
|
|
22
|
+
StockGains::Stock.retrieve_stock(tickers).collect do |s|
|
|
23
|
+
StockGains::Stock.new(s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7], s[8], s[9])
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
data/lib/stock_gains.rb
ADDED
data/portfolio.csv
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
data/spec/01_cli_spec.rb
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe 'StockGains::CLI' do
|
|
4
|
+
cli = StockGains::CLI.new
|
|
5
|
+
|
|
6
|
+
describe 'instance' do
|
|
7
|
+
it 'creates an instance' do
|
|
8
|
+
expect(cli).to be_an_instance_of(StockGains::CLI)
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
describe '#valid_input?' do
|
|
13
|
+
it 'is true when the input is "all"' do
|
|
14
|
+
expect(cli.valid_input?(["all"])).to be_truthy
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
it 'is true when the input values are valid' do
|
|
18
|
+
expect(cli.valid_input?(["1, 2, 3"])).to be_truthy
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
it 'is false when the input is invalid' do
|
|
22
|
+
expect(cli.valid_input?(["0"])).to be_falsey
|
|
23
|
+
expect(cli.valid_input?(["none"])).to be_falsey
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe 'StockGains::Portfolio' do
|
|
4
|
+
portfolio = StockGains::Portfolio.new
|
|
5
|
+
|
|
6
|
+
describe '#initialize' do
|
|
7
|
+
it 'instantiates @total to 0' do
|
|
8
|
+
expect(portfolio).to respond_to(:total)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
it '@total is set to 0 ' do
|
|
12
|
+
expect(portfolio.total).to eq(0)
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe 'StockGains::Stock' do
|
|
4
|
+
apple = StockGains::Stock.new("Apple Inc.", "113.07", "116.17", "114.94", "148.64", "112.85 - 115.39", "92.00 - 134.54", "12.28", "9.22", "30")
|
|
5
|
+
|
|
6
|
+
describe '#initialize' do
|
|
7
|
+
it 'correctly formats a new stock instance' do
|
|
8
|
+
expect(apple.name).to eq("Apple Inc.")
|
|
9
|
+
expect(apple.cur_price).to eq("113.07")
|
|
10
|
+
expect(apple.prev_close).to eq("116.17")
|
|
11
|
+
expect(apple.open).to eq("114.94")
|
|
12
|
+
expect(apple.year_trgt).to eq("148.64")
|
|
13
|
+
expect(apple.d_range).to eq("112.85 - 115.39")
|
|
14
|
+
expect(apple.y_range).to eq("92.00 - 134.54")
|
|
15
|
+
expect(apple.pe).to eq("12.28")
|
|
16
|
+
expect(apple.eps).to eq("9.22")
|
|
17
|
+
expect(apple.shares).to eq("30")
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
describe '#calculate_days_value' do
|
|
22
|
+
it '@days_value is correctly calculated' do
|
|
23
|
+
expect(apple.days_value).to eq(-93.0)
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
describe '.retrieve_stock' do
|
|
28
|
+
it 'retrieves stock values from the Yahoo! Finance API' do
|
|
29
|
+
expect(StockGains::Stock.retrieve_stock(["AAPL"])).to match_array([["Apple Inc.", "113.07", "116.17", "114.94", "148.64", "112.85 - 115.39", "92.00 - 134.54", "12.28", "9.22"]])
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
data/spec/spec_helper.rb
ADDED
|
Binary file
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
+
require 'stock-gains/version'
|
|
5
|
+
|
|
6
|
+
Gem::Specification.new do |spec|
|
|
7
|
+
spec.authors = ["Frank Nowinski"]
|
|
8
|
+
spec.email = ["nowinski.frank@gmail.com"]
|
|
9
|
+
spec.description = %q{This Ruby gem uses the Yahoo Finance API to provide three valuable stock market functions for the user. First, it imports the users portoflio from a CSV file, calculates each stocks earnings/losses for the day, then returns the total balance your portfolio has earned/lost. Next, it gives the user the option to display generic stock information of any or all of the stocks in their portfolio. Lastly, it allows the user to lookup stock data of any stock(s) of their choosing (see https://github.com/frankNowinski/stock-gains-gem).}
|
|
10
|
+
spec.summary = %q{https://github.com/frankNowinski/stock-gains-gem}
|
|
11
|
+
spec.homepage = "https://learn.co"
|
|
12
|
+
|
|
13
|
+
spec.files = `git ls-files`.split($\)
|
|
14
|
+
spec.executables = ["stock-gains"]
|
|
15
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
|
16
|
+
spec.name = "stock-gains"
|
|
17
|
+
spec.require_paths = ["lib", "lib/stock-gains"]
|
|
18
|
+
spec.version = StockGains::VERSION
|
|
19
|
+
spec.license = "MIT"
|
|
20
|
+
|
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.10"
|
|
22
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
|
23
|
+
spec.add_development_dependency "rspec"
|
|
24
|
+
spec.add_development_dependency "nokogiri"
|
|
25
|
+
spec.add_development_dependency "pry"
|
|
26
|
+
spec.add_development_dependency "vcr"
|
|
27
|
+
spec.add_development_dependency "webmock"
|
|
28
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: stock-gains
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.3
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Frank Nowinski
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2015-12-14 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: bundler
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '1.10'
|
|
20
|
+
type: :development
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '1.10'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: rake
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - "~>"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '10.0'
|
|
34
|
+
type: :development
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - "~>"
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '10.0'
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: rspec
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - ">="
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: '0'
|
|
48
|
+
type: :development
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - ">="
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '0'
|
|
55
|
+
- !ruby/object:Gem::Dependency
|
|
56
|
+
name: nokogiri
|
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
|
58
|
+
requirements:
|
|
59
|
+
- - ">="
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: '0'
|
|
62
|
+
type: :development
|
|
63
|
+
prerelease: false
|
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
+
requirements:
|
|
66
|
+
- - ">="
|
|
67
|
+
- !ruby/object:Gem::Version
|
|
68
|
+
version: '0'
|
|
69
|
+
- !ruby/object:Gem::Dependency
|
|
70
|
+
name: pry
|
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
|
72
|
+
requirements:
|
|
73
|
+
- - ">="
|
|
74
|
+
- !ruby/object:Gem::Version
|
|
75
|
+
version: '0'
|
|
76
|
+
type: :development
|
|
77
|
+
prerelease: false
|
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
+
requirements:
|
|
80
|
+
- - ">="
|
|
81
|
+
- !ruby/object:Gem::Version
|
|
82
|
+
version: '0'
|
|
83
|
+
- !ruby/object:Gem::Dependency
|
|
84
|
+
name: vcr
|
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
|
86
|
+
requirements:
|
|
87
|
+
- - ">="
|
|
88
|
+
- !ruby/object:Gem::Version
|
|
89
|
+
version: '0'
|
|
90
|
+
type: :development
|
|
91
|
+
prerelease: false
|
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
93
|
+
requirements:
|
|
94
|
+
- - ">="
|
|
95
|
+
- !ruby/object:Gem::Version
|
|
96
|
+
version: '0'
|
|
97
|
+
- !ruby/object:Gem::Dependency
|
|
98
|
+
name: webmock
|
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
|
100
|
+
requirements:
|
|
101
|
+
- - ">="
|
|
102
|
+
- !ruby/object:Gem::Version
|
|
103
|
+
version: '0'
|
|
104
|
+
type: :development
|
|
105
|
+
prerelease: false
|
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
107
|
+
requirements:
|
|
108
|
+
- - ">="
|
|
109
|
+
- !ruby/object:Gem::Version
|
|
110
|
+
version: '0'
|
|
111
|
+
description: This Ruby gem uses the Yahoo Finance API to provide three valuable stock
|
|
112
|
+
market functions for the user. First, it imports the users portoflio from a CSV
|
|
113
|
+
file, calculates each stocks earnings/losses for the day, then returns the total
|
|
114
|
+
balance your portfolio has earned/lost. Next, it gives the user the option to display
|
|
115
|
+
generic stock information of any or all of the stocks in their portfolio. Lastly,
|
|
116
|
+
it allows the user to lookup stock data of any stock(s) of their choosing (see https://github.com/frankNowinski/stock-gains-gem).
|
|
117
|
+
email:
|
|
118
|
+
- nowinski.frank@gmail.com
|
|
119
|
+
executables:
|
|
120
|
+
- stock-gains
|
|
121
|
+
extensions: []
|
|
122
|
+
extra_rdoc_files: []
|
|
123
|
+
files:
|
|
124
|
+
- ".rspec"
|
|
125
|
+
- Gemfile
|
|
126
|
+
- Gemfile.lock
|
|
127
|
+
- LICENSE.txt
|
|
128
|
+
- README.md
|
|
129
|
+
- Rakefile
|
|
130
|
+
- bin/console
|
|
131
|
+
- bin/setup
|
|
132
|
+
- bin/stock-gains
|
|
133
|
+
- lib/stock-gains/cli.rb
|
|
134
|
+
- lib/stock-gains/portfolio.rb
|
|
135
|
+
- lib/stock-gains/stock.rb
|
|
136
|
+
- lib/stock-gains/stock_lookup.rb
|
|
137
|
+
- lib/stock-gains/version.rb
|
|
138
|
+
- lib/stock_gains.rb
|
|
139
|
+
- portfolio.csv
|
|
140
|
+
- screenshots/portfolio_csv.png
|
|
141
|
+
- screenshots/portfolio_data.png
|
|
142
|
+
- screenshots/portfolio_table.png
|
|
143
|
+
- screenshots/stock_lookup.png
|
|
144
|
+
- spec/01_cli_spec.rb
|
|
145
|
+
- spec/02_portfolio_spec.rb
|
|
146
|
+
- spec/03_stock_spec.rb
|
|
147
|
+
- spec/04_stock_lookup_spec.rb
|
|
148
|
+
- spec/spec_helper.rb
|
|
149
|
+
- stock-gains-gem-0.1.0.gem
|
|
150
|
+
- stock-gains-gem.gemspec
|
|
151
|
+
homepage: https://learn.co
|
|
152
|
+
licenses:
|
|
153
|
+
- MIT
|
|
154
|
+
metadata: {}
|
|
155
|
+
post_install_message:
|
|
156
|
+
rdoc_options: []
|
|
157
|
+
require_paths:
|
|
158
|
+
- lib
|
|
159
|
+
- lib/stock-gains
|
|
160
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
161
|
+
requirements:
|
|
162
|
+
- - ">="
|
|
163
|
+
- !ruby/object:Gem::Version
|
|
164
|
+
version: '0'
|
|
165
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
166
|
+
requirements:
|
|
167
|
+
- - ">="
|
|
168
|
+
- !ruby/object:Gem::Version
|
|
169
|
+
version: '0'
|
|
170
|
+
requirements: []
|
|
171
|
+
rubyforge_project:
|
|
172
|
+
rubygems_version: 2.4.5.1
|
|
173
|
+
signing_key:
|
|
174
|
+
specification_version: 4
|
|
175
|
+
summary: https://github.com/frankNowinski/stock-gains-gem
|
|
176
|
+
test_files:
|
|
177
|
+
- spec/01_cli_spec.rb
|
|
178
|
+
- spec/02_portfolio_spec.rb
|
|
179
|
+
- spec/03_stock_spec.rb
|
|
180
|
+
- spec/04_stock_lookup_spec.rb
|
|
181
|
+
- spec/spec_helper.rb
|
|
182
|
+
has_rdoc:
|