forked from rails/rails
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move SCSS generators and default templates from Rails to the Sass Rai…
…ltie (d435726312601edb3ba6f97b34f562221f72c1f8). * Sass gem registers a compressor * Sass gem registers generators for assets and scaffold * Create a default stylesheet_engine ("css") for apps that remove the Sass gem
- Loading branch information
tomhuda
committed
May 24, 2011
1 parent
9701db1
commit ac3503c
Showing
12 changed files
with
61 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
railties/lib/rails/generators/css/assets/assets_generator.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
require "rails/generators/named_base" | ||
|
||
module Css | ||
module Generators | ||
class AssetsGenerator < Rails::Generators::NamedBase | ||
source_root File.expand_path("../templates", __FILE__) | ||
|
||
def copy_stylesheet | ||
copy_file "stylesheet.css", File.join('app/assets/stylesheets', class_path, "#{file_name}.css") | ||
end | ||
end | ||
end | ||
end |
3 changes: 1 addition & 2 deletions
3
...ails/assets/templates/stylesheet.css.scss → ...ators/css/assets/templates/stylesheet.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
/* | ||
/* | ||
Place all the styles related to the matching controller here. | ||
They will automatically be included in application.css. | ||
You can use Sass (SCSS) here: http://sass-lang.com/ | ||
*/ |
16 changes: 16 additions & 0 deletions
16
railties/lib/rails/generators/css/scaffold/scaffold_generator.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
require "rails/generators/named_base" | ||
|
||
module Css | ||
module Generators | ||
class ScaffoldGenerator < Rails::Generators::NamedBase | ||
# In order to allow the Sass generators to pick up the default Rails CSS and | ||
# transform it, we leave it in a standard location for the CSS stylesheet | ||
# generators to handle. For the simple, default case, just copy it over. | ||
def copy_stylesheet | ||
dir = Rails::Generators::ScaffoldGenerator.source_root | ||
file = File.join(dir, "scaffold.css") | ||
create_file "app/assets/stylesheets/scaffold.css", File.read(file) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 0 additions & 58 deletions
58
railties/lib/rails/generators/rails/scaffold/templates/scaffold.css.scss
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters