Module: IsoDoc::Generic::Utils

Included in:
I18n, Init, Metadata
Defined in:
lib/isodoc/generic/utils.rb

Instance Method Summary collapse

Instance Method Details

#baselocation(loc) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/isodoc/generic/utils.rb', line 12

def baselocation(loc)
  return nil if loc.nil?
  return "" if loc.empty?
  return loc
  f = defined?(self.class::_file) ? (self.class::_file || __FILE__) :
    __FILE__
  File.expand_path(File.join(
    File.dirname(f), "..", "..", "..", loc))
end

#configurationObject



4
5
6
# File 'lib/isodoc/generic/utils.rb', line 4

def configuration
  Metanorma::Generic.configuration
end

#fileloc(loc) ⇒ Object



8
9
10
# File 'lib/isodoc/generic/utils.rb', line 8

def fileloc(loc)
  File.join(File.dirname(__FILE__), loc)
end