procon_bypass_man 0.3.4 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +10 -1
  3. data/Gemfile.lock +3 -3
  4. data/README.md +1 -8
  5. data/Steepfile +0 -1
  6. data/bin/generate_output_report +18 -0
  7. data/docs/getting_started.md +13 -9
  8. data/docs/setting/splatoon3_macro_dasei_cancel.md +7 -0
  9. data/docs/setting/{splatoon3_rotation_forward_stick.md → splatoon3_rotation_left_stick.md} +1 -1
  10. data/lib/procon_bypass_man/background/jobs/post_completed_remote_action_job.rb +20 -0
  11. data/lib/procon_bypass_man/background/jobs/report_info_log_job.rb +11 -0
  12. data/lib/procon_bypass_man/background/jobs/report_warning_job.rb +11 -0
  13. data/lib/procon_bypass_man/background.rb +2 -0
  14. data/lib/procon_bypass_man/buttons_setting_configuration/loader.rb +6 -0
  15. data/lib/procon_bypass_man/buttons_setting_configuration/metadata_loader.rb +27 -0
  16. data/lib/procon_bypass_man/buttons_setting_configuration/validator.rb +4 -4
  17. data/lib/procon_bypass_man/bypass/bypass_command.rb +2 -2
  18. data/lib/procon_bypass_man/bypass/procon_to_switch.rb +3 -0
  19. data/lib/procon_bypass_man/commands/send_info_log_command.rb +11 -0
  20. data/lib/procon_bypass_man/commands/send_warning_command.rb +18 -0
  21. data/lib/procon_bypass_man/commands.rb +2 -0
  22. data/lib/procon_bypass_man/configuration.rb +1 -1
  23. data/lib/procon_bypass_man/procon.rb +22 -11
  24. data/lib/procon_bypass_man/procon_display/status.rb +1 -0
  25. data/lib/procon_bypass_man/procon_display.rb +0 -1
  26. data/lib/procon_bypass_man/{remote_macro → remote_action}/queue_over_process.rb +2 -2
  27. data/lib/procon_bypass_man/{remote_macro/remote_macro_object.rb → remote_action/remote_action_object.rb} +1 -1
  28. data/lib/procon_bypass_man/{remote_macro/remote_macro_receiver.rb → remote_action/remote_action_receiver.rb} +8 -7
  29. data/lib/procon_bypass_man/remote_action/remote_action_sender.rb +9 -0
  30. data/lib/procon_bypass_man/remote_action/remote_pbm_job/base_action.rb +55 -0
  31. data/lib/procon_bypass_man/remote_action/remote_pbm_job/change_pbm_version_action.rb +31 -0
  32. data/lib/procon_bypass_man/remote_action/remote_pbm_job/commands/run_remote_pbm_job_dispatch_command.rb +29 -0
  33. data/lib/procon_bypass_man/{remote_pbm_action/commands/update_remote_pbm_action_status_command.rb → remote_action/remote_pbm_job/commands/update_remote_pbm_job_status_command.rb} +2 -2
  34. data/lib/procon_bypass_man/remote_action/remote_pbm_job/reboot_os_action.rb +24 -0
  35. data/lib/procon_bypass_man/remote_action/remote_pbm_job/report_procon_status.rb +25 -0
  36. data/lib/procon_bypass_man/remote_action/remote_pbm_job/restore_pbm_setting.rb +42 -0
  37. data/lib/procon_bypass_man/remote_action/remote_pbm_job/stop_pbm_action.rb +23 -0
  38. data/lib/procon_bypass_man/{remote_pbm_action/value_objects/remote_pbm_action_object.rb → remote_action/remote_pbm_job/value_objects/remote_pbm_job_object.rb} +2 -2
  39. data/lib/procon_bypass_man/remote_action/remote_pbm_job.rb +45 -0
  40. data/lib/procon_bypass_man/remote_action/task.rb +14 -0
  41. data/lib/procon_bypass_man/{remote_macro → remote_action}/task_queue.rb +1 -1
  42. data/lib/procon_bypass_man/remote_action.rb +19 -0
  43. data/lib/procon_bypass_man/support/callbacks.rb +1 -0
  44. data/lib/procon_bypass_man/support/{update_remote_pbm_action_status_http_client.rb → update_remote_pbm_job_status_http_client.rb} +1 -1
  45. data/lib/procon_bypass_man/version.rb +1 -1
  46. data/lib/procon_bypass_man/websocket/client.rb +42 -26
  47. data/lib/procon_bypass_man.rb +5 -7
  48. data/procon_bypass_man.gemspec +1 -1
  49. data/project_template/app.rb +1 -1
  50. data/project_template/app.rb.erb +1 -1
  51. data/sig/main.rbs +0 -6
  52. metadata +30 -23
  53. data/lib/procon_bypass_man/procon_display/bypass_hook.rb +0 -12
  54. data/lib/procon_bypass_man/remote_macro/remote_macro_sender.rb +0 -8
  55. data/lib/procon_bypass_man/remote_macro/task.rb +0 -2
  56. data/lib/procon_bypass_man/remote_macro.rb +0 -16
  57. data/lib/procon_bypass_man/remote_pbm_action/base_action.rb +0 -53
  58. data/lib/procon_bypass_man/remote_pbm_action/change_pbm_version_action.rb +0 -28
  59. data/lib/procon_bypass_man/remote_pbm_action/commands/run_remote_pbm_action_dispatch_command.rb +0 -21
  60. data/lib/procon_bypass_man/remote_pbm_action/reboot_os_action.rb +0 -22
  61. data/lib/procon_bypass_man/remote_pbm_action/restore_pbm_setting.rb +0 -41
  62. data/lib/procon_bypass_man/remote_pbm_action/stop_pbm_action.rb +0 -21
  63. data/lib/procon_bypass_man/remote_pbm_action.rb +0 -36
@@ -1,5 +1,5 @@
1
1
  module ProconBypassMan
2
- class UpdateRemotePbmActionStatusCommand
2
+ class UpdateRemotePbmJobStatusCommand
3
3
  # @param [String] pbm_job_uuid
4
4
  def initialize(pbm_job_uuid: )
5
5
  @pbm_job_uuid = pbm_job_uuid
@@ -8,7 +8,7 @@ module ProconBypassMan
8
8
  # @param [String] to_status
9
9
  # @return [void]
10
10
  def execute(to_status: )
11
- ProconBypassMan::UpdateRemotePbmActionStatusHttpClient.new(
11
+ ProconBypassMan::UpdateRemotePbmJobStatusHttpClient.new(
12
12
  path: path,
13
13
  server: ProconBypassMan.config.api_server,
14
14
  ).put(to_status: to_status)
@@ -0,0 +1,24 @@
1
+ module ProconBypassMan
2
+ module RemoteAction
3
+ module RemotePbmJob
4
+ class RebootOsAction < BaseAction
5
+
6
+ def action_content(_args)
7
+ ProconBypassMan.logger.info "execute RebootOsAction!"
8
+ `reboot`
9
+ end
10
+
11
+ private
12
+
13
+ def before_action_callback
14
+ ProconBypassMan::ReportStartRebootJob.perform
15
+ be_processed
16
+ end
17
+
18
+ def after_action_callback
19
+ # no-op
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,25 @@
1
+ module ProconBypassMan
2
+ module RemoteAction
3
+ module RemotePbmJob
4
+ class ReportProconStatusAction < BaseAction
5
+
6
+ def action_content(_args)
7
+ ProconBypassMan.logger.info "execute ReportProconStatusAction!"
8
+ ProconBypassMan::SendInfoLogCommand.execute(
9
+ message: ProconBypassMan::ProconDisplay::Status.instance.current.to_s
10
+ )
11
+ end
12
+
13
+ private
14
+
15
+ def before_action_callback
16
+ be_in_progress
17
+ end
18
+
19
+ def after_action_callback
20
+ be_processed
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,42 @@
1
+ module ProconBypassMan
2
+ module RemoteAction
3
+ module RemotePbmJob
4
+ class RestorePbmSettingAction < BaseAction
5
+
6
+ def action_content(args: )
7
+ require "pbmenv"
8
+ ProconBypassMan.logger.info "execute RestorePbmSettingAction!"
9
+ setting = args.dig("setting") or raise(ProconBypassMan::RemotePbmJob::NeedPbmVersionError, "settingが必要です, #{args.inspect}")
10
+
11
+ # 復元に失敗したら戻せるように退避する
12
+ FileUtils.copy(
13
+ ProconBypassMan::ButtonsSettingConfiguration.instance.setting_path,
14
+ ProconBypassMan.fallback_setting_path,
15
+ )
16
+
17
+ ProconBypassMan::YamlWriter.write(
18
+ path: ProconBypassMan::ButtonsSettingConfiguration.instance.setting_path,
19
+ content: setting,
20
+ )
21
+
22
+ hot_reload!
23
+ end
24
+
25
+ private
26
+
27
+ def before_action_callback
28
+ be_in_progress
29
+ end
30
+
31
+ def after_action_callback
32
+ be_processed
33
+ end
34
+
35
+ # @return [void]
36
+ def hot_reload!
37
+ Process.kill(:USR2, ProconBypassMan.pid)
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,23 @@
1
+ module ProconBypassMan
2
+ module RemoteAction
3
+ module RemotePbmJob
4
+ class StopPbmJob < BaseAction
5
+
6
+ def action_content(_args)
7
+ ProconBypassMan.logger.info "execute StopPbmJob!"
8
+ Process.kill("TERM", ProconBypassMan.pid)
9
+ end
10
+
11
+ private
12
+
13
+ def before_action_callback
14
+ be_processed
15
+ end
16
+
17
+ def after_action_callback
18
+ # no-op
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -1,5 +1,5 @@
1
1
  module ProconBypassMan
2
- class RemotePbmActionObject
2
+ class RemotePbmJobObject
3
3
  # valueobjectがvalidatorの責務も持っている. 今度分離する
4
4
  class ValidationError < StandardError; end
5
5
  class MustBeNotNilError < ValidationError; end
@@ -30,7 +30,7 @@ module ProconBypassMan
30
30
  self.status or raise MustBeNotNilError, "statusは値が必須です"
31
31
  self.uuid or raise MustBeNotNilError, "uuidは値が必須です"
32
32
 
33
- unless ProconBypassMan::RemotePbmAction::ACTIONS.include?(action)
33
+ unless ProconBypassMan::RemoteAction::RemotePbmJob::ACTIONS.include?(action)
34
34
  raise NonSupportAction, "知らないアクションです"
35
35
  end
36
36
  end
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ProconBypassMan
4
+ module RemoteAction
5
+ module RemotePbmJob
6
+ require "procon_bypass_man/remote_action/remote_pbm_job/value_objects/remote_pbm_job_object"
7
+
8
+ require "procon_bypass_man/remote_action/remote_pbm_job/base_action"
9
+ require "procon_bypass_man/remote_action/remote_pbm_job/change_pbm_version_action"
10
+ require "procon_bypass_man/remote_action/remote_pbm_job/reboot_os_action"
11
+ require "procon_bypass_man/remote_action/remote_pbm_job/stop_pbm_action"
12
+ require "procon_bypass_man/remote_action/remote_pbm_job/restore_pbm_setting"
13
+ require "procon_bypass_man/remote_action/remote_pbm_job/report_procon_status"
14
+ require "procon_bypass_man/remote_action/remote_pbm_job/commands/update_remote_pbm_job_status_command"
15
+ require "procon_bypass_man/remote_action/remote_pbm_job/commands/run_remote_pbm_job_dispatch_command"
16
+
17
+ ACTION_CHANGE_PBM_VERSION = "change_pbm_version"
18
+ ACTION_REBOOT_OS = "reboot_os"
19
+ ACTION_STOP_PBM = "stop_pbm"
20
+ ACTION_RESTORE_SETTING = "restore_pbm_setting"
21
+ ACTION_REPORT_PORCON_STATUS = 'report_porcon_status'
22
+
23
+ ACTIONS_IN_MASTER_PROCESS = [
24
+ ACTION_CHANGE_PBM_VERSION,
25
+ ACTION_REBOOT_OS,
26
+ ACTION_STOP_PBM,
27
+ ACTION_RESTORE_SETTING,
28
+ ]
29
+ ACTIONS_IN_BYPASS_PROCESS = [
30
+ ACTION_REPORT_PORCON_STATUS,
31
+ ]
32
+ ACTIONS = ACTIONS_IN_MASTER_PROCESS + ACTIONS_IN_BYPASS_PROCESS
33
+
34
+ STATUS_FAILED = :failed
35
+ STATUS_IN_PROGRESS = :in_progress
36
+ STATUS_PROCESSED = :processed
37
+
38
+ ACTION_STATUSES = [
39
+ STATUS_FAILED,
40
+ STATUS_IN_PROGRESS,
41
+ STATUS_PROCESSED,
42
+ ]
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,14 @@
1
+ # NOTE: remote macroとpbm remote actionの両方で使う
2
+ class ProconBypassMan::RemoteAction::Task < ::Struct.new(:name, :uuid, :steps, :type)
3
+ TYPE_MACRO = 'macro'
4
+ TYPE_ACTION = 'action'
5
+
6
+ # remote actionのためのalias
7
+ def action
8
+ name
9
+ end
10
+
11
+ def job_args
12
+ steps
13
+ end
14
+ end
@@ -1,4 +1,4 @@
1
- class ProconBypassMan::RemoteMacro::TaskQueue < ::Queue
1
+ class ProconBypassMan::RemoteAction::TaskQueue < ::Queue
2
2
  def present?
3
3
  not empty?
4
4
  end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ProconBypassMan
4
+ module RemoteAction
5
+ # NOTE: RemoteActionは「具体的な処理を行うジョブ」と「マクロ」を内包する
6
+ require "procon_bypass_man/remote_action/remote_pbm_job"
7
+
8
+ require "procon_bypass_man/remote_action/remote_action_object"
9
+ require "procon_bypass_man/remote_action/remote_action_receiver"
10
+ require "procon_bypass_man/remote_action/remote_action_sender"
11
+ require "procon_bypass_man/remote_action/queue_over_process"
12
+ require "procon_bypass_man/remote_action/task"
13
+ require "procon_bypass_man/remote_action/task_queue"
14
+
15
+ ACTION_MACRO = "remote_macro"
16
+
17
+ TaskQueueInProcess = ProconBypassMan::RemoteAction::TaskQueue.new
18
+ end
19
+ end
@@ -24,6 +24,7 @@ module ProconBypassMan
24
24
  RUBY
25
25
  end
26
26
 
27
+ # TODO: 存在しないメソッドへのcallbackを登録したらエラーにする
27
28
  def set_callback(kind, filter, chain_method, &block)
28
29
  self.__callbacks ||= {}
29
30
  self.__callbacks[kind] ||= CallbackChain.new
@@ -1,5 +1,5 @@
1
1
  module ProconBypassMan
2
- class UpdateRemotePbmActionStatusHttpClient < HttpClient
2
+ class UpdateRemotePbmJobStatusHttpClient < HttpClient
3
3
  def put(to_status: )
4
4
  super(request_body: {
5
5
  body: { status: to_status },
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ProconBypassMan
4
- VERSION = "0.3.4"
4
+ VERSION = "0.3.6"
5
5
  end
@@ -59,59 +59,75 @@ module ProconBypassMan
59
59
 
60
60
  # @param [Hash] data
61
61
  def self.dispatch(data: , client: )
62
- pbm_job_hash = data.dig("message")
63
- case pbm_job_hash['action']
62
+ case data.dig("message")['action']
64
63
  when "ping"
65
64
  client.perform('pong', { device_id: ProconBypassMan.device_id, message: 'hello from pbm' })
66
- when ProconBypassMan::RemoteMacro::ACTION_KEY
67
- validate_and_run_remote_macro(data: data)
68
- when *ProconBypassMan::RemotePbmAction::ACTIONS
69
- validate_and_run_remote_pbm_action(data: data)
65
+ when ProconBypassMan::RemoteAction::ACTION_MACRO
66
+ run_remote_macro(data: data)
67
+ when *ProconBypassMan::RemoteAction::RemotePbmJob::ACTIONS_IN_MASTER_PROCESS
68
+ run_remote_pbm_job(data: data, process_to_execute: :master)
69
+ when *ProconBypassMan::RemoteAction::RemotePbmJob::ACTIONS_IN_BYPASS_PROCESS
70
+ run_remote_pbm_job(data: data, process_to_execute: :bypass)
70
71
  else
71
- ProconBypassMan.logger.error "unknown action"
72
+ ProconBypassMan::SendErrorCommand.execute(error: 'unknown remote pbm action')
72
73
  end
73
74
  end
74
75
 
75
- # @raise [ProconBypassMan::RemotePbmActionObject::ValidationError]
76
+ # @raise [ProconBypassMan::RemotePbmJobObject::ValidationError]
76
77
  # @param [Hash] data
78
+ # @param [Symbol] process_to_execute どのプロセスで実行するか
77
79
  # @return [Void]
78
- def self.validate_and_run_remote_pbm_action(data: )
80
+ def self.run_remote_pbm_job(data: , process_to_execute: )
79
81
  pbm_job_hash = data.dig("message")
80
82
  begin
81
- pbm_job_object = ProconBypassMan::RemotePbmActionObject.new(action: pbm_job_hash["action"],
83
+ pbm_job_object = ProconBypassMan::RemotePbmJobObject.new(action: pbm_job_hash["action"],
82
84
  status: pbm_job_hash["status"],
83
85
  uuid: pbm_job_hash["uuid"],
84
86
  created_at: pbm_job_hash["created_at"],
85
87
  job_args: pbm_job_hash["args"])
86
88
  pbm_job_object.validate!
87
- rescue ProconBypassMan::RemotePbmActionObject::ValidationError => e
89
+ rescue ProconBypassMan::RemotePbmJobObject::ValidationError => e
88
90
  ProconBypassMan::SendErrorCommand.execute(error: e)
89
91
  return
90
92
  end
91
93
 
92
- ProconBypassMan::RunRemotePbmActionDispatchCommand.execute(
93
- action: pbm_job_object.action,
94
- uuid: pbm_job_object.uuid,
95
- job_args: pbm_job_object.job_args
96
- )
94
+ case process_to_execute
95
+ when :master
96
+ ProconBypassMan::RemoteAction::RemotePbmJob::RunRemotePbmJobDispatchCommand.execute(
97
+ action: pbm_job_object.action,
98
+ uuid: pbm_job_object.uuid,
99
+ job_args: pbm_job_object.job_args
100
+ )
101
+ when :bypass
102
+ ProconBypassMan::RemoteAction::QueueOverProcess.push(
103
+ ProconBypassMan::RemoteAction::Task.new(pbm_job_object.action,
104
+ pbm_job_object.uuid,
105
+ pbm_job_object.job_args,
106
+ ProconBypassMan::RemoteAction::Task::TYPE_ACTION)
107
+ )
108
+ else
109
+ ProconBypassMan::SendErrorCommand.execute(error: 'unknown process to execute')
110
+ end
97
111
  end
98
112
 
99
- def self.validate_and_run_remote_macro(data: )
113
+ def self.run_remote_macro(data: )
100
114
  pbm_job_hash = data.dig("message")
101
115
  begin
102
- remote_macro_object = ProconBypassMan::RemoteMacro::RemoteMacroObject.new(name: pbm_job_hash["name"],
103
- uuid: pbm_job_hash["uuid"],
104
- steps: pbm_job_hash["steps"])
105
- remote_macro_object.validate!
106
- rescue ProconBypassMan::RemoteMacro::RemoteMacroObject::ValidationError => e
116
+ remote_action_object = ProconBypassMan::RemoteAction::RemoteActionObject.new(name: pbm_job_hash["name"],
117
+ uuid: pbm_job_hash["uuid"],
118
+ steps: pbm_job_hash["steps"])
119
+ remote_action_object.validate!
120
+ rescue ProconBypassMan::RemoteAction::RemoteActionObject::ValidationError => e
107
121
  ProconBypassMan::SendErrorCommand.execute(error: e)
108
122
  return
109
123
  end
110
124
 
111
- ProconBypassMan::RemoteMacroSender.execute(
112
- name: remote_macro_object.name,
113
- uuid: remote_macro_object.uuid,
114
- steps: remote_macro_object.steps,
125
+ # TODO: インラインしたい
126
+ ProconBypassMan::RemoteActionSender.execute(
127
+ name: remote_action_object.name,
128
+ uuid: remote_action_object.uuid,
129
+ steps: remote_action_object.steps,
130
+ type: ProconBypassMan::RemoteAction::Task::TYPE_MACRO,
115
131
  )
116
132
  end
117
133
  end
@@ -31,7 +31,7 @@ require_relative "procon_bypass_man/support/on_memory_cache"
31
31
  require_relative "procon_bypass_man/support/http_client"
32
32
  require_relative "procon_bypass_man/support/report_http_client"
33
33
  require_relative "procon_bypass_man/support/remote_macro_http_client"
34
- require_relative "procon_bypass_man/support/update_remote_pbm_action_status_http_client"
34
+ require_relative "procon_bypass_man/support/update_remote_pbm_job_status_http_client"
35
35
  require_relative "procon_bypass_man/support/send_device_stats_http_client"
36
36
  require_relative "procon_bypass_man/support/procon_performance_http_client"
37
37
  require_relative "procon_bypass_man/support/analog_stick_hypotenuse_tilting_power_scaler"
@@ -55,7 +55,6 @@ require_relative "procon_bypass_man/device_model"
55
55
  require_relative "procon_bypass_man/procon/button"
56
56
  require_relative "procon_bypass_man/procon/analog_stick_cap"
57
57
  require_relative "procon_bypass_man/procon/analog_stick_manipulator"
58
- require_relative "procon_bypass_man/remote_pbm_action/value_objects/remote_pbm_action_object"
59
58
  require_relative "procon_bypass_man/scheduler"
60
59
  require_relative "procon_bypass_man/plugins"
61
60
  require_relative "procon_bypass_man/worker"
@@ -63,8 +62,7 @@ require_relative "procon_bypass_man/websocket/client"
63
62
  require_relative "procon_bypass_man/websocket/watchdog"
64
63
  require_relative "procon_bypass_man/websocket/forever"
65
64
 
66
- require_relative "procon_bypass_man/remote_pbm_action"
67
- require_relative "procon_bypass_man/remote_macro"
65
+ require_relative "procon_bypass_man/remote_action"
68
66
 
69
67
  STDOUT.sync = true
70
68
  Thread.abort_on_exception = true
@@ -161,7 +159,7 @@ module ProconBypassMan
161
159
  ProconBypassMan::Background::JobQueue.start!
162
160
  ProconBypassMan::Websocket::Client.start!
163
161
  # TODO ProconBypassMan::DrbObjects.start_all! みたいな感じで書きたい
164
- ProconBypassMan::RemoteMacro::QueueOverProcess.start!
162
+ ProconBypassMan::RemoteAction::QueueOverProcess.start!
165
163
  ProconBypassMan::Procon::PerformanceMeasurement::QueueOverProcess.start!
166
164
  ProconBypassMan::Scheduler.start!
167
165
 
@@ -193,7 +191,7 @@ module ProconBypassMan
193
191
  BlueGreenProcess.configure do |config|
194
192
  config.after_fork = -> {
195
193
  DRb.start_service if defined?(DRb)
196
- ProconBypassMan::RemoteMacroReceiver.start!
194
+ ProconBypassMan::RemoteActionReceiver.start!
197
195
  BlueGreenProcess.config.logger = ProconBypassMan.logger
198
196
  }
199
197
  config.shared_variables = [:buttons, :current_layer_key, :recent_left_stick_hypotenuses]
@@ -204,7 +202,7 @@ module ProconBypassMan
204
202
  def self.terminate_pbm
205
203
  FileUtils.rm_rf(ProconBypassMan.pid_path)
206
204
  FileUtils.rm_rf(ProconBypassMan.digest_path)
207
- ProconBypassMan::RemoteMacro::QueueOverProcess.shutdown
205
+ ProconBypassMan::RemoteAction::QueueOverProcess.shutdown
208
206
  ProconBypassMan::Procon::PerformanceMeasurement::QueueOverProcess.shutdown
209
207
  self.worker&.shutdown
210
208
  end
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
28
28
  spec.require_paths = ["lib"]
29
29
 
30
30
  # Uncomment to register a new dependency of your gem
31
- spec.add_dependency "pbmenv", ">= 0.1.9" # enable_pbm_cloud連携機能でPbmenv.installを使っている.
31
+ spec.add_dependency "pbmenv", ">= 0.1.11" # enable_pbm_cloud連携機能でPbmenv.install, .cleanを使っている.
32
32
  spec.add_dependency "action_cable_client"
33
33
  spec.add_dependency "sorted_set"
34
34
  spec.add_dependency "blue_green_process", '0.1.4.2'
@@ -12,7 +12,7 @@ begin
12
12
  gemfile do
13
13
  source 'https://rubygems.org'
14
14
  git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
15
- gem 'procon_bypass_man', '0.3.4'
15
+ gem 'procon_bypass_man', '0.3.6'
16
16
  end
17
17
  rescue Bundler::Source::Git::GitCommandError => e
18
18
  retry_count_on_git_command_error = retry_count_on_git_command_error + 1
@@ -12,7 +12,7 @@ begin
12
12
  gemfile do
13
13
  source 'https://rubygems.org'
14
14
  git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
15
- gem 'procon_bypass_man', '0.3.4'
15
+ gem 'procon_bypass_man', '0.3.6'
16
16
  end
17
17
  rescue Bundler::Source::Git::GitCommandError => e
18
18
  retry_count_on_git_command_error = retry_count_on_git_command_error + 1
data/sig/main.rbs CHANGED
@@ -613,12 +613,6 @@ module ProconBypassMan
613
613
  end
614
614
  end
615
615
 
616
- module ProconBypassMan
617
- class UpdateRemotePbmActionStatusHttpClient
618
- def post: (to_status: ::Symbol) -> untyped
619
- end
620
- end
621
-
622
616
  module ProconBypassMan
623
617
  class CompressArray
624
618
  @array: [String]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: procon_bypass_man
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - jiikko
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-12-26 00:00:00.000000000 Z
11
+ date: 2023-03-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pbmenv
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.1.9
19
+ version: 0.1.11
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 0.1.9
26
+ version: 0.1.11
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: action_cable_client
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -93,6 +93,7 @@ files:
93
93
  - bin/console
94
94
  - bin/dev_api_server.rb
95
95
  - bin/generate_default_app
96
+ - bin/generate_output_report
96
97
  - bin/setup
97
98
  - docs/getting_started.md
98
99
  - docs/how_to_connect_procon.md
@@ -106,7 +107,7 @@ files:
106
107
  - docs/setting/splatoon3_macro_dasei_cancel.md
107
108
  - docs/setting/splatoon3_macro_forward_ikarole.md
108
109
  - docs/setting/splatoon3_recommended_setting.md
109
- - docs/setting/splatoon3_rotation_forward_stick.md
110
+ - docs/setting/splatoon3_rotation_left_stick.md
110
111
  - docs/setup_raspi.md
111
112
  - docs/setup_raspi.mitamae.rb
112
113
  - docs/setup_raspi_by_mitamae.md
@@ -119,20 +120,24 @@ files:
119
120
  - lib/procon_bypass_man/background/jobs/base_job.rb
120
121
  - lib/procon_bypass_man/background/jobs/concerns/has_external_api_setting.rb
121
122
  - lib/procon_bypass_man/background/jobs/concerns/job_performable.rb
123
+ - lib/procon_bypass_man/background/jobs/post_completed_remote_action_job.rb
122
124
  - lib/procon_bypass_man/background/jobs/post_completed_remote_macro_job.rb
123
125
  - lib/procon_bypass_man/background/jobs/report_boot_job.rb
124
126
  - lib/procon_bypass_man/background/jobs/report_completed_upgrade_pbm_job.rb
125
127
  - lib/procon_bypass_man/background/jobs/report_error_job.rb
126
128
  - lib/procon_bypass_man/background/jobs/report_error_reload_config_job.rb
127
129
  - lib/procon_bypass_man/background/jobs/report_event_base_job.rb
130
+ - lib/procon_bypass_man/background/jobs/report_info_log_job.rb
128
131
  - lib/procon_bypass_man/background/jobs/report_load_config_job.rb
129
132
  - lib/procon_bypass_man/background/jobs/report_procon_performance_measurements_job.rb
130
133
  - lib/procon_bypass_man/background/jobs/report_reload_config_job.rb
131
134
  - lib/procon_bypass_man/background/jobs/report_start_reboot_job.rb
135
+ - lib/procon_bypass_man/background/jobs/report_warning_job.rb
132
136
  - lib/procon_bypass_man/background/jobs/sync_device_stats_job.rb
133
137
  - lib/procon_bypass_man/buttons_setting_configuration.rb
134
138
  - lib/procon_bypass_man/buttons_setting_configuration/layer.rb
135
139
  - lib/procon_bypass_man/buttons_setting_configuration/loader.rb
140
+ - lib/procon_bypass_man/buttons_setting_configuration/metadata_loader.rb
136
141
  - lib/procon_bypass_man/buttons_setting_configuration/param_normalizer.rb
137
142
  - lib/procon_bypass_man/buttons_setting_configuration/param_normalizer/button.rb
138
143
  - lib/procon_bypass_man/buttons_setting_configuration/param_normalizer/button_list.rb
@@ -152,7 +157,9 @@ files:
152
157
  - lib/procon_bypass_man/commands/print_boot_message_command.rb
153
158
  - lib/procon_bypass_man/commands/print_message_command.rb
154
159
  - lib/procon_bypass_man/commands/send_error_command.rb
160
+ - lib/procon_bypass_man/commands/send_info_log_command.rb
155
161
  - lib/procon_bypass_man/commands/send_reload_config_event_command.rb
162
+ - lib/procon_bypass_man/commands/send_warning_command.rb
156
163
  - lib/procon_bypass_man/commands/write_device_id_command.rb
157
164
  - lib/procon_bypass_man/commands/write_session_id_command.rb
158
165
  - lib/procon_bypass_man/configuration.rb
@@ -229,28 +236,28 @@ files:
229
236
  - lib/procon_bypass_man/procon/value_objects/procon_reader.rb
230
237
  - lib/procon_bypass_man/procon/value_objects/rumble_binary.rb
231
238
  - lib/procon_bypass_man/procon_display.rb
232
- - lib/procon_bypass_man/procon_display/bypass_hook.rb
233
239
  - lib/procon_bypass_man/procon_display/http_request.rb
234
240
  - lib/procon_bypass_man/procon_display/http_response.rb
235
241
  - lib/procon_bypass_man/procon_display/server.rb
236
242
  - lib/procon_bypass_man/procon_display/server_app.rb
237
243
  - lib/procon_bypass_man/procon_display/status.rb
238
- - lib/procon_bypass_man/remote_macro.rb
239
- - lib/procon_bypass_man/remote_macro/queue_over_process.rb
240
- - lib/procon_bypass_man/remote_macro/remote_macro_object.rb
241
- - lib/procon_bypass_man/remote_macro/remote_macro_receiver.rb
242
- - lib/procon_bypass_man/remote_macro/remote_macro_sender.rb
243
- - lib/procon_bypass_man/remote_macro/task.rb
244
- - lib/procon_bypass_man/remote_macro/task_queue.rb
245
- - lib/procon_bypass_man/remote_pbm_action.rb
246
- - lib/procon_bypass_man/remote_pbm_action/base_action.rb
247
- - lib/procon_bypass_man/remote_pbm_action/change_pbm_version_action.rb
248
- - lib/procon_bypass_man/remote_pbm_action/commands/run_remote_pbm_action_dispatch_command.rb
249
- - lib/procon_bypass_man/remote_pbm_action/commands/update_remote_pbm_action_status_command.rb
250
- - lib/procon_bypass_man/remote_pbm_action/reboot_os_action.rb
251
- - lib/procon_bypass_man/remote_pbm_action/restore_pbm_setting.rb
252
- - lib/procon_bypass_man/remote_pbm_action/stop_pbm_action.rb
253
- - lib/procon_bypass_man/remote_pbm_action/value_objects/remote_pbm_action_object.rb
244
+ - lib/procon_bypass_man/remote_action.rb
245
+ - lib/procon_bypass_man/remote_action/queue_over_process.rb
246
+ - lib/procon_bypass_man/remote_action/remote_action_object.rb
247
+ - lib/procon_bypass_man/remote_action/remote_action_receiver.rb
248
+ - lib/procon_bypass_man/remote_action/remote_action_sender.rb
249
+ - lib/procon_bypass_man/remote_action/remote_pbm_job.rb
250
+ - lib/procon_bypass_man/remote_action/remote_pbm_job/base_action.rb
251
+ - lib/procon_bypass_man/remote_action/remote_pbm_job/change_pbm_version_action.rb
252
+ - lib/procon_bypass_man/remote_action/remote_pbm_job/commands/run_remote_pbm_job_dispatch_command.rb
253
+ - lib/procon_bypass_man/remote_action/remote_pbm_job/commands/update_remote_pbm_job_status_command.rb
254
+ - lib/procon_bypass_man/remote_action/remote_pbm_job/reboot_os_action.rb
255
+ - lib/procon_bypass_man/remote_action/remote_pbm_job/report_procon_status.rb
256
+ - lib/procon_bypass_man/remote_action/remote_pbm_job/restore_pbm_setting.rb
257
+ - lib/procon_bypass_man/remote_action/remote_pbm_job/stop_pbm_action.rb
258
+ - lib/procon_bypass_man/remote_action/remote_pbm_job/value_objects/remote_pbm_job_object.rb
259
+ - lib/procon_bypass_man/remote_action/task.rb
260
+ - lib/procon_bypass_man/remote_action/task_queue.rb
254
261
  - lib/procon_bypass_man/runner.rb
255
262
  - lib/procon_bypass_man/scheduler.rb
256
263
  - lib/procon_bypass_man/support/analog_stick_hypotenuse_tilting_power_scaler.rb
@@ -271,7 +278,7 @@ files:
271
278
  - lib/procon_bypass_man/support/retryable.rb
272
279
  - lib/procon_bypass_man/support/safe_timeout.rb
273
280
  - lib/procon_bypass_man/support/send_device_stats_http_client.rb
274
- - lib/procon_bypass_man/support/update_remote_pbm_action_status_http_client.rb
281
+ - lib/procon_bypass_man/support/update_remote_pbm_job_status_http_client.rb
275
282
  - lib/procon_bypass_man/support/uptime.rb
276
283
  - lib/procon_bypass_man/support/usb_device_controller.rb
277
284
  - lib/procon_bypass_man/support/yaml_loader.rb
@@ -1,12 +0,0 @@
1
- module ProconBypassMan::ProconDisplay::BypassHook
2
- include ProconBypassMan::Callbacks
3
-
4
- define_callbacks :run
5
-
6
- set_callback :run, :after, :write_procon_display_status
7
-
8
- def write_procon_display_status
9
- return unless bypass_value.binary
10
- ProconBypassMan::ProconDisplay::Status.instance.current = bypass_value.binary.to_procon_reader.to_hash.dup
11
- end
12
- end
@@ -1,8 +0,0 @@
1
- class ProconBypassMan::RemoteMacroSender
2
- def self.execute(name: , uuid: , steps: )
3
- ProconBypassMan.logger.info "[remote macro][sender] name: #{name}, uuid: #{uuid}, steps: #{steps}"
4
- ProconBypassMan::RemoteMacro::QueueOverProcess.push(
5
- ProconBypassMan::RemoteMacro::Task.new(name, uuid, steps)
6
- )
7
- end
8
- end
@@ -1,2 +0,0 @@
1
- class ProconBypassMan::RemoteMacro::Task < ::Struct.new(:name, :uuid, :steps)
2
- end
@@ -1,16 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module ProconBypassMan
4
- module RemoteMacro
5
- require "procon_bypass_man/remote_macro/remote_macro_object"
6
- require "procon_bypass_man/remote_macro/remote_macro_receiver"
7
- require "procon_bypass_man/remote_macro/remote_macro_sender"
8
- require "procon_bypass_man/remote_macro/queue_over_process"
9
- require "procon_bypass_man/remote_macro/task"
10
- require "procon_bypass_man/remote_macro/task_queue"
11
-
12
- ACTION_KEY = "remote_macro"
13
-
14
- TaskQueueInProcess = ProconBypassMan::RemoteMacro::TaskQueue.new
15
- end
16
- end