File: facets.rb

package info (click to toggle)
ruby-facets 2.9.2-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 9,824 kB
  • sloc: ruby: 25,483; xml: 90; makefile: 20
file content (37 lines) | stat: -rw-r--r-- 758 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Dynamically load all core libraries.

# Nah... lets do it statically.
module Facets

  # Libraries to exclude from default require.
  EXTRANEOUS = %w{
    succ.rb
    kernel/autoreload.rb
    kernel/once.rb
    kernel/this.rb
    module/attr_validator.rb
    module/instance_function.rb
    object/instance_eval.rb
    proc/partial.rb
    string/mask.rb
    string/obfuscate.rb
    string/stylize.rb
    string/words.rb
  }

  def self.require
    __DIR__ = File.dirname(__FILE__)
    list = []
    Dir.chdir("#{__DIR__}/facets") do
      list = Dir['**/*']
      list.reject!{ |d| File.directory?(d) }
    end
    list -= EXTRANEOUS
    list = list.map{ |f| File.join('facets', f) }
    list.each{ |f| p f; Kernel.require(f) }
  end

end

Facets.require