Sha256: d30972936d7f08cfc3be7628a26153f4c7b9fa6ea18d1d012ae7e30a708d41fb

Contents?: true

Size: 574 Bytes

Versions: 3

Compression:

Stored size: 574 Bytes

Contents

require 'facets/functor'

class String

  # Use fluent notation for making file directives.
  #
  #    'README.rdoc'.file.mtime
  #  
  def file
    Functor.new(&method(:file_send).to_proc)
  end

  private

  def file_send(op, *a, &b)
    File.send(op, self, *a, &b)
  end

  ## TODO: When no longer needing to support 1.8.6 we can use:
  ##
  ## # Use fluent notation for making file directives.
  ## #
  ## #    'README.rdoc'.file.mtime
  ## #  
  ## def file
  ##   f = self
  ##   Functor.new do |op, *a, &b|
  ##     File.send(op, f, *a, &b)
  ##   end
  ## end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
facets-2.9.0 lib/core/facets/string/file.rb
facets-2.9.0.pre.2 lib/core/facets/string/file.rb
facets-2.9.0.pre.1 lib/core/facets/string/file.rb