Skip to content

Commit

Permalink
Merge pull request #1520 from sinatra/fix-1507
Browse files Browse the repository at this point in the history
ignore bundler/inline from callers
  • Loading branch information
namusyaka committed Feb 5, 2019
2 parents cb4f651 + 932665f commit 4ceed83
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
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

0 comments on commit 4ceed83

Please sign in to comment.