procon_bypass_man 0.1.7 → 0.1.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +3 -2
  3. data/.github/workflows/ruby.yml +34 -0
  4. data/.gitignore +4 -0
  5. data/.rubocop.yml +2 -0
  6. data/.ruby-version +1 -1
  7. data/CHANGELOG.md +17 -0
  8. data/Gemfile +4 -0
  9. data/Gemfile.lock +54 -2
  10. data/README.md +13 -8
  11. data/Rakefile +10 -1
  12. data/Steepfile +39 -0
  13. data/bin/console +4 -0
  14. data/bin/dev_api_server.rb +18 -0
  15. data/docs/setup_raspi.mitamae.rb +17 -2
  16. data/docs/setup_raspi_by_mitamae.md +2 -1
  17. data/lib/procon_bypass_man/background/report_thread.rb +42 -0
  18. data/lib/procon_bypass_man/boot_message.rb +40 -0
  19. data/lib/procon_bypass_man/buttons_setting_configuration.rb +102 -0
  20. data/lib/procon_bypass_man/bypass/usb_hid_logger.rb +27 -0
  21. data/lib/procon_bypass_man/bypass.rb +60 -29
  22. data/lib/procon_bypass_man/callbacks.rb +70 -0
  23. data/lib/procon_bypass_man/configuration/layer.rb +50 -4
  24. data/lib/procon_bypass_man/configuration/loader.rb +8 -8
  25. data/lib/procon_bypass_man/configuration/validator.rb +1 -1
  26. data/lib/procon_bypass_man/configuration.rb +67 -64
  27. data/lib/procon_bypass_man/device_connector.rb +13 -30
  28. data/lib/procon_bypass_man/io_monitor.rb +7 -4
  29. data/lib/procon_bypass_man/on_memory_cache.rb +34 -0
  30. data/lib/procon_bypass_man/outbound/base.rb +53 -0
  31. data/lib/procon_bypass_man/outbound/error_reporter.rb +13 -0
  32. data/lib/procon_bypass_man/outbound/pressed_buttons_reporter.rb +13 -0
  33. data/lib/procon_bypass_man/outbound/reporter.rb +12 -0
  34. data/lib/procon_bypass_man/procon/analog_stick.rb +31 -0
  35. data/lib/procon_bypass_man/procon/analog_stick_cap.rb +65 -0
  36. data/lib/procon_bypass_man/procon/button_collection.rb +15 -6
  37. data/lib/procon_bypass_man/procon/layer_changeable.rb +2 -2
  38. data/lib/procon_bypass_man/procon/macro_registry.rb +2 -2
  39. data/lib/procon_bypass_man/procon/mode_registry.rb +4 -4
  40. data/lib/procon_bypass_man/procon/press_button_aware.rb +13 -0
  41. data/lib/procon_bypass_man/procon/pressed_button_helper.rb +1 -11
  42. data/lib/procon_bypass_man/procon/user_operation.rb +15 -4
  43. data/lib/procon_bypass_man/procon.rb +25 -5
  44. data/lib/procon_bypass_man/readonly_procon.rb +32 -0
  45. data/lib/procon_bypass_man/runner.rb +39 -48
  46. data/lib/procon_bypass_man/uptime.rb +15 -0
  47. data/lib/procon_bypass_man/version.rb +1 -1
  48. data/lib/procon_bypass_man.rb +26 -33
  49. data/project_template/README.md +3 -2
  50. data/project_template/app.rb +8 -6
  51. data/project_template/systemd_units/pbm.service +1 -1
  52. data/project_template/systemd_units/pbm_web.service +11 -0
  53. data/project_template/web.rb +16 -0
  54. data/sig/README.rb +4 -0
  55. data/sig/main.rbs +507 -0
  56. metadata +25 -5
  57. data/examples/practical/app.rb +0 -21
  58. data/examples/practical/setting.yml +0 -24
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.7
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - jiikko
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-09-11 00:00:00.000000000 Z
11
+ date: 2021-11-04 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: extension for Nintendo Switch Pro Controller
14
14
  email:
@@ -18,6 +18,7 @@ extensions: []
18
18
  extra_rdoc_files: []
19
19
  files:
20
20
  - ".circleci/config.yml"
21
+ - ".github/workflows/ruby.yml"
21
22
  - ".gitignore"
22
23
  - ".rspec"
23
24
  - ".rubocop.yml"
@@ -28,40 +29,59 @@ files:
28
29
  - LICENSE.txt
29
30
  - README.md
30
31
  - Rakefile
32
+ - Steepfile
31
33
  - bin/console
34
+ - bin/dev_api_server.rb
32
35
  - bin/setup
33
36
  - docs/how_to_connect_procon.md
34
37
  - docs/setup_raspi.md
35
38
  - docs/setup_raspi.mitamae.rb
36
39
  - docs/setup_raspi_by_mitamae.md
37
- - examples/practical/app.rb
38
- - examples/practical/setting.yml
39
40
  - lib/procon_bypass_man.rb
41
+ - lib/procon_bypass_man/background/report_thread.rb
42
+ - lib/procon_bypass_man/boot_message.rb
43
+ - lib/procon_bypass_man/buttons_setting_configuration.rb
40
44
  - lib/procon_bypass_man/bypass.rb
45
+ - lib/procon_bypass_man/bypass/usb_hid_logger.rb
46
+ - lib/procon_bypass_man/callbacks.rb
41
47
  - lib/procon_bypass_man/configuration.rb
42
48
  - lib/procon_bypass_man/configuration/layer.rb
43
49
  - lib/procon_bypass_man/configuration/loader.rb
44
50
  - lib/procon_bypass_man/configuration/validator.rb
45
51
  - lib/procon_bypass_man/device_connector.rb
46
52
  - lib/procon_bypass_man/io_monitor.rb
53
+ - lib/procon_bypass_man/on_memory_cache.rb
54
+ - lib/procon_bypass_man/outbound/base.rb
55
+ - lib/procon_bypass_man/outbound/error_reporter.rb
56
+ - lib/procon_bypass_man/outbound/pressed_buttons_reporter.rb
57
+ - lib/procon_bypass_man/outbound/reporter.rb
47
58
  - lib/procon_bypass_man/processor.rb
48
59
  - lib/procon_bypass_man/procon.rb
60
+ - lib/procon_bypass_man/procon/analog_stick.rb
61
+ - lib/procon_bypass_man/procon/analog_stick_cap.rb
49
62
  - lib/procon_bypass_man/procon/button_collection.rb
50
63
  - lib/procon_bypass_man/procon/data.rb
51
64
  - lib/procon_bypass_man/procon/flip_cache.rb
52
65
  - lib/procon_bypass_man/procon/layer_changeable.rb
53
66
  - lib/procon_bypass_man/procon/macro_registry.rb
54
67
  - lib/procon_bypass_man/procon/mode_registry.rb
68
+ - lib/procon_bypass_man/procon/press_button_aware.rb
55
69
  - lib/procon_bypass_man/procon/pressed_button_helper.rb
56
70
  - lib/procon_bypass_man/procon/user_operation.rb
71
+ - lib/procon_bypass_man/readonly_procon.rb
57
72
  - lib/procon_bypass_man/runner.rb
58
73
  - lib/procon_bypass_man/timer.rb
74
+ - lib/procon_bypass_man/uptime.rb
59
75
  - lib/procon_bypass_man/version.rb
60
76
  - procon_bypass_man.gemspec
61
77
  - project_template/README.md
62
78
  - project_template/app.rb
63
79
  - project_template/setting.yml
64
80
  - project_template/systemd_units/pbm.service
81
+ - project_template/systemd_units/pbm_web.service
82
+ - project_template/web.rb
83
+ - sig/README.rb
84
+ - sig/main.rbs
65
85
  homepage: https://github.com/splaplapla/procon_bypass_man
66
86
  licenses:
67
87
  - MIT
@@ -83,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
83
103
  - !ruby/object:Gem::Version
84
104
  version: '0'
85
105
  requirements: []
86
- rubygems_version: 3.2.15
106
+ rubygems_version: 3.2.30
87
107
  signing_key:
88
108
  specification_version: 4
89
109
  summary: extension for Nintendo Switch Pro Controller
@@ -1,21 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- # sudo ln -s /home/pi/src/procon_bypass_man/examples/practical/setting.yml /home/pi/src/procon_bypass_man/setting.yml
4
- # cd src/procon_bypass_man
5
- # sudo ruby examples/practical/app.rb
6
-
7
- require 'bundler/inline'
8
-
9
- gemfile do
10
- source 'https://rubygems.org'
11
- gem 'procon_bypass_man', github: 'splaplapla/procon_bypass_man', branch: "edge"
12
- gem 'procon_bypass_man-splatoon2', github: 'splaplapla/procon_bypass_man-splatoon2', branch: "0.1.0"
13
- end
14
-
15
- ProconBypassMan.tap do |pbm|
16
- pbm.logger = Logger.new("#{ProconBypassMan.root}/app.log", 5, 1024 * 1024 * 10) # 5世代まで残して, 10MBでローテーション
17
- pbm.logger.level = :debug
18
- pbm.root = File.expand_path(__dir__)
19
- end
20
-
21
- ProconBypassMan.run(setting_path: "./setting.yml")
@@ -1,24 +0,0 @@
1
- version: 1.0
2
- setting: |-
3
- fast_return = ProconBypassMan::Splatoon2::Macro::FastReturn
4
- guruguru = ProconBypassMan::Splatoon2::Mode::Guruguru
5
-
6
- install_macro_plugin fast_return
7
- install_mode_plugin guruguru
8
-
9
- prefix_keys_for_changing_layer [:zr, :r, :zl, :l]
10
-
11
- layer :up, mode: :manual do
12
- flip :zr, if_pressed: :zr, force_neutral: :zl, flip_interval: "8F"
13
- flip :zl, if_pressed: [:y, :b, :zl]
14
- flip :down, if_pressed: :down
15
- macro fast_return.name, if_pressed: [:y, :b, :down]
16
- remap :l, to: :zr
17
- end
18
- layer :right, mode: guruguru.name
19
- layer :left do
20
- # no-op
21
- end
22
- layer :down do
23
- flip :zl
24
- end