Skip to content

Commit ada8568

Browse files
committed
Update pbbuilder and fix show_exceptions? errors.
1 parent ee18000 commit ada8568

File tree

7 files changed

+30
-11
lines changed

7 files changed

+30
-11
lines changed

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.3.0
1+
3.3.3

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ source "https://rubygems.org"
66
gemspec
77

88
gem "sqlite3"
9-
gem "pbbuilder"
9+
gem "pbbuilder", github: "cheddar-me/pbbuilder", branch: "use-system-basic-object"
1010
gem "standard"
1111
gem "pry"
1212

Rakefile

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,27 @@ require "rake/testtask"
66

77
Rake::TestTask.new(:test) do |t|
88
t.libs << "test"
9-
t.pattern = "test/**/*_test.rb"
10-
t.verbose = false
9+
t.libs << "lib"
10+
11+
# Running specific tests with line numbers, like with rails test, is not supported by default in rake.
12+
# By setting the TESTOPS env var we can however specify the name of a single test with underscores instead of spaces.
13+
# So run your single test by calling for ex:
14+
#
15+
# rake test /Users/sebastian/projects/cheddar/rails-twirp/test/ping_controller_test.rb "uncaught errors should bubble up to the test"
16+
17+
file_name = ARGV[1]
18+
test_name = ARGV[2]&.tr(" ", "_")
19+
20+
ENV["TESTOPTS"] = "--verbose"
21+
22+
t.test_files = if file_name
23+
if test_name
24+
ENV["TESTOPTS"] = ENV["TESTOPTS"] + " --name=#{test_name}"
25+
end
26+
[file_name]
27+
else
28+
FileList["test/**/*_test.rb"]
29+
end
1130
end
1231

1332
task default: :test

lib/rails_twirp/exception_handling.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def process_action(*)
2020
# 1. When we 'show exceptions' we make the exception bubble up—this is useful for testing
2121
# If the exception gets raised here error reporting will happen in the middleware of the APM package
2222
# higher in the call stack.
23-
raise e unless http_request.show_exceptions?
23+
raise e unless http_request.get_header("action_dispatch.show_exceptions")
2424

2525
# 2. We report the error to the error tracking service, this needs to be configured.
2626
RailsTwirp.unhandled_exception_handler&.call(e)

lib/rails_twirp/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module RailsTwirp
4-
VERSION = "0.16"
4+
VERSION = "0.17"
55
end

rails_twirp.gemspec

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@ Gem::Specification.new do |spec|
1313

1414
spec.files = `git ls-files`.split("\n")
1515

16-
# Rails has shipped an incompatible change in ActiveView, that was reverted in later versions
17-
# but at this time has not been released as a 7.x version
18-
# @see https://github.com/rails/rails/pull/51023
19-
spec.add_runtime_dependency "rails", ">= 6.1.3", " < 7.1"
20-
spec.add_runtime_dependency "twirp", ">= 1.9", "< 1.11"
16+
spec.add_runtime_dependency "rails", ">= 6.1.3", "!= 7.1"
17+
spec.add_runtime_dependency "twirp", ">= 1.9"
18+
spec.add_development_dependency "pry"
19+
2120
spec.required_ruby_version = ">= 3"
2221
end

test/test_helper.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
ActiveRecord::Migrator.migrations_paths = [File.expand_path("../test/dummy/db/migrate", __dir__)]
88
require "rails/test_help"
99
require "rails/test_unit/reporter"
10+
require "pry"
1011
Rails::TestUnitReporter.executable = "bin/test"
1112

1213
# Load fixtures from the engine

0 commit comments

Comments
 (0)