[DRE-commits] [kwalify] 01/05: [patch] YAML.load_documents is obsolete

Marc Dequènes duck at moszumanska.debian.org
Tue Aug 4 21:07:18 UTC 2015


This is an automated email from the git hooks/post-receive script.

duck pushed a commit to branch master
in repository kwalify.

commit 0a860a7978344a876624a4ad8410c5f1f276ccfc
Author: Marc Dequènes (Duck) <Duck at DuckCorp.org>
Date:   Tue Aug 4 21:34:44 2015 +0200

    [patch] YAML.load_documents is obsolete
---
 debian/changelog                     |  6 +++++
 debian/patches/series                |  1 +
 debian/patches/yaml_deprecated.patch | 52 ++++++++++++++++++++++++++++++++++++
 3 files changed, 59 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 7538467..6004187 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+kwalify (0.7.2-3) UNRELEASED; urgency=medium
+
+  * Added patch to fix using the deprecated YAML.load_documents method.
+
+ -- Marc Dequènes (Duck) <Duck at DuckCorp.org>  Tue, 04 Aug 2015 21:33:19 +0200
+
 kwalify (0.7.2-3~exp1) experimental; urgency=low
 
   * Team upload.
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..e3fd2aa
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+yaml_deprecated.patch
diff --git a/debian/patches/yaml_deprecated.patch b/debian/patches/yaml_deprecated.patch
new file mode 100644
index 0000000..b80f760
--- /dev/null
+++ b/debian/patches/yaml_deprecated.patch
@@ -0,0 +1,52 @@
+Index: kwalify/contrib/kwalify
+===================================================================
+--- kwalify.orig/contrib/kwalify
++++ kwalify/contrib/kwalify
+@@ -4010,7 +4010,7 @@ module Kwalify
+           end
+         else
+           i = 0
+-          YAML.load_documents(input) do |ydoc|
++          YAML.load_stream(input) do |ydoc|
+             errors = validator.validate(ydoc)
+             _show_errors(filename, i, ydoc, errors)
+             i += 1
+Index: kwalify/lib/kwalify/util/testcase-helper.rb
+===================================================================
+--- kwalify.orig/lib/kwalify/util/testcase-helper.rb
++++ kwalify/lib/kwalify/util/testcase-helper.rb
+@@ -33,7 +33,7 @@ class Test::Unit::TestCase   # :nodoc:
+     identkey = options[:identkey] || 'name'
+     list = []
+     table = {}
+-    YAML.load_documents(str) do |ydoc|
++    YAML.load_stream(str) do |ydoc|
+       if ydoc.is_a?(Hash)
+         list << ydoc
+       elsif ydoc.is_a?(Array)
+Index: kwalify/test/test-databinding.rb
+===================================================================
+--- kwalify.orig/test/test-databinding.rb
++++ kwalify/test/test-databinding.rb
+@@ -14,7 +14,7 @@ class DataBindingTest < Test::Unit::Test
+   filename = __FILE__.sub(/\.rb$/, '.yaml')
+   input = Kwalify::Util.untabify(File.read(filename))
+   TESTDATA1 = {}
+-  YAML.load_documents(input) do |ydoc|
++  YAML.load_stream(input) do |ydoc|
+     hash_list = ydoc
+     hash_list.each do |hash|
+       for key in hash.keys()
+Index: kwalify/lib/kwalify/main.rb
+===================================================================
+--- kwalify.orig/lib/kwalify/main.rb
++++ kwalify/lib/kwalify/main.rb
+@@ -296,7 +296,7 @@ module Kwalify
+           end
+         else
+           i = 0
+-          YAML.load_documents(input) do |ydoc|
++          YAML.load_stream(input) do |ydoc|
+             errors = validator.validate(ydoc)
+             _show_errors(filename, i, ydoc, errors)
+             i += 1

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/kwalify.git



More information about the Pkg-ruby-extras-commits mailing list