Class: Pod::Command::Plugins::Create
- Inherits:
-
Pod::Command::Plugins
- Object
- Pod::Command
- Pod::Command::Plugins
- Pod::Command::Plugins::Create
- Extended by:
- Executable
- Defined in:
- lib/pod/command/plugins/create.rb
Overview
The create subcommand. Used to create a new plugin using either the default template (CocoaPods/cocoapods-plugin-template) or a custom template
Constant Summary collapse
- NAME_PREFIX =
'cocoapods-'
Instance Method Summary collapse
-
#initialize(argv) ⇒ Create
constructor
A new instance of Create.
- #run ⇒ Object
- #validate! ⇒ Object
Constructor Details
#initialize(argv) ⇒ Create
Returns a new instance of Create.
26 27 28 29 30 31 32 33 |
# File 'lib/pod/command/plugins/create.rb', line 26 def initialize(argv) @name = argv.shift_argument unless @name.nil? || @name.empty? || @name.index(NAME_PREFIX) == 0 @name = @name.dup.prepend(NAME_PREFIX) end @template_url = argv.shift_argument super end |
Instance Method Details
#run ⇒ Object
45 46 47 48 |
# File 'lib/pod/command/plugins/create.rb', line 45 def run clone_template configure_template end |
#validate! ⇒ Object
35 36 37 38 39 40 41 42 43 |
# File 'lib/pod/command/plugins/create.rb', line 35 def validate! super if @name.nil? || @name.empty? help! 'A name for the plugin is required.' end if @name.match(/\s/) help! 'The plugin name cannot contain spaces.' end end |