Sha256: 75f37068796a58c0c1a9ad6d96878377a44c9ad4b2dfc65ea996b776130301f0

Contents?: true

Size: 674 Bytes

Versions: 4

Compression:

Stored size: 674 Bytes

Contents

require 'rails/generators/named_base'
module Ixtlan
  module Generators
    class Base < Rails::Generators::Base

      argument :name, :type => :string, :required => false

      class_option :dynamic, :type => :boolean, :default => true

      protected
      def generator_name
        raise "please overwrite generator_name"
      end

      def application_name
        @application_name ||= Rails.application.class.to_s.gsub(/::/,'').sub(/Application$/, '')
      end

      public

      def create_initializer_file
        if options[:dynamic]
          template 'dynamic.rb', File.join('config', "initializers", "ixtlan.rb")
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ixtlan-generators-0.1.7 lib/generators/ixtlan/base.rb
ixtlan-generators-0.1.5 lib/generators/ixtlan/base.rb
ixtlan-generators-0.1.4 lib/generators/ixtlan/base.rb
ixtlan-generators-0.1.3 lib/generators/ixtlan/base.rb