Class: TinyMCE::Rails::YamlManifest
Instance Attribute Summary
#file
Class Method Summary
collapse
Instance Method Summary
collapse
#asset_path, #each, load, #to_s
Constructor Details
Returns a new instance of YamlManifest.
9
10
11
12
|
# File 'lib/tinymce/rails/asset_manifest/yaml_manifest.rb', line 9
def initialize(file)
@file = file
@manifest = YAML.load_file(file)
end
|
Class Method Details
.try(manifest_path) ⇒ Object
4
5
6
7
|
# File 'lib/tinymce/rails/asset_manifest/yaml_manifest.rb', line 4
def self.try(manifest_path)
yaml_file = File.join(manifest_path, "manifest.yml")
new(yaml_file) if File.exist?(yaml_file)
end
|
Instance Method Details
#append(logical_path, file) ⇒ Object
14
15
16
|
# File 'lib/tinymce/rails/asset_manifest/yaml_manifest.rb', line 14
def append(logical_path, file)
assets[logical_path] = logical_path
end
|
#assets ⇒ Object
30
31
32
|
# File 'lib/tinymce/rails/asset_manifest/yaml_manifest.rb', line 30
def assets
@manifest
end
|
#dump(io = nil) ⇒ Object
34
35
36
|
# File 'lib/tinymce/rails/asset_manifest/yaml_manifest.rb', line 34
def dump(io=nil)
YAML.dump(@manifest, io)
end
|
#remove(logical_path) ⇒ Object
18
19
20
|
# File 'lib/tinymce/rails/asset_manifest/yaml_manifest.rb', line 18
def remove(logical_path)
assets.delete(logical_path)
end
|
#remove_digest(logical_path) ⇒ Object
22
23
24
25
26
27
28
|
# File 'lib/tinymce/rails/asset_manifest/yaml_manifest.rb', line 22
def remove_digest(logical_path)
asset_path(logical_path) do |digested, logical_path|
assets[logical_path] = logical_path
yield digested, logical_path if block_given?
end
end
|
#write ⇒ Object
38
39
40
|
# File 'lib/tinymce/rails/asset_manifest/yaml_manifest.rb', line 38
def write
File.open(@file, "wb") { |f| dump(f) }
end
|