stockticker_cli 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3b15731913ff0de59abb1f3267caf19be14249582909a0984cfbbac9705000f7
4
- data.tar.gz: 19801b052cb0e4a3414f22f0ebd75a598d28651751ca7afb06ebe40913b355a8
3
+ metadata.gz: f7f59902974bc4a3e11c828f1196ece22610dad661f04baf750bbdc85570ce69
4
+ data.tar.gz: fe28a2b45d9d314f2ce5f0459b24aa84bc2638b7613492d1e2fbc959bf2a5fa9
5
5
  SHA512:
6
- metadata.gz: ed7fed565baf2a88da209fddefbc78148483400213423f7493d537d102570225818493920b1c2336a1f52a2633fef097e559f34f2bcf8070fd738ed0dee5e5c1
7
- data.tar.gz: 5f29cf77f3d9c611db0ba929ae6561586bbdebf73f65de2bc2bcd41ff8c89e87aa0e352a80d06c55b7aa5e25419db6c425b503528b9f472c5fa79df89cde02ee
6
+ metadata.gz: 2e8cbaeddfb64814cd74b95d30073f04dc85391f9df71f828f497749b3803e8077d6a943c02d8c4b3f8aad8720f47a8730f07310713d4ea27389513b91975e13
7
+ data.tar.gz: c045172ee4d6bb945d6c2b833c5cb0681beed211c3bba7fd11713fbcb7071279f50fe1181c218258133f90729ce4cd7b6a04f06a85ec07e82cc729e6508db4d8
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- stockticker_cli (0.1.2)
4
+ stockticker_cli (0.1.3)
5
5
  dotenv
6
6
  json
7
7
  pry
@@ -1,13 +1,11 @@
1
1
  class StocktickerCli::API
2
2
  BASE_URL = 'https://fmpcloud.io/api/v3/'
3
- KEY = ENV["API_KEY"]
4
-
5
-
6
-
3
+ # KEY = ENV["API_KEY"]
4
+
7
5
  # Api call
8
6
  def self.query
9
7
  # https://fmpcloud.io/api/v3/actives?apikey=4b31fc84cd3248a0f61868b96f531bde
10
- results = RestClient.get("#{BASE_URL}actives?apikey=#{KEY}")
8
+ results = RestClient.get("#{BASE_URL}actives?apikey=#{$KEY}")
11
9
  json = JSON.parse(results)
12
10
 
13
11
 
@@ -18,7 +16,7 @@ class StocktickerCli::API
18
16
  end
19
17
 
20
18
  def self.info_query(stock_obj)
21
- results = RestClient.get("#{BASE_URL}profile/#{stock_obj.ticker}?apikey=#{KEY}")
19
+ results = RestClient.get("#{BASE_URL}profile/#{stock_obj.ticker}?apikey=#{$KEY}")
22
20
  json = JSON.parse(results)
23
21
  stock_obj.set_attributes(json[0])
24
22
  end
@@ -8,7 +8,10 @@ class StocktickerCli::CLI
8
8
  def welcome
9
9
  puts "Welcome to the stock ticker cli app!"
10
10
  puts ""
11
+ puts "Please sign-up for a free account to use this app here: https://fmpcloud.io/register"
11
12
  sleep(1)
13
+ puts "Please enter your api key to continue."
14
+ $KEY = gets.strip
12
15
  menu
13
16
  end
14
17
 
@@ -53,8 +56,7 @@ class StocktickerCli::CLI
53
56
 
54
57
  if (input.between?(0, 10))
55
58
  s = StocktickerCli::STOCK.all[input - 1]
56
- StocktickerCli::API.info_query(s)
57
- binding.pry
59
+ StocktickerCli::API.info_query(s)
58
60
  puts ""
59
61
  puts "#{s.symbol} - #{s.companyName} - $#{s.price}"
60
62
  puts ""
@@ -1,3 +1,3 @@
1
1
  module StocktickerCli
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stockticker_cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - TerryThreatt