diff --git a/Gemfile.lock b/Gemfile.lock index 559224c..feed4b3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -21,32 +21,32 @@ GEM reline (>= 0.3.8) diff-lcs (1.6.2) docile (1.4.1) - erb (6.0.4) + erb (6.0.7) hashdiff (1.2.1) - io-console (0.8.2) + io-console (0.9.2) irb (1.18.0) pp (>= 0.6.0) prism (>= 1.3.0) rdoc (>= 4.0.0) reline (>= 0.4.2) - json (2.19.7) - language_server-protocol (3.17.0.5) + json (2.21.2) + language_server-protocol (3.17.0.6) lint_roller (1.1.0) - parallel (2.1.0) - parser (3.3.11.1) + parallel (2.2.0) + parser (3.3.12.0) ast (~> 2.4.1) racc - pp (0.6.3) + pp (0.6.4) prettyprint prettier_print (1.2.1) prettyprint (0.2.0) prism (1.9.0) - psych (5.3.1) + psych (5.5.0) date stringio public_suffix (7.0.5) racc (1.8.1) - rack (3.2.6) + rack (3.2.7) rainbow (3.1.1) rake (13.4.2) rdoc (7.2.0) @@ -54,7 +54,7 @@ GEM psych (>= 4.0.0) tsort regexp_parser (2.12.0) - reline (0.6.3) + reline (0.7.0) io-console (~> 0.5) rexml (3.4.4) rspec (3.13.2) @@ -70,8 +70,8 @@ GEM diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-support (3.13.7) - rubocop (1.86.2) - json (~> 2.3) + rubocop (1.90.0) + json (>= 2.3) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.1.0) parallel (>= 1.10) @@ -81,19 +81,20 @@ GEM rubocop-ast (>= 1.49.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 4.0) - rubocop-ast (1.49.1) + rubocop-ast (1.50.0) parser (>= 3.3.7.2) prism (~> 1.7) - rubocop-performance (1.26.1) + rubocop-performance (1.27.0) lint_roller (~> 1.1) - rubocop (>= 1.75.0, < 2.0) + rubocop (>= 1.89.0, < 2.0) rubocop-ast (>= 1.47.1, < 2.0) rubocop-rake (0.7.1) lint_roller (~> 1.1) rubocop (>= 1.72.1) - rubocop-rspec (3.9.0) + rubocop-rspec (3.10.2) lint_roller (~> 1.1) - rubocop (~> 1.81) + regexp_parser (>= 2.0) + rubocop (~> 1.86, >= 1.86.2) ruby-progressbar (1.13.0) simplecov (0.22.0) docile (~> 1.1) @@ -109,7 +110,7 @@ GEM unicode-display_width (3.2.0) unicode-emoji (~> 4.1) unicode-emoji (4.2.0) - webmock (3.26.2) + webmock (3.26.4) addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) diff --git a/bin/lint b/bin/lint index 0088ff7..3296cce 100755 --- a/bin/lint +++ b/bin/lint @@ -3,10 +3,12 @@ set -euo pipefail cd "$(dirname "$0")/.." -# asdf-managed Ruby must win the PATH race because plugin-ruby spawns a Ruby -# parser as a child process; otherwise macOS system Ruby 2.6 wins and crashes -# trying to parse a Bundler 2.5 lockfile. -if command -v brew >/dev/null && [ -f "$(brew --prefix asdf)/libexec/asdf.sh" ]; then +# mise-managed Ruby must win the PATH race because plugin-ruby spawns a Ruby +# parser as a child process; otherwise macOS system Ruby wins and crashes +# trying to parse a modern Bundler lockfile. +if command -v mise >/dev/null; then + eval "$(mise activate bash)" +elif command -v brew >/dev/null && [ -f "$(brew --prefix asdf)/libexec/asdf.sh" ]; then # shellcheck disable=SC1091 . "$(brew --prefix asdf)/libexec/asdf.sh" fi @@ -22,7 +24,7 @@ echo "--- LINTER for / ---" bundle exec rubocop -A # 2. Prettier — formats Ruby (via @prettier/plugin-ruby, which spawns the -# asdf-managed Ruby parser sourced above) plus everything else not +# mise-managed Ruby parser sourced above) plus everything else not # covered by .prettierignore (JSON, MD, YAML, etc.). ./node_modules/.bin/prettier --write . diff --git a/lib/castle/api.rb b/lib/castle/api.rb index 93f3cb6..6c8bae7 100644 --- a/lib/castle/api.rb +++ b/lib/castle/api.rb @@ -43,9 +43,8 @@ def send_request(command, headers = {}, http = nil, config = nil) # @note We need to initialize the error, as the original error is a cause for this # custom exception. If we would do it the default Ruby way, the original error # would get converted into a string - # rubocop:disable Style/RaiseArgs + # rubocop:disable-next Style/RaiseArgs raise Castle::RequestError.new(e) - # rubocop:enable Style/RaiseArgs end end end diff --git a/mise.toml b/mise.toml new file mode 100644 index 0000000..7515063 --- /dev/null +++ b/mise.toml @@ -0,0 +1,16 @@ +# Runtime versions stay in `.tool-versions` (mise reads that natively). + +[tasks.install] +description = "Install Ruby gems and JS packages" +run = """ +bundle install +yarn install +""" + +[tasks.test] +description = "Run the RSpec suite" +run = "bundle exec rspec" + +[tasks.lint] +description = "Run RuboCop and Prettier" +run = "bin/lint" diff --git a/package.json b/package.json index 8c131df..d4bfb4c 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "packageManager": "yarn@1.22.22", "devDependencies": { "@prettier/plugin-ruby": "4.0.4", - "prettier": "3.8.3" + "prettier": "3.9.6" }, "scripts": { "format": "prettier --write .", diff --git a/spec/lib/castle/api/events/schema_spec.rb b/spec/lib/castle/api/events/schema_spec.rb index c92843a..d98fa82 100644 --- a/spec/lib/castle/api/events/schema_spec.rb +++ b/spec/lib/castle/api/events/schema_spec.rb @@ -10,8 +10,6 @@ before { call } - it do - assert_requested :get, 'https://api.castle.io/v1/events/schema', times: 1 - end + it { assert_requested :get, 'https://api.castle.io/v1/events/schema', times: 1 } end end diff --git a/yarn.lock b/yarn.lock index fce7bdd..71696d0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7,7 +7,7 @@ resolved "https://registry.yarnpkg.com/@prettier/plugin-ruby/-/plugin-ruby-4.0.4.tgz#73d85fc2a1731a3f62b57ac3116cf1c234027cb6" integrity sha512-lCpvfS/dQU5WrwN3AQ5vR8qrvj2h5gE41X08NNzAAXvHdM4zwwGRcP2sHSxfu6n6No+ljWCVx95NvJPFTTjCTg== -prettier@3.8.3: - version "3.8.3" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.8.3.tgz#560f2de55bf01b4c0503bc629d5df99b9a1d09b0" - integrity sha512-7igPTM53cGHMW8xWuVTydi2KO233VFiTNyF5hLJqpilHfmn8C8gPf+PS7dUT64YcXFbiMGZxS9pCSxL/Dxm/Jw== +prettier@3.9.6: + version "3.9.6" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.9.6.tgz#b3ea5146515d40fc53f18aa63f74dfab1e10dbf6" + integrity sha512-OpN0zzVdiaiAhxpuuj5efpIS4sY9j7bY6uR5mnj5yPzGkdkjNKSJeUThPb60Jw29QuAZgA4o+/iB49kFiaBX6g==