Class: TinyMCE::Rails::AssetManifest

Inherits:
Object
  • Object
show all
Defined in:
lib/tinymce/rails/asset_manifest.rb

Direct Known Subclasses

JsonManifest, NullManifest, YamlManifest

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#fileObject (readonly)

Returns the value of attribute file.


4
5
6
# File 'lib/tinymce/rails/asset_manifest.rb', line 4

def file
  @file
end

Class Method Details

.load(manifest_path) ⇒ Object


6
7
8
9
10
11
# File 'lib/tinymce/rails/asset_manifest.rb', line 6

def self.load(manifest_path)
  JsonManifest.try(manifest_path, ".sprockets-manifest*.json") ||
    JsonManifest.try(manifest_path, "manifest*.json") ||
    YamlManifest.try(manifest_path) ||
    NullManifest.new
end

Instance Method Details

#asset_path(logical_path) ⇒ Object


21
22
23
24
25
# File 'lib/tinymce/rails/asset_manifest.rb', line 21

def asset_path(logical_path)
  if digested = assets[logical_path]
    yield digested, logical_path if block_given?
  end
end

#each(pattern) ⇒ Object


13
14
15
16
17
18
19
# File 'lib/tinymce/rails/asset_manifest.rb', line 13

def each(pattern)
  assets.each_key do |asset|
    if asset =~ pattern && !index_asset?(asset)
      yield asset
    end
  end
end

#to_sObject


27
28
29
# File 'lib/tinymce/rails/asset_manifest.rb', line 27

def to_s
  dump
end