[DRE-commits] [nanoc] 03/06: add patch to filter out nil Gem::Specifications with Ruby 2.3
Cédric Boutillier
boutil at moszumanska.debian.org
Wed Mar 2 21:16:50 UTC 2016
This is an automated email from the git hooks/post-receive script.
boutil pushed a commit to branch master
in repository nanoc.
commit 3a821b0c3a04e653ee05fdd5ab2db6ea109b6d3f
Author: Cédric Boutillier <boutil at debian.org>
Date: Wed Mar 2 21:58:46 2016 +0100
add patch to filter out nil Gem::Specifications with Ruby 2.3
---
debian/patches/filter_out_nil_gemspec.patch | 19 +++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 20 insertions(+)
diff --git a/debian/patches/filter_out_nil_gemspec.patch b/debian/patches/filter_out_nil_gemspec.patch
new file mode 100644
index 0000000..dee4319
--- /dev/null
+++ b/debian/patches/filter_out_nil_gemspec.patch
@@ -0,0 +1,19 @@
+Description: filter out nil Gem specifications
+ For some reason, for Ruby2.3, some specifications selected by gem_and_versions
+ are nil, which causes error when trying to call #name on them
+ selecting explicitly the non nil ones fixes the problem for now
+Author: Cédric Boutillier <boutil at debian.org>
+Forwarded: not-needed
+Last-Update: 2016-03-02
+
+--- a/lib/nanoc/cli/error_handler.rb
++++ b/lib/nanoc/cli/error_handler.rb
+@@ -169,7 +169,7 @@
+ # @return [Hash<String, Array>] A hash containing the gem names as keys and gem versions as value
+ def gems_and_versions
+ gems = {}
+- Gem::Specification.find_all.sort_by { |s| [s.name, s.version] }.each do |spec|
++ Gem::Specification.select{ |s| !s.nil? }.sort_by { |s| [s.name, s.version] }.each do |spec|
+ gems[spec.name] ||= []
+ gems[spec.name] << spec.version.to_s
+ end
diff --git a/debian/patches/series b/debian/patches/series
index 42669b8..101e581 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -5,3 +5,4 @@ no_rdoc4.patch
no_privacy_breach.patch
no_vcr.patch
set-load_paths-for-sass-tests.patch
+filter_out_nil_gemspec.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/nanoc.git
More information about the Pkg-ruby-extras-commits
mailing list