Class: Treat::Config::Paths

Inherits:
Object
  • Object
show all
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

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.expand_path(         # 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