Sha256: 05c37f037dc7434db23ffa4aed740ced2386700386f46f75f9e5f428a4cfa57a
Contents?: true
Size: 1.04 KB
Versions: 11
Compression:
Stored size: 1.04 KB
Contents
module ProconBypassMan module RemotePbmAction class RestorePbmSettingAction < BaseAction def action_content(args: ) require "pbmenv" ProconBypassMan.logger.info "execute RestorePbmSettingAction!" setting = args.dig("setting") or raise(ProconBypassMan::RemotePbmAction::NeedPbmVersionError, "settingが必要です, #{args.inspect}") # 復元に失敗したら戻せるように退避する FileUtils.copy( ProconBypassMan::ButtonsSettingConfiguration.instance.setting_path, ProconBypassMan.fallback_setting_path, ) ProconBypassMan::YamlWriter.write( path: ProconBypassMan::ButtonsSettingConfiguration.instance.setting_path, content: setting, ) hot_reload! end private def before_action_callback be_in_progress end def after_action_callback be_processed end # @return [void] def hot_reload! Process.kill(:USR2, ProconBypassMan.pid) end end end end
Version data entries
11 entries across 11 versions & 1 rubygems