Sha256: 40afe6d4a68437602fee465030d27bad47ac31c845736eee4730835839d37386

Contents?: true

Size: 387 Bytes

Versions: 123

Compression:

Stored size: 387 Bytes

Contents

require "pathname"

module Metanorma
  module Output
    module Utils
      class << self
        def file_path(url_path)
          file_url = url_path
          file_url = "file://#{url_path}" if Pathname.new(file_url).absolute?
          %r{^file://}.match?(file_url) or
            file_url = "file://#{Dir.pwd}/#{url_path}"
          file_url
        end
      end
    end
  end
end

Version data entries

123 entries across 123 versions & 2 rubygems

Version Path
isodoc-2.6.3 lib/metanorma/output/utils.rb
isodoc-2.6.2 lib/metanorma/output/utils.rb
isodoc-2.6.1 lib/metanorma/output/utils.rb
isodoc-2.6.0 lib/metanorma/output/utils.rb
isodoc-2.5.10 lib/metanorma/output/utils.rb
isodoc-2.5.9 lib/metanorma/output/utils.rb
isodoc-2.5.8 lib/metanorma/output/utils.rb
isodoc-2.5.7 lib/metanorma/output/utils.rb
isodoc-2.5.6 lib/metanorma/output/utils.rb
isodoc-2.5.5 lib/metanorma/output/utils.rb
isodoc-2.5.4 lib/metanorma/output/utils.rb
isodoc-2.5.3 lib/metanorma/output/utils.rb
isodoc-2.5.2 lib/metanorma/output/utils.rb
isodoc-2.5.1 lib/metanorma/output/utils.rb
isodoc-2.5.0 lib/metanorma/output/utils.rb
isodoc-2.4.5 lib/metanorma/output/utils.rb
isodoc-2.4.4 lib/metanorma/output/utils.rb
isodoc-2.4.3 lib/metanorma/output/utils.rb
isodoc-2.4.2 lib/metanorma/output/utils.rb
isodoc-2.4.1 lib/metanorma/output/utils.rb