Commit 93e888b2 authored by Samuel E. Giddins's avatar Samuel E. Giddins

Merge pull request #4640 from CocoaPods/seg-inch-by-inch

[Rakefile] Switch to inch_by_inch for documentation task
parents 0e85cde6 b3ff5e7c
......@@ -35,11 +35,13 @@ group :development do
gem 'mocha-on-bacon'
gem 'prettybacon'
gem 'webmock'
gem 'inch'
# Integration tests
gem 'diffy'
gem 'clintegracon'
# Code Quality
gem 'inch_by_inch'
gem 'rubocop'
end
......
......@@ -140,11 +140,14 @@ GEM
ffi (1.9.6)
fuzzy_match (2.0.4)
i18n (0.7.0)
inch (0.5.10)
inch (0.7.0)
pry
sparkr (>= 0.2.0)
term-ansicolor
yard (~> 0.8.7.5)
inch_by_inch (1.0.0)
inch (~> 0.7.0)
rake (~> 10.0)
kicker (3.0.0)
listen (~> 1.3.0)
notify (~> 0.5.2)
......@@ -167,7 +170,7 @@ GEM
powerpack (0.1.1)
prettybacon (0.0.2)
bacon (~> 1.2)
pry (0.10.1)
pry (0.10.3)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
......@@ -190,10 +193,10 @@ GEM
safe_yaml (1.0.4)
slop (3.6.0)
sparkr (0.4.1)
term-ansicolor (1.3.0)
term-ansicolor (1.3.2)
tins (~> 1.0)
thread_safe (0.3.5)
tins (1.3.5)
tins (1.8.1)
tzinfo (1.2.2)
thread_safe (~> 0.1)
webmock (1.20.4)
......@@ -221,7 +224,7 @@ DEPENDENCIES
cocoapods-trunk!
cocoapods-try!
diffy
inch
inch_by_inch
json!
kicker
mocha
......
......@@ -31,6 +31,7 @@ begin
end
require 'bundler/gem_tasks'
require 'bundler/setup'
# Pre release
#-----------------------------------------------------------------------------#
......@@ -145,7 +146,7 @@ begin
Rake::Task['rubocop'].invoke
title 'Running Inch'
Rake::Task['inch:spec'].invoke
Rake::Task['inch'].invoke
end
namespace :fixture_tarballs do
......@@ -302,57 +303,8 @@ begin
#-- Inch -------------------------------------------------------------------#
namespace :inch do
desc 'Lint the completeness of the documentation with Inch'
task :spec do
require 'inch'
require 'inch/cli'
puts 'Parse docs …'
YARD::Parser::SourceParser.before_parse_file do |_|
print green('.') # Visualize progress
end
class ProgressEnumerable
include Enumerable
def initialize(array)
@array = array
end
def each
@array.each do |e|
print '.'
yield e
end
end
end
Inch::Codebase::Objects.class_eval do
alias_method :old_init, :initialize
def initialize(language, objects)
puts "\n\nEvaluating …"
old_init(language, ProgressEnumerable.new(objects))
end
end
codebase = Inch::Codebase.parse(Dir.pwd, Inch::Config.codebase)
context = Inch::API::List.new(codebase, {})
options = Inch::CLI::Command::Options::List.new
options.show_all = true
options.ui = Inch::Utils::UI.new
failing_grade_symbols = [:B, :C] # add :U for undocumented
failing_grade_list = context.grade_lists.select { |g| failing_grade_symbols.include?(g.to_sym) }
Inch::CLI::Command::Output::List.new(options, context.objects, failing_grade_list)
puts
if context.objects.any? { |o| failing_grade_symbols.include?(o.grade.to_sym) }
puts red('✗ Lint of Documentation failed: Please improve above suggestions.')
exit 1
else
puts green('✓ Nothing to improve detected.')
end
end
end
require 'inch_by_inch/rake_task'
InchByInch::RakeTask.new
rescue LoadError, NameError => e
$stderr.puts "\033[0;31m" \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment