Sha256: 6df0e4edaab267495401f20d6287059d18211e94a4ff28996ddb5954c6ace44f

Contents?: true

Size: 629 Bytes

Versions: 4

Compression:

Stored size: 629 Bytes

Contents

class PizzaConfigGenerator < Rails::Generator::Base
  def initialize(runtime_args, runtime_options = {})
    super
    @name = @args.first || 'app'
  end
  
  def manifest
    record do |m|
      m.directory 'config/initializers'

      m.template "load_config.rb", "config/initializers/load_#{file_name}_config.rb"
      m.file     "config.yml",  "config/#{file_name}_config.yml"
    end
  end
  
  def file_name
    @name.underscore
  end
  
  def constant_name
    @name.underscore.upcase
  end

  protected
    def banner
      <<-EOS
Creates config and loader files.

USAGE: #{$0} #{spec.name} [config_name]
EOS
    end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
iain-pizza-generators-0.1.1 rails_generators/pizza_config/pizza_config_generator.rb
iain-pizza-generators-0.1.2 rails_generators/pizza_config/pizza_config_generator.rb
iain-pizza-generators-0.1.3 rails_generators/pizza_config/pizza_config_generator.rb
iain-pizza-generators-0.1.4 rails_generators/pizza_config/pizza_config_generator.rb