From 1e1d94d125e5b9407b658326ee9531de8b007b50 Mon Sep 17 00:00:00 2001 From: taca Date: Mon, 7 Nov 2011 11:56:25 +0000 Subject: Don't require 'yaml' unconditionaly but try to call Gem.load_yaml. Avoid possible problem of ruby192-base with ruby-psych installed. --- lang/ruby/files/update-gemspec.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lang/ruby') diff --git a/lang/ruby/files/update-gemspec.rb b/lang/ruby/files/update-gemspec.rb index 77256a9ee85..5bfa8cd4553 100644 --- a/lang/ruby/files/update-gemspec.rb +++ b/lang/ruby/files/update-gemspec.rb @@ -1,7 +1,7 @@ #!/usr/pkg/bin/ruby # -*- coding: utf-8 -*- # -# $NetBSD: update-gemspec.rb,v 1.2 2011/09/13 03:18:29 taca Exp $ +# $NetBSD: update-gemspec.rb,v 1.3 2011/11/07 11:56:25 taca Exp $ # # Copyright (c) 2011 The NetBSD Foundation, Inc. # All rights reserved. @@ -36,10 +36,16 @@ # This is a quick and dirty tool which updates gemspec file: # require 'rubygems' -require 'yaml' require 'fileutils' require 'optparse' +begin + # Since newer rubygems load psych instead of syck, don't load yaml directly. + Gem.load_yaml +rescue NoMethodError + # Older rubygems don't have load_yaml() and don't know about psych. +end + class GemSpecUpdater OrigSuffix = '.orig_gemspec' -- cgit v1.2.3