119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
|
# File 'lib/rbs/annotate/annotations.rb', line 119
def self.parse(annotation)
string = annotation.string
case
when match = string.match(/\Aannotate:rdoc:skip(:all)?\Z/)
Skip.new(
annotation: annotation,
skip_children: string.end_with?(":all")
)
when match = string.match(/\Aannotate:rdoc:source:from=(?<path>.+)\Z/)
Source.new(
annotation: annotation,
include: (match[:path] or raise).strip
)
when match = string.match(/\Aannotate:rdoc:source:skip=(?<path>.+)\Z/)
Source.new(
annotation: annotation,
skip: (match[:path] or raise).strip
)
when match = string.match(/\Aannotate:rdoc:copy:(?<name>.+)\Z/)
Copy.new(
annotation: annotation,
source: (match[:name] or raise).strip
)
end
end
|