minstrel 0.2.20101115030604 → 0.2.20101115031938

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/README.textile +38 -2
  2. metadata +3 -3
data/README.textile CHANGED
@@ -25,8 +25,29 @@ prints what is called. For example:
25
25
 
26
26
  <pre>
27
27
  % RUBY_INSTRUMENT=String ruby -rminstrel -e 'puts "hello world".capitalize.reverse'
28
- String#capitalize([])
29
- String#reverse([])
28
+ enter String#capitalize([])
29
+ exit String#capitalize([])
30
+ enter String#reverse([])
31
+ exit String#reverse([])
32
+ dlrow olleH
33
+ </pre>
34
+
35
+ h3. The 'minstrel' tool
36
+
37
+ Since this doesn't work as expected in ruby 1.8 (or maybe all rubies): ruby
38
+ -rrubygems -rminstrel ..., I provide 'minstrel' as a way to run ruby programs
39
+ with minstrel preloaded.
40
+
41
+ <pre>
42
+ % cat test.rb
43
+ #!/usr/bin/env ruby
44
+ puts "hello world".capitalize.reverse
45
+
46
+ % RUBY_INSTRUMENT=String minstrel test.rb
47
+ enter String#capitalize([])
48
+ exit String#capitalize([])
49
+ enter String#reverse([])
50
+ exit String#reverse([])
30
51
  dlrow olleH
31
52
  </pre>
32
53
 
@@ -82,3 +103,18 @@ enter Foo#baz([])
82
103
  Baz!
83
104
  exit Foo#baz([])
84
105
  </pre>
106
+
107
+ h3. From ruby (deferred loading)
108
+
109
+ Sometimes you don't know when a class is going to be defined. To solve this,
110
+ you must use Minstrel::Instrument#wrap_classname. For example:
111
+
112
+ <pre>
113
+ >> require "minstrel"
114
+ >> Minstrel::Instrument.new.wrap_classname("TCPSocket")
115
+ >> require "socket"
116
+ Wrap of TCPSocket successful
117
+ </pre>
118
+
119
+ Minstrel will wrap 'require' and check for classes you want wrapped at each
120
+ require until it finds all the classes you asked to be wrapped.
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minstrel
3
3
  version: !ruby/object:Gem::Version
4
- hash: 40202230061199
4
+ hash: 40202230063891
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 20101115030604
10
- version: 0.2.20101115030604
9
+ - 20101115031938
10
+ version: 0.2.20101115031938
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jordan Sissel