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

Version Path
slack-smart-bot-1.12.9 lib/slack/smart-bot/utils/update_vacations.rb
slack-smart-bot-1.12.8 lib/slack/smart-bot/utils/update_vacations.rb
slack-smart-bot-1.12.7 lib/slack/smart-bot/utils/update_vacations.rb
slack-smart-bot-1.12.6 lib/slack/smart-bot/utils/update_vacations.rb
slack-smart-bot-1.12.5 lib/slack/smart-bot/utils/update_vacations.rb
slack-smart-bot-1.12.4 lib/slack/smart-bot/utils/update_vacations.rb
slack-smart-bot-1.12.3 lib/slack/smart-bot/utils/update_vacations.rb
slack-smart-bot-1.12.2 lib/slack/smart-bot/utils/update_vacations.rb
slack-smart-bot-1.12.1 lib/slack/smart-bot/utils/update_vacations.rb
slack-smart-bot-1.12.0 lib/slack/smart-bot/utils/update_vacations.rb