tmm1-perftools.rb 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/ext/extconf.rb +19 -10
- data/perftools.rb.gemspec +1 -1
- metadata +1 -1
data/ext/extconf.rb
CHANGED
@@ -2,20 +2,24 @@ require 'mkmf'
|
|
2
2
|
require 'fileutils'
|
3
3
|
require 'net/http'
|
4
4
|
|
5
|
-
|
6
|
-
perftools =
|
5
|
+
url = 'http://google-perftools.googlecode.com/files/google-perftools-1.2.tar.gz'
|
6
|
+
perftools = File.basename(url)
|
7
7
|
dir = File.basename(perftools, '.tar.gz')
|
8
8
|
|
9
9
|
Logging.message "(I'm about to download and compile google-perftools.. this will definitely take a while)"
|
10
10
|
|
11
|
-
FileUtils.
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
11
|
+
FileUtils.mkdir_p('src')
|
12
|
+
|
13
|
+
Dir.chdir('src') do
|
14
|
+
unless File.exists?(perftools)
|
15
|
+
Net::HTTP.get_response(URI(url)) do |res|
|
16
|
+
File.open(perftools, 'wb') do |out|
|
17
|
+
res.read_body do |chunk|
|
18
|
+
out.write(chunk)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
19
23
|
|
20
24
|
unless File.exists?(dir)
|
21
25
|
xsystem("tar zxvf #{perftools}")
|
@@ -42,5 +46,10 @@ Dir.chdir("src") do
|
|
42
46
|
end
|
43
47
|
end
|
44
48
|
|
49
|
+
case RUBY_PLATFORM
|
50
|
+
when /darwin/, /linux/
|
51
|
+
CONFIG['LDSHARED'] = "$(CXX) " + CONFIG['LDSHARED'].split[1..-1].join(' ')
|
52
|
+
end
|
53
|
+
|
45
54
|
$libs = append_library($libs, 'profiler')
|
46
55
|
create_makefile 'perftools'
|
data/perftools.rb.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
spec = Gem::Specification.new do |s|
|
2
2
|
s.name = 'perftools.rb'
|
3
|
-
s.version = '0.1.
|
3
|
+
s.version = '0.1.4'
|
4
4
|
s.date = '2009-06-01'
|
5
5
|
s.summary = 'google-perftools for ruby code'
|
6
6
|
s.description = 'A sampling profiler for ruby code based on patches to google-perftools'
|