From c83223f7ffb72f3731dc561821c01e10d559c494 Mon Sep 17 00:00:00 2001 From: Taketo Takashima Date: Tue, 2 Jan 2024 09:10:07 +0900 Subject: [PATCH] Add Ruby 3.3 gem to CI (#603) * Add ruby 3.3 to CI * Fix rubocop --- .github/workflows/ci.yml | 2 +- Guardfile | 2 +- lib/mini_profiler/config.rb | 2 ++ lib/mini_profiler/snapshots_transporter.rb | 2 ++ lib/mini_profiler/storage/file_store.rb | 2 -- lib/mini_profiler/timer_struct/base.rb | 1 - lib/mini_profiler/views.rb | 2 +- 7 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 73ebe037..3ceecffc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: strategy: fail-fast: false matrix: - ruby: ["3.2", "3.1", "3.0", "2.7"] + ruby: ["3.3", "3.2", "3.1", "3.0", "2.7"] redis: ["5.x"] steps: - uses: actions/checkout@v3 diff --git a/Guardfile b/Guardfile index fc722665..f737f1e3 100644 --- a/Guardfile +++ b/Guardfile @@ -3,7 +3,7 @@ # More info at https://github.com/guard/guard#readme directories %w(lib spec) \ - .select { |d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist") } + .select { |d| Dir.exist?(d) ? d : UI.warning("Directory #{d} does not exist") } ## Note: if you are using the `directories` clause above and you are not ## watching the project directory ('.'), then you will want to move diff --git a/lib/mini_profiler/config.rb b/lib/mini_profiler/config.rb index f7a4d281..737399a0 100644 --- a/lib/mini_profiler/config.rb +++ b/lib/mini_profiler/config.rb @@ -97,7 +97,9 @@ def self.default # redefined - since the accessor defines it first undef :authorization_mode= + # rubocop:disable Lint/DuplicateMethods def authorization_mode=(mode) + # rubocop:enable Lint/DuplicateMethods if mode == :whitelist warn "[DEPRECATION] `:whitelist` authorization mode is deprecated. Please use `:allow_authorized` instead." diff --git a/lib/mini_profiler/snapshots_transporter.rb b/lib/mini_profiler/snapshots_transporter.rb index ee8537da..1d7160c4 100644 --- a/lib/mini_profiler/snapshots_transporter.rb +++ b/lib/mini_profiler/snapshots_transporter.rb @@ -9,9 +9,11 @@ class << self def transported_snapshots_count @@transported_snapshots_count end + def successful_http_requests_count @@successful_http_requests_count end + def failed_http_requests_count @@failed_http_requests_count end diff --git a/lib/mini_profiler/storage/file_store.rb b/lib/mini_profiler/storage/file_store.rb index 938f7153..b62ba2e1 100644 --- a/lib/mini_profiler/storage/file_store.rb +++ b/lib/mini_profiler/storage/file_store.rb @@ -91,8 +91,6 @@ def initialize(args = nil) end at_exit { t[:should_exit] = true } - - t end def save(page_struct) diff --git a/lib/mini_profiler/timer_struct/base.rb b/lib/mini_profiler/timer_struct/base.rb index 15a46982..508a0c3b 100644 --- a/lib/mini_profiler/timer_struct/base.rb +++ b/lib/mini_profiler/timer_struct/base.rb @@ -22,7 +22,6 @@ def [](name) def []=(name, val) attributes[name] = val - self end def to_json(*a) diff --git a/lib/mini_profiler/views.rb b/lib/mini_profiler/views.rb index bd27edb5..f5754b01 100644 --- a/lib/mini_profiler/views.rb +++ b/lib/mini_profiler/views.rb @@ -77,7 +77,7 @@ def get_profile_script(env) script = ::File.read(::File.expand_path('../html/profile_handler.js', ::File.dirname(__FILE__))) # replace the variables settings.each do |k, v| - regex = Regexp.new("\\{#{k.to_s}\\}") + regex = Regexp.new("\\{#{k}\\}") script.gsub!(regex, v.to_s) end