Sha256: c0b20e4c35da36356179b7c8a57b8af7fa89c562b593b3744c47169697526b9c
Contents?: true
Size: 613 Bytes
Versions: 35
Compression:
Stored size: 613 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.exist?(sample_yml) && !File.exist?(real_yml) Interaction.announce 'Creating ' + real_yml sample = File.read(sample_yml) adapter = sample.match(/adapter: (\w+)/).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) } Interaction.note "Created #{real_yml}." end end
Version data entries
35 entries across 35 versions & 1 rubygems