Projects

The simplest possible command to generate a base application would be:

$ padrino g project demo_project

This would construct a Padrino application DemoProject (which extends from
Padrino::Application) inside the folder demo_project at our current path.
Inside the application there would be configuration and setup performed for the
default components.

You can also instruct the generator to skip a certain component to avoid using
one at all (or to use your own):

$ padrino g project demo_project --test none --renderer none

You can also specify an alternate name for your core application using the
--app option:

$ padrino g project demo_project --app alternate_app_name # alias -n

The generator uses the bundler gem to resolve any application dependencies
when the application is newly created. The necessary bundler command can be
executed automatically through the generator with:

$ padrino g project demo_project --run_bundler # alias -b

This can also be done manually by executing the command bundle install in the
terminal at the root of the generated application.

For more examples of using the project generator in common cases, check out the
Basic Projects guide.

The generator framework within Padrino is extensible and additional components
and tools can be added easily. This would be achieved through forking our
project and reading through the code in lib/generators/project.rb and the
setup instructions inside the relevant files within
lib/generators/components/. We are happy to accept pull requests for
additional component types not originally included (although helping us maintain
them would also be appreciated).

Note: Be careful with your naming when using generators and do not have your
project name, or any models or controllers overlap. Avoid naming your app
"Posts" and then your controller or subapp with the same name.

Examples

Generate a project with a different application name from the project path

$ padrino g my_project -n blog

This will generate the project at path my_project/ but the applications name
will be Blog.

Generate a project with mongoid and run bundler after

$ padrino g project your_project -d mongoid -b

Generate a project with shoulda test and rr mocking

$ padrino g project your_project -t shoulda -m rr

Generate a project with sequel with mysql

$ padrino g project your_project -d sequel -a mysql

Generate a tiny project skeleton

$ padrino g project your_project --tiny

Choose a root for your project

$ padrino g project your_project -r /usr/local/padrino

This will create a new padrino project in /usr/local/padrino/your_project/