Skip to content

Commit

Permalink
add generator
Browse files Browse the repository at this point in the history
  • Loading branch information
JesseChavez committed Jun 19, 2018
1 parent 9905b31 commit 7d3af96
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions lib/generators/foundation/overrides_generator.rb
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

0 comments on commit 7d3af96

Please sign in to comment.