The application builder allows you to override elements of the application
generator without being forced to reverse the operations of the default
generator.
This allows you to override entire operations, like the creation of the
Gemfile, README, or
JavaScript files, without needing to know exactly what those operations do
so you can create another template action.
Methods
- A
-
- C
-
- D
-
- G
-
- L
-
- P
-
- R
-
- S
-
- T
-
- V
-
Instance Public methods
Source:
show
| on GitHub
def app
directory 'app'
git_keep 'app/mailers'
git_keep 'app/models'
end
Source:
show
| on GitHub
def config
empty_directory "config"
inside "config" do
template "routes.rb"
template "application.rb"
template "environment.rb"
directory "environments"
directory "initializers"
directory "locales"
end
end
Source:
show
| on GitHub
def database_yml
template "config/databases/#{options[:database]}.yml", "config/database.yml"
end
Source:
show
| on GitHub
def gitignore
copy_file "gitignore", ".gitignore"
end
Source:
show
| on GitHub
def lib
empty_directory "lib"
empty_directory_with_gitkeep "lib/tasks"
empty_directory_with_gitkeep "lib/assets"
end
Source:
show
| on GitHub
def log
empty_directory_with_gitkeep "log"
end
Source:
show
| on GitHub
def public_directory
directory "public", "public", :recursive => false
end
Source:
show
| on GitHub
def readme
copy_file "README", "README.rdoc"
end
Source:
show
| on GitHub
def script
directory "script" do |content|
"#{shebang}\n" + content
end
chmod "script", 0755, :verbose => false
end
Source:
show
| on GitHub
def test
empty_directory_with_gitkeep "test/fixtures"
empty_directory_with_gitkeep "test/functional"
empty_directory_with_gitkeep "test/integration"
empty_directory_with_gitkeep "test/unit"
template "test/performance/browsing_test.rb"
template "test/test_helper.rb"
end
Source:
show
| on GitHub
def tmp
empty_directory "tmp/cache"
empty_directory "tmp/cache/assets"
end
Source:
show
| on GitHub
def vendor
vendor_javascripts
vendor_stylesheets
vendor_plugins
end
Source:
show
| on GitHub
def vendor_javascripts
empty_directory_with_gitkeep "vendor/assets/javascripts"
end
Source:
show
| on GitHub
def vendor_plugins
empty_directory_with_gitkeep "vendor/plugins"
end
Source:
show
| on GitHub
def vendor_stylesheets
empty_directory_with_gitkeep "vendor/assets/stylesheets"
end