W3cubDocs

/Padrino

Module: Padrino::Generators::Runner

Included in:
Plugin, Project

Overview

Responsible for executing plugin and template instructions including common actions for modifying a project or application.

Instance Method Summary

Instance Method Details

#app(name) ⇒ Object

Executes App generator. Accepts an optional block allowing generation inside subapp.

Examples:

app :name
app :name do
 generate :model, "posts title:string" # generate a model inside of subapp
end

Parameters:

  • name (Symbol) — Name of (sub)application to generate.
  • block (Proc) — Commands to execute in context of (sub)appliation directory.

#generate(type, arguments = "") ⇒ Object

Executes generator command for specified type with given arguments.

Examples:

generate :model, "post title:string body:text"
generate :controller, "posts get:index get:new post:new"
generate :migration, "AddEmailToUser email:string"

Parameters:

  • type (Symbol) — Type of component module.
  • arguments (String) (defaults to: "") — Arguments to send to component generator.

#git(*args) ⇒ Object

Executes git commmands in project.

Examples:

git :init
git :add, "."
git :commit, "hello world"

Parameters:

  • action (Symbol) — Git command to execute.
  • arguments (String) — Arguments to invoke on git command.

#project(options = {}) ⇒ Object

Generates project scaffold based on a given template file.

Examples:

project :test => :shoulda, :orm => :activerecord, :renderer => "haml"

Parameters:

  • options (Hash) (defaults to: {}) — Options to use to generate the project.

#rake(command) ⇒ Object

Executes rake command with given arguments.

Examples:

rake "custom task1 task2"

Parameters:

  • command (String) — Rake tasks to execute.

© 2010–2016 Padrino
Licensed under the MIT License.
http://www.rubydoc.info/github/padrino/padrino-framework/Padrino/Generators/Runner