dronejob 1.5.1 → 1.6.0

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: d3279b04803e22fc7a01e3ca3c4cb46f4f202b85
4
- data.tar.gz: 3811612ce2b9408bf25cfa424466257cbe579d56
3
+ metadata.gz: 5d5e8318926dc2e1172dd75fde843e138c07d957
4
+ data.tar.gz: 84d2f9eff533a50c1bbe198edf695d8f526a6216
5
5
  SHA512:
6
- metadata.gz: 7fd4183d69c358ba7120e2617bdd3eb351f6afa3b091571ee127623f0fda7eb166c845e697e025e1afdc055b7556c7c22c1ab5df453b098f5df87ff8b7b7988b
7
- data.tar.gz: 6b7131500b197c157d1952524f675ff79d75748eb26bc86e0cdbc9daf71ee2c270b4d760bac8286cf6d2643294c0bf05e096fbaa8d559709a8d01e2199bd5fe8
6
+ metadata.gz: 727c3da9be4f677294e675ebcbc4c7f41ad513e861c20d86497a94af31db90e70ba324c61b2df5f4527cd744f144f6fa549a6b998cb576e76dd2f85d80a8d94c
7
+ data.tar.gz: d6f86e969fbb77d7324acd26436dcef4e1b9d1557f49de0a05d953b28e59ebc6a985e8f4193db64f15e20cecd5d38b9b00c88ce7e7feccb6310765f003d9ec54
@@ -20,7 +20,7 @@ Lint/UselessAssignment:
20
20
  - '**/spec/**/*'
21
21
 
22
22
  # We could potentially enable the 2 below:
23
- Layout/IndentHash:
23
+ Layout/IndentFirstHashElement:
24
24
  Enabled: false
25
25
 
26
26
  Layout/AlignHash:
@@ -41,7 +41,7 @@ Style/NumericPredicate:
41
41
  Lint/HandleExceptions:
42
42
  Enabled: false
43
43
 
44
- Lint/RescueWithoutErrorClass:
44
+ Style/RescueStandardError:
45
45
  Enabled: false
46
46
 
47
47
  # Cop supports --auto-correct.
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dronejob (1.5.1)
5
- actionpack (>= 5.1)
6
- activejob (>= 5.1)
4
+ dronejob (1.6.0)
5
+ actionpack (>= 4.0.2)
6
+ activejob (>= 4.0.2)
7
7
  bundler (>= 1.12.0, < 3.0.0)
8
8
  git (>= 1.3)
9
9
  google-cloud-logging (>= 1.2)
@@ -54,7 +54,7 @@ GEM
54
54
  ffi (>= 1.3.0)
55
55
  faraday (0.15.4)
56
56
  multipart-post (>= 1.2, < 3)
57
- ffi (1.10.0)
57
+ ffi (1.11.0)
58
58
  git (1.5.0)
59
59
  globalid (0.4.2)
60
60
  activesupport (>= 4.2.0)
@@ -74,7 +74,7 @@ GEM
74
74
  googleauth (>= 0.6.2, < 0.10.0)
75
75
  grpc (>= 1.7.2, < 2.0)
76
76
  rly (~> 0.2.3)
77
- google-protobuf (3.7.1-universal-darwin)
77
+ google-protobuf (3.7.1)
78
78
  googleapis-common-protos (1.3.9)
79
79
  google-protobuf (~> 3.0)
80
80
  googleapis-common-protos-types (~> 1.0)
@@ -88,10 +88,10 @@ GEM
88
88
  multi_json (~> 1.11)
89
89
  os (>= 0.9, < 2.0)
90
90
  signet (~> 0.7)
91
- grpc (1.20.0-universal-darwin)
91
+ grpc (1.20.0)
92
92
  google-protobuf (~> 3.7)
93
93
  googleapis-common-protos-types (~> 1.0.0)
94
- haml (5.0.4)
94
+ haml (5.1.0)
95
95
  temple (>= 0.8.0)
96
96
  tilt
97
97
  httpclient (2.8.3)
@@ -110,7 +110,7 @@ GEM
110
110
  mini_portile2 (2.4.0)
111
111
  minitest (5.11.3)
112
112
  multi_json (1.13.1)
113
- multipart-post (2.0.0)
113
+ multipart-post (2.1.1)
114
114
  nokogiri (1.10.3)
115
115
  mini_portile2 (~> 2.4.0)
116
116
  os (1.0.1)
@@ -140,7 +140,7 @@ GEM
140
140
  rails-html-sanitizer (1.0.4)
141
141
  loofah (~> 2.2, >= 2.2.2)
142
142
  rainbow (3.0.0)
143
- redis (4.1.0)
143
+ redis (4.1.1)
144
144
  rly (0.2.3)
145
145
  rmagick (2.16.0)
146
146
  rspec (3.8.0)
@@ -156,13 +156,13 @@ GEM
156
156
  diff-lcs (>= 1.2.0, < 2.0)
157
157
  rspec-support (~> 3.8.0)
158
158
  rspec-support (3.8.0)
159
- rubocop (0.68.1)
159
+ rubocop (0.69.0)
160
160
  jaro_winkler (~> 1.5.1)
161
161
  parallel (~> 1.10)
162
- parser (>= 2.5, != 2.5.1.1)
162
+ parser (>= 2.6)
163
163
  rainbow (>= 2.2.2, < 4.0)
164
164
  ruby-progressbar (~> 1.7)
165
- unicode-display_width (>= 1.4.0, < 1.6)
165
+ unicode-display_width (>= 1.4.0, < 1.7)
166
166
  ruby-progressbar (1.10.0)
167
167
  rubyzip (1.2.2)
168
168
  sidekiq (5.2.7)
@@ -185,7 +185,7 @@ GEM
185
185
  ethon (>= 0.9.0)
186
186
  tzinfo (1.2.5)
187
187
  thread_safe (~> 0.1)
188
- unicode-display_width (1.5.0)
188
+ unicode-display_width (1.6.0)
189
189
  workspace (1.0.15)
190
190
  bundler (>= 1.12.0, < 3.0.0)
191
191
  mime-types (~> 3.1)
@@ -213,4 +213,4 @@ DEPENDENCIES
213
213
  rubocop (>= 0.50)
214
214
 
215
215
  BUNDLED WITH
216
- 2.0.1
216
+ 1.16.3
@@ -1,4 +1,4 @@
1
- lib = File.expand_path('../lib', __FILE__)
1
+ lib = File.expand_path('lib', __dir__)
2
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
  require 'dronejob/version'
4
4
 
@@ -12,23 +12,23 @@ Gem::Specification.new do |s|
12
12
  s.homepage = "https://github.com/MagLoft/dronejob"
13
13
  s.summary = "DroneJob Drone Factory"
14
14
  s.description = "Scalable worker factory for ruby"
15
- s.required_ruby_version = '~> 2.0'
15
+ s.required_ruby_version = '~> 2.3'
16
16
  s.required_rubygems_version = '~> 2.4'
17
17
  s.add_dependency "bundler", "< 3.0.0", ">= 1.12.0"
18
+ s.add_runtime_dependency "actionpack", ">= 4.0.2"
19
+ s.add_runtime_dependency "activejob", ">= 4.0.2"
18
20
  s.add_runtime_dependency "git", ">= 1.3"
19
- s.add_runtime_dependency "thor", ">= 0.19"
20
- s.add_runtime_dependency "sidekiq", ">= 5.0"
21
- s.add_runtime_dependency "activejob", ">= 5.1"
22
- s.add_runtime_dependency "actionpack", ">= 5.1"
23
21
  s.add_runtime_dependency "google-cloud-logging", ">= 1.2"
24
22
  s.add_runtime_dependency "pusher", ">= 1.3"
23
+ s.add_runtime_dependency "sidekiq", ">= 5.0"
24
+ s.add_runtime_dependency "thor", ">= 0.19"
25
25
  s.add_runtime_dependency "workspace", ">= 1.0"
26
- s.add_runtime_dependency "workspace-parse", ">= 1.0"
27
26
  s.add_runtime_dependency "workspace-archive", ">= 1.0"
28
27
  s.add_runtime_dependency "workspace-media", ">= 1.0"
29
28
  s.add_runtime_dependency "workspace-net", ">= 1.0"
30
- s.add_development_dependency "rspec", ">= 3.3"
29
+ s.add_runtime_dependency "workspace-parse", ">= 1.0"
31
30
  s.add_development_dependency "pry", ">= 0.10"
31
+ s.add_development_dependency "rspec", ">= 3.3"
32
32
  s.add_development_dependency "rubocop", ">= 0.50"
33
33
  s.files = `git ls-files`.split("\n")
34
34
  s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
@@ -66,6 +66,7 @@ module Dronejob
66
66
  Workspace::Dir.new(File.join(Dir.pwd, "tmp/jobs")).each_dir do |dir|
67
67
  dronejob_variables = dir.file("dronejob.yml").read_yaml
68
68
  next unless dronejob_variables[:dronejob_completed] == true
69
+
69
70
  Dronejob::Base.log("info", "Archiving #{dir.name}")
70
71
  archive_file = archive_dir.file("#{dir.name}.zip")
71
72
  if archive_file.exists? and !options.force
@@ -75,6 +75,7 @@ module Dronejob
75
75
  info("starting from phase #{param(:from)}")
76
76
  phase = prev_phase(param(:from))
77
77
  raise("phase '#{param(:from)}' not found!") if phase.nil? or @commits[phase.to_s].nil?
78
+
78
79
  git_reset(phase.to_s)
79
80
  else
80
81
  git_reset
@@ -30,6 +30,7 @@ module Dronejob
30
30
  if (config = self.class.param_config(name))
31
31
  return Base64.strict_decode64(value) if config[:type] == :base64
32
32
  return JSON.parse(Base64.strict_decode64(value)) if config[:type] == :json64
33
+
33
34
  if config[:type] == :numeric
34
35
  return Integer(value) if Integer(value) rescue false
35
36
  return Float(value) if Float(value) rescue false
@@ -29,6 +29,7 @@ module Dronejob
29
29
 
30
30
  # initialize phase
31
31
  fail "Phase not found: '#{phase}'" unless self.respond_to?(phase)
32
+
32
33
  run_callbacks :phase do
33
34
  if completed_phase?(phase) and !@phase_config[:always_run]
34
35
  info("already completed")
@@ -88,6 +89,7 @@ module Dronejob
88
89
  index = phases.index(phase.to_sym)
89
90
  return nil if index.nil?
90
91
  return "start" if index == 0
92
+
91
93
  phases[index - 1]
92
94
  end
93
95
  end
@@ -39,11 +39,12 @@ module Dronejob
39
39
  data[:timestamp] = Time.now.to_i
40
40
  data[:status] = status
41
41
  return false if data[:user_id].nil?
42
+
42
43
  pusher_client.trigger("private-#{data[:user_id]}", "process", data)
43
44
  end
44
45
 
45
- def publish_error(e)
46
- publish_status({ title: self.title, description: e.message, phase: @phase, progress: 100 }, "failed") if should_notify?
46
+ def publish_error(event)
47
+ publish_status({ title: self.title, description: event.message, phase: @phase, progress: 100 }, "failed") if should_notify?
47
48
  end
48
49
 
49
50
  def notify_before_phase
@@ -1,3 +1,3 @@
1
1
  module Dronejob
2
- VERSION = "1.5.1"
2
+ VERSION = "1.6.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dronejob
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Strebitzer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-03 00:00:00.000000000 Z
11
+ date: 2019-05-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -31,103 +31,103 @@ dependencies:
31
31
  - !ruby/object:Gem::Version
32
32
  version: 1.12.0
33
33
  - !ruby/object:Gem::Dependency
34
- name: git
34
+ name: actionpack
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - ">="
38
38
  - !ruby/object:Gem::Version
39
- version: '1.3'
39
+ version: 4.0.2
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - ">="
45
45
  - !ruby/object:Gem::Version
46
- version: '1.3'
46
+ version: 4.0.2
47
47
  - !ruby/object:Gem::Dependency
48
- name: thor
48
+ name: activejob
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - ">="
52
52
  - !ruby/object:Gem::Version
53
- version: '0.19'
53
+ version: 4.0.2
54
54
  type: :runtime
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - ">="
59
59
  - !ruby/object:Gem::Version
60
- version: '0.19'
60
+ version: 4.0.2
61
61
  - !ruby/object:Gem::Dependency
62
- name: sidekiq
62
+ name: git
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
65
  - - ">="
66
66
  - !ruby/object:Gem::Version
67
- version: '5.0'
67
+ version: '1.3'
68
68
  type: :runtime
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
72
  - - ">="
73
73
  - !ruby/object:Gem::Version
74
- version: '5.0'
74
+ version: '1.3'
75
75
  - !ruby/object:Gem::Dependency
76
- name: activejob
76
+ name: google-cloud-logging
77
77
  requirement: !ruby/object:Gem::Requirement
78
78
  requirements:
79
79
  - - ">="
80
80
  - !ruby/object:Gem::Version
81
- version: '5.1'
81
+ version: '1.2'
82
82
  type: :runtime
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - ">="
87
87
  - !ruby/object:Gem::Version
88
- version: '5.1'
88
+ version: '1.2'
89
89
  - !ruby/object:Gem::Dependency
90
- name: actionpack
90
+ name: pusher
91
91
  requirement: !ruby/object:Gem::Requirement
92
92
  requirements:
93
93
  - - ">="
94
94
  - !ruby/object:Gem::Version
95
- version: '5.1'
95
+ version: '1.3'
96
96
  type: :runtime
97
97
  prerelease: false
98
98
  version_requirements: !ruby/object:Gem::Requirement
99
99
  requirements:
100
100
  - - ">="
101
101
  - !ruby/object:Gem::Version
102
- version: '5.1'
102
+ version: '1.3'
103
103
  - !ruby/object:Gem::Dependency
104
- name: google-cloud-logging
104
+ name: sidekiq
105
105
  requirement: !ruby/object:Gem::Requirement
106
106
  requirements:
107
107
  - - ">="
108
108
  - !ruby/object:Gem::Version
109
- version: '1.2'
109
+ version: '5.0'
110
110
  type: :runtime
111
111
  prerelease: false
112
112
  version_requirements: !ruby/object:Gem::Requirement
113
113
  requirements:
114
114
  - - ">="
115
115
  - !ruby/object:Gem::Version
116
- version: '1.2'
116
+ version: '5.0'
117
117
  - !ruby/object:Gem::Dependency
118
- name: pusher
118
+ name: thor
119
119
  requirement: !ruby/object:Gem::Requirement
120
120
  requirements:
121
121
  - - ">="
122
122
  - !ruby/object:Gem::Version
123
- version: '1.3'
123
+ version: '0.19'
124
124
  type: :runtime
125
125
  prerelease: false
126
126
  version_requirements: !ruby/object:Gem::Requirement
127
127
  requirements:
128
128
  - - ">="
129
129
  - !ruby/object:Gem::Version
130
- version: '1.3'
130
+ version: '0.19'
131
131
  - !ruby/object:Gem::Dependency
132
132
  name: workspace
133
133
  requirement: !ruby/object:Gem::Requirement
@@ -143,7 +143,7 @@ dependencies:
143
143
  - !ruby/object:Gem::Version
144
144
  version: '1.0'
145
145
  - !ruby/object:Gem::Dependency
146
- name: workspace-parse
146
+ name: workspace-archive
147
147
  requirement: !ruby/object:Gem::Requirement
148
148
  requirements:
149
149
  - - ">="
@@ -157,7 +157,7 @@ dependencies:
157
157
  - !ruby/object:Gem::Version
158
158
  version: '1.0'
159
159
  - !ruby/object:Gem::Dependency
160
- name: workspace-archive
160
+ name: workspace-media
161
161
  requirement: !ruby/object:Gem::Requirement
162
162
  requirements:
163
163
  - - ">="
@@ -171,7 +171,7 @@ dependencies:
171
171
  - !ruby/object:Gem::Version
172
172
  version: '1.0'
173
173
  - !ruby/object:Gem::Dependency
174
- name: workspace-media
174
+ name: workspace-net
175
175
  requirement: !ruby/object:Gem::Requirement
176
176
  requirements:
177
177
  - - ">="
@@ -185,7 +185,7 @@ dependencies:
185
185
  - !ruby/object:Gem::Version
186
186
  version: '1.0'
187
187
  - !ruby/object:Gem::Dependency
188
- name: workspace-net
188
+ name: workspace-parse
189
189
  requirement: !ruby/object:Gem::Requirement
190
190
  requirements:
191
191
  - - ">="
@@ -199,33 +199,33 @@ dependencies:
199
199
  - !ruby/object:Gem::Version
200
200
  version: '1.0'
201
201
  - !ruby/object:Gem::Dependency
202
- name: rspec
202
+ name: pry
203
203
  requirement: !ruby/object:Gem::Requirement
204
204
  requirements:
205
205
  - - ">="
206
206
  - !ruby/object:Gem::Version
207
- version: '3.3'
207
+ version: '0.10'
208
208
  type: :development
209
209
  prerelease: false
210
210
  version_requirements: !ruby/object:Gem::Requirement
211
211
  requirements:
212
212
  - - ">="
213
213
  - !ruby/object:Gem::Version
214
- version: '3.3'
214
+ version: '0.10'
215
215
  - !ruby/object:Gem::Dependency
216
- name: pry
216
+ name: rspec
217
217
  requirement: !ruby/object:Gem::Requirement
218
218
  requirements:
219
219
  - - ">="
220
220
  - !ruby/object:Gem::Version
221
- version: '0.10'
221
+ version: '3.3'
222
222
  type: :development
223
223
  prerelease: false
224
224
  version_requirements: !ruby/object:Gem::Requirement
225
225
  requirements:
226
226
  - - ">="
227
227
  - !ruby/object:Gem::Version
228
- version: '0.10'
228
+ version: '3.3'
229
229
  - !ruby/object:Gem::Dependency
230
230
  name: rubocop
231
231
  requirement: !ruby/object:Gem::Requirement
@@ -285,7 +285,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
285
285
  requirements:
286
286
  - - "~>"
287
287
  - !ruby/object:Gem::Version
288
- version: '2.0'
288
+ version: '2.3'
289
289
  required_rubygems_version: !ruby/object:Gem::Requirement
290
290
  requirements:
291
291
  - - "~>"