rubybreaker 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/ABOUT.md +20 -0
- data/NEWS +5 -0
- data/README.md +16 -352
- data/Rakefile +30 -16
- data/TOPICS.md +55 -0
- data/TUTORIAL.md +291 -0
- data/VERSION +1 -1
- data/bin/rubybreaker +32 -14
- data/lib/rubybreaker/runtime/monitor.rb +1 -1
- data/lib/rubybreaker/runtime.rb +41 -21
- data/lib/rubybreaker/task.rb +15 -9
- data/lib/rubybreaker/test/rspec.rb +3 -3
- data/lib/rubybreaker/test/testcase.rb +3 -3
- data/lib/rubybreaker.rb +31 -16
- data/test/integrated/{tc_both_broken_breakable.rb → tc_both_documented_and_undocumented.rb} +3 -4
- data/test/integrated/tc_class_methods.rb +1 -1
- data/test/integrated/tc_inherit_broken.rb +1 -1
- data/test/integrated/tc_method_missing.rb +1 -1
- data/test/integrated/tc_namespace.rb +1 -1
- data/test/integrated/tc_simple1.rb +1 -1
- data/test/testtask/tc_testtask.rb +2 -2
- data/test/ts_integrated.rb +1 -1
- data/test/ts_rspec.rb +1 -1
- data/webpage/about.html +50 -0
- data/webpage/footer.html +6 -1
- data/webpage/header.html +9 -3
- data/webpage/images/logo.png +0 -0
- data/webpage/images/title.png +0 -0
- data/webpage/index.html +31 -367
- data/webpage/rdoc/Object.html +3 -103
- data/webpage/rdoc/Rake/RubyBreakerTestTask.html +80 -18
- data/webpage/rdoc/Rake.html +3 -7
- data/webpage/rdoc/RubyBreaker/Breakable.html +4 -8
- data/webpage/rdoc/RubyBreaker/Broken.html +4 -8
- data/webpage/rdoc/RubyBreaker/Context.html +3 -7
- data/webpage/rdoc/RubyBreaker/Errors/InternalError.html +3 -7
- data/webpage/rdoc/RubyBreaker/Errors/InvalidSubtypeCheck.html +3 -7
- data/webpage/rdoc/RubyBreaker/Errors/InvalidTypeConstruction.html +3 -7
- data/webpage/rdoc/RubyBreaker/Errors/SubtypeFailure.html +3 -7
- data/webpage/rdoc/RubyBreaker/Errors/TypeError.html +3 -7
- data/webpage/rdoc/RubyBreaker/Errors/UserError.html +3 -7
- data/webpage/rdoc/RubyBreaker/Errors.html +3 -7
- data/webpage/rdoc/RubyBreaker/ObjectPosition.html +3 -7
- data/webpage/rdoc/RubyBreaker/Position.html +3 -7
- data/webpage/rdoc/RubyBreaker/RDocSupport.html +3 -7
- data/webpage/rdoc/RubyBreaker/RubyTypeUtils.html +3 -7
- data/webpage/rdoc/RubyBreaker/Runtime/Inspector.html +3 -7
- data/webpage/rdoc/RubyBreaker/Runtime/MethodInfo.html +3 -7
- data/webpage/rdoc/RubyBreaker/Runtime/Monitor.html +3 -7
- data/webpage/rdoc/RubyBreaker/Runtime/MonitorInstaller.html +10 -14
- data/webpage/rdoc/RubyBreaker/Runtime/MonitorSwitch.html +3 -7
- data/webpage/rdoc/RubyBreaker/Runtime/MonitorUtils.html +3 -7
- data/webpage/rdoc/RubyBreaker/Runtime/ObjectWrapper.html +3 -7
- data/webpage/rdoc/RubyBreaker/Runtime/Pluggable.html +3 -7
- data/webpage/rdoc/RubyBreaker/Runtime/TypeSigParser.html +3 -7
- data/webpage/rdoc/RubyBreaker/Runtime/TypeSigUnparser.html +3 -7
- data/webpage/rdoc/RubyBreaker/Runtime/TypeSystem.html +3 -7
- data/webpage/rdoc/RubyBreaker/Runtime.html +42 -39
- data/webpage/rdoc/RubyBreaker/TypeComparer.html +3 -7
- data/webpage/rdoc/RubyBreaker/TypeDefs/AnyType.html +3 -7
- data/webpage/rdoc/RubyBreaker/TypeDefs/BlockType.html +3 -7
- data/webpage/rdoc/RubyBreaker/TypeDefs/DuckType.html +3 -7
- data/webpage/rdoc/RubyBreaker/TypeDefs/FusionType.html +3 -7
- data/webpage/rdoc/RubyBreaker/TypeDefs/MethodListType.html +3 -7
- data/webpage/rdoc/RubyBreaker/TypeDefs/MethodType.html +3 -7
- data/webpage/rdoc/RubyBreaker/TypeDefs/NilType.html +3 -7
- data/webpage/rdoc/RubyBreaker/TypeDefs/NominalType.html +3 -7
- data/webpage/rdoc/RubyBreaker/TypeDefs/OptionalType.html +3 -7
- data/webpage/rdoc/RubyBreaker/TypeDefs/OrType.html +3 -7
- data/webpage/rdoc/RubyBreaker/TypeDefs/SelfType.html +3 -7
- data/webpage/rdoc/RubyBreaker/TypeDefs/Type.html +3 -7
- data/webpage/rdoc/RubyBreaker/TypeDefs/VarLengthType.html +3 -7
- data/webpage/rdoc/RubyBreaker/TypeDefs.html +3 -7
- data/webpage/rdoc/RubyBreaker/TypeUnparser.html +3 -7
- data/webpage/rdoc/RubyBreaker/Typing.html +3 -7
- data/webpage/rdoc/RubyBreaker/Util.html +3 -7
- data/webpage/rdoc/RubyBreaker.html +48 -15
- data/webpage/rdoc/Test/Unit.html +3 -7
- data/webpage/rdoc/Test.html +3 -7
- data/webpage/rdoc/created.rid +18 -17
- data/webpage/rdoc/index.html +3 -7
- data/webpage/rdoc/js/search_index.js +1 -1
- data/webpage/rdoc/table_of_contents.html +28 -36
- data/webpage/rubybreaker.css +8 -6
- data/webpage/topics.html +85 -0
- data/webpage/tutorial.html +331 -0
- metadata +14 -8
- data/lib/rubybreaker/doc.rb +0 -3
- data/webpage/rdoc/Kernel.html +0 -286
- data/webpage/rdoc/Test/Unit/TestCase.html +0 -309
@@ -0,0 +1,331 @@
|
|
1
|
+
<html>
|
2
|
+
<head>
|
3
|
+
<title>RubyBreaker</title>
|
4
|
+
<LINK REL=StyleSheet HREF="rubybreaker.css" TYPE="text/css">
|
5
|
+
<script type="text/javascript" src="generated_toc.js"> </script>
|
6
|
+
</head>
|
7
|
+
<body onLoad="createTOC()">
|
8
|
+
<center>
|
9
|
+
<div id="content">
|
10
|
+
<div id="logo">
|
11
|
+
<img src="images/title.png" border="0">
|
12
|
+
</div>
|
13
|
+
<center>
|
14
|
+
<a href="index.html">Introduction</a> |
|
15
|
+
<a href="tutorial.html">Tutorial</a> |
|
16
|
+
<a href="topics.html">Advanced Topics</a> |
|
17
|
+
<a href="about.html">About</a>
|
18
|
+
</center>
|
19
|
+
<hr />
|
20
|
+
<!--<div id="generated-toc"></div>-->
|
21
|
+
<h1>Tutorial</h1>
|
22
|
+
|
23
|
+
<p>This tutorial will describe the basic usage of the tool, the RubyBreaker
|
24
|
+
Type Annotation Language, and the RubyBreaker Type System.</p>
|
25
|
+
|
26
|
+
<h2>Usage</h2>
|
27
|
+
|
28
|
+
<p>RubyBreaker takes advantage of test cases that already come with the source
|
29
|
+
program. It is recommended that RubyBreaker is run as a Rake task, which
|
30
|
+
does require a minimum change in the Rakefile (but no code change in the
|
31
|
+
source program) but is better for a long-term maintenance. Regardless of the
|
32
|
+
mode you choose to run, no source code change is required.</p>
|
33
|
+
|
34
|
+
<p>Let us briefly see how RubyBreaker can be run directly as a command-line
|
35
|
+
program to understand the overall concept of the tool. We will explain how
|
36
|
+
to use RubyBreaker in a Rakefile later.</p>
|
37
|
+
|
38
|
+
<pre><code>$ rubybreaker -v -s -l lib.rb -b A,B prog.rb
|
39
|
+
</code></pre>
|
40
|
+
|
41
|
+
<p>The above command runs RubyBreaker in verbose mode (<code>-v</code>) and will display
|
42
|
+
the output on the screen (<code>-s</code>). Before RubyBreaker runs <code>prog.rb</code>, it will
|
43
|
+
import (<code>-l</code>) <code>lib.rb</code> and instrument (<code>-b</code>) classes <code>A</code> and <code>B</code>.
|
44
|
+
Here is <code>lib.rb</code>:</p>
|
45
|
+
|
46
|
+
<pre><code>class A
|
47
|
+
def foo(x)
|
48
|
+
x.to_s
|
49
|
+
end
|
50
|
+
end
|
51
|
+
class B
|
52
|
+
def bar(y,z)
|
53
|
+
y.foo(z)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
</code></pre>
|
57
|
+
|
58
|
+
<p>And, <code>prog.rb</code> simply imports the library file and executes it:</p>
|
59
|
+
|
60
|
+
<pre><code>require "lib"
|
61
|
+
A.new.foo(1)
|
62
|
+
</code></pre>
|
63
|
+
|
64
|
+
<p>This example will show how <code>A#foo</code> method is given a type by RubyBreaker.
|
65
|
+
After running the command shown above, the following output will be
|
66
|
+
generated and displayed on the screen:</p>
|
67
|
+
|
68
|
+
<pre><code>class A
|
69
|
+
typesig("foo(fixnum[to_s]) -> string")
|
70
|
+
end
|
71
|
+
</code></pre>
|
72
|
+
|
73
|
+
<p>Here, the <code>typesig</code> method call registers <code>foo</code> as a method type that takes
|
74
|
+
an object that has <code>Fixnum#to_s</code> method and returns a <code>String</code>. This
|
75
|
+
method is made available simply by importing <code>rubybreaker</code>. Now, assume
|
76
|
+
that an additional code, <code>B.new.bar(A.new,1)</code>, is added at the end of
|
77
|
+
<code>prog.rb</code>. The subsequent run will generate the following result:</p>
|
78
|
+
|
79
|
+
<pre><code>class A
|
80
|
+
typesig("foo(fixnum[to_s]) -> string")
|
81
|
+
end
|
82
|
+
class B
|
83
|
+
typesig("bar(a[foo], fixnum[to_s]) -> string")
|
84
|
+
end
|
85
|
+
</code></pre>
|
86
|
+
|
87
|
+
<p>Keep in mind that RubyBreaker is designed to gather type information based
|
88
|
+
on the <em>actual</em> execution of the source program. This means the program
|
89
|
+
should be equipped with test cases that have a reasonable program path
|
90
|
+
coverage. Additionally, RubyBreaker assumes that test runs are correct and
|
91
|
+
the program behaves correctly (for those test runs) as intended by the
|
92
|
+
programmer. This assumption is not a strong requirement, but is necessary to
|
93
|
+
obtain precise and accurate type information.</p>
|
94
|
+
|
95
|
+
<h3>Using Ruby Unit Testing Framework</h3>
|
96
|
+
|
97
|
+
<p>Instead of manually inserting the entry point indicator in the source
|
98
|
+
program, you can take advantage of Ruby's built-in testing framework. This
|
99
|
+
is preferred to modifying the source program directly, especially for the
|
100
|
+
long term program maintainability. But no worries! This method is as simple
|
101
|
+
as the previous one.</p>
|
102
|
+
|
103
|
+
<pre><code>require "test/unit"
|
104
|
+
require "rubybreaker" # This should come after test/unit.
|
105
|
+
class TestClassA < Test::Unit::TestCase
|
106
|
+
def setup()
|
107
|
+
RubyBreaker.break(Class1, Class2, ...)
|
108
|
+
...
|
109
|
+
end
|
110
|
+
# ...tests!...
|
111
|
+
end
|
112
|
+
</code></pre>
|
113
|
+
|
114
|
+
<p>That's it! The only requirements are to indicate to RubyBreaker which modules
|
115
|
+
and classes to "break" and to place <code>require rubybreaker</code> <em>after</em>
|
116
|
+
<code>require test/unit</code>.</p>
|
117
|
+
|
118
|
+
<h3>Using RSpec</h3>
|
119
|
+
|
120
|
+
<p>The requirement is same for RSpec but use <code>before</code> instead of <code>setup</code> to
|
121
|
+
specify which modules and classes to "break".</p>
|
122
|
+
|
123
|
+
<pre><code>require "rspec"
|
124
|
+
require "rubybreaker"
|
125
|
+
|
126
|
+
describe "TestClassA Test"
|
127
|
+
before { RubyBreaker.break(Class1, Class2, ...) }
|
128
|
+
...
|
129
|
+
# ...tests!...
|
130
|
+
end
|
131
|
+
</code></pre>
|
132
|
+
|
133
|
+
<h3>Using Rakefile</h3>
|
134
|
+
|
135
|
+
<p>By running RubyBreaker along with the Rakefile, you can avoid modifying the
|
136
|
+
source program at all. (You no longer need to import <code>rubybreaker</code> in the
|
137
|
+
test cases neither.) Therefore, this is the recommended way to use
|
138
|
+
RubyBreaker. The following code snippet describes how it can be done:</p>
|
139
|
+
|
140
|
+
<pre><code>require "rubybreaker/task"
|
141
|
+
...
|
142
|
+
desc "Run RubyBreaker"
|
143
|
+
Rake::RubyBreakerTestTask.new(:"rubybreaker") do |t|
|
144
|
+
t.libs << "lib"
|
145
|
+
t.test_files = ["test/foo/tc_foo1.rb"]
|
146
|
+
# ...Other test task options..
|
147
|
+
t.rubybreaker_opts << "-v" # run in verbose mode
|
148
|
+
t.break = ["Class1", "Class2", ...] # specify what to monitor
|
149
|
+
end
|
150
|
+
</code></pre>
|
151
|
+
|
152
|
+
<p>Note that <code>RubyBrakerTestTask</code> can simply replace your <code>TestTask</code> block in
|
153
|
+
Rakefile. In fact, the former is a subclass of the latter and includes all
|
154
|
+
features supported by the latter. The only additional options are
|
155
|
+
<code>rubybreaker_opts</code> which is RubyBreaker's command-line options and
|
156
|
+
<code>break</code> which specifies which modules and classes to monitor. Since
|
157
|
+
<code>Class1</code> and <code>Class2</code> are not <em>recognized</em> by this Rakefile, you must use
|
158
|
+
string literals to specify modules and classes (and with full namespace).</p>
|
159
|
+
|
160
|
+
<p>If this is the route you are taking, there needs no editing of the source
|
161
|
+
program whatsoever. This task will take care of instrumenting the specified
|
162
|
+
modules and classes at proper moments.</p>
|
163
|
+
|
164
|
+
<h2>Type Annotation</h2>
|
165
|
+
|
166
|
+
<p>The annotation language used in RubyBreaker resembles the method
|
167
|
+
documentation used by Ruby Core Library Doc. Each type signature
|
168
|
+
defines a method type using the name, argument types, block type, and return
|
169
|
+
type. But, let us consider a simple case where there is one argument type
|
170
|
+
and a return type.</p>
|
171
|
+
|
172
|
+
<pre><code>class A
|
173
|
+
...
|
174
|
+
typesig("foo(fixnum) -> string")
|
175
|
+
end
|
176
|
+
</code></pre>
|
177
|
+
|
178
|
+
<p>In RubyBreaker, a type signature is recognized by the meta-class level
|
179
|
+
method <code>typesig</code> which takes a string as an argument. This string is the
|
180
|
+
actual type signature written in the Ruby Type Annotation Language. This
|
181
|
+
language is designed to reflect the common documentation practice used by
|
182
|
+
Ruby Core Library Doc. It starts with the name of the method. In the
|
183
|
+
above example, <code>foo</code> is currently being given a type. The rest of the
|
184
|
+
signature takes a typical method type symbol, <code>(x) -> y</code> where <code>x</code> is the
|
185
|
+
argument type and <code>y</code> is the return type. In the example shown above, the
|
186
|
+
method takes a <code>Fixnum</code> object and returns a <code>String</code> object. Note that
|
187
|
+
these types are in lowercase, indicating they are objects and not modules or
|
188
|
+
classes themselves.</p>
|
189
|
+
|
190
|
+
<p>There are several types that represent an object: nominal, duck, fusion,
|
191
|
+
nil, 'any', 'or', optional, variable-length, and block. Each type signature
|
192
|
+
itself represents a method type or a method list type (explained below).</p>
|
193
|
+
|
194
|
+
<h3>Nominal Type</h3>
|
195
|
+
|
196
|
+
<p>This is the simplest and most intuitive way to represent an object. For
|
197
|
+
instance, <code>fixnum</code> is an object of type <code>Fixnum</code>. Use lower-case letters and
|
198
|
+
underscores instead of <em>camelized</em> name. <code>MyClass</code>, for example would be
|
199
|
+
<code>my_class</code> in RubyBreaker type signatures. There is no particular
|
200
|
+
reason for this convention other than it is the common practice used in
|
201
|
+
RubyDoc. Use <code>/</code> to indicate the namespace delimiter <code>::</code>. For example,
|
202
|
+
<code>NamspaceA::ClassB</code> would be represented by <code>namespace_a/class_b</code> in
|
203
|
+
a RubyBreaker type signature.</p>
|
204
|
+
|
205
|
+
<h3>Self Type</h3>
|
206
|
+
|
207
|
+
<p>This type is similar to the nominal type but is referring to the current
|
208
|
+
object--that is, the receiver of the method being typed. RubyBreaker will
|
209
|
+
auto-document the return type as a self type if the return value is the same
|
210
|
+
as the receiver of that call. It is also recommended to use this type over
|
211
|
+
a nominal type (if the return value is <code>self</code>) since it depicts more
|
212
|
+
precise return type.</p>
|
213
|
+
|
214
|
+
<h3>Duck Type</h3>
|
215
|
+
|
216
|
+
<p>This type is inspired by the Ruby Language's duck typing, <em>"if it
|
217
|
+
walks like a duck and quacks like a duck, it must be a duck."</em> Using this
|
218
|
+
type, an object can be represented simply by a list of method names. For
|
219
|
+
example <code>[walks, quacks]</code> is an object that has <code>walks</code> and <code>quacks</code>
|
220
|
+
methods. Note that these method names do <em>not</em> reveal any type
|
221
|
+
information for themselves.</p>
|
222
|
+
|
223
|
+
<h3>Fusion Type</h3>
|
224
|
+
|
225
|
+
<p>Duck type is very flexible but can be too lenient when trying to restrict
|
226
|
+
the type of an object. RubyBreaker provides a type called <em>the fusion type</em>
|
227
|
+
which lists method names but with respect to a nominal type. For
|
228
|
+
example, <code>fixnum[to_f, to_s]</code> represents an object that has methods <code>to_f</code>
|
229
|
+
and <code>to_s</code> whose types are same as those of <code>Fixnum</code>. This is more
|
230
|
+
restrictive (precise) than <code>[to_f, to_s]</code> because the two methods must have
|
231
|
+
the same types as <code>to_f</code> and <code>to_s</code> methods, respectively, in <code>Fixnum</code>.</p>
|
232
|
+
|
233
|
+
<h3>Nil Type</h3>
|
234
|
+
|
235
|
+
<p>A nil type represents a value of nil and is denoted by <code>nil</code>.</p>
|
236
|
+
|
237
|
+
<h3>Any Type</h3>
|
238
|
+
|
239
|
+
<p>RubyBreaker also provides a way to represent an object that is compatible with
|
240
|
+
any type. This type is denoted by <code>?</code>. Use caution with this type because
|
241
|
+
it should be only used for an object that requires an arbitrary yet most
|
242
|
+
specific type--that is, <code>?</code> is a subtype of any other type, but any
|
243
|
+
other type is not a subtype of <code>?</code>. This becomes a bit complicated for
|
244
|
+
method or block argument types because of their contra-variance
|
245
|
+
characteristic. Please refer to the section <em>Subtyping</em>.</p>
|
246
|
+
|
247
|
+
<h3>Or Type</h3>
|
248
|
+
|
249
|
+
<p>Any above types can be "or"ed together, using <code>||</code>, to represent an object
|
250
|
+
that can be either one or the other. It <em>does</em> not represent an object that
|
251
|
+
has to be both (which is not supported by RubyBreaker).</p>
|
252
|
+
|
253
|
+
<h3>Optional Argument Type and Variable-Length Argument Type</h3>
|
254
|
+
|
255
|
+
<p>Another useful features of Ruby are the optional argument type and the
|
256
|
+
variable-length argument type. The former represents an argument that has a
|
257
|
+
default value (and therefore does not have to be provided). The latter
|
258
|
+
represents zero or more arguments of the same type. These are denoted by
|
259
|
+
suffices, <code>?</code> and <code>*</code>, respectively.</p>
|
260
|
+
|
261
|
+
<h3>Block Type</h3>
|
262
|
+
|
263
|
+
<p>One of the Ruby's prominent features is the block argument. It allows
|
264
|
+
the caller to pass in a piece of code to be executed inside the callee. This
|
265
|
+
code block can be executed by the Ruby construct, <code>yield</code>, or by directly
|
266
|
+
calling the <code>call</code> method of the block object. In RubyBreaker, this type can
|
267
|
+
be respresented by curly brackets. For instance, <code>{|fixnum,string| ->
|
268
|
+
string}</code> represents a block that takes two arguments--one <code>Fixnum</code> and one
|
269
|
+
<code>String</code>--and returns a <code>String</code>.</p>
|
270
|
+
|
271
|
+
<p>RubyBreaker does supports nested blocks as Ruby 1.9 finally allows them.
|
272
|
+
However, <em>keep in mind</em> that RubyBreaker <em>cannot</em> automatically document the
|
273
|
+
block types due to <code>yield</code> being a language construct rather than a method,
|
274
|
+
which means it cannot be captured by meta-programming!</p>
|
275
|
+
|
276
|
+
<h3>Method Type and Method List Types</h3>
|
277
|
+
|
278
|
+
<p>Method type is similar to the block type, but it represents an actual method
|
279
|
+
and not a block object. It is the "root" type that the type annotation
|
280
|
+
language supports, along with method list types. Method <em>list</em> type is a
|
281
|
+
collection of method types to represent more than one type information for
|
282
|
+
the given method. Why would this type be needed? Consider the following Ruby
|
283
|
+
code:</p>
|
284
|
+
|
285
|
+
<pre><code>def foo(x)
|
286
|
+
case x
|
287
|
+
when Fixnum
|
288
|
+
1
|
289
|
+
when String
|
290
|
+
"1"
|
291
|
+
end
|
292
|
+
end
|
293
|
+
</code></pre>
|
294
|
+
|
295
|
+
<p>There is no way to document the type of <code>foo</code> without using a method list
|
296
|
+
type. Let's try to give a method type to <code>foo</code> without a method list. The
|
297
|
+
closest we can come up with would be <code>foo(fixnum or string) -> fixnum and
|
298
|
+
string</code>. But RubyBreaker does not have the "and" type in the type annotation
|
299
|
+
language because it gives me an headache! (By the way, it needs to be an
|
300
|
+
"and" type because the caller must handle both <code>Fixnum</code> and <code>String</code> return
|
301
|
+
values.)</p>
|
302
|
+
|
303
|
+
<p>It is a dilemma because Ruby programmers actually enjoy using this kind of
|
304
|
+
dynamic type checks in their code. To alleviate this headache, RubyBreaker
|
305
|
+
supports the method list type to represent different scenarios depending on
|
306
|
+
the argument types. Thus, the <code>foo</code> method shown above can be given the
|
307
|
+
following method list type:</p>
|
308
|
+
|
309
|
+
<pre><code>typesig("foo(fixnum) -> fixnum")
|
310
|
+
typesig("foo(string) -> string")
|
311
|
+
</code></pre>
|
312
|
+
|
313
|
+
<p>These two type signatures simply tell RubyBreaker that <code>foo</code> has two method
|
314
|
+
types--one for a <code>Fixnum</code> argument and another for a <code>String</code> argument.
|
315
|
+
Depending on the argument type, the return type is determined. In this
|
316
|
+
example, a <code>Fixnum</code> is returned when the argument is also a <code>Fixnum</code> and a
|
317
|
+
<code>String</code> is returned when the argument is also a <code>String</code>. When
|
318
|
+
automatically documenting such a type, RubyBreaker looks for the (subtyping)
|
319
|
+
compatibility between the return types and "promote" the method type to a
|
320
|
+
method list type by spliting the type signature into two (or more in
|
321
|
+
subsequent "promotions").</p>
|
322
|
+
<hr />
|
323
|
+
<center style="font-size:smaller; padding:0px;">
|
324
|
+
Copyright (C) 2012 Jong-hoon (David) An. All Rights Reserved.<br />
|
325
|
+
Contact David An at rockalizer at gmail<br />
|
326
|
+
<a href="http://rockalizer.com">rockalizer.com</a>
|
327
|
+
</center>
|
328
|
+
</div>
|
329
|
+
</center>
|
330
|
+
</body>
|
331
|
+
</html>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubybreaker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-06-
|
12
|
+
date: 2012-06-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: treetop
|
@@ -43,7 +43,6 @@ files:
|
|
43
43
|
- lib/rubybreaker/debug/error.rb
|
44
44
|
- lib/rubybreaker/debug.rb
|
45
45
|
- lib/rubybreaker/doc/rdoc.rb
|
46
|
-
- lib/rubybreaker/doc.rb
|
47
46
|
- lib/rubybreaker/runtime/inspector.rb
|
48
47
|
- lib/rubybreaker/runtime/monitor.rb
|
49
48
|
- lib/rubybreaker/runtime/object_wrapper.rb
|
@@ -70,6 +69,7 @@ files:
|
|
70
69
|
- lib/rubybreaker.rb
|
71
70
|
- bin/gen_stub_rubylib
|
72
71
|
- bin/rubybreaker
|
72
|
+
- ABOUT.md
|
73
73
|
- AUTHORS
|
74
74
|
- LICENSE
|
75
75
|
- NEWS
|
@@ -77,8 +77,10 @@ files:
|
|
77
77
|
- Rakefile
|
78
78
|
- README.md
|
79
79
|
- TODO
|
80
|
+
- TOPICS.md
|
81
|
+
- TUTORIAL.md
|
80
82
|
- VERSION
|
81
|
-
- test/integrated/
|
83
|
+
- test/integrated/tc_both_documented_and_undocumented.rb
|
82
84
|
- test/integrated/tc_class_methods.rb
|
83
85
|
- test/integrated/tc_inherit_broken.rb
|
84
86
|
- test/integrated/tc_method_missing.rb
|
@@ -100,10 +102,12 @@ files:
|
|
100
102
|
- test/type/tc_unparser.rb
|
101
103
|
- test/typing/tc_rubytype.rb
|
102
104
|
- test/typing/tc_typing.rb
|
105
|
+
- webpage/about.html
|
103
106
|
- webpage/footer.html
|
104
107
|
- webpage/generated_toc.js
|
105
108
|
- webpage/header.html
|
106
109
|
- webpage/images/logo.png
|
110
|
+
- webpage/images/title.png
|
107
111
|
- webpage/index.html
|
108
112
|
- webpage/rdoc/created.rid
|
109
113
|
- webpage/rdoc/images/add.png
|
@@ -137,7 +141,6 @@ files:
|
|
137
141
|
- webpage/rdoc/js/search.js
|
138
142
|
- webpage/rdoc/js/search_index.js
|
139
143
|
- webpage/rdoc/js/searcher.js
|
140
|
-
- webpage/rdoc/Kernel.html
|
141
144
|
- webpage/rdoc/Object.html
|
142
145
|
- webpage/rdoc/Rake/RubyBreakerTestTask.html
|
143
146
|
- webpage/rdoc/Rake.html
|
@@ -188,17 +191,20 @@ files:
|
|
188
191
|
- webpage/rdoc/RubyBreaker/Util.html
|
189
192
|
- webpage/rdoc/RubyBreaker.html
|
190
193
|
- webpage/rdoc/table_of_contents.html
|
191
|
-
- webpage/rdoc/Test/Unit/TestCase.html
|
192
194
|
- webpage/rdoc/Test/Unit.html
|
193
195
|
- webpage/rdoc/Test.html
|
194
196
|
- webpage/rubybreaker.css
|
197
|
+
- webpage/topics.html
|
198
|
+
- webpage/tutorial.html
|
195
199
|
homepage: http://github.com/rockalizer/rubybreaker
|
196
200
|
licenses:
|
197
201
|
- BSD
|
198
202
|
post_install_message:
|
199
203
|
rdoc_options:
|
200
|
-
-
|
201
|
-
-
|
204
|
+
- README.md
|
205
|
+
- TUTORIAL.md
|
206
|
+
- TOPICS.md
|
207
|
+
- ABOUT.md
|
202
208
|
require_paths:
|
203
209
|
- lib
|
204
210
|
required_ruby_version: !ruby/object:Gem::Requirement
|
data/lib/rubybreaker/doc.rb
DELETED