Class: Pod::Command::X::Lib::Create
- Inherits:
-
Pod::Command::X::Lib
- Object
- Pod::Command
- Pod::Command::X
- Pod::Command::X::Lib
- Pod::Command::X::Lib::Create
- Extended by:
- Executable
- Defined in:
- lib/cocoapods-x/command/libary/create.rb
Instance Method Summary collapse
-
#initialize(argv) ⇒ Create
constructor
A new instance of Create.
- #run ⇒ Object
Constructor Details
#initialize(argv) ⇒ Create
Returns a new instance of Create.
21 22 23 24 |
# File 'lib/cocoapods-x/command/libary/create.rb', line 21 def initialize(argv) @name = argv.shift_argument super end |
Instance Method Details
#run ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/cocoapods-x/command/libary/create.rb', line 26 def run project_name = @name target_url = File.join(Dir::pwd, project_name) configure_url = Pod::X::Sandbox::workspace::template::configure template_url = Pod::X::Sandbox::workspace::template::ios_template if Dir::exist?(target_url) && !Dir::empty?(target_url) UI.puts 'Pod::X '.magenta + "fatal: destination path '#{project_name}' already exists and is not an empty directory.".red else rm! ['-rf', target_url] if !template_url.exist? Pod::X::Sandbox::update! end UI.section("Configuring #{project_name} template.") do system('ruby', configure_url.to_s, template_url.to_s, target_url.to_s, project_name.to_s) end end end |