Add support for listing undocumented stuff.
This commit is contained in:
parent
c974e284dd
commit
006697665d
27
Rakefile
27
Rakefile
|
@ -226,7 +226,7 @@ end
|
||||||
begin
|
begin
|
||||||
require 'yard'
|
require 'yard'
|
||||||
|
|
||||||
namespace :yard do
|
namespace :doc do
|
||||||
task :sass do
|
task :sass do
|
||||||
require scope('lib/sass')
|
require scope('lib/sass')
|
||||||
Dir[scope("yard/default/**/*.sass")].each do |sass|
|
Dir[scope("yard/default/**/*.sass")].each do |sass|
|
||||||
|
@ -235,12 +235,26 @@ begin
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
desc "List all undocumented methods and classes."
|
||||||
|
task :undocumented do
|
||||||
|
opts = ENV["YARD_OPTS"] || ""
|
||||||
|
ENV["YARD_OPTS"] = opts.dup + <<OPTS
|
||||||
|
--list --query "
|
||||||
|
object.docstring.blank? &&
|
||||||
|
!(object.type == :method && object.is_alias?)"
|
||||||
|
OPTS
|
||||||
|
Rake::Task['yard'].execute
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
YARD::Rake::YardocTask.new do |t|
|
YARD::Rake::YardocTask.new do |t|
|
||||||
t.files = FileList.new(scope('lib/**/*.rb')) do |list|
|
t.files = FileList.new(scope('lib/**/*.rb')) do |list|
|
||||||
list.exclude('lib/haml/template/*.rb')
|
list.exclude('lib/haml/template/*.rb')
|
||||||
list.exclude('lib/haml/helpers/action_view_mods.rb')
|
list.exclude('lib/haml/helpers/action_view_mods.rb')
|
||||||
|
list.exclude('lib/haml/helpers/xss_mods.rb')
|
||||||
|
list.exclude('lib/sass/plugin/merb.rb')
|
||||||
|
list.exclude('lib/sass/plugin/rails.rb')
|
||||||
end.to_a
|
end.to_a
|
||||||
t.options << '--incremental' if Rake.application.top_level_tasks.include?('redoc')
|
t.options << '--incremental' if Rake.application.top_level_tasks.include?('redoc')
|
||||||
t.options += FileList.new(scope('yard/*.rb')).to_a.map {|f| ['-e', f]}.flatten
|
t.options += FileList.new(scope('yard/*.rb')).to_a.map {|f| ['-e', f]}.flatten
|
||||||
|
@ -248,12 +262,15 @@ begin
|
||||||
t.options << '--files' << files.join(',')
|
t.options << '--files' << files.join(',')
|
||||||
t.options << '--template-path' << scope('yard')
|
t.options << '--template-path' << scope('yard')
|
||||||
t.options << '--title' << ENV["YARD_TITLE"] if ENV["YARD_TITLE"]
|
t.options << '--title' << ENV["YARD_TITLE"] if ENV["YARD_TITLE"]
|
||||||
if ENV["YARD_OPTS"]
|
|
||||||
require 'shellwords'
|
t.before = lambda do
|
||||||
t.options.concat(Shellwords.shellwords(ENV["YARD_OPTS"]))
|
if ENV["YARD_OPTS"]
|
||||||
|
require 'shellwords'
|
||||||
|
t.options.concat(Shellwords.shellwords(ENV["YARD_OPTS"]))
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
Rake::Task['yard'].prerequisites.insert(0, 'yard:sass')
|
Rake::Task['yard'].prerequisites.insert(0, 'doc:sass')
|
||||||
Rake::Task['yard'].instance_variable_set('@comment', nil)
|
Rake::Task['yard'].instance_variable_set('@comment', nil)
|
||||||
|
|
||||||
desc "Generate Documentation"
|
desc "Generate Documentation"
|
||||||
|
|
|
@ -106,7 +106,7 @@ module Sass::Script
|
||||||
# @raise [NoMethodError] if `other` is an invalid type
|
# @raise [NoMethodError] if `other` is an invalid type
|
||||||
def times(other)
|
def times(other)
|
||||||
if other.is_a? Number
|
if other.is_a? Number
|
||||||
self.operate(other, :*)
|
operate(other, :*)
|
||||||
elsif other.is_a? Color
|
elsif other.is_a? Color
|
||||||
other.times(self)
|
other.times(self)
|
||||||
else
|
else
|
||||||
|
@ -284,7 +284,7 @@ module Sass::Script
|
||||||
end, num_units, den_units)
|
end, num_units, den_units)
|
||||||
end
|
end
|
||||||
|
|
||||||
protected
|
private
|
||||||
|
|
||||||
def operate(other, operation)
|
def operate(other, operation)
|
||||||
this = self
|
this = self
|
||||||
|
|
Loading…
Reference in New Issue