with_locking 1.0.1 → 1.0.2

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.
@@ -1,3 +1,3 @@
1
1
  module WithLocking
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
data/lib/with_locking.rb CHANGED
@@ -10,12 +10,8 @@ module WithLocking
10
10
 
11
11
  return false if File.exists? pid_file
12
12
 
13
- begin
14
- Dir.mkdir("tmp")
15
- Dir.mkdir("tmp/pids")
16
- rescue Errno::EEXIST => e
17
- # ignore this error
18
- end
13
+ Dir.mkdir("tmp") unless Dir.exists?("tmp")
14
+ Dir.mkdir("tmp/pids") unless Dir.exists?("tmp/pids")
19
15
 
20
16
  File.open(pid_file, 'w') { |f| f.puts Process.pid }
21
17
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: with_locking
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
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-06-13 00:00:00.000000000 Z
12
+ date: 2012-06-14 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: A gem to execute a block of code and ensure that one does not execute
15
15
  other code until the block has completed executing.
@@ -49,7 +49,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
49
49
  version: '0'
50
50
  requirements: []
51
51
  rubyforge_project:
52
- rubygems_version: 1.8.21
52
+ rubygems_version: 1.8.17
53
53
  signing_key:
54
54
  specification_version: 3
55
55
  summary: Writes a file before executing a given block and then deletes the file when