From e11dee85448fc7270671c1f1a004739f49a93903 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= Date: Fri, 10 Jan 2014 16:06:12 +0100 Subject: [PATCH] Don't generate documentation on unexpected places. --- ruby.spec | 9 +++ ...-Add-BasicSpecification-source_paths.patch | 73 +++++++++++++++++++ ...ource_paths-for-fallback-rdoc-plugin.patch | 26 +++++++ 3 files changed, 108 insertions(+) create mode 100644 rubygems-2.2.1-Add-BasicSpecification-source_paths.patch create mode 100644 rubygems-2.2.1-Use-source_paths-for-fallback-rdoc-plugin.patch diff --git a/ruby.spec b/ruby.spec index 3eff915..ce34984 100644 --- a/ruby.spec +++ b/ruby.spec @@ -143,6 +143,12 @@ Patch18: ruby-2.1.0-resolv.rb-no-encodings.patch # Backport regenerated certificates for IMAP tests. # http://bugs.ruby-lang.org/issues/9341 Patch19: ruby-2.1.1-fix-test-failures-due-to-expired-certs.patch +# Fix documentation generated on unexpected places. +# https://github.com/rubygems/rubygems/issues/758 +# https://github.com/rubygems/rubygems/commit/e088c6824209d98eccb0f1e6c7e21f26b4a1178d +Patch20: rubygems-2.2.1-Add-BasicSpecification-source_paths.patch +# https://github.com/rubygems/rubygems/commit/2f03b54b63043aadce9e95b83e98b29712bad21f +Patch21: rubygems-2.2.1-Use-source_paths-for-fallback-rdoc-plugin.patch Requires: %{name}-libs%{?_isa} = %{version}-%{release} Requires: ruby(rubygems) >= %{rubygems_version} @@ -408,6 +414,8 @@ Tcl/Tk interface for the object-oriented scripting language Ruby. %patch17 -p1 %patch18 -p1 %patch19 -p1 +%patch20 -p1 +%patch21 -p1 # Provide an example of usage of the tapset: cp -a %{SOURCE3} . @@ -917,6 +925,7 @@ OPENSSL_ENABLE_MD5_VERIFY=1 make check TESTS="-v $DISABLE_TESTS" %changelog * Fri Jan 10 2014 Vít Ondruch - 2.1.0-18 +- Don't generate documentation on unexpected places. - Detect if rubygems are running under rpmbuild and install gem binary extensions into appropriate place. diff --git a/rubygems-2.2.1-Add-BasicSpecification-source_paths.patch b/rubygems-2.2.1-Add-BasicSpecification-source_paths.patch new file mode 100644 index 0000000..3cd1bed --- /dev/null +++ b/rubygems-2.2.1-Add-BasicSpecification-source_paths.patch @@ -0,0 +1,73 @@ +From e088c6824209d98eccb0f1e6c7e21f26b4a1178d Mon Sep 17 00:00:00 2001 +From: Eric Hodel +Date: Mon, 6 Jan 2014 14:20:18 -0800 +Subject: [PATCH] Add BasicSpecification#source_paths + +This allows documentation and analysis tools to retrieve paths of source +files in gems. This is needed as the introduction of shared gem +directories means the extension source directory is no longer included +in require_paths (which was meant for $LOAD_PATH, not source code). +--- + lib/rubygems/basic_specification.rb | 18 ++++++++++++++++++ + test/rubygems/test_gem_specification.rb | 16 ++++++++++++++++ + 2 files changed, 34 insertions(+) + +diff --git a/lib/rubygems/basic_specification.rb b/lib/rubygems/basic_specification.rb +index a52377f..470a6eb 100644 +--- a/lib/rubygems/basic_specification.rb ++++ b/lib/rubygems/basic_specification.rb +@@ -207,6 +207,24 @@ def require_paths + end + + ## ++ # Returns the paths to the source files for use with analysis and ++ # documentation tools. These paths are relative to full_gem_path. ++ ++ def source_paths ++ paths = raw_require_paths.dup ++ ++ if @extensions then ++ ext_dirs = @extensions.map do |extension| ++ extension.split(File::SEPARATOR, 2).first ++ end.uniq ++ ++ paths.concat ext_dirs ++ end ++ ++ paths.uniq ++ end ++ ++ ## + # Return a Gem::Specification from this gem + + def to_spec +diff --git a/test/rubygems/test_gem_specification.rb b/test/rubygems/test_gem_specification.rb +index 46db0c4..b72a5d1 100644 +--- a/test/rubygems/test_gem_specification.rb ++++ b/test/rubygems/test_gem_specification.rb +@@ -1809,6 +1809,22 @@ def test_source + assert_kind_of Gem::Source::Installed, @a1.source + end + ++ def test_source_paths ++ ext_spec ++ ++ @ext.require_paths = %w[lib ext foo] ++ @ext.extensions << 'bar/baz' ++ ++ expected = %w[ ++ lib ++ ext ++ foo ++ bar ++ ] ++ ++ assert_equal expected, @ext.source_paths ++ end ++ + def test_full_require_paths + ext_spec + +-- +1.8.5.1 + diff --git a/rubygems-2.2.1-Use-source_paths-for-fallback-rdoc-plugin.patch b/rubygems-2.2.1-Use-source_paths-for-fallback-rdoc-plugin.patch new file mode 100644 index 0000000..edf40f1 --- /dev/null +++ b/rubygems-2.2.1-Use-source_paths-for-fallback-rdoc-plugin.patch @@ -0,0 +1,26 @@ +From 2f03b54b63043aadce9e95b83e98b29712bad21f Mon Sep 17 00:00:00 2001 +From: Eric Hodel +Date: Mon, 6 Jan 2014 14:30:07 -0800 +Subject: [PATCH] Use source_paths for fallback rdoc plugin + +Fixes #758 +--- + lib/rubygems/rdoc.rb | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/rubygems/rdoc.rb b/lib/rubygems/rdoc.rb +index 52249dc..633bd89 100644 +--- a/lib/rubygems/rdoc.rb ++++ b/lib/rubygems/rdoc.rb +@@ -193,7 +193,7 @@ def generate + ::RDoc::Parser::C.reset + + args = @spec.rdoc_options +- args.concat @spec.require_paths ++ args.concat @spec.source_paths + args.concat @spec.extra_rdoc_files + + case config_args = Gem.configuration[:rdoc] +-- +1.8.5.1 +