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

Make plugin :tmp_restart behavior correct in Windows. #905

Merged
merged 1 commit into from Feb 26, 2016
Merged
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
15 changes: 14 additions & 1 deletion lib/puma/plugin.rb
Expand Up @@ -58,8 +58,21 @@ def find(name)
Plugins = PluginRegistry.new

class Plugin
# Matches
# "C:/Ruby22/lib/ruby/gems/2.2.0/gems/puma-3.0.1/lib/puma/plugin/tmp_restart.rb:3:in `<top (required)>'"
# AS
# C:/Ruby22/lib/ruby/gems/2.2.0/gems/puma-3.0.1/lib/puma/plugin/tmp_restart.rb
CALLER_FILE = /
\A # start of string
.+ # file path (one or more characters)
(?= # stop previous match when
:\d+ # a colon is followed by one or more digits
:in # followed by a colon followed by in
)
/x

def self.extract_name(ary)
path = ary.first.split(":").first
path = ary.first[CALLER_FILE]

m = %r!puma/plugin/([^/]*)\.rb$!.match(path)
return m[1]
Expand Down