top_stock_movers 0.1.3 → 0.1.4
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/README.md +4 -15
- data/lib/top_stock_movers/cli.rb +10 -2
- data/lib/top_stock_movers/version.rb +1 -1
- data/now-playing-cli-gem-0.1.2.gem +0 -0
- data/top_stock_movers-0.1.0.gem +0 -0
- data/top_stock_movers-0.1.1.gem +0 -0
- data/top_stock_movers-0.1.2.gem +0 -0
- data/top_stock_movers-0.1.3.gem +0 -0
- metadata +6 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a49886117f150dcae22b84f600606c74a6e26d007e6bb74298d9e147331890d
|
4
|
+
data.tar.gz: 44205f70a128737479a7f8fafa21b3e236793dde1caae26244ca406cb6c38bdd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 650f2d61cd1153baa7a13516e584521ecc29db05c65ee3bbf2c3ce3e9355a0d3a8d21ec5052d4a355ae423f7d55388e5ab9011a02d5801a817e036aaede7f543
|
7
|
+
data.tar.gz: 83b686bd85c9bd15b760d0d69f65e53650793137ceb6af44d7725119fea17d2497a9a85fd5da5d91751186d5d7ce79e5dad93e1d5f8b787ec8119590fe8e61fe
|
data/README.md
CHANGED
@@ -1,28 +1,17 @@
|
|
1
1
|
# TopStockMovers
|
2
2
|
|
3
|
-
|
3
|
+
This Ruby Gem allows you to view the stock market through 7 different sorting options in real time. Each sorting option will give you the most relevant data customized to the sorting option you selected along with the Name and Ticker Symbol of the stock. From this list output you can gather more data on each individual stock as well as visit the stocks web page!
|
4
4
|
|
5
|
-
|
5
|
+
Enjoy!
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
9
|
-
Add this line to your application's Gemfile:
|
10
|
-
|
11
|
-
```ruby
|
12
|
-
gem 'top_stock_movers'
|
13
|
-
```
|
14
|
-
|
15
|
-
And then execute:
|
16
|
-
|
17
|
-
$ bundle
|
18
|
-
|
19
|
-
Or install it yourself as:
|
20
|
-
|
21
9
|
$ gem install top_stock_movers
|
22
10
|
|
23
11
|
## Usage
|
12
|
+
Type the below prompt into your command line & follow the given instructions.
|
24
13
|
|
25
|
-
|
14
|
+
$ top-stock-movers
|
26
15
|
|
27
16
|
## Development
|
28
17
|
|
data/lib/top_stock_movers/cli.rb
CHANGED
@@ -7,6 +7,9 @@ class TopStockMovers::CLI
|
|
7
7
|
goodbye
|
8
8
|
end
|
9
9
|
|
10
|
+
# This Viewing_options class is what is used to allow the program to view the 7 different sorting options
|
11
|
+
# from the website and is the information used to populate the first list selection. It also is what is used
|
12
|
+
# to provide the most relevant information and sorting options for the list_stocks method.
|
10
13
|
class Viewing_options
|
11
14
|
attr_accessor :name, :desc, :sorter
|
12
15
|
|
@@ -44,9 +47,12 @@ class TopStockMovers::CLI
|
|
44
47
|
puts ""
|
45
48
|
puts "Today's Top 25 #{@selection.name} stocks"
|
46
49
|
puts "------------------------------"
|
47
|
-
|
50
|
+
|
51
|
+
#The line below allows me to scrape 7 different url's by changing the url according to the users selection
|
48
52
|
TopStockMovers::Stocks.scrape_tradingview(@selection.name.downcase) if TopStockMovers::Stocks.all == []
|
49
53
|
@stocks = TopStockMovers::Stocks.all
|
54
|
+
#This case statement is using the Viewing_options instance originally selected by the user to output
|
55
|
+
#the most relevant data per the selection and sorts accordingly. For example "% change" for Gainers, or "volume" for Active
|
50
56
|
case @selection.sorter
|
51
57
|
when "percent_change-pos"
|
52
58
|
@stocks.sort{|a,b| b.percent_change <=> a.percent_change}.each.with_index(1) do |stock, i|
|
@@ -82,7 +88,7 @@ class TopStockMovers::CLI
|
|
82
88
|
end
|
83
89
|
|
84
90
|
def menu
|
85
|
-
puts "Enter number of Stock you would like more info on, type 'list' to list stocks,
|
91
|
+
puts "Enter number of Stock you would like more info on, type 'view options' to view the initial sorting options, 'list' to list stocks, or exit to quit"
|
86
92
|
input = gets.strip.downcase
|
87
93
|
if input.to_i > 0
|
88
94
|
num = input.to_i - 1
|
@@ -111,6 +117,8 @@ class TopStockMovers::CLI
|
|
111
117
|
else
|
112
118
|
menu
|
113
119
|
end
|
120
|
+
elsif input == 'view options'
|
121
|
+
call
|
114
122
|
elsif input == 'list'
|
115
123
|
list_stocks
|
116
124
|
menu
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: top_stock_movers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christian Thomas
|
@@ -133,9 +133,14 @@ files:
|
|
133
133
|
- lib/top_stock_movers/cli.rb
|
134
134
|
- lib/top_stock_movers/stocks.rb
|
135
135
|
- lib/top_stock_movers/version.rb
|
136
|
+
- now-playing-cli-gem-0.1.2.gem
|
136
137
|
- spec.md
|
137
138
|
- spec/spec_helper.rb
|
138
139
|
- spec/top_stock_movers_spec.rb
|
140
|
+
- top_stock_movers-0.1.0.gem
|
141
|
+
- top_stock_movers-0.1.1.gem
|
142
|
+
- top_stock_movers-0.1.2.gem
|
143
|
+
- top_stock_movers-0.1.3.gem
|
139
144
|
- top_stock_movers.gemspec
|
140
145
|
homepage: https://learn.co
|
141
146
|
licenses:
|