Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Asset pipeline 2 #25

Merged
merged 5 commits into from

3 participants

@sakuro

Recreated asset pipiline patch that uses app/assets instead of vendor/assets.

I'll close older pull req and issues.

@mjankowski
Owner

This looks good. On the copy task though, I don't think we need the :assets capability check. I think we can update the readme to reflect that...

  • If you are on rails 3.1 and using the asset pipeline, you don't need to run the rake task or copy any files
  • If you are on a prior version, or on 3.1 and not using the pipeline and/or not using sass, you do need to run the rake task

This way we don't exclude people who are on 3.1 (and thus will return true on the :assets check) but who don't actually want to use the pipeline.

@sakuro

I am neutral about conditionally guarding copy or not.

@croaky croaky merged commit 8590953 into thoughtbot:master
@croaky
Owner

Merged this in. I personally like that conditional guard + friendly standard out message but feel free to remove it if you want, Matt.

@mjankowski
Owner

Yeah, that's fine as-is. In retrospect, I don't actually care about the "using rails 3.1 but NOT the asset pipeline" use case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
View
10 README.md
@@ -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:
View
0  public/stylesheets/flutie.css → app/assets/stylesheets/flutie.css
File renamed without changes
View
0  ...ic/stylesheets/sass/flutie/_defaults.scss → ...ts/stylesheets/sass/flutie/_defaults.scss
File renamed without changes
View
0  public/stylesheets/sass/flutie/_forms.scss → ...ssets/stylesheets/sass/flutie/_forms.scss
File renamed without changes
View
0  public/stylesheets/sass/flutie/_lists.scss → ...ssets/stylesheets/sass/flutie/_lists.scss
File renamed without changes
View
0  public/stylesheets/sass/flutie/_reset.scss → ...ssets/stylesheets/sass/flutie/_reset.scss
File renamed without changes
View
0  public/stylesheets/sass/flutie/_screen.scss → ...sets/stylesheets/sass/flutie/_screen.scss
File renamed without changes
View
0  public/stylesheets/sass/flutie/_tables.scss → ...sets/stylesheets/sass/flutie/_tables.scss
File renamed without changes
View
0  public/stylesheets/sass/flutie/_type.scss → ...assets/stylesheets/sass/flutie/_type.scss
File renamed without changes
View
0  public/stylesheets/sass/flutie/flutie.scss → ...ssets/stylesheets/sass/flutie/flutie.scss
File renamed without changes
View
9 lib/tasks/flutie.rake
@@ -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
1  server.rb
@@ -3,6 +3,7 @@
set :views, ['app/views']
set :static, true
+set :public, 'app/assets'
helpers do
def stylesheet_link_tag(name)
Something went wrong with that request. Please try again.