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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 66b12d82496c865a2e65cb7fb39150d46264d5b3
4
- data.tar.gz: 8b75bef01632eba2f63ae712b1ec8172ac3a8792
3
+ metadata.gz: 43081f3f3adb70c36040d8988517ce5d75479c34
4
+ data.tar.gz: cbaca31ad41e98339afb002dda09f0fa2514e305
5
5
  SHA512:
6
- metadata.gz: 745762eec49c9941f5ae6b933211fdd860eabfb72f3bd11aa25afeab0d3e9f98e379fa4543c942a26aa39902a5818744a19aa475ba319794163ceb43c98ac5ab
7
- data.tar.gz: 4e1f5a4d42f5ace35821e1764245cda1122242f072e3d8f9614673dd57a349e3e66520e2cfba5e923a6010ede7668fd085e4481806e96d898b4cdce5402b7ce7
6
+ metadata.gz: acf83f9e71bd3d7cf9dbf421d98e2e3093c39e7c570590afc67255cd79161ea0f3dbd08705bc6b687fe03b2da873b540d1bfec2464ea593df5f42f04a3464afd
7
+ data.tar.gz: 7a55e02997e60d18fb1a9a8c1bd8e1aab4ef3f7e139d2134a0101fc12227cb9917eed8d1b4375f8862777651127df467ff1326a633ff8cd87f80c1bdec5973b8
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- qc (0.5.3)
4
+ qc (0.5.4)
5
5
  rest-client (~> 2.0.2)
6
6
  vcr (~> 3.0.3)
7
7
  webmock (~> 3.1.0)
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Qc
2
- VERSION = "0.5.3"
2
+ VERSION = "0.5.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jorge Manrubia