ruby: rdoc can run without gems (with patch)
authorLuiz Angelo Daros de Luca <luizluca@gmail.com>
Sat, 4 Oct 2014 20:19:54 +0000 (17:19 -0300)
committerLuiz Angelo Daros de Luca <luizluca@gmail.com>
Tue, 7 Oct 2014 17:14:53 +0000 (14:14 -0300)
rdoc seems to be written to run without gem. However,
some internal code still does not check for gems presence.
With a small patch, rdoc can run without gems.

Ref: https://bugs.ruby-lang.org/issues/10196

Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
lang/ruby/Makefile
lang/ruby/patches/001-rdoc-remove_gems_dep.patch [new file with mode: 0644]

index 66d58e33a28741bce67e2b1f48fe1dd2ae985234..dfdac6f916e3a31778884b0e34056ac699dddfe8 100644 (file)
@@ -16,7 +16,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ruby
 PKG_VERSION:=2.1.2
-PKG_RELEASE:=4
+PKG_RELEASE:=5
 
 PKG_LIBVER:=2.1
 
diff --git a/lang/ruby/patches/001-rdoc-remove_gems_dep.patch b/lang/ruby/patches/001-rdoc-remove_gems_dep.patch
new file mode 100644 (file)
index 0000000..afe81e8
--- /dev/null
@@ -0,0 +1,32 @@
+--- ruby-2.1.2.orig/lib/rdoc.rb        2014-09-02 17:14:28.719224215 -0300
++++ ruby-2.1.2/lib/rdoc.rb     2014-09-02 17:14:28.762223911 -0300
+@@ -109,6 +109,8 @@
+   def self.load_yaml
+     begin
+       gem 'psych'
++    rescue NameError => e # --disable-gems
++       raise unless e.name == :gem
+     rescue Gem::LoadError
+     end
+--- ruby-2.1.2.orig/lib/rdoc/markdown.rb       2014-09-02 17:14:28.761223918 -0300
++++ ruby-2.1.2/lib/rdoc/markdown.rb    2014-09-02 17:14:28.805223607 -0300
+@@ -525,7 +525,6 @@
+-  require 'rubygems'
+   require 'rdoc'
+   require 'rdoc/markup/to_joined_paragraph'
+   require 'rdoc/markdown/entities'
+--- ruby-2.1.2.orig/lib/rdoc/text.rb   2014-09-02 17:14:28.721224201 -0300
++++ ruby-2.1.2/lib/rdoc/text.rb        2014-09-02 17:14:28.764223897 -0300
+@@ -10,6 +10,8 @@
+ begin
+   gem 'json'
++rescue NameError => e # --disable-gems
++  raise unless e.name == :gem
+ rescue Gem::LoadError
+ end