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
|
# File 'lib/solargraph/yard_methods.rb', line 3
def yard_options
if @yard_options.nil?
@yard_options = {
include: [],
exclude: [],
flags: []
}
unless workspace.nil?
yardopts_file = File.join(workspace, '.yardopts')
if File.exist?(yardopts_file)
yardopts = File.read(yardopts_file)
yardopts.lines.each { |line|
arg = line.strip
if arg.start_with?('-')
@yard_options[:flags].push arg
else
@yard_options[:include].push arg
end
}
end
end
@yard_options[:include].concat ['app/**/*.rb', 'lib/**/*.rb'] if @yard_options[:include].empty?
end
@yard_options
end
|