bright_serializer 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -4
- data/Gemfile.lock +34 -32
- data/bright_serializer.gemspec +1 -1
- data/lib/bright_serializer/serializer.rb +3 -1
- data/lib/bright_serializer/version.rb +1 -1
- metadata +2 -3
- data/.github/workflows/build.yml +0 -37
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 77aa6c33f823a9f96b4d8a73fac9f7a87cf7892431d6e0f3cd1186b9da9fdf6b
|
4
|
+
data.tar.gz: b9820f01f3cf1d5d86588741b0f7af93521c4b55c5dc7352940b3cb1bebdc3e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2093dc003212c566476fb83ebb95cc0e9951e5652d0e4a0e1ee667a110581c09cf48ea6170948d3636792f70fa7c10be8acc5f1ff068d567c51fee81fa87235b
|
7
|
+
data.tar.gz: f1163513f3b3d2085f13165fd9f9f29712a9f2cab7486c8041daa7fb04d6719dc102df7fea428451c14eb7ff8677c7bde0c62f8ba4d64f0cef0262e7604387bd
|
data/CHANGELOG.md
CHANGED
@@ -4,21 +4,25 @@
|
|
4
4
|
|
5
5
|
* Your contribution
|
6
6
|
|
7
|
+
## 0.2.3 (2021-01-04)
|
8
|
+
|
9
|
+
* Update dependencies ([v0.2.2...v0.2.3](https://github.com/petalmd/bright_serializer/compare/v0.2.2...v0.2.3))
|
10
|
+
|
7
11
|
## 0.2.2 (2020-07-22)
|
8
12
|
|
9
|
-
* Run CI build on all supported Ruby versions (#11)
|
13
|
+
* Run CI build on all supported Ruby versions ([#11](https://github.com/petalmd/bright_serializer/pull/11))
|
10
14
|
* Update Rubocop 0.78.0 => 0.88.0 and run auto-correction
|
11
|
-
* Deep transform entity keys (#12)
|
15
|
+
* Deep transform entity keys ([#12](https://github.com/petalmd/bright_serializer/pull/12))
|
12
16
|
|
13
17
|
## 0.2.1 (2020-07-21)
|
14
18
|
|
15
|
-
* Handle set_key_transform inherited from a parent serializer (#10)
|
19
|
+
* Handle set_key_transform inherited from a parent serializer ([#10](https://github.com/petalmd/bright_serializer/pull/10))
|
16
20
|
|
17
21
|
## 0.2.0 (2020-07-17)
|
18
22
|
|
19
23
|
* Add RubyGems version badge
|
20
24
|
* Handle inherit from a parent serializer
|
21
|
-
* Define entity in serializer for grape_swagger (#9)
|
25
|
+
* Define entity in serializer for grape_swagger ([#9](https://github.com/petalmd/bright_serializer/pull/9))
|
22
26
|
|
23
27
|
## 0.1.1 (2020-07-13)
|
24
28
|
|
data/Gemfile.lock
CHANGED
@@ -1,56 +1,58 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
bright_serializer (0.2.
|
4
|
+
bright_serializer (0.2.3)
|
5
5
|
oj (~> 3)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
10
|
ast (2.4.1)
|
11
|
-
concurrent-ruby (1.1.
|
11
|
+
concurrent-ruby (1.1.7)
|
12
12
|
diff-lcs (1.4.4)
|
13
|
-
faker (2.
|
14
|
-
i18n (>= 1.6, <
|
15
|
-
i18n (1.
|
13
|
+
faker (2.15.1)
|
14
|
+
i18n (>= 1.6, < 2)
|
15
|
+
i18n (1.8.5)
|
16
16
|
concurrent-ruby (~> 1.0)
|
17
|
-
oj (3.10.
|
18
|
-
parallel (1.
|
19
|
-
parser (
|
17
|
+
oj (3.10.18)
|
18
|
+
parallel (1.20.1)
|
19
|
+
parser (3.0.0.0)
|
20
20
|
ast (~> 2.4.1)
|
21
21
|
rainbow (3.0.0)
|
22
|
-
rake (13.0.
|
23
|
-
regexp_parser (
|
22
|
+
rake (13.0.3)
|
23
|
+
regexp_parser (2.0.3)
|
24
24
|
rexml (3.2.4)
|
25
|
-
rspec (3.
|
26
|
-
rspec-core (~> 3.
|
27
|
-
rspec-expectations (~> 3.
|
28
|
-
rspec-mocks (~> 3.
|
29
|
-
rspec-core (3.
|
30
|
-
rspec-support (~> 3.
|
31
|
-
rspec-expectations (3.
|
25
|
+
rspec (3.10.0)
|
26
|
+
rspec-core (~> 3.10.0)
|
27
|
+
rspec-expectations (~> 3.10.0)
|
28
|
+
rspec-mocks (~> 3.10.0)
|
29
|
+
rspec-core (3.10.0)
|
30
|
+
rspec-support (~> 3.10.0)
|
31
|
+
rspec-expectations (3.10.0)
|
32
32
|
diff-lcs (>= 1.2.0, < 2.0)
|
33
|
-
rspec-support (~> 3.
|
34
|
-
rspec-mocks (3.
|
33
|
+
rspec-support (~> 3.10.0)
|
34
|
+
rspec-mocks (3.10.0)
|
35
35
|
diff-lcs (>= 1.2.0, < 2.0)
|
36
|
-
rspec-support (~> 3.
|
37
|
-
rspec-support (3.
|
38
|
-
rubocop (0.
|
36
|
+
rspec-support (~> 3.10.0)
|
37
|
+
rspec-support (3.10.0)
|
38
|
+
rubocop (0.93.1)
|
39
39
|
parallel (~> 1.10)
|
40
|
-
parser (>= 2.7.1.
|
40
|
+
parser (>= 2.7.1.5)
|
41
41
|
rainbow (>= 2.2.2, < 4.0)
|
42
|
-
regexp_parser (>= 1.
|
42
|
+
regexp_parser (>= 1.8)
|
43
43
|
rexml
|
44
|
-
rubocop-ast (>= 0.
|
44
|
+
rubocop-ast (>= 0.6.0)
|
45
45
|
ruby-progressbar (~> 1.7)
|
46
46
|
unicode-display_width (>= 1.4.0, < 2.0)
|
47
|
-
rubocop-ast (
|
48
|
-
parser (>= 2.7.
|
49
|
-
rubocop-performance (1.
|
50
|
-
rubocop (>= 0.
|
51
|
-
|
52
|
-
|
53
|
-
|
47
|
+
rubocop-ast (1.4.0)
|
48
|
+
parser (>= 2.7.1.5)
|
49
|
+
rubocop-performance (1.9.2)
|
50
|
+
rubocop (>= 0.90.0, < 2.0)
|
51
|
+
rubocop-ast (>= 0.4.0)
|
52
|
+
rubocop-rspec (1.44.1)
|
53
|
+
rubocop (~> 0.87)
|
54
|
+
rubocop-ast (>= 0.7.1)
|
55
|
+
ruby-progressbar (1.11.0)
|
54
56
|
unicode-display_width (1.7.0)
|
55
57
|
|
56
58
|
PLATFORMS
|
data/bright_serializer.gemspec
CHANGED
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
|
|
30
30
|
# Specify which files should be added to the gem when it is released.
|
31
31
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
32
32
|
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
33
|
-
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
33
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features|.github)/}) }
|
34
34
|
end
|
35
35
|
spec.bindir = 'exe'
|
36
36
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
@@ -12,6 +12,7 @@ module BrightSerializer
|
|
12
12
|
DEFAULT_OJ_OPTIONS = { mode: :compat, time_format: :ruby, use_to_json: true }.freeze
|
13
13
|
|
14
14
|
def self.included(base)
|
15
|
+
super
|
15
16
|
base.extend ClassMethods
|
16
17
|
base.instance_variable_set(:@attributes_to_serialize, [])
|
17
18
|
end
|
@@ -86,7 +87,8 @@ module BrightSerializer
|
|
86
87
|
def entity
|
87
88
|
{}.tap do |result|
|
88
89
|
@attributes_to_serialize.each do |attribute|
|
89
|
-
entity_value = attribute.entity&.to_h ||
|
90
|
+
entity_value = attribute.entity&.to_h ||
|
91
|
+
BrightSerializer::Entity::Base::DEFAULT_DEFINITION
|
90
92
|
result.merge!(attribute.transformed_key => entity_value)
|
91
93
|
end
|
92
94
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bright_serializer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jean-Francis Bastien
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oj
|
@@ -87,7 +87,6 @@ executables: []
|
|
87
87
|
extensions: []
|
88
88
|
extra_rdoc_files: []
|
89
89
|
files:
|
90
|
-
- ".github/workflows/build.yml"
|
91
90
|
- ".gitignore"
|
92
91
|
- ".rspec"
|
93
92
|
- ".rubocop.yml"
|
data/.github/workflows/build.yml
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
name: Build
|
2
|
-
|
3
|
-
on: [push]
|
4
|
-
|
5
|
-
jobs:
|
6
|
-
Build:
|
7
|
-
|
8
|
-
runs-on: ubuntu-latest
|
9
|
-
strategy:
|
10
|
-
matrix:
|
11
|
-
ruby: [2.5, 2.6, 2.7]
|
12
|
-
steps:
|
13
|
-
- uses: actions/checkout@v1
|
14
|
-
- name: Set up Ruby ${{ matrix.ruby }}
|
15
|
-
uses: actions/setup-ruby@v1
|
16
|
-
with:
|
17
|
-
ruby-version: ${{ matrix.ruby }}
|
18
|
-
- name: Bundle install
|
19
|
-
run: |
|
20
|
-
gem install bundler
|
21
|
-
bundle install --jobs 4 --retry 3
|
22
|
-
- name: Specs
|
23
|
-
run: bundle exec rake
|
24
|
-
Rubocop:
|
25
|
-
runs-on: ubuntu-latest
|
26
|
-
steps:
|
27
|
-
- uses: actions/checkout@v1
|
28
|
-
- name: Set up Ruby 2.7
|
29
|
-
uses: actions/setup-ruby@v1
|
30
|
-
with:
|
31
|
-
ruby-version: 2.7
|
32
|
-
- name: Bundle install
|
33
|
-
run: |
|
34
|
-
gem install bundler
|
35
|
-
bundle install --jobs 4 --retry 3
|
36
|
-
- name: Rubocop
|
37
|
-
run: bundle exec rubocop --parallel
|