Sha256: 6870ac6daf86f79901cfdfc0500910cd32c2f5788226add87227fbac8060c909

Contents?: true

Size: 421 Bytes

Versions: 51

Compression:

Stored size: 421 Bytes

Contents

require 'uri'
require 'addressable'

module ManageIQ
  module Smartstate
    module Util
      def self.uri_to_local_path(uri_path)
        # Detect and return UNC paths
        return URI.decode(uri_path) if uri_path[0, 2] == '//'
        local = URI.decode(URI.parse(uri_path).path)
        return local[1..-1] if local[2, 1] == ':'
        return local
      rescue
        return uri_path
      end
    end
  end
end

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
manageiq-smartstate-0.6.2 lib/manageiq/smartstate/util.rb
manageiq-smartstate-0.5.10 lib/manageiq/smartstate/util.rb
manageiq-smartstate-0.3.10 lib/manageiq/smartstate/util.rb
manageiq-smartstate-0.6.1 lib/manageiq/smartstate/util.rb
manageiq-smartstate-0.3.9 lib/manageiq/smartstate/util.rb
manageiq-smartstate-0.6.0 lib/manageiq/smartstate/util.rb
manageiq-smartstate-0.5.9 lib/manageiq/smartstate/util.rb
manageiq-smartstate-0.5.8 lib/manageiq/smartstate/util.rb
manageiq-smartstate-0.3.8 lib/manageiq/smartstate/util.rb
manageiq-smartstate-0.5.7 lib/manageiq/smartstate/util.rb
manageiq-smartstate-0.3.7 lib/manageiq/smartstate/util.rb
manageiq-smartstate-0.5.6 lib/manageiq/smartstate/util.rb
manageiq-smartstate-0.3.6 lib/manageiq/smartstate/util.rb
manageiq-smartstate-0.5.5 lib/manageiq/smartstate/util.rb
manageiq-smartstate-0.5.4 lib/manageiq/smartstate/util.rb
manageiq-smartstate-0.3.5 lib/manageiq/smartstate/util.rb
manageiq-smartstate-0.5.3 lib/manageiq/smartstate/util.rb
manageiq-smartstate-0.5.2 lib/manageiq/smartstate/util.rb
manageiq-smartstate-0.5.1 lib/manageiq/smartstate/util.rb
manageiq-smartstate-0.5.0 lib/manageiq/smartstate/util.rb