Class: Pod::Command::Mod::Create
- Inherits:
-
Pod::Command::Mod
- Object
- Pod::Command
- Pod::Command::Mod
- Pod::Command::Mod::Create
- Defined in:
- lib/cocoapods-modularization/command/mod/create.rb
Instance Method Summary collapse
-
#initialize(argv) ⇒ Create
constructor
A new instance of Create.
- #run ⇒ Object
- #validate! ⇒ Object
Constructor Details
#initialize(argv) ⇒ 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
#run ⇒ Object
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 |