class Pod::Command::X::Lib::Create

Public Class Methods

new(argv) click to toggle source
Calls superclass method
# File lib/cocoapods-x/command/libary/create.rb, line 21
def initialize(argv)
    @name = argv.shift_argument
    super
end

Public Instance Methods

run() click to toggle source
# 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