Sha256: 0dc7327fa4d54c2cc4f36031f04b02a8541f0854583566f27bfdad66389276f9

Contents?: true

Size: 1.13 KB

Versions: 24

Compression:

Stored size: 1.13 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 generate 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

24 entries across 24 versions & 2 rubygems

Version Path
brainsome_typus-4.0.0.beta13 lib/generators/typus/typus_generator.rb
brainsome_typus-4.0.0.beta12 lib/generators/typus/typus_generator.rb
brainsome_typus-4.0.0.beta11 lib/generators/typus/typus_generator.rb
brainsome_typus-4.0.0.beta10 lib/generators/typus/typus_generator.rb
brainsome_typus-4.0.0.beta9 lib/generators/typus/typus_generator.rb
brainsome_typus-4.0.0.beta8 lib/generators/typus/typus_generator.rb
brainsome_typus-4.0.0.beta7 lib/generators/typus/typus_generator.rb
brainsome_typus-4.0.0.beta6 lib/generators/typus/typus_generator.rb
brainsome_typus-4.0.0.beta5 lib/generators/typus/typus_generator.rb
brainsome_typus-4.0.0.beta4 lib/generators/typus/typus_generator.rb
brainsome_typus-4.0.0.beta3 lib/generators/typus/typus_generator.rb
brainsome_typus-4.0.0.beta2 lib/generators/typus/typus_generator.rb
brainsome_typus-4.0.0.beta1 lib/generators/typus/typus_generator.rb
typus-3.1.10 lib/generators/typus/typus_generator.rb
typus-3.1.9 lib/generators/typus/typus_generator.rb
typus-3.1.8 lib/generators/typus/typus_generator.rb
typus-3.1.7 lib/generators/typus/typus_generator.rb
typus-3.1.6 lib/generators/typus/typus_generator.rb
typus-3.1.5 lib/generators/typus/typus_generator.rb
typus-3.1.4 lib/generators/typus/typus_generator.rb