New Upstream Snapshot - ruby-activemodel-serializers-xml
Ready changes
Summary
Merged new upstream version: 1.0.2+git20211216.1.32841fd (was: 1.0.2).
Resulting package
Built on 2023-01-19T21:47 (took 2m33s)
The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:
apt install -t fresh-snapshots ruby-activemodel-serializers-xml
Lintian Result
- ruby-activemodel-serializers-xml_1.0.2+git20211216.1.32841fd-1~jan+nus2.dsc
- ruby-activemodel-serializers-xml_1.0.2+git20211216.1.32841fd-1~jan+nus2_all.deb
- ruby-activemodel-serializers-xml_1.0.2+git20211216.1.32841fd-1~jan+nus2_amd64.buildinfo
- ruby-activemodel-serializers-xml_1.0.2+git20211216.1.32841fd-1~jan+nus2_amd64.changes
Diff
diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index 0cb6eeb..0000000
--- a/.gitignore
+++ /dev/null
@@ -1,9 +0,0 @@
-/.bundle/
-/.yardoc
-/Gemfile.lock
-/_yardoc/
-/coverage/
-/doc/
-/pkg/
-/spec/reports/
-/tmp/
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index d777c6c..9cb774b 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -7,7 +7,7 @@ ActiveModel::Serializers::Xml is work of [many contributors](https://github.com/
#### Fork the Project
-Fork the [project on Github](https://github.com/rails/activemodel-serializers-xml) and check out your copy.
+Fork the [project on GitHub](https://github.com/rails/activemodel-serializers-xml) and check out your copy.
```
git clone https://github.com/contributor/activemodel-serializers-xml.git
diff --git a/README.md b/README.md
index dd67567..21f6eec 100644
--- a/README.md
+++ b/README.md
@@ -12,11 +12,15 @@ gem 'activemodel-serializers-xml'
And then execute:
- $ bundle
+```
+$ bundle
+```
Or install it yourself as:
- $ gem install activemodel-serializers-xml
+```
+$ gem install activemodel-serializers-xml
+```
## Usage
diff --git a/activemodel-serializers-xml.gemspec b/activemodel-serializers-xml.gemspec
index 65cf51f..744607f 100644
--- a/activemodel-serializers-xml.gemspec
+++ b/activemodel-serializers-xml.gemspec
@@ -15,11 +15,12 @@ Gem::Specification.new do |spec|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
spec.require_paths = ["lib"]
- spec.add_dependency "activesupport", "> 5.x"
- spec.add_dependency "activemodel", "> 5.x"
+ spec.add_dependency "activesupport", ">= 5.0.0.a"
+ spec.add_dependency "activemodel", ">= 5.0.0.a"
spec.add_dependency "builder", "~> 3.1"
spec.add_development_dependency "rake", "~> 10.0"
- spec.add_development_dependency "activerecord", "> 5.x"
- spec.add_development_dependency "sqlite3"
+ spec.add_development_dependency "activerecord", ">= 5.0.0.a"
+ spec.add_development_dependency "sqlite3", "~> 1.3.6"
+ spec.add_development_dependency "rexml"
end
diff --git a/debian/changelog b/debian/changelog
index e65a51d..d751bb5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+ruby-activemodel-serializers-xml (1.0.2+git20211216.1.32841fd-1) UNRELEASED; urgency=low
+
+ * New upstream snapshot.
+ * Drop patch timestamps_create_at_field.patch, present upstream.
+
+ -- Debian Janitor <janitor@jelmer.uk> Thu, 19 Jan 2023 21:45:53 -0000
+
ruby-activemodel-serializers-xml (1.0.2-3) unstable; urgency=medium
* Team upload
diff --git a/debian/patches/drop-git-in-gemspec.patch b/debian/patches/drop-git-in-gemspec.patch
index 1fbaa97..1484976 100644
--- a/debian/patches/drop-git-in-gemspec.patch
+++ b/debian/patches/drop-git-in-gemspec.patch
@@ -6,8 +6,10 @@ Forwarded: not-needed
Reviewed-By: Andrew Lee (李健秋) <ajqlee@debian.org>
Last-Update: 2018-11-20
---- ruby-activemodel-serializers-xml-1.0.2.orig/activemodel-serializers-xml.gemspec
-+++ ruby-activemodel-serializers-xml-1.0.2/activemodel-serializers-xml.gemspec
+Index: ruby-activemodel-serializers-xml.git/activemodel-serializers-xml.gemspec
+===================================================================
+--- ruby-activemodel-serializers-xml.git.orig/activemodel-serializers-xml.gemspec
++++ ruby-activemodel-serializers-xml.git/activemodel-serializers-xml.gemspec
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
spec.homepage = "http://github.com/rails/activemodel-serializers-xml"
spec.license = "MIT"
@@ -15,5 +17,5 @@ Last-Update: 2018-11-20
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
+ spec.files = Dir.glob('**/*').reject { |f| f.match(%r{^(debian|test|spec|features)/}) }
spec.require_paths = ["lib"]
- spec.add_dependency "activesupport", "> 5.x"
- spec.add_dependency "activemodel", "> 5.x"
+ spec.add_dependency "activesupport", ">= 5.0.0.a"
+ spec.add_dependency "activemodel", ">= 5.0.0.a"
diff --git a/debian/patches/series b/debian/patches/series
index 280f6f0..917a4f1 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1 @@
drop-git-in-gemspec.patch
-timestamps_create_at_field.patch
diff --git a/debian/patches/timestamps_create_at_field.patch b/debian/patches/timestamps_create_at_field.patch
deleted file mode 100644
index 0969325..0000000
--- a/debian/patches/timestamps_create_at_field.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From 5196792dfc74eb2d6d7f951225a4a1de6db2fc72 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
-Date: Fri, 11 Sep 2020 18:45:00 +0200
-Origin: https://github.com/rails/activemodel-serializers-xml/commit/5196792dfc74eb2d6d7f951225a4a1de6db2fc72
-Bug: https://github.com/rails/activemodel-serializers-xml/pull/18/
-Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=964952
-Description: `timestamps` creates `created_at` field.
-
-The `t.timestamps`, available since Rails 2.3, already creates the
-`created_at` column. Therefore, since Rails 6.0+ the test suite fails
-with the following error:
-
-~~~
-/usr/share/gems/gems/activerecord-6.0.3.2/lib/active_record/connection_adapters/abstract/schema_definitions.rb:372:in `column': you can't define an already defined column 'created_at'. (ArgumentError)
- from /usr/share/gems/gems/activerecord-6.0.3.2/lib/active_record/connection_adapters/abstract/schema_definitions.rb:411:in `timestamps'
- from /builddir/build/BUILD/test/helper.rb:114:in `block (2 levels) in <top (required)>'
-~~~
----
- test/helper.rb | 2 --
- 1 file changed, 2 deletions(-)
-
-diff --git a/test/helper.rb b/test/helper.rb
-index cbe4374..fe1ef5a 100644
---- a/test/helper.rb
-+++ b/test/helper.rb
-@@ -106,7 +106,6 @@ def verify_default_timezone_config
- t.string :name
- t.integer :age
- t.binary :avatar
-- t.datetime :created_at
- t.boolean :awesome
- t.string :preferences
- t.integer :alternative_id
-@@ -119,7 +118,6 @@ def verify_default_timezone_config
- t.string :name
- t.integer :age
- t.binary :avatar
-- t.datetime :created_at
- t.boolean :awesome
- t.string :preferences
- t.integer :alternative_id
diff --git a/lib/active_model/serializers/xml.rb b/lib/active_model/serializers/xml.rb
index 9203a09..ed7781b 100644
--- a/lib/active_model/serializers/xml.rb
+++ b/lib/active_model/serializers/xml.rb
@@ -107,9 +107,10 @@ module ActiveModel
def add_attributes_and_methods
serializable_collection.each do |attribute|
- key = ActiveSupport::XmlMini.rename_key(attribute.name, options)
+ _options = options.except(:methods)
+ key = ActiveSupport::XmlMini.rename_key(attribute.name, _options)
ActiveSupport::XmlMini.to_tag(key, attribute.value,
- options.merge(attribute.decorations))
+ _options.merge(attribute.decorations))
end
end
diff --git a/test/active_model/xml_serialization_test.rb b/test/active_model/xml_serialization_test.rb
index df4580e..e15319f 100644
--- a/test/active_model/xml_serialization_test.rb
+++ b/test/active_model/xml_serialization_test.rb
@@ -28,6 +28,39 @@ class SerializableContact < Contact
end
end
+class Role
+ include ActiveModel::Serializers::Xml
+ attr_accessor :title
+
+ def initialize(title)
+ @title = title
+ end
+
+ def attributes
+ instance_values
+ end
+end
+
+class Human
+ include ActiveModel::Serializers::Xml
+
+ attr_accessor :first_name, :last_name, :role
+
+ def initialize(first_name, last_name, role)
+ @first_name = first_name
+ @last_name = last_name
+ @role = role
+ end
+
+ def full_name
+ first_name + ' ' + last_name
+ end
+
+ def attributes
+ instance_values
+ end
+end
+
class AMXmlSerializationTest < ActiveSupport::TestCase
def setup
@contact = Contact.new
@@ -248,4 +281,11 @@ class AMXmlSerializationTest < ActiveSupport::TestCase
xml = @contact.to_xml(include: :contact)
assert xml.include?(%(<contact type="SerializableContact">))
end
+
+ test "computed property applies only to root" do
+ role = Role.new("manager")
+ human = Human.new("Jane", "Air", role)
+ xml = human.to_xml(methods: :full_name)
+ assert_match %r{<full-name>}, xml
+ end
end
diff --git a/test/helper.rb b/test/helper.rb
index cbe4374..fe1ef5a 100644
--- a/test/helper.rb
+++ b/test/helper.rb
@@ -106,7 +106,6 @@ ActiveRecord::Schema.define do
t.string :name
t.integer :age
t.binary :avatar
- t.datetime :created_at
t.boolean :awesome
t.string :preferences
t.integer :alternative_id
@@ -119,7 +118,6 @@ ActiveRecord::Schema.define do
t.string :name
t.integer :age
t.binary :avatar
- t.datetime :created_at
t.boolean :awesome
t.string :preferences
t.integer :alternative_id
Debdiff
File lists identical (after any substitutions)
No differences were encountered in the control files