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 157 157: def initialize(*args) 158: raise Error, "Options should be given after the application name. For details run: rails --help" if args[0].blank? 159: 160: super 161: 162: if !options[:skip_active_record] && !DATABASES.include?(options[:database]) 163: raise Error, "Invalid value for --database option. Supported for preconfiguration are: #{DATABASES.join(", ")}." 164: end 165: end
Class Protected methods
Instance Public methods
Instance Protected methods
This method is also aliased as
camelized
Alias for app_const_base
This method is also aliased as
defined_app_const_base?
# File railties/lib/rails/generators/rails/app/app_generator.rb, line 255 255: def defined_app_const_base 256: Rails.respond_to?(:application) && defined?(Rails::Application) && 257: Rails.application.is_a?(Rails::Application) && Rails.application.class.name.sub(/::Application$/, "") 258: end
Alias for 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 285 285: def mysql_socket 286: @mysql_socket ||= [ 287: "/tmp/mysql.sock", # default 288: "/var/run/mysqld/mysqld.sock", # debian/gentoo 289: "/var/tmp/mysql.sock", # freebsd 290: "/var/lib/mysql/mysql.sock", # fedora 291: "/opt/local/lib/mysql/mysql.sock", # fedora 292: "/opt/local/var/run/mysqld/mysqld.sock", # mac + darwinports + mysql 293: "/opt/local/var/run/mysql4/mysqld.sock", # mac + darwinports + mysql4 294: "/opt/local/var/run/mysql5/mysqld.sock", # mac + darwinports + mysql5 295: "/opt/lampp/var/mysql/mysql.sock" # xampp for linux 296: ].find { |f| File.exist?(f) } unless RbConfig::CONFIG['host_os'] =~ /mswin|mingw/ 297: end
# File railties/lib/rails/generators/rails/app/app_generator.rb, line 271 271: def valid_const? 272: if app_const =~ /^\d/ 273: raise Error, "Invalid application name #{app_name}. Please give a name which does not start with numbers." 274: elsif RESERVED_NAMES.include?(app_name) 275: raise Error, "Invalid application name #{app_name}. Please give a name which does not match one of the reserved rails words." 276: elsif Object.const_defined?(app_const_base) 277: raise Error, "Invalid application name #{app_name}, constant #{app_const_base} is already in use. Please choose another application name." 278: end 279: end