ig_markets 0.23 → 0.24
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/ig_markets/cli/commands/self_test_command.rb +1 -1
- data/lib/ig_markets/cli/tables/table.rb +5 -10
- data/lib/ig_markets/deal_confirmation.rb +1 -0
- data/lib/ig_markets/streaming/subscription.rb +7 -12
- data/lib/ig_markets/version.rb +1 -1
- metadata +20 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9cd97e6621680b09ea0d2452be0f56c97d5e22e4
|
4
|
+
data.tar.gz: 591ddf885a14506bc1740b8856933e1f49b96a78
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c74e2b7aa2dfff1fed03b44ced746fdf9282a695d2a6589ebbe4c8c785c11040c6fa05ae282915e3cba127eda0acc4ccd96a144bbb727d48eb7d8bdbdc77b4d
|
7
|
+
data.tar.gz: fce219c5d359c4838b0d8d7ce1a60ffa46a41a5b70ced774443bd53267a84094db7d922eaa62e67772b63f337b1399576a81625142de35b148c390946c4d41f8
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# IG Markets Changelog
|
2
2
|
|
3
|
+
### 0.24 — December 6, 2016
|
4
|
+
|
5
|
+
- Added `IGMarkets::DealConfirmation#channel` attribute which is used by the streaming API
|
6
|
+
- Update to `codeclimate-test-reporter` 1.0
|
7
|
+
|
3
8
|
### 0.23 — October 19, 2016
|
4
9
|
|
5
10
|
- Use `Integer` instead of `Fixnum` in preparation for Ruby 2.4
|
@@ -6,7 +6,7 @@ module IGMarkets
|
|
6
6
|
|
7
7
|
def self_test
|
8
8
|
self.class.begin_session(options) do |dealing_platform|
|
9
|
-
raise '
|
9
|
+
raise 'The self-test command must be run on a demo account' unless dealing_platform.session.platform == :demo
|
10
10
|
|
11
11
|
@dealing_platform = dealing_platform
|
12
12
|
run_self_test
|
@@ -26,20 +26,15 @@ module IGMarkets
|
|
26
26
|
|
27
27
|
private
|
28
28
|
|
29
|
-
def default_title
|
30
|
-
end
|
29
|
+
def default_title; end
|
31
30
|
|
32
|
-
def headings
|
33
|
-
end
|
31
|
+
def headings; end
|
34
32
|
|
35
|
-
def right_aligned_columns
|
36
|
-
end
|
33
|
+
def right_aligned_columns; end
|
37
34
|
|
38
|
-
def row(_model)
|
39
|
-
end
|
35
|
+
def row(_model); end
|
40
36
|
|
41
|
-
def cell_color(_value, _model, _row_index, _column_index)
|
42
|
-
end
|
37
|
+
def cell_color(_value, _model, _row_index, _column_index); end
|
43
38
|
|
44
39
|
def table
|
45
40
|
Terminal::Table.new(title: @title, headings: headings, rows: rows).tap do |t|
|
@@ -50,7 +50,7 @@ module IGMarkets
|
|
50
50
|
CHART_TICK_DATA_REGEX = /^CHART:(.*):TICK$/
|
51
51
|
CONSOLIDATED_CHART_DATA_REGEX = /^CHART:(.*):(SECOND|1MINUTE|5MINUTE|HOUR)$/
|
52
52
|
|
53
|
-
def on_raw_data(
|
53
|
+
def on_raw_data(_subscription, item_name, item_data, new_data)
|
54
54
|
{
|
55
55
|
ACCOUNT_DATA_REGEX => :on_account_data,
|
56
56
|
MARKET_DATA_REGEX => :on_market_data,
|
@@ -58,12 +58,11 @@ module IGMarkets
|
|
58
58
|
CHART_TICK_DATA_REGEX => :on_chart_tick_data,
|
59
59
|
CONSOLIDATED_CHART_DATA_REGEX => :on_consolidated_chart_data
|
60
60
|
}.each do |regex, handler|
|
61
|
-
send handler,
|
61
|
+
send handler, item_name, item_data, new_data if item_name =~ regex
|
62
62
|
end
|
63
63
|
end
|
64
64
|
|
65
|
-
|
66
|
-
def on_account_data(_subscription, item_name, item_data, new_data)
|
65
|
+
def on_account_data(item_name, item_data, new_data)
|
67
66
|
item_data = @dealing_platform.instantiate_models AccountUpdate, item_data
|
68
67
|
new_data = @dealing_platform.instantiate_models AccountUpdate, new_data
|
69
68
|
|
@@ -73,8 +72,7 @@ module IGMarkets
|
|
73
72
|
run_callbacks new_data, item_data
|
74
73
|
end
|
75
74
|
|
76
|
-
|
77
|
-
def on_market_data(_subscription, item_name, item_data, new_data)
|
75
|
+
def on_market_data(item_name, item_data, new_data)
|
78
76
|
item_data = @dealing_platform.instantiate_models MarketUpdate, item_data
|
79
77
|
new_data = @dealing_platform.instantiate_models MarketUpdate, new_data
|
80
78
|
|
@@ -84,8 +82,7 @@ module IGMarkets
|
|
84
82
|
run_callbacks new_data, item_data
|
85
83
|
end
|
86
84
|
|
87
|
-
|
88
|
-
def on_trade_data(_subscription, item_name, _item_data, new_data)
|
85
|
+
def on_trade_data(item_name, _item_data, new_data)
|
89
86
|
account_id = item_name.match(TRADE_DATA_REGEX).captures.first
|
90
87
|
|
91
88
|
{ confirms: DealConfirmation, opu: PositionUpdate, wou: WorkingOrderUpdate }.each do |key, model_class|
|
@@ -98,8 +95,7 @@ module IGMarkets
|
|
98
95
|
end
|
99
96
|
end
|
100
97
|
|
101
|
-
|
102
|
-
def on_chart_tick_data(_subscription, item_name, _item_data, new_data)
|
98
|
+
def on_chart_tick_data(item_name, _item_data, new_data)
|
103
99
|
new_data = @dealing_platform.instantiate_models ChartTickUpdate, new_data
|
104
100
|
|
105
101
|
new_data.epic = item_name.match(CHART_TICK_DATA_REGEX).captures.first
|
@@ -107,8 +103,7 @@ module IGMarkets
|
|
107
103
|
run_callbacks new_data
|
108
104
|
end
|
109
105
|
|
110
|
-
|
111
|
-
def on_consolidated_chart_data(_subscription, item_name, item_data, new_data)
|
106
|
+
def on_consolidated_chart_data(item_name, item_data, new_data)
|
112
107
|
item_data = @dealing_platform.instantiate_models ConsolidatedChartDataUpdate, item_data
|
113
108
|
new_data = @dealing_platform.instantiate_models ConsolidatedChartDataUpdate, new_data
|
114
109
|
|
data/lib/ig_markets/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ig_markets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.24'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Viney
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-12-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|
@@ -114,14 +114,14 @@ dependencies:
|
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: '0
|
117
|
+
version: '1.0'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: '0
|
124
|
+
version: '1.0'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: factory_girl
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -198,14 +198,28 @@ dependencies:
|
|
198
198
|
requirements:
|
199
199
|
- - "~>"
|
200
200
|
- !ruby/object:Gem::Version
|
201
|
-
version: '0.
|
201
|
+
version: '0.46'
|
202
202
|
type: :development
|
203
203
|
prerelease: false
|
204
204
|
version_requirements: !ruby/object:Gem::Requirement
|
205
205
|
requirements:
|
206
206
|
- - "~>"
|
207
207
|
- !ruby/object:Gem::Version
|
208
|
-
version: '0.
|
208
|
+
version: '0.46'
|
209
|
+
- !ruby/object:Gem::Dependency
|
210
|
+
name: simplecov
|
211
|
+
requirement: !ruby/object:Gem::Requirement
|
212
|
+
requirements:
|
213
|
+
- - "~>"
|
214
|
+
- !ruby/object:Gem::Version
|
215
|
+
version: '0.12'
|
216
|
+
type: :development
|
217
|
+
prerelease: false
|
218
|
+
version_requirements: !ruby/object:Gem::Requirement
|
219
|
+
requirements:
|
220
|
+
- - "~>"
|
221
|
+
- !ruby/object:Gem::Version
|
222
|
+
version: '0.12'
|
209
223
|
- !ruby/object:Gem::Dependency
|
210
224
|
name: yard
|
211
225
|
requirement: !ruby/object:Gem::Requirement
|