class Stronglyboards::LockFile
Constants
- LOCK_FILE_NAME
Public Class Methods
new(project_file)
click to toggle source
# File lib/stronglyboards/lock_file.rb, line 4 def initialize(project_file) @path = File.dirname(project_file) + '/' + LOCK_FILE_NAME end
Public Instance Methods
contents()
click to toggle source
# File lib/stronglyboards/lock_file.rb, line 8 def contents # Load the lock file containing configuration file = File.open(@path, 'r') YAML::load(file) end
delete()
click to toggle source
# File lib/stronglyboards/lock_file.rb, line 21 def delete File.delete(@path) end
exists?()
click to toggle source
# File lib/stronglyboards/lock_file.rb, line 25 def exists? File.exists?(@path) end
update(options)
click to toggle source
# File lib/stronglyboards/lock_file.rb, line 14 def update(options) puts "Writing lock file at #{@path}" File.open(@path, 'w+') do |file| file.write(YAML::dump(options)) end end