Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ begin
rescue LoadError
end

task :default => [:clobber, :compile, 'README.md', :test]
task :default => [:clobber, :compile, 'README.md', :check_readme, :test]

file 'README.md' => ['lib/debug/session.rb', 'lib/debug/config.rb',
'exe/rdbg', 'misc/README.md.erb'] do
Expand All @@ -25,6 +25,20 @@ file 'README.md' => ['lib/debug/session.rb', 'lib/debug/config.rb',
puts 'README.md is updated.'
end

task :check_readme do
require_relative 'lib/debug/session'
require 'erb'
current_readme = File.read("README.md")
generated_readme = ERB.new(File.read('misc/README.md.erb')).result

if current_readme != generated_readme
fail <<~MSG
The content of README.md doesn't match its template and/or source.
Please apply the changes to info source (e.g. command comments) or the template and run 'rake README.md' to update README.md.
MSG
end
end

task :test_protocol do
ENV['RUBY_DEBUG_PROTOCOL_TEST'] = '1'
end
Expand Down