Permalink
Browse files

Merge pull request #25 from sakuro/asset-pipeline-2

asset pipeline patch that uses app/assets instead of vendor/assets
  • Loading branch information...
2 parents 5d1e227 + 48e7dd0 commit 859095375351f6c3048c64980f96c6cdfcbcc2b3 @croaky croaky committed Jul 4, 2011
View
@@ -12,7 +12,7 @@ Flutie is recommended to be run as a gem and included in your Gemfile:
gem "flutie"
-After you've bundled, run the installer:
+After you've bundled, if you are using Rails < 3.1, run the installer:
rake flutie:install
@@ -24,6 +24,10 @@ Click on the "Default styles" link to view the same markup with a barebones layo
To upgrade, bump the gem version in your Gemfile, and then run 'rake flutie:install' again to get the latest changes moved into your application.
+If you are using rails 3.1 or greater with asset pipelining enabled, you don't need to run the installer. Simply add
+ = require 'flutie'
+in the application stylesheet manifest (app/assets/stylesheets/applicaion.css).
+
Usage
-----
@@ -72,10 +76,10 @@ Fork away and create a "Github Issue":http://github.com/thoughtbot/flutie/issues
Development
-----------
-The actual stylesheet source files are sass, so edit the files in public/stylesheets/sass/flutie.
+The actual stylesheet source files are sass, so edit the files in app/assets/stylesheets/sass/flutie.
To rebuild the normal scss run:
- sass -C --update public/stylesheets/sass/flutie:public/stylesheets
+ sass -C --update app/assets/stylesheets/sass/flutie:app/assets/stylesheets
You can run a server which will allow you to view the flutie styleguide locally:
@@ -11,7 +11,12 @@ directory = File.dirname(__FILE__)
namespace :flutie do
desc 'install flutie stylesheets into public/ directory'
task :install => :environment do
- # Copy the flutie stylesheets into rails_root/public/stylesheets/sass
- copy_files("../../public/stylesheets", "/public", directory)
+ if Rails.application.config.respond_to?(:assets) && Rails.application.config.assets.enabled
+ # No copy is needed when asset pipelining is enabled
+ puts "Flutie stylesheets are provided via asset pipelining."
+ else
+ # Copy the flutie stylesheets into rails_root/public/flutie
+ copy_files("../../app/assets/stylesheets", "/public/flutie", directory)
+ end
end
end
View
@@ -3,6 +3,7 @@
set :views, ['app/views']
set :static, true
+set :public, 'app/assets'
helpers do
def stylesheet_link_tag(name)

0 comments on commit 8590953

Please sign in to comment.