Class: Servicedesk::Uploader

Inherits:
Object
  • Object
show all
Defined in:
lib/servicedesk/uploader.rb

Class Method Summary collapse

Class Method Details

.upload(config) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/servicedesk/uploader.rb', line 6

def self.upload(config)
	puts "in uploader"
	puts "file  #{config.file}"
	puts "config stuff    #{config.url}/#{config.built_on}"
	puts "name   #{config.name}"
	puts "version    #{config.version}"
	puts "ext     #{config.ext}"
	puts "architecture    #{config.architecture}"

`curl -F "file=@#{config.file}" \
			-F "name=#{config.name}" \
			-F "version=#{config.version}" \
			-F "ext=#{config.ext}" \
			-F "architecture=#{config.architecture}" \
			-F "distro=#{config.built_on}" \
			#{config.url}`

	# RestClient.post( "#{config.url}/#{config.built_on}", :data => File.new("#{config.file}", 'rb'), 
	# 		:name => "#{config.name}", 
	# 		:version => "#{config.version}", 
	# 		:ext => "#{config.ext}", 
	# 		:architecture => "#{config.architecture}" )
	#maybe one day this rest will work and be used
end