Sha256: b30bcd12969993ae3d28500fb3aac004d407ac72b5001bbc2849d525ac9fd48d

Contents?: true

Size: 941 Bytes

Versions: 17

Compression:

Stored size: 941 Bytes

Contents

require Webby.libpath(*%w[webby resources resource])

module Webby::Resources

# A Static resource is any file in the content folder that does not
# contain YAML meta-data at the top of the file and does not start with
# and underscore "_" character (those are partials). Static resources will
# be copied as-is from the content directory to the output directory.
#
class Static < Resource

  # Returns the contents of the file.
  #
  def render
    Webby.deprecated "render", "it is being replaced by the Renderer#render() method"
    self._read
  end

  # Returns +true+ if this static file is newer than its corresponding output
  # product. The static file needs to be copied to the output directory.
  #
  def dirty?
    return true unless test(?e, destination)
    @mtime > ::File.mtime(destination)
  end

  # :stopdoc:
  def _read
    ::File.read(path)
  end
  # :startdoc:

end  # class Layout
end  # module Webby::Resources

# EOF

Version data entries

17 entries across 17 versions & 8 rubygems

Version Path
TwP-webby-0.9.1 lib/webby/resources/static.rb
TwP-webby-0.9.2 lib/webby/resources/static.rb
TwP-webby-0.9.3 lib/webby/resources/static.rb
TwP-webby-0.9.4.1 lib/webby/resources/static.rb
TwP-webby-0.9.4 lib/webby/resources/static.rb
blowmage-webby-0.9.4.1 lib/webby/resources/static.rb
dysinger-webby-0.9.4 lib/webby/resources/static.rb
francois-webby-0.9.4.1 lib/webby/resources/static.rb
giraffesoft-webby-0.9.5 lib/webby/resources/static.rb
mikker-webby-0.9.4 lib/webby/resources/static.rb
jamesgolick-webby-0.9.5 lib/webby/resources/static.rb
webby-0.9.1 lib/webby/resources/static.rb
webby-0.9.3-x86-mswin32 lib/webby/resources/static.rb
webby-0.9.3 lib/webby/resources/static.rb
webby-0.9.2 lib/webby/resources/static.rb
webby-0.9.4 lib/webby/resources/static.rb
webby-0.9.4-x86-mswin32 lib/webby/resources/static.rb