rblineprof 0.3.5 → 0.3.6

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.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- MjI1MzFiNmMxMDdhNGEwYmZkNjU4OWRkNTdhZjExM2I5OGM0NzI0OA==
5
- data.tar.gz: !binary |-
6
- NzAxMzljM2U4ODk4NzYwODY1NWVhMzIyNDlhYzliNDU4ODA0YWE1Yw==
2
+ SHA1:
3
+ metadata.gz: c7965e23ab44d6873376d2cdb49393fe4c777ae2
4
+ data.tar.gz: 4f28d1eda92a257e34f80e7836b37305ad666c71
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- MjliYTMzYWQ5YTRkMjIwMTBhZGFiMjQxMTZiOGI0ZWYwOGIzMzA5ZDViNGM2
10
- ZTllOTQ3MzZjZmJhYjllYWM1ZGM5ZjdjOWViZmQ0YTIxODViMmUxOTUxNzkw
11
- NjcxMjc3ZmEyNDcwNTM0NTkyNGI5MmFiZmFkZTJiMTNiNjg3OGI=
12
- data.tar.gz: !binary |-
13
- NDA1ZGU2ZWVjMTMwNDM3NWU2NDJjZWUwYjhiMjJiZGQ5ZDcwNzM4MjVlMmY3
14
- YTRlMGI2ODllZjgyNGVlYjNhYzcwNTRmY2YzNGNkN2Q2M2VlMGFhODA2YzU5
15
- MmQ2MDY3MTBjNzI3MzIxNmM3NDZiYzZkNzgwYThlY2Q0MWY5MTM=
6
+ metadata.gz: 22fff0ea33e941fdb29f554e6ad3ab45a44a562e41687bef3a7f43c313fcfabcc1f8cd8881c17da0b543d32ff3f76648ec444a13b0e1a8d553c49ec5b8b5587e
7
+ data.tar.gz: 6d82e84091eeaef23cadb869f7f6d57f75460d202d169a997ee74a7ee756b0e29f0f727f84f0d7d85964e860a051e55a78a8a9bb59f52ee92235074033f2e398
data/Gemfile.lock CHANGED
@@ -1,16 +1,20 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rblineprof (0.3.3)
4
+ rblineprof (0.3.5)
5
5
  debugger-ruby_core_source (~> 1.3)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
10
  debugger-ruby_core_source (1.3.1)
11
+ rake (10.1.1)
12
+ rake-compiler (0.9.2)
13
+ rake
11
14
 
12
15
  PLATFORMS
13
16
  ruby
14
17
 
15
18
  DEPENDENCIES
19
+ rake-compiler
16
20
  rblineprof!
data/ext/rblineprof.c CHANGED
@@ -352,9 +352,16 @@ profiler_hook(rb_event_flag_t event, NODE *node, VALUE self, ID mid, VALUE klass
352
352
  * (as opposed to node, which points to the callee method being invoked)
353
353
  */
354
354
  #if defined(HAVE_RB_PROFILE_FRAMES)
355
- int l;
356
- VALUE iseq, path;
357
- rb_profile_frames(0, 1, &iseq, &l);
355
+ VALUE path, iseq;
356
+ VALUE iseqs[2];
357
+ int lines[2];
358
+ int i = 0, l, n = rb_profile_frames(0, 2, iseqs, lines);
359
+
360
+ if (mid == 0 && n == 2) /* skip empty frame on method definition line */
361
+ i = 1;
362
+
363
+ l = lines[i];
364
+ iseq = iseqs[i];
358
365
 
359
366
  /* TODO: use fstring VALUE directly */
360
367
  path = rb_profile_frame_absolute_path(iseq);
data/rblineprof.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'rblineprof'
3
- s.version = '0.3.5'
3
+ s.version = '0.3.6'
4
4
  s.homepage = 'http://github.com/tmm1/rblineprof'
5
5
 
6
6
  s.authors = 'Aman Gupta'
@@ -15,4 +15,5 @@ Gem::Specification.new do |s|
15
15
  s.license = 'MIT'
16
16
 
17
17
  s.add_dependency 'debugger-ruby_core_source', '~> 1.3'
18
+ s.add_development_dependency 'rake-compiler'
18
19
  end
@@ -30,4 +30,18 @@ class LineProfTest < Test::Unit::TestCase
30
30
  line = profile[__FILE__][__LINE__-3]
31
31
  assert_equal 100, line[3]
32
32
  end
33
+
34
+ def test_method
35
+ profile = lineprof(/./) do
36
+ 100.times{ helper_method }
37
+ end
38
+
39
+ m = method(:helper_method)
40
+ line = profile[__FILE__][m.source_location.last]
41
+ assert_equal 0, line[0]
42
+ end
43
+
44
+ def helper_method
45
+ sleep 0.001
46
+ end
33
47
  end
metadata CHANGED
@@ -1,29 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rblineprof
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aman Gupta
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-02 00:00:00.000000000 Z
11
+ date: 2014-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: debugger-ruby_core_source
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.3'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake-compiler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  description: rblineprof shows you lines of code that are slow.
28
42
  email: aman@tmm1.net
29
43
  executables: []
@@ -31,7 +45,7 @@ extensions:
31
45
  - ext/extconf.rb
32
46
  extra_rdoc_files: []
33
47
  files:
34
- - .gitignore
48
+ - ".gitignore"
35
49
  - Gemfile
36
50
  - Gemfile.lock
37
51
  - README.md
@@ -52,19 +66,18 @@ require_paths:
52
66
  - lib
53
67
  required_ruby_version: !ruby/object:Gem::Requirement
54
68
  requirements:
55
- - - ! '>='
69
+ - - ">="
56
70
  - !ruby/object:Gem::Version
57
71
  version: '0'
58
72
  required_rubygems_version: !ruby/object:Gem::Requirement
59
73
  requirements:
60
- - - ! '>='
74
+ - - ">="
61
75
  - !ruby/object:Gem::Version
62
76
  version: '0'
63
77
  requirements: []
64
78
  rubyforge_project:
65
- rubygems_version: 2.1.11
79
+ rubygems_version: 2.2.0
66
80
  signing_key:
67
81
  specification_version: 4
68
82
  summary: line-profiler for ruby
69
83
  test_files: []
70
- has_rdoc: