Compare commits

..

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
252b386ecd
!9 Upgrade version to 1.15.0
From: @cherry530 
Reviewed-by: @lyn1001 
Signed-off-by: @lyn1001
2023-11-16 08:16:36 +00:00
cherry530
1ebf19a7a4 Upgrade version to 1.15.0
Signed-off-by: cherry530 <707078654@qq.com>
2023-11-16 16:08:01 +08:00
openeuler-ci-bot
48d92dbdaa
!8 fix build failure due to rubygem-rspec updated
From: @wang--ge 
Reviewed-by: @small_leek 
Signed-off-by: @small_leek
2023-01-18 03:01:52 +00:00
wang--ge
620070c951 fix build failure due to rubygem-rspec updated 2023-01-17 16:41:56 +08:00
openeuler-ci-bot
cd62f4ec28
!7 [sync] PR-4: Fix jr_jackson removed due to tests error and Modify the test file to correct version 1.14.1
From: @openeuler-sync-bot 
Reviewed-by: @shinwell_hu 
Signed-off-by: @shinwell_hu
2022-03-24 12:29:20 +00:00
cherry530
c739d351c3 Fix jr_jackson remove due to tests failed
Signed-off-by: cherry530 <xuping33@huawei.com>
(cherry picked from commit 6d9aaa2f85914741eea794389273c214fb946dbc)
2022-03-23 09:16:09 +08:00
openeuler-ci-bot
4786a6a833 !3 Update to 1.14.1
From: @jxy_git
Reviewed-by: 
Signed-off-by:
2021-06-21 11:53:49 +00:00
jiangxinyu
c524f6a1fe Update project 2021-06-18 15:38:13 +08:00
openeuler-ci-bot
9edd2daf41 !1 Package init
Merge pull request !1 from jeff200902/master
2020-08-31 16:20:53 +08:00
jeff200902
db10c7b626 Package init 2020-08-28 14:18:44 +08:00
5 changed files with 193 additions and 0 deletions

View File

@ -0,0 +1,85 @@
From 00bdf8d9468f88356307f0fa7bdc6c0d05925aaf Mon Sep 17 00:00:00 2001
From: wang--ge <wang__ge@126.com>
Date: Thu, 12 Jan 2023 15:08:14 +0800
Subject: [PATCH] RSpec 3.11.0+ distinguish between hashes and Ruby 3 keywords
---
spec/multi_json_spec.rb | 4 ++--
spec/shared/adapter.rb | 8 ++++----
spec/shared/json_common_adapter.rb | 4 ++--
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/spec/multi_json_spec.rb b/spec/multi_json_spec.rb
index 323bff9..b3ffb4f 100644
--- a/spec/multi_json_spec.rb
+++ b/spec/multi_json_spec.rb
@@ -166,8 +166,8 @@
end
it 'sets both load and dump options' do
- expect(MultiJson).to receive(:dump_options=).with(:foo => 'bar')
- expect(MultiJson).to receive(:load_options=).with(:foo => 'bar')
+ expect(MultiJson).to receive(:dump_options=).with({:foo => 'bar'})
+ expect(MultiJson).to receive(:load_options=).with({:foo => 'bar'})
silence_warnings { MultiJson.default_options = {:foo => 'bar'} }
end
end
diff --git a/spec/shared/adapter.rb b/spec/shared/adapter.rb
index e850b99..52a6bc9 100644
--- a/spec/shared/adapter.rb
+++ b/spec/shared/adapter.rb
@@ -19,7 +19,7 @@
before { MultiJson.dump_options = MultiJson.adapter.dump_options = {} }
after do
- expect(MultiJson.adapter.instance).to receive(:dump).with(1, :foo => 'bar', :fizz => 'buzz')
+ expect(MultiJson.adapter.instance).to receive(:dump).with(1, {:foo => 'bar', :fizz => 'buzz'})
MultiJson.dump(1, :fizz => 'buzz')
MultiJson.dump_options = MultiJson.adapter.dump_options = nil
end
@@ -100,8 +100,8 @@
end
it 'passes options to the adapter' do
- expect(MultiJson.adapter).to receive(:dump).with('foo', :bar => :baz)
- MultiJson.dump('foo', :bar => :baz)
+ expect(MultiJson.adapter).to receive(:dump).with('foo', {:bar => :baz})
+ MultiJson.dump('foo', {:bar => :baz})
end
it 'dumps custom objects that implement to_json' do
@@ -128,7 +128,7 @@ def to_json(*)
before { MultiJson.load_options = MultiJson.adapter.load_options = {} }
after do
- expect(MultiJson.adapter.instance).to receive(:load).with('1', :foo => 'bar', :fizz => 'buzz')
+ expect(MultiJson.adapter.instance).to receive(:load).with('1', {:foo => 'bar', :fizz => 'buzz'})
MultiJson.load('1', :fizz => 'buzz')
MultiJson.load_options = MultiJson.adapter.load_options = nil
end
diff --git a/spec/shared/json_common_adapter.rb b/spec/shared/json_common_adapter.rb
index 9597d90..5a23c38 100644
--- a/spec/shared/json_common_adapter.rb
+++ b/spec/shared/json_common_adapter.rb
@@ -15,7 +15,7 @@
describe 'with :indent option' do
it 'passes it on dump' do
object = 'foo'
- expect(object).to receive(:to_json).with(:indent => "\t")
+ expect(object).to receive(:to_json).with({:indent => "\t"})
MultiJson.dump(object, :indent => "\t")
end
end
@@ -23,7 +23,7 @@
describe '.load' do
it 'passes :quirks_mode option' do
- expect(::JSON).to receive(:parse).with('[123]', :quirks_mode => false, :create_additions => false)
+ expect(::JSON).to receive(:parse).with('[123]', {:quirks_mode => false, :create_additions => false})
MultiJson.load('[123]', :quirks_mode => false)
end
end
--
2.27.0

BIN
multi_json-1.15.0-tests.tgz Normal file

Binary file not shown.

BIN
multi_json-1.15.0.gem Normal file

Binary file not shown.

104
rubygem-multi_json.spec Normal file
View File

@ -0,0 +1,104 @@
%global pkg_name %{name}
%global gem_name multi_json
Summary: A gem to provide swappable JSON backends
Name: rubygem-%{gem_name}
Version: 1.15.0
Release: 1
Group: Development/Languages
License: MIT
URL: https://github.com/intridea/multi_json
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
#git clone https://github.com/intridea/multi_json.git && cd multi_json
#git archive -v -o multi_json-1.15.0-tests.tgz v1.15.0 spec/
Source1: %{gem_name}-%{version}-tests.tgz
Source2: 0001-RSpec-3.11.0-distinguish-between-hashes-and-Ruby-3-keywords.patch
Requires: ruby(release)
BuildRequires: ruby(release)
Requires: ruby(rubygems)
Requires: ruby
BuildRequires: rubygems-devel
BuildRequires: ruby
BuildRequires: rubygem(rspec)
BuildRequires: rubygem(json_pure)
BuildRequires: ruby(rubygems)
BuildArch: noarch
Provides: rubygem(%{gem_name}) = %{version}
# OkJson is allowed to be bundled:
Provides: bundled(okjson) = 20110719
%description
A gem to provide swappable JSON backends utilizing Yajl::Ruby, the JSON gem,
JSON pure, or a vendored version of okjson.
%package doc
Summary: Documentation for %{pkg_name}
Group: Documentation
Requires: %{pkg_name} = %{version}-%{release}
BuildArch: noarch
%description doc
Documentation for %{pkg_name}
%prep
%setup -q -c -T
%gem_install -n %{SOURCE0}
%build
%install
mkdir -p %{buildroot}%{gem_dir}
cp -a .%{gem_dir}/* \
%{buildroot}%{gem_dir}/
%check
pushd .%{gem_instdir}
tar xf %{SOURCE1}
cp %{SOURCE2} .
patch -p1 < 0001-RSpec-3.11.0-distinguish-between-hashes-and-Ruby-3-keywords.patch
sed -i "/expect(MultiJson.adapter.to_s).to eq('MultiJson::Adapters::Oj')/ s/Oj/JsonGem/" spec/multi_json_spec.rb
SKIP_ADAPTERS=jr_jackson rspec spec/{multi_json,options_cache}_spec.rb
for adapter in spec/*_adapter_spec.rb; do
SKIP_ADAPTERS=gson,jr_jackson,nsjsonserialization,oj,yajl rspec $adapter
done
popd
%files
%dir %{gem_instdir}
%exclude %{gem_instdir}/.*
%doc %{gem_instdir}/LICENSE.md
%{gem_libdir}
%exclude %{gem_cache}
%{gem_spec}
%files doc
%doc %{gem_docdir}
%doc %{gem_instdir}/CHANGELOG.md
%doc %{gem_instdir}/CONTRIBUTING.md
%doc %{gem_instdir}/LICENSE.md
%doc %{gem_instdir}/README.md
%changelog
* Thu Nov 16 2023 xu_ping <707078654@qq.com> - 1.15.0-1
- Upgrade version to 1.15.0
* Thu Jan 12 2023 Ge Wang <wangge20@h-partners.com> - 1.14.1-3
- Distinguish between hashes and Ruby 3 keywords
* Mon Feb 14 2022 xu_ping <xuping33@huawei.com> - 1.14.1-2
- Modify the tests file to correct version 1.14.1
- Fix jr_jackson remove due to tests failed
* Mon Jun 07 2021 jiangxinyu <jiangxinyu@kylinos.cn> - 1.14.1-1
- Update version to 1.14.1
* Sat Aug 22 2020 Jeffery.Gao <gaojianxing@huawei.com> - 1.13.1-1
- Package init

4
rubygem-multi_json.yaml Normal file
View File

@ -0,0 +1,4 @@
version_control: github
src_repo: intridea/multi_json
tag_prefix: "v"
seperator: "."