Sha256: 2bb456caf3fec31e1e29d857f7133151865777546545575feeaf132959c1480e

Contents?: true

Size: 1.22 KB

Versions: 4

Compression:

Stored size: 1.22 KB

Contents

require 'generators/happy_seed/happy_seed_generator'

module HappySeed
  module Generators
    class BootstrapGenerator < HappySeedGenerator
      source_root File.expand_path('../templates', __FILE__)

      def update_application_haml
        gem 'bootstrap-sass'
        gem 'modernizr-rails'
        gem 'meta-tags', :require => 'meta_tags'
        gem 'responders', '~> 2.0'
        gem 'bh'

        Bundler.with_clean_env do
          run "bundle install > /dev/null"
        end

        remove_file 'app/views/layouts/application.html.erb'
        remove_file 'app/assets/javascripts/application.js'
        remove_file 'app/helpers/application_helper.rb'
        remove_file 'app/assets/stylesheets/application.css'
        directory 'app'
        directory 'lib'
        directory 'docs'

        inject_into_file 'config/application.rb', before: "end\nend\n" do <<-'RUBY'
  config.action_view.field_error_proc = Proc.new { |html_tag, instance| html_tag }
    config.generators do |g|
      g.stylesheets = false
      g.scaffold_controller "scaffold_controller"
    end
  
RUBY
        end
        if File.exists?( File.join( destination_root, ".env" ) )
          add_env "GOOGLE_ANALYTICS_SITE_ID"
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
happy_seed-0.0.15 lib/generators/happy_seed/bootstrap/bootstrap_generator.rb
happy_seed-0.0.14 lib/generators/happy_seed/bootstrap/bootstrap_generator.rb
happy_seed-0.0.13 lib/generators/happy_seed/bootstrap/bootstrap_generator.rb
happy_seed-0.0.12 lib/generators/happy_seed/bootstrap/bootstrap_generator.rb