def substitute_relative_path_in_src_line(line, script_src, host_url, page_parent_url)
      unless script_src =~ /^["']?http:/
        host_url.slice!(-1) if ends_with?(host_url, "/")
        if script_src =~ /^\s*\// # absolute_path
          line.gsub!(script_src, "#{host_url}#{script_src}")
        else #relative_path
          line.gsub!(script_src, "#{page_parent_url}#{script_src}")
        end
      end
    end
def substitute_relative_path_in_src_line(line, script_src, host_url, page_parent_url)
      unless script_src =~ /^["']?http:/
        host_url.slice!(-1) if ends_with?(host_url, "/")
        if script_src =~ /^\s*\// # absolute_path
          line.gsub!(script_src, "#{host_url}#{script_src}")
        else #relative_path
          line.gsub!(script_src, "#{page_parent_url}#{script_src}")
        end
      end
    end
substut