Sha256: 273a8f0d7d23dc757a11199e3818496428f8ffc741b146c19e09a757c97b2e59
Contents?: true
Size: 453 Bytes
Versions: 10
Compression:
Stored size: 453 Bytes
Contents
class SlackSmartBot def update_vacations(vacation=nil) require 'yaml' unless vacation.nil? get_vacations() @vacations.merge!(vacation) end vacations_file = config.file_path.gsub(".rb", "_vacations.yaml") File.open(vacations_file, 'w') {|file| file.flock(File::LOCK_EX) file.write(@vacations.to_yaml) file.flock(File::LOCK_UN) } @datetime_vacations_file = File.mtime(vacations_file) end end
Version data entries
10 entries across 10 versions & 1 rubygems