Skip to content

Commit

Permalink
Merge pull request #294 from splaplapla/update-gem
Browse files Browse the repository at this point in the history
開発用のライブラリをアップデートする
  • Loading branch information
jiikko authored Jan 21, 2024
2 parents fe2c835 + f6bb118 commit b37a789
Show file tree
Hide file tree
Showing 16 changed files with 131 additions and 83 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ executors:
- image: ruby:<< parameters.tag >>
environment:
BUNDLE_PATH: vendor/bundle
BUNDLE_WITHOUT: development
BUNDLE_WITHOUT: "development"
working_directory: ~/app

commands:
Expand Down Expand Up @@ -141,8 +141,8 @@ build_jobs: &build_jobs
parameters:
ruby-version:
# - "3.0.1" # たまにSEGVするので
- "3.0.2"
- "3.1.2"
# - "3.0.2"
# - "3.1.2"
requires:
- bundle_install
- rspec:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ jobs:
timeout-minutes: 5
permissions:
contents: write
env:
BUNDLE_WITHOUT: "development"

steps:
- uses: actions/checkout@v3
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
strategy:
matrix:
ruby-version: ['3.0', '3.1', '3.2', '3.3.0']
env:
BUNDLE_WITHOUT: "development"

steps:
- uses: actions/checkout@v3
Expand All @@ -28,4 +30,4 @@ jobs:
- name: Run tests
run: |-
bundle exec rake
bundle exec steep check
# bundle exec steep check
2 changes: 2 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@ Lint/AmbiguousBlockAssociation:
Enabled: false
Security/Eval:
Enabled: false
Lint/MissingSuper:
Enabled: false
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## unrelease
* ruby-2.5のサポート終了しました

## [0.3.12] 2024-1-8
* sudoをつけずにPBMを起動できるようになりました。(なお周辺ファイルは未対応)
* setting.ymlからコントローラーアイコンの色を変更できるようになりました
Expand Down
11 changes: 7 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@ gem "rake"
gem "rspec"
gem "rubocop", require: false
gem "serialport" # シリアル通信をする時に必要。通常はいらない
gem "sinatra", require: false
gem "solargraph", require: false
gem "stackprof", require: false
gem "timecop"
gem "webrick", require: false

group :development do
gem "sinatra", require: false
gem "solargraph", "0.50.0", require: false
gem "stackprof", require: false
gem "webrick", require: false
end

if Gem::Version.new(RUBY_VERSION) > Gem::Version.new("2.6.0")
gem 'rbs', require: false
Expand Down
165 changes: 100 additions & 65 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12,135 +12,171 @@ GEM
specs:
action_cable_client (3.1.0)
websocket-eventmachine-client (>= 1.2.0)
activesupport (6.1.4.1)
activesupport (7.1.3)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
ast (2.4.2)
backport (1.2.0)
benchmark (0.2.1)
base64 (0.2.0)
benchmark (0.3.0)
bigdecimal (3.1.6)
blue_green_process (0.1.4.3)
coderay (1.1.3)
concurrent-ruby (1.1.9)
diff-lcs (1.4.4)
concurrent-ruby (1.2.3)
connection_pool (2.4.1)
csv (3.2.8)
diff-lcs (1.5.0)
drb (2.2.0)
ruby2_keywords
e2mmap (0.1.0)
eventmachine (1.2.7)
ffi (1.15.4)
i18n (1.8.11)
ffi (1.16.3)
fileutils (1.7.2)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
jaro_winkler (1.5.6)
json (2.7.1)
kramdown (2.4.0)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
language_server-protocol (3.16.0.3)
listen (3.7.0)
language_server-protocol (3.17.0.3)
listen (3.8.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
logger (1.6.0)
method_source (1.0.0)
mini_portile2 (2.8.5)
minitest (5.14.4)
mustermann (1.1.1)
minitest (5.21.2)
mustermann (3.0.0)
ruby2_keywords (~> 0.0.1)
mutex_m (0.2.0)
nokogiri (1.15.5)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
parallel (1.21.0)
parser (3.0.3.2)
nokogiri (1.15.5-arm-linux)
racc (~> 1.4)
nokogiri (1.15.5-arm64-darwin)
racc (~> 1.4)
nokogiri (1.15.5-x86_64-linux)
racc (~> 1.4)
parallel (1.24.0)
parser (3.3.0.4)
ast (~> 2.4.1)
racc
pbmenv (0.1.13)
pry (0.14.1)
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
racc (1.7.3)
rack (2.2.3.1)
rack-protection (2.2.0)
rack
rainbow (3.0.0)
rake (13.0.6)
rb-fsevent (0.11.0)
rack (3.0.8)
rack-protection (4.0.0)
base64 (>= 0.1.0)
rack (>= 3.0.0, < 4)
rack-session (2.0.0)
rack (>= 3.0.0)
rainbow (3.1.1)
rake (13.1.0)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
rbs (1.7.1)
rbs (2.8.4)
rbtree (0.4.6)
regexp_parser (2.2.0)
regexp_parser (2.9.0)
reverse_markdown (2.1.1)
nokogiri
rexml (3.2.5)
rspec (3.10.0)
rspec-core (~> 3.10.0)
rspec-expectations (~> 3.10.0)
rspec-mocks (~> 3.10.0)
rspec-core (3.10.1)
rspec-support (~> 3.10.0)
rspec-expectations (3.10.1)
rexml (3.2.6)
rspec (3.12.0)
rspec-core (~> 3.12.0)
rspec-expectations (~> 3.12.0)
rspec-mocks (~> 3.12.0)
rspec-core (3.12.2)
rspec-support (~> 3.12.0)
rspec-expectations (3.12.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-mocks (3.10.2)
rspec-support (~> 3.12.0)
rspec-mocks (3.12.6)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-support (3.10.3)
rubocop (1.23.0)
rspec-support (~> 3.12.0)
rspec-support (3.12.1)
rubocop (1.60.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.0.0.0)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml
rubocop-ast (>= 1.12.0, < 2.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.30.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.14.0)
parser (>= 3.0.1.1)
ruby-progressbar (1.11.0)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.30.0)
parser (>= 3.2.1.0)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
securerandom (0.3.1)
serialport (1.3.2)
set (1.1.0)
sinatra (2.2.0)
mustermann (~> 1.0)
rack (~> 2.2)
rack-protection (= 2.2.0)
sinatra (4.0.0)
mustermann (~> 3.0)
rack (>= 3.0.0, < 4)
rack-protection (= 4.0.0)
rack-session (>= 2.0.0, < 3)
tilt (~> 2.0)
solargraph (0.48.0)
solargraph (0.50.0)
backport (~> 1.2)
benchmark
bundler (>= 1.17.2)
bundler (~> 2.0)
diff-lcs (~> 1.4)
e2mmap
jaro_winkler (~> 1.5)
kramdown (~> 2.3)
kramdown-parser-gfm (~> 1.1)
parser (~> 3.0)
reverse_markdown (>= 1.0.5, < 3)
rubocop (>= 0.52)
rbs (~> 2.0)
reverse_markdown (~> 2.0)
rubocop (~> 1.38)
thor (~> 1.0)
tilt (~> 2.0)
yard (~> 0.9, >= 0.9.24)
sorted_set (1.0.3)
rbtree
set (~> 1.0)
stackprof (0.2.22)
steep (0.47.0)
stackprof (0.2.26)
steep (1.4.0)
activesupport (>= 5.1)
concurrent-ruby (>= 1.2.2)
csv (>= 3.0.9)
fileutils (>= 1.1.0)
json (>= 2.1.0)
language_server-protocol (>= 3.15, < 4.0)
listen (~> 3.0)
parallel (>= 1.0.0)
parser (>= 3.0)
logger (>= 1.3.0)
parser (>= 3.1)
rainbow (>= 2.2.2, < 4.0)
rbs (~> 1.7.0)
rbs (>= 2.8.0)
securerandom (>= 0.1)
strscan (>= 1.0.0)
terminal-table (>= 2, < 4)
strscan (3.0.9)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
thor (1.2.2)
tilt (2.0.10)
timecop (0.9.4)
typeprof (0.20.4)
rbs (>= 1.6.2)
tzinfo (2.0.4)
thor (1.3.0)
tilt (2.3.0)
timecop (0.9.8)
typeprof (0.21.9)
rbs (>= 1.8.1)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.1.0)
webrick (1.7.0)
unicode-display_width (2.5.0)
webrick (1.8.1)
websocket (1.2.10)
websocket-eventmachine-base (1.2.0)
eventmachine (~> 1.0)
Expand All @@ -150,7 +186,6 @@ GEM
websocket-eventmachine-base (~> 1.0)
websocket-native (1.0.0)
yard (0.9.34)
zeitwerk (2.5.1)

PLATFORMS
arm-linux
Expand All @@ -169,7 +204,7 @@ DEPENDENCIES
rubocop
serialport
sinatra
solargraph
solargraph (= 0.50.0)
stackprof
steep
timecop
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def open_macro(name, steps: [], if_pressed: nil, if_tilted_left_stick: nil, forc
return
end

macro_name = name || "OpenMacro-#{steps.join}".to_sym
macro_name = name || :"OpenMacro-#{steps.join}"
@context.macro_registry.install_plugin(macro_name, steps: steps)
self.macros[macro_name] = { if_pressed: if_pressed, if_tilted_left_stick: if_tilted_left_stick, force_neutral: force_neutral }.compact
end
Expand Down
2 changes: 1 addition & 1 deletion lib/procon_bypass_man/bypass/bypass_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def execute
# TODO: 本当はいらないんだけど、なぜか反映されないのでここでも設定する
BlueGreenProcess.config.logger = ProconBypassMan.logger

while(readable_io = IO.select([self_read]))
while(readable_io = IO.select([self_read])) # rubocop:disable Lint/IncompatibleIoSelectWithFiberScheduler # TODO後で直す
signal = readable_io.first[0].gets.strip
case signal
when 'USR2'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ def self.execute
message = BootMessage.new
ProconBypassMan::ReportBootJob.perform_async(message.to_hash)
ProconBypassMan.logger.info message.to_s
puts message.to_s
puts message
end
end
3 changes: 2 additions & 1 deletion lib/procon_bypass_man/device_connection/command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ def self.execute!(retry_count: 0)

retry_count = retry_count + 1
retry
rescue ProconBypassMan::DeviceConnection::NotFoundProconError, ProconBypassMan::DeviceConnection::SetupIncompleteError => e
rescue ProconBypassMan::DeviceConnection::NotFoundProconError, ProconBypassMan::DeviceConnection::SetupIncompleteError => e # rubocop:disable Lint/UselessRescue
# TODO: エラークラスを作ってなげる
raise
end

Expand Down
2 changes: 1 addition & 1 deletion lib/procon_bypass_man/external_input/external_data.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module ProconBypassMan
module ExternalInput
class ExternalData
UNPRESS_BUTTONS = Set.new(ProconBypassMan::Procon::ButtonCollection.available.map { |x| "un#{x}".to_sym })
UNPRESS_BUTTONS = Set.new(ProconBypassMan::Procon::ButtonCollection.available.map { |x| :"un#{x}" })

# @return [String, NilClass] 16進数表現のデータ
attr_reader :hex
Expand Down
2 changes: 1 addition & 1 deletion lib/procon_bypass_man/procon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def apply!
no_op_step = :wait_for_0_3 # マクロの最後に固まって最後の入力をし続けるので、無の状態を最後に注入する
BlueGreenProcess::SharedVariable.extend_run_on_this_process = true
ProconBypassMan.buttons_setting_configuration.macro_registry.cleanup_remote_macros!
macro_name = task.name || "RemoteMacro-#{task.steps.join}".to_sym
macro_name = task.name || :"RemoteMacro-#{task.steps.join}"
task.steps << no_op_step
ProconBypassMan.buttons_setting_configuration.macro_registry.install_plugin(macro_name, steps: task.steps, macro_type: :remote)
@@status[:ongoing_macro] = ProconBypassMan.buttons_setting_configuration.macro_registry.load(macro_name, macro_type: :remote) do
Expand Down
4 changes: 2 additions & 2 deletions lib/procon_bypass_man/procon/macro_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def self.merge(subjects)

class Subject
def initialize(value)
if not /^shake_/ =~ value
if not (/^shake_/ =~ value)
@button =
if match = value.match(/_(\w+)\z/)
match[1]
Expand Down Expand Up @@ -106,7 +106,7 @@ def build_if_v2_format?(step: )
end

if /^rotation_left_stick/ =~ step
roll_left_stick_steps = 0.step(359, 17).map { |x| ["tilt_left_stick_completely_to_#{x}deg".to_sym] }
roll_left_stick_steps = 0.step(359, 17).map { |x| [:"tilt_left_stick_completely_to_#{x}deg"] }
return { steps: roll_left_stick_steps }
end

Expand Down
Loading

0 comments on commit b37a789

Please sign in to comment.