Skip to content

Commit f1c470a

Browse files
committed
Add a build:local_ruby task to simplify local testing flow
A common way to test RDoc changes is to build `ruby/ruby`'s documentation with the latest RDoc changes. When RDoc was a default gem, we can sync it to `ruby/ruby` with its `tool/sync_default_gems.rb` script. Now that RDoc is a bundled gem, we need to use a different method to sync it to `ruby/ruby`. And so far building it and moving it to `ruby/ruby`'s bundled gems folder is the easiest way to do it.
1 parent f6289b7 commit f1c470a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Rakefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,18 @@ task :clean do
9999
end
100100
end
101101

102+
desc "Build #{Bundler::GemHelper.gemspec.full_name} and move it to local ruby/ruby project's bundled gems folder"
103+
namespace :build do
104+
task local_ruby: :build do
105+
target = File.join("..", "ruby", "gems")
106+
unless File.directory?(target)
107+
abort("Expected ruby to be cloned at the same level as #{Bundler::GemHelper.gemspec.full_name} to use this task")
108+
end
109+
110+
mv("#{path}.gem", target)
111+
end
112+
end
113+
102114
begin
103115
require 'rubocop/rake_task'
104116
rescue LoadError

0 commit comments

Comments
 (0)