Included Modules

Bones::Plugins::Yard

Public Instance Methods

define_tasks() click to toggle source
    # File lib/bones/plugins/yard.rb, line 48
48:   def define_tasks
49:     return unless have?(:yard)
50:     config = ::Bones.config
51: 
52:     namespace :doc do
53:       desc 'Generate Yard documentation'
54:       YARD::Rake::YardocTask.new(:yard) do |yd|
55:         yard = config.yard
56: 
57:         incl = Regexp.new(yard.include.join('|'))
58:         excl = Regexp.new(yard.exclude.join('|'))
59:         yd.files = config.gem.files.find_all do |fn|
60:                      case fn
61:                      when excl; false
62:                      when incl; true
63:                      else false end
64:                    end
65: 
66:         yd.options << '--main' << yard.main
67:         yd.options << '--output-dir' << yard.dir
68:         yd.options << '--title' << "#{config.name}-#{config.version} Documentation"
69: 
70:         yd.options.concat(yard.opts)
71:       end
72: 
73:       task :clobber_yard do
74:         rm_r config.yard.dir rescue nil
75:       end
76:     end  # namespace :doc
77: 
78:     desc 'Alias to doc:yard'
79:     task :doc => 'doc:yard'
80: 
81:     task :clobber => %(doc:clobber_yard)
82:   end
initialize_yard() click to toggle source
    # File lib/bones/plugins/yard.rb, line 6
 6:   def initialize_yard
 7:     require 'yard'
 8:     require 'yard/rake/yardoc_task'
 9:     have?(:yard) { true }
10: 
11:     ::Bones.config {
12:       desc 'Configuration settings for yard'
13:       yard {
14:         opts  [], :desc => 'Array of yard options to use when generating documentation.'
15: 
16:         include  %(^lib/ ^bin/ ^ext/ \.txt$ \.rdoc$), :desc =>           An array of patterns that will be used to find the files for which          documentation should be generated. This is an array of strings that          will be converted in regular expressions.
17: 
18:         exclude  %(extconf\.rb$), :desc =>           An array of patterns that will be used to exclude files from yard          processing. This is an array of strings that will be converted in          regular expressions.
19: 
20:         main  nil, :desc =>           The main yard file for the project. This defaults to the project's          README file.
21: 
22:         dir  'doc', :desc => 'Output directory for generated documentation.'
23:       }
24:     }
25:   rescue LoadError
26:     have?(:yard) { false }
27:   end
post_load() click to toggle source
    # File lib/bones/plugins/yard.rb, line 40
40:   def post_load
41:     return unless have? :yard
42:     config = ::Bones.config
43: 
44:     config.exclude << "^#{Regexp.escape(config.yard.dir)}/"
45:     config.yard.main ||= config.readme_file
46:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.