Sha256: 5c7e6c2c4a0b7c29c9e151afae3dc8cb68242c6de6c0f13d9a668c4e39b0d30e

Contents?: true

Size: 1.12 KB

Versions: 26

Compression:

Stored size: 1.12 KB

Contents

require "rails/generators/migration"

require "generators/typus/config_generator"
require "generators/typus/controller_generator"
require "generators/typus/initializers_generator"

module Typus
  module Generators
    class TypusGenerator < Rails::Generators::Base

      include Rails::Generators::Migration

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

      namespace "typus"

      desc <<-DESC
Description:
  This generator creates required files to enable an admin panel which allows
  trusted users to edit structured content.

  To enable session authentication run `rails g typus:migration`.

      DESC

      def generate_initializers
        Typus::Generators::InitializersGenerator.new.invoke_all
      end

      def generate_controllers
        Typus.application_models.each do |model|
          Typus::Generators::ControllerGenerator.new([model.pluralize]).invoke_all
        end
      end

      def generate_config
        Typus::Generators::ConfigGenerator.new.invoke_all
      end

      protected

      def resource
        @resource
      end

      def sidebar
        @sidebar
      end

    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
typus-3.1.0.rc19 lib/generators/typus/typus_generator.rb
typus-3.1.0.rc18 lib/generators/typus/typus_generator.rb
typus-3.0.12 lib/generators/typus/typus_generator.rb
typus-3.1.0.rc17 lib/generators/typus/typus_generator.rb
typus-3.1.0.rc16 lib/generators/typus/typus_generator.rb
typus-3.1.0.rc15 lib/generators/typus/typus_generator.rb
typus-3.1.0.rc14 lib/generators/typus/typus_generator.rb
typus-3.0.11 lib/generators/typus/typus_generator.rb
typus-3.1.0.rc13 lib/generators/typus/typus_generator.rb
typus-3.1.0.rc12 lib/generators/typus/typus_generator.rb
typus-3.0.11.rc5 lib/generators/typus/typus_generator.rb
typus-3.1.0.rc11 lib/generators/typus/typus_generator.rb
typus-3.1.0.rc10 lib/generators/typus/typus_generator.rb
typus-3.0.11.rc4 lib/generators/typus/typus_generator.rb
typus-3.1.0.rc9 lib/generators/typus/typus_generator.rb
typus-3.0.11.rc3 lib/generators/typus/typus_generator.rb
typus-3.1.0.rc8 lib/generators/typus/typus_generator.rb
typus-3.1.0.rc7 lib/generators/typus/typus_generator.rb
typus-3.1.0.rc6 lib/generators/typus/typus_generator.rb
typus-3.1.0.rc5 lib/generators/typus/typus_generator.rb