Module: Calibrate::Configurable::DirectoryStructure

Included in:
Struct
Defined in:
lib/calibrate/configurable/directory-structure.rb

Overview

XXX Consider making the actual dir/path settings r/o Very easy to say

filename = "string"

rather than

filename.relative_path = "string"

and it isn’t clear which (abs/rel) you mean

Defined Under Namespace

Modules: ClassMethods Classes: StructurePath

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(sub) ⇒ Object



144
145
146
147
148
149
150
151
152
153
154
155
156
# File 'lib/calibrate/configurable/directory-structure.rb', line 144

def self.included(sub)
  sub.extend ClassMethods
  dir_path =
    if not (file_path = ::Rake.application.rakefile).nil?
      File::dirname(File::expand_path(file_path))
    elsif not (dir_path = ::Rake.application.original_dir).nil?
      dir_path
    else
      file_path = caller[0].split(':')[0]
      File::dirname(File::expand_path(file_path))
    end
  sub.setting :absolute_path, dir_path
end

Instance Method Details

#resolve_pathsObject



158
159
160
# File 'lib/calibrate/configurable/directory-structure.rb', line 158

def resolve_paths
  self.class.resolve_paths_on(self)
end