Methods
A
B
C
D
E
F
G
M
N
V
Class Public methods
exit_on_failure?()

We want to exit on failure to be kind to other libraries This is only when accessing via CLI

# File railties/lib/rails/commands/application.rb, line 31
def self.exit_on_failure?
  true
end
new(*args)
# File railties/lib/rails/generators/rails/app/app_generator.rb, line 156
def initialize(*args)
  raise Error, "Options should be given after the application name. For details run: rails --help" if args[0].blank?

  super

  if !options[:skip_active_record] && !DATABASES.include?(options[:database])
    raise Error, "Invalid value for --database option. Supported for preconfiguration are: #{DATABASES.join(", ")}."
  end
end
Class Protected methods
banner()
# File railties/lib/rails/generators/rails/app/app_generator.rb, line 237
def self.banner
  "rails new #{self.arguments.map(&:usage).join(' ')} [options]"
end
Instance Public methods
create_active_record_files()
# File railties/lib/rails/generators/rails/app/app_generator.rb, line 188
def create_active_record_files
  return if options[:skip_active_record]
  build(:database_yml)
end
create_app_files()
# File railties/lib/rails/generators/rails/app/app_generator.rb, line 176
def create_app_files
  build(:app)
end
create_boot_file()
# File railties/lib/rails/generators/rails/app/app_generator.rb, line 184
def create_boot_file
  template "config/boot.rb"
end
create_config_files()
# File railties/lib/rails/generators/rails/app/app_generator.rb, line 180
def create_config_files
  build(:config)
end
create_db_files()
# File railties/lib/rails/generators/rails/app/app_generator.rb, line 193
def create_db_files
  build(:db)
end
create_doc_files()
# File railties/lib/rails/generators/rails/app/app_generator.rb, line 197
def create_doc_files
  build(:doc)
end
create_lib_files()
# File railties/lib/rails/generators/rails/app/app_generator.rb, line 201
def create_lib_files
  build(:lib)
end
create_log_files()
# File railties/lib/rails/generators/rails/app/app_generator.rb, line 205
def create_log_files
  build(:log)
end
create_public_files()
# File railties/lib/rails/generators/rails/app/app_generator.rb, line 209
def create_public_files
  build(:public_directory)
end
create_root_files()
# File railties/lib/rails/generators/rails/app/app_generator.rb, line 168
def create_root_files
  build(:readme)
  build(:rakefile)
  build(:configru)
  build(:gitignore) unless options[:skip_git]
  build(:gemfile)   unless options[:skip_gemfile]
end
create_script_files()
# File railties/lib/rails/generators/rails/app/app_generator.rb, line 213
def create_script_files
  build(:script)
end
create_test_files()
# File railties/lib/rails/generators/rails/app/app_generator.rb, line 217
def create_test_files
  build(:test) unless options[:skip_test_unit]
end
create_tmp_files()
# File railties/lib/rails/generators/rails/app/app_generator.rb, line 221
def create_tmp_files
  build(:tmp)
end
create_vendor_files()
# File railties/lib/rails/generators/rails/app/app_generator.rb, line 225
def create_vendor_files
  build(:vendor)
end
finish_template()
# File railties/lib/rails/generators/rails/app/app_generator.rb, line 229
def finish_template
  build(:leftovers)
end
Instance Protected methods
app_const()
# File railties/lib/rails/generators/rails/app/app_generator.rb, line 266
def app_const
  @app_const ||= "#{app_const_base}::Application"
end
app_const_base()
Also aliased as: camelized
# File railties/lib/rails/generators/rails/app/app_generator.rb, line 261
def app_const_base
  @app_const_base ||= defined_app_const_base || app_name.gsub(%r\W/, '_').squeeze('_').camelize
end
app_name()
# File railties/lib/rails/generators/rails/app/app_generator.rb, line 246
def app_name
  @app_name ||= defined_app_const_base? ? defined_app_name : File.basename(destination_root)
end
app_secret()
# File railties/lib/rails/generators/rails/app/app_generator.rb, line 280
def app_secret
  SecureRandom.hex(64)
end
camelized()
defined_app_const_base()
Also aliased as: defined_app_const_base?
# File railties/lib/rails/generators/rails/app/app_generator.rb, line 254
def defined_app_const_base
  Rails.respond_to?(:application) && defined?(Rails::Application) &&
    Rails.application.is_a?(Rails::Application) && Rails.application.class.name.sub(%r::Application$/, "")
end
defined_app_const_base?()
defined_app_name()
# File railties/lib/rails/generators/rails/app/app_generator.rb, line 250
def defined_app_name
  defined_app_const_base.underscore
end
file(*args, &block)

Define file as an alias to create_file for backwards compatibility.

# File railties/lib/rails/generators/rails/app/app_generator.rb, line 242
def file(*args, &block)
  create_file(*args, &block)
end
get_builder_class()
# File railties/lib/rails/generators/rails/app/app_generator.rb, line 298
def get_builder_class
  defined?(::AppBuilder) ? ::AppBuilder : Rails::AppBuilder
end
mysql_socket()
# File railties/lib/rails/generators/rails/app/app_generator.rb, line 284
def mysql_socket
  @mysql_socket ||= [
    "/tmp/mysql.sock",                        # default
    "/var/run/mysqld/mysqld.sock",            # debian/gentoo
    "/var/tmp/mysql.sock",                    # freebsd
    "/var/lib/mysql/mysql.sock",              # fedora
    "/opt/local/lib/mysql/mysql.sock",        # fedora
    "/opt/local/var/run/mysqld/mysqld.sock",  # mac + darwinports + mysql
    "/opt/local/var/run/mysql4/mysqld.sock",  # mac + darwinports + mysql4
    "/opt/local/var/run/mysql5/mysqld.sock",  # mac + darwinports + mysql5
    "/opt/lampp/var/mysql/mysql.sock"         # xampp for linux
  ].find { |f| File.exist?(f) } unless RbConfig::CONFIG['host_os'] =~ %rmswin|mingw/
end
valid_const?()
# File railties/lib/rails/generators/rails/app/app_generator.rb, line 270
def valid_const?
  if app_const =~ %r^\d/
    raise Error, "Invalid application name #{app_name}. Please give a name which does not start with numbers."
  elsif RESERVED_NAMES.include?(app_name)
    raise Error, "Invalid application name #{app_name}. Please give a name which does not match one of the reserved rails words."
  elsif Object.const_defined?(app_const_base)
    raise Error, "Invalid application name #{app_name}, constant #{app_const_base} is already in use. Please choose another application name."
  end
end