Sha256: fbfb3669d1e7c4d3f90560f3687a16c000c9f29a3c97283eb16aef435c09c832

Contents?: true

Size: 1.23 KB

Versions: 1

Compression:

Stored size: 1.23 KB

Contents

module JsSpec
  module Resources
    class SpecRunner
      def get(request, response)
        guid = (request && request['guid']) || 'null';
        html = <<-HTML
        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
        <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ko">
        <head>
        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
        <title>JSSpec results</title>
        <link rel="stylesheet" type="text/css" href="/core/JSSpec.css" />
        <script type="text/javascript" src="/core/diff_match_patch.js"></script>
        <script type="text/javascript" src="/core/JSSpec.js"></script>
        <script type="text/javascript" src="/core/jquery.js"></script>
        <script type="text/javascript" src="/core/JSSpecExtensions.js"></script>
        HTML
        spec_files.each do |file|
          html << %{<script type="text/javascript" src="#{file.relative_path}"></script>\n}
        end

        html << <<-HTML
        <script type="text/javascript">
          JSSpec.guid = '#{guid}';
        </script>
        </head>
        <body></body>
        </html>
        HTML
        response.body = html.gsub(/^        /, "")
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
js_spec-0.2.0 lib/js_spec/resources/spec_runner.rb