Parent

Class/Module Index [+]

Quicksearch

Nanoc3::Extra::FileProxy

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

Public Class Methods

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

Public Instance Methods

method_missing(sym, *args, &block) click to toggle source
# File lib/nanoc3/extra/file_proxy.rb, line 19
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) click to toggle source
# File lib/nanoc3/extra/file_proxy.rb, line 15
def respond_to?(meth)
  File.instance_methods.any? { |m| m == meth.to_s || m == meth.to_sym }
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.