Sha256: d89dfc410755562c6a511f3dbefc402cbd789ca92ac42aaac3f92115094608e7

Contents?: true

Size: 664 Bytes

Versions: 57

Compression:

Stored size: 664 Bytes

Contents

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

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

      attr_reader :base_controller_class_name

      def initialize(*args)
        super
        @base_controller_class_name = ENV.fetch('BASE_CONTROLLER_CLASS_NAME') { '::ApplicationController' }
      end

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

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

Version data entries

57 entries across 57 versions & 1 rubygems

Version Path
cmor_files-0.0.38.pre lib/generators/cmor/files/install/install_generator.rb
cmor_files-0.0.37.pre lib/generators/cmor/files/install/install_generator.rb
cmor_files-0.0.36.pre lib/generators/cmor/files/install/install_generator.rb
cmor_files-0.0.35.pre lib/generators/cmor/files/install/install_generator.rb
cmor_files-0.0.34.pre lib/generators/cmor/files/install/install_generator.rb
cmor_files-0.0.33.pre lib/generators/cmor/files/install/install_generator.rb
cmor_files-0.0.32.pre lib/generators/cmor/files/install/install_generator.rb
cmor_files-0.0.31.pre lib/generators/cmor/files/install/install_generator.rb
cmor_files-0.0.30.pre lib/generators/cmor/files/install/install_generator.rb
cmor_files-0.0.29.pre lib/generators/cmor/files/install/install_generator.rb
cmor_files-0.0.28.pre lib/generators/cmor/files/install/install_generator.rb
cmor_files-0.0.27.pre lib/generators/cmor/files/install/install_generator.rb
cmor_files-0.0.26.pre lib/generators/cmor/files/install/install_generator.rb
cmor_files-0.0.25.pre lib/generators/cmor/files/install/install_generator.rb
cmor_files-0.0.24.pre lib/generators/cmor/files/install/install_generator.rb
cmor_files-0.0.22.pre lib/generators/cmor/files/install/install_generator.rb
cmor_files-0.0.21.pre lib/generators/cmor/files/install/install_generator.rb
cmor_files-0.0.20.pre lib/generators/cmor/files/install/install_generator.rb
cmor_files-0.0.19.pre lib/generators/cmor/files/install/install_generator.rb
cmor_files-0.0.18.pre lib/generators/cmor/files/install/install_generator.rb