# File lib/tinymce/rails/asset_manifest.rb, line 20 def initialize(file) @file = file @manifest = YAML.load_file(file) end
# File lib/tinymce/rails/asset_manifest.rb, line 15 def self.try(manifest_path) yaml_file = File.join(manifest_path, "manifest.yml") new(yaml_file) if File.exists?(yaml_file) end
# File lib/tinymce/rails/asset_manifest.rb, line 25 def append(logical_path, file) @manifest[logical_path] = logical_path end
# File lib/tinymce/rails/asset_manifest.rb, line 50 def dump(io=nil) YAML.dump(@manifest, io) end
# File lib/tinymce/rails/asset_manifest.rb, line 40 def each(pattern) @manifest.each_key do |asset| yield asset if asset =~ pattern end end
# File lib/tinymce/rails/asset_manifest.rb, line 29 def remove(logical_path) @manifest.delete(logical_path) end
# File lib/tinymce/rails/asset_manifest.rb, line 33 def remove_digest(logical_path) if digested = @manifest[logical_path] @manifest[logical_path] = logical_path yield digested, logical_path if block_given? end end
# File lib/tinymce/rails/asset_manifest.rb, line 46 def to_s dump end
# File lib/tinymce/rails/asset_manifest.rb, line 54 def write File.open(@file, "wb") { |f| dump(f) } end