vendor/bundle/ruby/2.6.0/gems/lumberjack-1.2.8/lib/lumberjack/template.rb
def compile(template) #:nodoc:
      tag_vars = []
      template = template.gsub(PLACEHOLDER_PATTERN) do |match|
        var_name = match.sub("{", "").sub("}", "")
        position = TEMPLATE_ARGUMENT_ORDER.index(var_name)
        if position
          "%#{position + 1}$s"
        else
          tag_vars << var_name[1, var_name.length]
          "%#{TEMPLATE_ARGUMENT_ORDER.size + tag_vars.size}$s"
        end
      end
      [template, tag_vars]
    end
# Compile the template string into a value that can be used with sprintf.
Compile the template string into a value that can be used with sprintf.
Compile the template string into a value that can be used with sprintf .
def compile(template) 
      tag_vars = []
      template = template.gsub(PLACEHOLDER_PATTERN) do |match|
        var_name = match.sub("{", "").sub("}", "")
        position = TEMPLATE_ARGUMENT_ORDER.index(var_name)
        if position
          "%#{position + 1}$s"
        else
          tag_vars << var_name[1, var_name.length]
          "%#{TEMPLATE_ARGUMENT_ORDER.size + tag_vars.size}$s"
        end
      end
      [template, tag_vars]
    end
def compile ( template ) tag_vars = [ ] template = template . gsub ( PLACEHOLDER_PATTERN ) do | match | var_name = match . sub ( "{" , "" ) . sub ( "}" , "" ) position = TEMPLATE_ARGUMENT_ORDER . index ( var_name ) if position "%#{position + 1}$s" else tag_vars << var_name [ 1 , var_name . length ] "%#{TEMPLATE_ARGUMENT_ORDER.size + tag_vars.size}$s" end end [ template , tag_vars ] end
Compile the template string into a value that can be used with sprintf.
Compile the template string into a value that can be used with sprintf .
#:nodoc:
template