Module: Thor::Actions

Included in:
Angus::CommandProcessor
Defined in:
lib/angus/generator/thor/resource.rb,
lib/angus/generator/thor/new_project.rb

Defined Under Namespace

Classes: NewProject, Resource

Instance Method Summary collapse

Instance Method Details

#new_project(name, config = {}) ⇒ Object

Creates a new project.

Examples:


new_project 'great-api'

Parameters:

  • name (String)

    The name of the resource.

  • config (Hash) (defaults to: {})


16
17
18
# File 'lib/angus/generator/thor/new_project.rb', line 16

def new_project(name, config = {})
  action NewProject.new(self, name, config)
end

#resource(name, actions, config = {}) ⇒ Object

Creates a new resource.

Examples:


resource 'user', 'resouces', 'definitions'

Parameters:

  • name (String)

    The name of the resource.

  • config (Hash) (defaults to: {})


16
17
18
# File 'lib/angus/generator/thor/resource.rb', line 16

def resource(name, actions, config = {})
  action Resource.new(self, name, actions, config)
end