Sha256: f87861f65fdd92978537880f9cee6c1c83807564542772af065a6d65613ca576

Contents?: true

Size: 446 Bytes

Versions: 24

Compression:

Stored size: 446 Bytes

Contents

module Eucalypt
  def self.set_root(root)
    const_set :ROOT, root.freeze

    define_singleton_method :root do
      const_get :ROOT
    end

    define_singleton_method :path do |*args|
      File.join self.root, *args
    end

    define_singleton_method :glob do |*args, &block|
      Dir.glob self.path(*args), &block
    end

    define_singleton_method :require do |*args|
      self.glob *args, &Kernel.method(:require)
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
eucalypt-0.3.1 lib/eucalypt/root.rb
eucalypt-0.3.0 lib/eucalypt/root.rb
eucalypt-0.2.2 lib/eucalypt/root.rb
eucalypt-0.2.1 lib/eucalypt/root.rb