Class: WebpackManifest::Manifest
- Inherits:
-
Object
- Object
- WebpackManifest::Manifest
show all
- Defined in:
- lib/webpack_manifest/manifest.rb
Defined Under Namespace
Classes: FileNotFoundError, MissingEntryError
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(path, cache: false) ⇒ Manifest
Returns a new instance of Manifest.
15
16
17
18
|
# File 'lib/webpack_manifest/manifest.rb', line 15
def initialize(path, cache: false)
@path = path.to_s
@cache = cache
end
|
Instance Attribute Details
#cache=(value) ⇒ Object
13
14
15
|
# File 'lib/webpack_manifest/manifest.rb', line 13
def cache=(value)
@cache = value
end
|
#path ⇒ Object
Returns the value of attribute path.
12
13
14
|
# File 'lib/webpack_manifest/manifest.rb', line 12
def path
@path
end
|
Instance Method Details
#assets ⇒ Object
34
35
36
|
# File 'lib/webpack_manifest/manifest.rb', line 34
def assets
data.values
end
|
#cache_enabled? ⇒ Boolean
38
39
40
|
# File 'lib/webpack_manifest/manifest.rb', line 38
def cache_enabled?
@cache
end
|
#find(name) ⇒ Object
30
31
32
|
# File 'lib/webpack_manifest/manifest.rb', line 30
def find(name)
data[name.to_s]
end
|
#lookup!(name) ⇒ Object
26
27
28
|
# File 'lib/webpack_manifest/manifest.rb', line 26
def lookup!(name)
find(name) || handle_missing_entry(name)
end
|
#lookup_pack_with_chunks!(name, type: nil) ⇒ Object
20
21
22
23
24
|
# File 'lib/webpack_manifest/manifest.rb', line 20
def lookup_pack_with_chunks!(name, type: nil)
manifest_pack_type = manifest_type(name, type)
manifest_pack_name = manifest_name(name, manifest_pack_type)
find('entrypoints')&.dig(manifest_pack_name, manifest_pack_type) || handle_missing_entry(name)
end
|