Skip to content
This repository
Browse code

Build in jQuery-Lint

  • Loading branch information...
commit 4dc81d31e4ea987feaa3801e2b50d4b790dd5b29 1 parent 4b77dfa
Mike Gunderloy authored January 27, 2010
3  README.textile
Source Rendered
@@ -100,7 +100,8 @@ h3. Testing Tools
100 100
 * More extra shoulda macros: @should_have_before_filter@, @should_have_after_filter@, @should_protect_from_forgery@, @should_have_helper_method@
101 101
 * "metric-fu":http://metric-fu.rubyforge.org/ for static code analysis. rake metrics:all, configure in Rakefile
102 102
 * "inaction-mailer":http://github.com/cwninja/inaction_mailer/tree/master is installed for development environment, so mails sent during dev will end up as files in /tmp/sent_mails. @rake mail:clear@ will clean out this directory. Alternatively, you can configure the template to use "MockSMTP":http://mocksmtpapp.com/ in development mode.
103  
-* "test-unit 2.0":http://test-unit.rubyforge.org/test-unit/ for nicer output.
  103
+* "test-unit 2.0":http://test-unit.rubyforge.org/test-unit/ for nicer output.      
  104
+* "jQuery-Lint":http://github.com/jamespadolsey/jQuery-Lint to keep your jQuery squeaky clean.
104 105
 
105 106
 h3. Miscellaneous
106 107
 
3  patterns/default/app/views/layouts/application.html.erb
@@ -6,7 +6,8 @@
6 6
     <title><%= h(yield(:title) || controller.action_name) %></title>
7 7
     <%= raw include_stylesheets :common, :media => 'all' %>
8 8
     <%= raw include_stylesheets :print, :media => 'print' %>
9  
-    <%= raw include_javascripts :common %>
  9
+    <%= raw include_javascripts :common %>  
  10
+    #{jquery_lint_tag}
10 11
     <!--[if IE]>
11 12
       <%= raw include_stylesheets :ie, :media => 'screen, projection' %>
12 13
     <![endif]-->
1  patterns/default/doc/README_FOR_APP
@@ -94,3 +94,4 @@ Testing Tools
94 94
 - time-warp for forcing time in tests (use pretend_now_is)
95 95
 - test_benchmark to identify slow tests (in test environment only)
96 96
 - query-trace to locate source of queries in the log (development only - turn on via config/initializers/query_trace.rb)
  97
+#{'- jQuery-Lint to keep your jQuery squeaky-clean' if javascript_library == 'jquery'}  
3  snippets/jquery/jquery_lint_tag
... ...
@@ -0,0 +1,3 @@
  1
+    <% if Rails.env.development? %>
  2
+      <%= javascript_include_tag "jquery.lint.js" %>
  3
+    <% end %>
10  templates/lark/main.rb
@@ -117,7 +117,11 @@
117 117
 file 'app/views/layouts/_flashes.html.erb', load_pattern('app/views/layouts/_flashes.html.erb', 'default', binding)
118 118
 
119 119
 footer_class = load_snippet('footer_class', design)
120  
-
  120
+  
  121
+jquery_lint_tag = ''
  122
+if javascript_library == 'jquery'
  123
+  jquery_lint_tag = load_snippet('jquery_lint_tag', 'jquery')
  124
+end
121 125
 file 'app/views/layouts/application.html.erb', load_pattern('app/views/layouts/application.html.erb', 'default', binding)
122 126
 
123 127
 # rakefile for use with inaction_mailer
@@ -195,7 +199,9 @@
195 199
   download('http://jqueryui.com/download/jquery-ui-1.7.2.custom.zip', 'public/javascripts/jquery-ui-1.7.2.custom.zip') 
196 200
   # there's got to be an easier way...
197 201
   system('cd public/javascripts/ && unzip jquery-ui-1.7.2.custom.zip development-bundle/ui/jquery-ui-1.7.2.custom.js && mv development-bundle/ui/jquery-ui-1.7.2.custom.js jquery-ui-1.7.2.custom.js && rm jquery-ui-1.7.2.custom.zip && rm -Rf development-bundle && cd ../.. ')
198  
-
  202
+  
  203
+  file_from_repo "jamespadolsey", "jQuery-Lint", "master", "jquery.lint.js", "public/javascripts/jquery.lint.js"
  204
+  
199 205
   commit_state "added jQuery"
200 206
 end
201 207
 

0 notes on commit 4dc81d3

Please sign in to comment.
Something went wrong with that request. Please try again.