Module Heel::Configuration
In: lib/heel/configuration.rb
lib/heel/configuration.rb

Configuration module used by all the other modules and classes for determining paths and default values.

Methods

Constants

HOMEPAGE = "http://copiousfreetime.rubyforge.org/heel/"
HOMEPAGE = "http://copiousfreetime.rubyforge.org/heel/"

Public Class methods

returns:[String] The full expanded path of the config directory below root_dir. All parameters passed in are joined onto the result. Trailing File::SEPARATOR is guaranteed if args are not present.

[Source]

    # File lib/heel/configuration.rb, line 34
34:     def self.config_path(*args)
35:       self.sub_path("config", *args)
36:     end
returns:[String] The full expanded path of the config directory below root_dir. All parameters passed in are joined onto the result. Trailing File::SEPARATOR is guaranteed if args are not present.

[Source]

    # File lib/heel/configuration.rb, line 34
34:     def self.config_path(*args)
35:       self.sub_path("config", *args)
36:     end
returns:[String] The full expanded path of the data directory below root_dir. All parameters passed in are joined onto the result. Trailing File::SEPARATOR is guaranteed if _*args_ are not present.

[Source]

    # File lib/heel/configuration.rb, line 43
43:     def self.data_path(*args)
44:       self.sub_path("data", *args)
45:     end
returns:[String] The full expanded path of the data directory below root_dir. All parameters passed in are joined onto the result. Trailing File::SEPARATOR is guaranteed if _*args_ are not present.

[Source]

    # File lib/heel/configuration.rb, line 43
43:     def self.data_path(*args)
44:       self.sub_path("data", *args)
45:     end
returns:[String] The full expanded path of the lib directory below root_dir. All parameters passed in are joined onto the result. Trailing File::SEPARATOR is guaranteed if _*args_ are not present.

[Source]

    # File lib/heel/configuration.rb, line 52
52:     def self.lib_path(*args)
53:       self.sub_path("lib", *args)
54:     end
returns:[String] The full expanded path of the lib directory below root_dir. All parameters passed in are joined onto the result. Trailing File::SEPARATOR is guaranteed if _*args_ are not present.

[Source]

    # File lib/heel/configuration.rb, line 52
52:     def self.lib_path(*args)
53:       self.sub_path("lib", *args)
54:     end

The root directory of the project is considered to be the parent directory of the ‘lib’ directory.

returns:[String] The full expanded path of the parent directory of ‘lib’ going up the path from the current file. Trailing File::SEPARATOR is guaranteed.

[Source]

    # File lib/heel/configuration.rb, line 20
20:     def self.root_dir
21:       unless @root_dir
22:         path_parts = ::File.expand_path(__FILE__).split(::File::SEPARATOR)
23:         lib_index  = path_parts.rindex("lib")
24:         @root_dir = path_parts[0...lib_index].join(::File::SEPARATOR) + ::File::SEPARATOR
25:       end
26:       return @root_dir
27:     end

The root directory of the project is considered to be the parent directory of the ‘lib’ directory.

returns:[String] The full expanded path of the parent directory of ‘lib’ going up the path from the current file. Trailing File::SEPARATOR is guaranteed.

[Source]

    # File lib/heel/configuration.rb, line 20
20:     def self.root_dir
21:       unless @root_dir
22:         path_parts = ::File.expand_path(__FILE__).split(::File::SEPARATOR)
23:         lib_index  = path_parts.rindex("lib")
24:         @root_dir = path_parts[0...lib_index].join(::File::SEPARATOR) + ::File::SEPARATOR
25:       end
26:       return @root_dir
27:     end

[Validate]