Skip to content

Commit dec8904

Browse files
Add generator for rake task
1 parent d639a6d commit dec8904

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

lib/critical_path_css/rails/engine.rb

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module CriticalPathCss
2+
module Rails
3+
class Engine < ::Rails::Engine
4+
end
5+
end
6+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
require 'rails/generators'
2+
3+
module CriticalPathCss
4+
class InstallGenerator < Rails::Generators::Base
5+
source_root File.expand_path('..', __FILE__)
6+
7+
# Copy all needed stylesheets in the asset directory of the application
8+
def copy_stylesheets
9+
FileUtils.mkdir_p "app/assets/stylesheets/bootstrap_overrides"
10+
11+
copy_file "../../../app/assets/stylesheets/twitter/bootstrap.css.scss", "app/assets/stylesheets/bootstrap_overrides/base.css.scss"
12+
copy_file "../../../app/assets/stylesheets/twitter/bootstrap/_variables.scss", "app/assets/stylesheets/bootstrap_overrides/variables.css.scss"
13+
copy_file "templates/bootstrap_overrides.css.scss", "app/assets/stylesheets/bootstrap_overrides/bootstrap_overrides.css.scss"
14+
end
15+
end
16+
end

0 commit comments

Comments
 (0)