Class: Recap::Support::CLI

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/recap/support/cli.rb

Overview

Recap provides a simple command-line tool (‘recap`) to generate a `Capfile` in your project.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameObject

Returns the value of attribute name.



13
14
15
# File 'lib/recap/support/cli.rb', line 13

def name
  @name
end

#recipeObject

Returns the value of attribute recipe.



13
14
15
# File 'lib/recap/support/cli.rb', line 13

def recipe
  @recipe
end

#repositoryObject

Returns the value of attribute repository.



13
14
15
# File 'lib/recap/support/cli.rb', line 13

def repository
  @repository
end

#serverObject

Returns the value of attribute server.



13
14
15
# File 'lib/recap/support/cli.rb', line 13

def server
  @server
end

Class Method Details

.source_rootObject



15
16
17
# File 'lib/recap/support/cli.rb', line 15

def self.source_root
  File.expand_path("../templates", __FILE__)
end

Instance Method Details

#setupObject



25
26
27
28
29
30
31
# File 'lib/recap/support/cli.rb', line 25

def setup
  self.name = options["name"] || guess_name
  self.repository = options["repo"] || guess_repository
  self.recipe = options["recipe"] || guess_recipe
  self.server = options["server"] || 'your-server-address'
  template 'Capfile.erb', 'Capfile'
end