class Puma::Plugin
Constants
- CALLER_FILE
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
Public Class Methods
create(&blk)
click to toggle source
# File lib/puma/plugin.rb, line 97 def self.create(&blk) name = extract_name(caller) cls = Class.new(self) cls.class_eval(&blk) Plugins.register name, cls end
extract_name(ary)
click to toggle source
# File lib/puma/plugin.rb, line 90 def self.extract_name(ary) path = ary.first[CALLER_FILE] m = %r!puma/plugin/([^/]*)\.rb$!.match(path) m[1] end
Public Instance Methods
in_background(&blk)
click to toggle source
# File lib/puma/plugin.rb, line 107 def in_background(&blk) Plugins.add_background blk end