Sha256: ec7754d0bc1583295d9430a9ae9dd80f0902f719988c7eeb484210eba8084be2

Contents?: true

Size: 776 Bytes

Versions: 5

Compression:

Stored size: 776 Bytes

Contents

module NoPassword
  class InstallTemplatesGenerator < Rails::Generators::Base
    source_root File.expand_path("../../../app/views", __FILE__)

    def copy_layout
      empty_directory "app/views/layouts/no_password"
      directory File.join(engine_views_path, "layouts", "no_password"),
        File.join(app_views_path, "layouts", "no_password")
    end

    def copy_views
      empty_directory "app/views/no_password"
      directory File.join(engine_views_path, "no_password"),
        File.join(app_views_path, "no_password")
    end

    private

    def engine_views_path
      @engine_views_path ||= File.join(NoPassword::Engine.root, "app", "views")
    end

    def app_views_path
      @app_views_path ||= File.join(Rails.root, "app", "views")
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
no_password_auth-0.5.0 lib/generators/no_password/install_templates_generator.rb
no_password_auth-0.4.1 lib/generators/no_password/install_templates_generator.rb
no_password_auth-0.4.0 lib/generators/no_password/install_templates_generator.rb
no_password_auth-0.3.0 lib/generators/no_password/install_templates_generator.rb
no_password_auth-0.2.1 lib/generators/no_password/install_templates_generator.rb