Sha256: 304dd4c95cf373815d24ff13a9886cba5c3db3aaf15f3b0e37e80208fe55372d

Contents?: true

Size: 1.29 KB

Versions: 5

Compression:

Stored size: 1.29 KB

Contents

#!/usr/bin/env ruby

require 'generic_app'

def get_input(default_value)
  value_input = gets.chomp
  if value_input == ""
    return default_value
  else
    return value_input
  end
end

puts '***********************'
puts 'Welcome to Generic App!'
puts

default_subdir = 'tmp9'
puts
puts "DEFAULT VALUE: #{default_subdir}"
puts 'Enter the directory name you wish to use for your generic app:'
subdir_name = get_input(default_subdir)
puts "You chose '#{subdir_name}'."
puts

default_email = 'please-change-me-at-config-initializers-devise@example.com'
puts "DEFAULT VALUE: #{default_email}"
puts "Enter the email address you wish to use for your generic app's mailer:"
email = get_input(default_email)

GenericApp.create_new(subdir_name, email)

puts '*********************************************'
puts "BEGIN TESTING THE #{subdir_name} RAILS APP"
system("cd #{subdir_name} && sh test_app.sh")
puts "FINISHED TESTING THE #{subdir_name} RAILS APP"
puts '*********************************************'

puts "Your new Rails app has been created at #{ENV['PWD']}/#{subdir_name} ."
puts 'It is currently configured to use the SQLite database in the'
puts 'development environment.'
puts 'To set up the PostgreSQL database, enter the'
puts "#{ENV['PWD']}/#{subdir_name} directory and enter the command"
puts 'sh setup-pg.sh .'

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
generic_app-1.0.4 bin/generic_app
generic_app-1.0.3 bin/generic_app
generic_app-1.0.2 bin/generic_app
generic_app-1.0.1 bin/generic_app
generic_app-1.0.0 bin/generic_app