Sha256: 492ce2646222feabfd8bbff4304a5af039b946ff2ea5faefad8de5073f83f3ee

Contents?: true

Size: 550 Bytes

Versions: 20

Compression:

Stored size: 550 Bytes

Contents

class SlackSmartBot
  def update_shortcuts_file
    require 'yaml'
    sc_file = "#{config.path}/shortcuts/#{config.shortcuts_file}"
    File.open(sc_file, 'w') {|file|
      file.flock(File::LOCK_EX)
      file.write(@shortcuts.to_yaml) 
      file.flock(File::LOCK_UN)
    }

    if config.on_master_bot
      sc_file = "#{config.path}/shortcuts/shortcuts_global.yaml"
      File.open(sc_file, 'w') {|file|
        file.flock(File::LOCK_EX)
        file.write(@shortcuts_global.to_yaml) 
        file.flock(File::LOCK_UN)
      }
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
slack-smart-bot-1.15.25 lib/slack/smart-bot/utils/update_shortcuts_file.rb
slack-smart-bot-1.15.1 lib/slack/smart-bot/utils/update_shortcuts_file.rb
slack-smart-bot-1.15.0 lib/slack/smart-bot/utils/update_shortcuts_file.rb
slack-smart-bot-1.14.2 lib/slack/smart-bot/utils/update_shortcuts_file.rb
slack-smart-bot-1.14.1 lib/slack/smart-bot/utils/update_shortcuts_file.rb
slack-smart-bot-1.14.0 lib/slack/smart-bot/utils/update_shortcuts_file.rb
slack-smart-bot-1.13.2 lib/slack/smart-bot/utils/update_shortcuts_file.rb
slack-smart-bot-1.13.1 lib/slack/smart-bot/utils/update_shortcuts_file.rb
slack-smart-bot-1.13.0 lib/slack/smart-bot/utils/update_shortcuts_file.rb
slack-smart-bot-1.12.9 lib/slack/smart-bot/utils/update_shortcuts_file.rb
slack-smart-bot-1.12.8 lib/slack/smart-bot/utils/update_shortcuts_file.rb
slack-smart-bot-1.12.7 lib/slack/smart-bot/utils/update_shortcuts_file.rb
slack-smart-bot-1.12.6 lib/slack/smart-bot/utils/update_shortcuts_file.rb
slack-smart-bot-1.12.5 lib/slack/smart-bot/utils/update_shortcuts_file.rb
slack-smart-bot-1.12.4 lib/slack/smart-bot/utils/update_shortcuts_file.rb
slack-smart-bot-1.12.3 lib/slack/smart-bot/utils/update_shortcuts_file.rb
slack-smart-bot-1.12.2 lib/slack/smart-bot/utils/update_shortcuts_file.rb
slack-smart-bot-1.12.1 lib/slack/smart-bot/utils/update_shortcuts_file.rb
slack-smart-bot-1.12.0 lib/slack/smart-bot/utils/update_shortcuts_file.rb
slack-smart-bot-1.11.0 lib/slack/smart-bot/utils/update_shortcuts_file.rb