Sha256: bd71f4aff2597ab914ad87661112e3d66c30155b36a7004f6a1da1803dbea4d3
Contents?: true
Size: 1.39 KB
Versions: 6
Compression:
Stored size: 1.39 KB
Contents
module HappySeed module Generators class SplashGenerator < Rails::Generators::Base source_root File.expand_path('../templates', __FILE__) def install_landing_page unless gem_available?( "bootstrap-sass" ) puts "The splash generator requires bootstrap" if yes?( "Run happy_seed:bootstrap now?" ) generate "happy_seed:bootstrap" else exit end end gem 'gibbon' Bundler.with_clean_env do run "bundle install" end remove_file 'public/index.html' gsub_file "config/routes.rb", /\s*root.*\n/, "\n" route "root 'splash#index'" route "post '/signup' => 'splash#signup', as: :splash_signup" directory 'app' directory "docs" directory "spec" directory "vendor" append_to_file "config/initializers/assets.rb", "Rails.application.config.assets.precompile += %w( splash.css scrollReveal.js )\n" begin append_to_file ".env", "MAILCHIMP_API_KEY=\nMAILCHIMP_SPLASH_SIGNUP_LIST_ID=\n" rescue say_status :env, "Unable to add template .env files", :red end end private def gem_available?(name) Gem::Specification.find_by_name(name) rescue Gem::LoadError false rescue Gem.available?(name) end end end end
Version data entries
6 entries across 6 versions & 1 rubygems