Parent

Class/Module Index [+]

Quicksearch

Nanoc::Extra::FileProxy

@deprecated Create a File instance directly and use that instead.

Public Class Methods

new(path) click to toggle source
# File lib/nanoc/extra/file_proxy.rb, line 11
def initialize(path)
  @path = path
end

Public Instance Methods

freeze() click to toggle source
# File lib/nanoc/extra/file_proxy.rb, line 15
def freeze
end
method_missing(sym, *args, &block) click to toggle source
# File lib/nanoc/extra/file_proxy.rb, line 22
def method_missing(sym, *args, &block)
  if !@@deprecation_warning_shown
    $stderr.puts 'WARNING: The :file attribute is deprecated and will be removed in a future version of nanoc. Instead of using this :file attribute, consider manually creating a File object when it’s needed, using the :content_filename, :meta_filename or :filename attributes.'
    @@deprecation_warning_shown = true
  end

  File.open(@path, 'r') { |io| io.__send__(sym, *args, &block) }
end
respond_to?(meth, include_all=false) click to toggle source
# File lib/nanoc/extra/file_proxy.rb, line 18
def respond_to?(meth, include_all=false)
  file_instance_methods.include?(meth.to_sym)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.