Class: Pod::Command::Module::Create

Inherits:
Pod::Command::Module show all
Includes:
ProjectDirectory
Defined in:
lib/cocoapods-module/command/module/create.rb

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ Create

Returns a new instance of Create.



16
17
18
19
20
21
# File 'lib/cocoapods-module/command/module/create.rb', line 16

def initialize(argv)
  @project_name = argv.shift_argument
  path = argv.shift_argument
  @project_path = Pathname.new(path) if path
  super
end

Instance Method Details

#runObject



34
35
36
37
# File 'lib/cocoapods-module/command/module/create.rb', line 34

def run
	UI.puts "Start execute pod module create command..."
	exec("pod lib create #{@project_name} --template-url='https://gitee.com/giraffex/pod-template.git'")
end

#validate!Object



23
24
25
26
27
28
29
30
31
32
# File 'lib/cocoapods-module/command/module/create.rb', line 23

def validate!
  super
  unless @project_name
  	help! 'Specify the project name.'
  end

  unless @project_path
		@project_path = Pathname.getwd + @project_name
	end
end