Sha256: 040bc640ccbbc34d614a7dc2b1d1e30dd6d2ddccfb4e6a20132b76d5386f6854

Contents?: true

Size: 439 Bytes

Versions: 3

Compression:

Stored size: 439 Bytes

Contents

require File.join(File.dirname(__FILE__), "base")

module Wellcar
  module Templates
    class DatabaseYaml < Base
      def initialize(app_name)
        super "config/database.yml"
        with_attributes app_name: app_name
        with_template "database.yml.erb"
      end

      def update
        # back up existing file
        FileUtils.mv file_path, "config/database.pre_docker.yml"
        self.write
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
wellcar-0.0.3 lib/wellcar/templates/database_yaml.rb
wellcar-0.0.2 lib/wellcar/templates/database_yaml.rb
wellcar-0.0.1 lib/wellcar/templates/database_yaml.rb