Sha256: 469f825853bf50fd4360b0797e3752a0659040e9fda5b85222f8cd0df3ab55e5

Contents?: true

Size: 538 Bytes

Versions: 14

Compression:

Stored size: 538 Bytes

Contents

require 'generators/nifty'

module Nifty
  module Generators
    class ConfigGenerator < Base
      argument :config_name, :type => :string, :default => 'app', :banner => 'config_name'

      def create_config
        template "load_config.rb", "config/initializers/load_#{file_name}_config.rb"
        copy_file "config.yml", "config/#{file_name}_config.yml"
      end

      private

      def file_name
        config_name.underscore
      end

      def constant_name
        config_name.underscore.upcase
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 3 rubygems

Version Path
nifty-generators-improved-0.5 lib/generators/nifty/config/config_generator.rb
flockonus-nifty-generators-0.0.12 lib/generators/nifty/config/config_generator.rb
nifty-generators-0.4.6 lib/generators/nifty/config/config_generator.rb
flockonus-nifty-generators-0.0.11 lib/generators/nifty/config/config_generator.rb
flockonus-nifty-generators-0.0.10 lib/generators/nifty/config/config_generator.rb
flockonus-nifty-generators-0.0.9 lib/generators/nifty/config/config_generator.rb
nifty-generators-0.4.5 lib/generators/nifty/config/config_generator.rb
flockonus-nifty-generators-0.0.8 lib/generators/nifty/config/config_generator.rb
flockonus-nifty-generators-0.0.7 lib/generators/nifty/config/config_generator.rb
flockonus-nifty-generators-0.0.6 lib/generators/nifty/config/config_generator.rb
nifty-generators-0.4.4 lib/generators/nifty/config/config_generator.rb
nifty-generators-0.4.3 lib/generators/nifty/config/config_generator.rb
nifty-generators-0.4.2 lib/generators/nifty/config/config_generator.rb
nifty-generators-0.4.1 lib/generators/nifty/config/config_generator.rb