Module: Tork
- Defined in:
- lib/tork/bridge.rb,
lib/tork/cliapp.rb,
lib/tork/config.rb,
lib/tork/driver.rb,
lib/tork/engine.rb,
lib/tork/master.rb,
lib/tork/server.rb,
lib/tork/version.rb
Defined Under Namespace
Classes: Bridge, CLIApp, Driver, Engine, Master, Server
Constant Summary collapse
- VERSION =
"20.0.1"
Class Method Summary collapse
-
.config(name, search_path = ENV['TORK_CONFIGS']) ⇒ Array
Loads all Ruby scripts found having the given name in (1) the directories specified in the given $TORK_CONFIGS search path, (2) the subdirectories of lib/tork/config/, and (3) the user’s .tork/ directory; in that order.
Class Method Details
.config(name, search_path = ENV['TORK_CONFIGS']) ⇒ Array
Loads all Ruby scripts found having the given name in (1) the directories specified in the given $TORK_CONFIGS search path, (2) the subdirectories of lib/tork/config/, and (3) the user’s .tork/ directory; in that order.
8 9 10 11 12 13 |
# File 'lib/tork/config.rb', line 8 def self.config name, search_path=ENV['TORK_CONFIGS'] dirs = search_path.to_s.strip.split(/:+/).reject(&:empty?).uniq. map {|dir| [dir, __FILE__.sub(/\.rb$/, "/#{dir}")] }.flatten Dir.glob("{#{dirs.join(',')},.tork}/#{name}.rb") {|script| load script } end |