Class: Andy::CLI
- Inherits:
-
Thor
- Object
- Thor
- Andy::CLI
- Defined in:
- lib/andy_thor.rb
Instance Method Summary collapse
-
#initialize(args = [], options = {}, config = {}) ⇒ CLI
constructor
A new instance of CLI.
- #list ⇒ Object
- #new(dir_name) ⇒ Object
- #update ⇒ Object
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=[], ={}, config={}) super(args, , 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
#list ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/andy_thor.rb', line 33 def list if [:local] list_local end if [:remote] list_remote end if ![:local] && ![: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 = [:pint_name] app_name = [: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 |
#update ⇒ Object
47 48 49 |
# File 'lib/andy_thor.rb', line 47 def update catalog = @fetch.build_pint_catalog end |