Class: Andy::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/andy_thor.rb

Instance Method Summary collapse

Constructor Details

#initialize(args = [], options = {}, config = {}) ⇒ CLI

Returns a new instance of CLI.



10
11
12
13
14
15
16
# File 'lib/andy_thor.rb', line 10

def initialize(args=[], options={}, config={})
  super(args, options, config)
  @config = Andy::Config.new
  @list = Andy::Api::List.new @config
  @install = Andy::Api::Install.new @config
  @fetch = Andy::Api::Fetch.new
end

Instance Method Details

#listObject



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

def list
	if options[:local]
    list_local
  end
  if options[:remote]
     list_remote
  end
  if !options[:local] && !options[:remote]
    list_local
    list_remote
  end
end

#new(dir_name) ⇒ Object



21
22
23
24
25
26
27
28
# File 'lib/andy_thor.rb', line 21

def new(dir_name)
  # def install(pint_name, project_name, dir_name, project_parent_location)
  pint_name = options[:pint_name]
  app_name = options[:app_name] || dir_name
  project_parent_location = Dir.getwd
  @install.install(pint_name, app_name, dir_name, project_parent_location)
  puts "Created project #{app_name} in #{dir_name}"
end

#updateObject



47
48
49
# File 'lib/andy_thor.rb', line 47

def update
  catalog = @fetch.build_pint_catalog
end