lockfile 1.4.1 → 1.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README +10 -4
- data/bin/rlock +2 -2
- data/bin/{rlock-1.4.1 → rlock-1.4.3} +2 -2
- data/gemspec.rb +4 -0
- data/install.rb +4 -0
- data/lib/{lockfile-1.4.1.rb → lockfile-1.4.3.rb} +7 -5
- data/lib/lockfile.rb +7 -5
- metadata +5 -5
data/README
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
URLS
|
2
2
|
|
3
3
|
http://rubyforge.org/projects/codeforpeople/
|
4
|
-
http://codeforpeople.com/lib/ruby/
|
5
|
-
http://raa.ruby-lang.org/project/lockfile/
|
4
|
+
http://codeforpeople.com/lib/ruby/
|
6
5
|
|
7
6
|
SYNOPSIS
|
8
7
|
|
@@ -71,10 +70,10 @@ BASIC USAGE
|
|
71
70
|
|
72
71
|
:max_sleep => 32, # we will never sleep longer than 32 seconds
|
73
72
|
|
74
|
-
:max_age =>
|
73
|
+
:max_age => 3600, # we will blow away any files found to be older
|
75
74
|
# than this (lockfile.thief? #=> true)
|
76
75
|
|
77
|
-
:suspend =>
|
76
|
+
:suspend => 1800, # iff we steal the lock from someone else - wait
|
78
77
|
# this long to give them a chance to realize it
|
79
78
|
|
80
79
|
:refresh => 8, # we will spawn a bg thread that touches file
|
@@ -160,6 +159,13 @@ BUGS
|
|
160
159
|
|
161
160
|
HISTORY
|
162
161
|
|
162
|
+
1.4.3:
|
163
|
+
- fixed a small non-critical bug in the require gaurd
|
164
|
+
|
165
|
+
1.4.2:
|
166
|
+
- upped defaults for max_age to 3600 and suspend to 1800.
|
167
|
+
- tweaked a few things to play nice with rubygems
|
168
|
+
|
163
169
|
1.4.1:
|
164
170
|
- Mike Kasick <mkasick@club.cc.cmu.edu> reported a bug whereby false/nil
|
165
171
|
values for options were ignored. patched to address this bug
|
data/bin/rlock
CHANGED
data/gemspec.rb
CHANGED
@@ -1,8 +1,10 @@
|
|
1
|
+
|
1
2
|
lib, version = File::basename(File::dirname(File::expand_path(__FILE__))).split %r/-/, 2
|
2
3
|
|
3
4
|
require 'rubygems'
|
4
5
|
|
5
6
|
Gem::Specification::new do |spec|
|
7
|
+
$VERBOSE = nil
|
6
8
|
spec.name = lib
|
7
9
|
spec.version = version
|
8
10
|
spec.platform = Gem::Platform::RUBY
|
@@ -17,6 +19,8 @@ Gem::Specification::new do |spec|
|
|
17
19
|
spec.has_rdoc = File::exist? "doc"
|
18
20
|
spec.test_suite_file = "test/#{ lib }.rb" if File::directory? "test"
|
19
21
|
|
22
|
+
spec.extensions << "extconf.rb" if File::exists? "extconf.rb"
|
23
|
+
|
20
24
|
spec.author = "Ara T. Howard"
|
21
25
|
spec.email = "ara.t.howard@noaa.gov"
|
22
26
|
spec.homepage = "http://codeforpeople.com/lib/ruby/#{ lib }/"
|
data/install.rb
CHANGED
@@ -192,6 +192,8 @@ if help
|
|
192
192
|
exit
|
193
193
|
end
|
194
194
|
|
195
|
+
system "#{ sudo } #{ $ruby } pre-install.rb" if test(?s, 'pre-install.rb')
|
196
|
+
|
195
197
|
unless no_linkify
|
196
198
|
linked = linkify('lib') + linkify('bin')
|
197
199
|
end
|
@@ -204,3 +206,5 @@ install_rb(BINDIR, bindir, BINDIR_MODE, bin=true)
|
|
204
206
|
if linked
|
205
207
|
linked.each{|path| File::rm_f path}
|
206
208
|
end
|
209
|
+
|
210
|
+
system "#{ sudo } #{ $ruby } post-install.rb" if test(?s, 'post-install.rb')
|
@@ -1,11 +1,13 @@
|
|
1
|
-
unless
|
1
|
+
unless(defined?($__lockfile__) or defined?(Lockfile))
|
2
|
+
|
2
3
|
require 'socket'
|
3
4
|
require 'timeout'
|
4
5
|
require 'fileutils'
|
5
6
|
|
6
7
|
class Lockfile
|
7
8
|
#--{{{
|
8
|
-
VERSION = '1.4.
|
9
|
+
VERSION = '1.4.3'
|
10
|
+
def version() VERSION end
|
9
11
|
|
10
12
|
class LockError < StandardError; end
|
11
13
|
class StolenLockError < LockError; end
|
@@ -55,11 +57,11 @@ unless defined? $__lockfile__
|
|
55
57
|
|
56
58
|
DEFAULT_RETRIES = nil # maximum number of attempts
|
57
59
|
DEFAULT_TIMEOUT = nil # the longest we will try
|
58
|
-
DEFAULT_MAX_AGE =
|
60
|
+
DEFAULT_MAX_AGE = 3600 # lockfiles older than this are stale
|
59
61
|
DEFAULT_SLEEP_INC = 2 # sleep cycle is this much longer each time
|
60
62
|
DEFAULT_MIN_SLEEP = 2 # shortest sleep time
|
61
63
|
DEFAULT_MAX_SLEEP = 32 # longest sleep time
|
62
|
-
DEFAULT_SUSPEND =
|
64
|
+
DEFAULT_SUSPEND = 1800 # iff we steal a lock wait this long before we go on
|
63
65
|
DEFAULT_REFRESH = 8 # how often we touch/validate the lock
|
64
66
|
DEFAULT_DONT_CLEAN = false # iff we leave lock files lying around
|
65
67
|
DEFAULT_POLL_RETRIES = 16 # this many polls makes one 'try'
|
@@ -558,5 +560,5 @@ unless defined? $__lockfile__
|
|
558
560
|
#--}}}
|
559
561
|
end
|
560
562
|
|
561
|
-
$__lockfile__
|
563
|
+
$__lockfile__ = __FILE__
|
562
564
|
end
|
data/lib/lockfile.rb
CHANGED
@@ -1,11 +1,13 @@
|
|
1
|
-
unless
|
1
|
+
unless(defined?($__lockfile__) or defined?(Lockfile))
|
2
|
+
|
2
3
|
require 'socket'
|
3
4
|
require 'timeout'
|
4
5
|
require 'fileutils'
|
5
6
|
|
6
7
|
class Lockfile
|
7
8
|
#--{{{
|
8
|
-
VERSION = '1.4.
|
9
|
+
VERSION = '1.4.3'
|
10
|
+
def version() VERSION end
|
9
11
|
|
10
12
|
class LockError < StandardError; end
|
11
13
|
class StolenLockError < LockError; end
|
@@ -55,11 +57,11 @@ unless defined? $__lockfile__
|
|
55
57
|
|
56
58
|
DEFAULT_RETRIES = nil # maximum number of attempts
|
57
59
|
DEFAULT_TIMEOUT = nil # the longest we will try
|
58
|
-
DEFAULT_MAX_AGE =
|
60
|
+
DEFAULT_MAX_AGE = 3600 # lockfiles older than this are stale
|
59
61
|
DEFAULT_SLEEP_INC = 2 # sleep cycle is this much longer each time
|
60
62
|
DEFAULT_MIN_SLEEP = 2 # shortest sleep time
|
61
63
|
DEFAULT_MAX_SLEEP = 32 # longest sleep time
|
62
|
-
DEFAULT_SUSPEND =
|
64
|
+
DEFAULT_SUSPEND = 1800 # iff we steal a lock wait this long before we go on
|
63
65
|
DEFAULT_REFRESH = 8 # how often we touch/validate the lock
|
64
66
|
DEFAULT_DONT_CLEAN = false # iff we leave lock files lying around
|
65
67
|
DEFAULT_POLL_RETRIES = 16 # this many polls makes one 'try'
|
@@ -558,5 +560,5 @@ unless defined? $__lockfile__
|
|
558
560
|
#--}}}
|
559
561
|
end
|
560
562
|
|
561
|
-
$__lockfile__
|
563
|
+
$__lockfile__ = __FILE__
|
562
564
|
end
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
|
|
3
3
|
specification_version: 1
|
4
4
|
name: lockfile
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 1.4.
|
7
|
-
date: 2007-
|
6
|
+
version: 1.4.3
|
7
|
+
date: 2007-03-21 00:00:00.000000 -06:00
|
8
8
|
summary: lockfile
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -38,9 +38,9 @@ files:
|
|
38
38
|
- doc
|
39
39
|
- gemspec.rb
|
40
40
|
- lib/lockfile.rb
|
41
|
-
- lib/lockfile-1.4.
|
41
|
+
- lib/lockfile-1.4.3.rb
|
42
42
|
- bin/rlock
|
43
|
-
- bin/rlock-1.4.
|
43
|
+
- bin/rlock-1.4.3
|
44
44
|
- samples/a.rb
|
45
45
|
- samples/nfsstore.rb
|
46
46
|
- samples/out
|
@@ -53,7 +53,7 @@ rdoc_options: []
|
|
53
53
|
extra_rdoc_files: []
|
54
54
|
executables:
|
55
55
|
- rlock
|
56
|
-
- rlock-1.4.
|
56
|
+
- rlock-1.4.3
|
57
57
|
extensions: []
|
58
58
|
requirements: []
|
59
59
|
dependencies: []
|