Sha256: 71696d800c003069a5294491f6e0a665c03db600398339c79e193f4361581d59
Contents?: true
Size: 1.75 KB
Versions: 2
Compression:
Stored size: 1.75 KB
Contents
require 'guard' require 'guard/guard' require 'yard' module Guard class Yard < Guard autoload :NoServer, 'guard/yard/no_server' autoload :Server, 'guard/yard/server' attr_accessor :server def initialize(watchers=[], options={}) super options[:server] = true unless options.has_key?(:server) @server = options[:server] ? Server.new(options) : NoServer.new end def start boot end def stop server.kill end def reload boot end def run_all UI.info "[Guard::Yard] Generating all documentation." system('rm -rf .yardoc && yard doc') UI.info "[Guard::Yard] Documentation has been generated." true end def run_on_changes(paths) UI.info "[Guard::Yard] Detected changes in #{paths.join(',')}." paths.each{ |path| document([path]) } UI.info "[Guard::Yard] Updated documentation for #{paths.join(',')}." end private def check return true if File.exists?('.yardoc') UI.info "[Guard::Yard] Documentation missing." run_all and true end def boot check and server.kill and server.spawn and server.verify end def document files ::YARD::Registry.load! ::YARD::Registry.load(files, true) ::YARD::Registry.load_all yardoc = ::YARD::CLI::Yardoc.new yardoc.parse_arguments options = yardoc.options objects = ::YARD::Registry.all(:root, :module, :class).reject do |object| (!options[:serializer] || options[:serializer].exists?(object)) \ && !object.files.any?{|f,line| files.include?(f)} end ::YARD::Templates::Engine.generate(objects, options) save_registry end def save_registry ::YARD::Registry.save(true) end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
guard-yard-2.1.3 | lib/guard/yard.rb |
guard-yard-2.1.1 | lib/guard/yard.rb |