actionable 0.0.4 → 0.0.5

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: 037f786d6b7377660c22f4173edd7bf83cfe0133
4
- data.tar.gz: 74c9df4178629aacd95d80b252014435a4224ad1
3
+ metadata.gz: aba5c2dd61d34960608b12a00742c86eddeb904e
4
+ data.tar.gz: 0c9d7ab01b25b32b973c7a69e8cf254999a46eaf
5
5
  SHA512:
6
- metadata.gz: 950e7d98d5fcc7cd685385b95beb4bd520a67106e71d2a02cb0aa1753dd938c53256136d6f997687268fc2060dc5673dd14767d4d501fdae85102a8069f2ee16
7
- data.tar.gz: be1d4c15adcc51311175ecb0538405b3549ef0506ace8489da12f9b4e12fa1a8a8d1a28c8c6bef175483d5005227ebe7bc052628855366bab52a1a3a522ef27b
6
+ metadata.gz: b83923f9cde4a28559ac389a02f634541947c320cfe36655a3d42756ad400df0b6f419708ad1141ceaf82e4bce9959260b044ec73eea0f93580f733ad1492261
7
+ data.tar.gz: e8ad792fcfb39c41ee9f1edc8f71000b6a8018b4bc21d7686b6148deaf642ff47ed5232f63b1dc8ca52682a2b7b49ec133dc6191d334c6632faf57b3b03cffc2
@@ -29,6 +29,7 @@ module Actionable
29
29
  end
30
30
 
31
31
  def enqueue
32
+ update_attributes(status: :enqueued)
32
33
  Resque.enqueue(job_class,id.to_s)
33
34
  end
34
35
 
@@ -22,7 +22,7 @@ module Actionable
22
22
  end
23
23
 
24
24
  def next_scheduled?
25
- Actionable::Action.where(status: :scheduled, target_id: id).exists?
25
+ Actionable::Action.where(:status.in => [:scheduled,:late,:enqueued,:working], target_id: id).exists?
26
26
  end
27
27
 
28
28
  def ensure_scheduled
@@ -32,7 +32,7 @@ module Actionable
32
32
  private
33
33
 
34
34
  def next_run_time
35
- Rufus::CronLine.new(recurrence_string).next_time.to_datetime
35
+ Rufus::CronLine.new(recurrence_string).next_time.to_datetime.utc
36
36
  end
37
37
 
38
38
  def job_class
@@ -8,8 +8,8 @@ module Actionable
8
8
  end
9
9
 
10
10
  def self.perform
11
- Actionable::Action.to_do.each(&:enqueue)
12
11
  Actionable::Recurrence.all.each(&:ensure_scheduled)
12
+ Actionable::Action.to_do.each(&:enqueue)
13
13
  end
14
14
 
15
15
  end
@@ -1,3 +1,3 @@
1
1
  module Actionable
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
data/spec/job_spec.rb CHANGED
@@ -52,7 +52,7 @@ describe Actionable::Job do
52
52
  Resque.inline = false
53
53
  end
54
54
 
55
- it "should be executed by a worker in another processes" do
55
+ it "should be executed by a worker in another processes", :no do
56
56
  id = target.id
57
57
  run_test_worker(id)
58
58
  expect(TestModel.find(id).number).to eq(6)
data/spec/spec_helper.rb CHANGED
@@ -19,6 +19,8 @@ end
19
19
 
20
20
  RSpec.configure do |config|
21
21
 
22
+ config.treat_symbols_as_metadata_keys_with_true_values = true
23
+
22
24
  config.after(:each) do
23
25
  Resque.purge!
24
26
  Mongoid.purge!
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: actionable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Luxemburg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-04-13 00:00:00.000000000 Z
11
+ date: 2013-04-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler