Skip to content

Commit

Permalink
Adds Ruby 3.2 to the CI matrix (#543)
Browse files Browse the repository at this point in the history
* Adds Ruby 3.2 to the CI matrix. Updates checkout action version.

* Switch 127.0.0.1 to localhost so specs pass.

* Address lints.  Disable context wording

* Fix lint.
  • Loading branch information
petergoldstein committed Mar 28, 2023
1 parent 457d8b2 commit e1d1762
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Expand Up @@ -22,10 +22,10 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ["3.1", "3.0", "2.7", "2.6"]
ruby: ["3.2", "3.1", "3.0", "2.7", "2.6"]
redis: ["5.x"]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
Expand Down
3 changes: 3 additions & 0 deletions .rubocop.yml
@@ -1,6 +1,9 @@
inherit_gem:
rubocop-discourse: default.yml

RSpec/ContextWording:
Enabled: false

RSpec/MessageSpies:
Enabled: false

Expand Down
12 changes: 6 additions & 6 deletions lib/mini_profiler/profiler.rb
Expand Up @@ -347,12 +347,7 @@ def call(env)
env['HTTP_ACCEPT_ENCODING'] = 'identity' if config.suppress_encoding

if query_string =~ /pp=(async-)?flamegraph/ || env['HTTP_REFERER'] =~ /pp=async-flamegraph/
unless defined?(StackProf) && StackProf.respond_to?(:run)
headers = { 'Content-Type' => 'text/html' }
message = "Please install the stackprof gem and require it: add gem 'stackprof' to your Gemfile"
body.close if body.respond_to? :close
return client_settings.handle_cookie([500, headers, message])
else
if defined?(StackProf) && StackProf.respond_to?(:run)
# do not sully our profile with mini profiler timings
current.measure = false
match_data = query_string.match(/flamegraph_sample_rate=([\d\.]+)/)
Expand All @@ -379,6 +374,11 @@ def call(env)
) do
status, headers, body = @app.call(env)
end
else
headers = { 'Content-Type' => 'text/html' }
message = "Please install the stackprof gem and require it: add gem 'stackprof' to your Gemfile"
body.close if body.respond_to? :close
return client_settings.handle_cookie([500, headers, message])
end
elsif path == '/rack-mini-profiler/requests'
blank_page_html = <<~HTML
Expand Down
4 changes: 2 additions & 2 deletions spec/lib/profiler_spec.rb
Expand Up @@ -100,7 +100,7 @@ def self.bar(baz, boo)
end

describe 'typical usage' do
before(:all) do
before do
start = Process.clock_gettime(Process::CLOCK_MONOTONIC)
clock_set(start)
Rack::MiniProfiler.create_current
Expand All @@ -122,7 +122,7 @@ def self.bar(baz, boo)
@inner = @outer.children[0]
end

after(:all) do
after do
clock_back_to_normal
end

Expand Down
2 changes: 1 addition & 1 deletion spec/lib/storage/redis_store_spec.rb
Expand Up @@ -153,7 +153,7 @@
describe 'diagnostics' do
it "returns useful info" do
res = store.diagnostics('a')
expected = "Redis prefix: MPRedisStore\nRedis location: 127.0.0.1:6379 db: 2\nunviewed_ids: []\n"
expected = "Redis prefix: MPRedisStore\nRedis location: localhost:6379 db: 2\nunviewed_ids: []\n"
expect(res).to eq(expected)
end
end
Expand Down

0 comments on commit e1d1762

Please sign in to comment.