Class: AppGenerator
- Inherits:
-
Rails::Generator::Base
- Object
- Rails::Generator::Base
- AppGenerator
- Defined in:
- lib/rails_generator/generators/applications/app/app_generator.rb
Constant Summary collapse
- DEFAULT_SHEBANG =
File.join(Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name'])
- DATABASES =
%w( mysql oracle postgresql sqlite2 sqlite3 frontbase ibm_db )
- DEFAULT_DATABASE =
'sqlite3'
Instance Attribute Summary
Attributes inherited from Rails::Generator::Base
#args, #destination_root, #source_root
Attributes included from Rails::Generator::Options
Instance Method Summary collapse
- #after_generate ⇒ Object
-
#initialize(runtime_args, runtime_options = {}) ⇒ AppGenerator
constructor
A new instance of AppGenerator.
- #manifest ⇒ Object
Methods inherited from Rails::Generator::Base
#destination_path, #source_path
Methods included from Rails::Generator::Options
Constructor Details
#initialize(runtime_args, runtime_options = {}) ⇒ AppGenerator
Returns a new instance of AppGenerator.
17 18 19 20 21 22 23 24 25 |
# File 'lib/rails_generator/generators/applications/app/app_generator.rb', line 17 def initialize(runtime_args, = {}) super usage if args.empty? usage("Databases supported for preconfiguration are: #{DATABASES.join(", ")}") if ([:db] && !DATABASES.include?([:db])) @destination_root = args.shift @app_name = File.basename(File.(@destination_root)) end |
Instance Method Details
#after_generate ⇒ Object
41 42 43 44 45 |
# File 'lib/rails_generator/generators/applications/app/app_generator.rb', line 41 def after_generate if [:template] Rails::TemplateRunner.new([:template], @destination_root) end end |
#manifest ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/rails_generator/generators/applications/app/app_generator.rb', line 27 def manifest record do |m| create_directories(m) create_root_files(m) create_app_files(m) create_config_files(m) create_script_files(m) create_test_files(m) create_public_files(m) create_documentation_file(m) create_log_files(m) end end |