[DRE-commits] [ruby-sprockets-rails] 01/05: Imported Upstream version 2.0.0

Hleb Valoshka tsfgnu-guest at alioth.debian.org
Sat Oct 12 21:38:26 UTC 2013


This is an automated email from the git hooks/post-receive script.

tsfgnu-guest pushed a commit to branch master
in repository ruby-sprockets-rails.

commit be62511d52b20701448da350cdbfd17a8152d6b8
Author: Hleb Valoshka <375GNU at Gmail.COM>
Date:   Sat Oct 12 23:00:24 2013 +0300

    Imported Upstream version 2.0.0
---
 MIT-LICENSE                                    |   20 -
 README.md                                      |  155 +++++++
 README.rdoc                                    |    3 -
 Rakefile                                       |   24 --
 checksums.yaml.gz                              |  Bin 0 -> 269 bytes
 lib/sprockets-rails.rb                         |    7 -
 lib/sprockets/rails.rb                         |    3 +
 lib/sprockets/rails/bootstrap.rb               |   41 --
 lib/sprockets/rails/compressors.rb             |   87 ----
 lib/sprockets/rails/helper.rb                  |  145 +++++++
 lib/sprockets/rails/helpers.rb                 |    8 -
 lib/sprockets/rails/helpers/isolated_helper.rb |   15 -
 lib/sprockets/rails/helpers/rails_helper.rb    |  169 --------
 lib/sprockets/rails/legacy_asset_tag_helper.rb |   32 ++
 lib/sprockets/rails/legacy_asset_url_helper.rb |  130 ++++++
 lib/sprockets/rails/railtie.rb                 |   64 ---
 lib/sprockets/rails/static_compiler.rb         |   64 ---
 lib/sprockets/rails/task.rb                    |   82 ++++
 lib/sprockets/rails/version.rb                 |    5 -
 lib/sprockets/railtie.rb                       |  125 ++++++
 lib/tasks/assets.rake                          |  105 -----
 metadata.yml                                   |  131 +++---
 test/abstract_unit.rb                          |  145 -------
 test/assets_debugging_test.rb                  |   65 ---
 test/assets_test.rb                            |  532 ------------------------
 test/fixtures/alternate/stylesheets/style.css  |    1 -
 test/fixtures/app/images/logo.png              |  Bin 6646 -> 0 bytes
 test/fixtures/app/javascripts/application.js   |    1 -
 test/fixtures/app/stylesheets/application.css  |    1 -
 test/sprockets_compressors_test.rb             |   27 --
 test/sprockets_helper_test.rb                  |  345 ---------------
 test/sprockets_helper_with_routes_test.rb      |   60 ---
 test/test_helper.rb                            |   84 ----
 33 files changed, 723 insertions(+), 1953 deletions(-)

diff --git a/MIT-LICENSE b/MIT-LICENSE
deleted file mode 100644
index fb7fed0..0000000
--- a/MIT-LICENSE
+++ /dev/null
@@ -1,20 +0,0 @@
-Copyright (c) 2012 David Heinemeier Hansson
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..b8f4cb5
--- /dev/null
+++ b/README.md
@@ -0,0 +1,155 @@
+# Sprockets Rails
+
+Provides Sprockets implementation for Rails 4.x (and beyond) Asset Pipeline.
+
+
+## Installation
+
+``` ruby
+gem 'sprockets-rails', :require => 'sprockets/railtie'
+```
+
+Or alternatively `require 'sprockets/railtie'` in your `config/application.rb` if you have Bundler auto-require disabled.
+
+
+## Usage
+
+
+### Rake task
+
+**`rake assets:precompile`**
+
+Deployment task that compiles any assets listed in `config.assets.precompile` to `public/assets`.
+
+**`rake assets:clean`**
+
+Only removes old assets (keeps the most recent 3 copies) from `public/assets`. Useful when doing rolling deploys that may still be serving old assets while the new ones are being compiled.
+
+**`rake assets:clobber`**
+
+Nuke `public/assets` and clear the Sprockets file system cache.
+
+#### Customize
+
+If the basic tasks don't do all that you need, it's straight forward to redefine them and replace them with something more specific to your app.
+
+You can also redefine the task with the built in task generator.
+
+``` ruby
+require 'sprockets/rails/task'
+Sprockets::Rails::Task.new do |t|
+  t.environment = lambda { Rails.application.assets }
+  t.assets = %w( application.js application.css )
+  t.keep = 5
+end
+```
+
+Each asset task will invoke `assets:environment` first. By default this loads the Rails environment. You can override this task to add or remove dependencies for your specific compilation environment.
+
+Also see [Sprockest::Rails::Task](https://github.com/josh/sprockets-rails/blob/master/lib/sprockets/rails/task.rb) and [Rake::SprocketsTask](https://github.com/sstephenson/sprockets/blob/master/lib/rake/sprocketstask.rb).
+
+
+### Initializer options
+
+**`config.assets.precompile`**
+
+Add additional assets to compile on deploy. Defaults to `application.js`, `application.css` and any other non-js/css file under `app/assets`.
+
+**`config.assets.paths`**
+
+Add additional load paths to this Array. Rails includes `app/assets` and `vendor/assets` for you already. Plugins might want to add their custom paths to to this.
+
+**`config.assets.version`**
+
+Set a custom cache buster string. Changing it will cause all assets to recompile on the next build.
+
+``` ruby
+config.assets.version = 'v1'
+# after installing a new plugin, change loads paths
+config.assets.version = 'v2'
+```
+
+**`config.assets.prefix`**
+
+Defaults to `/assets`. Changes the directory to compile assets to.
+
+**`config.assets.digest`**
+
+Link to undigest asset filenames. This option will eventually go away. Unless when `compile` is disabled.
+
+**`config.assets.debug`**
+
+Enable expanded asset debugging mode. Individual files will be served to make referencing filenames in the web console easier. This feature will eventually be deprecated and replaced by Source Maps in Sprockets 3.x.
+
+**`config.assets.compile`**
+
+Enables Sprockest compile environment. If disabled, `Rails.application.assets` will be unavailable to any ActionView helpers. View helpers will depend on assets being precompiled to `public/assets` in order to link to them. You can still access the environment by directly calling `Rails.application.assets`.
+
+**`config.assets.configure`**
+
+Invokes block with environment when the environment is initialized. Allows direct access to the environment instance and lets you lazily load libraries only needed for asset compiling.
+
+``` ruby
+config.assets.configure do |env|
+  env.js_compressor  = :uglify # or :closure, :yui
+  env.css_compressor = :sass   # or :yui
+
+  require 'my_processor'
+  env.register_preprocessor 'application/javascript', MyProcessor
+
+  env.logger = Rails.logger
+
+  env.cache = ActiveSupport::Cache::FileStore.new("tmp/cache/assets")
+end
+```
+
+
+## Complementary plugins
+
+The following plugins provide some extras for the Sprockets Asset Pipeline.
+
+* [coffee-rails](https://github.com/rails/coffee-rails)
+* [sass-rails](https://github.com/rails/sass-rails)
+
+**NOTE** That these plugins are optional. The core coffee-script, sass, less, uglify, (any many more) features are built into Sprockets itself. Many of these plugins only provide generators and extra helpers. You can probably get by without them.
+
+
+## Changes from Rails 3.x
+
+* Only compiles digest filenames. Static non-digest assets should simply live in public/.
+* Unmanaged asset paths and urls fallback to linking to public/. This should make it easier to work with both compiled assets and simple static assets. As a side effect, there will never be any "asset not precompiled errors" when linking to missing assets. They will just link to a public file which may or may not exist.
+* JS and CSS compressors must be explicitly set. Magic detection has been removed to avoid loading compressors in environments where you want to avoid loading any of the asset libraries. Assign `config.assets.js_compressor = :uglify` or `config.assets.css_compressor = :sass` for the standard compressors.
+* The manifest file is now in a JSON format. Since it lives in public/ by default, the initial filename is also randomized to obfuscate public access to the resource.
+* Two cleanup tasks. `rake assets:clean` is now a safe cleanup that only removes older assets that are no longer used. While `rake assets:clobber` nukes the entire `public/assets` directory and clears your filesystem cache. The clean task allows for rolling deploys that may still be linking to an old asset while the new assets are being built.
+
+
+## Contributing
+
+Usual bundler workflow.
+
+``` shell
+$ git clone https://github.com/rails/sprockets-rails.git
+$ cd sprockets-rails/
+$ bundle install
+$ bundle exec rake test
+```
+
+[![Build Status](https://secure.travis-ci.org/rails/sprockets-rails.png)](http://travis-ci.org/rails/sprockets-rails)
+
+
+## Releases
+
+sprockets-rails 2.x will primarily target sprockets 2.x. And future versions will target the corresponding sprockets release line.
+
+The minor and patch version will be updated according to [semver](http://semver.org/).
+
+* Any new APIs or config options that don't break compatibility will be in a minor release
+* Any time the sprockets depedency is bumped, there will be a new minor release
+* Simple bug fixes will be patch releases
+
+
+## License
+
+Copyright © 2012 Joshua Peek.
+
+Released under the MIT license. See `LICENSE` for details.
diff --git a/README.rdoc b/README.rdoc
deleted file mode 100644
index c138ea5..0000000
--- a/README.rdoc
+++ /dev/null
@@ -1,3 +0,0 @@
-= sprockets-rails
-
-This project rocks and uses MIT-LICENSE.
diff --git a/Rakefile b/Rakefile
deleted file mode 100644
index c79e8c7..0000000
--- a/Rakefile
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/usr/bin/env rake
-require 'rake/testtask'
-
-namespace :test do
-  task :isolated do
-    Dir["test/assets*_test.rb"].each do |file|
-      dash_i = [
-        'test',
-        'lib',
-      ]
-      ruby "-I#{dash_i.join ':'}", file
-    end
-  end
-end
-
-Rake::TestTask.new("test:regular") do |t|
-  t.libs << 'lib'
-  t.libs << 'test'
-  t.pattern = 'test/**/sprockets*_test.rb'
-  t.verbose = true
-end
-
-task :test => ['test:isolated', 'test:regular']
-task :default => :test
diff --git a/checksums.yaml.gz b/checksums.yaml.gz
new file mode 100644
index 0000000..c8c40ee
Binary files /dev/null and b/checksums.yaml.gz differ
diff --git a/lib/sprockets-rails.rb b/lib/sprockets-rails.rb
deleted file mode 100644
index c9041f7..0000000
--- a/lib/sprockets-rails.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-require 'sprockets'
-require 'sprockets/rails/railtie'
-
-module Sprockets
-  module Rails
-  end
-end
diff --git a/lib/sprockets/rails.rb b/lib/sprockets/rails.rb
new file mode 100644
index 0000000..cf8d13d
--- /dev/null
+++ b/lib/sprockets/rails.rb
@@ -0,0 +1,3 @@
+if defined? Rails::Railtie
+  require 'sprockets/railtie'
+end
diff --git a/lib/sprockets/rails/bootstrap.rb b/lib/sprockets/rails/bootstrap.rb
deleted file mode 100644
index 8e6468a..0000000
--- a/lib/sprockets/rails/bootstrap.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-module Sprockets
-  module Rails
-    class Bootstrap
-      def initialize(app)
-        @app = app
-      end
-
-      # TODO: Get rid of config.assets.enabled
-      def run
-        app, config = @app, @app.config
-        return unless app.assets
-
-        config.assets.paths.each { |path| app.assets.append_path(path) }
-
-        if config.assets.compress
-          # temporarily hardcode default JS compressor to uglify. Soon, it will work
-          # the same as SCSS, where a default plugin sets the default.
-          unless config.assets.js_compressor == false
-            js_compressor = config.assets.js_compressor || :uglifier
-            app.assets.js_compressor = LazyCompressor.new { Sprockets::Rails::Compressors.registered_js_compressor(js_compressor) }
-          end
-
-          unless config.assets.css_compressor == false
-            css_compressor = config.assets.css_compressor
-            app.assets.css_compressor = LazyCompressor.new { Sprockets::Rails::Compressors.registered_css_compressor(css_compressor) }
-          end
-        end
-
-        if config.assets.compile
-          app.routes.prepend do
-            mount app.assets => config.assets.prefix
-          end
-        end
-
-        if config.assets.digest
-          app.assets = app.assets.index
-        end
-      end
-    end
-  end
-end
diff --git a/lib/sprockets/rails/compressors.rb b/lib/sprockets/rails/compressors.rb
deleted file mode 100644
index b638b63..0000000
--- a/lib/sprockets/rails/compressors.rb
+++ /dev/null
@@ -1,87 +0,0 @@
-module Sprockets
-  module Rails
-    module Compressors
-      extend self
-
-      @@css_compressors = {}
-      @@js_compressors = {}
-      @@default_css_compressor = nil
-      @@default_js_compressor = nil
-
-      def register_css_compressor(name, klass, options = {})
-        @@default_css_compressor = name.to_sym if options[:default] || @@default_css_compressor.nil?
-        @@css_compressors[name.to_sym] = { :klass => klass.to_s, :require => options[:require] }
-      end
-
-      def register_js_compressor(name, klass, options = {})
-        @@default_js_compressor = name.to_sym if options[:default] || @@default_js_compressor.nil?
-        @@js_compressors[name.to_sym] = { :klass => klass.to_s, :require => options[:require] }
-      end
-
-      def registered_css_compressor(name)
-        find_registered_compressor name, @@css_compressors, @@default_css_compressor
-      end
-
-      def registered_js_compressor(name)
-        find_registered_compressor name, @@js_compressors, @@default_js_compressor
-      end
-
-      # The default compressors must be registered in default plugins (ex. Sass-Rails)
-      register_css_compressor(:scss, 'Sass::Rails::Compressor', :require => 'sass/rails/compressor', :default => true)
-      register_js_compressor(:uglifier, 'Uglifier', :require => 'uglifier', :default => true)
-
-      # Automaticaly register some compressors
-      register_css_compressor(:yui, 'YUI::CssCompressor', :require => 'yui/compressor')
-      register_js_compressor(:closure, 'Closure::Compiler', :require => 'closure-compiler')
-      register_js_compressor(:yui, 'YUI::JavaScriptCompressor', :require => 'yui/compressor')
-
-      private
-
-      def find_registered_compressor(name, compressors_hash, default_compressor_name)
-        if name.respond_to?(:to_sym)
-          compressor = compressors_hash[name.to_sym] || compressors_hash[default_compressor_name]
-          require compressor[:require] if compressor[:require]
-          compressor[:klass].constantize.new
-        else
-          name
-        end
-      end
-    end
-
-    # An asset compressor which does nothing.
-    #
-    # This compressor simply returns the asset as-is, without any compression
-    # whatsoever. It is useful in development mode, when compression isn't
-    # needed but using the same asset pipeline as production is desired.
-    class NullCompressor #:nodoc:
-      def compress(content)
-        content
-      end
-    end
-
-    # An asset compressor which only initializes the underlying compression
-    # engine when needed.
-    #
-    # This postpones the initialization of the compressor until
-    # <code>#compress</code> is called the first time.
-    class LazyCompressor #:nodoc:
-      # Initializes a new LazyCompressor.
-      #
-      # The block should return a compressor when called, i.e. an object
-      # which responds to <code>#compress</code>.
-      def initialize(&block)
-        @block = block
-      end
-
-      def compress(content)
-        compressor.compress(content)
-      end
-
-      private
-
-      def compressor
-        @compressor ||= (@block.call || NullCompressor.new)
-      end
-    end
-  end
-end
diff --git a/lib/sprockets/rails/helper.rb b/lib/sprockets/rails/helper.rb
new file mode 100644
index 0000000..571cd7d
--- /dev/null
+++ b/lib/sprockets/rails/helper.rb
@@ -0,0 +1,145 @@
+require 'action_view'
+require 'sprockets'
+require 'active_support/core_ext/class/attribute'
+
+module Sprockets
+  module Rails
+    module Helper
+      if defined? ActionView::Helpers::AssetUrlHelper
+        include ActionView::Helpers::AssetUrlHelper
+      else
+        require 'sprockets/rails/legacy_asset_tag_helper'
+        require 'sprockets/rails/legacy_asset_url_helper'
+        include LegacyAssetTagHelper
+        include LegacyAssetUrlHelper
+      end
+
+      VIEW_ACCESSORS = [:assets_environment, :assets_manifest,
+                        :assets_prefix, :digest_assets, :debug_assets]
+
+      def self.included(klass)
+        if klass < Sprockets::Context
+          klass.class_eval do
+            alias_method :assets_environment, :environment
+            def assets_manifest; end
+            class_attribute :config, :assets_prefix, :digest_assets
+          end
+        else
+          klass.class_attribute(*VIEW_ACCESSORS)
+        end
+      end
+
+      def self.extended(obj)
+        obj.class_eval do
+          attr_accessor(*VIEW_ACCESSORS)
+        end
+      end
+
+      def compute_asset_path(path, options = {})
+        if digest_path = asset_digest_path(path)
+          path = digest_path if digest_assets
+          path += "?body=1" if options[:debug]
+          File.join(assets_prefix || "/", path)
+        else
+          super
+        end
+      end
+
+      # Get digest for asset path.
+      #
+      # path    - String path
+      # options - Hash options
+      #
+      # Returns String Hex digest or nil if digests are disabled.
+      def asset_digest(path, options = {})
+        return unless digest_assets
+
+        if digest_path = asset_digest_path(path, options)
+          digest_path[/-(.+)\./, 1]
+        end
+      end
+
+      # Expand asset path to digested form.
+      #
+      # path    - String path
+      # options - Hash options
+      #
+      # Returns String path or nil if no asset was found.
+      def asset_digest_path(path, options = {})
+        if manifest = assets_manifest
+          if digest_path = manifest.assets[path]
+            return digest_path
+          end
+        end
+
+        if environment = assets_environment
+          if asset = environment[path]
+            return asset.digest_path
+          end
+        end
+      end
+
+      # Override javascript tag helper to provide debugging support.
+      #
+      # Eventually will be deprecated and replaced by source maps.
+      def javascript_include_tag(*sources)
+        options = sources.extract_options!.stringify_keys
+
+        if request_debug_assets?
+          sources.map { |source|
+            if asset = lookup_asset_for_path(source, :type => :javascript)
+              asset.to_a.map do |a|
+                super(path_to_javascript(a.logical_path, :debug => true), options)
+              end
+            else
+              super(source, options)
+            end
+          }.flatten.uniq.join("\n").html_safe
+        else
+          sources.push(options)
+          super(*sources)
+        end
+      end
+
+      # Override stylesheet tag helper to provide debugging support.
+      #
+      # Eventually will be deprecated and replaced by source maps.
+      def stylesheet_link_tag(*sources)
+        options = sources.extract_options!.stringify_keys
+
+        if request_debug_assets?
+          sources.map { |source|
+            if asset = lookup_asset_for_path(source, :type => :stylesheet)
+              asset.to_a.map do |a|
+                super(path_to_stylesheet(a.logical_path, :debug => true), options)
+              end
+            else
+              super(source, options)
+            end
+          }.flatten.uniq.join("\n").html_safe
+        else
+          sources.push(options)
+          super(*sources)
+        end
+      end
+
+      protected
+        # Enable split asset debugging. Eventually will be deprecated
+        # and replaced by source maps in Sprockets 3.x.
+        def request_debug_assets?
+          debug_assets || (defined?(controller) && controller && params[:debug_assets])
+        end
+
+        # Internal method to support multifile debugging. Will
+        # eventually be removed w/ Sprockets 3.x.
+        def lookup_asset_for_path(path, options = {})
+          return unless env = assets_environment
+          path = path.to_s
+          if extname = compute_asset_extname(path, options)
+            path = "#{path}#{extname}"
+          end
+          env[path]
+        end
+    end
+  end
+end
diff --git a/lib/sprockets/rails/helpers.rb b/lib/sprockets/rails/helpers.rb
deleted file mode 100644
index b1cdcc7..0000000
--- a/lib/sprockets/rails/helpers.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-module Sprockets
-  module Rails
-    module Helpers
-      autoload :RailsHelper,    "sprockets/rails/helpers/rails_helper"
-      autoload :IsolatedHelper, "sprockets/rails/helpers/isolated_helper"
-    end
-  end
-end
diff --git a/lib/sprockets/rails/helpers/isolated_helper.rb b/lib/sprockets/rails/helpers/isolated_helper.rb
deleted file mode 100644
index 6fc565c..0000000
--- a/lib/sprockets/rails/helpers/isolated_helper.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-module Sprockets
-  module Rails
-    module Helpers
-      module IsolatedHelper
-        def controller
-          nil
-        end
-
-        def config
-          ::Rails.application.config.action_controller
-        end
-      end
-    end
-  end
-end
diff --git a/lib/sprockets/rails/helpers/rails_helper.rb b/lib/sprockets/rails/helpers/rails_helper.rb
deleted file mode 100644
index bdd580a..0000000
--- a/lib/sprockets/rails/helpers/rails_helper.rb
+++ /dev/null
@@ -1,169 +0,0 @@
-require "action_view"
-
-module Sprockets
-  module Rails
-    module Helpers
-      module RailsHelper
-        extend ActiveSupport::Concern
-        include ActionView::Helpers::AssetTagHelper
-
-        def asset_paths
-          @asset_paths ||= begin
-            paths = RailsHelper::AssetPaths.new(config, controller)
-            paths.asset_environment = asset_environment
-            paths.asset_digests     = asset_digests
-            paths.compile_assets    = compile_assets?
-            paths.digest_assets     = digest_assets?
-            paths
-          end
-        end
-
-        def javascript_include_tag(*sources)
-          options = sources.extract_options!
-          debug   = options.delete(:debug)  { debug_assets? }
-          body    = options.delete(:body)   { false }
-          digest  = options.delete(:digest) { digest_assets? }
-
-          sources.collect do |source|
-            if debug && asset = asset_paths.asset_for(source, 'js')
-              asset.to_a.map { |dep|
-                super(dep.pathname.to_s, { :src => path_to_asset(dep, :ext => 'js', :body => true, :digest => digest) }.merge!(options))
-              }
-            else
-              super(source.to_s, { :src => path_to_asset(source, :ext => 'js', :body => body, :digest => digest) }.merge!(options))
-            end
-          end.join("\n").html_safe
-        end
-
-        def stylesheet_link_tag(*sources)
-          options = sources.extract_options!
-          debug   = options.delete(:debug)  { debug_assets? }
-          body    = options.delete(:body)   { false }
-          digest  = options.delete(:digest) { digest_assets? }
-
-          sources.collect do |source|
-            if debug && asset = asset_paths.asset_for(source, 'css')
-              asset.to_a.map { |dep|
-                super(dep.pathname.to_s, { :href => path_to_asset(dep, :ext => 'css', :body => true, :protocol => :request, :digest => digest) }.merge!(options))
-              }
-            else
-              super(source.to_s, { :href => path_to_asset(source, :ext => 'css', :body => body, :protocol => :request, :digest => digest) }.merge!(options))
-            end
-          end.join("\n").html_safe
-        end
-
-        def asset_path(source, options = {})
-          source = source.logical_path if source.respond_to?(:logical_path)
-          path = asset_paths.compute_public_path(source, asset_prefix, options.merge(:body => true))
-          options[:body] ? "#{path}?body=1" : path
-        end
-        alias_method :path_to_asset, :asset_path # aliased to avoid conflicts with an asset_path named route
-
-        def image_path(source)
-          path_to_asset(source)
-        end
-        alias_method :path_to_image, :image_path # aliased to avoid conflicts with an image_path named route
-
-        def font_path(source)
-          path_to_asset(source)
-        end
-        alias_method :path_to_font, :font_path # aliased to avoid conflicts with an font_path named route
-
-        def javascript_path(source)
-          path_to_asset(source, :ext => 'js')
-        end
-        alias_method :path_to_javascript, :javascript_path # aliased to avoid conflicts with an javascript_path named route
-
-        def stylesheet_path(source)
-          path_to_asset(source, :ext => 'css')
-        end
-        alias_method :path_to_stylesheet, :stylesheet_path # aliased to avoid conflicts with an stylesheet_path named route
-
-      private
-        def debug_assets?
-          compile_assets? && (::Rails.application.config.assets.debug || params[:debug_assets])
-        rescue NameError
-          false
-        end
-
-        # Override to specify an alternative prefix for asset path generation.
-        # When combined with a custom +asset_environment+, this can be used to
-        # implement themes that can take advantage of the asset pipeline.
-        #
-        # If you only want to change where the assets are mounted, refer to
-        # +config.assets.prefix+ instead.
-        def asset_prefix
-          ::Rails.application.config.assets.prefix
-        end
-
-        def asset_digests
-          ::Rails.application.config.assets.digests
-        end
-
-        def compile_assets?
-          ::Rails.application.config.assets.compile
-        end
-
-        def digest_assets?
-          ::Rails.application.config.assets.digest
-        end
-
-        # Override to specify an alternative asset environment for asset
-        # path generation. The environment should already have been mounted
-        # at the prefix returned by +asset_prefix+.
-        def asset_environment
-          ::Rails.application.assets
-        end
-
-        class AssetPaths < ::ActionView::AssetPaths #:nodoc:
-          attr_accessor :asset_environment, :asset_prefix, :asset_digests, :compile_assets, :digest_assets
-
-          class AssetNotPrecompiledError < StandardError; end
-
-          def asset_for(source, ext)
-            source = source.to_s
-            return nil if is_uri?(source)
-            source = rewrite_extension(source, nil, ext)
-            asset_environment[source]
-          rescue Sprockets::FileOutsidePaths
-            nil
-          end
-
-          def digest_for(logical_path)
-            if digest_assets && asset_digests && (digest = asset_digests[logical_path])
-              return digest
-            end
-
-            if compile_assets
-              if digest_assets && asset = asset_environment[logical_path]
-                return asset.digest_path
-              end
-              return logical_path
-            else
-              raise AssetNotPrecompiledError.new("#{logical_path} isn't precompiled")
-            end
-          end
-
-          def rewrite_asset_path(source, dir, options = {})
-            if source[0] == ?/
-              source
-            else
-              source = digest_for(source) unless options[:digest] == false
-              source = File.join(dir, source)
-              source = "/#{source}" unless source =~ /^\//
-              source
-            end
-          end
-
-          def rewrite_extension(source, dir, ext)
-            if ext && File.extname(source) != ".#{ext}"
-              "#{source}.#{ext}"
-            else
-              source
-            end
-          end
-        end
-      end
-    end
-  end
-end
diff --git a/lib/sprockets/rails/legacy_asset_tag_helper.rb b/lib/sprockets/rails/legacy_asset_tag_helper.rb
new file mode 100644
index 0000000..9d90942
--- /dev/null
+++ b/lib/sprockets/rails/legacy_asset_tag_helper.rb
@@ -0,0 +1,32 @@
+require 'sprockets'
+
+module Sprockets
+  module Rails
+    # Backports of AssetTagHelper methods for Rails 2.x and 3.x.
+    module LegacyAssetTagHelper
+      include ActionView::Helpers::TagHelper
+
+      def javascript_include_tag(*sources)
+        options = sources.extract_options!.stringify_keys
+        sources.uniq.map { |source|
+          tag_options = {
+            "src" => path_to_javascript(source)
+          }.merge(options)
+          content_tag(:script, "", tag_options)
+        }.join("\n").html_safe
+      end
+
+      def stylesheet_link_tag(*sources)
+        options = sources.extract_options!.stringify_keys
+        sources.uniq.map { |source|
+          tag_options = {
+            "rel" => "stylesheet",
+            "media" => "screen",
+            "href" => path_to_stylesheet(source)
+          }.merge(options)
+          tag(:link, tag_options)
+        }.join("\n").html_safe
+      end
+    end
+  end
+end
diff --git a/lib/sprockets/rails/legacy_asset_url_helper.rb b/lib/sprockets/rails/legacy_asset_url_helper.rb
new file mode 100644
index 0000000..f78e8fe
--- /dev/null
+++ b/lib/sprockets/rails/legacy_asset_url_helper.rb
@@ -0,0 +1,130 @@
+require 'sprockets'
+
+module Sprockets
+  module Rails
+    # Backports of AssetUrlHelper methods for Rails 2.x and 3.x.
+    module LegacyAssetUrlHelper
+      URI_REGEXP = %r{^[-a-z]+://|^(?:cid|data):|^//}
+
+      def asset_path(source, options = {})
+        source = source.to_s
+        return "" unless source.present?
+        return source if source =~ URI_REGEXP
+
+        tail, source = source[/([\?#].+)$/], source.sub(/([\?#].+)$/, '')
+
+        if extname = compute_asset_extname(source, options)
+          source = "#{source}#{extname}"
+        end
+
+        if source[0] != ?/
+          source = compute_asset_path(source, options)
+        end
+
+        relative_url_root = (defined?(config.relative_url_root) && config.relative_url_root) ||
+          (respond_to?(:request) && request.try(:script_name))
+        if relative_url_root
+          source = "#{relative_url_root}#{source}" unless source.starts_with?("#{relative_url_root}/")
+        end
+
+        if host = compute_asset_host(source, options)
+          source = "#{host}#{source}"
+        end
+
+        "#{source}#{tail}"
+      end
+      alias_method :path_to_asset, :asset_path
+
+      ASSET_EXTENSIONS = {
+        :javascript => '.js',
+        :stylesheet => '.css'
+      }
+
+      def compute_asset_extname(source, options = {})
+        return if options[:extname] == false
+        extname = options[:extname] || ASSET_EXTENSIONS[options[:type]]
+        extname if extname && File.extname(source) != extname
+      end
+
+      ASSET_PUBLIC_DIRECTORIES = {
+        :audio      => '/audios',
+        :font       => '/fonts',
+        :image      => '/images',
+        :javascript => '/javascripts',
+        :stylesheet => '/stylesheets',
+        :video      => '/videos'
+      }
+
+      def compute_asset_path(source, options = {})
+        dir = ASSET_PUBLIC_DIRECTORIES[options[:type]] || ""
+        File.join(dir, source)
+      end
+
+      def compute_asset_host(source = "", options = {})
+        request = self.request if respond_to?(:request)
+
+        if defined? config
+          host = config.asset_host
+        elsif defined? ActionController::Base.asset_host
+          host = ActionController::Base.asset_host
+        end
+
+        host ||= request.base_url if request && options[:protocol] == :request
+        return unless host
+
+        if host.respond_to?(:call)
+          arity = host.respond_to?(:arity) ? host.arity : host.method(:call).arity
+          args = [source]
+          args << request if request && (arity > 1 || arity < 0)
+          host = host.call(*args)
+        elsif host =~ /%d/
+          host = host % (Zlib.crc32(source) % 4)
+        end
+
+        if host =~ URI_REGEXP
+          host
+        else
+          protocol = options[:protocol] || (request ? :request : :relative)
+          case protocol
+          when :relative
+            "//#{host}"
+          when :request
+            "#{request.protocol}#{host}"
+          else
+            "#{protocol}://#{host}"
+          end
+        end
+      end
+
+      def javascript_path(source, options = {})
+        path_to_asset(source, {:type => :javascript}.merge(options))
+      end
+      alias_method :path_to_javascript, :javascript_path
+
+      def stylesheet_path(source, options = {})
+        path_to_asset(source, {:type => :stylesheet}.merge(options))
+      end
+      alias_method :path_to_stylesheet, :stylesheet_path
+
+      def image_path(source, options = {})
+        path_to_asset(source, {:type => :image}.merge(options))
+      end
+      alias_method :path_to_image, :image_path
+
+      def video_path(source, options = {})
+        path_to_asset(source, {:type => :video}.merge(options))
+      end
+      alias_method :path_to_video, :video_path
+
+      def audio_path(source, options = {})
+        path_to_asset(source, {:type => :audio}.merge(options))
+      end
+      alias_method :path_to_audio, :audio_path
+
+      def font_path(source, options = {})
+        path_to_asset(source, {:type => :font}.merge(options))
+      end
+      alias_method :path_to_font, :font_path
+    end
+  end
+end
diff --git a/lib/sprockets/rails/railtie.rb b/lib/sprockets/rails/railtie.rb
deleted file mode 100644
index e375891..0000000
--- a/lib/sprockets/rails/railtie.rb
+++ /dev/null
@@ -1,64 +0,0 @@
-require "action_controller/railtie"
-
-module Sprockets
-  module Rails
-    autoload :Bootstrap,      "sprockets/rails/bootstrap"
-    autoload :Helpers,        "sprockets/rails/helpers"
-    autoload :Compressors,    "sprockets/rails/compressors"
-    autoload :LazyCompressor, "sprockets/rails/compressors"
-    autoload :NullCompressor, "sprockets/rails/compressors"
-    autoload :StaticCompiler, "sprockets/rails/static_compiler"
-
-    # TODO: Get rid of config.assets.enabled
-    class Railtie < ::Rails::Railtie
-      rake_tasks do
-        load "tasks/assets.rake"
-      end
-
-      initializer "sprockets.environment", :group => :all do |app|
-        config = app.config
-        next unless config.assets.enabled
-
-        require 'sprockets'
-
-        app.assets = Sprockets::Environment.new(app.root.to_s) do |env|
-          env.version = ::Rails.env + "-#{config.assets.version}"
-
-          if config.assets.logger != false
-            env.logger = config.assets.logger || ::Rails.logger
-          end
-
-          if config.assets.cache_store != false
-            env.cache = ActiveSupport::Cache.lookup_store(config.assets.cache_store) || ::Rails.cache
-          end
-        end
-
-        if config.assets.manifest
-          path = File.join(config.assets.manifest, "manifest.yml")
-        else
-          path = File.join(::Rails.public_path, config.assets.prefix, "manifest.yml")
-        end
-
-        if File.exist?(path)
-          config.assets.digests = YAML.load_file(path)
-        end
-
-        ActiveSupport.on_load(:action_view) do
-          include ::Sprockets::Rails::Helpers::RailsHelper
-          app.assets.context_class.instance_eval do
-            include ::Sprockets::Rails::Helpers::IsolatedHelper
-            include ::Sprockets::Rails::Helpers::RailsHelper
-          end
-        end
-      end
-
-      # We need to configure this after initialization to ensure we collect
-      # paths from all engines. This hook is invoked exactly before routes
-      # are compiled, and so that other Railties have an opportunity to
-      # register compressors.
-      config.after_initialize do |app|
-        Sprockets::Rails::Bootstrap.new(app).run
-      end
-    end
-  end
-end
diff --git a/lib/sprockets/rails/static_compiler.rb b/lib/sprockets/rails/static_compiler.rb
deleted file mode 100644
index 5b4fb3c..0000000
--- a/lib/sprockets/rails/static_compiler.rb
+++ /dev/null
@@ -1,64 +0,0 @@
-require 'fileutils'
-
-module Sprockets
-  module Rails
-    class StaticCompiler
-      attr_accessor :env, :target, :paths
-
-      def initialize(env, target, paths, options = {})
-        @env = env
-        @target = target
-        @paths = paths
-        @digest = options.fetch(:digest, true)
-        @manifest = options.fetch(:manifest, true)
-        @manifest_path = options.delete(:manifest_path) || target
-        @zip_files = options.delete(:zip_files) || /\.(?:css|html|js|svg|txt|xml)$/
-      end
-
-      def compile
-        manifest = {}
-        env.each_logical_path do |logical_path|
-          next unless compile_path?(logical_path)
-          if asset = env.find_asset(logical_path)
-            manifest[logical_path] = write_asset(asset)
-          end
-        end
-        write_manifest(manifest) if @manifest
-      end
-
-      def write_manifest(manifest)
-        FileUtils.mkdir_p(@manifest_path)
-        File.open("#{@manifest_path}/manifest.yml", 'wb') do |f|
-          YAML.dump(manifest, f)
-        end
-      end
-
-      def write_asset(asset)
-        path_for(asset).tap do |path|
-          filename = File.join(target, path)
-          FileUtils.mkdir_p File.dirname(filename)
-          asset.write_to(filename)
-          asset.write_to("#{filename}.gz") if filename.to_s =~ @zip_files
-        end
-      end
-
-      def compile_path?(logical_path)
-        paths.each do |path|
-          case path
-          when Regexp
-            return true if path.match(logical_path)
-          when Proc
-            return true if path.call(logical_path)
-          else
-            return true if File.fnmatch(path.to_s, logical_path)
-          end
-        end
-        false
-      end
-
-      def path_for(asset)
-        @digest ? asset.digest_path : asset.logical_path
-      end
-    end
-  end
-end
diff --git a/lib/sprockets/rails/task.rb b/lib/sprockets/rails/task.rb
new file mode 100644
index 0000000..cf397ca
--- /dev/null
+++ b/lib/sprockets/rails/task.rb
@@ -0,0 +1,82 @@
+require 'rake'
+require 'rake/sprocketstask'
+require 'sprockets'
+
+module Sprockets
+  module Rails
+    class Task < Rake::SprocketsTask
+      attr_accessor :app
+
+      def initialize(app = nil)
+        self.app = app
+        super()
+      end
+
+      def environment
+        if app
+          app.assets
+        else
+          super
+        end
+      end
+
+      def output
+        if app
+          File.join(app.root, 'public', app.config.assets.prefix)
+        else
+          super
+        end
+      end
+
+      def assets
+        if app
+          app.config.assets.precompile
+        else
+          super
+        end
+      end
+
+      def cache_path
+        if app
+          "#{app.config.root}/tmp/cache/assets"
+        else
+          @cache_path
+        end
+      end
+      attr_writer :cache_path
+
+      def define
+        namespace :assets do
+          # Override this task change the loaded dependencies
+          desc "Load asset compile environment"
+          task :environment do
+            # Load full Rails environment by default
+            Rake::Task['environment'].invoke
+          end
+
+          desc "Compile all the assets named in config.assets.precompile"
+          task :precompile => :environment do
+            with_logger do
+              manifest.compile(assets)
+            end
+          end
+
+          desc "Remove old compiled assets"
+          task :clean => :environment do
+            with_logger do
+              manifest.clean(keep)
+            end
+          end
+
+          desc "Remove compiled assets"
+          task :clobber => :environment do
+            with_logger do
+              manifest.clobber
+              rm_rf cache_path if cache_path
+            end
+          end
+        end
+      end
+    end
+  end
+end
diff --git a/lib/sprockets/rails/version.rb b/lib/sprockets/rails/version.rb
deleted file mode 100644
index 75846d8..0000000
--- a/lib/sprockets/rails/version.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-module Sprockets
-  module Rails
-    VERSION = "1.0.0"
-  end
-end
diff --git a/lib/sprockets/railtie.rb b/lib/sprockets/railtie.rb
new file mode 100644
index 0000000..07669a7
--- /dev/null
+++ b/lib/sprockets/railtie.rb
@@ -0,0 +1,125 @@
+require 'rails'
+require 'rails/railtie'
+require 'action_controller/railtie'
+require 'active_support/core_ext/module/remove_method'
+require 'sprockets'
+require 'sprockets/rails/helper'
+
+module Rails
+  class Application
+    # Hack: We need to remove Rails' built in config.assets so we can
+    # do our own thing.
+    class Configuration
+      remove_possible_method :assets
+    end
+
+    # Undefine Rails' assets method before redefining it, to avoid warnings.
+    remove_possible_method :assets
+    remove_possible_method :assets=
+
+    # Returns Sprockets::Environment for app config.
+    def assets
+      @assets ||= Sprockets::Environment.new(root.to_s) do |env|
+        env.version = ::Rails.env
+
+        path = "#{config.root}/tmp/cache/assets/#{::Rails.env}"
+        env.cache = Sprockets::Cache::FileStore.new(path)
+
+        env.context_class.class_eval do
+          include ::Sprockets::Rails::Helper
+        end
+      end
+    end
+    attr_writer :assets
+  end
+end
+
+module Sprockets
+  class Railtie < ::Rails::Railtie
+    LOOSE_APP_ASSETS = lambda do |path, filename|
+      filename =~ /app\/assets/ && !%w(.js .css).include?(File.extname(path))
+    end
+
+    class OrderedOptions < ActiveSupport::OrderedOptions
+      def configure(&block)
+        self._blocks << block
+      end
+    end
+
+    config.assets = OrderedOptions.new
+    config.assets._blocks    = []
+    config.assets.paths      = []
+    config.assets.prefix     = "/assets"
+    config.assets.precompile = [LOOSE_APP_ASSETS, /(?:\/|\\|\A)application\.(css|js)$/]
+    config.assets.version    = ""
+    config.assets.debug      = false
+    config.assets.compile    = true
+    config.assets.digest     = false
+
+    rake_tasks do |app|
+      require 'sprockets/rails/task'
+      Sprockets::Rails::Task.new(app)
+    end
+
+    config.after_initialize do |app|
+      config = app.config
+
+      manifest_path = File.join(app.root, 'public', config.assets.prefix)
+
+      unless config.assets.version.blank?
+        app.assets.version += "-#{config.assets.version}"
+      end
+
+      # Copy config.assets.paths to Sprockets
+      config.assets.paths.each do |path|
+        app.assets.append_path path
+      end
+
+      ActionView::Base.instance_eval do
+        include Sprockets::Rails::Helper
+
+        # Copy relevant config to AV context
+        self.debug_assets  = config.assets.debug
+        self.digest_assets = config.assets.digest
+        self.assets_prefix = config.assets.prefix
+
+        # Copy over to Sprockets as well
+        context = app.assets.context_class
+        context.assets_prefix = config.assets.prefix
+        context.digest_assets = config.assets.digest
+        context.config        = config.action_controller
+
+        if config.assets.compile
+          self.assets_environment = app.assets
+          self.assets_manifest    = Sprockets::Manifest.new(app.assets, manifest_path)
+        else
+          self.assets_manifest = Sprockets::Manifest.new(manifest_path)
+        end
+      end
+
+      app.assets.js_compressor  = config.assets.js_compressor
+      app.assets.css_compressor = config.assets.css_compressor
+
+      # Run app.assets.configure blocks
+      config.assets._blocks.each do |block|
+        block.call app.assets
+      end
+
+      # No more configuration changes at this point.
+      # With cache classes on, Sprockets won't check the FS when files
+      # change. Preferable in production when the FS only changes on
+      # deploys when the app restarts.
+      if config.cache_classes
+        app.assets = app.assets.index
+      end
+
+      if config.assets.compile
+        if app.routes.respond_to?(:prepend)
+          app.routes.prepend do
+            mount app.assets => config.assets.prefix
+          end
+        end
+      end
+    end
+  end
+end
diff --git a/lib/tasks/assets.rake b/lib/tasks/assets.rake
deleted file mode 100644
index 1ab47e3..0000000
--- a/lib/tasks/assets.rake
+++ /dev/null
@@ -1,105 +0,0 @@
-require "fileutils"
-
-namespace :assets do
-  def ruby_rake_task(task, fork = true)
-    env    = ENV['RAILS_ENV'] || 'production'
-    groups = ENV['RAILS_GROUPS'] || 'assets'
-    args   = [$0, task,"RAILS_ENV=#{env}","RAILS_GROUPS=#{groups}"]
-    args << "--trace" if Rake.application.options.trace
-    if $0 =~ /rake\.bat\Z/i
-      Kernel.exec $0, *args
-    else
-      fork ? ruby(*args) : Kernel.exec(FileUtils::RUBY, *args)
-    end
-  end
-
-  # We are currently running with no explicit bundler group
-  # and/or no explicit environment - we have to reinvoke rake to
-  # execute this task.
-  def invoke_or_reboot_rake_task(task)
-    if ENV['RAILS_GROUPS'].to_s.empty? || ENV['RAILS_ENV'].to_s.empty?
-      ruby_rake_task task
-    else
-      Rake::Task[task].invoke
-    end
-  end
-
-  desc "Compile all the assets named in config.assets.precompile"
-  task :precompile do
-    invoke_or_reboot_rake_task "assets:precompile:all"
-  end
-
-  namespace :precompile do
-    def internal_precompile(digest=nil)
-      unless ::Rails.application.config.assets.enabled
-        warn "Cannot precompile assets if sprockets is disabled. Please set config.assets.enabled to true"
-        exit
-      end
-
-      # Ensure that action view is loaded and the appropriate
-      # sprockets hooks get executed
-      _ = ActionView::Base
-
-      config = ::Rails.application.config
-      config.assets.compile = true
-      config.assets.digest  = digest unless digest.nil?
-      config.assets.digests = {}
-
-      env      = ::Rails.application.assets
-      target   = File.join(::Rails.public_path, config.assets.prefix)
-      compiler = Sprockets::Rails::StaticCompiler.new(env,
-                                                      target,
-                                                      config.assets.precompile,
-                                                      :manifest_path => config.assets.manifest,
-                                                      :digest => config.assets.digest,
-                                                      :manifest => digest.nil?)
-      compiler.compile
-    end
-
-    task :all do
-      Rake::Task["assets:precompile:primary"].invoke
-      # We need to reinvoke in order to run the secondary digestless
-      # asset compilation run - a fresh Sprockets environment is
-      # required in order to compile digestless assets as the
-      # environment has already cached the assets on the primary
-      # run.
-      ruby_rake_task("assets:precompile:nondigest", false) if ::Rails.application.config.assets.digest
-    end
-
-    task :primary => ["assets:cache:clean"] do
-      internal_precompile
-    end
-
-    task :nondigest => ["assets:cache:clean"] do
-      internal_precompile(false)
-    end
-  end
-
-  desc "Remove compiled assets"
-  task :clean do
-    invoke_or_reboot_rake_task "assets:clean:all"
-  end
-
-  namespace :clean do
-    task :all => ["assets:cache:clean"] do
-      config = ::Rails.application.config
-      public_asset_path = File.join(::Rails.public_path, config.assets.prefix)
-      rm_rf public_asset_path, :secure => true
-    end
-  end
-
-  namespace :cache do
-    task :clean => ["assets:environment"] do
-      ::Rails.application.assets.cache.clear
-    end
-  end
-
-  task :environment do
-    if ::Rails.application.config.assets.initialize_on_precompile
-      Rake::Task["environment"].invoke
-    else
-      ::Rails.application.initialize!(:assets)
-      Sprockets::Rails::Bootstrap.new(Rails.application).run
-    end
-  end
-end
diff --git a/metadata.yml b/metadata.yml
index 67bfad4..02e0cce 100644
--- a/metadata.yml
+++ b/metadata.yml
@@ -1,134 +1,105 @@
 --- !ruby/object:Gem::Specification
 name: sprockets-rails
 version: !ruby/object:Gem::Version
-  version: 1.0.0
-  prerelease: 
+  version: 2.0.0
 platform: ruby
 authors:
-- David Heinemeier Hansson
+- Joshua Peek
 autorequire: 
 bindir: bin
 cert_chain: []
-date: 2012-03-26 00:00:00.000000000 Z
+date: 2013-06-11 00:00:00.000000000 Z
 dependencies:
 - !ruby/object:Gem::Dependency
   name: sprockets
   requirement: !ruby/object:Gem::Requirement
-    none: false
     requirements:
     - - ~>
       - !ruby/object:Gem::Version
-        version: 2.3.1
+        version: '2.8'
   type: :runtime
   prerelease: false
   version_requirements: !ruby/object:Gem::Requirement
-    none: false
     requirements:
     - - ~>
       - !ruby/object:Gem::Version
-        version: 2.3.1
+        version: '2.8'
 - !ruby/object:Gem::Dependency
-  name: railties
+  name: actionpack
   requirement: !ruby/object:Gem::Requirement
-    none: false
     requirements:
-    - - ! '>='
+    - - '>='
       - !ruby/object:Gem::Version
-        version: 4.0.0.beta
-    - - <
+        version: '3.0'
+  type: :runtime
+  prerelease: false
+  version_requirements: !ruby/object:Gem::Requirement
+    requirements:
+    - - '>='
+      - !ruby/object:Gem::Version
+        version: '3.0'
+- !ruby/object:Gem::Dependency
+  name: activesupport
+  requirement: !ruby/object:Gem::Requirement
+    requirements:
+    - - '>='
       - !ruby/object:Gem::Version
-        version: '5.0'
+        version: '3.0'
   type: :runtime
   prerelease: false
   version_requirements: !ruby/object:Gem::Requirement
-    none: false
     requirements:
-    - - ! '>='
+    - - '>='
       - !ruby/object:Gem::Version
-        version: 4.0.0.beta
-    - - <
+        version: '3.0'
+- !ruby/object:Gem::Dependency
+  name: rake
+  requirement: !ruby/object:Gem::Requirement
+    requirements:
+    - - '>='
+      - !ruby/object:Gem::Version
+        version: '0'
+  type: :development
+  prerelease: false
+  version_requirements: !ruby/object:Gem::Requirement
+    requirements:
+    - - '>='
       - !ruby/object:Gem::Version
-        version: '5.0'
-description: Sprockets Rails integration
-email:
-- david at loudthinking.com
+        version: '0'
+description: 
+email: josh at joshpeek.com
 executables: []
 extensions: []
 extra_rdoc_files: []
 files:
-- lib/sprockets/rails/bootstrap.rb
-- lib/sprockets/rails/compressors.rb
-- lib/sprockets/rails/helpers/isolated_helper.rb
-- lib/sprockets/rails/helpers/rails_helper.rb
-- lib/sprockets/rails/helpers.rb
-- lib/sprockets/rails/railtie.rb
-- lib/sprockets/rails/static_compiler.rb
-- lib/sprockets/rails/version.rb
-- lib/sprockets-rails.rb
-- lib/tasks/assets.rake
-- MIT-LICENSE
-- Rakefile
-- README.rdoc
-- test/abstract_unit.rb
-- test/assets_debugging_test.rb
-- test/assets_test.rb
-- test/fixtures/alternate/stylesheets/style.css
-- test/fixtures/app/fonts/dir/font.ttf
-- test/fixtures/app/fonts/font.ttf
-- test/fixtures/app/images/logo.png
-- test/fixtures/app/javascripts/application.js
-- test/fixtures/app/javascripts/dir/xmlhr.js
-- test/fixtures/app/javascripts/extra.js
-- test/fixtures/app/javascripts/xmlhr.js
-- test/fixtures/app/stylesheets/application.css
-- test/fixtures/app/stylesheets/dir/style.css
-- test/fixtures/app/stylesheets/extra.css
-- test/fixtures/app/stylesheets/style.css
-- test/sprockets_compressors_test.rb
-- test/sprockets_helper_test.rb
-- test/sprockets_helper_with_routes_test.rb
-- test/test_helper.rb
+- README.md
+- lib/sprockets/rails/helper.rb
+- lib/sprockets/rails/legacy_asset_tag_helper.rb
+- lib/sprockets/rails/legacy_asset_url_helper.rb
+- lib/sprockets/rails/task.rb
+- lib/sprockets/rails.rb
+- lib/sprockets/railtie.rb
 homepage: https://github.com/rails/sprockets-rails
 licenses: []
+metadata: {}
 post_install_message: 
 rdoc_options: []
 require_paths:
 - lib
 required_ruby_version: !ruby/object:Gem::Requirement
-  none: false
   requirements:
-  - - ! '>='
+  - - '>='
     - !ruby/object:Gem::Version
       version: '0'
 required_rubygems_version: !ruby/object:Gem::Requirement
-  none: false
   requirements:
-  - - ! '>='
+  - - '>='
     - !ruby/object:Gem::Version
       version: '0'
 requirements: []
 rubyforge_project: 
-rubygems_version: 1.8.21
+rubygems_version: 2.0.2
 signing_key: 
-specification_version: 3
+specification_version: 4
 summary: Sprockets Rails integration
-test_files:
-- test/abstract_unit.rb
-- test/assets_debugging_test.rb
-- test/assets_test.rb
-- test/fixtures/alternate/stylesheets/style.css
-- test/fixtures/app/fonts/dir/font.ttf
-- test/fixtures/app/fonts/font.ttf
-- test/fixtures/app/images/logo.png
-- test/fixtures/app/javascripts/application.js
-- test/fixtures/app/javascripts/dir/xmlhr.js
-- test/fixtures/app/javascripts/extra.js
-- test/fixtures/app/javascripts/xmlhr.js
-- test/fixtures/app/stylesheets/application.css
-- test/fixtures/app/stylesheets/dir/style.css
-- test/fixtures/app/stylesheets/extra.css
-- test/fixtures/app/stylesheets/style.css
-- test/sprockets_compressors_test.rb
-- test/sprockets_helper_test.rb
-- test/sprockets_helper_with_routes_test.rb
-- test/test_helper.rb
+test_files: []
diff --git a/test/abstract_unit.rb b/test/abstract_unit.rb
deleted file mode 100644
index f4d9c55..0000000
--- a/test/abstract_unit.rb
+++ /dev/null
@@ -1,145 +0,0 @@
-lib = File.expand_path("#{File.dirname(__FILE__)}/../lib")
-$:.unshift(lib) unless $:.include?('lib') || $:.include?(lib)
-
-require 'sprockets-rails'
-require 'fileutils'
-require 'minitest/autorun'
-require 'active_support/test_case'
-require 'rails/generators'
-require "active_support/testing/isolation"
-require "active_support/testing/declarative"
-require "active_support/core_ext/kernel/reporting"
-
-module TestHelpers
-  module Paths
-    module_function
-
-    TMP_PATH = File.expand_path(File.join(File.dirname(__FILE__), *%w[.. tmp]))
-
-    def tmp_path(*args)
-      File.join(TMP_PATH, *args)
-    end
-
-    def app_path(*args)
-      tmp_path(*%w[app] + args)
-    end
-
-    def rails_root
-      app_path
-    end
-  end
-
-  module Rack
-    def app(env = "production")
-      old_env = ENV["RAILS_ENV"]
-      @app ||= begin
-        ENV["RAILS_ENV"] = env
-        require "#{app_path}/config/environment"
-        Rails.application
-      end
-    ensure
-      ENV["RAILS_ENV"] = old_env
-    end
-
-    def get(path)
-      @app.call(::Rack::MockRequest.env_for(path))
-    end
-  end
-
-  module Generation
-    # Build an application by invoking the generator and going through the whole stack.
-    def build_app(options = {})
-      @prev_rails_env = ENV['RAILS_ENV']
-      ENV['RAILS_ENV'] = 'development'
-
-      FileUtils.rm_rf(app_path)
-      FileUtils.cp_r(tmp_path('app_template'), app_path)
-
-      # Delete the initializers unless requested
-      unless options[:initializers]
-        Dir["#{app_path}/config/initializers/*.rb"].each do |initializer|
-          File.delete(initializer)
-        end
-      end
-
-      unless options[:gemfile]
-        File.delete"#{app_path}/Gemfile"
-      end
-
-      routes = File.read("#{app_path}/config/routes.rb")
-      if routes =~ /(\n\s*end\s*)\Z/
-        File.open("#{app_path}/config/routes.rb", 'w') do |f|
-          f.puts $` + "\nmatch ':controller(/:action(/:id))(.:format)'\n" + $1
-        end
-      end
-
-      add_to_config 'config.secret_token = "3b7cd727ee24e8444053437c36cc66c4"; config.session_store :cookie_store, :key => "_myapp_session"; config.active_support.deprecation = :log'
-    end
-
-    def teardown_app
-      ENV['RAILS_ENV'] = @prev_rails_env if @prev_rails_env
-    end
-
-    def add_to_config(str)
-      environment = File.read("#{app_path}/config/application.rb")
-      if environment =~ /(\n\s*end\s*end\s*)\Z/
-        File.open("#{app_path}/config/application.rb", 'w') do |f|
-          f.puts $` + "\n#{str}\n" + $1
-        end
-      end
-    end
-
-    def add_to_env_config(env, str)
-      environment = File.read("#{app_path}/config/environments/#{env}.rb")
-      if environment =~ /(\n\s*end\s*)\Z/
-        File.open("#{app_path}/config/environments/#{env}.rb", 'w') do |f|
-          f.puts $` + "\n#{str}\n" + $1
-        end
-      end
-    end
-
-    def app_file(path, contents)
-      FileUtils.mkdir_p File.dirname("#{app_path}/#{path}")
-      File.open("#{app_path}/#{path}", 'w') do |f|
-        f.puts contents
-      end
-    end
-
-    def boot_rails
-      require 'rubygems' unless defined? Gem
-      require 'bundler'
-      Bundler.setup
-    end
-  end
-end
-
-class ActiveSupport::TestCase
-  include TestHelpers::Paths
-  include TestHelpers::Rack
-  include TestHelpers::Generation
-  extend  ActiveSupport::Testing::Declarative
-end
-
-# Create a scope and build a fixture rails app
-Module.new do
-  extend TestHelpers::Paths
-  # Build a rails app
-  if File.exist?(tmp_path)
-    FileUtils.rm_rf(tmp_path)
-  end
-  FileUtils.mkdir(tmp_path)
-
-  quietly do
-    Rails::Generators.invoke('app', ["#{tmp_path('app_template')}", "--skip-active-record", "--skip-test-unit"])
-  end
-
-  File.open("#{tmp_path}/app_template/config/boot.rb", 'w') do |f|
-    f.puts 'require "action_controller/railtie"'
-  end
-
-  # This is temporary, disable sprockets-rails railtie done in rails
-  file = "#{tmp_path}/app_template/config/application.rb"
-  contents = File.read(file)
-  contents.sub!(/require \"sprockets\/railtie\"/, "")
-  File.open(file, "w+") { |f| f.puts contents }
-end
diff --git a/test/assets_debugging_test.rb b/test/assets_debugging_test.rb
deleted file mode 100644
index 1a341e3..0000000
--- a/test/assets_debugging_test.rb
+++ /dev/null
@@ -1,65 +0,0 @@
-require File.expand_path(File.dirname(__FILE__) + "/abstract_unit")
-require 'rack/test'
-
-module ApplicationTests
-  class AssetsDebuggingTest < ActiveSupport::TestCase
-    include ActiveSupport::Testing::Isolation
-    include Rack::Test::Methods
-
-    def setup
-      build_app(:initializers => true)
-
-      app_file "app/assets/javascripts/application.js", "//= require_tree ."
-      app_file "app/assets/javascripts/xmlhr.js", "function f1() { alert(); }"
-      app_file "app/views/posts/index.html.erb", "<%= javascript_include_tag 'application' %>"
-
-      app_file "config/routes.rb", <<-RUBY
-        AppTemplate::Application.routes.draw do
-          match '/posts', :to => "posts#index"
-        end
-      RUBY
-
-      app_file "app/controllers/posts_controller.rb", <<-RUBY
-        class PostsController < ActionController::Base
-        end
-      RUBY
-
-      ENV["RAILS_ENV"] = "production"
-
-      boot_rails
-    end
-
-    def teardown
-      teardown_app
-    end
-
-    test "assets are concatenated when debug is off and compile is off either if debug_assets param is provided" do
-      # config.assets.debug and config.assets.compile are false for production environment
-      ENV["RAILS_ENV"] = "production"
-      capture(:stdout) do
-        Dir.chdir(app_path){ `bundle exec rake assets:precompile` }
-      end
-      require "#{app_path}/config/environment"
-
-      class ::PostsController < ActionController::Base ; end
-
-      # the debug_assets params isn't used if compile is off
-      get '/posts?debug_assets=true'
-      assert_match(/<script src="\/assets\/application-([0-z]+)\.js" type="text\/javascript"><\/script>/, last_response.body)
-      assert_no_match(/<script src="\/assets\/xmlhr-([0-z]+)\.js" type="text\/javascript"><\/script>/, last_response.body)
-    end
-
-    test "assets aren't concatened when compile is true is on and debug_assets params is true" do
-      app_file "config/initializers/compile.rb", "Rails.application.config.assets.compile = true"
-
-      ENV["RAILS_ENV"] = "production"
-      require "#{app_path}/config/environment"
-
-      class ::PostsController < ActionController::Base ; end
-
-      get '/posts?debug_assets=true'
-      assert_match(/<script src="\/assets\/application-([0-z]+)\.js\?body=1" type="text\/javascript"><\/script>/, last_response.body)
-      assert_match(/<script src="\/assets\/xmlhr-([0-z]+)\.js\?body=1" type="text\/javascript"><\/script>/, last_response.body)
-    end
-  end
-end
diff --git a/test/assets_test.rb b/test/assets_test.rb
deleted file mode 100644
index bd5c595..0000000
--- a/test/assets_test.rb
+++ /dev/null
@@ -1,532 +0,0 @@
-# -*- coding: utf-8 -*-
-require File.expand_path(File.dirname(__FILE__) + "/abstract_unit")
-require 'rack/test'
-
-module ApplicationTests
-  class AssetsTest < ActiveSupport::TestCase
-    include ActiveSupport::Testing::Isolation
-    include Rack::Test::Methods
-
-    def setup
-      build_app(:initializers => true)
-      boot_rails
-    end
-
-    def teardown
-      teardown_app
-    end
-
-    def precompile!
-      quietly do
-        Dir.chdir(app_path){ `bundle exec rake assets:precompile` }
-      end
-    end
-
-    test "assets routes have higher priority" do
-      app_file "app/assets/javascripts/demo.js.erb", "a = <%= image_path('rails.png').inspect %>;"
-
-      app_file 'config/routes.rb', <<-RUBY
-        AppTemplate::Application.routes.draw do
-          match '*path', :to => lambda { |env| [200, { "Content-Type" => "text/html" }, "Not an asset"] }
-        end
-      RUBY
-
-      require "#{app_path}/config/environment"
-
-      get "/assets/demo.js"
-      assert_equal 'a = "/assets/rails.png";', last_response.body.strip
-    end
-
-    test "assets do not require compressors until it is used" do
-      app_file "app/assets/javascripts/demo.js.erb", "<%= :alert %>();"
-      add_to_env_config "production", "config.assets.compile = true"
-
-      ENV["RAILS_ENV"] = "production"
-      require "#{app_path}/config/environment"
-
-      assert !defined?(Uglifier)
-      get "/assets/demo.js"
-      assert_match "alert()", last_response.body
-      assert defined?(Uglifier)
-    end
-
-    test "precompile creates the file, gives it the original asset's content and run in production as default" do
-      app_file "app/assets/javascripts/application.js", "alert();"
-      app_file "app/assets/javascripts/foo/application.js", "alert();"
-
-      ENV["RAILS_ENV"] = nil
-      precompile!
-
-      files = Dir["#{app_path}/public/assets/application-*.js"]
-      files << Dir["#{app_path}/public/assets/application.js"].first
-      files << Dir["#{app_path}/public/assets/foo/application-*.js"].first
-      files << Dir["#{app_path}/public/assets/foo/application.js"].first
-      files.each do |file|
-        assert_not_nil file, "Expected application.js asset to be generated, but none found"
-        assert_equal "alert();", File.read(file)
-      end
-    end
-
-    test "precompile application.js and application.css and all other non JS/CSS files" do
-      app_file "app/assets/javascripts/application.js", "alert();"
-      app_file "app/assets/stylesheets/application.css", "body{}"
-
-      app_file "app/assets/javascripts/someapplication.js", "alert();"
-      app_file "app/assets/stylesheets/someapplication.css", "body{}"
-
-      app_file "app/assets/javascripts/something.min.js", "alert();"
-      app_file "app/assets/stylesheets/something.min.css", "body{}"
-
-      app_file "app/assets/javascripts/something.else.js.erb", "alert();"
-      app_file "app/assets/stylesheets/something.else.css.erb", "body{}"
-
-      images_should_compile = ["a.png", "happyface.png", "happy_face.png", "happy.face.png",
-                               "happy-face.png", "happy.happy_face.png", "happy_happy.face.png",
-                               "happy.happy.face.png", "happy", "happy.face", "-happyface",
-                               "-happy.png", "-happy.face.png", "_happyface", "_happy.face.png",
-                               "_happy.png"]
-
-      images_should_compile.each do |filename|
-        app_file "app/assets/images/#{filename}", "happy"
-      end
-
-      precompile!
-
-      images_should_compile.each do |filename|
-        assert File.exists?("#{app_path}/public/assets/#{filename}")
-      end
-
-      assert File.exists?("#{app_path}/public/assets/application.js")
-      assert File.exists?("#{app_path}/public/assets/application.css")
-
-      assert !File.exists?("#{app_path}/public/assets/someapplication.js")
-      assert !File.exists?("#{app_path}/public/assets/someapplication.css")
-
-      assert !File.exists?("#{app_path}/public/assets/something.min.js")
-      assert !File.exists?("#{app_path}/public/assets/something.min.css")
-
-      assert !File.exists?("#{app_path}/public/assets/something.else.js")
-      assert !File.exists?("#{app_path}/public/assets/something.else.css")
-    end
-
-    test "asset pipeline should use a Sprockets::Index when config.assets.digest is true" do
-      add_to_config "config.assets.digest = true"
-      add_to_config "config.action_controller.perform_caching = false"
-
-      ENV["RAILS_ENV"] = "production"
-      require "#{app_path}/config/environment"
-
-      assert_equal Sprockets::Index, Rails.application.assets.class
-    end
-
-    test "precompile creates a manifest file with all the assets listed" do
-      app_file "app/assets/stylesheets/application.css.erb", "<%= asset_path('rails.png') %>"
-      app_file "app/assets/javascripts/application.js", "alert();"
-      # digest is default in false, we must enable it for test environment
-      add_to_config "config.assets.digest = true"
-
-      precompile!
-      manifest = "#{app_path}/public/assets/manifest.yml"
-
-      assets = YAML.load_file(manifest)
-      assert_match(/application-([0-z]+)\.js/, assets["application.js"])
-      assert_match(/application-([0-z]+)\.css/, assets["application.css"])
-    end
-
-    test "precompile creates a manifest file in a custom path with all the assets listed" do
-      app_file "app/assets/stylesheets/application.css.erb", "<%= asset_path('rails.png') %>"
-      app_file "app/assets/javascripts/application.js", "alert();"
-      # digest is default in false, we must enable it for test environment
-      add_to_config "config.assets.digest = true"
-      add_to_config "config.assets.manifest = '#{app_path}/shared'"
-
-      precompile!
-      manifest = "#{app_path}/shared/manifest.yml"
-
-      assets = YAML.load_file(manifest)
-      assert_match(/application-([0-z]+)\.js/, assets["application.js"])
-      assert_match(/application-([0-z]+)\.css/, assets["application.css"])
-    end
-
-    test "the manifest file should be saved by default in the same assets folder" do
-      app_file "app/assets/javascripts/application.js", "alert();"
-      # digest is default in false, we must enable it for test environment
-      add_to_config "config.assets.digest = true"
-      add_to_config "config.assets.prefix = '/x'"
-
-      precompile!
-
-      manifest = "#{app_path}/public/x/manifest.yml"
-      assets = YAML.load_file(manifest)
-      assert_match(/application-([0-z]+)\.js/, assets["application.js"])
-    end
-
-    test "precompile does not append asset digests when config.assets.digest is false" do
-      app_file "app/assets/stylesheets/application.css.erb", "<%= asset_path('rails.png') %>"
-      app_file "app/assets/javascripts/application.js", "alert();"
-      add_to_config "config.assets.digest = false"
-
-      precompile!
-
-      assert File.exists?("#{app_path}/public/assets/application.js")
-      assert File.exists?("#{app_path}/public/assets/application.css")
-
-      manifest = "#{app_path}/public/assets/manifest.yml"
-
-      assets = YAML.load_file(manifest)
-      assert_equal "application.js", assets["application.js"]
-      assert_equal "application.css", assets["application.css"]
-    end
-
-    test "assets do not require any assets group gem when manifest file is present" do
-      app_file "app/assets/javascripts/application.js", "alert();"
-      add_to_env_config "production", "config.serve_static_assets = true"
-
-      ENV["RAILS_ENV"] = "production"
-      precompile!
-
-      manifest = "#{app_path}/public/assets/manifest.yml"
-      assets = YAML.load_file(manifest)
-      asset_path = assets["application.js"]
-
-      require "#{app_path}/config/environment"
-
-      # Checking if Uglifier is defined we can know if Sprockets was reached or not
-      assert !defined?(Uglifier)
-      get "/assets/#{asset_path}"
-      assert_match "alert()", last_response.body
-      assert !defined?(Uglifier)
-    end
-
-    test "assets raise AssetNotPrecompiledError when manifest file is present and requested file isn't precompiled" do
-      app_file "app/views/posts/index.html.erb", "<%= javascript_include_tag 'app' %>"
-
-      app_file "config/routes.rb", <<-RUBY
-        AppTemplate::Application.routes.draw do
-          match '/posts', :to => "posts#index"
-        end
-      RUBY
-
-      ENV["RAILS_ENV"] = "production"
-      precompile!
-
-      # Create file after of precompile
-      app_file "app/assets/javascripts/app.js", "alert();"
-
-      require "#{app_path}/config/environment"
-      class ::PostsController < ActionController::Base
-        def show_detailed_exceptions?() true end
-      end
-
-      get '/posts'
-      assert_match(/AssetNotPrecompiledError/, last_response.body)
-      assert_match(/app.js isn't precompiled/, last_response.body)
-    end
-
-    test "assets raise AssetNotPrecompiledError when manifest file is present and requested file isn't precompiled if digest is disabled" do
-      app_file "app/views/posts/index.html.erb", "<%= javascript_include_tag 'app' %>"
-      add_to_config "config.assets.compile = false"
-
-      app_file "config/routes.rb", <<-RUBY
-        AppTemplate::Application.routes.draw do
-          match '/posts', :to => "posts#index"
-        end
-      RUBY
-
-      ENV["RAILS_ENV"] = "development"
-      precompile!
-
-      # Create file after of precompile
-      app_file "app/assets/javascripts/app.js", "alert();"
-
-      require "#{app_path}/config/environment"
-      class ::PostsController < ActionController::Base ; end
-
-      get '/posts'
-      assert_match(/AssetNotPrecompiledError/, last_response.body)
-      assert_match(/app.js isn't precompiled/, last_response.body)
-    end
-
-    test "precompile properly refers files referenced with asset_path and and run in the provided RAILS_ENV" do
-      app_file "app/assets/stylesheets/application.css.erb", "<%= asset_path('rails.png') %>"
-      # digest is default in false, we must enable it for test environment
-      add_to_env_config "test", "config.assets.digest = true"
-
-      quietly do
-        Dir.chdir(app_path){ `bundle exec rake assets:precompile RAILS_ENV=test` }
-      end
-      file = Dir["#{app_path}/public/assets/application.css"].first
-      assert_match(/\/assets\/rails\.png/, File.read(file))
-      file = Dir["#{app_path}/public/assets/application-*.css"].first
-      assert_match(/\/assets\/rails-([0-z]+)\.png/, File.read(file))
-    end
-
-    test "precompile shouldn't use the digests present in manifest.yml" do
-      app_file "app/assets/stylesheets/application.css.erb", "<%= asset_path('rails.png') %>"
-
-      ENV["RAILS_ENV"] = "production"
-      precompile!
-
-      manifest = "#{app_path}/public/assets/manifest.yml"
-      assets = YAML.load_file(manifest)
-      asset_path = assets["application.css"]
-
-      app_file "app/assets/images/rails.png", "image changed"
-
-      precompile!
-      assets = YAML.load_file(manifest)
-
-      assert_not_equal asset_path, assets["application.css"]
-    end
-
-    test "precompile appends the md5 hash to files referenced with asset_path and run in production as default even using RAILS_GROUPS=assets" do
-      app_file "app/assets/stylesheets/application.css.erb", "<%= asset_path('rails.png') %>"
-      add_to_config "config.assets.compile = true"
-
-      ENV["RAILS_ENV"] = nil
-      quietly do
-        Dir.chdir(app_path){ `bundle exec rake assets:precompile RAILS_GROUPS=assets` }
-      end
-      file = Dir["#{app_path}/public/assets/application-*.css"].first
-      assert_match(/\/assets\/rails-([0-z]+)\.png/, File.read(file))
-    end
-
-    test "precompile should handle utf8 filenames" do
-      filename = "レイルズ.png"
-      app_file "app/assets/images/#{filename}", "not a image really"
-      add_to_config "config.assets.precompile = [ /\.png$/, /application.(css|js)$/ ]"
-
-      precompile!
-      require "#{app_path}/config/environment"
-
-      get "/assets/#{URI.parser.escape(filename)}"
-      assert_match "not a image really", last_response.body
-      assert File.exists?("#{app_path}/public/assets/#{filename}")
-    end
-
-    test "assets are cleaned up properly" do
-      app_file "public/assets/application.js", "alert();"
-      app_file "public/assets/application.css", "a { color: green; }"
-      app_file "public/assets/subdir/broken.png", "not really an image file"
-
-      quietly do
-        Dir.chdir(app_path){ `bundle exec rake assets:clean` }
-      end
-
-      files = Dir["#{app_path}/public/assets/**/*", "#{app_path}/tmp/cache/assets/*"]
-      assert_equal 0, files.length, "Expected no assets, but found #{files.join(', ')}"
-    end
-
-    test "assets routes are not drawn when compilation is disabled" do
-      app_file "app/assets/javascripts/demo.js.erb", "<%= :alert %>();"
-      add_to_config "config.assets.compile = false"
-
-      ENV["RAILS_ENV"] = "production"
-      require "#{app_path}/config/environment"
-
-      get "/assets/demo.js"
-      assert_equal 404, last_response.status
-    end
-
-    test "does not stream session cookies back" do
-      app_file "app/assets/javascripts/demo.js.erb", "<%= :alert %>();"
-
-      app_file "config/routes.rb", <<-RUBY
-        AppTemplate::Application.routes.draw do
-          match '/omg', :to => "omg#index"
-        end
-      RUBY
-
-      require "#{app_path}/config/environment"
-
-      class ::OmgController < ActionController::Base
-        def index
-          flash[:cool_story] = true
-          render :text => "ok"
-        end
-      end
-
-      get "/omg"
-      assert_equal 'ok', last_response.body
-
-      get "/assets/demo.js"
-      assert_match "alert()", last_response.body
-      assert_equal nil, last_response.headers["Set-Cookie"]
-    end
-
-    test "files in any assets/ directories are not added to Sprockets" do
-      %w[app lib vendor].each do |dir|
-        app_file "#{dir}/assets/#{dir}_test.erb", "testing"
-      end
-
-      app_file "app/assets/javascripts/demo.js", "alert();"
-
-      require "#{app_path}/config/environment"
-
-      get "/assets/demo.js"
-      assert_match "alert();", last_response.body
-      assert_equal 200, last_response.status
-    end
-
-    test "assets are concatenated when debug is off and compile is off either if debug_assets param is provided" do
-      app_with_assets_in_view
-
-      # config.assets.debug and config.assets.compile are false for production environment
-      ENV["RAILS_ENV"] = "production"
-      precompile!
-
-      require "#{app_path}/config/environment"
-
-      class ::PostsController < ActionController::Base ; end
-
-      # the debug_assets params isn't used if compile is off
-      get '/posts?debug_assets=true'
-      assert_match(/<script src="\/assets\/application-([0-z]+)\.js" type="text\/javascript"><\/script>/, last_response.body)
-      assert_no_match(/<script src="\/assets\/xmlhr-([0-z]+)\.js" type="text\/javascript"><\/script>/, last_response.body)
-    end
-
-    test "assets aren't concatened when compile is true is on and debug_assets params is true" do
-      app_with_assets_in_view
-      add_to_env_config "production", "config.assets.compile  = true"
-      add_to_env_config "production", "config.assets.allow_debugging = true"
-
-      ENV["RAILS_ENV"] = "production"
-      require "#{app_path}/config/environment"
-
-      class ::PostsController < ActionController::Base ; end
-
-      get '/posts?debug_assets=true'
-      assert_match(/<script src="\/assets\/application-([0-z]+)\.js\?body=1" type="text\/javascript"><\/script>/, last_response.body)
-      assert_match(/<script src="\/assets\/xmlhr-([0-z]+)\.js\?body=1" type="text\/javascript"><\/script>/, last_response.body)
-    end
-
-    test "assets can access model information when precompiling" do
-      app_file "app/models/post.rb", "class Post; end"
-      app_file "app/assets/javascripts/application.js", "//= require_tree ."
-      app_file "app/assets/javascripts/xmlhr.js.erb", "<%= Post.name %>"
-
-      add_to_config "config.assets.digest = false"
-      precompile!
-      assert_equal "Post;\n", File.read("#{app_path}/public/assets/application.js")
-    end
-
-    test "assets can't access model information when precompiling if not initializing the app" do
-      app_file "app/models/post.rb", "class Post; end"
-      app_file "app/assets/javascripts/application.js", "//= require_tree ."
-      app_file "app/assets/javascripts/xmlhr.js.erb", "<%= defined?(Post) || :NoPost %>"
-
-      add_to_config "config.assets.digest = false"
-      add_to_config "config.assets.initialize_on_precompile = false"
-
-      precompile!
-      assert_equal "NoPost;\n", File.read("#{app_path}/public/assets/application.js")
-    end
-
-    test "initialization on the assets group should set assets_dir" do
-      require "#{app_path}/config/application"
-      Rails.application.initialize!(:assets)
-      assert_not_nil Rails.application.config.action_controller.assets_dir
-    end
-
-    test "enhancements to assets:precompile should only run once" do
-      app_file "lib/tasks/enhance.rake", "Rake::Task['assets:precompile'].enhance { puts 'enhancement' }"
-      output = precompile!
-      assert_equal 1, output.scan("enhancement").size
-    end
-
-    test "digested assets are not mistakenly removed" do
-      app_file "app/assets/application.js", "alert();"
-      add_to_config "config.assets.compile = true"
-      add_to_config "config.assets.digest = true"
-
-      quietly do
-        Dir.chdir(app_path){ `bundle exec rake assets:clean assets:precompile` }
-      end
-
-      files = Dir["#{app_path}/public/assets/application-*.js"]
-      assert_equal 1, files.length, "Expected digested application.js asset to be generated, but none found"
-    end
-
-    test "digested assets are removed from configured path" do
-      app_file "public/production_assets/application.js", "alert();"
-      add_to_env_config "production", "config.assets.prefix = 'production_assets'"
-
-      ENV["RAILS_ENV"] = nil
-      quietly do
-        Dir.chdir(app_path){ `bundle exec rake assets:clean` }
-      end
-
-      files = Dir["#{app_path}/public/production_assets/application.js"]
-      assert_equal 0, files.length, "Expected application.js asset to be removed, but still exists"
-    end
-
-    test "asset urls should use the request's protocol by default" do
-      app_with_assets_in_view
-      add_to_config "config.asset_host = 'example.com'"
-      require "#{app_path}/config/environment"
-      class ::PostsController < ActionController::Base; end
-
-      get '/posts', {}, {'HTTPS'=>'off'}
-      assert_match('src="http://example.com/assets/application.js', last_response.body)
-      get '/posts', {}, {'HTTPS'=>'on'}
-      assert_match('src="https://example.com/assets/application.js', last_response.body)
-    end
-
-    test "asset urls should be protocol-relative if no request is in scope" do
-      app_file "app/assets/javascripts/image_loader.js.erb", 'var src="<%= image_path("rails.png") %>";'
-      add_to_config "config.assets.precompile = %w{image_loader.js}"
-      add_to_config "config.asset_host = 'example.com'"
-      precompile!
-
-      assert_match 'src="//example.com/assets/rails.png"', File.read("#{app_path}/public/assets/image_loader.js")
-    end
-
-    test "asset paths should use RAILS_RELATIVE_URL_ROOT by default" do
-      ENV["RAILS_RELATIVE_URL_ROOT"] = "/sub/uri"
-
-      app_file "app/assets/javascripts/app.js.erb", 'var src="<%= image_path("rails.png") %>";'
-      add_to_config "config.assets.precompile = %w{app.js}"
-      precompile!
-
-      assert_match 'src="/sub/uri/assets/rails.png"', File.read("#{app_path}/public/assets/app.js")
-    end
-
-    test "html assets are compiled when executing precompile" do
-      app_file "app/assets/pages/page.html.erb", "<%= javascript_include_tag :application %>"
-      ENV["RAILS_ENV"]   = "production"
-      ENV["RAILS_GROUP"] = "assets"
-
-      quietly do
-        Dir.chdir(app_path){ `bundle exec rake assets:precompile` }
-      end
-
-      assert File.exists?("#{app_path}/public/assets/page.html")
-    end
-
-    test "assets:cache:clean should clean cache" do
-      ENV["RAILS_ENV"] = "production"
-      precompile!
-
-      quietly do
-        Dir.chdir(app_path){ `bundle exec rake assets:cache:clean` }
-      end
-
-      require "#{app_path}/config/environment"
-      assert_equal 0, Dir.entries(Rails.application.assets.cache.cache_path).size - 2 # reject [".", ".."]
-    end
-
-    private
-
-    def app_with_assets_in_view
-      app_file "app/assets/javascripts/application.js", "//= require_tree ."
-      app_file "app/assets/javascripts/xmlhr.js", "function f1() { alert(); }"
-      app_file "app/views/posts/index.html.erb", "<%= javascript_include_tag 'application' %>"
-
-      app_file "config/routes.rb", <<-RUBY
-        AppTemplate::Application.routes.draw do
-          match '/posts', :to => "posts#index"
-        end
-      RUBY
-    end
-  end
-end
diff --git a/test/fixtures/alternate/stylesheets/style.css b/test/fixtures/alternate/stylesheets/style.css
deleted file mode 100644
index bfb90bf..0000000
--- a/test/fixtures/alternate/stylesheets/style.css
+++ /dev/null
@@ -1 +0,0 @@
-/* Different from other style.css */
\ No newline at end of file
diff --git a/test/fixtures/app/fonts/dir/font.ttf b/test/fixtures/app/fonts/dir/font.ttf
deleted file mode 100644
index e69de29..0000000
diff --git a/test/fixtures/app/fonts/font.ttf b/test/fixtures/app/fonts/font.ttf
deleted file mode 100644
index e69de29..0000000
diff --git a/test/fixtures/app/images/logo.png b/test/fixtures/app/images/logo.png
deleted file mode 100644
index d5edc04..0000000
Binary files a/test/fixtures/app/images/logo.png and /dev/null differ
diff --git a/test/fixtures/app/javascripts/application.js b/test/fixtures/app/javascripts/application.js
deleted file mode 100644
index e611d2b..0000000
--- a/test/fixtures/app/javascripts/application.js
+++ /dev/null
@@ -1 +0,0 @@
-//= require xmlhr
diff --git a/test/fixtures/app/javascripts/dir/xmlhr.js b/test/fixtures/app/javascripts/dir/xmlhr.js
deleted file mode 100644
index e69de29..0000000
diff --git a/test/fixtures/app/javascripts/extra.js b/test/fixtures/app/javascripts/extra.js
deleted file mode 100644
index e69de29..0000000
diff --git a/test/fixtures/app/javascripts/xmlhr.js b/test/fixtures/app/javascripts/xmlhr.js
deleted file mode 100644
index e69de29..0000000
diff --git a/test/fixtures/app/stylesheets/application.css b/test/fixtures/app/stylesheets/application.css
deleted file mode 100644
index 2365eaa..0000000
--- a/test/fixtures/app/stylesheets/application.css
+++ /dev/null
@@ -1 +0,0 @@
-/*= require style */
diff --git a/test/fixtures/app/stylesheets/dir/style.css b/test/fixtures/app/stylesheets/dir/style.css
deleted file mode 100644
index e69de29..0000000
diff --git a/test/fixtures/app/stylesheets/extra.css b/test/fixtures/app/stylesheets/extra.css
deleted file mode 100644
index e69de29..0000000
diff --git a/test/fixtures/app/stylesheets/style.css b/test/fixtures/app/stylesheets/style.css
deleted file mode 100644
index e69de29..0000000
diff --git a/test/sprockets_compressors_test.rb b/test/sprockets_compressors_test.rb
deleted file mode 100644
index 579fd35..0000000
--- a/test/sprockets_compressors_test.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-require File.expand_path(File.dirname(__FILE__) + "/test_helper")
-
-class CompressorsTest < ActiveSupport::TestCase
-  def test_register_css_compressor
-    Sprockets::Rails::Compressors.register_css_compressor(:null, Sprockets::Rails::NullCompressor)
-    compressor = Sprockets::Rails::Compressors.registered_css_compressor(:null)
-    assert_kind_of Sprockets::Rails::NullCompressor, compressor
-  end
-
-  def test_register_js_compressor
-    Sprockets::Rails::Compressors.register_js_compressor(:uglifier, 'Uglifier', :require => 'uglifier')
-    compressor = Sprockets::Rails::Compressors.registered_js_compressor(:uglifier)
-    assert_kind_of Uglifier, compressor
-  end
-
-  def test_register_default_css_compressor
-    Sprockets::Rails::Compressors.register_css_compressor(:null, Sprockets::Rails::NullCompressor, :default => true)
-    compressor = Sprockets::Rails::Compressors.registered_css_compressor(:default)
-    assert_kind_of Sprockets::Rails::NullCompressor, compressor
-  end
-
-  def test_register_default_js_compressor
-    Sprockets::Rails::Compressors.register_js_compressor(:null, Sprockets::Rails::NullCompressor, :default => true)
-    compressor = Sprockets::Rails::Compressors.registered_js_compressor(:default)
-    assert_kind_of Sprockets::Rails::NullCompressor, compressor
-  end
-end
diff --git a/test/sprockets_helper_test.rb b/test/sprockets_helper_test.rb
deleted file mode 100644
index 3a9ecb6..0000000
--- a/test/sprockets_helper_test.rb
+++ /dev/null
@@ -1,345 +0,0 @@
-require File.expand_path(File.dirname(__FILE__) + "/test_helper")
-
-class SprocketsHelperTest < ActiveSupport::TestCase
-  include Sprockets::Rails::Helpers::RailsHelper
-
-  attr_accessor :assets, :controller, :params
-
-  class MockRequest
-    def protocol() 'http://' end
-    def ssl?() false end
-    def host_with_port() 'localhost' end
-    def script_name() nil end
-  end
-
-  def setup
-    @controller         = BasicController.new
-    @controller.request = MockRequest.new
-
-    @assets = Sprockets::Environment.new
-    @assets.append_path(FIXTURES.join("app/javascripts"))
-    @assets.append_path(FIXTURES.join("app/stylesheets"))
-    @assets.append_path(FIXTURES.join("app/images"))
-    @assets.append_path(FIXTURES.join("app/fonts"))
-
-    application = Struct.new(:config, :assets).new(config, @assets)
-    ::Rails.stubs(:application).returns(application)
-    @config = config
-    @config.perform_caching = true
-    @config.assets.digest = true
-    @config.assets.compile = true
-    @params = {}
-  end
-
-  def url_for(*args)
-    "http://www.example.com"
-  end
-
-  def config
-    @controller ? @controller.config : @config
-  end
-
-  def compute_host(source, request, options = {})
-    raise "Should never get here"
-  end
-
-  test "asset_path" do
-    assert_match %r{/assets/logo-[0-9a-f]+.png},
-      asset_path("logo.png")
-    assert_match %r{/assets/logo-[0-9a-f]+.png},
-      asset_path("logo.png", :digest => true)
-    assert_match %r{/assets/logo.png},
-      asset_path("logo.png", :digest => false)
-  end
-
-  test "custom_asset_path" do
-    @config.assets.prefix = '/s'
-    assert_match %r{/s/logo-[0-9a-f]+.png},
-      asset_path("logo.png")
-    assert_match %r{/s/logo-[0-9a-f]+.png},
-      asset_path("logo.png", :digest => true)
-    assert_match %r{/s/logo.png},
-      asset_path("logo.png", :digest => false)
-  end
-
-  test "asset_path with root relative assets" do
-    assert_equal "/images/logo",
-      asset_path("/images/logo")
-    assert_equal "/images/logo.gif",
-      asset_path("/images/logo.gif")
-
-    assert_equal "/dir/audio",
-      asset_path("/dir/audio")
-  end
-
-  test "asset_path with absolute urls" do
-    assert_equal "http://www.example.com/video/play",
-      asset_path("http://www.example.com/video/play")
-    assert_equal "http://www.example.com/video/play.mp4",
-      asset_path("http://www.example.com/video/play.mp4")
-  end
-
-  test "with a simple asset host the url should default to protocol relative" do
-    @controller.config.default_asset_host_protocol = :relative
-    @controller.config.asset_host = "assets-%d.example.com"
-    assert_match %r{^//assets-\d.example.com/assets/logo-[0-9a-f]+.png},
-      asset_path("logo.png")
-  end
-
-  test "with a simple asset host the url can be changed to use the request protocol" do
-    @controller.config.asset_host = "assets-%d.example.com"
-    @controller.config.default_asset_host_protocol = :request
-    assert_match %r{http://assets-\d.example.com/assets/logo-[0-9a-f]+.png},
-      asset_path("logo.png")
-  end
-
-  test "With a proc asset host that returns no protocol the url should be protocol relative" do
-    @controller.config.default_asset_host_protocol = :relative
-    @controller.config.asset_host = Proc.new do |asset|
-      "assets-999.example.com"
-    end
-    assert_match %r{^//assets-999.example.com/assets/logo-[0-9a-f]+.png},
-      asset_path("logo.png")
-  end
-
-  test "with a proc asset host that returns a protocol the url use it" do
-    @controller.config.asset_host = Proc.new do |asset|
-      "http://assets-999.example.com"
-    end
-    assert_match %r{http://assets-999.example.com/assets/logo-[0-9a-f]+.png},
-      asset_path("logo.png")
-  end
-
-  test "stylesheets served with a controller in scope can access the request" do
-    config.asset_host = Proc.new do |asset, request|
-      assert_not_nil request
-      "http://assets-666.example.com"
-    end
-    assert_match %r{http://assets-666.example.com/assets/logo-[0-9a-f]+.png},
-      asset_path("logo.png")
-  end
-
-  test "stylesheets served without a controller in scope cannot access the request" do
-    @controller = nil
-    @config.asset_host = Proc.new do |asset, request|
-      fail "This should not have been called."
-    end
-    assert_raises ActionController::RoutingError do
-      asset_path("logo.png")
-    end
-    @config.asset_host = method :compute_host
-    assert_raises ActionController::RoutingError do
-      asset_path("logo.png")
-    end
-  end
-
-  test "image_tag" do
-    assert_dom_equal '<img alt="Xml" src="/assets/xml.png" />', image_tag("xml.png")
-  end
-
-  test "image_path" do
-    assert_match %r{/assets/logo-[0-9a-f]+.png},
-      image_path("logo.png")
-
-    assert_match %r{/assets/logo-[0-9a-f]+.png},
-      path_to_image("logo.png")
-  end
-
-  test "font_path" do
-    assert_match %r{/assets/font-[0-9a-f]+.ttf},
-      font_path("font.ttf")
-
-    assert_match %r{/assets/font-[0-9a-f]+.ttf},
-      path_to_font("font.ttf")
-  end
-
-  test "javascript_path" do
-    assert_match %r{/assets/application-[0-9a-f]+.js},
-      javascript_path("application")
-
-    assert_match %r{/assets/application-[0-9a-f]+.js},
-      javascript_path("application.js")
-
-    assert_match %r{/assets/application-[0-9a-f]+.js},
-      path_to_javascript("application.js")
-  end
-
-  test "stylesheet_path" do
-    assert_match %r{/assets/application-[0-9a-f]+.css},
-      stylesheet_path("application")
-
-    assert_match %r{/assets/application-[0-9a-f]+.css},
-      stylesheet_path("application.css")
-
-    assert_match %r{/assets/application-[0-9a-f]+.css},
-      path_to_stylesheet("application.css")
-  end
-
-  test "stylesheets served without a controller in do not use asset hosts when the default protocol is :request" do
-    @controller = nil
-    @config.asset_host = "assets-%d.example.com"
-    @config.default_asset_host_protocol = :request
-    @config.perform_caching = true
-
-    assert_match %r{/assets/logo-[0-9a-f]+.png},
-      asset_path("logo.png")
-  end
-
-  test "asset path with relative url root" do
-    @controller.config.relative_url_root = "/collaboration/hieraki"
-    assert_equal "/collaboration/hieraki/images/logo.gif",
-     asset_path("/images/logo.gif")
-  end
-
-  test "asset path with relative url root when controller isn't present but relative_url_root is" do
-    @controller = nil
-    @config.relative_url_root = "/collaboration/hieraki"
-    assert_equal "/collaboration/hieraki/images/logo.gif",
-     asset_path("/images/logo.gif")
-  end
-
-  test "font path through asset_path" do
-    assert_match %r{/assets/font-[0-9a-f]+.ttf},
-      asset_path('font.ttf')
-
-    assert_match %r{/assets/dir/font-[0-9a-f]+.ttf},
-      asset_path("dir/font.ttf")
-
-    assert_equal "http://www.example.com/fonts/font.ttf",
-      asset_path("http://www.example.com/fonts/font.ttf")
-  end
-
-  test "javascript path through asset_path" do
-    assert_match %r{/assets/application-[0-9a-f]+.js},
-      asset_path(:application, :ext => "js")
-
-    assert_match %r{/assets/xmlhr-[0-9a-f]+.js},
-      asset_path("xmlhr", :ext => "js")
-    assert_match %r{/assets/dir/xmlhr-[0-9a-f]+.js},
-      asset_path("dir/xmlhr.js", :ext => "js")
-
-    assert_equal "/dir/xmlhr.js",
-      asset_path("/dir/xmlhr", :ext => "js")
-
-    assert_equal "http://www.example.com/js/xmlhr",
-      asset_path("http://www.example.com/js/xmlhr", :ext => "js")
-    assert_equal "http://www.example.com/js/xmlhr.js",
-      asset_path("http://www.example.com/js/xmlhr.js", :ext => "js")
-  end
-
-  test "javascript include tag" do
-    assert_match %r{<script src="/assets/application-[0-9a-f]+.js" type="text/javascript"></script>},
-      javascript_include_tag(:application)
-    assert_match %r{<script src="/assets/application-[0-9a-f]+.js" type="text/javascript"></script>},
-      javascript_include_tag(:application, :digest => true)
-    assert_match %r{<script src="/assets/application.js" type="text/javascript"></script>},
-      javascript_include_tag(:application, :digest => false)
-
-    assert_match %r{<script src="/assets/xmlhr-[0-9a-f]+.js" type="text/javascript"></script>},
-      javascript_include_tag("xmlhr")
-    assert_match %r{<script src="/assets/xmlhr-[0-9a-f]+.js" type="text/javascript"></script>},
-      javascript_include_tag("xmlhr.js")
-    assert_equal '<script src="http://www.example.com/xmlhr" type="text/javascript"></script>',
-      javascript_include_tag("http://www.example.com/xmlhr")
-
-    assert_match %r{<script src=\"/assets/xmlhr-[0-9a-f]+.js" type=\"text/javascript\"></script>\n<script src=\"/assets/extra-[0-9a-f]+.js" type=\"text/javascript\"></script>},
-      javascript_include_tag("xmlhr", "extra")
-
-    assert_match %r{<script src="/assets/xmlhr-[0-9a-f]+.js\?body=1" type="text/javascript"></script>\n<script src="/assets/application-[0-9a-f]+.js\?body=1" type="text/javascript"></script>},
-      javascript_include_tag(:application, :debug => true)
-
-    assert_match %r{<script src="/assets/jquery.plugin.js" type="text/javascript"></script>},
-      javascript_include_tag('jquery.plugin', :digest => false)
-
-    @config.assets.compile = true
-    @config.assets.debug = true
-    assert_match %r{<script src="/javascripts/application.js" type="text/javascript"></script>},
-      javascript_include_tag('/javascripts/application')
-    assert_match %r{<script src="/assets/xmlhr-[0-9a-f]+.js\?body=1" type="text/javascript"></script>\n<script src="/assets/application-[0-9a-f]+.js\?body=1" type="text/javascript"></script>},
-      javascript_include_tag(:application)
-  end
-
-  test "stylesheet path through asset_path" do
-    assert_match %r{/assets/application-[0-9a-f]+.css}, asset_path(:application, :ext => "css")
-
-    assert_match %r{/assets/style-[0-9a-f]+.css}, asset_path("style", :ext => "css")
-    assert_match %r{/assets/dir/style-[0-9a-f]+.css}, asset_path("dir/style.css", :ext => "css")
-    assert_equal "/dir/style.css", asset_path("/dir/style.css", :ext => "css")
-
-    assert_equal "http://www.example.com/css/style",
-      asset_path("http://www.example.com/css/style", :ext => "css")
-    assert_equal "http://www.example.com/css/style.css",
-      asset_path("http://www.example.com/css/style.css", :ext => "css")
-  end
-
-  test "stylesheet link tag" do
-    assert_match %r{<link href="/assets/application-[0-9a-f]+.css" media="screen" rel="stylesheet" type="text/css" />},
-      stylesheet_link_tag(:application)
-    assert_match %r{<link href="/assets/application-[0-9a-f]+.css" media="screen" rel="stylesheet" type="text/css" />},
-      stylesheet_link_tag(:application, :digest => true)
-    assert_match %r{<link href="/assets/application.css" media="screen" rel="stylesheet" type="text/css" />},
-      stylesheet_link_tag(:application, :digest => false)
-
-    assert_match %r{<link href="/assets/style-[0-9a-f]+.css" media="screen" rel="stylesheet" type="text/css" />},
-      stylesheet_link_tag("style")
-    assert_match %r{<link href="/assets/style-[0-9a-f]+.css" media="screen" rel="stylesheet" type="text/css" />},
-      stylesheet_link_tag("style.css")
-
-    assert_equal '<link href="http://www.example.com/style.css" media="screen" rel="stylesheet" type="text/css" />',
-      stylesheet_link_tag("http://www.example.com/style.css")
-    assert_match %r{<link href="/assets/style-[0-9a-f]+.css" media="all" rel="stylesheet" type="text/css" />},
-      stylesheet_link_tag("style", :media => "all")
-    assert_match %r{<link href="/assets/style-[0-9a-f]+.css" media="print" rel="stylesheet" type="text/css" />},
-      stylesheet_link_tag("style", :media => "print")
-
-    assert_match %r{<link href="/assets/style-[0-9a-f]+.css" media="screen" rel="stylesheet" type="text/css" />\n<link href="/assets/extra-[0-9a-f]+.css" media="screen" rel="stylesheet" type="text/css" />},
-      stylesheet_link_tag("style", "extra")
-
-    assert_match %r{<link href="/assets/style-[0-9a-f]+.css\?body=1" media="screen" rel="stylesheet" type="text/css" />\n<link href="/assets/application-[0-9a-f]+.css\?body=1" media="screen" rel="stylesheet" type="text/css" />},
-      stylesheet_link_tag(:application, :debug => true)
-
-    @config.assets.compile = true
-    @config.assets.debug = true
-    assert_match %r{<link href="/stylesheets/application.css" media="screen" rel="stylesheet" type="text/css" />},
-      stylesheet_link_tag('/stylesheets/application')
-
-    assert_match %r{<link href="/assets/style-[0-9a-f]+.css\?body=1" media="screen" rel="stylesheet" type="text/css" />\n<link href="/assets/application-[0-9a-f]+.css\?body=1" media="screen" rel="stylesheet" type="text/css" />},
-      stylesheet_link_tag(:application)
-
-    assert_match %r{<link href="/assets/style-[0-9a-f]+.css\?body=1" media="print" rel="stylesheet" type="text/css" />\n<link href="/assets/application-[0-9a-f]+.css\?body=1" media="print" rel="stylesheet" type="text/css" />},
-      stylesheet_link_tag(:application, :media => "print")
-  end
-
-  test "alternate asset prefix" do
-    stubs(:asset_prefix).returns("/themes/test")
-    assert_match %r{/themes/test/style-[0-9a-f]+.css}, asset_path("style", :ext => "css")
-  end
-
-  test "alternate asset environment" do
-    assets = Sprockets::Environment.new
-    assets.append_path(FIXTURES.join("alternate/stylesheets"))
-    stubs(:asset_environment).returns(assets)
-    assert_match %r{/assets/style-[0-9a-f]+.css}, asset_path("style", :ext => "css")
-  end
-
-  test "alternate hash based on environment" do
-    assets = Sprockets::Environment.new
-    assets.version = 'development'
-    assets.append_path(FIXTURES.join("alternate/stylesheets"))
-    stubs(:asset_environment).returns(assets)
-    dev_path = asset_path("style", :ext => "css")
-
-    assets.version = 'production'
-    prod_path = asset_path("style", :ext => "css")
-
-    assert_not_equal prod_path, dev_path
-  end
-
-  test "precedence of `config.digest = false` over manifest.yml asset digests" do
-    Rails.application.config.assets.digests = {'logo.png' => 'logo-d1g3st.png'}
-    @config.assets.digest = false
-
-    assert_equal '/assets/logo.png',
-      asset_path("logo.png")
-  end
-end
diff --git a/test/sprockets_helper_with_routes_test.rb b/test/sprockets_helper_with_routes_test.rb
deleted file mode 100644
index ca624d8..0000000
--- a/test/sprockets_helper_with_routes_test.rb
+++ /dev/null
@@ -1,60 +0,0 @@
-require File.expand_path(File.dirname(__FILE__) + "/test_helper")
-
-class SprocketsHelperWithRoutesTest < ActiveSupport::TestCase
-  include Sprockets::Rails::Helpers::RailsHelper
-
-  attr_accessor :controller, :params
-
-  # Let's bring in some named routes to test namespace conflicts with potential *_paths.
-  # We have to do this after we bring in the Sprockets RailsHelper so if there are conflicts,
-  # they'll fail in the way we expect in a real live Rails app.
-  routes = ActionDispatch::Routing::RouteSet.new
-  routes.draw do
-    resources :assets
-  end
-  include routes.url_helpers
-
-  def setup
-    @controller = BasicController.new
-
-    @assets = Sprockets::Environment.new
-    @assets.append_path(FIXTURES.join("app/javascripts"))
-    @assets.append_path(FIXTURES.join("app/stylesheets"))
-    @assets.append_path(FIXTURES.join("app/images"))
-
-    application = Struct.new(:config, :assets).new(config, @assets)
-    ::Rails.stubs(:application).returns(application)
-    @config = config
-    @config.perform_caching = true
-    @config.assets.digest = true
-    @config.assets.compile = true
-    @params = {}
-  end
-
-  def config
-    @controller ? @controller.config : @config
-  end
-
-  test "namespace conflicts on a named route called asset_path" do
-    # Testing this for sanity - asset_path is now a named route!
-    assert_equal asset_path('test_asset'), '/assets/test_asset'
-
-    assert_match %r{/assets/logo-[0-9a-f]+.png},
-      path_to_asset("logo.png")
-    assert_match %r{/assets/logo-[0-9a-f]+.png},
-      path_to_asset("logo.png", :digest => true)
-    assert_match %r{/assets/logo.png},
-      path_to_asset("logo.png", :digest => false)
-  end
-
-  test "javascript_include_tag with a named_route named asset_path" do
-    assert_match %r{<script src="/assets/application-[0-9a-f]+.js" type="text/javascript"></script>},
-      javascript_include_tag(:application)
-  end
-
-  test "stylesheet_link_tag with a named_route named asset_path" do
-    assert_match %r{<link href="/assets/application-[0-9a-f]+.css" media="screen" rel="stylesheet" type="text/css" />},
-      stylesheet_link_tag(:application)
-  end
-
-end
diff --git a/test/test_helper.rb b/test/test_helper.rb
deleted file mode 100644
index 63837a9..0000000
--- a/test/test_helper.rb
+++ /dev/null
@@ -1,84 +0,0 @@
-lib = File.expand_path("#{File.dirname(__FILE__)}/../lib")
-$:.unshift(lib) unless $:.include?('lib') || $:.include?(lib)
-
-require 'minitest/autorun'
-require 'sprockets-rails'
-require 'action_controller'
-require 'mocha'
-require 'active_support/dependencies'
-require 'action_controller/vendor/html-scanner'
-
-FIXTURE_LOAD_PATH = File.join(File.dirname(__FILE__), 'fixtures')
-FIXTURES = Pathname.new(FIXTURE_LOAD_PATH)
-
-module Rails
-  class << self
-    def env
-      @_env ||= ActiveSupport::StringInquirer.new(ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "test")
-    end
-  end
-end
-
-ActiveSupport::Dependencies.hook!
-
-module SetupOnce
-  extend ActiveSupport::Concern
-
-  included do
-    cattr_accessor :setup_once_block
-    self.setup_once_block = nil
-
-    setup :run_setup_once
-  end
-
-  module ClassMethods
-    def setup_once(&block)
-      self.setup_once_block = block
-    end
-  end
-
-  private
-    def run_setup_once
-      if self.setup_once_block
-        self.setup_once_block.call
-        self.setup_once_block = nil
-      end
-    end
-end
-
-SharedTestRoutes = ActionDispatch::Routing::RouteSet.new
-
-module ActiveSupport
-  class TestCase
-    include SetupOnce
-    # Hold off drawing routes until all the possible controller classes
-    # have been loaded.
-    setup_once do
-      SharedTestRoutes.draw do
-        match ':controller(/:action)'
-      end
-    end
-
-    def assert_dom_equal(expected, actual, message = "")
-      expected_dom = HTML::Document.new(expected).root
-      actual_dom   = HTML::Document.new(actual).root
-      assert_equal expected_dom, actual_dom
-    end
-  end
-end
-
-class BasicController
-  attr_accessor :request
-
-  def config
-    @config ||= ActiveSupport::InheritableOptions.new(ActionController::Base.config).tap do |config|
-      # VIEW TODO: View tests should not require a controller
-      public_dir = File.expand_path("../fixtures/public", __FILE__)
-      config.assets_dir = public_dir
-      config.javascripts_dir = "#{public_dir}/javascripts"
-      config.stylesheets_dir = "#{public_dir}/stylesheets"
-      config.assets          = ActiveSupport::InheritableOptions.new({ :prefix => "assets" })
-      config
-    end
-  end
-end

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-sprockets-rails.git



More information about the Pkg-ruby-extras-commits mailing list