-
Notifications
You must be signed in to change notification settings - Fork 0
/
tquery
executable file
·37 lines (34 loc) · 857 Bytes
/
tquery
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#! /usr/bin/env ruby
require('bundler')
Bundler.setup
require('yard')
require('byebug')
alltags = YARD::Registry.load!.all
tagnames = ARGV.map { |e| e.to_sym }
if (tagnames.empty?)
tagnames = %i[ todo note ]
end
tagnames = tagnames.sort
taglists = {}
tagnames.each do |tagsym|
taglists[tagsym] = alltags.select { |o| o.tag(tagsym) }
taglists[tagsym].each do |tagelt|
puts(format("@%s %s\n %s#%i",
tagelt.tag(tagsym).tag_name,
tagelt.path,
tagelt.file,
tagelt.line))
text = tagelt.tag(tagsym).text
if (text.kind_of?(String))
text = text.split(%r!\n!)
text = ' ' + text.join("\n ")
puts(text)
end
end
end
# Local Variables:
# mode: ruby
# indent-tabs-mode: nil
# eval: (if (intern-soft "fci-mode") (fci-mode 1))
# eval: (auto-fill-mode 1)
# End: