Hello community, here is the log from the commit of package rubygem-mustache for openSUSE:Factory checked in at 2019-01-21 10:25:16 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-mustache (Old) and /work/SRC/openSUSE:Factory/.rubygem-mustache.new.28833 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-mustache" Mon Jan 21 10:25:16 2019 rev:5 rq:656364 version:1.1.0 Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-mustache/rubygem-mustache.changes 2017-04-11 09:34:14.513647528 +0200 +++ /work/SRC/openSUSE:Factory/.rubygem-mustache.new.28833/rubygem-mustache.changes 2019-01-21 10:25:17.825754344 +0100 @@ -1,0 +2,6 @@ +Sat Dec 8 16:26:01 UTC 2018 - Stephan Kulow <co...@suse.com> + +- updated to version 1.1.0 + no changelog found + +------------------------------------------------------------------- Old: ---- mustache-1.0.5.gem New: ---- mustache-1.1.0.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-mustache.spec ++++++ --- /var/tmp/diff_new_pack.IGeOup/_old 2019-01-21 10:25:18.253753873 +0100 +++ /var/tmp/diff_new_pack.IGeOup/_new 2019-01-21 10:25:18.257753869 +0100 @@ -1,7 +1,7 @@ # # spec file for package rubygem-mustache # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -12,7 +12,7 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # @@ -24,7 +24,7 @@ # Name: rubygem-mustache -Version: 1.0.5 +Version: 1.1.0 Release: 0 %define mod_name mustache %define mod_full_name %{mod_name}-%{version} @@ -34,7 +34,7 @@ BuildRequires: ruby-macros >= 5 BuildRequires: update-alternatives Url: https://github.com/mustache/mustache -Source: http://rubygems.org/gems/%{mod_full_name}.gem +Source: https://rubygems.org/gems/%{mod_full_name}.gem Source1: gem2rpm.yml Summary: Mustache is a framework-agnostic way to render logic-free views License: MIT ++++++ mustache-1.0.5.gem -> mustache-1.1.0.gem ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Rakefile new/Rakefile --- old/Rakefile 2017-03-27 00:42:12.000000000 +0200 +++ new/Rakefile 2018-10-13 16:15:46.000000000 +0200 @@ -35,7 +35,7 @@ desc "Build the manual" task "man:build" do - sh "ronn -br5 --organization=DEFUNKT --manual='Mustache Manual' man/*.ron" + sh "ronn -br5 --organization=DEFUNKT --manual='Mustache Manual' man/*.ronn" end end Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/mustache/context.rb new/lib/mustache/context.rb --- old/lib/mustache/context.rb 2017-03-27 00:42:12.000000000 +0200 +++ new/lib/mustache/context.rb 2018-10-13 16:15:46.000000000 +0200 @@ -51,12 +51,12 @@ # Allows customization of how Mustache escapes things. # - # @param [String] str String to escape. + # @param [Object] value Value to escape. # - # @return [String] Escaped HTML string. + # @return [String] Escaped string. # - def escapeHTML(str) - mustache_in_stack.escapeHTML(str) + def escape(value) + mustache_in_stack.escape(value) end # Adds a new object to the context's internal stack. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/mustache/generator.rb new/lib/mustache/generator.rb --- old/lib/mustache/generator.rb 2017-03-27 00:42:12.000000000 +0200 +++ new/lib/mustache/generator.rb 2018-10-13 16:15:46.000000000 +0200 @@ -133,7 +133,7 @@ when Proc #{proc_handling} when Array, Enumerator, Mustache::Enumerable - v.map { |h| ctx.push(h); r = #{code}; ctx.pop; r }.join + v.map { |_| ctx.push(_); r = #{code}; ctx.pop; r }.join else ctx.push(v); r = #{code}; ctx.pop; r end @@ -182,7 +182,7 @@ if v.is_a?(Proc) v = #{@option_static_lambdas ? 'v.call' : 'Mustache::Template.new(v.call.to_s).render(ctx.dup)'} end - ctx.escapeHTML(v.to_s) + ctx.escape(v) compiled end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/mustache/parser.rb new/lib/mustache/parser.rb --- old/lib/mustache/parser.rb 2017-03-27 00:42:12.000000000 +0200 +++ new/lib/mustache/parser.rb 2018-10-13 16:15:46.000000000 +0200 @@ -323,12 +323,14 @@ def scan_tag_close content, fetch, padding, pre_match_position section, pos, result = @sections.pop + if section.nil? + error "Closing unopened #{content.inspect}" + end + raw = @scanner.pre_match[pos[3]...pre_match_position] + padding (@result = result).last << raw << [self.otag, self.ctag] - if section.nil? - error "Closing unopened #{content.inspect}" - elsif section != content + if section != content error "Unclosed section #{section.inspect}", pos end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/mustache/version.rb new/lib/mustache/version.rb --- old/lib/mustache/version.rb 2017-03-27 00:42:12.000000000 +0200 +++ new/lib/mustache/version.rb 2018-10-13 16:15:46.000000000 +0200 @@ -1,3 +1,3 @@ class Mustache - VERSION = '1.0.5' + VERSION = '1.1.0' end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/mustache.rb new/lib/mustache.rb --- old/lib/mustache.rb 2017-03-27 00:42:12.000000000 +0200 +++ new/lib/mustache.rb 2018-10-13 16:15:46.000000000 +0200 @@ -190,7 +190,22 @@ end # Override this to provide custom escaping. + # By default it uses `CGI.escapeHTML`. # + # @example Overriding #escape + # class PersonView < Mustache + # def escape(value) + # my_html_escape_method(value.to_s) + # end + # end + # + # @param [Object] value Value to escape. + # @return [String] Escaped content. + def escape(value) + self.escapeHTML(value.to_s) + end + + # Override this to provide custom escaping. # Example: # # class PersonView < Mustache @@ -199,6 +214,11 @@ # end # end # + # @deprecated Use {#escape} instead. + # + # Note that {#escape} can receive any kind of object. + # If your override logic is expecting a string, you will + # have to call to_s on it yourself. # @param [String] str String to escape. # # @return [String] Escaped HTML. @@ -244,7 +264,7 @@ file_name = underscore(name) file_path = "#{view_path}/#{file_name}.rb" - return Mustache unless File.exists?(file_path) + return Mustache unless File.exist?(file_path) require file_path.chomp('.rb') rescued_const_get(name) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/man/mustache.1.html new/man/mustache.1.html --- old/man/mustache.1.html 2017-03-27 00:42:12.000000000 +0200 +++ new/man/mustache.1.html 2018-10-13 16:15:46.000000000 +0200 @@ -102,7 +102,7 @@ should work fine.</p> <p>After the frontmatter should come any valid Mustache template. See -<a class="man-ref" href="mustache.5.ron.html">mustache<span class="s">(5)</span></a> for an overview of Mustache templates.</p> +<a class="man-ref" href="mustache.5.ronn.html">mustache<span class="s">(5)</span></a> for an overview of Mustache templates.</p> <p>For example:</p> @@ -198,7 +198,7 @@ <h2 id="SEE-ALSO">SEE ALSO</h2> -<p><a class="man-ref" href="mustache.5.ron.html">mustache<span class="s">(5)</span></a>, <span class="man-ref">gem<span class="s">(1)</span></span>, +<p><a class="man-ref" href="mustache.5.ronn.html">mustache<span class="s">(5)</span></a>, <span class="man-ref">gem<span class="s">(1)</span></span>, <a href="http://mustache.github.io/" data-bare-link="true">http://mustache.github.io/</a></p> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/man/mustache.5.html new/man/mustache.5.html --- old/man/mustache.5.html 2017-03-27 00:42:12.000000000 +0200 +++ new/man/mustache.5.html 2018-10-13 16:15:46.000000000 +0200 @@ -409,7 +409,7 @@ <h2 id="SEE-ALSO">SEE ALSO</h2> -<p><a class="man-ref" href="mustache.1.ron.html">mustache<span class="s">(1)</span></a>, +<p><a class="man-ref" href="mustache.1.ronn.html">mustache<span class="s">(1)</span></a>, <a href="http://mustache.github.io/" data-bare-link="true">http://mustache.github.io/</a></p> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/man/mustache.5.ron new/man/mustache.5.ron --- old/man/mustache.5.ron 2017-03-27 00:42:12.000000000 +0200 +++ new/man/mustache.5.ron 2018-10-13 16:15:46.000000000 +0200 @@ -310,7 +310,7 @@ Custom delimiters may not contain whitespace or the equals sign. -[ct]: http://google-ctemplate.googlecode.com/svn/trunk/doc/howto.html +[ct]: http://goog-ctemplate.sourceforge.net/doc/howto.html ## COPYRIGHT diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 2017-03-27 00:42:12.000000000 +0200 +++ new/metadata 2018-10-13 16:15:46.000000000 +0200 @@ -1,7 +1,7 @@ --- !ruby/object:Gem::Specification name: mustache version: !ruby/object:Gem::Version - version: 1.0.5 + version: 1.1.0 platform: ruby authors: - Chris Wanstrath @@ -11,7 +11,7 @@ autorequire: bindir: bin cert_chain: [] -date: 2017-03-26 00:00:00.000000000 Z +date: 2018-10-13 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: bundler @@ -220,7 +220,7 @@ version: '0' requirements: [] rubyforge_project: -rubygems_version: 2.6.8 +rubygems_version: 2.7.7 signing_key: specification_version: 4 summary: Mustache is a framework-agnostic way to render logic-free views. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/mustache_test.rb new/test/mustache_test.rb --- old/test/mustache_test.rb 2017-03-27 00:42:12.000000000 +0200 +++ new/test/mustache_test.rb 2018-10-13 16:15:46.000000000 +0200 @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- require_relative 'helper' +require 'json' class MustacheTest < Minitest::Test def test_instance_render @@ -659,7 +660,7 @@ assert_equal('[ 0 1 2 3 4 5 6 7 8 9 10 ]', MethodMissing.render) end - def test_custom_escaping + def test_custom_html_escaping view = Class.new(Mustache) do def escapeHTML(str) "pong" @@ -670,6 +671,17 @@ assert_equal 'nothing', Mustache.render("{{thing}}", :thing => "nothing") end + def test_custom_escaping + view = Class.new(Mustache) do + def escape(str) + JSON.dump(str) + end + end + + assert_equal '{ "key": "a\"b" }', view.render('{ "key": {{thing}} }', :thing => 'a"b') + assert_equal 'nothing', Mustache.render("{{thing}}", :thing => "nothing") + end + def test_implicit_iterator view = Mustache.new view.template = "{{#people}}* {{.}}\n{{/people}}" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/parser_test.rb new/test/parser_test.rb --- old/test/parser_test.rb 2017-03-27 00:42:12.000000000 +0200 +++ new/test/parser_test.rb 2018-10-13 16:15:46.000000000 +0200 @@ -94,4 +94,68 @@ assert_equal expected, tokens end + + def test_unclosed_section + lexer = Mustache::Parser.new + exception = assert_raises Mustache::Parser::SyntaxError do + lexer.compile("{{#list}}") + end + + expected = <<-EOF +Unclosed section "list" + Line 1 + {{#list}} + ^ +EOF + + assert_equal expected, exception.message + end + + def test_closing_unopened + lexer = Mustache::Parser.new + exception = assert_raises Mustache::Parser::SyntaxError do + lexer.compile("{{/list}}") + end + + expected = <<-EOF +Closing unopened "list" + Line 1 + {{/list}} + ^ +EOF + + assert_equal expected, exception.message + end + + def test_unclosed_tag + lexer = Mustache::Parser.new + exception = assert_raises Mustache::Parser::SyntaxError do + lexer.compile("{{list") + end + + expected = <<-EOF +Unclosed tag + Line 1 + {{list + ^ +EOF + + assert_equal expected, exception.message + end + + def test_illegal_content + lexer = Mustache::Parser.new + exception = assert_raises Mustache::Parser::SyntaxError do + lexer.compile("{{") + end + + expected = <<-EOF +Illegal content in tag + Line 1 + {{ + ^ +EOF + + assert_equal expected, exception.message + end end