forked from sass/sassc-rails
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate Rails scss scaffolding from sass-rails.
- Loading branch information
1 parent
f5ab1cb
commit 1a7c6ba
Showing
7 changed files
with
66 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
require "rails/generators/named_base" | ||
|
||
module Sass | ||
module Generators | ||
class AssetsGenerator < ::Rails::Generators::NamedBase | ||
source_root File.expand_path("../templates", __FILE__) | ||
|
||
def copy_sass | ||
template "stylesheet.sass", File.join('app/assets/stylesheets', class_path, "#{file_name}.sass") | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// Place all the styles related to the <%= name %> controller here. | ||
// They will automatically be included in application.css. | ||
// You can use Sass here: http://sass-lang.com/ |
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,9 @@ | ||
require "rails/generators/sass_scaffold" | ||
|
||
module Sass | ||
module Generators | ||
class ScaffoldGenerator < ::Sass::Generators::ScaffoldBase | ||
def syntax() :sass 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
require "sass/css" | ||
require "rails/generators/named_base" | ||
|
||
module Sass | ||
module Generators | ||
class ScaffoldBase < ::Rails::Generators::NamedBase | ||
def copy_stylesheet | ||
dir = ::Rails::Generators::ScaffoldGenerator.source_root | ||
file = File.join(dir, "scaffold.css") | ||
converted_contents = ::Sass::CSS.new(File.read(file)).render(syntax) | ||
create_file "app/assets/stylesheets/scaffolds.#{syntax}", converted_contents | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
require "rails/generators/named_base" | ||
|
||
module Scss | ||
module Generators | ||
class AssetsGenerator < ::Rails::Generators::NamedBase | ||
source_root File.expand_path("../templates", __FILE__) | ||
|
||
def copy_scss | ||
template "stylesheet.scss", File.join('app/assets/stylesheets', class_path, "#{file_name}.scss") | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// Place all the styles related to the <%= name %> controller here. | ||
// They will automatically be included in application.css. | ||
// You can use Sass (SCSS) here: http://sass-lang.com/ |
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,10 @@ | ||
require "rails/generators/sass_scaffold" | ||
|
||
module Scss | ||
module Generators | ||
class ScaffoldGenerator < ::Sass::Generators::ScaffoldBase | ||
def syntax() :scss end | ||
end | ||
end | ||
end | ||
|