Skip to content

Commit ae1e138

Browse files
committed
Always run md-ruby-eval when generating YARD
1 parent 9def842 commit ae1e138

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

tasks/update_doc.rake

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
require 'yard'
22
require 'md_ruby_eval'
33

4+
# TODO (pitr-ch 23-Feb-2017): find a proper place
45
module YARD
56
module Templates::Helpers
67
# The helper module for HTML templates.
@@ -38,23 +39,20 @@ end
3839

3940
root = File.expand_path File.join(File.dirname(__FILE__), '..')
4041

41-
task yard: %w(yard:preprocess yard:doc)
42-
43-
namespace :yard do
44-
45-
YARD::Rake::YardocTask.new(:doc)
42+
cmd = lambda do |command|
43+
puts ">> executing: #{command}"
44+
puts ">> in: #{Dir.pwd}"
45+
system command or raise "#{command} failed"
46+
end
4647

47-
cmd = lambda do |command|
48-
puts ">> executing: #{command}"
49-
puts ">> in: #{Dir.pwd}"
50-
system command or raise "#{command} failed"
48+
yard_doc = YARD::Rake::YardocTask.new(:yard)
49+
yard_doc.before = -> do
50+
Dir.chdir File.join(__dir__, '..', 'doc') do
51+
cmd.call 'bundle exec md-ruby-eval --auto' or raise
5152
end
53+
end
5254

53-
task :preprocess do
54-
Dir.chdir File.join(__dir__, '..', 'doc') do
55-
cmd.call 'bundle exec md-ruby-eval --auto' or raise
56-
end
57-
end
55+
namespace :yard do
5856

5957
desc 'Pushes generated documentation to github pages: http://ruby-concurrency.github.io/concurrent-ruby/'
6058
task :push => [:setup, :yard] do

0 commit comments

Comments
 (0)