yard-heuristics 1.2.1 → 1.2.2
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 +4 -4
- data/README +11 -1
- data/Rakefile +1 -5
- data/lib/yard-heuristics-1.0/version.rb +16 -4
- metadata +73 -61
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef43920bd097fa60bf496c06435113b1fbec6665
|
4
|
+
data.tar.gz: 038b9f8c4050e0f4d7a4a526995211ccc4667456
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7cd00abbb4fc7f5f06227c9c653313cafaca7c54e9cfdf6842a21b869adb172877cd43d492f91d9d12d104ea25d8434e4d6dbf94c9f04baa5a1db774d498f540
|
7
|
+
data.tar.gz: 9d5b08db2559c7282221e905bad7ffa4fa39c2db2b475bcb7365ce435a58b565925ca99f43367eef83f79345d5ac1f528cfb862d081af529aa8bb4e04a0808e4
|
data/README
CHANGED
@@ -164,7 +164,7 @@
|
|
164
164
|
donation to now@disu.se¹. Thanks! Your support won’t go unnoticed!
|
165
165
|
|
166
166
|
¹ Send a donation:
|
167
|
-
https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=now
|
167
|
+
https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=now@disu.se&item_name=YARD-Heuristics
|
168
168
|
|
169
169
|
§ Reporting Bugs
|
170
170
|
|
@@ -175,3 +175,13 @@
|
|
175
175
|
§ Authors
|
176
176
|
|
177
177
|
Nikolai Weibull wrote the code, the tests, and this README.
|
178
|
+
|
179
|
+
§ Licensing
|
180
|
+
|
181
|
+
YARD-Heuristics is free software: you may redistribute it and/or modify it
|
182
|
+
under the terms of the {GNU Lesser General Public License, version 3}¹ or
|
183
|
+
later², as published by the {Free Software Foundation}³.
|
184
|
+
|
185
|
+
¹ See http://disu.se/licenses/lgpl-3.0/
|
186
|
+
² See http://gnu.org/licenses/
|
187
|
+
³ See http://fsf.org/
|
data/Rakefile
CHANGED
@@ -4,11 +4,7 @@ require 'inventory-rake-1.0'
|
|
4
4
|
|
5
5
|
load File.expand_path('../lib/yard-heuristics-1.0/version.rb', __FILE__)
|
6
6
|
|
7
|
-
Inventory::Rake::Tasks.define YARDHeuristics::Version
|
8
|
-
s.author = 'Nikolai Weibull'
|
9
|
-
s.email = 'now@bitwi.se'
|
10
|
-
s.homepage = 'https://github.com/now/yard-heuristics'
|
11
|
-
}
|
7
|
+
Inventory::Rake::Tasks.define YARDHeuristics::Version
|
12
8
|
|
13
9
|
Inventory::Rake::Tasks.unless_installing_dependencies do
|
14
10
|
require 'lookout-rake-3.0'
|
@@ -3,13 +3,25 @@
|
|
3
3
|
require 'inventory-1.0'
|
4
4
|
|
5
5
|
module YARDHeuristics
|
6
|
-
Version = Inventory.new(1, 2,
|
6
|
+
Version = Inventory.new(1, 2, 2){
|
7
|
+
authors{
|
8
|
+
author 'Nikolai Weibull', 'now@disu.se'
|
9
|
+
}
|
10
|
+
|
11
|
+
homepage 'http://disu.se/software/yard-heuristics/'
|
12
|
+
|
13
|
+
licenses{
|
14
|
+
license 'LGPLv3+',
|
15
|
+
'GNU Lesser General Public License, version 3 or later',
|
16
|
+
'http://www.gnu.org/licenses/'
|
17
|
+
}
|
18
|
+
|
7
19
|
def dependencies
|
8
20
|
super + Inventory::Dependencies.new{
|
9
|
-
development 'inventory-rake', 1,
|
21
|
+
development 'inventory-rake', 1, 6, 0
|
10
22
|
development 'lookout', 3, 0, 0
|
11
|
-
development 'lookout-rake', 3,
|
12
|
-
runtime 'yard', 0, 8,
|
23
|
+
development 'lookout-rake', 3, 1, 0
|
24
|
+
runtime 'yard', 0, 8, 7, :feature => 'yard'
|
13
25
|
}
|
14
26
|
end
|
15
27
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yard-heuristics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nikolai Weibull
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-05
|
11
|
+
date: 2013-09-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: inventory
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
19
|
+
version: '1.5'
|
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
|
-
version: '1.
|
26
|
+
version: '1.5'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: inventory-rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '1.
|
33
|
+
version: '1.6'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '1.
|
40
|
+
version: '1.6'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: lookout
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -58,39 +58,39 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '3.
|
61
|
+
version: '3.1'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - ~>
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '3.
|
68
|
+
version: '3.1'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: yard
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - ~>
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.8.
|
75
|
+
version: 0.8.7
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - ~>
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 0.8.
|
82
|
+
version: 0.8.7
|
83
83
|
description: |2
|
84
84
|
YARD-Heuristics
|
85
85
|
|
86
86
|
YARD-Heuristics heuristically determines types of parameters and return
|
87
|
-
values for YARD documentation that doesn
|
88
|
-
allows you to write documentation that isn
|
87
|
+
values for YARD documentation that doesnΓÇÖt explicitly document it. This
|
88
|
+
allows you to write documentation that isnΓÇÖt adorned with ΓÇ£obviousΓÇ¥ types,
|
89
89
|
but still get that information into the output. It also lets you
|
90
90
|
nice-looking references to parameters and have them be marked up
|
91
91
|
appropriately in HTML output.
|
92
92
|
|
93
|
-
|
93
|
+
§ Heuristics
|
94
94
|
|
95
95
|
The following sections list the various heuristics that YARD-Heuristics
|
96
96
|
apply for determining types of parameters and return values.
|
@@ -98,9 +98,9 @@ description: |2
|
|
98
98
|
Note that for all heuristics, a type will only be added if none already
|
99
99
|
exists.
|
100
100
|
|
101
|
-
|
101
|
+
§ Parameter Named “other”
|
102
102
|
|
103
|
-
A parameter named
|
103
|
+
A parameter named ΓÇ£otherΓÇ¥ has the same type as the receiver. This turns
|
104
104
|
|
105
105
|
class Point
|
106
106
|
def ==(other)
|
@@ -111,7 +111,7 @@ description: |2
|
|
111
111
|
# @param [Point] other
|
112
112
|
def ==(other)
|
113
113
|
|
114
|
-
|
114
|
+
§ Parameter Types Derived by Parameter Name
|
115
115
|
|
116
116
|
Parameters to a method with names in the following table has the type
|
117
117
|
listed on the same row.
|
@@ -134,9 +134,9 @@ description: |2
|
|
134
134
|
# @param [Range] range
|
135
135
|
def x_inside?(range)
|
136
136
|
|
137
|
-
|
137
|
+
§ Block Parameters
|
138
138
|
|
139
|
-
If the last parameter to a method
|
139
|
+
If the last parameter to a methodΓÇÖs name begins with ΓÇÿ&ΓÇÖ it has the type
|
140
140
|
[Proc].
|
141
141
|
|
142
142
|
class Method
|
@@ -148,26 +148,26 @@ description: |2
|
|
148
148
|
# @param [Block] block
|
149
149
|
def initialize(&block)
|
150
150
|
|
151
|
-
|
151
|
+
§ Return Types by Method Name
|
152
152
|
|
153
|
-
For the return type of a method with less than two
|
153
|
+
For the return type of a method with less than two ‹@return› tags, the
|
154
154
|
method name is lookup up in the following table and has the type listed on
|
155
|
-
the same row. For the
|
156
|
-
the name
|
157
|
-
used. For the
|
155
|
+
the same row. For the “type” “self or type”, if a ‹@param› tag exists with
|
156
|
+
the name ΓÇ£otherΓÇ¥, the type of the receiver is used, otherwise ΓÇ£selfΓÇ¥ is
|
157
|
+
used. For the ΓÇ£typeΓÇ¥ ΓÇ£typeΓÇ¥, the type of the receiver is used.
|
158
158
|
|
159
159
|
| Name | Type |
|
160
160
|
|-----------------+----------------|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
161
|
+
| ‹<<› | self or type |
|
162
|
+
| ‹>>› | self or type |
|
163
|
+
| ‹==› | [Boolean] |
|
164
|
+
| ‹===› | [Boolean] |
|
165
|
+
| ‹=~› | [Boolean] |
|
166
|
+
| ‹<=>› | [Integer, nil] |
|
167
|
+
| ‹+› | type |
|
168
|
+
| ‹-› | type |
|
169
|
+
| ‹*› | type |
|
170
|
+
| ‹/› | type |
|
171
171
|
| each | [self] |
|
172
172
|
| each_with_index | [self] |
|
173
173
|
| hash | [Integer] |
|
@@ -200,41 +200,41 @@ description: |2
|
|
200
200
|
# @return [self]
|
201
201
|
def <<(item)
|
202
202
|
|
203
|
-
|
203
|
+
§ Emphasizing Parameter Names
|
204
204
|
|
205
205
|
When producing HTML output, any words in all uppercase, with a possible
|
206
|
-
|
207
|
-
|
208
|
-
|
206
|
+
“th” suffix, that is also the name of a parameter, an ‹@option›, or a
|
207
|
+
‹@yieldparam›, will be downcased and emphasized with a class of
|
208
|
+
ΓÇ£parameterΓÇ¥.
|
209
209
|
|
210
|
-
In the following example,
|
211
|
-
|
210
|
+
In the following example, ΓÇ£OTHERΓÇ¥ will be turned into
|
211
|
+
‹<em class="parameter">other</em>›:
|
212
212
|
|
213
213
|
class Point
|
214
|
-
# @return True if the receiver
|
214
|
+
# @return True if the receiverΓÇÖs class and {#x} and {#y} `#==` those of
|
215
215
|
# OTHER
|
216
216
|
def ==(other)
|
217
217
|
|
218
|
-
|
218
|
+
§ Usage
|
219
219
|
|
220
|
-
Add
|
221
|
-
using Inventory-Rake-Tasks-YARD
|
220
|
+
Add ‹--plugin yard-heuristics-1.0› to your YARD command line. If you’re
|
221
|
+
using Inventory-Rake-Tasks-YARD┬╣, add the following to your Rakefile:
|
222
222
|
|
223
223
|
Inventory::Rake::Tasks::YARD.new do |t|
|
224
224
|
t.options += %w'--plugin yard-heuristics-1.0'
|
225
225
|
end
|
226
226
|
|
227
|
-
|
227
|
+
┬╣ See http://disu.se/software/inventory-rake-tasks-yard/
|
228
228
|
|
229
|
-
|
229
|
+
§ API
|
230
230
|
|
231
|
-
There
|
231
|
+
ThereΓÇÖs really not very much to the YARD-Heuristics API. What you can do
|
232
232
|
is add (or modify) the types of parameters and return types of methods by
|
233
233
|
adding (or modifying) entries in the Hash tables
|
234
|
-
|
235
|
-
respectively. That
|
234
|
+
‹YARDHeuristics::ParamTypes› and ‹YARDHeuristics::ReturnTypes›
|
235
|
+
respectively. ThatΓÇÖs about it.
|
236
236
|
|
237
|
-
|
237
|
+
§ Financing
|
238
238
|
|
239
239
|
Currently, most of my time is spent at my day job and in my rather busy
|
240
240
|
private life. Please motivate me to spend time on this piece of software
|
@@ -244,21 +244,32 @@ description: |2
|
|
244
244
|
to have other people give me the things that I need to continue living
|
245
245
|
under the rules of said society. So, if you feel that this piece of
|
246
246
|
software has helped you out enough to warrant a reward, please PayPal a
|
247
|
-
donation to now@disu.se
|
247
|
+
donation to now@disu.se┬╣. Thanks! Your support wonΓÇÖt go unnoticed!
|
248
248
|
|
249
|
-
|
250
|
-
https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=now
|
249
|
+
┬╣ Send a donation:
|
250
|
+
https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=now@disu.se&item_name=YARD-Heuristics
|
251
251
|
|
252
|
-
|
252
|
+
§ Reporting Bugs
|
253
253
|
|
254
|
-
Please report any bugs that you encounter to the {issue tracker}
|
254
|
+
Please report any bugs that you encounter to the {issue tracker}┬╣.
|
255
255
|
|
256
|
-
|
256
|
+
┬╣ See https://github.com/now/yard-heuristics/issues
|
257
257
|
|
258
|
-
|
258
|
+
§ Authors
|
259
259
|
|
260
260
|
Nikolai Weibull wrote the code, the tests, and this README.
|
261
|
-
|
261
|
+
|
262
|
+
§ Licensing
|
263
|
+
|
264
|
+
YARD-Heuristics is free software: you may redistribute it and/or modify it
|
265
|
+
under the terms of the {GNU Lesser General Public License, version 3}┬╣ or
|
266
|
+
later┬▓, as published by the {Free Software Foundation}┬│.
|
267
|
+
|
268
|
+
┬╣ See http://disu.se/licenses/lgpl-3.0/
|
269
|
+
┬▓ See http://gnu.org/licenses/
|
270
|
+
┬│ See http://fsf.org/
|
271
|
+
email:
|
272
|
+
- now@disu.se
|
262
273
|
executables: []
|
263
274
|
extensions: []
|
264
275
|
extra_rdoc_files: []
|
@@ -269,8 +280,9 @@ files:
|
|
269
280
|
- test/unit/yard-heuristics-1.0/version.rb
|
270
281
|
- README
|
271
282
|
- Rakefile
|
272
|
-
homepage:
|
273
|
-
licenses:
|
283
|
+
homepage: http://disu.se/software/yard-heuristics/
|
284
|
+
licenses:
|
285
|
+
- LGPLv3+
|
274
286
|
metadata: {}
|
275
287
|
post_install_message:
|
276
288
|
rdoc_options: []
|
@@ -288,8 +300,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
288
300
|
version: '0'
|
289
301
|
requirements: []
|
290
302
|
rubyforge_project:
|
291
|
-
rubygems_version: 2.0.
|
303
|
+
rubygems_version: 2.0.2
|
292
304
|
signing_key:
|
293
305
|
specification_version: 4
|
294
|
-
summary: values for YARD documentation that doesn
|
306
|
+
summary: values for YARD documentation that doesnΓÇÖt explicitly document it.
|
295
307
|
test_files: []
|