commit rubygem-jbuilder for openSUSE:Factory
Hello community, here is the log from the commit of package rubygem-jbuilder for openSUSE:Factory checked in at 2015-02-23 13:19:32 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-jbuilder (Old) and /work/SRC/openSUSE:Factory/.rubygem-jbuilder.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "rubygem-jbuilder" Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-jbuilder/rubygem-jbuilder.changes 2015-02-20 12:01:27.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.rubygem-jbuilder.new/rubygem-jbuilder.changes 2015-02-23 13:19:34.000000000 +0100 @@ -1,0 +2,5 @@ +Mon Feb 23 05:29:24 UTC 2015 - coolo@suse.com + +- updated to version 2.2.8 + +------------------------------------------------------------------- Old: ---- jbuilder-2.2.7.gem New: ---- jbuilder-2.2.8.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-jbuilder.spec ++++++ --- /var/tmp/diff_new_pack.2PE5FU/_old 2015-02-23 13:19:35.000000000 +0100 +++ /var/tmp/diff_new_pack.2PE5FU/_new 2015-02-23 13:19:35.000000000 +0100 @@ -24,7 +24,7 @@ # Name: rubygem-jbuilder -Version: 2.2.7 +Version: 2.2.8 Release: 0 %define mod_name jbuilder %define mod_full_name %{mod_name}-%{version} ++++++ jbuilder-2.2.7.gem -> jbuilder-2.2.8.gem ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CHANGELOG.md new/CHANGELOG.md --- old/CHANGELOG.md 2015-02-15 05:10:00.000000000 +0100 +++ new/CHANGELOG.md 2015-02-22 06:54:27.000000000 +0100 @@ -1,5 +1,9 @@ # Changelog +2.2.8 +----- +* [Raise ArrayError when trying to add key to an array](https://github.com/rails/jbuilder/commit/869e4be1ad165ce986d8fca78311bdd3ed1...) + 2.2.7 ----- * [Make Blank object serializable with Marshal](https://github.com/rails/jbuilder/commit/7083f28d8b665aa60d0d1b1927ae88bb5c6...) Files old/checksums.yaml.gz and new/checksums.yaml.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jbuilder.gemspec new/jbuilder.gemspec --- old/jbuilder.gemspec 2015-02-15 05:10:00.000000000 +0100 +++ new/jbuilder.gemspec 2015-02-22 06:54:27.000000000 +0100 @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = 'jbuilder' - s.version = '2.2.7' + s.version = '2.2.8' s.authors = ['David Heinemeier Hansson', 'Pavel Pravosud'] s.email = ['david@37signals.com', 'pavel@pravosud.com'] s.summary = 'Create JSON structures via a Builder-style DSL' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/jbuilder/errors.rb new/lib/jbuilder/errors.rb --- old/lib/jbuilder/errors.rb 2015-02-15 05:10:00.000000000 +0100 +++ new/lib/jbuilder/errors.rb 2015-02-22 06:54:27.000000000 +0100 @@ -7,4 +7,11 @@ new(message) end end + + class ArrayError < ::StandardError + def self.build(key) + message = "Failed to add #{key.to_s.inspect} property to an array" + new(message) + end + end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/jbuilder.rb new/lib/jbuilder.rb --- old/lib/jbuilder.rb 2015-02-15 05:10:00.000000000 +0100 +++ new/lib/jbuilder.rb 2015-02-22 06:54:27.000000000 +0100 @@ -274,20 +274,16 @@ end end - def _write(key, value) - @attributes = {} if _blank? - @attributes[_key(key)] = value - end - def _key(key) @key_formatter.format(key) end def _set_value(key, value) raise NullError.build(key) if @attributes.nil? - return if @ignore_nil && value.nil? - return if _blank?(value) - _write key, value + raise ArrayError.build(key) if ::Array === @attributes + return if @ignore_nil && value.nil? or _blank?(value) + @attributes = {} if _blank? + @attributes[_key(key)] = value end def _map_collection(collection) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 2015-02-15 05:10:00.000000000 +0100 +++ new/metadata 2015-02-22 06:54:27.000000000 +0100 @@ -1,7 +1,7 @@ --- !ruby/object:Gem::Specification name: jbuilder version: !ruby/object:Gem::Version - version: 2.2.7 + version: 2.2.8 platform: ruby authors: - David Heinemeier Hansson @@ -9,7 +9,7 @@ autorequire: bindir: bin cert_chain: [] -date: 2015-02-15 00:00:00.000000000 Z +date: 2015-02-22 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: activesupport diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/jbuilder_test.rb new/test/jbuilder_test.rb --- old/test/jbuilder_test.rb 2015-02-15 05:10:00.000000000 +0100 +++ new/test/jbuilder_test.rb 2015-02-22 06:54:27.000000000 +0100 @@ -645,11 +645,21 @@ assert_nil result['author'] end + test 'throws ArrayError when trying to add a key to an array' do + assert_raise Jbuilder::ArrayError do + jbuild do |json| + json.array! %w[foo bar] + json.fizz "buzz" + end + end + end + test 'throws NullError when trying to add properties to null' do - json = Jbuilder.new - json.null! assert_raise Jbuilder::NullError do - json.foo 'bar' + jbuild do |json| + json.null! + json.foo 'bar' + end end end -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@hilbert.suse.de