Sha256: d9750ae50a78183fec10b52ea3a62a5d42b4b4f30f7848e24807ac694a19076f
Contents?: true
Size: 666 Bytes
Versions: 19
Compression:
Stored size: 666 Bytes
Contents
module Tork # Loads all Ruby scripts found having the given name in (1) the directories # specified in the TORK_CONFIGS environment variable, (2) the subdirectories # of lib/tork/config/, and (3) the user's .tork/ directory; in that order. # # @return [Array] paths of Ruby scripts that were loaded # def self.config name dirs = ENV['TORK_CONFIGS'].strip.split(/:+/).reject(&:empty?).uniq. map {|dir| [dir, __FILE__.sub(/\.rb$/, "/#{dir}")] }.flatten Dir["{#{dirs.join(',')},.tork}/#{name}.rb"].each {|script| load script } end end ENV['TORK_CONFIGS'] ||= 'default'.freeze # ENV values come frozen by default Tork.config :config
Version data entries
19 entries across 19 versions & 1 rubygems