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

ignore bundler/inline from callers #1520

Merged
merged 1 commit into from Feb 5, 2019
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
2 changes: 1 addition & 1 deletion lib/sinatra/base.rb
Expand Up @@ -1168,7 +1168,7 @@ class << self
/^\(.*\)$/, # generated code
/rubygems\/(custom|core_ext\/kernel)_require\.rb$/, # rubygems require hacks
/active_support/, # active_support require hacks
/bundler(\/runtime)?\.rb/, # bundler require hacks
/bundler(\/(?:runtime|inline))?\.rb/, # bundler require hacks
/<internal:/, # internal in ruby >= 1.9.2
/src\/kernel\/bootstrap\/[A-Z]/ # maglev kernel files
]
Expand Down
6 changes: 6 additions & 0 deletions test/settings_test.rb
Expand Up @@ -186,6 +186,12 @@ def foo=(value)
@base.enable :methodoverride
assert @base.methodoverride?
end

it 'ignores bundler/inline from callers' do
@application.stub(:caller, ->(_){ ['/path/to/bundler/inline.rb', $0] }) do
assert_equal File.expand_path($0), File.expand_path(@application.send(:caller_files).first)
end
end
end

describe 'run' do
Expand Down