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
21
22
23
24
25
# File 'lib/isodoc/generic/utils.rb', line 12

def baselocation(loc)
  return nil if loc.nil?
  return "" if loc.empty?

  return loc
  f = if defined?(self.class::_file)
        (self.class::_file || __FILE__)
      else
        __FILE__
      end
  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