panko_serializer 0.8.1 → 0.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b1f46c78adb3128739cca219e9835e4411c2a9e9ac65f7cf18444c7bddd432a4
4
- data.tar.gz: e30e2ba7abbb08270b00dc9d71ef1fb2b509b6d2778d9971b3d19283e5830369
3
+ metadata.gz: 30c234d90f13454e0f54347e0b98ed6c1e3f935ef25769d55c825a462021f66b
4
+ data.tar.gz: 3c49a951469fad5249307c3569b1f9a1c03763f2cd961ed94ef19684ae63f0ab
5
5
  SHA512:
6
- metadata.gz: b70dac493132900bf6f9b6490679f399a2dc0e38a54d25f3a50f5bcba9e04da137d7e9b4fc7d87a81747ed8625e486750dda4dca5086a8ce38750c85205e50c9
7
- data.tar.gz: 9f1f330ff1c05694bade23bbaee954c4bfa281a27de8e2c872271b30fb2ea9a893074041af050249073d33ed074e038757c37973c555c053b9e84f86edf8b2ea
6
+ metadata.gz: dcce669e933459d36d033abc5d94494b5aa6333c1fe97e3015609e6eaabc27a3d7d2376c328bbbd53f941b238c67725b6130a64e9bf313b90cb10800ed2c0af9
7
+ data.tar.gz: 1f83c4d03e1a175976044d78e920ab4864b9973569fc945f510f773a02ca06190e81557d259741b0fd15abf1b23eec2ebda6951bcb2e862fb83f177b78945fac
@@ -15,7 +15,7 @@ jobs:
15
15
  working_directory: 'docs/'
16
16
 
17
17
  steps:
18
- - uses: actions/checkout@v2
18
+ - uses: actions/checkout@v4
19
19
  - name: Use Node.js ${{ matrix.node-version }}
20
20
  uses: actions/setup-node@v1
21
21
  with:
@@ -26,7 +26,7 @@ jobs:
26
26
  run: npm install
27
27
 
28
28
  - name: Install SSH Client 🔑
29
- uses: webfactory/ssh-agent@v0.4.1
29
+ uses: webfactory/ssh-agent@v0.6.0
30
30
  with:
31
31
  ssh-private-key: ${{ secrets.DEPLOY_KEY }}
32
32
 
@@ -7,7 +7,7 @@ jobs:
7
7
  runs-on: ubuntu-latest
8
8
 
9
9
  steps:
10
- - uses: actions/checkout@v2
10
+ - uses: actions/checkout@v4
11
11
  - name: Set up Ruby
12
12
  uses: ruby/setup-ruby@v1
13
13
  with:
@@ -19,16 +19,12 @@ jobs:
19
19
  sudo apt install -y libsqlite3-dev
20
20
 
21
21
  - name: Install gems
22
- env:
23
- RAILS_VERSION: "7.0"
24
22
  run: |
25
23
  gem install bundler
26
24
  bundle config set path 'vendor/bundle'
27
25
  bundle check || bundle install --jobs 4 --retry 3
28
26
 
29
27
  - name: Lint ruby
30
- env:
31
- RAILS_VERSION: "7.0"
32
28
  run: |
33
29
  bundle exec rake standard
34
30
 
@@ -8,11 +8,11 @@ jobs:
8
8
  strategy:
9
9
  fail-fast: false
10
10
  matrix:
11
- ruby: ["3.0", "3.1", "3.2"]
12
- rails: ["6.1.0", "7.0.0"]
11
+ ruby: ["3.0", "3.1", "3.2", "3.3"]
12
+ rails: ["6.1.0", "7.0.0", "7.1.0"]
13
13
 
14
14
  steps:
15
- - uses: actions/checkout@v2
15
+ - uses: actions/checkout@v4
16
16
  - name: Set up Ruby ${{ matrix.ruby }}
17
17
  uses: ruby/setup-ruby@v1
18
18
  with:
@@ -25,7 +25,7 @@ jobs:
25
25
 
26
26
  - name: Gems Cache
27
27
  id: gem-cache
28
- uses: actions/cache@v1
28
+ uses: actions/cache@v3
29
29
  with:
30
30
  path: vendor/bundle
31
31
  key: ${{ runner.os }}-${{ matrix.ruby }}-${{ matrix.rails }}-gem
@@ -34,7 +34,7 @@ jobs:
34
34
 
35
35
  - name: Install gems
36
36
  env:
37
- RAILS_VERSION: ${{ matrix.rails }}
37
+ BUNDLE_GEMFILE: gemfiles/${{ matrix.rails }}.gemfile
38
38
  run: |
39
39
  gem install bundler
40
40
  bundle config set path 'vendor/bundle'
@@ -42,6 +42,6 @@ jobs:
42
42
 
43
43
  - name: Compile & test
44
44
  env:
45
- RAILS_VERSION: ${{ matrix.rails }}
45
+ BUNDLE_GEMFILE: gemfiles/${{ matrix.rails }}.gemfile
46
46
  run: |
47
47
  bundle exec rake
data/.standard.yml CHANGED
@@ -1,4 +1,5 @@
1
1
  ignore:
2
2
  - "ext/**/*"
3
+ - "benchmarks/**/*"
3
4
  - "spec/**/*":
4
5
  - Lint/ConstantDefinitionInBlock
data/Appraisals ADDED
@@ -0,0 +1,17 @@
1
+ appraise "6.1.0" do
2
+ gem "activesupport", "~> 6.1.0"
3
+ gem "activemodel", "~> 6.1.0"
4
+ gem "activerecord", "~> 6.1.0", group: :test
5
+ end
6
+
7
+ appraise "7.0.0" do
8
+ gem "activesupport", "~> 7.0.0"
9
+ gem "activemodel", "~> 7.0.0"
10
+ gem "activerecord", "~> 7.0.0", group: :test
11
+ end
12
+
13
+ appraise "7.1.0" do
14
+ gem "activesupport", "~> 7.1.0"
15
+ gem "activemodel", "~> 7.1.0"
16
+ gem "activerecord", "~> 7.1.0", group: :test
17
+ end
data/Gemfile CHANGED
@@ -4,24 +4,14 @@ source "https://rubygems.org"
4
4
 
5
5
  gemspec
6
6
 
7
- raw_rails_version = ENV.fetch("RAILS_VERSION", "6.1.0")
8
- rails_version = "~> #{raw_rails_version}"
9
-
10
- gem "activesupport", rails_version
11
- gem "activemodel", rails_version
12
- gem "activerecord", rails_version, group: :test
13
-
14
7
  group :benchmarks do
15
8
  gem "sqlite3", "~> 1.4"
16
9
  gem "pg", ">= 0.18", "< 2.0"
17
10
 
18
- gem "memory_profiler"
19
- gem "ruby-prof", platforms: [:mri]
20
- gem "ruby-prof-flamegraph", platforms: [:mri]
21
-
22
11
  gem "benchmark-ips"
23
12
  gem "active_model_serializers", "~> 0.10"
24
13
  gem "terminal-table"
14
+ gem "memory_profiler"
25
15
  end
26
16
 
27
17
  group :test do
data/README.md CHANGED
@@ -2,13 +2,13 @@
2
2
 
3
3
  ![Build Status](https://github.com/yosiat/panko_serializer/workflows/Panko%20Serializer%20CI/badge.svg?branch=master)
4
4
 
5
- Panko is library which is inspired by ActiveModelSerializers 0.9 for serializing ActiveRecord/Ruby objects to JSON strings, fast.
5
+ Panko is a library which is inspired by ActiveModelSerializers 0.9 for serializing ActiveRecord/Ruby objects to JSON strings, fast.
6
6
 
7
- To achieve it's [performance](https://panko.dev/docs/performance.html):
7
+ To achieve its [performance](https://panko.dev/docs/performance.html):
8
8
 
9
- * Oj - Panko relies Oj since it's fast and allow to serialize incrementally using `Oj::StringWriter`
9
+ * Oj - Panko relies on Oj since it's fast and allows for incremental serialization using `Oj::StringWriter`
10
10
  * Serialization Descriptor - Panko computes most of the metadata ahead of time, to save time later in serialization.
11
- * Type casting — Panko does type casting by it's self, instead of relying on ActiveRecord.
11
+ * Type casting — Panko does type casting by itself, instead of relying on ActiveRecord.
12
12
 
13
13
  To dig deeper about the performance choices, read [Design Choices](https://panko.dev/docs/design-choices.html).
14
14
 
@@ -23,4 +23,3 @@ License
23
23
  -------
24
24
 
25
25
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
26
-
@@ -5,26 +5,14 @@ require_relative "support"
5
5
  def ar_type_convert(type_klass, from, to)
6
6
  converter = type_klass.new
7
7
 
8
- if ENV["RAILS_VERSION"].start_with? "4.2"
9
- assert type_klass.name, converter.type_cast_from_database(from), to
8
+ assert type_klass.name, converter.deserialize(from), to
10
9
 
11
- Benchmark.run("#{type_klass.name}_TypeCast") do
12
- converter.type_cast_from_database(from)
13
- end
14
-
15
- Benchmark.run("#{type_klass.name}_NoTypeCast") do
16
- converter.type_cast_from_database(to)
17
- end
18
- else
19
- assert type_klass.name, converter.deserialize(from), to
20
-
21
- Benchmark.run("#{type_klass.name}_TypeCast") do
22
- converter.deserialize(from)
23
- end
10
+ Benchmark.run("#{type_klass.name}_TypeCast") do
11
+ converter.deserialize(from)
12
+ end
24
13
 
25
- Benchmark.run("#{type_klass.name}_NoTypeCast") do
26
- converter.deserialize(to)
27
- end
14
+ Benchmark.run("#{type_klass.name}_NoTypeCast") do
15
+ converter.deserialize(to)
28
16
  end
29
17
  end
30
18
 
@@ -36,14 +24,8 @@ def utc_ar_time
36
24
  type = ActiveRecord::ConnectionAdapters::PostgreSQL::OID::DateTime.new
37
25
  converter = ActiveRecord::AttributeMethods::TimeZoneConversion::TimeZoneConverter.new(type)
38
26
 
39
- if ENV["RAILS_VERSION"].start_with? "4.2"
40
- Benchmark.run("#{tz}_#{type.class.name}_TypeCast") do
41
- converter.type_cast_from_database(from).iso8601
42
- end
43
- else
44
- Benchmark.run("#{tz}_#{type.class.name}_TypeCast") do
45
- converter.deserialize(from).iso8601
46
- end
27
+ Benchmark.run("#{tz}_#{type.class.name}_TypeCast") do
28
+ converter.deserialize(from).iso8601
47
29
  end
48
30
  end
49
31
 
@@ -53,14 +35,8 @@ def db_ar_time
53
35
 
54
36
  from = "2017-07-10 09:26:40.937392"
55
37
 
56
- if ENV["RAILS_VERSION"].start_with? "4.2"
57
- Benchmark.run("ActiveRecord_Time_TypeCast_WithISO8601") do
58
- converter.type_cast_from_database(from).iso8601
59
- end
60
- else
61
- Benchmark.run("ActiveRecord_Time_TypeCast_WithISO8601") do
62
- converter.deserialize(from).iso8601
63
- end
38
+ Benchmark.run("ActiveRecord_Time_TypeCast_WithISO8601") do
39
+ converter.deserialize(from).iso8601
64
40
  end
65
41
  end
66
42
 
@@ -71,11 +47,6 @@ ar_type_convert ActiveRecord::Type::Float, "1.23", 1.23
71
47
  ar_type_convert ActiveRecord::Type::Boolean, "true", true
72
48
  ar_type_convert ActiveRecord::Type::Boolean, "t", true
73
49
 
74
- if ENV["RAILS_VERSION"].start_with? "4.2"
75
- ar_type_convert ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Integer, "1", 1
76
- ar_type_convert ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Float, "1.23", 1.23
77
- ar_type_convert ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Float, "Infinity", ::Float::INFINITY
78
- end
79
50
  if check_if_exists "ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Json"
80
51
  ar_type_convert ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Json, '{"a":1}', {a: 1}
81
52
  end
@@ -52,15 +52,12 @@ panko_type_convert ActiveRecord::Type::Float, "1.23", 1.23
52
52
  panko_type_convert ActiveRecord::Type::Boolean, "true", true
53
53
  panko_type_convert ActiveRecord::Type::Boolean, "t", true
54
54
 
55
- if ENV["RAILS_VERSION"].start_with? "4.2"
56
- panko_type_convert ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Integer, "1", 1
57
- panko_type_convert ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Float, "1.23", 1.23
58
- panko_type_convert ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Float, "Infinity", ::Float::INFINITY
59
- end
60
-
61
55
  if check_if_exists "ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Json"
62
56
  panko_type_convert ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Json, '{"a":1}', '{"a":1}'
63
57
  end
58
+ if check_if_exists "ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Jsonb"
59
+ panko_type_convert ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Jsonb, '{"a":1}', '{"a":1}'
60
+ end
64
61
  if check_if_exists "ActiveRecord::Type::Json"
65
62
  panko_type_convert ActiveRecord::Type::Json, '{"a":1}', '{"a":1}'
66
63
  end
@@ -63,7 +63,7 @@ We can declare tailored serializer for this, or we can re-use the above defined
63
63
  ```ruby
64
64
  posts = Post.all
65
65
 
66
- Panko::ArraySerializer.new(posts, only: {
66
+ Panko::ArraySerializer.new(posts, each_serializer: PostSerializer, only: {
67
67
  instance: [:title, :body, :author, :comments],
68
68
  author: [:id],
69
69
  comments: [:id],
@@ -24,7 +24,10 @@ static VALUE ar_pg_integer_type = Qundef;
24
24
  static VALUE ar_pg_float_type = Qundef;
25
25
  static VALUE ar_pg_uuid_type = Qundef;
26
26
  static VALUE ar_pg_json_type = Qundef;
27
+ static VALUE ar_pg_jsonb_type = Qundef;
28
+ static VALUE ar_pg_array_type = Qundef;
27
29
  static VALUE ar_pg_date_time_type = Qundef;
30
+ static VALUE ar_pg_timestamp_type = Qundef;
28
31
 
29
32
  static int initiailized = 0;
30
33
 
@@ -63,10 +66,18 @@ VALUE cache_postgres_type_lookup(VALUE ar) {
63
66
  ar_pg_json_type = rb_const_get_at(ar_oid, rb_intern("Json"));
64
67
  }
65
68
 
69
+ if (rb_const_defined_at(ar_oid, rb_intern("Jsonb")) == (int)Qtrue) {
70
+ ar_pg_jsonb_type = rb_const_get_at(ar_oid, rb_intern("Jsonb"));
71
+ }
72
+
66
73
  if (rb_const_defined_at(ar_oid, rb_intern("DateTime")) == (int)Qtrue) {
67
74
  ar_pg_date_time_type = rb_const_get_at(ar_oid, rb_intern("DateTime"));
68
75
  }
69
76
 
77
+ if (rb_const_defined_at(ar_oid, rb_intern("Timestamp")) == (int)Qtrue) {
78
+ ar_pg_timestamp_type = rb_const_get_at(ar_oid, rb_intern("Timestamp"));
79
+ }
80
+
70
81
  return Qtrue;
71
82
  }
72
83
 
@@ -210,6 +221,7 @@ VALUE cast_integer_type(VALUE value) {
210
221
 
211
222
  bool is_json_type(VALUE type_klass) {
212
223
  return ((ar_pg_json_type != Qundef && type_klass == ar_pg_json_type) ||
224
+ (ar_pg_jsonb_type != Qundef && type_klass == ar_pg_jsonb_type) ||
213
225
  (ar_json_type != Qundef && type_klass == ar_json_type));
214
226
  }
215
227
 
@@ -250,6 +262,8 @@ bool is_date_time_type(VALUE type_klass) {
250
262
  return (type_klass == ar_date_time_type) ||
251
263
  (ar_pg_date_time_type != Qundef &&
252
264
  type_klass == ar_pg_date_time_type) ||
265
+ (ar_pg_timestamp_type != Qundef &&
266
+ type_klass == ar_pg_timestamp_type) ||
253
267
  (ar_time_zone_converter != Qundef &&
254
268
  type_klass == ar_time_zone_converter);
255
269
  }
@@ -377,5 +391,8 @@ void panko_init_type_cast(VALUE mPanko) {
377
391
  rb_global_variable(&ar_pg_float_type);
378
392
  rb_global_variable(&ar_pg_uuid_type);
379
393
  rb_global_variable(&ar_pg_json_type);
394
+ rb_global_variable(&ar_pg_jsonb_type);
395
+ rb_global_variable(&ar_pg_array_type);
380
396
  rb_global_variable(&ar_pg_date_time_type);
397
+ rb_global_variable(&ar_pg_timestamp_type);
381
398
  }
@@ -0,0 +1,30 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "standard", group: [:development, :test]
6
+ gem "activesupport", "~> 6.1.0"
7
+ gem "activemodel", "~> 6.1.0"
8
+ gem "activerecord", "~> 6.1.0", group: :test
9
+
10
+ group :benchmarks do
11
+ gem "sqlite3", "~> 1.4"
12
+ gem "pg", ">= 0.18", "< 2.0"
13
+ gem "benchmark-ips"
14
+ gem "active_model_serializers", "~> 0.10"
15
+ gem "terminal-table"
16
+ gem "memory_profiler"
17
+ end
18
+
19
+ group :test do
20
+ gem "faker"
21
+ end
22
+
23
+ group :development do
24
+ gem "byebug"
25
+ gem "rake"
26
+ gem "rspec", "~> 3.0"
27
+ gem "rake-compiler"
28
+ end
29
+
30
+ gemspec path: "../"
@@ -0,0 +1,166 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ panko_serializer (0.8.1)
5
+ activesupport
6
+ oj (> 3.11.0, < 4.0.0)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ actionpack (6.1.7.7)
12
+ actionview (= 6.1.7.7)
13
+ activesupport (= 6.1.7.7)
14
+ rack (~> 2.0, >= 2.0.9)
15
+ rack-test (>= 0.6.3)
16
+ rails-dom-testing (~> 2.0)
17
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
18
+ actionview (6.1.7.7)
19
+ activesupport (= 6.1.7.7)
20
+ builder (~> 3.1)
21
+ erubi (~> 1.4)
22
+ rails-dom-testing (~> 2.0)
23
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
24
+ active_model_serializers (0.10.14)
25
+ actionpack (>= 4.1)
26
+ activemodel (>= 4.1)
27
+ case_transform (>= 0.2)
28
+ jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
29
+ activemodel (6.1.7.7)
30
+ activesupport (= 6.1.7.7)
31
+ activerecord (6.1.7.7)
32
+ activemodel (= 6.1.7.7)
33
+ activesupport (= 6.1.7.7)
34
+ activesupport (6.1.7.7)
35
+ concurrent-ruby (~> 1.0, >= 1.0.2)
36
+ i18n (>= 1.6, < 2)
37
+ minitest (>= 5.1)
38
+ tzinfo (~> 2.0)
39
+ zeitwerk (~> 2.3)
40
+ appraisal (2.5.0)
41
+ bundler
42
+ rake
43
+ thor (>= 0.14.0)
44
+ ast (2.4.2)
45
+ benchmark-ips (2.13.0)
46
+ builder (3.2.4)
47
+ byebug (11.1.3)
48
+ case_transform (0.2)
49
+ activesupport
50
+ concurrent-ruby (1.2.3)
51
+ crass (1.0.6)
52
+ diff-lcs (1.5.1)
53
+ erubi (1.12.0)
54
+ faker (3.2.3)
55
+ i18n (>= 1.8.11, < 2)
56
+ i18n (1.14.4)
57
+ concurrent-ruby (~> 1.0)
58
+ json (2.7.1)
59
+ jsonapi-renderer (0.2.2)
60
+ language_server-protocol (3.17.0.3)
61
+ lint_roller (1.1.0)
62
+ loofah (2.22.0)
63
+ crass (~> 1.0.2)
64
+ nokogiri (>= 1.12.0)
65
+ memory_profiler (1.0.1)
66
+ minitest (5.22.3)
67
+ nokogiri (1.16.3-arm64-darwin)
68
+ racc (~> 1.4)
69
+ oj (3.16.1)
70
+ parallel (1.24.0)
71
+ parser (3.3.0.5)
72
+ ast (~> 2.4.1)
73
+ racc
74
+ pg (1.5.5)
75
+ racc (1.7.3)
76
+ rack (2.2.8.1)
77
+ rack-test (2.1.0)
78
+ rack (>= 1.3)
79
+ rails-dom-testing (2.2.0)
80
+ activesupport (>= 5.0.0)
81
+ minitest
82
+ nokogiri (>= 1.6)
83
+ rails-html-sanitizer (1.6.0)
84
+ loofah (~> 2.21)
85
+ nokogiri (~> 1.14)
86
+ rainbow (3.1.1)
87
+ rake (13.2.1)
88
+ rake-compiler (1.2.1)
89
+ rake
90
+ regexp_parser (2.9.0)
91
+ rexml (3.2.6)
92
+ rspec (3.13.0)
93
+ rspec-core (~> 3.13.0)
94
+ rspec-expectations (~> 3.13.0)
95
+ rspec-mocks (~> 3.13.0)
96
+ rspec-core (3.13.0)
97
+ rspec-support (~> 3.13.0)
98
+ rspec-expectations (3.13.0)
99
+ diff-lcs (>= 1.2.0, < 2.0)
100
+ rspec-support (~> 3.13.0)
101
+ rspec-mocks (3.13.0)
102
+ diff-lcs (>= 1.2.0, < 2.0)
103
+ rspec-support (~> 3.13.0)
104
+ rspec-support (3.13.1)
105
+ rubocop (1.62.1)
106
+ json (~> 2.3)
107
+ language_server-protocol (>= 3.17.0)
108
+ parallel (~> 1.10)
109
+ parser (>= 3.3.0.2)
110
+ rainbow (>= 2.2.2, < 4.0)
111
+ regexp_parser (>= 1.8, < 3.0)
112
+ rexml (>= 3.2.5, < 4.0)
113
+ rubocop-ast (>= 1.31.1, < 2.0)
114
+ ruby-progressbar (~> 1.7)
115
+ unicode-display_width (>= 2.4.0, < 3.0)
116
+ rubocop-ast (1.31.2)
117
+ parser (>= 3.3.0.4)
118
+ rubocop-performance (1.20.2)
119
+ rubocop (>= 1.48.1, < 2.0)
120
+ rubocop-ast (>= 1.30.0, < 2.0)
121
+ ruby-progressbar (1.13.0)
122
+ sqlite3 (1.7.3-arm64-darwin)
123
+ standard (1.34.0)
124
+ language_server-protocol (~> 3.17.0.2)
125
+ lint_roller (~> 1.0)
126
+ rubocop (~> 1.60)
127
+ standard-custom (~> 1.0.0)
128
+ standard-performance (~> 1.3)
129
+ standard-custom (1.0.2)
130
+ lint_roller (~> 1.0)
131
+ rubocop (~> 1.50)
132
+ standard-performance (1.3.1)
133
+ lint_roller (~> 1.1)
134
+ rubocop-performance (~> 1.20.2)
135
+ terminal-table (3.0.2)
136
+ unicode-display_width (>= 1.1.1, < 3)
137
+ thor (1.3.1)
138
+ tzinfo (2.0.6)
139
+ concurrent-ruby (~> 1.0)
140
+ unicode-display_width (2.5.0)
141
+ zeitwerk (2.6.13)
142
+
143
+ PLATFORMS
144
+ arm64-darwin-23
145
+
146
+ DEPENDENCIES
147
+ active_model_serializers (~> 0.10)
148
+ activemodel (~> 6.1.0)
149
+ activerecord (~> 6.1.0)
150
+ activesupport (~> 6.1.0)
151
+ appraisal
152
+ benchmark-ips
153
+ byebug
154
+ faker
155
+ memory_profiler
156
+ panko_serializer!
157
+ pg (>= 0.18, < 2.0)
158
+ rake
159
+ rake-compiler
160
+ rspec (~> 3.0)
161
+ sqlite3 (~> 1.4)
162
+ standard
163
+ terminal-table
164
+
165
+ BUNDLED WITH
166
+ 2.4.6
@@ -0,0 +1,30 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "standard", group: [:development, :test]
6
+ gem "activesupport", "~> 7.0.0"
7
+ gem "activemodel", "~> 7.0.0"
8
+ gem "activerecord", "~> 7.0.0", group: :test
9
+
10
+ group :benchmarks do
11
+ gem "sqlite3", "~> 1.4"
12
+ gem "pg", ">= 0.18", "< 2.0"
13
+ gem "benchmark-ips"
14
+ gem "active_model_serializers", "~> 0.10"
15
+ gem "terminal-table"
16
+ gem "memory_profiler"
17
+ end
18
+
19
+ group :test do
20
+ gem "faker"
21
+ end
22
+
23
+ group :development do
24
+ gem "byebug"
25
+ gem "rake"
26
+ gem "rspec", "~> 3.0"
27
+ gem "rake-compiler"
28
+ end
29
+
30
+ gemspec path: "../"
@@ -0,0 +1,164 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ panko_serializer (0.8.1)
5
+ activesupport
6
+ oj (> 3.11.0, < 4.0.0)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ actionpack (7.0.8.1)
12
+ actionview (= 7.0.8.1)
13
+ activesupport (= 7.0.8.1)
14
+ rack (~> 2.0, >= 2.2.4)
15
+ rack-test (>= 0.6.3)
16
+ rails-dom-testing (~> 2.0)
17
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
18
+ actionview (7.0.8.1)
19
+ activesupport (= 7.0.8.1)
20
+ builder (~> 3.1)
21
+ erubi (~> 1.4)
22
+ rails-dom-testing (~> 2.0)
23
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
24
+ active_model_serializers (0.10.14)
25
+ actionpack (>= 4.1)
26
+ activemodel (>= 4.1)
27
+ case_transform (>= 0.2)
28
+ jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
29
+ activemodel (7.0.8.1)
30
+ activesupport (= 7.0.8.1)
31
+ activerecord (7.0.8.1)
32
+ activemodel (= 7.0.8.1)
33
+ activesupport (= 7.0.8.1)
34
+ activesupport (7.0.8.1)
35
+ concurrent-ruby (~> 1.0, >= 1.0.2)
36
+ i18n (>= 1.6, < 2)
37
+ minitest (>= 5.1)
38
+ tzinfo (~> 2.0)
39
+ appraisal (2.5.0)
40
+ bundler
41
+ rake
42
+ thor (>= 0.14.0)
43
+ ast (2.4.2)
44
+ benchmark-ips (2.13.0)
45
+ builder (3.2.4)
46
+ byebug (11.1.3)
47
+ case_transform (0.2)
48
+ activesupport
49
+ concurrent-ruby (1.2.3)
50
+ crass (1.0.6)
51
+ diff-lcs (1.5.1)
52
+ erubi (1.12.0)
53
+ faker (3.2.3)
54
+ i18n (>= 1.8.11, < 2)
55
+ i18n (1.14.4)
56
+ concurrent-ruby (~> 1.0)
57
+ json (2.7.1)
58
+ jsonapi-renderer (0.2.2)
59
+ language_server-protocol (3.17.0.3)
60
+ lint_roller (1.1.0)
61
+ loofah (2.22.0)
62
+ crass (~> 1.0.2)
63
+ nokogiri (>= 1.12.0)
64
+ memory_profiler (1.0.1)
65
+ minitest (5.22.3)
66
+ nokogiri (1.16.3-arm64-darwin)
67
+ racc (~> 1.4)
68
+ oj (3.16.1)
69
+ parallel (1.24.0)
70
+ parser (3.3.0.5)
71
+ ast (~> 2.4.1)
72
+ racc
73
+ pg (1.5.5)
74
+ racc (1.7.3)
75
+ rack (2.2.8.1)
76
+ rack-test (2.1.0)
77
+ rack (>= 1.3)
78
+ rails-dom-testing (2.2.0)
79
+ activesupport (>= 5.0.0)
80
+ minitest
81
+ nokogiri (>= 1.6)
82
+ rails-html-sanitizer (1.6.0)
83
+ loofah (~> 2.21)
84
+ nokogiri (~> 1.14)
85
+ rainbow (3.1.1)
86
+ rake (13.2.1)
87
+ rake-compiler (1.2.1)
88
+ rake
89
+ regexp_parser (2.9.0)
90
+ rexml (3.2.6)
91
+ rspec (3.13.0)
92
+ rspec-core (~> 3.13.0)
93
+ rspec-expectations (~> 3.13.0)
94
+ rspec-mocks (~> 3.13.0)
95
+ rspec-core (3.13.0)
96
+ rspec-support (~> 3.13.0)
97
+ rspec-expectations (3.13.0)
98
+ diff-lcs (>= 1.2.0, < 2.0)
99
+ rspec-support (~> 3.13.0)
100
+ rspec-mocks (3.13.0)
101
+ diff-lcs (>= 1.2.0, < 2.0)
102
+ rspec-support (~> 3.13.0)
103
+ rspec-support (3.13.1)
104
+ rubocop (1.62.1)
105
+ json (~> 2.3)
106
+ language_server-protocol (>= 3.17.0)
107
+ parallel (~> 1.10)
108
+ parser (>= 3.3.0.2)
109
+ rainbow (>= 2.2.2, < 4.0)
110
+ regexp_parser (>= 1.8, < 3.0)
111
+ rexml (>= 3.2.5, < 4.0)
112
+ rubocop-ast (>= 1.31.1, < 2.0)
113
+ ruby-progressbar (~> 1.7)
114
+ unicode-display_width (>= 2.4.0, < 3.0)
115
+ rubocop-ast (1.31.2)
116
+ parser (>= 3.3.0.4)
117
+ rubocop-performance (1.20.2)
118
+ rubocop (>= 1.48.1, < 2.0)
119
+ rubocop-ast (>= 1.30.0, < 2.0)
120
+ ruby-progressbar (1.13.0)
121
+ sqlite3 (1.7.3-arm64-darwin)
122
+ standard (1.34.0)
123
+ language_server-protocol (~> 3.17.0.2)
124
+ lint_roller (~> 1.0)
125
+ rubocop (~> 1.60)
126
+ standard-custom (~> 1.0.0)
127
+ standard-performance (~> 1.3)
128
+ standard-custom (1.0.2)
129
+ lint_roller (~> 1.0)
130
+ rubocop (~> 1.50)
131
+ standard-performance (1.3.1)
132
+ lint_roller (~> 1.1)
133
+ rubocop-performance (~> 1.20.2)
134
+ terminal-table (3.0.2)
135
+ unicode-display_width (>= 1.1.1, < 3)
136
+ thor (1.3.1)
137
+ tzinfo (2.0.6)
138
+ concurrent-ruby (~> 1.0)
139
+ unicode-display_width (2.5.0)
140
+
141
+ PLATFORMS
142
+ arm64-darwin-23
143
+
144
+ DEPENDENCIES
145
+ active_model_serializers (~> 0.10)
146
+ activemodel (~> 7.0.0)
147
+ activerecord (~> 7.0.0)
148
+ activesupport (~> 7.0.0)
149
+ appraisal
150
+ benchmark-ips
151
+ byebug
152
+ faker
153
+ memory_profiler
154
+ panko_serializer!
155
+ pg (>= 0.18, < 2.0)
156
+ rake
157
+ rake-compiler
158
+ rspec (~> 3.0)
159
+ sqlite3 (~> 1.4)
160
+ standard
161
+ terminal-table
162
+
163
+ BUNDLED WITH
164
+ 2.4.6
@@ -0,0 +1,30 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "standard", group: [:development, :test]
6
+ gem "activesupport", "~> 7.1.0"
7
+ gem "activemodel", "~> 7.1.0"
8
+ gem "activerecord", "~> 7.1.0", group: :test
9
+
10
+ group :benchmarks do
11
+ gem "sqlite3", "~> 1.4"
12
+ gem "pg", ">= 0.18", "< 2.0"
13
+ gem "benchmark-ips"
14
+ gem "active_model_serializers", "~> 0.10"
15
+ gem "terminal-table"
16
+ gem "memory_profiler"
17
+ end
18
+
19
+ group :test do
20
+ gem "faker"
21
+ end
22
+
23
+ group :development do
24
+ gem "byebug"
25
+ gem "rake"
26
+ gem "rspec", "~> 3.0"
27
+ gem "rake-compiler"
28
+ end
29
+
30
+ gemspec path: "../"
@@ -0,0 +1,181 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ panko_serializer (0.8.1)
5
+ activesupport
6
+ oj (> 3.11.0, < 4.0.0)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ actionpack (7.1.3.2)
12
+ actionview (= 7.1.3.2)
13
+ activesupport (= 7.1.3.2)
14
+ nokogiri (>= 1.8.5)
15
+ racc
16
+ rack (>= 2.2.4)
17
+ rack-session (>= 1.0.1)
18
+ rack-test (>= 0.6.3)
19
+ rails-dom-testing (~> 2.2)
20
+ rails-html-sanitizer (~> 1.6)
21
+ actionview (7.1.3.2)
22
+ activesupport (= 7.1.3.2)
23
+ builder (~> 3.1)
24
+ erubi (~> 1.11)
25
+ rails-dom-testing (~> 2.2)
26
+ rails-html-sanitizer (~> 1.6)
27
+ active_model_serializers (0.10.14)
28
+ actionpack (>= 4.1)
29
+ activemodel (>= 4.1)
30
+ case_transform (>= 0.2)
31
+ jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
32
+ activemodel (7.1.3.2)
33
+ activesupport (= 7.1.3.2)
34
+ activerecord (7.1.3.2)
35
+ activemodel (= 7.1.3.2)
36
+ activesupport (= 7.1.3.2)
37
+ timeout (>= 0.4.0)
38
+ activesupport (7.1.3.2)
39
+ base64
40
+ bigdecimal
41
+ concurrent-ruby (~> 1.0, >= 1.0.2)
42
+ connection_pool (>= 2.2.5)
43
+ drb
44
+ i18n (>= 1.6, < 2)
45
+ minitest (>= 5.1)
46
+ mutex_m
47
+ tzinfo (~> 2.0)
48
+ appraisal (2.5.0)
49
+ bundler
50
+ rake
51
+ thor (>= 0.14.0)
52
+ ast (2.4.2)
53
+ base64 (0.2.0)
54
+ benchmark-ips (2.13.0)
55
+ bigdecimal (3.1.7)
56
+ builder (3.2.4)
57
+ byebug (11.1.3)
58
+ case_transform (0.2)
59
+ activesupport
60
+ concurrent-ruby (1.2.3)
61
+ connection_pool (2.4.1)
62
+ crass (1.0.6)
63
+ diff-lcs (1.5.1)
64
+ drb (2.2.1)
65
+ erubi (1.12.0)
66
+ faker (3.2.3)
67
+ i18n (>= 1.8.11, < 2)
68
+ i18n (1.14.4)
69
+ concurrent-ruby (~> 1.0)
70
+ json (2.7.1)
71
+ jsonapi-renderer (0.2.2)
72
+ language_server-protocol (3.17.0.3)
73
+ lint_roller (1.1.0)
74
+ loofah (2.22.0)
75
+ crass (~> 1.0.2)
76
+ nokogiri (>= 1.12.0)
77
+ memory_profiler (1.0.1)
78
+ minitest (5.22.3)
79
+ mutex_m (0.2.0)
80
+ nokogiri (1.16.3-arm64-darwin)
81
+ racc (~> 1.4)
82
+ oj (3.16.1)
83
+ parallel (1.24.0)
84
+ parser (3.3.0.5)
85
+ ast (~> 2.4.1)
86
+ racc
87
+ pg (1.5.5)
88
+ racc (1.7.3)
89
+ rack (3.0.10)
90
+ rack-session (2.0.0)
91
+ rack (>= 3.0.0)
92
+ rack-test (2.1.0)
93
+ rack (>= 1.3)
94
+ rails-dom-testing (2.2.0)
95
+ activesupport (>= 5.0.0)
96
+ minitest
97
+ nokogiri (>= 1.6)
98
+ rails-html-sanitizer (1.6.0)
99
+ loofah (~> 2.21)
100
+ nokogiri (~> 1.14)
101
+ rainbow (3.1.1)
102
+ rake (13.2.1)
103
+ rake-compiler (1.2.1)
104
+ rake
105
+ regexp_parser (2.9.0)
106
+ rexml (3.2.6)
107
+ rspec (3.13.0)
108
+ rspec-core (~> 3.13.0)
109
+ rspec-expectations (~> 3.13.0)
110
+ rspec-mocks (~> 3.13.0)
111
+ rspec-core (3.13.0)
112
+ rspec-support (~> 3.13.0)
113
+ rspec-expectations (3.13.0)
114
+ diff-lcs (>= 1.2.0, < 2.0)
115
+ rspec-support (~> 3.13.0)
116
+ rspec-mocks (3.13.0)
117
+ diff-lcs (>= 1.2.0, < 2.0)
118
+ rspec-support (~> 3.13.0)
119
+ rspec-support (3.13.1)
120
+ rubocop (1.62.1)
121
+ json (~> 2.3)
122
+ language_server-protocol (>= 3.17.0)
123
+ parallel (~> 1.10)
124
+ parser (>= 3.3.0.2)
125
+ rainbow (>= 2.2.2, < 4.0)
126
+ regexp_parser (>= 1.8, < 3.0)
127
+ rexml (>= 3.2.5, < 4.0)
128
+ rubocop-ast (>= 1.31.1, < 2.0)
129
+ ruby-progressbar (~> 1.7)
130
+ unicode-display_width (>= 2.4.0, < 3.0)
131
+ rubocop-ast (1.31.2)
132
+ parser (>= 3.3.0.4)
133
+ rubocop-performance (1.20.2)
134
+ rubocop (>= 1.48.1, < 2.0)
135
+ rubocop-ast (>= 1.30.0, < 2.0)
136
+ ruby-progressbar (1.13.0)
137
+ sqlite3 (1.7.3-arm64-darwin)
138
+ standard (1.34.0)
139
+ language_server-protocol (~> 3.17.0.2)
140
+ lint_roller (~> 1.0)
141
+ rubocop (~> 1.60)
142
+ standard-custom (~> 1.0.0)
143
+ standard-performance (~> 1.3)
144
+ standard-custom (1.0.2)
145
+ lint_roller (~> 1.0)
146
+ rubocop (~> 1.50)
147
+ standard-performance (1.3.1)
148
+ lint_roller (~> 1.1)
149
+ rubocop-performance (~> 1.20.2)
150
+ terminal-table (3.0.2)
151
+ unicode-display_width (>= 1.1.1, < 3)
152
+ thor (1.3.1)
153
+ timeout (0.4.1)
154
+ tzinfo (2.0.6)
155
+ concurrent-ruby (~> 1.0)
156
+ unicode-display_width (2.5.0)
157
+
158
+ PLATFORMS
159
+ arm64-darwin-23
160
+
161
+ DEPENDENCIES
162
+ active_model_serializers (~> 0.10)
163
+ activemodel (~> 7.1.0)
164
+ activerecord (~> 7.1.0)
165
+ activesupport (~> 7.1.0)
166
+ appraisal
167
+ benchmark-ips
168
+ byebug
169
+ faker
170
+ memory_profiler
171
+ panko_serializer!
172
+ pg (>= 0.18, < 2.0)
173
+ rake
174
+ rake-compiler
175
+ rspec (~> 3.0)
176
+ sqlite3 (~> 1.4)
177
+ standard
178
+ terminal-table
179
+
180
+ BUNDLED WITH
181
+ 2.4.6
@@ -65,7 +65,7 @@ module Panko
65
65
  end
66
66
 
67
67
  def method_added(method)
68
- super(method)
68
+ super
69
69
 
70
70
  return if @_descriptor.nil?
71
71
 
data/lib/panko/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Panko
4
- VERSION = "0.8.1"
4
+ VERSION = "0.8.2"
5
5
  end
@@ -32,4 +32,5 @@ Gem::Specification.new do |spec|
32
32
 
33
33
  spec.add_dependency "oj", "> 3.11.0", "< 4.0.0"
34
34
  spec.add_dependency "activesupport"
35
+ spec.add_development_dependency "appraisal"
35
36
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: panko_serializer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yosi Attias
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-10 00:00:00.000000000 Z
11
+ date: 2024-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oj
@@ -44,6 +44,20 @@ dependencies:
44
44
  - - ">="
45
45
  - !ruby/object:Gem::Version
46
46
  version: '0'
47
+ - !ruby/object:Gem::Dependency
48
+ name: appraisal
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
47
61
  description:
48
62
  email:
49
63
  - yosy101@gmail.com
@@ -60,6 +74,7 @@ files:
60
74
  - ".rspec"
61
75
  - ".rubocop.yml"
62
76
  - ".standard.yml"
77
+ - Appraisals
63
78
  - Gemfile
64
79
  - LICENSE.txt
65
80
  - README.md
@@ -135,6 +150,12 @@ files:
135
150
  - ext/panko_serializer/serialization_descriptor/attribute.h
136
151
  - ext/panko_serializer/serialization_descriptor/serialization_descriptor.c
137
152
  - ext/panko_serializer/serialization_descriptor/serialization_descriptor.h
153
+ - gemfiles/6.1.0.gemfile
154
+ - gemfiles/6.1.0.gemfile.lock
155
+ - gemfiles/7.0.0.gemfile
156
+ - gemfiles/7.0.0.gemfile.lock
157
+ - gemfiles/7.1.0.gemfile
158
+ - gemfiles/7.1.0.gemfile.lock
138
159
  - lib/panko/array_serializer.rb
139
160
  - lib/panko/association.rb
140
161
  - lib/panko/attribute.rb
@@ -169,7 +190,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
169
190
  - !ruby/object:Gem::Version
170
191
  version: '0'
171
192
  requirements: []
172
- rubygems_version: 3.4.19
193
+ rubygems_version: 3.5.9
173
194
  signing_key:
174
195
  specification_version: 4
175
196
  summary: High Performance JSON Serialization for ActiveRecord & Ruby Objects