Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds Ruby 3.2 to the CI matrix #543

Merged
merged 4 commits into from
Mar 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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