Sha256: 318d89958725da496fafa266af5315b1e9df74d0ec517cb9f3955627b4bbfc89

Contents?: true

Size: 552 Bytes

Versions: 1

Compression:

Stored size: 552 Bytes

Contents

require 'pathname'
require 'yaml'
require 'fileutils'

module FeCoreExt::CoreExt
end

module FeCoreExt::CoreExt::Pathname
  def load_yaml
    return unless exist?
    YAML.load_file(self)
  end

  def glob(pattern, &block)
    Pathname.glob(join(pattern), &block)
  end

  def touch(options={})
    FileUtils.touch(@path, options)
  end
end

module FeCoreExt::CoreExt::PathnameClassMethods
  def join(*args)
    new(File.join(*args))
  end
end

class Pathname
  extend FeCoreExt::CoreExt::PathnameClassMethods
  include FeCoreExt::CoreExt::Pathname
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fe_core_ext-0.1.27 lib/fe_core_ext/core_ext/pathname.rb