dronejob 1.1.9 → 1.2.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: 0c94ba81da81adb2eec9c74286d3ee853ee5afeb
4
- data.tar.gz: 33703463749cd88f918d58ecc601fa57beba2c60
3
+ metadata.gz: 1ae3f67b3ef3b04b19441944585f8444a79e7ca0
4
+ data.tar.gz: 97a7e9a0d4c8325953f004ae8adcb32a2577ee45
5
5
  SHA512:
6
- metadata.gz: 6ff736fee739b754e522f48f7b128585eaf46ab6a72b0b48df59431f6530101490ea2a60346a681b69b1ee98a7acf22e1363a32ffa44dba5a37a1a76539f9079
7
- data.tar.gz: 5e1e844fdbe97aa49a815ae39e0a10e139f3473cbf4d9a889f7a3cd7d5f7166531357e23705618109c02ae00200c11ad430ee0a7f7152ac6b3163034af2cb666
6
+ metadata.gz: 4715a179f18ca37b8788154ce745a83bc9004d96a90c75c652b3b406afde985f5d6c3619839748fde9f8321463bbfadb66f79a4a4c5a73861ee0bbce3201368e
7
+ data.tar.gz: afc37a7dc0183ab36e1ddb1077ed4883ef650efc46c589e9f44b8eb69659959d6634448040e88e86bdb60cfd530735fb8ddbed68967138186b961f3b704ed5a5
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dronejob (1.1.9)
4
+ dronejob (1.2.0)
5
5
  activejob (~> 4.2)
6
6
  bundler (>= 1.3.0, < 2.0)
7
7
  git (~> 1.2)
@@ -29,7 +29,7 @@ GEM
29
29
  concurrent-ruby (1.0.2)
30
30
  connection_pool (2.2.0)
31
31
  diff-lcs (1.2.5)
32
- ethon (0.9.0)
32
+ ethon (0.9.1)
33
33
  ffi (>= 1.3.0)
34
34
  ffi (1.9.14)
35
35
  git (1.3.0)
@@ -40,13 +40,13 @@ GEM
40
40
  i18n (0.7.0)
41
41
  json (1.8.3)
42
42
  method_source (0.8.2)
43
- minitest (5.9.0)
43
+ minitest (5.9.1)
44
44
  open_uri_redirections (0.2.1)
45
45
  pry (0.10.3)
46
46
  coderay (~> 1.1.0)
47
47
  method_source (~> 0.8.1)
48
48
  slop (~> 3.4)
49
- rack (1.6.4)
49
+ rack (2.0.1)
50
50
  rack-protection (1.5.3)
51
51
  rack
52
52
  redis (3.3.1)
@@ -64,17 +64,13 @@ GEM
64
64
  rspec-support (~> 3.4.0)
65
65
  rspec-support (3.4.1)
66
66
  rubyzip (1.2.0)
67
- sidekiq (4.1.4)
67
+ sidekiq (4.2.2)
68
68
  concurrent-ruby (~> 1.0)
69
69
  connection_pool (~> 2.2, >= 2.2.0)
70
+ rack-protection (~> 1.5)
70
71
  redis (~> 3.2, >= 3.2.1)
71
- sinatra (>= 1.4.7)
72
72
  sidekiq-status (0.6.0)
73
73
  sidekiq (>= 2.7)
74
- sinatra (1.4.7)
75
- rack (~> 1.5)
76
- rack-protection (~> 1.4)
77
- tilt (>= 1.3, < 3)
78
74
  slop (3.6.0)
79
75
  thor (0.19.1)
80
76
  thread_safe (0.3.5)
@@ -98,5 +98,19 @@ module Dronejob
98
98
  end
99
99
  end
100
100
 
101
+ desc :continue, "Continue existing job"
102
+ jobs_dir = WorkspaceDir.new("tmp/jobs")
103
+ jobs = jobs_dir.exists? ? jobs_dir.children.map(&:name) : []
104
+ method_option(:job, type: :string, required: true, enum: jobs)
105
+ def continue
106
+ job_dir = WorkspaceDir.new("tmp/jobs").dir(options.job)
107
+ dronejob_config = job_dir.file("dronejob.yml").read_yaml
108
+ job_params = dronejob_config[:job_params]
109
+ job_identifier = dronejob_config[:job_identifier]
110
+ worker = Dronejob::Loader.workers[job_identifier]
111
+ job_params.delete("from")
112
+ Dronejob::Base.queue_adapter = job_params["queue_adapter"]
113
+ worker.perform_now(job_params)
114
+ end
101
115
  end
102
116
  end
@@ -9,12 +9,12 @@ module Dronejob
9
9
 
10
10
  class_methods do
11
11
  def attr_store(*args)
12
- @attr_stores ||= [:dronejob_completed]
12
+ @attr_stores ||= [:dronejob_completed, :job_params, :job_identifier]
13
13
  @attr_stores.push(*args)
14
14
  end
15
15
 
16
16
  def attr_stores
17
- @attr_stores ||= [:dronejob_completed]
17
+ @attr_stores ||= [:dronejob_completed, :job_params, :job_identifier]
18
18
  end
19
19
  end
20
20
 
@@ -8,6 +8,8 @@ module Dronejob
8
8
  end
9
9
 
10
10
  def perform(params)
11
+ @job_params = params.to_h
12
+ @job_identifier = Dronejob::Loader.identifier_for(self)
11
13
  set_parameters(params)
12
14
  validate_parameters!
13
15
  run_callbacks :job do
@@ -1,3 +1,3 @@
1
1
  module Dronejob
2
- VERSION = "1.1.9"
2
+ VERSION = "1.2.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.1.9
4
+ version: 1.2.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: 2016-09-01 00:00:00.000000000 Z
11
+ date: 2016-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler