module YARD
Backward compatibility for gem specification lookup @see Gem::SourceIndex
Gem::YARDoc provides methods to generate YARDoc and yri data for installed gems upon gem installation.
This file is automatically required by RubyGems 1.9 and newer.
Constants
Public Class Methods
(see YARD::Config.load_plugins
) @deprecated Use {Config.load_plugins}
# File lib/yard.rb, line 31 def self.load_plugins; YARD::Config.load_plugins end
An alias to {Parser::SourceParser}‘s parsing method
@example Parse a glob of files
YARD.parse('lib/**/*.rb')
@see Parser::SourceParser.parse
# File lib/yard.rb, line 20 def self.parse(*args) Parser::SourceParser.parse(*args) end
An alias to {Parser::SourceParser}‘s parsing method
@example Parse a string of input
YARD.parse_string('class Foo; end')
@see Parser::SourceParser.parse_string
# File lib/yard.rb, line 27 def self.parse_string(*args) Parser::SourceParser.parse_string(*args) end
@return [Boolean] whether YARD
is being run in Ruby 1.8 mode
# File lib/yard.rb, line 44 def self.ruby18?; !ruby19? end
@return [Boolean] whether YARD
is being run in Ruby 1.9 mode
# File lib/yard.rb, line 47 def self.ruby19?; @ruby19 ||= (RUBY_VERSION >= "1.9.1") end
@return [Boolean] whether YARD
is being run in Ruby 2.0
# File lib/yard.rb, line 50 def self.ruby2?; @ruby2 ||= (RUBY_VERSION >= '2.0.0') end
@return [Boolean] whether YARD
is being run in Ruby 3.1
# File lib/yard.rb, line 56 def self.ruby31?; @ruby31 ||= (RUBY_VERSION >= '3.1.0') end
@return [Boolean] whether YARD
is being run in Ruby 3.0
# File lib/yard.rb, line 53 def self.ruby3?; @ruby3 ||= (RUBY_VERSION >= '3.0.0') end
@return [Boolean] whether YARD
is being run inside of Windows
# File lib/yard.rb, line 34 def self.windows? return @windows if defined? @windows require 'rbconfig' @windows = ::RbConfig::CONFIG['host_os'] =~ /mingw|win32|cygwin/ ? true : false ensure @windows ||= false end