Skip to content
Browse files

Ensure engine registry is setup on require sprockets

  • Loading branch information...
1 parent b5817f6 commit 67df578673fab407780ba701e1b7f28516ae7d4e @josh josh committed Oct 10, 2011
Showing with 24 additions and 24 deletions.
  1. +24 −0 lib/sprockets.rb
  2. +0 −24 lib/sprockets/engines.rb
View
24 lib/sprockets.rb
@@ -36,4 +36,28 @@ module Sprockets
module Cache
autoload :FileStore, "sprockets/cache/file_store"
end
+
+ # Extend Sprockets module to provide global registry
+ extend Engines
+ @engines = {}
+
+ # Cherry pick the default Tilt engines that make sense for
+ # Sprockets. We don't need ones that only generate html like HAML.
+
+ # Mmm, CoffeeScript
+ register_engine '.coffee', Tilt::CoffeeScriptTemplate
+
+ # JST engines
+ register_engine '.jst', JstProcessor
+ register_engine '.eco', EcoTemplate
+ register_engine '.ejs', EjsTemplate
+
+ # CSS engines
+ register_engine '.less', Tilt::LessTemplate
+ register_engine '.sass', Tilt::SassTemplate
+ register_engine '.scss', Tilt::ScssTemplate
+
+ # Other
+ register_engine '.erb', Tilt::ERBTemplate
+ register_engine '.str', Tilt::StringTemplate
end
View
24 lib/sprockets/engines.rb
@@ -71,28 +71,4 @@ def deep_copy_hash(hash)
hash.inject(initial) { |h, (k, a)| h[k] = a.dup; h }
end
end
-
- # Extend Sprockets module to provide global registry
- extend Engines
- @engines = {}
-
- # Cherry pick the default Tilt engines that make sense for
- # Sprockets. We don't need ones that only generate html like HAML.
-
- # Mmm, CoffeeScript
- register_engine '.coffee', Tilt::CoffeeScriptTemplate
-
- # JST engines
- register_engine '.jst', JstProcessor
- register_engine '.eco', EcoTemplate
- register_engine '.ejs', EjsTemplate
-
- # CSS engines
- register_engine '.less', Tilt::LessTemplate
- register_engine '.sass', Tilt::SassTemplate
- register_engine '.scss', Tilt::ScssTemplate
-
- # Other
- register_engine '.erb', Tilt::ERBTemplate
- register_engine '.str', Tilt::StringTemplate
end

0 comments on commit 67df578

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