Class: Lathe::CLI

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject

   method_option :miniapp, :type => :boolean



9
10
11
# File 'lib/lathe/cli.rb', line 9

def self.source_root
	File.join File.dirname(__FILE__), 'generators'
end

Instance Method Details

#newObject



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

def new
	if app_name
		if(options[:exclude]) then
			@app_path=app_name
			directory 'mini_app', @app_path
		else
			@app_path="mini_app_"+app_name
			directory 'mini_app', @app_path
		end	
	else
		say '请输入应用名称'
	end
end