Method: AndParcel::RemoveRequest#remove

Defined in:
lib/andparcel/parcel.rb

#remove(parcel_name) ⇒ Object



443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
# File 'lib/andparcel/parcel.rb', line 443

def remove(parcel_name)
  @parcel_root=File.join(root, 'parcels', parcel_name)
  
  if File.exists?(@parcel_root)
    dest=Dir[File.join(@parcel_root, '*.zip')][0]
    
    if dest
      Zip::ZipFile.open(dest) do |zf|
        manifest(zf) if
          assets(zf) if
            resources(zf) if
              libs(zf)
      end
      
      FileUtils.rm_rf @parcel_root
    end
  else
    raise "Parcel not installed: #{parcel_name}"
  end
end