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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
# File 'lib/yard/yaml/tags.rb', line 13
def register!
return unless defined?(::YARD) && ::YARD.const_defined?(:Tags)
unless ::YARD::Tags.const_defined?(:Library, false)
if defined?(::Library) && ::Library.is_a?(Module)
begin
::YARD::Tags.const_set(:Library, ::Library)
rescue StandardError
return
end
else
lib = Module.new
class << lib
attr_accessor :calls
def define_tag(*args)
self.calls ||= []
self.calls << args
end
end
begin
::YARD::Tags.const_set(:Library, lib)
rescue StandardError
return
end
end
end
begin
::YARD::Tags::Library.define_tag("YAML", :yaml, :with_title_and_text)
rescue StandardError
end
begin
::YARD::Tags::Library.define_tag("YAML File", :yaml_file, :with_text)
rescue StandardError
end
end
|