procon_bypass_man 0.1.23 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/gitleacks.yml +11 -0
  3. data/CHANGELOG.md +10 -0
  4. data/Gemfile.lock +1 -1
  5. data/docs/setup_raspi.md +0 -1
  6. data/lib/procon_bypass_man/buttons_setting_configuration/loader.rb +1 -1
  7. data/lib/procon_bypass_man/{commands → bypass}/bypass_command.rb +11 -19
  8. data/lib/procon_bypass_man/bypass.rb +6 -9
  9. data/lib/procon_bypass_man/commands/print_boot_message_command.rb +1 -2
  10. data/lib/procon_bypass_man/commands/send_error_command.rb +2 -2
  11. data/lib/procon_bypass_man/commands.rb +0 -3
  12. data/lib/procon_bypass_man/configuration.rb +21 -2
  13. data/lib/procon_bypass_man/device_connection/command.rb +28 -0
  14. data/lib/procon_bypass_man/{device_connector.rb → device_connection/executor.rb} +51 -38
  15. data/lib/procon_bypass_man/device_connection/output_report_generator.rb +42 -0
  16. data/lib/procon_bypass_man/device_connection/output_report_markerable.rb +28 -0
  17. data/lib/procon_bypass_man/device_connection/output_report_sub_command_table.rb +133 -0
  18. data/lib/procon_bypass_man/device_connection/output_report_watcher.rb +41 -0
  19. data/lib/procon_bypass_man/device_connection/pre_bypass.rb +67 -0
  20. data/lib/procon_bypass_man/device_connection/procon_setting_overrider.rb +78 -0
  21. data/lib/procon_bypass_man/device_connection/spoofing_output_report_watcher.rb +39 -0
  22. data/lib/procon_bypass_man/device_connection.rb +16 -0
  23. data/lib/procon_bypass_man/device_model.rb +17 -0
  24. data/lib/procon_bypass_man/io_monitor.rb +20 -1
  25. data/lib/procon_bypass_man/procon/macro_builder.rb +5 -3
  26. data/lib/procon_bypass_man/{commands → remote_pbm_action/commands}/run_remote_pbm_action_dispatch_command.rb +0 -0
  27. data/lib/procon_bypass_man/remote_pbm_action/restore_pbm_setting.rb +7 -1
  28. data/lib/procon_bypass_man/remote_pbm_action.rb +1 -0
  29. data/lib/procon_bypass_man/runner.rb +3 -7
  30. data/lib/procon_bypass_man/support/never_exit_accidentally.rb +3 -3
  31. data/lib/procon_bypass_man/support/usb_device_controller.rb +2 -2
  32. data/lib/procon_bypass_man/support/yaml_loader.rb +12 -0
  33. data/lib/procon_bypass_man/version.rb +1 -1
  34. data/lib/procon_bypass_man/websocket/client.rb +1 -4
  35. data/lib/procon_bypass_man.rb +65 -41
  36. data/project_template/app.rb +7 -1
  37. data/sig/main.rbs +3 -3
  38. metadata +17 -6
  39. data/lib/procon_bypass_man/commands/connect_device_command.rb +0 -18
data/sig/main.rbs CHANGED
@@ -11,9 +11,6 @@ module ProconBypassMan
11
11
  class CouldNotLoadConfigError < StandardError
12
12
  end
13
13
 
14
- class EternalConnectionError < StandardError
15
- end
16
-
17
14
  def self.configure: (?setting_path: untyped? setting_path) { () -> untyped } -> untyped
18
15
 
19
16
  def self.run: (?setting_path: untyped? setting_path) { () -> untyped } -> untyped
@@ -189,6 +186,7 @@ class ProconBypassMan::Configuration
189
186
  attr_reader api_server: untyped
190
187
  attr_reader api_servers: untyped
191
188
  attr_writer never_exit_accidentally: bool
189
+ attr_writer io_monitor_logging: bool
192
190
 
193
191
  attr_accessor enable_critical_error_logging: bool
194
192
 
@@ -228,6 +226,8 @@ class ProconBypassMan::Configuration
228
226
  def verbose_bypass_log: () -> bool
229
227
 
230
228
  def never_exit_accidentally: () -> bool
229
+
230
+ def io_monitor_logging: () -> bool
231
231
  end
232
232
 
233
233
 
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.1.23
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - jiikko
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-05-04 00:00:00.000000000 Z
11
+ date: 2022-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pbmenv
@@ -60,6 +60,7 @@ extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
62
  - ".circleci/config.yml"
63
+ - ".github/workflows/gitleacks.yml"
63
64
  - ".github/workflows/release.yml"
64
65
  - ".github/workflows/ruby.yml"
65
66
  - ".gitignore"
@@ -122,19 +123,27 @@ files:
122
123
  - lib/procon_bypass_man/buttons_setting_configuration/param_normalizer/open_macro_steps.rb
123
124
  - lib/procon_bypass_man/buttons_setting_configuration/validator.rb
124
125
  - lib/procon_bypass_man/bypass.rb
126
+ - lib/procon_bypass_man/bypass/bypass_command.rb
125
127
  - lib/procon_bypass_man/bypass/usb_hid_logger.rb
126
128
  - lib/procon_bypass_man/commands.rb
127
- - lib/procon_bypass_man/commands/bypass_command.rb
128
- - lib/procon_bypass_man/commands/connect_device_command.rb
129
129
  - lib/procon_bypass_man/commands/print_boot_message_command.rb
130
130
  - lib/procon_bypass_man/commands/print_message_command.rb
131
- - lib/procon_bypass_man/commands/run_remote_pbm_action_dispatch_command.rb
132
131
  - lib/procon_bypass_man/commands/send_error_command.rb
133
132
  - lib/procon_bypass_man/commands/send_reload_config_event_command.rb
134
133
  - lib/procon_bypass_man/commands/write_device_id_command.rb
135
134
  - lib/procon_bypass_man/commands/write_session_id_command.rb
136
135
  - lib/procon_bypass_man/configuration.rb
137
- - lib/procon_bypass_man/device_connector.rb
136
+ - lib/procon_bypass_man/device_connection.rb
137
+ - lib/procon_bypass_man/device_connection/command.rb
138
+ - lib/procon_bypass_man/device_connection/executor.rb
139
+ - lib/procon_bypass_man/device_connection/output_report_generator.rb
140
+ - lib/procon_bypass_man/device_connection/output_report_markerable.rb
141
+ - lib/procon_bypass_man/device_connection/output_report_sub_command_table.rb
142
+ - lib/procon_bypass_man/device_connection/output_report_watcher.rb
143
+ - lib/procon_bypass_man/device_connection/pre_bypass.rb
144
+ - lib/procon_bypass_man/device_connection/procon_setting_overrider.rb
145
+ - lib/procon_bypass_man/device_connection/spoofing_output_report_watcher.rb
146
+ - lib/procon_bypass_man/device_model.rb
138
147
  - lib/procon_bypass_man/device_status.rb
139
148
  - lib/procon_bypass_man/io_monitor.rb
140
149
  - lib/procon_bypass_man/plugin/splatoon2/macro/charge_tansan_bomb.rb
@@ -185,6 +194,7 @@ files:
185
194
  - lib/procon_bypass_man/remote_pbm_action.rb
186
195
  - lib/procon_bypass_man/remote_pbm_action/base_action.rb
187
196
  - lib/procon_bypass_man/remote_pbm_action/change_pbm_version_action.rb
197
+ - lib/procon_bypass_man/remote_pbm_action/commands/run_remote_pbm_action_dispatch_command.rb
188
198
  - lib/procon_bypass_man/remote_pbm_action/commands/update_remote_pbm_action_status_command.rb
189
199
  - lib/procon_bypass_man/remote_pbm_action/reboot_os_action.rb
190
200
  - lib/procon_bypass_man/remote_pbm_action/restore_pbm_setting.rb
@@ -210,6 +220,7 @@ files:
210
220
  - lib/procon_bypass_man/support/update_remote_pbm_action_status_http_client.rb
211
221
  - lib/procon_bypass_man/support/uptime.rb
212
222
  - lib/procon_bypass_man/support/usb_device_controller.rb
223
+ - lib/procon_bypass_man/support/yaml_loader.rb
213
224
  - lib/procon_bypass_man/support/yaml_writer.rb
214
225
  - lib/procon_bypass_man/version.rb
215
226
  - lib/procon_bypass_man/websocket/client.rb
@@ -1,18 +0,0 @@
1
- class ProconBypassMan::ConnectDeviceCommand
2
- class NotFoundProconError < StandardError; end
3
-
4
- # @return [void]
5
- def self.execute!
6
- gadget, procon = ProconBypassMan::DeviceConnector.connect
7
- rescue ProconBypassMan::DeviceConnector::NotFoundProconError => e
8
- ProconBypassMan.logger.error e
9
- gadget&.close
10
- procon&.close
11
- raise ProconBypassMan::ConnectDeviceCommand::NotFoundProconError
12
- rescue ProconBypassMan::SafeTimeout::Timeout
13
- ProconBypassMan.logger.error "デバイスとの通信でタイムアウトが起きて接続ができませんでした。"
14
- gadget&.close
15
- procon&.close
16
- raise ProconBypassMan::EternalConnectionError
17
- end
18
- end