rbtrace 0.4.3 → 0.4.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/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rbtrace (0.4.3)
4
+ rbtrace (0.4.4)
5
5
  ffi (>= 1.0.6)
6
6
  msgpack (>= 0.4.3)
7
7
  trollop (>= 1.16.2)
@@ -10,7 +10,7 @@ GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
12
  ffi (1.9.3)
13
- msgpack (0.5.7)
13
+ msgpack (0.5.8)
14
14
  trollop (2.0)
15
15
 
16
16
  PLATFORMS
data/ext/extconf.rb CHANGED
@@ -11,7 +11,9 @@ end
11
11
  require 'mkmf'
12
12
  require 'fileutils'
13
13
 
14
- unless File.exists?("#{CWD}/dst/lib/libmsgpackc.a")
14
+ libdir = File.basename RbConfig::CONFIG['libdir']
15
+
16
+ unless File.exists?("#{CWD}/dst/#{libdir}/libmsgpackc.a")
15
17
  Logging.message "Building msgpack\n"
16
18
 
17
19
  msgpack = File.basename('msgpack-0.5.7.tar.gz')
@@ -49,7 +51,7 @@ unless File.exists?("#{CWD}/dst/lib/libmsgpackc.a")
49
51
  end
50
52
  end
51
53
 
52
- FileUtils.cp "#{CWD}/dst/lib/libmsgpackc.a", "#{CWD}/libmsgpackc_ext.a"
54
+ FileUtils.cp "#{CWD}/dst/#{libdir}/libmsgpackc.a", "#{CWD}/libmsgpackc_ext.a"
53
55
  $INCFLAGS[0,0] = "-I#{CWD}/dst/include "
54
56
 
55
57
  unless have_library('msgpackc_ext') and have_header('msgpack.h')
data/lib/rbtrace/cli.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require 'trollop'
2
2
  require 'rbtrace/rbtracer'
3
+ require 'rbtrace/version'
3
4
 
4
5
  class RBTraceCLI
5
6
  # Suggest increasing the maximum number of bytes allowed on
@@ -54,7 +55,7 @@ class RBTraceCLI
54
55
  parser = Trollop::Parser.new do
55
56
  version <<-EOS
56
57
  rbtrace: like strace, but for ruby code
57
- version 0.4.3
58
+ version #{RBTracer::VERSION}
58
59
  (c) 2013 Aman Gupta (tmm1)
59
60
  http://github.com/tmm1/rbtrace
60
61
  EOS
@@ -43,12 +43,11 @@ class RBTracer
43
43
  raise ArgumentError, 'could not signal process, are you running as root?'
44
44
  end
45
45
 
46
- path = "/tmp/rbtrace-#{@pid}.sock"
47
46
  @sock = Socket.new Socket::AF_UNIX, Socket::SOCK_DGRAM, 0
48
- @sockaddr = Socket.pack_sockaddr_un(path)
47
+ @sockaddr = Socket.pack_sockaddr_un(socket_path)
49
48
  @sock.bind(@sockaddr)
50
- FileUtils.chmod 0666, path
51
- at_exit{ FileUtils.rm(path) if File.exists?(path) }
49
+ FileUtils.chmod 0666, socket_path
50
+ at_exit { clean_socket_path }
52
51
 
53
52
  5.times do
54
53
  signal
@@ -92,6 +91,14 @@ class RBTracer
92
91
  attach
93
92
  end
94
93
 
94
+ def socket_path
95
+ "/tmp/rbtrace-#{@pid}.sock"
96
+ end
97
+
98
+ def clean_socket_path
99
+ FileUtils.rm(socket_path) if File.exists?(socket_path)
100
+ end
101
+
95
102
  # Watch for method calls slower than a threshold.
96
103
  #
97
104
  # msec - The Fixnum threshold in milliseconds
@@ -139,7 +146,9 @@ class RBTracer
139
146
  send_cmd(:eval, code)
140
147
 
141
148
  if wait('for eval response', 15){ !!@eval_result }
142
- @eval_result
149
+ res = @eval_result
150
+ @eval_result = nil
151
+ res
143
152
  else
144
153
  STDERR.puts '*** timed out waiting for eval response'
145
154
  end
@@ -231,6 +240,8 @@ class RBTracer
231
240
  # STDERR.puts $!.backtrace.join("\n ")
232
241
  rescue Interrupt, SignalException
233
242
  retry
243
+ ensure
244
+ clean_socket_path
234
245
  end
235
246
 
236
247
  # Process events from the traced process.
@@ -0,0 +1,3 @@
1
+ class RBTracer
2
+ VERSION = '0.4.4'
3
+ end
data/rbtrace.gemspec CHANGED
@@ -1,6 +1,8 @@
1
+ require File.expand_path('../lib/rbtrace/version', __FILE__)
2
+
1
3
  Gem::Specification.new do |s|
2
4
  s.name = 'rbtrace'
3
- s.version = '0.4.3'
5
+ s.version = RBTracer::VERSION
4
6
  s.homepage = 'http://github.com/tmm1/rbtrace'
5
7
 
6
8
  s.authors = 'Aman Gupta'
metadata CHANGED
@@ -1,18 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbtrace
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Aman Gupta
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2014-02-13 00:00:00.000000000 Z
12
+ date: 2014-06-17 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: ffi
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
19
  - - ! '>='
18
20
  - !ruby/object:Gem::Version
@@ -20,6 +22,7 @@ dependencies:
20
22
  type: :runtime
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
27
  - - ! '>='
25
28
  - !ruby/object:Gem::Version
@@ -27,6 +30,7 @@ dependencies:
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: trollop
29
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
35
  - - ! '>='
32
36
  - !ruby/object:Gem::Version
@@ -34,6 +38,7 @@ dependencies:
34
38
  type: :runtime
35
39
  prerelease: false
36
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
37
42
  requirements:
38
43
  - - ! '>='
39
44
  - !ruby/object:Gem::Version
@@ -41,6 +46,7 @@ dependencies:
41
46
  - !ruby/object:Gem::Dependency
42
47
  name: msgpack
43
48
  requirement: !ruby/object:Gem::Requirement
49
+ none: false
44
50
  requirements:
45
51
  - - ! '>='
46
52
  - !ruby/object:Gem::Version
@@ -48,6 +54,7 @@ dependencies:
48
54
  type: :runtime
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
51
58
  requirements:
52
59
  - - ! '>='
53
60
  - !ruby/object:Gem::Version
@@ -74,6 +81,7 @@ files:
74
81
  - lib/rbtrace/core_ext.rb
75
82
  - lib/rbtrace/msgq.rb
76
83
  - lib/rbtrace/rbtracer.rb
84
+ - lib/rbtrace/version.rb
77
85
  - rbtrace.gemspec
78
86
  - server.rb
79
87
  - test.sh
@@ -87,26 +95,27 @@ files:
87
95
  homepage: http://github.com/tmm1/rbtrace
88
96
  licenses:
89
97
  - MIT
90
- metadata: {}
91
98
  post_install_message:
92
99
  rdoc_options: []
93
100
  require_paths:
94
101
  - lib
95
102
  required_ruby_version: !ruby/object:Gem::Requirement
103
+ none: false
96
104
  requirements:
97
105
  - - ! '>='
98
106
  - !ruby/object:Gem::Version
99
107
  version: '0'
100
108
  required_rubygems_version: !ruby/object:Gem::Requirement
109
+ none: false
101
110
  requirements:
102
111
  - - ! '>='
103
112
  - !ruby/object:Gem::Version
104
113
  version: '0'
105
114
  requirements: []
106
115
  rubyforge_project:
107
- rubygems_version: 2.1.11
116
+ rubygems_version: 1.8.23
108
117
  signing_key:
109
- specification_version: 4
118
+ specification_version: 3
110
119
  summary: ! 'rbtrace: like strace but for ruby code'
111
120
  test_files: []
112
121
  has_rdoc:
checksums.yaml DELETED
@@ -1,15 +0,0 @@
1
- ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- Y2Y5ZDY3NmVmZWY1ODA5YWVjYzJmNmI2ZDI0NWM3OTMwYmM0M2VkMA==
5
- data.tar.gz: !binary |-
6
- NWVhZWRkOGJhNzE3NTE4ZjRiM2U1YTcyOGFiMzJiODE0ZDc0MmRlYQ==
7
- SHA512:
8
- metadata.gz: !binary |-
9
- YzM0Yjk4YjViNjgwNTk1N2Y5NzY5YzBiMjg3N2MzZGE5NjIwMjU3Zjg4NzQz
10
- MGNmNjM0MzUzNGUwZWVlNDI1MGVkZTlkNDQwZmJjYzliMTlmZTY2OGNhYzdh
11
- NjBiNmNjOWZjNmU4MjJjMTU5MTkwYTk0N2ExYzU0ZWFkNTBmNjM=
12
- data.tar.gz: !binary |-
13
- ODg5ZGI2NTEyZGM4Y2I1ZjcwYTQ2YzA5NWZkMTFhNDNlNWI2MTlkYWE3ZWU3
14
- MGZhZTcxMWQyZmZkNDFkNmU3NGExZDAyMmU4NmNlNTU1OTIxYjIzNGRjNzUw
15
- OTdlMmU5YTFjYjg1NGJmOTNiMjI0MTQ4ZjI5MDg1ZTBlODZkNGM=