Sha256: 51799751f7e2d878c6c1a43b324b1778c86a4401a466dbb7727aef686f4b805a

Contents?: true

Size: 670 Bytes

Versions: 72

Compression:

Stored size: 670 Bytes

Contents

require 'uri'

module URI
	class VsphereUrl < Generic
		DEFAULT_PORT = 443
		DEFAULT_PATH = '/sdk'

		def self.from_config(options)
			URI("vsphere://#{options[:host]}:#{options[:port]}#{options[:path]}?use_ssl=#{options[:use_ssl]}&insecure=#{options[:insecure]}")
		end

		def use_ssl
			if query
				ssl_query = query.split('&').each.select{|q| q.start_with?('use_ssl=')}.first
				ssl_query == 'use_ssl=true'
			else
				true
			end
		end

		def insecure
			if query
				insecure_query = query.split('&').each.select{|q| q.start_with?('insecure=')}.first
				insecure_query == 'insecure=true'
			else
				false
			end
		end
	end
	@@schemes['VSPHERE'] = VsphereUrl
end

Version data entries

72 entries across 72 versions & 3 rubygems

Version Path
clc-chef-metal-vsphere-0.3.11 lib/chef_metal_vsphere/vsphere_url.rb
clc-chef-metal-vsphere-0.3.10 lib/chef_metal_vsphere/vsphere_url.rb
clc-chef-metal-vsphere-0.3.9 lib/chef_metal_vsphere/vsphere_url.rb
clc-chef-metal-vsphere-0.3.8 lib/chef_metal_vsphere/vsphere_url.rb
clc-chef-metal-vsphere-0.3.7 lib/chef_metal_vsphere/vsphere_url.rb
clc-chef-metal-vsphere-0.3.6 lib/chef_metal_vsphere/vsphere_url.rb
clc-chef-metal-vsphere-0.3.5 lib/chef_metal_vsphere/vsphere_url.rb
clc-chef-metal-vsphere-0.3.4 lib/chef_metal_vsphere/vsphere_url.rb
clc-chef-metal-vsphere-0.3.3 lib/chef_metal_vsphere/vsphere_url.rb
clc-chef-metal-vsphere-0.3.2 lib/chef_metal_vsphere/vsphere_url.rb
clc-chef-metal-vsphere-0.3.1 lib/chef_metal_vsphere/vsphere_url.rb
clc-chef-metal-vsphere-0.3.0 lib/chef_metal_vsphere/vsphere_url.rb