Class: Lock
- Inherits:
-
Object
- Object
- Lock
- Defined in:
- lib/lock.rb
Class Method Summary collapse
Class Method Details
.lock ⇒ Object
13 14 15 |
# File 'lib/lock.rb', line 13 def lock system "touch #{@lock_file}" end |
.locked? ⇒ Boolean
9 10 11 |
# File 'lib/lock.rb', line 9 def locked? File.exist? @lock_file end |
.unlock ⇒ Object
17 18 19 20 |
# File 'lib/lock.rb', line 17 def unlock lock system "rm #{@lock_file}" end |
.use(lock_file) ⇒ Object
5 6 7 |
# File 'lib/lock.rb', line 5 def use lock_file @lock_file = lock_file end |