Sha256: 0c4042dcc96d6e85a081cc1b82d5ce3966201c8d765be7866d3c237033328f7b

Contents?: true

Size: 959 Bytes

Versions: 34

Compression:

Stored size: 959 Bytes

Contents

module Cantango
  module Generators
    class InstallGenerator < Rails::Generators::Base
      desc "Add role strategy to a User model"

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

      class_option :categories,       :type => :boolean,     :default => true,  :desc => "Create categories"
      class_option :permissions,      :type => :boolean,     :default => true,  :desc => "Create yaml permissions store"

      def copy_initializer
        template "cantango.rb", "config/initializers/cantango.rb"
      end

      def copy_categories
        return unless categories?
        template "categories.yml", "config/categories.yml"
      end

      def copy_permissions
        return unless permissions?
        template "permissions.yml", "config/permissions.yml"
      end

      protected

      def permissions?
        options[:permissions]
      end

      def categories?
        options[:categories]
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 2 rubygems

Version Path
cantango-core-0.1.9.3 lib/generators/cantango/install/install_generator.rb
cantango-core-0.1.9.2 lib/generators/cantango/install/install_generator.rb
cantango-core-0.1.9.1 lib/generators/cantango/install/install_generator.rb
cantango-core-0.1.9 lib/generators/cantango/install/install_generator.rb
cantango-core-0.1.8 lib/generators/cantango/install/install_generator.rb
cantango-core-0.1.7 lib/generators/cantango/install/install_generator.rb
cantango-core-0.1.6 lib/generators/cantango/install/install_generator.rb
cantango-core-0.1.5 lib/generators/cantango/install/install_generator.rb
cantango-core-0.1.4 lib/generators/cantango/install/install_generator.rb
cantango-core-0.1.3 lib/generators/cantango/install/install_generator.rb
cantango-core-0.1.2 lib/generators/cantango/install/install_generator.rb
cantango-core-0.1.1 lib/generators/cantango/install/install_generator.rb
cantango-core-0.1.0 lib/generators/cantango/install/install_generator.rb
cantango-0.9.4.7 lib/generators/cantango/install/install_generator.rb
cantango-0.9.4.6 lib/generators/cantango/install/install_generator.rb
cantango-0.9.4.5 lib/generators/cantango/install/install_generator.rb
cantango-0.9.4.3 lib/generators/cantango/install/install_generator.rb
cantango-0.9.4.2 lib/generators/cantango/install/install_generator.rb
cantango-0.9.4.1 lib/generators/cantango/install/install_generator.rb
cantango-0.9.4 lib/generators/cantango/install/install_generator.rb