Sha256: 33f5f3883d4dae1083772cab77349d1b4eebc5ea0b6ef3042a7e20becd750e4f

Contents?: true

Size: 540 Bytes

Versions: 4

Compression:

Stored size: 540 Bytes

Contents

require 'generators/seivan'

module Seivan
  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

4 entries across 4 versions & 1 rubygems

Version Path
seivan-generators-0.5 lib/generators/seivan/config/config_generator.rb
seivan-generators-0.4 lib/generators/seivan/config/config_generator.rb
seivan-generators-0.3 lib/generators/seivan/config/config_generator.rb
seivan-generators-0.2 lib/generators/seivan/config/config_generator.rb