Sha256: 85389cae435c9fa14520fe5005c982bef1bf499b12726b53ba053c70c5bd5c99
Contents?: true
Size: 600 Bytes
Versions: 10
Compression:
Stored size: 600 Bytes
Contents
desc 'create-database-yml', '[sic]', :hide => true def create_database_yml real_yml = 'config/database.yml' sample_yml = 'config/database.sample.yml' if File.exists?(sample_yml) and not File.exists?(real_yml) announce 'Creating ' + real_yml sample = File.read(sample_yml) adapter = sample.match(/adapter: (\w+)\n/).captures.first print "Please enter your #{adapter} password: " db_password = STDIN.gets.strip real = sample.gsub(/password:.*$/, "password: #{db_password}") File.open(real_yml, 'w') { |f| f.write(real) } note "Created #{real_yml}." end end
Version data entries
10 entries across 10 versions & 1 rubygems