heap_dump 0.0.12 → 0.0.13

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,11 +1,30 @@
1
1
  require 'mkmf'
2
2
 
3
- spec = Gem::Specification.find_by_name('ruby-internal', '~>0.8.5') #FIXME: DRY (see gemfile)
4
- find_header('version.h', File.join(spec.gem_dir, 'ext', 'internal', 'yarv-headers'))
5
- find_header('yarv-headers/node.h', File.join(spec.gem_dir, 'ext', 'internal'))
6
- find_header('internal/method/internal_method.h', File.join(spec.gem_dir, 'ext'))
3
+ def find_spec name,*requirements
4
+ return Gem::Specification.find_by_name(name, *requirements) if Gem::Specification.respond_to? :find_by_name
7
5
 
8
- yajl = Gem::Specification.find_by_name('yajl-ruby', '~>1.1')
9
- find_header('api/yajl_gen.h', File.join(yajl.gem_dir, 'ext', 'yajl'))
6
+ requirements = Gem::Requirement.default if requirements.empty?
7
+
8
+ gem = Gem::Dependency.new(name, *requirements)
9
+ matches = Gem.source_index.find_name(gem.name, gem.requirement)
10
+ raise "No matching #{name} gem!" unless matches.any?
11
+ matches.find { |spec|
12
+ Gem.loaded_specs[gem.name] == spec
13
+ } or matches.last
14
+ end
15
+
16
+ def find_gem_dir(name, *req)
17
+ gem = find_spec(name, *req)
18
+ return gem.gem_dir if gem.respond_to? :gem_dir
19
+ gem.full_gem_path
20
+ end
21
+
22
+ dir = find_gem_dir('ruby-internal', '~>0.8.5') #FIXME: DRY (see gemfile)
23
+ find_header('version.h', File.join(dir, 'ext', 'internal', 'yarv-headers'))
24
+ find_header('yarv-headers/node.h', File.join(dir, 'ext', 'internal'))
25
+ find_header('internal/method/internal_method.h', File.join(dir, 'ext'))
26
+
27
+ yajl = find_gem_dir('yajl-ruby', '~>1.1')
28
+ find_header('api/yajl_gen.h', File.join(yajl, 'ext', 'yajl'))
10
29
 
11
30
  create_makefile('heap_dump')
@@ -1,3 +1,3 @@
1
1
  module HeapDump
2
- VERSION = "0.0.12"
2
+ VERSION = "0.0.13"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: heap_dump
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-01 00:00:00.000000000Z
12
+ date: 2012-06-05 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ruby-internal
16
- requirement: &70353553846140 !ruby/object:Gem::Requirement
16
+ requirement: &70239972346420 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.8.5
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70353553846140
24
+ version_requirements: *70239972346420
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: yajl-ruby
27
- requirement: &70353553845660 !ruby/object:Gem::Requirement
27
+ requirement: &70239972345920 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '1.1'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70353553845660
35
+ version_requirements: *70239972345920
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rake-compiler
38
- requirement: &70353553845240 !ruby/object:Gem::Requirement
38
+ requirement: &70239972345420 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70353553845240
46
+ version_requirements: *70239972345420
47
47
  description: dump ruby 1.9 heap contents
48
48
  email:
49
49
  - vasilyfedoseyev@gmail.com