Loading db/seeds/first_user.rb +18 −24 Original line number Diff line number Diff line Loading @@ -5,9 +5,13 @@ # Add a parameterized user to database. # # # config_path = File.join (File.dirname(__FILE__), '..', '..', 'config') require File.join(config_path, 'environment') require File.join(config_path, 'initializers', '_load_app_config.rb') require File.join(File.dirname(__FILE__), '..', '..', 'config', 'environment') require File.join(File.dirname(__FILE__), '..', '..','config', 'initializers', '_load_app_config.rb') require 'yaml' def read_password Loading @@ -18,10 +22,6 @@ def read_password printf 'Enter password: ' pw1 = $stdin.gets.chomp puts if pw1.length < 6 puts "Too short (minimum 6 characters)" next end printf 'Again: ' pw2 = $stdin.gets.chomp puts Loading @@ -44,13 +44,7 @@ else email = ARGS[:email] end if ARGS[:password] == nil password = read_password else password = ARGS[:password] end #printf "Building: %s, %s, '%s'\n", username, email, password password = (ARGS[:password] == nil ? read_password : ARGS[:password]) user = User.build( :email => email, :username => username, Loading lib/tasks/db.rake +0 −9 Original line number Diff line number Diff line Loading @@ -59,13 +59,6 @@ namespace :db do puts "you did it!" end task :reset do puts "making a new base user" Rake::Task['db:purge'].invoke Rake::Task['db:seed:dev'].invoke puts "you did it!" end desc 'Purge database, add a new user' task :first_user, :username, :password do |t, args| puts "Purging database and adding a new user" Loading @@ -75,8 +68,6 @@ namespace :db do Rake::Task['db:seed:first_user'].invoke(username, password) end task :fix_diaspora_handle do puts "fixing the people in this seed" require File.dirname(__FILE__) + '/../../config/environment' Loading Loading
db/seeds/first_user.rb +18 −24 Original line number Diff line number Diff line Loading @@ -5,9 +5,13 @@ # Add a parameterized user to database. # # # config_path = File.join (File.dirname(__FILE__), '..', '..', 'config') require File.join(config_path, 'environment') require File.join(config_path, 'initializers', '_load_app_config.rb') require File.join(File.dirname(__FILE__), '..', '..', 'config', 'environment') require File.join(File.dirname(__FILE__), '..', '..','config', 'initializers', '_load_app_config.rb') require 'yaml' def read_password Loading @@ -18,10 +22,6 @@ def read_password printf 'Enter password: ' pw1 = $stdin.gets.chomp puts if pw1.length < 6 puts "Too short (minimum 6 characters)" next end printf 'Again: ' pw2 = $stdin.gets.chomp puts Loading @@ -44,13 +44,7 @@ else email = ARGS[:email] end if ARGS[:password] == nil password = read_password else password = ARGS[:password] end #printf "Building: %s, %s, '%s'\n", username, email, password password = (ARGS[:password] == nil ? read_password : ARGS[:password]) user = User.build( :email => email, :username => username, Loading
lib/tasks/db.rake +0 −9 Original line number Diff line number Diff line Loading @@ -59,13 +59,6 @@ namespace :db do puts "you did it!" end task :reset do puts "making a new base user" Rake::Task['db:purge'].invoke Rake::Task['db:seed:dev'].invoke puts "you did it!" end desc 'Purge database, add a new user' task :first_user, :username, :password do |t, args| puts "Purging database and adding a new user" Loading @@ -75,8 +68,6 @@ namespace :db do Rake::Task['db:seed:first_user'].invoke(username, password) end task :fix_diaspora_handle do puts "fixing the people in this seed" require File.dirname(__FILE__) + '/../../config/environment' Loading