module PatchedResource

Public Instance Methods

delete(key) click to toggle source

Monkeypatch to delete a file from both the local file system and Google Cloud Storage. Done atomically to prevent circular file syncing where files never get deleted.

@param [String] key Name of the gem to delete.

Calls superclass method
# File lib/patched/storage.rb, line 26
def delete key
  file = content_filename key
  return unless File.exist?(file) && File.exist?(properties_filename)
  Filelock file do
    super
    Google::Cloud::Gemserver::GCS.delete_file file
    Google::Cloud::Gemserver::GCS.delete_file properties_filename
  end
end