Class: Flocker
- Inherits:
-
Object
- Object
- Flocker
- Defined in:
- lib/flocker.rb
Instance Method Summary collapse
-
#initialize ⇒ Flocker
constructor
A new instance of Flocker.
Constructor Details
#initialize ⇒ Flocker
Returns a new instance of Flocker.
2 3 4 5 6 |
# File 'lib/flocker.rb', line 2 def initialize filepath = File.($PROGRAM_NAME) f = File.open(filepath) abort "This script is already running." unless f.flock(File::LOCK_EX | File::LOCK_NB) end |