<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,15 +1,39 @@
 module Shoebox::Helpers
 
   def shoebox_scripts
-    src  = &quot;/shoebox/scripts/#{controller.controller_name}.js&quot;
-    src &lt;&lt; &quot;?#{Time.now.to_i}&quot; if Rails.env.development?
-    content_tag 'script', '', { :type =&gt; 'text/javascript', :src =&gt; src  }
+    shoebox_scripts_tag(:application) +
+    shoebox_scripts_tag(shoebox_controller)
   end
 
   def shoebox_styles(media = :screen)
-    href  = &quot;/shoebox/styles/#{controller.controller_name}/#{media}.css&quot;
-    href &lt;&lt; &quot;?#{Time.now.to_i}&quot; if Rails.env.development?
-    tag 'link', { :rel =&gt; 'stylesheet', :href =&gt; href, :media =&gt; media }
+    shoebox_styles_tag(:application, media) +
+    shoebox_styles_tag(shoebox_controller, media)
   end
-  
-end
\ No newline at end of file
+
+  def shoebox_scripts_tag(controller)
+    src = shoebox_scripts_uri(controller)
+    %{ &lt;script type=&quot;text/javascript&quot; src=&quot;#{src}&quot;&gt;&lt;/script&gt; }
+  end
+
+  def shoebox_styles_tag(controller, media)
+    href = shoebox_styles_uri(controller, media)
+    %{ &lt;link rel=&quot;stylesheet&quot; media=&quot;#{media}&quot; href=&quot;#{href}&quot; /&gt; }
+  end
+
+  def shoebox_scripts_uri(controller)
+    src  = &quot;/shoebox/scripts/#{controller}.js&quot;
+    src += &quot;?#{Time.now.to_i}&quot; if Rails.env.development?
+    src
+  end
+
+  def shoebox_styles_uri(controller, media)
+    src  = &quot;/shoebox/styles/#{controller}/#{media}.css&quot;
+    src += &quot;?#{Time.now.to_i}&quot; if Rails.env.development?
+    src
+  end
+
+  def shoebox_controller
+    controller.controller_name
+  end
+
+end</diff>
      <filename>lib/shoebox/helpers.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,17 +5,14 @@ describe Shoebox::Helpers do
   before(:each) do
     @object = Object.new
     @object.extend Shoebox::Helpers
-    controller = mock
-    controller.should_receive(:controller_name).and_return('users')
-    @object.should_receive(:controller).and_return(controller)
   end
 
   describe 'with #shoebox_scripts' do
 
     it 'should render appropriately' do
-      src = '/shoebox/scripts/users.js'
-      @object.should_receive(:content_tag).with('script', '', hash_including(:src =&gt; src))
-      @object.shoebox_scripts
+      @object.stub(:shoebox_controller).and_return('users')
+      @object.shoebox_scripts.should include('/shoebox/scripts/application.js')
+      @object.shoebox_scripts.should include('/shoebox/scripts/users.js')
     end
 
   end
@@ -23,15 +20,14 @@ describe Shoebox::Helpers do
   describe 'with #shoebox_styles' do
 
     it 'should render appropriately' do
-      href = '/shoebox/styles/users/screen.css'
-      @object.should_receive(:tag).with('link', hash_including(:href =&gt; href))
-      @object.shoebox_styles
+      @object.stub(:shoebox_controller).and_return('users')
+      @object.shoebox_styles.should include('/shoebox/styles/application/screen.css')
+      @object.shoebox_styles.should include('/shoebox/styles/users/screen.css')
     end
 
     it 'should take media type as an arg' do
-      href = '/shoebox/styles/users/print.css'
-      @object.should_receive(:tag).with('link', hash_including(:href =&gt; href))
-      @object.shoebox_styles(:print)
+      @object.stub(:shoebox_controller).and_return('users')
+      @object.shoebox_styles(:print).should include('/shoebox/styles/users/print.css')
     end
 
   end</diff>
      <filename>spec/shoebox/helpers_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>f46cf68186330058cc20b5a8ca5a8449c6868c5b</id>
    </parent>
  </parents>
  <author>
    <name>David Dollar</name>
    <email>ddollar@gmail.com</email>
  </author>
  <url>http://github.com/ddollar/shoebox/commit/3899fde2123baca5983c63be07b0ebf003173279</url>
  <id>3899fde2123baca5983c63be07b0ebf003173279</id>
  <committed-date>2009-06-23T14:12:24-07:00</committed-date>
  <authored-date>2009-06-23T14:12:24-07:00</authored-date>
  <message>split application styles/scripts into a separate file to allow for better cache hits</message>
  <tree>3a88444ed1d2338bc175e6df90ef225b20f7f28b</tree>
  <committer>
    <name>David Dollar</name>
    <email>ddollar@gmail.com</email>
  </committer>
</commit>
