Permalink
Browse files

moved all of the CSS & JS into the asset pipeline and simplified the …

…spec runner ERB
  • Loading branch information...
searls committed Aug 31, 2011
1 parent d3c7fbe commit 3880c8da382fcecd1bd58a968ff8c026eada6066
@@ -4,6 +4,7 @@
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
+//= require jasmine_rails/jasmine_libs
<%
require 'jasmine'
@@ -0,0 +1,13 @@
+// This is a manifest file that'll be compiled into including all the files listed below.
+// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
+// be included in the compiled file accessible from http://example.com/assets/application.js
+// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
+// the compiled file.
+//
+<%
+require 'jasmine-core'
+
+Jasmine::Core.js_files.map do |f|
+ require_asset "/#{Jasmine::Core.path}/#{f}"
+end
+%>
@@ -0,0 +1,13 @@
+/*
+ * This is a manifest file that'll automatically include all the stylesheets available in this directory
+ * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
+ * the top of the compiled file, but it's generally better to create a new file per style scope.
+ *= require jasmine_rails/jasmine_libs
+*/
+<%
+require 'jasmine'
+
+Jasmine::Config.new.css_files.each do |f|
+ require_asset "#{Rails.root}#{f}"
+end
+%>
@@ -2,6 +2,11 @@
* This is a manifest file that'll automatically include all the stylesheets available in this directory
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
* the top of the compiled file, but it's generally better to create a new file per style scope.
- *= require_self
- *= require_tree .
-*/
+*/
+<%
+require 'jasmine'
+
+Jasmine::Core.css_files.each do |f|
+ require_asset "/#{Jasmine::Core.path}/#{f}"
+end
+%>
@@ -1,26 +1,12 @@
-<%
-#This file is a controlled mess to provide a page you can load with your browser when
-# JHW doesn't provide sufficient console feedback.
-# at some point the jasmine-gem will support Rails 3.1 / assets / Coffee.
-# see this thread on the jasmine group: http://groups.google.com/group/jasmine-js/browse_thread/thread/c9c30854ecfd915d
-require 'jasmine-core'
-require 'jasmine'
-%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type"/>
<title>Jasmine suite</title>
<link rel="shortcut icon" type="image/png" href="<%=url_for%>__JASMINE_ROOT__/images/jasmine_favicon.png">
-
- <!-- jasmine -->
- <% Jasmine::Core.css_files.each do |f| %>
- <%= stylesheet_link_tag url_for+"lib/css/"+f %>
- <% end %>
- <% Jasmine::Core.js_files.map do |f| %>
- <%= javascript_include_tag url_for+"lib/js/"+f %>
- <% end %>
+ <%= stylesheet_link_tag "jasmine_rails/application" %>
+ <%= javascript_include_tag "jasmine_rails/application" %>
<!-- executing jasmine's runner -->
<script type="text/javascript">
@@ -53,14 +39,6 @@ require 'jasmine'
})();
</script>
-
- <!-- user's css -->
- <% Jasmine::Config.new.css_files.each do |f| %>
- <%= stylesheet_link_tag url_for+"css"+f%>
- <% end %>
-
- <!-- user's sources -->
- <%= javascript_include_tag "jasmine_rails/application" %>
</head>
<body>
<div id="jasmine_content"></div>

0 comments on commit 3880c8d

Please sign in to comment.