Hello community, here is the log from the commit of package rubygem-jbuilder for openSUSE:Factory checked in at 2016-03-18 21:39:24 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 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-10-26 12:47:35.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.rubygem-jbuilder.new/rubygem-jbuilder.changes 2016-03-18 21:39:26.000000000 +0100 @@ -1,0 +2,22 @@ +Wed Feb 10 05:30:45 UTC 2016 - coolo@suse.com + +- updated to version 2.4.1 + see installed CHANGELOG.md + + 2.4.1 + ----- + + * [Fix controller generators to be Rails 5 compatible](https://github.com/rails/jbuilder/commit/2dc6203c5c4a98701d5b64c2a5200835a48...) + + 2.4.0 + ----- + + * [Rails 5 compatibility](https://github.com/rails/jbuilder/commit/4aa2cfcc19a4634d65a28ffc75f0ac0cb83...) + +------------------------------------------------------------------- +Thu Jan 21 05:37:48 UTC 2016 - coolo@suse.com + +- updated to version 2.4.0 + see installed CHANGELOG.md + +------------------------------------------------------------------- Old: ---- jbuilder-2.3.2.gem New: ---- jbuilder-2.4.1.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-jbuilder.spec ++++++ --- /var/tmp/diff_new_pack.YfI2t5/_old 2016-03-18 21:39:27.000000000 +0100 +++ /var/tmp/diff_new_pack.YfI2t5/_new 2016-03-18 21:39:27.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package rubygem-jbuilder # -# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2016 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 @@ -24,7 +24,7 @@ # Name: rubygem-jbuilder -Version: 2.3.2 +Version: 2.4.1 Release: 0 %define mod_name jbuilder %define mod_full_name %{mod_name}-%{version} ++++++ jbuilder-2.3.2.gem -> jbuilder-2.4.1.gem ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/.travis.yml new/.travis.yml --- old/.travis.yml 2015-09-30 20:31:43.000000000 +0200 +++ new/.travis.yml 2016-02-09 07:33:18.000000000 +0100 @@ -7,7 +7,8 @@ - 1.9 - 2.0 - 2.1 - - 2.2 + - 2.2.4 + - 2.3.0 - ruby-head - jruby-19mode - rbx @@ -19,7 +20,7 @@ - gemfiles/rails_4_0.gemfile - gemfiles/rails_4_1.gemfile - gemfiles/rails_4_2.gemfile - - gemfiles/rails_edge.gemfile + - gemfiles/rails_5_0.gemfile matrix: allow_failures: @@ -29,15 +30,15 @@ fast_finish: true exclude: - rvm: 1.9 - gemfile: gemfiles/rails_edge.gemfile + gemfile: gemfiles/rails_5_0.gemfile - rvm: 2.0 - gemfile: gemfiles/rails_edge.gemfile + gemfile: gemfiles/rails_5_0.gemfile - rvm: 2.1 - gemfile: gemfiles/rails_edge.gemfile + gemfile: gemfiles/rails_5_0.gemfile - rvm: jruby-19mode - gemfile: gemfiles/rails_edge.gemfile + gemfile: gemfiles/rails_5_0.gemfile - rvm: rbx - gemfile: gemfiles/rails_edge.gemfile + gemfile: gemfiles/rails_5_0.gemfile notifications: email: false diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Appraisals new/Appraisals --- old/Appraisals 2015-09-30 20:31:43.000000000 +0200 +++ new/Appraisals 2016-02-09 07:33:18.000000000 +0100 @@ -37,8 +37,8 @@ gem "activemodel", "~> 4.2.0" end -appraise "rails-edge" do - gem "rails", ">= 5.0.0.alpha", github: "rails/rails" - gem "arel", ">= 7.0.0.alpha", github: "rails/arel" - gem "rack", ">= 2.0.0.alpha", github: "rack/rack" +appraise "rails-5-0" do + gem "railties", ">= 5.0.0.beta2", "< 5.1" + gem "actionpack", ">= 5.0.0.beta2", "< 5.1" + gem "activemodel", ">= 5.0.0.beta2", "< 5.1" end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CHANGELOG.md new/CHANGELOG.md --- old/CHANGELOG.md 2015-09-30 20:31:43.000000000 +0200 +++ new/CHANGELOG.md 2016-02-09 07:33:18.000000000 +0100 @@ -1,5 +1,15 @@ # Changelog +2.4.1 +----- + +* [Fix controller generators to be Rails 5 compatible](https://github.com/rails/jbuilder/commit/2dc6203c5c4a98701d5b64c2a5200835a48...) + +2.4.0 +----- + +* [Rails 5 compatibility](https://github.com/rails/jbuilder/commit/4aa2cfcc19a4634d65a28ffc75f0ac0cb83...) + 2.3.2 ----- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CONTRIBUTING.md new/CONTRIBUTING.md --- old/CONTRIBUTING.md 2015-09-30 20:31:43.000000000 +0200 +++ new/CONTRIBUTING.md 2016-02-09 07:33:18.000000000 +0100 @@ -1,10 +1,15 @@ Contributing to Jbuilder ===================== -[![Build Status](https://travis-ci.org/rails/jbuilder.svg?branch=master)]() -[![Gem Version](http://img.shields.io/gem/v/jbuilder.svg)]() -[![Code Climate](http://img.shields.io/codeclimate/github/rails/jbuilder.svg)]() -[![Dependencies Status](http://img.shields.io/gemnasium/rails/jbuilder.svg)]() +[![Build Status](https://api.travis-ci.org/rails/jbuilder.svg?branch=master)][travis] +[![Gem Version](http://img.shields.io/gem/v/jbuilder.svg)][gem] +[![Code Climate](http://img.shields.io/codeclimate/github/rails/jbuilder.svg)][codeclimate] +[![Dependencies Status](http://img.shields.io/gemnasium/rails/jbuilder.svg)][gemnasium] + +[travis]: https://travis-ci.org/rails/jbuilder +[gem]: https://rubygems.org/gems/jbuilder +[codeclimate]: https://codeclimate.com/github/rails/jbuilder +[gemnasium]: https://gemnasium.com/rails/jbuilder Jbuilder is work of [many contributors](https://github.com/rails/jbuilder/graphs/contributors). You're encouraged to submit [pull requests](https://github.com/rails/jbuilder/pulls), [propose features and discuss issues](https://github.com/rails/jbuilder/issues). diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MIT-LICENSE new/MIT-LICENSE --- old/MIT-LICENSE 2015-09-30 20:31:43.000000000 +0200 +++ new/MIT-LICENSE 2016-02-09 07:33:18.000000000 +0100 @@ -1,4 +1,4 @@ -Copyright (c) 2011-2015 David Heinemeier Hansson, 37signals +Copyright (c) 2011-2016 David Heinemeier Hansson, 37signals Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/README.md new/README.md --- old/README.md 2015-09-30 20:31:43.000000000 +0200 +++ new/README.md 2016-02-09 07:33:18.000000000 +0100 @@ -196,6 +196,15 @@ end ``` +To prevent Jbuilder from including null values in the output, you can use the `ignore_nil!` method: + +```ruby +json.ignore_nil! +json.foo nil +json.bar "bar" +# => { "bar": "bar" } +``` + Fragment caching is supported, it uses `Rails.cache` and works like caching in HTML templates: @@ -251,7 +260,7 @@ ## Contributing to Jbuilder -Jbuilder is work of many contributors. You're encouraged to submit pull requests, propose +Jbuilder is the work of many contributors. You're encouraged to submit pull requests, propose features and discuss issues. See [CONTRIBUTING](CONTRIBUTING.md). Files old/checksums.yaml.gz and new/checksums.yaml.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gemfiles/rails_5_0.gemfile new/gemfiles/rails_5_0.gemfile --- old/gemfiles/rails_5_0.gemfile 1970-01-01 01:00:00.000000000 +0100 +++ new/gemfiles/rails_5_0.gemfile 2016-02-09 07:33:18.000000000 +0100 @@ -0,0 +1,13 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "rake" +gem "mocha", :require => false +gem "appraisal" +gem "pry" +gem "railties", ">= 5.0.0.beta2", "< 5.1" +gem "actionpack", ">= 5.0.0.beta2", "< 5.1" +gem "activemodel", ">= 5.0.0.beta2", "< 5.1" + +gemspec :path => "../" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gemfiles/rails_edge.gemfile new/gemfiles/rails_edge.gemfile --- old/gemfiles/rails_edge.gemfile 2015-09-30 20:31:43.000000000 +0200 +++ new/gemfiles/rails_edge.gemfile 1970-01-01 01:00:00.000000000 +0100 @@ -1,13 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "rake" -gem "mocha", :require => false -gem "appraisal" -gem "pry" -gem "rails", ">= 5.0.0.alpha", :github => "rails/rails" -gem "arel", ">= 7.0.0.alpha", :github => "rails/arel" -gem "rack", ">= 2.0.0.alpha", :github => "rack/rack" - -gemspec :path => "../" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jbuilder.gemspec new/jbuilder.gemspec --- old/jbuilder.gemspec 2015-09-30 20:31:43.000000000 +0200 +++ new/jbuilder.gemspec 2016-02-09 07:33:18.000000000 +0100 @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = 'jbuilder' - s.version = '2.3.2' + s.version = '2.4.1' 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' @@ -9,7 +9,7 @@ s.required_ruby_version = '>= 1.9.3' - s.add_dependency 'activesupport', '>= 3.0.0', '< 5' + s.add_dependency 'activesupport', '>= 3.0.0', '< 5.1' s.add_dependency 'multi_json', '~> 1.2' s.files = `git ls-files`.split("\n") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/generators/rails/templates/api_controller.rb new/lib/generators/rails/templates/api_controller.rb --- old/lib/generators/rails/templates/api_controller.rb 2015-09-30 20:31:43.000000000 +0200 +++ new/lib/generators/rails/templates/api_controller.rb 2016-02-09 07:33:18.000000000 +0100 @@ -54,7 +54,7 @@ # Never trust parameters from the scary internet, only allow the white list through. def <%= "#{singular_table_name}_params" %> <%- if attributes_names.empty? -%> - params[<%= ":#{singular_table_name}" %>] + params.fetch(<%= ":#{singular_table_name}" %>, {}) <%- else -%> params.require(<%= ":#{singular_table_name}" %>).permit(<%= attributes_names.map { |name| ":#{name}" }.join(', ') %>) <%- end -%> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/generators/rails/templates/controller.rb new/lib/generators/rails/templates/controller.rb --- old/lib/generators/rails/templates/controller.rb 2015-09-30 20:31:43.000000000 +0200 +++ new/lib/generators/rails/templates/controller.rb 2016-02-09 07:33:18.000000000 +0100 @@ -75,7 +75,7 @@ # Never trust parameters from the scary internet, only allow the white list through. def <%= "#{singular_table_name}_params" %> <%- if attributes_names.empty? -%> - params[<%= ":#{singular_table_name}" %>] + params.fetch(<%= ":#{singular_table_name}" %>, {}) <%- else -%> params.require(<%= ":#{singular_table_name}" %>).permit(<%= attributes_names.map { |name| ":#{name}" }.join(', ') %>) <%- end -%> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 2015-09-30 20:31:43.000000000 +0200 +++ new/metadata 2016-02-09 07:33:18.000000000 +0100 @@ -1,7 +1,7 @@ --- !ruby/object:Gem::Specification name: jbuilder version: !ruby/object:Gem::Version - version: 2.3.2 + version: 2.4.1 platform: ruby authors: - David Heinemeier Hansson @@ -9,7 +9,7 @@ autorequire: bindir: bin cert_chain: [] -date: 2015-09-30 00:00:00.000000000 Z +date: 2016-02-09 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: activesupport @@ -20,7 +20,7 @@ version: 3.0.0 - - "<" - !ruby/object:Gem::Version - version: '5' + version: '5.1' type: :runtime prerelease: false version_requirements: !ruby/object:Gem::Requirement @@ -30,7 +30,7 @@ version: 3.0.0 - - "<" - !ruby/object:Gem::Version - version: '5' + version: '5.1' - !ruby/object:Gem::Dependency name: multi_json requirement: !ruby/object:Gem::Requirement @@ -68,7 +68,7 @@ - gemfiles/rails_4_0.gemfile - gemfiles/rails_4_1.gemfile - gemfiles/rails_4_2.gemfile -- gemfiles/rails_edge.gemfile +- gemfiles/rails_5_0.gemfile - jbuilder.gemspec - lib/generators/rails/jbuilder_generator.rb - lib/generators/rails/scaffold_controller_generator.rb @@ -111,7 +111,7 @@ version: '0' requirements: [] rubyforge_project: -rubygems_version: 2.4.8 +rubygems_version: 2.5.1 signing_key: specification_version: 4 summary: Create JSON structures via a Builder-style DSL diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/scaffold_api_controller_generator_test.rb new/test/scaffold_api_controller_generator_test.rb --- old/test/scaffold_api_controller_generator_test.rb 2015-09-30 20:31:43.000000000 +0200 +++ new/test/scaffold_api_controller_generator_test.rb 2016-02-09 07:33:18.000000000 +0100 @@ -42,5 +42,14 @@ assert_match(/params\.require\(:post\)\.permit\(:title, :body\)/, content) end end + + test 'dont use require and permit if there are no attributes' do + run_generator %w(Post --api) + + assert_file 'app/controllers/posts_controller.rb' do |content| + assert_match(/def post_params/, content) + assert_match(/params\.fetch\(:post, {}\)/, content) + end + end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/scaffold_controller_generator_test.rb new/test/scaffold_controller_generator_test.rb --- old/test/scaffold_controller_generator_test.rb 2015-09-30 20:31:43.000000000 +0200 +++ new/test/scaffold_controller_generator_test.rb 2016-02-09 07:33:18.000000000 +0100 @@ -54,4 +54,13 @@ assert_match(/params\.require\(:post\)\.permit\(:title, :body\)/, content) end end + + test 'dont use require and permit if there are no attributes' do + run_generator %w(Post) + + assert_file 'app/controllers/posts_controller.rb' do |content| + assert_match(/def post_params/, content) + assert_match(/params\.fetch\(:post, {}\)/, content) + end + end end