Class: PrecompiledAssets::Manifest

Inherits:
Object
  • Object
show all
Defined in:
lib/precompiled_assets/manifest.rb

Defined Under Namespace

Classes: Error, NotFound, ParseError

Constant Summary collapse

DEFAULT_FILENAME =
'manifest.json'.freeze

Instance Method Summary collapse

Instance Method Details

#expired?Boolean

Returns:

  • (Boolean)


27
28
29
30
# File 'lib/precompiled_assets/manifest.rb', line 27

def expired?
  # Not intended for use in production environments.
  mtime && mtime != fetch_mtime
end

#includes_digested_path?(path_or_pathname) ⇒ Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/precompiled_assets/manifest.rb', line 18

def includes_digested_path?(path_or_pathname)
  digested_paths.include?(path_or_pathname.to_s)
end

#pathnameObject



14
15
16
# File 'lib/precompiled_assets/manifest.rb', line 14

def pathname
  @pathname ||= LocalPath.pathname.join(filename)
end

#resolve(path) ⇒ Object



10
11
12
# File 'lib/precompiled_assets/manifest.rb', line 10

def resolve(path)
  parsed_manifest[path]
end

#updated_atObject



22
23
24
25
# File 'lib/precompiled_assets/manifest.rb', line 22

def updated_at
  # Not intended for use in production environments.
  mtime || fetch_mtime
end