single_instance 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +5 -0
- data/bin/single_instance +13 -0
- data/lib/single_instance/version.rb +1 -1
- metadata +7 -22
data/README.rdoc
CHANGED
@@ -30,6 +30,11 @@ Run without a block, it creates a lock that lasts as long as the process is runn
|
|
30
30
|
SingleInstance.exclusive_non_blocking(:build_models) || exit
|
31
31
|
end
|
32
32
|
|
33
|
+
There is also a simple binary (called `single_instance`) that you can use to wrap
|
34
|
+
non-Ruby tasks:
|
35
|
+
|
36
|
+
# in crontab
|
37
|
+
*/10 * * * * single_instance /usr/local/bin/long-running-task
|
33
38
|
|
34
39
|
== Note on Patches/Pull Requests
|
35
40
|
|
data/bin/single_instance
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
#! /usr/bin/env ruby
|
2
|
+
$: << File.join(File.dirname(__FILE__), '..', 'lib')
|
3
|
+
require 'single_instance'
|
4
|
+
|
5
|
+
block_on = File.basename(ARGV[0])
|
6
|
+
|
7
|
+
SingleInstance.exclusive_non_blocking(block_on) do |blocker|
|
8
|
+
if blocker
|
9
|
+
exit 1
|
10
|
+
else
|
11
|
+
exec *ARGV
|
12
|
+
end
|
13
|
+
end
|
metadata
CHANGED
@@ -1,12 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: single_instance
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
5
|
-
|
6
|
-
- 0
|
7
|
-
- 2
|
8
|
-
- 0
|
9
|
-
version: 0.2.0
|
4
|
+
prerelease:
|
5
|
+
version: 0.3.0
|
10
6
|
platform: ruby
|
11
7
|
authors:
|
12
8
|
- David Vrensk
|
@@ -15,7 +11,7 @@ autorequire:
|
|
15
11
|
bindir: bin
|
16
12
|
cert_chain: []
|
17
13
|
|
18
|
-
date:
|
14
|
+
date: 2012-03-30 00:00:00 +02:00
|
19
15
|
default_executable:
|
20
16
|
dependencies:
|
21
17
|
- !ruby/object:Gem::Dependency
|
@@ -26,10 +22,6 @@ dependencies:
|
|
26
22
|
requirements:
|
27
23
|
- - ">="
|
28
24
|
- !ruby/object:Gem::Version
|
29
|
-
segments:
|
30
|
-
- 1
|
31
|
-
- 0
|
32
|
-
- 0
|
33
25
|
version: 1.0.0
|
34
26
|
type: :development
|
35
27
|
version_requirements: *id001
|
@@ -41,16 +33,14 @@ dependencies:
|
|
41
33
|
requirements:
|
42
34
|
- - ">="
|
43
35
|
- !ruby/object:Gem::Version
|
44
|
-
segments:
|
45
|
-
- 0
|
46
36
|
version: "0"
|
47
37
|
type: :development
|
48
38
|
version_requirements: *id002
|
49
39
|
description: SingleInstance uses an exclusive file lock to allow or block execution of code.
|
50
40
|
email:
|
51
41
|
- dev+gemsupport@icehouse.se
|
52
|
-
executables:
|
53
|
-
|
42
|
+
executables:
|
43
|
+
- single_instance
|
54
44
|
extensions: []
|
55
45
|
|
56
46
|
extra_rdoc_files: []
|
@@ -64,6 +54,7 @@ files:
|
|
64
54
|
- LICENSE
|
65
55
|
- README.rdoc
|
66
56
|
- Rakefile
|
57
|
+
- bin/single_instance
|
67
58
|
- lib/single_instance.rb
|
68
59
|
- lib/single_instance/version.rb
|
69
60
|
- single_instance.gemspec
|
@@ -83,23 +74,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
83
74
|
requirements:
|
84
75
|
- - ">="
|
85
76
|
- !ruby/object:Gem::Version
|
86
|
-
segments:
|
87
|
-
- 0
|
88
77
|
version: "0"
|
89
78
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
90
79
|
none: false
|
91
80
|
requirements:
|
92
81
|
- - ">="
|
93
82
|
- !ruby/object:Gem::Version
|
94
|
-
segments:
|
95
|
-
- 1
|
96
|
-
- 3
|
97
|
-
- 6
|
98
83
|
version: 1.3.6
|
99
84
|
requirements: []
|
100
85
|
|
101
86
|
rubyforge_project: single_instance
|
102
|
-
rubygems_version: 1.
|
87
|
+
rubygems_version: 1.5.0
|
103
88
|
signing_key:
|
104
89
|
specification_version: 3
|
105
90
|
summary: Ruby Gem that makes sure that only a single instance of a code block or process is running.
|