Permalink
Browse files

add config

  • Loading branch information...
siuying committed Mar 23, 2012
1 parent 07e8407 commit 431c108151fba2ed525251b5c03d6dba0baf952c
Showing with 14 additions and 15 deletions.
  1. +5 −1 README.md
  2. +6 −0 config/assets.yml
  3. +3 −14 sprockets_helper.rb
View
@@ -26,4 +26,8 @@ Guard will watch the app folder and compile javascripts, coffeescripts, SASS and
Put your application images, javascripts and stylesheets into app/images, app/javascripts and app/stylesheets.
Put your vendor images, javascripts and stylesheets into vendor/images, vendor/javascripts and vendor/stylesheets.
-
+
+## Configuration
+
+Edit config/assets.yml for additional files to asset pipeline.
+
View
@@ -0,0 +1,6 @@
+assets_paths:
+ - "app/stylesheets"
+ - "app/javascripts"
+ - "app/images"
+ - "vendor/stylesheets"
+ - "vendor/javascripts"
View
@@ -5,22 +5,11 @@
module SprocketsHelper
def self.environment
environment = Sprockets::Environment.new(File.dirname(__FILE__))
-
- css_dir = ["app/stylesheets", "vendor/stylesheets"]
- css_dir.each do |path|
- environment.append_path path
- end
-
- js_dir = ["app/javascripts", "vendor/javascripts"]
- js_dir.each do |path|
+
+ config = YAML.load(open("./config/assets.yml"))
+ config["assets_paths"].each do |path|
environment.append_path path
end
-
- images_dir = ["app/images", "vendor/images"]
- images_dir.each do |path|
- environment.append_path path
- end
-
environment
end
end

0 comments on commit 431c108

Please sign in to comment.