active_scheduler 0.1.0 → 0.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: 26ba70054e1bb771404a32c12fb267d203af40ff
4
- data.tar.gz: 8ae34c71ac6b98180726bac6c709d302d6fec381
3
+ metadata.gz: c723aa094616a7530ea528c8910f5abfe695d91b
4
+ data.tar.gz: a8286d5ebc009739893d72912fc3534158161dbe
5
5
  SHA512:
6
- metadata.gz: 4ce49add1fbfd7c9f7855a9743c427f52c425bcb90ecf8937aefb1c92231d474f7acbfa5fc4e53f60fa9eb2a2c696033d1267f964ca4a0605ce2a4ab7053a6d3
7
- data.tar.gz: 5c8b69658933b8c32f07d784ce01c95534c4b680c30c6a319015f257cc50e94d25d5f110970f3a40e52a7addb51b6c0989ef31844eaafa02c461bea5c0bcf1b9
6
+ metadata.gz: 42cc510cc65ff67895469f65ee436024faeaf4b064bf2e18e2264219ba89b55603c6f0f489008838db3e8c6bf107dcbc771d986d0e1599ab4e19b41e751ba4d3
7
+ data.tar.gz: 71cba03ce129f5a22a5b948f71a3cc3428d0a09939c0df418c77ce364e43d3251a6f2aae43c3639c1c9a0c38425e6d44ce0e0e7d89c58cbc9d0e46a93b73ba2f
data/CHANGELOG.markdown CHANGED
@@ -1,3 +1,7 @@
1
+ # 0.2.0
2
+
3
+ - Deprecate `arguments` in favor of `args` [#5](https://github.com/JustinAiken/active_scheduler/pull/5)
4
+
1
5
  # 0.1.0
2
6
 
3
7
  - Only wrap jobs that are descendants of `ActiveJob::Base` [#3](https://github.com/JustinAiken/active_scheduler/pull/3)
@@ -20,6 +20,14 @@ module ActiveScheduler
20
20
  next unless class_name.constantize <= ActiveJob::Base
21
21
 
22
22
  queue = opts[:queue] || 'default'
23
+ args = opts[:args]
24
+
25
+ if !args && opts.has_key?(:arguments)
26
+ warn 'active_scheduler: [DEPRECATION] using the `arguments` key in ' \
27
+ 'your resque schedule will soon be deprecated. Please revert to ' \
28
+ 'the resque standard `args` key.'
29
+ args = opts[:arguments]
30
+ end
23
31
 
24
32
  schedule[job] = {
25
33
  class: 'ActiveScheduler::ResqueWrapper',
@@ -27,7 +35,7 @@ module ActiveScheduler
27
35
  args: [{
28
36
  job_class: class_name,
29
37
  queue_name: queue,
30
- arguments: opts[:arguments]
38
+ arguments: args
31
39
  }]
32
40
  }
33
41
 
@@ -1,3 +1,3 @@
1
1
  module ActiveScheduler
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -18,7 +18,7 @@ describe ActiveScheduler::ResqueWrapper do
18
18
  "args" => [{
19
19
  "job_class" => "SimpleJob",
20
20
  "queue_name" => "simple",
21
- "arguments" => nil
21
+ "arguments" => ['foo-arg-1', 'foo-arg-2'],
22
22
  }]
23
23
  )
24
24
  end
@@ -31,7 +31,7 @@ describe ActiveScheduler::ResqueWrapper do
31
31
  "queue" => "simple",
32
32
  "description" => "It's a simple job.",
33
33
  "every" => "30s",
34
- "args" => [nil],
34
+ "args" => ['foo-arg-1', 'foo-arg-2'],
35
35
  )
36
36
  end
37
37
  end
@@ -50,7 +50,7 @@ describe ActiveScheduler::ResqueWrapper do
50
50
  "args" => [{
51
51
  "job_class" => "SimpleJob",
52
52
  "queue_name" => "simple",
53
- "arguments" => nil
53
+ "arguments" => "foo-argument",
54
54
  }]
55
55
  )
56
56
  end
@@ -98,7 +98,7 @@ describe ActiveScheduler::ResqueWrapper do
98
98
  "args" => [{
99
99
  "job_class" => "MyScheduleNameIsClassNameJob",
100
100
  "queue_name" => "myscheduledjobqueue",
101
- "arguments" => nil
101
+ "arguments" => [nil]
102
102
  }]
103
103
  )
104
104
  end
@@ -3,6 +3,7 @@
3
3
  "every": "30s",
4
4
  "queue": "simple",
5
5
  "class": "SimpleJob",
6
- "description": "It's a simple job."
6
+ "description": "It's a simple job.",
7
+ "arguments": "foo-argument"
7
8
  }
8
9
  }
@@ -3,5 +3,6 @@ simple_job:
3
3
  queue: "simple"
4
4
  class: "SimpleJob"
5
5
  args:
6
- -
6
+ - foo-arg-1
7
+ - foo-arg-2
7
8
  description: "It's a simple job."
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_scheduler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Aiken
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-29 00:00:00.000000000 Z
11
+ date: 2016-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activejob