Sha256: b5ba0b397acb5f13a39da68d0a0b8dfebfbfbea5029f55cc04cdd267ff8fc913

Contents?: true

Size: 958 Bytes

Versions: 56

Compression:

Stored size: 958 Bytes

Contents

module Cmor
  module Blog
    module Generators
      class InstallGenerator < Rails::Generators::Base
        desc 'Generates the initializer'

        source_root File.expand_path('../templates', __FILE__)

        attr_reader :base_controller_class_name
        attr_reader :user_factory_name
        attr_reader :creator_class_name

        def initialize(*args)
          super
          @base_controller_class_name = ENV.fetch('BASE_CONTROLLER_CLASS_NAME') { '::ApplicationController' }
          @user_factory_name = ENV.fetch('CMOR_BLOG_USER_FACTORY_NAME') { 'user' }
          @creator_class_name = ENV.fetch('CMOR_BLOG_CREATOR_CLASS_NAME') { 'User' }
        end

        def generate_initializer
          template 'initializer.rb', 'config/initializers/cmor_blog.rb'
        end

        def generate_routes
          route File.read(File.join(File.expand_path('../templates', __FILE__), 'routes.source'))
        end
      end
    end
  end
end

Version data entries

56 entries across 56 versions & 1 rubygems

Version Path
cmor_blog-0.0.17.pre lib/generators/cmor/blog/install/install_generator.rb
cmor_blog-0.0.15.pre lib/generators/cmor/blog/install/install_generator.rb
cmor_blog-0.0.14.pre lib/generators/cmor/blog/install/install_generator.rb
cmor_blog-0.0.13.pre lib/generators/cmor/blog/install/install_generator.rb
cmor_blog-0.0.12.pre lib/generators/cmor/blog/install/install_generator.rb
cmor_blog-0.0.11.pre lib/generators/cmor/blog/install/install_generator.rb
cmor_blog-0.0.10.pre lib/generators/cmor/blog/install/install_generator.rb
cmor_blog-0.0.9.pre lib/generators/cmor/blog/install/install_generator.rb
cmor_blog-0.0.8.pre lib/generators/cmor/blog/install/install_generator.rb
cmor_blog-0.0.7.pre lib/generators/cmor/blog/install/install_generator.rb
cmor_blog-0.0.6.pre lib/generators/cmor/blog/install/install_generator.rb
cmor_blog-0.0.5.pre lib/generators/cmor/blog/install/install_generator.rb
cmor_blog-0.0.4.pre lib/generators/cmor/blog/install/install_generator.rb
cmor_blog-0.0.3.pre lib/generators/cmor/blog/install/install_generator.rb
cmor_blog-0.0.2.pre lib/generators/cmor/blog/install/install_generator.rb
cmor_blog-0.0.1.pre lib/generators/cmor/blog/install/install_generator.rb