Sha256: 2e30dbe96b565cec32f40945120d3987099006f7a9e8f59d2ea952925f91c33e

Contents?: true

Size: 1.4 KB

Versions: 7

Compression:

Stored size: 1.4 KB

Contents

module Contour
  module Generators
    class InstallGenerator < Rails::Generators::Base
      source_root File.expand_path("../../templates", __FILE__)

      desc "Creates a Contour initializer"
      # class_option :orm

      def copy_initializer
        template "contour.rb", "config/initializers/contour.rb"
      end

      # def copy_devise
      #   template "devise.rb", "config/initializers/devise.rb"
      # end

      def copy_omniauth
        template "omniauth.rb", "config/initializers/omniauth.rb"
      end

      def install_devise
        generate("devise:install")
        # model_name = ask("What would you like the user model to be called? [user]")
        # model_name = "user" if model_name.blank?
        model_name = "user"
        generate("devise", model_name)
      end

      def add_contour_devise_route
        route "devise_for :users, controllers: { registrations: 'contour/registrations', sessions: 'contour/sessions', passwords: 'contour/passwords', confirmations: 'contour/confirmations', unlocks: 'contour/unlocks' }, path_names: { sign_up: 'register', sign_in: 'login' }"
      end

      def show_readme
        readme "README" if behavior == :invoke
      end

      # def copy_locale
      #   copy_file "../../../config/locales/en.yml", "config/locales/contour.en.yml"
      # end
      #
      # def show_readme
      #   readme "README" if behavior == :invoke
      # end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
contour-1.0.0.beta12 lib/generators/contour/install_generator.rb
contour-1.0.0.beta11 lib/generators/contour/install_generator.rb
contour-1.0.0.beta10 lib/generators/contour/install_generator.rb
contour-1.0.0.beta9 lib/generators/contour/install_generator.rb
contour-1.0.0.beta8 lib/generators/contour/install_generator.rb
contour-1.0.0.beta7 lib/generators/contour/install_generator.rb
contour-1.0.0.beta6 lib/generators/contour/install_generator.rb