stockfighter 0.1.1 → 0.1.2

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
  SHA1:
3
- metadata.gz: 3133a56c01c50225b606c5a027a4450892ad4c19
4
- data.tar.gz: d2e02e42f70aff2bacd3b060d782e42f815f77a5
3
+ metadata.gz: 6db5633dfc5eb501d4fb258d9a28e4dc56b95bda
4
+ data.tar.gz: 4964650a2d4a52c04ac20e92276d05b6ab9a1efa
5
5
  SHA512:
6
- metadata.gz: 1252862680f92e3968c730baaf1e9361548b7f9c7ed99d61685ec66b1a152454f2ef76c4459ac4ab86178bb8ce3e8419c131e5c21ccf66e78717ac423731b9ee
7
- data.tar.gz: 8ad9d93e6ae4559e4bce99b632208fa5eb3a5f026aedbcbdd646e8a8c1c604deae64984fd8d1a30e9c2fbe609e1298e1683dbbf48555f15c694570efcf210eed
6
+ metadata.gz: 4a17e554b60b9d0535c01b7e0935595aac75282a494bb33bc25dd4699c49b1bd64963ce9006c0032f0ccb1e3cd16b0fdbc2dc7d627ebd1174e43d141d2ceb1b7
7
+ data.tar.gz: aed5349983101b57c345b3d3d2f8984e3f6d18a463bb3362d3646b087503fd6024eda542a1733df0d830b0e7444cd1fd84e8cc54875c23cf45c8114597ac68b9
@@ -26,7 +26,7 @@ module Stockfighter
26
26
  def restart
27
27
  if @instance_id
28
28
  resp = HTTParty.post("#{GM_URL}/instances/#{@instance_id}/restart", :headers => {"X-Starfighter-Authorization" => @api_key})
29
- udpate_config(resp)
29
+ update_config(resp)
30
30
  end
31
31
  end
32
32
 
@@ -50,13 +50,18 @@ module Stockfighter
50
50
  end
51
51
 
52
52
  def update_config(resp)
53
- @config = {}
54
- @config[:key] = @api_key
55
- @config[:account] = resp["account"]
56
- @config[:venue] = resp["venues"][0]
57
- @config[:symbol] = resp["tickers"][0]
58
53
 
59
- @instance_id = resp["instanceId"]
54
+ if resp["ok"]
55
+ @config = {}
56
+ @config[:key] = @api_key
57
+ @config[:account] = resp["account"]
58
+ @config[:venue] = resp["venues"][0]
59
+ @config[:symbol] = resp["tickers"][0]
60
+
61
+ @instance_id = resp["instanceId"]
62
+ else
63
+ raise "Error response received from #{GM_URL}: #{resp['error']}"
64
+ end
60
65
  end
61
66
  private :update_config
62
67
  end
@@ -1,3 +1,3 @@
1
1
  module Stockfighter
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stockfighter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert J Samson