Skip to content

Commit 9d1df6b

Browse files
vinistockst0012
andcommitted
Allow installing RDoc from a git source
Co-authored-by: Stan Lo <st0012@users.noreply.github.com>
1 parent 265d572 commit 9d1df6b

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

ext/rdoc/extconf.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# frozen_string_literal: true
2+
3+
# Generate all parse files using racc and kpeg. This is not necessary for regular gem installation, but it is when
4+
# installing RDoc from the git source. Without this, the generated parse files would not exist and RDoc would not work
5+
system("gem install kpeg && rake generate") if Dir.exist?(File.join("..", "..", ".git"))
6+
7+
# RDoc doesn't actually have a native extension, but a Makefile needs to exist in order to successfully install the gem
8+
require "mkmf"
9+
create_makefile("rdoc/rdoc")

rdoc.gemspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ RDoc includes the +rdoc+ and +ri+ tools for generating and displaying documentat
3535
s.bindir = "exe"
3636
s.executables = ["rdoc", "ri"]
3737
s.require_paths = ["lib"]
38+
s.extensions = ["ext/rdoc/extconf.rb"]
3839
# for ruby core repository. It was generated by
3940
# `git ls-files -z`.split("\x0").each {|f| puts " #{f.dump}," unless f.start_with?(*%W[test/ spec/ features/ .]) }
4041
s.files = [

0 commit comments

Comments
 (0)