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 +4 -4
- data/lib/stockfighter/gm.rb +12 -7
- data/lib/stockfighter/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6db5633dfc5eb501d4fb258d9a28e4dc56b95bda
|
4
|
+
data.tar.gz: 4964650a2d4a52c04ac20e92276d05b6ab9a1efa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a17e554b60b9d0535c01b7e0935595aac75282a494bb33bc25dd4699c49b1bd64963ce9006c0032f0ccb1e3cd16b0fdbc2dc7d627ebd1174e43d141d2ceb1b7
|
7
|
+
data.tar.gz: aed5349983101b57c345b3d3d2f8984e3f6d18a463bb3362d3646b087503fd6024eda542a1733df0d830b0e7444cd1fd84e8cc54875c23cf45c8114597ac68b9
|
data/lib/stockfighter/gm.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
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
|
data/lib/stockfighter/version.rb
CHANGED