Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
scrapbook / lib / generators / scrapbook / install / install_generator.rb
Size: Mime:
module Scrapbook
  class InstallGenerator < Rails::Generators::Base
    source_root File.expand_path("../templates", __FILE__)

    def copy_templates
      template "initializer.rb.erb",
               "config/initializers/scrapbook.rb"
    end

    def setup_routes
      insert_into_file 'config/routes.rb',
                       "\n  mount Scrapbook::Engine => '/scrapbook/'\n",
                       after: "Rails.application.routes.draw do"
    end

    def create_migrations
      rake 'scrapbook:install:migrations'
    end
  end
end