Class: Pod::Command::Mod::Create

Inherits:
Pod::Command::Mod show all
Defined in:
lib/cocoapods-modularization/command/mod/create.rb

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ Create

Returns a new instance of Create.



15
16
17
18
# File 'lib/cocoapods-modularization/command/mod/create.rb', line 15

def initialize(argv)
  @name = argv.shift_argument
  super
end

Instance Method Details

#runObject



28
29
30
# File 'lib/cocoapods-modularization/command/mod/create.rb', line 28

def run
  `pod lib create #{@name} --template-url='http://gitlab.appshahe.com/ios-specs/template.git'`
end

#validate!Object



20
21
22
23
24
25
26
# File 'lib/cocoapods-modularization/command/mod/create.rb', line 20

def validate!
  super
  help! 'A name for the Pod is required.' unless @name
  help! 'The Pod name cannot contain spaces.' if @name =~ /\s/
  help! 'The Pod name cannot contain plusses.' if @name =~ /\+/
  help! "The Pod name cannot begin with a '.'" if @name[0, 1] == '.'
end