Skip to content

Commit

Permalink
Add a build:local_ruby task to simplify local testing flow (#1281)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
st0012 authored Jan 24, 2025
1 parent f6289b7 commit c2eef4b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/ruby-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ jobs:
- name: Build RDoc locally
run: |
bundle install
bundle exec rake build
mv pkg/rdoc-*.gem ../ruby/gems
bundle exec rake build:local_ruby
working-directory: ruby/rdoc
- name: Generate Documentation with RDoc
run: make html
Expand Down
13 changes: 13 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,19 @@ task :clean do
end
end

desc "Build #{Bundler::GemHelper.gemspec.full_name} and move it to local ruby/ruby project's bundled gems folder"
namespace :build do
task local_ruby: :build do
target = File.join("..", "ruby", "gems")

unless File.directory?(target)
abort("Expected Ruby to be cloned under the same parent directory as RDoc to use this task")
end

mv("#{path}.gem", target)
end
end

begin
require 'rubocop/rake_task'
rescue LoadError
Expand Down

0 comments on commit c2eef4b

Please sign in to comment.