new def create_database build(:database_yaml) end def database_yaml copy_file "database.yml" end ‣ Argument becomes the method called on the AppBuilder ➤ Rails::Generators::AppGenerator.start
me to .example your .yml file?" ) copy_file "config/database.yml", "config/database.yml.example" remove_file "config/database.yml" link_file "some_path/database.yml.postgres", "config/database.yml" append_to_file ".gitignore" do "config/database.yml" end end
me to .example your .yml file?" ) copy_file "config/database.yml", "config/database.yml.example" remove_file "config/database.yml" link_file "some_path/database.yml.postgres", "config/database.yml" append_to_file ".gitignore" do "config/database.yml" end end class MyAppBuilder < Rails::AppBuilder def database_yml end end template "config/database.#{@options[:database]}.yml" "config/database.yml.example"
me to .example your .yml file?" ) link_file "some_path/database.yml.postgres", "config/database.yml" append_to_file ".gitignore" do "config/database.yml" end end class MyAppBuilder < Rails::AppBuilder def database_yml end end template "config/database.#{@options[:database]}.yml" "config/database.yml.example" copy_file "#{dest_root}/config/database.yml.example", "#{dest_root}/config/database.yml"
me to .example your .yml file?" ) append_to_file ".gitignore" do "config/database.yml" end end class MyAppBuilder < Rails::AppBuilder def database_yml end end template "config/database.#{@options[:database]}.yml" "config/database.yml.example" unless @options[:skip_git] end copy_file "#{dest_root}/config/database.yml.example", "#{dest_root}/config/database.yml"
me to .example your .yml file?" ) append_to_file ".gitignore" do "config/database.yml" end end class MyAppBuilder < Rails::AppBuilder def database_yml end end template "config/database.#{@options[:database]}.yml" "config/database.yml.example" unless @options[:skip_git] end copy_file "#{dest_root}/config/database.yml.example", "#{dest_root}/config/database.yml" else super
Your Leftovers ‣ Not implemented in AppBuilder class MyAppBuilder < AppBuilder def leftovers end end # Do some stuff here... maybe copy RSpec support files? # Create an .rvmrc file?