Class: Mgen::CLI

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

Instance Method Summary collapse

Methods included from Utils

#base_location, #create_directories, #create_new_file, #create_with_template, #error, #log, #remove_directories, #remove_files, source_root, #templates, #touch, #underscore

Instance Method Details

#buildObject



80
81
82
# File 'lib/mgen/cli.rb', line 80

def build
  say "Version #{Mgen::VERSION}"
end

#infoObject



56
57
58
# File 'lib/mgen/cli.rb', line 56

def info
  say "Version #{Mgen::VERSION}"
end

#new(name) ⇒ Object



65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/mgen/cli.rb', line 65

def new(name)
  if File.exist?(base_location.join(name))
    if yes? "#{name} already exists, do you want to override? (yes or no)", :yellow
      create(name)
    else
      say "Skipping #{name} because it already exists", :green
    end
  else
    create(name)
  end

end