Navigation Menu

Skip to content

Commit

Permalink
moved all of the CSS & JS into the asset pipeline and simplified the …
Browse files Browse the repository at this point in the history
…spec runner ERB
  • Loading branch information
searls committed Aug 31, 2011
1 parent d3c7fbe commit 3880c8d
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 27 deletions.
1 change: 1 addition & 0 deletions app/assets/javascripts/jasmine_rails/application.js.erb
Expand Up @@ -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'

Expand Down
13 changes: 13 additions & 0 deletions app/assets/javascripts/jasmine_rails/jasmine_libs.js.erb
@@ -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
%>
13 changes: 13 additions & 0 deletions app/assets/stylesheets/jasmine_rails/application.css.erb
@@ -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
%>
Expand Up @@ -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
%>
26 changes: 2 additions & 24 deletions app/views/layouts/jasmine_rails/spec_runner.html.erb
@@ -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">
Expand Down Expand Up @@ -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>
Expand Down

0 comments on commit 3880c8d

Please sign in to comment.