Class: Nu::CLI

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCLI

Returns a new instance of CLI.



9
10
11
12
13
# File 'lib/nu/cli.rb', line 9

def initialize(*)
  super

  @proj = Nu::Project.new
end

Class Method Details

.source_rootObject



52
53
54
# File 'lib/nu/cli.rb', line 52

def self.source_root
  File.dirname(__FILE__)
end

Instance Method Details

#install(*names) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/nu/cli.rb', line 18

def install(*names)

  loc = @proj.location
  cl = options['location']
ver = options['version']

  loc = cl unless cl.nil?

  names.each do |n|
loader = Nu::Loader.new(n, loc, ver)
loader.copy_to_lib
  end
end

#lib(folder) ⇒ Object



38
39
40
# File 'lib/nu/cli.rb', line 38

def lib(folder)
  @proj.location= folder
end

#uninstall(gem) ⇒ Object



33
34
35
# File 'lib/nu/cli.rb', line 33

def uninstall(gem)
	
end

#uselongnamesObject



43
44
45
# File 'lib/nu/cli.rb', line 43

def uselongnames
  @proj.use_long_names
end

#useshortnamesObject



48
49
50
# File 'lib/nu/cli.rb', line 48

def useshortnames
  @proj.use_short_names
end