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.31 lib/chef_metal_vsphere/vsphere_url.rb
clc-chef-metal-vsphere-0.3.30 lib/chef_metal_vsphere/vsphere_url.rb
clc-chef-metal-vsphere-0.3.29 lib/chef_metal_vsphere/vsphere_url.rb
clc-chef-metal-vsphere-0.3.28 lib/chef_metal_vsphere/vsphere_url.rb
clc-chef-metal-vsphere-0.3.27 lib/chef_metal_vsphere/vsphere_url.rb
clc-chef-metal-vsphere-0.3.26 lib/chef_metal_vsphere/vsphere_url.rb
clc-chef-metal-vsphere-0.3.25 lib/chef_metal_vsphere/vsphere_url.rb
clc-chef-metal-vsphere-0.3.24 lib/chef_metal_vsphere/vsphere_url.rb
clc-chef-metal-vsphere-0.3.23 lib/chef_metal_vsphere/vsphere_url.rb
clc-chef-metal-vsphere-0.3.22 lib/chef_metal_vsphere/vsphere_url.rb
clc-chef-metal-vsphere-0.3.21 lib/chef_metal_vsphere/vsphere_url.rb
clc-chef-metal-vsphere-0.3.20 lib/chef_metal_vsphere/vsphere_url.rb
clc-chef-metal-vsphere-0.3.19 lib/chef_metal_vsphere/vsphere_url.rb
clc-chef-metal-vsphere-0.3.18 lib/chef_metal_vsphere/vsphere_url.rb
clc-chef-metal-vsphere-0.3.17 lib/chef_metal_vsphere/vsphere_url.rb
clc-chef-metal-vsphere-0.3.16 lib/chef_metal_vsphere/vsphere_url.rb
clc-chef-metal-vsphere-0.3.15 lib/chef_metal_vsphere/vsphere_url.rb
clc-chef-metal-vsphere-0.3.14 lib/chef_metal_vsphere/vsphere_url.rb
clc-chef-metal-vsphere-0.3.13 lib/chef_metal_vsphere/vsphere_url.rb
clc-chef-metal-vsphere-0.3.12 lib/chef_metal_vsphere/vsphere_url.rb