class TinyMCE::YamlManifest

def self.try(manifest_path)

def self.try(manifest_path)
  yaml_file = File.join(manifest_path, "manifest.yml")
  new(yaml_file) if File.exists?(yaml_file)
end

def append(logical_path, file)

def append(logical_path, file)
  @manifest[logical_path] = logical_path
end

def dump(io=nil)

def dump(io=nil)
  YAML.dump(@manifest, io)
end

def each(pattern)

def each(pattern)
  @manifest.each_key do |asset|
    yield asset if asset =~ pattern
  end
end

def initialize(file)

def initialize(file)
  @file = file
  @manifest = YAML.load_file(file)
end

def remove(logical_path)

def remove(logical_path)
  @manifest.delete(logical_path)
end

def remove_digest(logical_path)

def remove_digest(logical_path)
  if digested = @manifest[logical_path]
    @manifest[logical_path] = logical_path
    yield digested, logical_path if block_given?
  end
end

def to_s

def to_s
  dump
end

def write

def write
  File.open(@file, "wb") { |f| dump(f) }
end