From 25bf87e871550caac4bd7230b89ab29e01cb98d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= Date: Thu, 20 Sep 2012 16:36:34 +0200 Subject: [PATCH] Fix mustache executable for Ruby 1.9.3 (rhbz#859025). --- ...-fix-mustache-executable-for-ruby193.patch | 26 +++++++++++++++++++ rubygem-mustache.spec | 13 +++++++++- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 mustache-0.99.4-fix-mustache-executable-for-ruby193.patch diff --git a/mustache-0.99.4-fix-mustache-executable-for-ruby193.patch b/mustache-0.99.4-fix-mustache-executable-for-ruby193.patch new file mode 100644 index 0000000..994da86 --- /dev/null +++ b/mustache-0.99.4-fix-mustache-executable-for-ruby193.patch @@ -0,0 +1,26 @@ +From 2c7d84e44d4b204836ce81291a0173da014e7032 Mon Sep 17 00:00:00 2001 +From: Patrick McNally +Date: Mon, 14 Nov 2011 13:52:42 -0600 +Subject: [PATCH] YAML::each_document has gone away in ruby 1.9.3, replaced + call with load_stream + +--- + bin/mustache | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/bin/mustache b/bin/mustache +index 6a9b141..8a364f2 100755 +--- a/bin/mustache ++++ b/bin/mustache +@@ -73,7 +73,7 @@ class Mustache + yaml = $2.strip + template = doc.sub($1, '') + +- YAML.each_document(yaml) do |data| ++ YAML.load_stream(yaml).each do |data| + puts Mustache.render(template, data) + end + else +-- +1.7.10 + diff --git a/rubygem-mustache.spec b/rubygem-mustache.spec index 5358f95..b02fc4e 100644 --- a/rubygem-mustache.spec +++ b/rubygem-mustache.spec @@ -20,11 +20,15 @@ Summary: Framework-agnostic way to render logic-free views Name: rubygem-%{gem_name} Version: 0.99.4 -Release: 5%{?dist} +Release: 6%{?dist} Group: Development/Languages License: MIT URL: http://github.com/defunkt/mustache Source0: http://rubygems.org/downloads/%{gem_name}-%{version}.gem +# Executable fails with Ruby 1.9.3. +# https://bugzilla.redhat.com/show_bug.cgi?id=859025 +# https://github.com/defunkt/mustache/pull/116 +Patch0: mustache-0.99.4-fix-mustache-executable-for-ruby193.patch Requires: ruby(abi) = %{rubyabi} Requires: ruby(rubygems) Requires: ruby @@ -60,6 +64,10 @@ gem install --local --install-dir .%{gem_dir} \ --bindir .%{_bindir} \ --force %{SOURCE0} +pushd .%{gem_instdir} +%patch0 -p1 +popd + %build %install @@ -108,6 +116,9 @@ popd %{gem_instdir}/test %changelog +* Thu Sep 20 2012 Vít Ondruch - 0.99.4-6 +- Fix mustache executable for Ruby 1.9.3 (rhbz#859025). + * Sat Jul 21 2012 Fedora Release Engineering - 0.99.4-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild