Class: YARD::CLI::Yardoc

Inherits:
Object
  • Object
show all
Defined in:
lib/extensions.rb

Instance Method Summary collapse

Instance Method Details

#add_extra_files(*files) ⇒ Object



176
177
178
179
180
181
182
183
184
185
# File 'lib/extensions.rb', line 176

def add_extra_files(*files)
  files.map! {|f| f.include?("*") ? Dir.glob(File.join(File.dirname(options_file), f)) : f }.flatten!
  files.each do |file|
    file = File.join(File.dirname(options_file), file) unless file[0] == '/'
    if File.file?(file)
      fname = file.gsub(File.dirname(options_file) + '/', '')
      options[:files] << CodeObjects::ExtraFileObject.new(fname)
    end
  end
end

#support_rdoc_document_file!(file = '.document') ⇒ Object



170
171
172
173
174
# File 'lib/extensions.rb', line 170

def support_rdoc_document_file!(file = '.document')
  IO.read(File.join(File.dirname(options_file), file)).gsub(/^[ \t]*#.+/m, '').split(/\s+/)
rescue Errno::ENOENT
  []
end

#yardopts(file = options_file) ⇒ Object



163
164
165
166
167
168
# File 'lib/extensions.rb', line 163

def yardopts(file = options_file)
  list = IO.read(file).shell_split
  list.map {|a| %w(-c --use-cache --db -b --query).include?(a) ? '-o' : a }
rescue Errno::ENOENT
  []
end