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.12.7 lib/metanorma/output/utils.rb
isodoc-2.12.6 lib/metanorma/output/utils.rb
isodoc-2.12.5 lib/metanorma/output/utils.rb
isodoc-2.12.4 lib/metanorma/output/utils.rb
isodoc-2.12.3 lib/metanorma/output/utils.rb
isodoc-2.12.2 lib/metanorma/output/utils.rb
isodoc-2.12.1 lib/metanorma/output/utils.rb
isodoc-2.12.0 lib/metanorma/output/utils.rb
isodoc-2.11.4 lib/metanorma/output/utils.rb
isodoc-2.11.3 lib/metanorma/output/utils.rb
isodoc-2.11.2 lib/metanorma/output/utils.rb
isodoc-2.11.1 lib/metanorma/output/utils.rb
isodoc-2.11.0 lib/metanorma/output/utils.rb
isodoc-2.10.7 lib/metanorma/output/utils.rb
isodoc-2.10.6 lib/metanorma/output/utils.rb
isodoc-2.10.5 lib/metanorma/output/utils.rb
isodoc-2.10.4 lib/metanorma/output/utils.rb
isodoc-2.10.3 lib/metanorma/output/utils.rb
isodoc-2.10.2 lib/metanorma/output/utils.rb
isodoc-2.10.1 lib/metanorma/output/utils.rb