Sha256: 396f32d48df6e552d9d302e66209949c81d03d2b9aaca81b8bb984121da9f78f

Contents?: true

Size: 717 Bytes

Versions: 32

Compression:

Stored size: 717 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

  def rm(options={})
    FileUtils.rm(self, options)
  end

  def mkdir_p
    mkpath
    self
  end

  def require_relative
    Kernel.require_relative(self)
  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

32 entries across 32 versions & 1 rubygems

Version Path
fe_core_ext-0.10.0 lib/fe_core_ext/core_ext/pathname.rb
fe_core_ext-0.9.2 lib/fe_core_ext/core_ext/pathname.rb
fe_core_ext-0.9.1 lib/fe_core_ext/core_ext/pathname.rb
fe_core_ext-0.9.0 lib/fe_core_ext/core_ext/pathname.rb
fe_core_ext-0.8.3 lib/fe_core_ext/core_ext/pathname.rb
fe_core_ext-0.8.2 lib/fe_core_ext/core_ext/pathname.rb
fe_core_ext-0.8.1 lib/fe_core_ext/core_ext/pathname.rb
fe_core_ext-0.7.0 lib/fe_core_ext/core_ext/pathname.rb
fe_core_ext-0.6.0 lib/fe_core_ext/core_ext/pathname.rb
fe_core_ext-0.5.0 lib/fe_core_ext/core_ext/pathname.rb
fe_core_ext-0.4.0 lib/fe_core_ext/core_ext/pathname.rb
fe_core_ext-0.3.0 lib/fe_core_ext/core_ext/pathname.rb
fe_core_ext-0.2.2 lib/fe_core_ext/core_ext/pathname.rb
fe_core_ext-0.2.1 lib/fe_core_ext/core_ext/pathname.rb
fe_core_ext-0.1.49 lib/fe_core_ext/core_ext/pathname.rb
fe_core_ext-0.1.48 lib/fe_core_ext/core_ext/pathname.rb
fe_core_ext-0.1.47 lib/fe_core_ext/core_ext/pathname.rb
fe_core_ext-0.1.46 lib/fe_core_ext/core_ext/pathname.rb
fe_core_ext-0.1.45 lib/fe_core_ext/core_ext/pathname.rb
fe_core_ext-0.1.44 lib/fe_core_ext/core_ext/pathname.rb