qc 0.5.3 → 0.5.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/qc/command_runner.rb +17 -2
- data/lib/qc/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: 43081f3f3adb70c36040d8988517ce5d75479c34
|
4
|
+
data.tar.gz: cbaca31ad41e98339afb002dda09f0fa2514e305
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: acf83f9e71bd3d7cf9dbf421d98e2e3093c39e7c570590afc67255cd79161ea0f3dbd08705bc6b687fe03b2da873b540d1bfec2464ea593df5f42f04a3464afd
|
7
|
+
data.tar.gz: 7a55e02997e60d18fb1a9a8c1bd8e1aab4ef3f7e139d2134a0101fc12227cb9917eed8d1b4375f8862777651127df467ff1326a633ff8cd87f80c1bdec5973b8
|
data/Gemfile.lock
CHANGED
data/lib/qc/command_runner.rb
CHANGED
@@ -102,12 +102,16 @@ module Qc
|
|
102
102
|
end
|
103
103
|
|
104
104
|
def run_push
|
105
|
+
return false unless validate_initialized_project!
|
106
|
+
|
105
107
|
sync_changed_files
|
106
108
|
save_current_timestamp
|
107
109
|
true
|
108
110
|
end
|
109
111
|
|
110
112
|
def run_compile
|
113
|
+
return false unless validate_initialized_project!
|
114
|
+
|
111
115
|
compile = quant_connect_proxy.create_compile project_settings.project_id
|
112
116
|
puts "Compile request sent to the queue with id #{compile.id}"
|
113
117
|
|
@@ -127,6 +131,8 @@ module Qc
|
|
127
131
|
end
|
128
132
|
|
129
133
|
def run_backtest
|
134
|
+
return false unless validate_initialized_project!
|
135
|
+
|
130
136
|
unless project_settings.last_compile_id
|
131
137
|
puts "Project not compiled. Please run 'qc compile'"
|
132
138
|
return false
|
@@ -138,6 +144,8 @@ module Qc
|
|
138
144
|
end
|
139
145
|
|
140
146
|
def do_run_default
|
147
|
+
return false unless validate_initialized_project!
|
148
|
+
|
141
149
|
failed = %i(push compile backtest).find do |command|
|
142
150
|
!run(command)
|
143
151
|
end
|
@@ -155,8 +163,6 @@ module Qc
|
|
155
163
|
sleep BACKTEST_DELAY_IN_SECONDS if backtest.completed?
|
156
164
|
end while !backtest.completed?
|
157
165
|
|
158
|
-
puts "RESULT: #{backtest.result}"
|
159
|
-
|
160
166
|
puts "Bactest finished" if backtest.success?
|
161
167
|
puts "Backtest failed" if backtest.error?
|
162
168
|
|
@@ -228,5 +234,14 @@ module Qc
|
|
228
234
|
project_settings.last_sync_at = Time.now
|
229
235
|
save_project_settings
|
230
236
|
end
|
237
|
+
|
238
|
+
def validate_initialized_project!
|
239
|
+
puts "Please run 'qc init' to initialize your project" unless initialized_project?
|
240
|
+
initialized_project?
|
241
|
+
end
|
242
|
+
|
243
|
+
def initialized_project?
|
244
|
+
project_settings.project_id
|
245
|
+
end
|
231
246
|
end
|
232
247
|
end
|
data/lib/qc/version.rb
CHANGED