-
Notifications
You must be signed in to change notification settings - Fork 1
/
foundation.rb
36 lines (29 loc) · 1.08 KB
/
foundation.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Dir[File.join(File.dirname(__FILE__), 'utils/*.rb')].each {|file| require file }
# rails new APP_PATH -m=https://raw.github.com/bazzel/rails-templates/master/foundation.rb
# bundle exec rake rails:template LOCATION=https://raw.github.com/bazzel/rails-templates/master/foundation.rb
#
# Tested with:
# Rails 4.0.2
# foundation-rails 5.1.1.0
#
# This template sets up Zurb Foundation.
#
puts <<-CODE
== Rails template for setting up ZURB Foundation ================================
-- see: http://foundation.zurb.com for more info
CODE
# Declare and install gems
#
bundle_install do
gem 'foundation-rails', '~> 5.2'
gem 'modernizr-rails'
end
#
# End Declare and install gems
generate 'foundation:install'
# Replace JS initialization with CS
gsub_file app_js.join('application.js.coffee'), /.*foundation\(\).*/, '$ -> $(document).foundation()'
prepend_file app_js.join('application.js.coffee'), "#= require modernizr\n"
if ask('Do you need an application layout file? You might not need one if you\'re working on a single-page app? [Yn]').downcase == 'n'
remove_dir 'app/views/layouts'
end