vidibus-watch_folder 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -50,6 +50,7 @@ module Vidibus
50
50
  if checksum == last_checksum || (last_checksum && !delay)
51
51
  send(handler[:method], event, file_path)
52
52
  else
53
+ Job.delete_all(uuid, event, file_path)
53
54
  Job.create(uuid, event, file_path, checksum, delay)
54
55
  end
55
56
  end
@@ -25,8 +25,15 @@ module Vidibus
25
25
  raise ArgumentError, 'Provide UUID, event, path, checksum, and an optional delay'
26
26
  end
27
27
 
28
- def self.create(*args)
29
- new(*args).enqueue!
28
+ class << self
29
+ def create(*args)
30
+ new(*args).enqueue!
31
+ end
32
+
33
+ def delete_all(uuid, event, path)
34
+ regex = /Vidibus::WatchFolder::Job\nuuid: #{uuid}\nevent: #{event}\npath: #{path}\n/
35
+ Delayed::Backend::Mongoid::Job.delete_all(:handler => regex)
36
+ end
30
37
  end
31
38
 
32
39
  private
@@ -1,5 +1,5 @@
1
1
  module Vidibus
2
2
  module WatchFolder
3
- VERSION = '0.1.0'
3
+ VERSION = '0.1.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vidibus-watch_folder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-28 00:00:00.000000000 Z
12
+ date: 2012-10-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mongoid
@@ -240,7 +240,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
240
240
  version: '0'
241
241
  segments:
242
242
  - 0
243
- hash: -1021260411944907488
243
+ hash: 2506031279976357694
244
244
  required_rubygems_version: !ruby/object:Gem::Requirement
245
245
  none: false
246
246
  requirements: