Module: Bond::Yard

Extended by:
Yard
Included in:
Yard
Defined in:
lib/bond/yard.rb

Overview

Generates method autocompletions for gems that use yard documentation. Currently generates completions for methods that take a hash of options and have been documented with @option.

Instance Method Summary (collapse)

Instance Method Details

- (Object) load_yard_gems(*gems)

Loads completions for yard gem(s)

Raises:

  • (LoadError)


8
9
10
11
12
13
14
15
# File 'lib/bond/yard.rb', line 8

def load_yard_gems(*gems)
  @options = gems[-1].is_a?(Hash) ? gems.pop : {}
  require 'yard'
  raise LoadError unless YARD::VERSION >= '0.5.2'
  gems.select {|e| load_yard_gem(e) }
rescue LoadError
  $stderr.puts "Bond Error: yard gem (version >= 0.5.2) not installed "
end