Sha256: edc239dd9b5a25af29ca02728c3a9b10623e4284c391c5763159153287db19d2

Contents?: true

Size: 890 Bytes

Versions: 11

Compression:

Stored size: 890 Bytes

Contents

module RailsConfig
  module Generators
    class InstallGenerator < ::Rails::Generators::Base
      desc "Generates a custom Rails Config initializer file."

      def self.source_root
        @_rails_config_source_root ||= File.expand_path("../templates", __FILE__)
      end

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

      def copy_settings
        template "settings.yml", "config/settings.yml"
        template "settings.local.yml", "config/settings.local.yml"
        directory "settings", "config/settings"
      end

      def modify_gitignore
        append_to_file '.gitignore' do
          "\n"                                +
          "config/settings.local.yml\n"       +
          "config/settings/*.local.yml\n"     +
          "config/environments/*.local.yml\n"
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
rails_config-0.4.2 lib/generators/rails_config/install_generator.rb
rails_config-0.4.1 lib/generators/rails_config/install_generator.rb
rails_config-0.3.4 lib/generators/rails_config/install_generator.rb
rails_config-0.3.3 lib/generators/rails_config/install_generator.rb
rails_config-0.3.2 lib/generators/rails_config/install_generator.rb
rails_config-0.3.1 lib/generators/rails_config/install_generator.rb
rails_config-0.3.0 lib/generators/rails_config/install_generator.rb
rails_config-0.2.7 lib/generators/rails_config/install_generator.rb
rails_config-0.2.6 lib/generators/rails_config/install_generator.rb
rails_config-0.2.5 lib/generators/rails_config/install_generator.rb
rails_config-0.2.4 lib/generators/rails_config/install_generator.rb