Class: Treat::Config::Paths
- Inherits:
-
Object
- Object
- Treat::Config::Paths
- Defined in:
- lib/treat/config/paths.rb,
lib/treat/config/config.rb
Overview
Configuration for paths to models, binaries, temporary storage and file downloads.
Class Method Summary collapse
-
.configure! ⇒ Object
Get the path configuration based on the directory structure loaded into Paths.
Class Method Details
.configure! ⇒ Object
Get the path configuration based on the directory structure loaded into Paths. Note that this doesn’t call super, as there is no external config files to load.
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/treat/config/paths.rb', line 10 def self.configure! root = File.dirname(File.( # FIXME __FILE__)).split('/')[0..-4].join('/') + '/' self.config = Hash[ # Get a list of directories in treat/ Dir.glob(root + '*').select do |path| FileTest.directory?(path) # Map to pairs of [:name, path] end.map do |path| [File.basename(path).intern, path + '/'] end] end |