Methods
- A
- B
- C
- D
- E
- F
- G
- M
- N
- V
Class Public methods
We want to exit on failure to be kind to other libraries This is only when accessing via CLI
# 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
Instance Public methods
Instance Protected methods
Also aliased as: camelized
Also aliased as: defined_app_const_base?
Define file as an alias to create_file for backwards compatibility.
# 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
# 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