[BACK]Return to patch-lib_rubygems_specification.rb CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / lang / ruby200-base / patches

File: [cvs.NetBSD.org] / pkgsrc / lang / ruby200-base / patches / Attic / patch-lib_rubygems_specification.rb (download)

Revision 1.3, Sun Mar 8 14:59:12 2015 UTC (9 years, 1 month ago) by taca
Branch: MAIN
CVS Tags: pkgsrc-2015Q4-base, pkgsrc-2015Q4, pkgsrc-2015Q3-base, pkgsrc-2015Q3, pkgsrc-2015Q2-base, pkgsrc-2015Q2, pkgsrc-2015Q1-base, pkgsrc-2015Q1
Changes since 1.2: +5 -15 lines

Update ruby200-base to 2.0.0p643.

This is the last ordinal release of Ruby 2.0.0. Ruby 2.0.0 goes into the
state of the security maintenance phase, and will never be released unless
any critical regressions or security issues are found. This phase is planned
to be maintained for 1 year. Then, maintenance of Ruby 2.0.0 will be ended
at Feb. 24th, 2016. We recommend to start planning to migrate to newer
versions of Ruby, such as 2.1 or 2.2.

pkgsrc change:

* Change "os" of Gem::Platform, now it change the case of "netbsd" only.
* Reduce patches to builtin rubygems.

$NetBSD: patch-lib_rubygems_specification.rb,v 1.3 2015/03/08 14:59:12 taca Exp $

* Changes for pkgsrc environment:

  -  Allow some attributes to nil.
  -  Relax date/time format.

And allow multiple conditions for requirement from Ruby 2.0.0 and
Rubygem 1.8.25.

--- lib/rubygems/specification.rb.orig	2013-11-13 02:59:08.000000000 +0000
+++ lib/rubygems/specification.rb
@@ -162,6 +162,12 @@ class Gem::Specification
     @@default_value[k].nil?
   }
 
+  # under pkgsrc environment
+  @@pkgsrc_nil_attributes = {}
+  [:authors, :cert_chain, :executables, :extensions, :extra_rdoc_files, :licenses, :required_rubygems_version, :test_files].each do |k|
+    @@pkgsrc_nil_attributes[k] = true
+  end
+
   ######################################################################
   # :section: Required gemspec attributes
 
@@ -2334,7 +2340,24 @@ class Gem::Specification
     normalize
 
     nil_attributes = self.class.non_nil_attributes.find_all do |name|
-      instance_variable_get("@#{name}").nil?
+      val = instance_variable_get("@#{name}")
+      if val.nil?
+        if @@pkgsrc_nil_attributes.key?(name)
+          case name
+          when :required_rubygems_version
+            val = Gem::Requirement.default
+          else
+            val = []
+          end
+          instance_variable_set("@#{name}", val)
+          false
+        end
+      end
+      if name == :authors and val.empty?
+        val = ['not specified']
+        self.authors = val
+        false
+      end
     end
 
     unless nil_attributes.empty? then
@@ -2474,8 +2474,7 @@ class Gem::Specification
 
     if homepage and not homepage.empty? and
        homepage !~ /\A[a-z][a-z\d+.-]*:/i then
-      raise Gem::InvalidSpecificationException,
-            "\"#{homepage}\" is not a URI"
+      wann "\"#{homepage}\" is not a URI"
     end
 
     # Warnings