def update_source!(source)
      # e.g. /\[%\s+javascript\s+((\S+)\s?(\S+))\s+%\]/
      regex = /
        #{Regexp.escape options[:src_pre]}
        \s+#{type.to_s.singularize}
        \s+((\S+)\s?(\S+))\s+
        #{Regexp.escape options[:src_post]}
      /x
      source.gsub! regex do
        if Regexp.last_match[2] == options[:inline]
          assets[Regexp.last_match[3]].to_s
        else
          asset = write Regexp.last_match[1]

          # @todo Raise warning or error if asset not found.
          p "asset not found: #{Regexp.last_match[1]}" && next if asset.nil?

          "#{options[:cdn]}#{format_path asset}"
        end
      end
      true
    end
def update_source!(source)
      # e.g. /\[%\s+javascript\s+((\S+)\s?(\S+))\s+%\]/
      regex = /
        #{Regexp.escape options[:src_pre]}
        \s+#{type.to_s.singularize}
        \s+((\S+)\s?(\S+))\s+
        #{Regexp.escape options[:src_post]}
      /x
      source.gsub! regex do
        if Regexp.last_match[2] == options[:inline]
          assets[Regexp.last_match[3]].to_s
        else
          asset = write Regexp.last_match[1]

          # @todo Raise warning or error if asset not found.
          p "asset not found: #{Regexp.last_match[1]}" && next if asset.nil?

          "#{options[:cdn]}#{format_path asset}"
        end
      end
      true
    end
(see #update_source)
 @note this modifies the `source` `String` in place