inch 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -0
- data/README.md +335 -3
- data/Rakefile +8 -0
- data/TODOS.md +12 -0
- data/bin/inch +17 -0
- data/inch.gemspec +7 -2
- data/lib/inch.rb +6 -1
- data/lib/inch/cli.rb +24 -0
- data/lib/inch/cli/arguments.rb +45 -0
- data/lib/inch/cli/command.rb +29 -0
- data/lib/inch/cli/command/base.rb +62 -0
- data/lib/inch/cli/command/base_list.rb +75 -0
- data/lib/inch/cli/command/base_object.rb +40 -0
- data/lib/inch/cli/command/console.rb +22 -0
- data/lib/inch/cli/command/inspect.rb +20 -0
- data/lib/inch/cli/command/list.rb +25 -0
- data/lib/inch/cli/command/options/base.rb +137 -0
- data/lib/inch/cli/command/options/base_list.rb +84 -0
- data/lib/inch/cli/command/options/base_object.rb +47 -0
- data/lib/inch/cli/command/options/console.rb +26 -0
- data/lib/inch/cli/command/options/inspect.rb +25 -0
- data/lib/inch/cli/command/options/list.rb +30 -0
- data/lib/inch/cli/command/options/show.rb +27 -0
- data/lib/inch/cli/command/options/stats.rb +20 -0
- data/lib/inch/cli/command/options/suggest.rb +61 -0
- data/lib/inch/cli/command/output/base.rb +32 -0
- data/lib/inch/cli/command/output/console.rb +45 -0
- data/lib/inch/cli/command/output/inspect.rb +129 -0
- data/lib/inch/cli/command/output/list.rb +87 -0
- data/lib/inch/cli/command/output/show.rb +79 -0
- data/lib/inch/cli/command/output/stats.rb +111 -0
- data/lib/inch/cli/command/output/suggest.rb +104 -0
- data/lib/inch/cli/command/show.rb +20 -0
- data/lib/inch/cli/command/stats.rb +20 -0
- data/lib/inch/cli/command/suggest.rb +104 -0
- data/lib/inch/cli/command_parser.rb +82 -0
- data/lib/inch/cli/sparkline_helper.rb +31 -0
- data/lib/inch/cli/trace_helper.rb +42 -0
- data/lib/inch/cli/yardopts_helper.rb +49 -0
- data/lib/inch/code_object.rb +8 -0
- data/lib/inch/code_object/docstring.rb +97 -0
- data/lib/inch/code_object/nodoc_helper.rb +84 -0
- data/lib/inch/code_object/proxy.rb +37 -0
- data/lib/inch/code_object/proxy/base.rb +194 -0
- data/lib/inch/code_object/proxy/class_object.rb +9 -0
- data/lib/inch/code_object/proxy/constant_object.rb +8 -0
- data/lib/inch/code_object/proxy/method_object.rb +118 -0
- data/lib/inch/code_object/proxy/method_parameter_object.rb +81 -0
- data/lib/inch/code_object/proxy/module_object.rb +8 -0
- data/lib/inch/code_object/proxy/namespace_object.rb +38 -0
- data/lib/inch/core_ext.rb +2 -0
- data/lib/inch/core_ext/string.rb +3 -0
- data/lib/inch/core_ext/yard.rb +4 -0
- data/lib/inch/evaluation.rb +35 -0
- data/lib/inch/evaluation/base.rb +60 -0
- data/lib/inch/evaluation/class_object.rb +6 -0
- data/lib/inch/evaluation/constant_object.rb +34 -0
- data/lib/inch/evaluation/file.rb +66 -0
- data/lib/inch/evaluation/method_object.rb +127 -0
- data/lib/inch/evaluation/module_object.rb +6 -0
- data/lib/inch/evaluation/namespace_object.rb +94 -0
- data/lib/inch/evaluation/role/base.rb +49 -0
- data/lib/inch/evaluation/role/constant.rb +43 -0
- data/lib/inch/evaluation/role/method.rb +60 -0
- data/lib/inch/evaluation/role/method_parameter.rb +46 -0
- data/lib/inch/evaluation/role/missing.rb +20 -0
- data/lib/inch/evaluation/role/namespace.rb +58 -0
- data/lib/inch/evaluation/role/object.rb +64 -0
- data/lib/inch/evaluation/score_range.rb +26 -0
- data/lib/inch/rake.rb +1 -0
- data/lib/inch/rake/suggest.rb +26 -0
- data/lib/inch/source_parser.rb +36 -0
- data/lib/inch/version.rb +1 -1
- data/test/fixtures/code_examples/lib/foo.rb +87 -0
- data/test/fixtures/readme/lib/foo.rb +17 -0
- data/test/fixtures/simple/README +25 -0
- data/test/fixtures/simple/lib/broken.rb +10 -0
- data/test/fixtures/simple/lib/foo.rb +214 -0
- data/test/fixtures/simple/lib/role_methods.rb +78 -0
- data/test/fixtures/simple/lib/role_namespaces.rb +68 -0
- data/test/fixtures/visibility/lib/foo.rb +18 -0
- data/test/fixtures/yardopts/.yardopts +1 -0
- data/test/fixtures/yardopts/foo/bar.rb +6 -0
- data/test/inch/cli/arguments_test.rb +70 -0
- data/test/inch/cli/command/console_test.rb +59 -0
- data/test/inch/cli/command/inspect_test.rb +59 -0
- data/test/inch/cli/command/list_test.rb +61 -0
- data/test/inch/cli/command/show_test.rb +59 -0
- data/test/inch/cli/command/stats_test.rb +57 -0
- data/test/inch/cli/command/suggest_test.rb +57 -0
- data/test/inch/cli/command_parser_test.rb +33 -0
- data/test/inch/cli/yardopts_helper_test.rb +84 -0
- data/test/inch/code_object/docstring_test.rb +204 -0
- data/test/inch/code_object/nodoc_helper_test.rb +38 -0
- data/test/inch/code_object/proxy_test.rb +188 -0
- data/test/inch/source_parser_test.rb +23 -0
- data/test/integration/stats_options_test.rb +34 -0
- data/test/integration/visibility_options_test.rb +79 -0
- data/test/test_helper.rb +21 -0
- metadata +184 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7567dd076efa1061ed2fe78515e1cae97bacd0c
|
4
|
+
data.tar.gz: d56dc92a462fab56c73d1693f091aec50b29ca62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fac873dedadc24c9d3430d2c60b921bd1b3ab16a7797ab37aca149b56897b28e53bcd021b7569fb56c1a29b3f31c12a0c72150b8092e49a40e4a1383738442d6
|
7
|
+
data.tar.gz: d3648df680260a3c7c9d450f372db7ff5eeb2477d3f9feef31f6b3380d08a6291cb295a263fe291cd91fbbbc11491fc2878f35896ae8c3e931dfb364349fa826
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
# Inch
|
2
2
|
|
3
|
-
|
3
|
+
Inch is a documentation measurement tool for Ruby, based on
|
4
|
+
[YARD](http://yardoc.org/).
|
5
|
+
|
6
|
+
It does not measure documentation *coverage*, but grades and
|
7
|
+
prioritizes code objects to give you hints where to improve your docs.
|
8
|
+
One Inch at a time.
|
9
|
+
|
4
10
|
|
5
11
|
## Installation
|
6
12
|
|
@@ -16,14 +22,340 @@ Or install it yourself as:
|
|
16
22
|
|
17
23
|
$ gem install inch
|
18
24
|
|
25
|
+
|
19
26
|
## Usage
|
20
27
|
|
21
|
-
|
28
|
+
To run Inch, simply type
|
29
|
+
|
30
|
+
$ inch
|
31
|
+
|
32
|
+
Given a `lib` directory with the following code inside:
|
33
|
+
|
34
|
+
class Foo
|
35
|
+
# A complicated method
|
36
|
+
def complicated(o, i, *args, &block)
|
37
|
+
# ... snip ...
|
38
|
+
end
|
39
|
+
|
40
|
+
# An example of a method that takes a parameter (+param1+)
|
41
|
+
# and does nothing.
|
42
|
+
#
|
43
|
+
# Returns nil
|
44
|
+
def nothing(param1)
|
45
|
+
end
|
46
|
+
|
47
|
+
def filename
|
48
|
+
"#{self.class}_#{id}.foo"
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
Inch will suggest that the docs could be improved:
|
53
|
+
|
54
|
+
# Properly documented, could be improved:
|
55
|
+
|
56
|
+
┃ B ↑ Foo#complicated
|
57
|
+
|
58
|
+
# Undocumented:
|
59
|
+
|
60
|
+
┃ U ↑ Foo
|
61
|
+
┃ U ↗ Foo#filename
|
62
|
+
|
63
|
+
You might want to look at these files:
|
64
|
+
|
65
|
+
┃ lib/foo.rb
|
66
|
+
|
67
|
+
Grade distribution (undocumented, C, B, A): █ ▁ ▄ ▄
|
68
|
+
|
69
|
+
Only considering priority objects: ↑ ↗ → (use `--help` for options).
|
70
|
+
|
71
|
+
Inch does not report coverage scores for code objects. It assigns grades and shows you the grade distribution rather then an overall grade.
|
72
|
+
|
73
|
+
The grades (A, B, C) show how good the present documentation seems. The grade `U` is assigned to all undocumented objects. The arrows (↑ ↗ → ↘ ↓) hint at the importance of the object being documented.
|
74
|
+
|
75
|
+
|
76
|
+
### Inch does not judge
|
77
|
+
|
78
|
+
Inch uses grades instead of scores to take a more relaxed approach. You can
|
79
|
+
get an `A` without employing every trick from a predetermined list of checks.
|
80
|
+
|
81
|
+
The reason for using the grade distribution instead of an overall score is
|
82
|
+
that the distribution says more about your codebase than a coverage percentage
|
83
|
+
ever could:
|
84
|
+
|
85
|
+
Grade distribution (undocumented, C, B, A): ▄ ▁ ▄ █
|
86
|
+
|
87
|
+
In this example we have a good chunk of code that is still undocumented, but
|
88
|
+
the vast majority of code is rated A or B. This tells you three things:
|
89
|
+
|
90
|
+
* There is a significant amount of documentation present.
|
91
|
+
* The present documentation seems good.
|
92
|
+
* There are still undocumented methods.
|
93
|
+
|
94
|
+
Inch does not really tell you what to do from here. It suggests objects and
|
95
|
+
files that could be improved to get a better rating, but that is all.
|
96
|
+
|
97
|
+
This way, it is perfectly reasonable to leave parts of your codebase
|
98
|
+
undocumented. Instead of reporting
|
99
|
+
|
100
|
+
coverage: 67.1% 46 ouf of 140 checks failed
|
101
|
+
|
102
|
+
and leaving you with a bad feeling, Inch tells you there are still
|
103
|
+
undocumented objects without judging.
|
104
|
+
|
105
|
+
Inch does not tell you to document all your methods. Neither does it tell you
|
106
|
+
not to. It does not tell you "a method's documentation should be a single line
|
107
|
+
under 80 characters not ending in a period".
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
### Limitations
|
112
|
+
|
113
|
+
How you document your code is up to you and Inch can't actually tell you how good your docs are.
|
114
|
+
|
115
|
+
It can't tell if your code examples work or if you described parameters
|
116
|
+
correctly or if you have just added `# TODO: write docs` to each and every
|
117
|
+
method.
|
118
|
+
|
119
|
+
It is just a tool, that you can use to find parts of a codebase lacking
|
120
|
+
documentation.
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
## Features
|
125
|
+
|
126
|
+
Inch is build to parse [YARD](http://yardoc.org/),
|
127
|
+
[RDoc](http://rdoc.rubyforge.org/) and [TomDoc](http://tomdoc.org/)
|
128
|
+
style documentation comments, but works reasonably well with unstructured
|
129
|
+
comments.
|
130
|
+
|
131
|
+
It comes with four sub-commands: `suggest`, `stats`, `show`, and `list`
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
### inch suggest
|
136
|
+
|
137
|
+
Suggests places where a codebase suffers a lack of documentation.
|
138
|
+
|
139
|
+
$ inch suggest
|
140
|
+
|
141
|
+
# Properly documented, could be improved:
|
142
|
+
|
143
|
+
┃ B ↑ Inch::CLI::Command::BaseObject#prepare_objects
|
144
|
+
┃ B ↑ Inch::CLI::Command::BaseList#prepare_list
|
145
|
+
┃ B ↑ Inch::CLI::Command::Suggest#run
|
146
|
+
┃ B ↑ Inch::CLI::Command::List#run
|
147
|
+
┃ B ↑ Inch::CodeObject::Proxy::MethodParameterObject#initialize
|
148
|
+
┃ B ↗ Inch::CLI::Command::Stats#run
|
149
|
+
┃ B ↗ Inch::CLI::CommandParser#run
|
150
|
+
┃ B ↗ Inch::CLI::CommandParser.run
|
151
|
+
|
152
|
+
# Not properly documented:
|
153
|
+
|
154
|
+
┃ C ↑ Inch::CodeObject::NodocHelper#implicit_nodoc_comment?
|
155
|
+
┃ C ↑ Inch::CLI::Command::Output::Console#initialize
|
156
|
+
┃ C ↑ Inch::CLI::Command::Output::Suggest#initialize
|
157
|
+
┃ C ↑ Inch::Rake::Suggest#initialize
|
158
|
+
|
159
|
+
# Undocumented:
|
160
|
+
|
161
|
+
┃ U ↑ Inch::Evaluation::NamespaceObject#evaluate
|
162
|
+
┃ U ↑ Inch::Evaluation::ConstantObject#evaluate
|
163
|
+
┃ U ↑ Inch::Evaluation::MethodObject#evaluate
|
164
|
+
┃ U ↑ Inch::SourceParser#find_object
|
165
|
+
|
166
|
+
You might want to look at these files:
|
167
|
+
|
168
|
+
┃ lib/inch/code_object/proxy/base.rb
|
169
|
+
┃ lib/inch/code_object/proxy/method_object.rb
|
170
|
+
┃ lib/inch/evaluation/role/constant.rb
|
171
|
+
┃ lib/inch/evaluation/role/method_parameter.rb
|
172
|
+
┃ lib/inch/evaluation/role/object.rb
|
173
|
+
|
174
|
+
Grade distribution (undocumented, C, B, A): █ ▃ ▁ ▄
|
175
|
+
|
176
|
+
Only considering priority objects: ↑ ↗ → (use `--help` for options).
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
### inch stats
|
181
|
+
|
182
|
+
Shows you an overview of the codebase.
|
183
|
+
|
184
|
+
$ inch stats
|
185
|
+
|
186
|
+
Grade distribution: (undocumented, C, B, A)
|
187
|
+
|
188
|
+
Overall: █ ▂ ▁ ▃ 439 objects
|
189
|
+
|
190
|
+
Grade distribution by priority:
|
191
|
+
|
192
|
+
↑ ▁ ▄ █ ▁ 10 objects
|
193
|
+
|
194
|
+
↗ █ ▃ ▁ ▃ 302 objects
|
195
|
+
|
196
|
+
→ ▆ ▂ ▁ █ 73 objects
|
197
|
+
|
198
|
+
↘ █ ▁ ▁ ▁ 54 objects
|
199
|
+
|
200
|
+
↓ ▁ ▁ ▁ ▁ 0 objects
|
201
|
+
|
202
|
+
Priority distribution in grades: (low to high)
|
203
|
+
|
204
|
+
↓ ↘ → ↗ ↑
|
205
|
+
U: ▁ ▁ ▁ ▁ ▁ ▁ ▂ ▂ ▁ █ ▁ ▁ ▁ ▁ ▁ 243 objects
|
206
|
+
|
207
|
+
C: ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ █ ▁ ▁ ▁ ▁ ▁ 73 objects
|
208
|
+
|
209
|
+
B: ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ █ ▂ ▄ ▁ ▁ ▁ 19 objects
|
210
|
+
|
211
|
+
A: ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▄ ▁ █ ▁ ▁ ▁ ▁ ▁ 104 objects
|
212
|
+
|
213
|
+
|
214
|
+
Try `--format json|yaml` for raw numbers.
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
### inch show
|
219
|
+
|
220
|
+
Shows you details about what can be approved in a specific object.
|
221
|
+
|
222
|
+
$ inch show Inch::SourceParser#find_object
|
223
|
+
|
224
|
+
# Inch::SourceParser#find_object
|
225
|
+
|
226
|
+
┃ -> lib/inch/source_parser.rb:16
|
227
|
+
┃ ------------------------------------------------------
|
228
|
+
┃ Grade: C - Needs work
|
229
|
+
┃ ------------------------------------------------------
|
230
|
+
┃ + Add a comment describing the method
|
231
|
+
┃ + Describe the parameter 'path'
|
232
|
+
┃ + Describe the return type of 'find_object'
|
233
|
+
┃ + Add a code example (optional)
|
234
|
+
┃ ------------------------------------------------------
|
235
|
+
|
236
|
+
|
237
|
+
|
238
|
+
### inch list
|
239
|
+
|
240
|
+
Lists all objects in your codebase with their grades.
|
241
|
+
|
242
|
+
$ inch list
|
243
|
+
|
244
|
+
# Seems really good
|
245
|
+
|
246
|
+
┃ A ↑ Inch::CLI::Command::Output::Console#object
|
247
|
+
┃ A ↗ Inch
|
248
|
+
┃ A ↗ Inch::CodeObject::Proxy::Base#depth
|
249
|
+
┃ A ↗ Inch::CodeObject::Proxy::Base#height
|
250
|
+
┃ A ↗ Inch::CLI::Command::Base#description
|
251
|
+
┃ A ↗ Inch::CodeObject::NodocHelper#nodoc?
|
252
|
+
┃ A ↗ Inch::CLI::YardoptsHelper#parse_yardopts_options
|
253
|
+
┃ A ↗ Inch::Evaluation::NamespaceObject
|
254
|
+
┃ A ↗ Inch::SourceParser
|
255
|
+
┃ A ↗ Inch::Evaluation::ScoreRange#range=
|
256
|
+
┃ ... (omitting 75 objects)
|
257
|
+
|
258
|
+
# Proper documentation present
|
259
|
+
|
260
|
+
┃ B ↑ Inch::CLI::Command::Suggest#run
|
261
|
+
┃ B ↑ Inch::CLI::Command::List#run
|
262
|
+
┃ B ↑ Inch::CodeObject::Proxy::MethodParameterObject#initialize
|
263
|
+
┃ B ↗ Inch::CLI::Command::Stats#run
|
264
|
+
┃ B ↗ Inch::CLI::CommandParser#run
|
265
|
+
┃ B ↗ Inch::CLI::CommandParser.run
|
266
|
+
┃ B ↗ Inch::CLI::Command::Base.run
|
267
|
+
┃ B ↗ Inch::Evaluation::Base#object=
|
268
|
+
┃ B ↗ Inch::CodeObject::Proxy::Base#object=
|
269
|
+
|
270
|
+
# Needs work
|
271
|
+
|
272
|
+
┃ C ↑ Inch::CLI::Command::Output::Stats#initialize
|
273
|
+
┃ C ↑ Inch::CLI::Command::Output::Suggest#initialize
|
274
|
+
┃ C ↑ Inch::CodeObject::NodocHelper#implicit_nodoc_comment?
|
275
|
+
┃ C ↑ Inch::CLI::Command::Output::Console#initialize
|
276
|
+
┃ C ↑ Inch::Evaluation::NamespaceObject#evaluate
|
277
|
+
┃ C ↑ Inch::Evaluation::ConstantObject#evaluate
|
278
|
+
┃ C ↑ Inch::SourceParser#find_object
|
279
|
+
┃ C ↑ Inch::Evaluation::MethodObject#evaluate
|
280
|
+
┃ C ↗ Inch::CLI::Command::Show#run
|
281
|
+
┃ C ↗ Inch::CodeObject::Proxy::Base
|
282
|
+
┃ ... (omitting 248 objects)
|
283
|
+
|
284
|
+
This output omitted 323 objects. Use `--all` to display all objects.
|
285
|
+
|
286
|
+
|
287
|
+
|
288
|
+
### Rake task
|
289
|
+
|
290
|
+
Add this to your `Rakefile`:
|
291
|
+
|
292
|
+
require 'inch/rake'
|
293
|
+
|
294
|
+
Inch::Rake::Suggest.new
|
295
|
+
|
296
|
+
This creates a rake task named `inch`. Change the name by passing it to the constructor. Use the `args` config option to add any command-line arguments from `inch suggest --help`.
|
297
|
+
|
298
|
+
require 'inch/rake'
|
299
|
+
|
300
|
+
Inch::Rake::Suggest.new("doc:suggest") do |suggest|
|
301
|
+
suggest.args << "--private"
|
302
|
+
end
|
303
|
+
|
304
|
+
|
305
|
+
|
306
|
+
## How is this different from ...?
|
307
|
+
|
308
|
+
### Documentation coverage
|
309
|
+
|
310
|
+
Documentation coverage checks (like they can be found in
|
311
|
+
[cane](https://github.com/square/cane) and
|
312
|
+
[rubocop](https://github.com/bbatsov/rubocop)) look at all code objects and
|
313
|
+
determine if the found documentation meets a certain threshold/expectation.
|
314
|
+
|
315
|
+
Inch takes a different approach as it aims for "properly documented" rather
|
316
|
+
than "100% coverage".
|
317
|
+
|
318
|
+
### Yardstick
|
319
|
+
|
320
|
+
[Yardstick](https://github.com/dkubb/yardstick) is a tool that verifies
|
321
|
+
documentation coverage of Ruby code and is specifically designed for
|
322
|
+
[YARD-style documentation](http://yardoc.org/). It is a great tool to see
|
323
|
+
where your docs could benefit from YARD's extra features over RDoc, but, at
|
324
|
+
the same time, it is very overwhelming when applied to a codebase that does
|
325
|
+
not yet adhere to YARD's standards.
|
326
|
+
|
327
|
+
Inch takes a less YARD specific, more "relaxed" approach: It recognizes
|
328
|
+
different forms of documentation (even in the same codebase) and assigns
|
329
|
+
grades instead of coverage measurements. So you can get an "A" rating without
|
330
|
+
employing every technique YARD has to offer.
|
331
|
+
|
332
|
+
|
22
333
|
|
23
334
|
## Contributing
|
24
335
|
|
25
|
-
1. Fork it
|
336
|
+
1. [Fork it!](http://github.com/rrrene/inch/fork)
|
26
337
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
338
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
28
339
|
4. Push to the branch (`git push origin my-new-feature`)
|
29
340
|
5. Create new Pull Request
|
341
|
+
|
342
|
+
|
343
|
+
|
344
|
+
## Author
|
345
|
+
|
346
|
+
René Föhring (@rrrene)
|
347
|
+
|
348
|
+
|
349
|
+
|
350
|
+
## Credits
|
351
|
+
|
352
|
+
Inch would not exist without Loren Segal's [YARD](http://yardoc.org/).
|
353
|
+
|
354
|
+
|
355
|
+
|
356
|
+
## License
|
357
|
+
|
358
|
+
Inch is released under the MIT License. See the LICENSE.txt file for further
|
359
|
+
details.
|
360
|
+
|
361
|
+
For YARD's licensing, see YARD's README under http://yardoc.org/
|
data/Rakefile
CHANGED
data/TODOS.md
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
# TODOs
|
2
|
+
|
3
|
+
* Recognize all relevant options in .yardopts file
|
4
|
+
* --plugin
|
5
|
+
* --[no-]api API
|
6
|
+
* Provide reusable context that filters code objects according to the
|
7
|
+
visibility options
|
8
|
+
* Add support for multiple signatures for methods
|
9
|
+
(realized via the @overload tag in YARD)
|
10
|
+
* YARD assigns an implicit @return tag to methods ending in a question
|
11
|
+
mark -- maybe this is a problem since those methods appear as `C` in
|
12
|
+
the output, even if they don't have any other documentation
|
data/bin/inch
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'bundler'
|
4
|
+
begin
|
5
|
+
Bundler.require
|
6
|
+
rescue Bundler::GemfileNotFound
|
7
|
+
ensure
|
8
|
+
require 'inch'
|
9
|
+
end
|
10
|
+
|
11
|
+
# hit Control + C to stop
|
12
|
+
Signal.trap("INT") do
|
13
|
+
warn " cancelled by user (INT)"
|
14
|
+
exit 1
|
15
|
+
end
|
16
|
+
|
17
|
+
Inch::CLI::CommandParser.run(*ARGV)
|
data/inch.gemspec
CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = Inch::VERSION
|
9
9
|
spec.authors = ["René Föhring"]
|
10
10
|
spec.email = ["rf@bamaru.de"]
|
11
|
-
spec.summary = %q{
|
12
|
-
spec.description = %q{
|
11
|
+
spec.summary = %q{Documentation measurement tool for Ruby}
|
12
|
+
spec.description = %q{Documentation measurement tool for Ruby, based on YARD.}
|
13
13
|
spec.homepage = ""
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
@@ -20,4 +20,9 @@ Gem::Specification.new do |spec|
|
|
20
20
|
|
21
21
|
spec.add_development_dependency "bundler", "~> 1.5"
|
22
22
|
spec.add_development_dependency "rake"
|
23
|
+
|
24
|
+
spec.add_dependency "yard", "~> 0.8.7"
|
25
|
+
spec.add_dependency "term-ansicolor"
|
26
|
+
spec.add_dependency 'sparkr', "~> 0.2.0"
|
27
|
+
spec.add_dependency "pry"
|
23
28
|
end
|
data/lib/inch.rb
CHANGED