Class: Nova::CLI

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

Overview

Handles the command line interface. Uses thor to do that.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootString

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

The source thor should use for managing files.

Returns:

  • (String)


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

def self.source_root
  File.absolute_path("../../generator/template", __FILE__)
end

Instance Method Details

#install(to) ⇒ void

This method returns an undefined value.

Installs a galaxy into the given path. Just copies the files and folders in lib/generator/template/new_install into the given folder.



25
26
27
# File 'lib/nova/cli.rb', line 25

def install(to)
   directory("new_install", to)
end

#listvoid

This method returns an undefined value.

Lists all of the stars that the project has available to it. Requires the –path parameter or to be in a project folder.



34
35
36
37
38
39
40
41
42
43
44
# File 'lib/nova/cli.rb', line 34

def list
  project.require_files

  Star.stars.each do |key, value|
    shell.say("#{key}:", :green, :bold)

    value.each do |k, v|
      shell.say "\t#{k}"
    end
  end
end