Skip to content

Commit 4ceed83

Browse files
authored
Merge pull request sinatra#1520 from sinatra/fix-1507
ignore bundler/inline from callers
2 parents cb4f651 + 932665f commit 4ceed83

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lib/sinatra/base.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1168,7 +1168,7 @@ class << self
11681168
/^\(.*\)$/, # generated code
11691169
/rubygems\/(custom|core_ext\/kernel)_require\.rb$/, # rubygems require hacks
11701170
/active_support/, # active_support require hacks
1171-
/bundler(\/runtime)?\.rb/, # bundler require hacks
1171+
/bundler(\/(?:runtime|inline))?\.rb/, # bundler require hacks
11721172
/<internal:/, # internal in ruby >= 1.9.2
11731173
/src\/kernel\/bootstrap\/[A-Z]/ # maglev kernel files
11741174
]

test/settings_test.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,12 @@ def foo=(value)
186186
@base.enable :methodoverride
187187
assert @base.methodoverride?
188188
end
189+
190+
it 'ignores bundler/inline from callers' do
191+
@application.stub(:caller, ->(_){ ['/path/to/bundler/inline.rb', $0] }) do
192+
assert_equal File.expand_path($0), File.expand_path(@application.send(:caller_files).first)
193+
end
194+
end
189195
end
190196

191197
describe 'run' do

0 commit comments

Comments
 (0)