-
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.
- Loading branch information
1 parent
9905b31
commit 7d3af96
Showing
1 changed file
with
39 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,39 @@ | ||
require 'rails/generators' | ||
|
||
module Foundation | ||
module Generators | ||
class OverridesGenerator < ::Rails::Generators::Base | ||
# creates the foundation overrides file | ||
def add_overrides | ||
create_file overrides_file, File.read(settings_file) | ||
append_to_file overrides_file, "\n@import 'foundation';\n" | ||
end | ||
|
||
private | ||
|
||
def settings_file | ||
File.join(vendor_stylesheets_base_dir, '_settings.scss') | ||
end | ||
|
||
def overrides_file | ||
File.join(stylesheets_base_dir, 'foundation_and_overrides.scss') | ||
end | ||
|
||
def vendor_stylesheets_base_dir | ||
File.join( | ||
File.dirname(__FILE__), | ||
'..', | ||
'..', | ||
'..', | ||
'vendor', | ||
'assets', | ||
'stylesheets' | ||
) | ||
end | ||
|
||
def stylesheets_base_dir | ||
File.join('app', 'assets', 'stylesheets') | ||
end | ||
end | ||
end | ||
end |