panko_serializer 0.8.4 → 1.0.0

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.
Files changed (144) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +8 -6
  3. data/lib/panko/array_serializer.rb +55 -16
  4. data/lib/panko/code_gen/active_record/access_classifier.rb +65 -0
  5. data/lib/panko/code_gen/active_record/define_attribute_methods.rb +13 -0
  6. data/lib/panko/code_gen/code_builder.rb +32 -0
  7. data/lib/panko/code_gen/compile_cache.rb +28 -0
  8. data/lib/panko/code_gen/compiler.rb +56 -0
  9. data/lib/panko/code_gen/config.rb +79 -0
  10. data/lib/panko/code_gen/datetime_format.rb +38 -0
  11. data/lib/panko/code_gen/descriptor.rb +136 -0
  12. data/lib/panko/code_gen/descriptor_builder.rb +166 -0
  13. data/lib/panko/code_gen/dump.rb +52 -0
  14. data/lib/panko/code_gen/errors.rb +21 -0
  15. data/lib/panko/code_gen/filter.rb +29 -0
  16. data/lib/panko/code_gen/filter_adapter.rb +44 -0
  17. data/lib/panko/code_gen/filters/indexed.rb +62 -0
  18. data/lib/panko/code_gen/filters/none.rb +19 -0
  19. data/lib/panko/code_gen/generator.rb +23 -0
  20. data/lib/panko/code_gen/generators/banner.rb +27 -0
  21. data/lib/panko/code_gen/generators/class_emitter.rb +120 -0
  22. data/lib/panko/code_gen/generators/cycle_membership.rb +53 -0
  23. data/lib/panko/code_gen/generators/descriptor_walk.rb +22 -0
  24. data/lib/panko/code_gen/generators/fanout.rb +60 -0
  25. data/lib/panko/code_gen/generators/field_index.rb +31 -0
  26. data/lib/panko/code_gen/generators/field_walk.rb +38 -0
  27. data/lib/panko/code_gen/generators/generated_names.rb +73 -0
  28. data/lib/panko/code_gen/generators/hash_sink.rb +217 -0
  29. data/lib/panko/code_gen/generators/json_sink.rb +290 -0
  30. data/lib/panko/code_gen/generators/record_access/generic.rb +92 -0
  31. data/lib/panko/code_gen/generators/record_access/specialized.rb +90 -0
  32. data/lib/panko/code_gen/generators/release.rb +60 -0
  33. data/lib/panko/code_gen/generators/sink.rb +80 -0
  34. data/lib/panko/code_gen/instance_pool.rb +27 -0
  35. data/lib/panko/code_gen/runtime.rb +27 -0
  36. data/lib/panko/code_gen/serializer_cache.rb +242 -0
  37. data/lib/panko/code_gen/validators/callable_arity.rb +42 -0
  38. data/lib/panko/code_gen/validators/name_uniqueness.rb +44 -0
  39. data/lib/panko/code_gen/validators/source_resolution.rb +48 -0
  40. data/lib/panko/code_gen/validators/validator.rb +19 -0
  41. data/lib/panko/code_gen/writers_pool.rb +51 -0
  42. data/lib/panko/code_gen.rb +82 -0
  43. data/lib/panko/compile_all.rb +80 -0
  44. data/lib/panko/compile_all_result.rb +21 -0
  45. data/lib/panko/config.rb +71 -0
  46. data/lib/panko/descriptor.rb +93 -0
  47. data/lib/panko/response.rb +40 -8
  48. data/lib/panko/serializer.rb +175 -91
  49. data/lib/panko/serializer_resolver.rb +2 -8
  50. data/lib/panko/version.rb +1 -1
  51. data/lib/panko_serializer.rb +3 -5
  52. metadata +49 -99
  53. data/.clang-format +0 -3
  54. data/.github/dependabot.yml +0 -6
  55. data/.github/workflows/database_matrix.yml +0 -85
  56. data/.github/workflows/docs.yml +0 -39
  57. data/.github/workflows/lint.yml +0 -30
  58. data/.github/workflows/tests.yml +0 -34
  59. data/.gitignore +0 -20
  60. data/.rspec +0 -2
  61. data/.rubocop.yml +0 -37
  62. data/Appraisals +0 -28
  63. data/Gemfile +0 -37
  64. data/Rakefile +0 -93
  65. data/benchmarks/BENCHMARKS.md +0 -48
  66. data/benchmarks/allocs.rb +0 -23
  67. data/benchmarks/app.rb +0 -11
  68. data/benchmarks/benchmarking_support.rb +0 -44
  69. data/benchmarks/bm_ams_0_10.rb +0 -43
  70. data/benchmarks/bm_object_writer.rb +0 -65
  71. data/benchmarks/bm_panko_json.rb +0 -60
  72. data/benchmarks/bm_panko_object.rb +0 -46
  73. data/benchmarks/bm_plain_object.rb +0 -99
  74. data/benchmarks/bm_serialization_descriptor.rb +0 -76
  75. data/benchmarks/bm_serializer_resolver.rb +0 -22
  76. data/benchmarks/bm_to_object.rb +0 -81
  77. data/benchmarks/profile.rb +0 -86
  78. data/benchmarks/sanity.rb +0 -83
  79. data/benchmarks/setup.rb +0 -56
  80. data/benchmarks/type_casts/bm_active_record.rb +0 -58
  81. data/benchmarks/type_casts/bm_panko.rb +0 -65
  82. data/benchmarks/type_casts/support.rb +0 -27
  83. data/docs/docs/associations.md +0 -107
  84. data/docs/docs/attributes.md +0 -150
  85. data/docs/docs/design-choices.md +0 -127
  86. data/docs/docs/getting-started.md +0 -70
  87. data/docs/docs/introduction.md +0 -13
  88. data/docs/docs/performance.md +0 -32
  89. data/docs/docs/response-bag.md +0 -83
  90. data/docs/docusaurus.config.js +0 -86
  91. data/docs/package-lock.json +0 -17872
  92. data/docs/package.json +0 -18
  93. data/docs/sidebars.json +0 -15
  94. data/docs/src/css/customTheme.css +0 -9
  95. data/docs/static/.DS_Store +0 -0
  96. data/docs/static/CNAME +0 -1
  97. data/docs/static/css/custom.css +0 -51
  98. data/docs/static/img/favicon.ico +0 -0
  99. data/docs/static/img/oss_logo.png +0 -0
  100. data/docs/static/img/undraw_code_review.svg +0 -1
  101. data/docs/static/img/undraw_monitor.svg +0 -1
  102. data/docs/static/img/undraw_note_list.svg +0 -1
  103. data/docs/static/img/undraw_online.svg +0 -1
  104. data/docs/static/img/undraw_open_source.svg +0 -1
  105. data/docs/static/img/undraw_operating_system.svg +0 -1
  106. data/docs/static/img/undraw_react.svg +0 -1
  107. data/docs/static/img/undraw_tweetstorm.svg +0 -1
  108. data/docs/static/img/undraw_youtube_tutorial.svg +0 -1
  109. data/docs/static/index.html +0 -14
  110. data/ext/panko_serializer/attributes_writer/active_record.c +0 -181
  111. data/ext/panko_serializer/attributes_writer/active_record.h +0 -17
  112. data/ext/panko_serializer/attributes_writer/attributes_writer.c +0 -55
  113. data/ext/panko_serializer/attributes_writer/attributes_writer.h +0 -35
  114. data/ext/panko_serializer/attributes_writer/common.c +0 -10
  115. data/ext/panko_serializer/attributes_writer/common.h +0 -9
  116. data/ext/panko_serializer/attributes_writer/hash.c +0 -13
  117. data/ext/panko_serializer/attributes_writer/hash.h +0 -7
  118. data/ext/panko_serializer/attributes_writer/plain.c +0 -13
  119. data/ext/panko_serializer/attributes_writer/plain.h +0 -7
  120. data/ext/panko_serializer/attributes_writer/type_cast/time_conversion.c +0 -156
  121. data/ext/panko_serializer/attributes_writer/type_cast/time_conversion.h +0 -10
  122. data/ext/panko_serializer/attributes_writer/type_cast/type_cast.c +0 -398
  123. data/ext/panko_serializer/attributes_writer/type_cast/type_cast.h +0 -81
  124. data/ext/panko_serializer/common.h +0 -9
  125. data/ext/panko_serializer/extconf.rb +0 -28
  126. data/ext/panko_serializer/panko_serializer.c +0 -181
  127. data/ext/panko_serializer/panko_serializer.h +0 -12
  128. data/ext/panko_serializer/serialization_descriptor/association.c +0 -90
  129. data/ext/panko_serializer/serialization_descriptor/association.h +0 -20
  130. data/ext/panko_serializer/serialization_descriptor/attribute.c +0 -96
  131. data/ext/panko_serializer/serialization_descriptor/attribute.h +0 -27
  132. data/ext/panko_serializer/serialization_descriptor/serialization_descriptor.c +0 -177
  133. data/ext/panko_serializer/serialization_descriptor/serialization_descriptor.h +0 -30
  134. data/gemfiles/7.2.0.gemfile +0 -41
  135. data/gemfiles/7.2.0.gemfile.lock +0 -221
  136. data/gemfiles/8.0.0.gemfile +0 -41
  137. data/gemfiles/8.0.0.gemfile.lock +0 -239
  138. data/gemfiles/8.1.0.gemfile +0 -41
  139. data/gemfiles/8.1.0.gemfile.lock +0 -248
  140. data/lib/panko/association.rb +0 -17
  141. data/lib/panko/attribute.rb +0 -29
  142. data/lib/panko/object_writer.rb +0 -68
  143. data/lib/panko/serialization_descriptor.rb +0 -180
  144. data/panko_serializer.gemspec +0 -36
@@ -1,90 +0,0 @@
1
- #include "association.h"
2
-
3
- VALUE cAssociation;
4
-
5
- static void association_free(void* ptr) {
6
- if (!ptr) {
7
- return;
8
- }
9
-
10
- Association association = (Association)ptr;
11
- association->name_str = Qnil;
12
- association->name_id = 0;
13
- association->name_sym = Qnil;
14
- association->rb_descriptor = Qnil;
15
-
16
- if (!association->descriptor || association->descriptor != NULL) {
17
- association->descriptor = NULL;
18
- }
19
-
20
- xfree(association);
21
- }
22
-
23
- void association_mark(Association data) {
24
- rb_gc_mark(data->name_str);
25
- rb_gc_mark(data->name_sym);
26
- rb_gc_mark(data->rb_descriptor);
27
-
28
- if (data->descriptor != NULL) {
29
- sd_mark(data->descriptor);
30
- }
31
- }
32
-
33
- static VALUE association_new(int argc, VALUE* argv, VALUE self) {
34
- Association association;
35
-
36
- Check_Type(argv[0], T_SYMBOL);
37
- Check_Type(argv[1], T_STRING);
38
-
39
- association = ALLOC(struct _Association);
40
- association->name_sym = argv[0];
41
- association->name_str = argv[1];
42
- association->rb_descriptor = argv[2];
43
-
44
- association->name_id = rb_intern_str(rb_sym2str(association->name_sym));
45
- association->descriptor = sd_read(association->rb_descriptor);
46
-
47
- return Data_Wrap_Struct(cAssociation, association_mark, association_free,
48
- association);
49
- }
50
-
51
- Association association_read(VALUE association) {
52
- return (Association)DATA_PTR(association);
53
- }
54
-
55
- VALUE association_name_sym_ref(VALUE self) {
56
- Association association = (Association)DATA_PTR(self);
57
- return association->name_sym;
58
- }
59
-
60
- VALUE association_name_str_ref(VALUE self) {
61
- Association association = (Association)DATA_PTR(self);
62
- return association->name_str;
63
- }
64
-
65
- VALUE association_descriptor_ref(VALUE self) {
66
- Association association = (Association)DATA_PTR(self);
67
- return association->rb_descriptor;
68
- }
69
-
70
- VALUE association_decriptor_aset(VALUE self, VALUE descriptor) {
71
- Association association = (Association)DATA_PTR(self);
72
-
73
- association->rb_descriptor = descriptor;
74
- association->descriptor = sd_read(descriptor);
75
-
76
- return association->rb_descriptor;
77
- }
78
-
79
- void panko_init_association(VALUE mPanko) {
80
- cAssociation = rb_define_class_under(mPanko, "Association", rb_cObject);
81
- rb_undef_alloc_func(cAssociation);
82
- rb_global_variable(&cAssociation);
83
-
84
- rb_define_module_function(cAssociation, "new", association_new, -1);
85
-
86
- rb_define_method(cAssociation, "name_sym", association_name_sym_ref, 0);
87
- rb_define_method(cAssociation, "name_str", association_name_str_ref, 0);
88
- rb_define_method(cAssociation, "descriptor", association_descriptor_ref, 0);
89
- rb_define_method(cAssociation, "descriptor=", association_decriptor_aset, 1);
90
- }
@@ -1,20 +0,0 @@
1
- #include <ruby.h>
2
-
3
- #ifndef __ASSOCIATION_H__
4
- #define __ASSOCIATION_H__
5
-
6
- #include "serialization_descriptor.h"
7
-
8
- typedef struct _Association {
9
- ID name_id;
10
- VALUE name_sym;
11
- VALUE name_str;
12
-
13
- VALUE rb_descriptor;
14
- SerializationDescriptor descriptor;
15
- }* Association;
16
-
17
- Association association_read(VALUE association);
18
- void panko_init_association(VALUE mPanko);
19
-
20
- #endif
@@ -1,96 +0,0 @@
1
- #include "attribute.h"
2
-
3
- ID attribute_aliases_id = 0;
4
- VALUE cAttribute;
5
-
6
- static void attribute_free(void* ptr) {
7
- if (!ptr) {
8
- return;
9
- }
10
-
11
- Attribute attribute = (Attribute)ptr;
12
- attribute->name_str = Qnil;
13
- attribute->name_id = 0;
14
- attribute->alias_name = Qnil;
15
- attribute->type = Qnil;
16
- attribute->record_class = Qnil;
17
-
18
- xfree(attribute);
19
- }
20
-
21
- void attribute_mark(Attribute data) {
22
- rb_gc_mark(data->name_str);
23
- rb_gc_mark(data->alias_name);
24
- rb_gc_mark(data->type);
25
- rb_gc_mark(data->record_class);
26
- }
27
-
28
- static VALUE attribute_new(int argc, VALUE* argv, VALUE self) {
29
- Attribute attribute;
30
-
31
- Check_Type(argv[0], T_STRING);
32
- if (argv[1] != Qnil) {
33
- Check_Type(argv[1], T_STRING);
34
- }
35
-
36
- attribute = ALLOC(struct _Attribute);
37
- attribute->name_str = argv[0];
38
- attribute->name_id = rb_intern_str(attribute->name_str);
39
- attribute->alias_name = argv[1];
40
- attribute->type = Qnil;
41
- attribute->record_class = Qnil;
42
-
43
- return Data_Wrap_Struct(cAttribute, attribute_mark, attribute_free,
44
- attribute);
45
- }
46
-
47
- Attribute attribute_read(VALUE attribute) {
48
- return (Attribute)DATA_PTR(attribute);
49
- }
50
-
51
- void attribute_try_invalidate(Attribute attribute, VALUE new_record_class) {
52
- if (attribute->record_class != new_record_class) {
53
- attribute->type = Qnil;
54
- attribute->record_class = new_record_class;
55
-
56
- // Once the record class is changed for this attribute, check if
57
- // we attribute_aliases (from ActivRecord), if so fill in
58
- // performance wise - this code should be called once (unless the serialzier
59
- // is polymorphic)
60
- volatile VALUE ar_aliases_hash =
61
- rb_funcall(new_record_class, attribute_aliases_id, 0);
62
-
63
- if (!PANKO_EMPTY_HASH(ar_aliases_hash)) {
64
- volatile VALUE aliasedValue =
65
- rb_hash_aref(ar_aliases_hash, attribute->name_str);
66
- if (aliasedValue != Qnil) {
67
- attribute->alias_name = attribute->name_str;
68
- attribute->name_str = aliasedValue;
69
- attribute->name_id = rb_intern_str(attribute->name_str);
70
- }
71
- }
72
- }
73
- }
74
-
75
- VALUE attribute_name_ref(VALUE self) {
76
- Attribute attribute = (Attribute)DATA_PTR(self);
77
- return attribute->name_str;
78
- }
79
-
80
- VALUE attribute_alias_name_ref(VALUE self) {
81
- Attribute attribute = (Attribute)DATA_PTR(self);
82
- return attribute->alias_name;
83
- }
84
-
85
- void panko_init_attribute(VALUE mPanko) {
86
- attribute_aliases_id = rb_intern("attribute_aliases");
87
-
88
- cAttribute = rb_define_class_under(mPanko, "Attribute", rb_cObject);
89
- rb_undef_alloc_func(cAttribute);
90
- rb_global_variable(&cAttribute);
91
-
92
- rb_define_module_function(cAttribute, "new", attribute_new, -1);
93
-
94
- rb_define_method(cAttribute, "name", attribute_name_ref, 0);
95
- rb_define_method(cAttribute, "alias_name", attribute_alias_name_ref, 0);
96
- }
@@ -1,27 +0,0 @@
1
- #include <ruby.h>
2
-
3
- #ifndef __ATTRIBUTE_H__
4
- #define __ATTRIBUTE_H__
5
-
6
- #include "../common.h"
7
-
8
- typedef struct _Attribute {
9
- VALUE name_str;
10
- ID name_id;
11
- VALUE alias_name;
12
-
13
- /*
14
- * We will cache the activerecord type
15
- * by the record_class
16
- */
17
- VALUE type;
18
- VALUE record_class;
19
- }* Attribute;
20
-
21
- Attribute attribute_read(VALUE attribute);
22
- void attribute_try_invalidate(Attribute attribute, VALUE new_record_class);
23
- void panko_init_attribute(VALUE mPanko);
24
-
25
- #define PANKO_ATTRIBUTE_READ(attribute) (Attribute) DATA_PTR(attribute)
26
-
27
- #endif
@@ -1,177 +0,0 @@
1
- #include "serialization_descriptor.h"
2
-
3
- static ID object_id;
4
- static ID sc_id;
5
-
6
- static void sd_free(SerializationDescriptor sd) {
7
- if (!sd) {
8
- return;
9
- }
10
-
11
- sd->serializer = Qnil;
12
- sd->serializer_type = Qnil;
13
- sd->attributes = Qnil;
14
- sd->method_fields = Qnil;
15
- sd->has_one_associations = Qnil;
16
- sd->has_many_associations = Qnil;
17
- sd->aliases = Qnil;
18
- xfree(sd);
19
- }
20
-
21
- void sd_mark(SerializationDescriptor data) {
22
- rb_gc_mark(data->serializer);
23
- rb_gc_mark(data->serializer_type);
24
- rb_gc_mark(data->attributes);
25
- rb_gc_mark(data->method_fields);
26
- rb_gc_mark(data->has_one_associations);
27
- rb_gc_mark(data->has_many_associations);
28
- rb_gc_mark(data->aliases);
29
- }
30
-
31
- static VALUE sd_alloc(VALUE klass) {
32
- SerializationDescriptor sd = ALLOC(struct _SerializationDescriptor);
33
-
34
- sd->serializer = Qnil;
35
- sd->serializer_type = Qnil;
36
- sd->attributes = Qnil;
37
- sd->method_fields = Qnil;
38
- sd->has_one_associations = Qnil;
39
- sd->has_many_associations = Qnil;
40
- sd->aliases = Qnil;
41
-
42
- sd->attributes_writer = create_empty_attributes_writer();
43
-
44
- return Data_Wrap_Struct(klass, sd_mark, sd_free, sd);
45
- }
46
-
47
- SerializationDescriptor sd_read(VALUE descriptor) {
48
- return (SerializationDescriptor)DATA_PTR(descriptor);
49
- }
50
-
51
- void sd_set_writer(SerializationDescriptor sd, VALUE object) {
52
- if (sd->attributes_writer.object_type != UnknownObjectType) {
53
- return;
54
- }
55
-
56
- sd->attributes_writer = create_attributes_writer(object);
57
- }
58
-
59
- VALUE sd_serializer_set(VALUE self, VALUE serializer) {
60
- SerializationDescriptor sd = (SerializationDescriptor)DATA_PTR(self);
61
-
62
- sd->serializer = serializer;
63
- return Qnil;
64
- }
65
-
66
- VALUE sd_serializer_ref(VALUE self) {
67
- SerializationDescriptor sd = (SerializationDescriptor)DATA_PTR(self);
68
-
69
- return sd->serializer;
70
- }
71
-
72
- VALUE sd_attributes_set(VALUE self, VALUE attributes) {
73
- SerializationDescriptor sd = (SerializationDescriptor)DATA_PTR(self);
74
-
75
- sd->attributes = attributes;
76
- return Qnil;
77
- }
78
-
79
- VALUE sd_attributes_ref(VALUE self) {
80
- SerializationDescriptor sd = (SerializationDescriptor)DATA_PTR(self);
81
- return sd->attributes;
82
- }
83
-
84
- VALUE sd_method_fields_set(VALUE self, VALUE method_fields) {
85
- SerializationDescriptor sd = (SerializationDescriptor)DATA_PTR(self);
86
- sd->method_fields = method_fields;
87
- return Qnil;
88
- }
89
-
90
- VALUE sd_method_fields_ref(VALUE self) {
91
- SerializationDescriptor sd = (SerializationDescriptor)DATA_PTR(self);
92
- return sd->method_fields;
93
- }
94
-
95
- VALUE sd_has_one_associations_set(VALUE self, VALUE has_one_associations) {
96
- SerializationDescriptor sd = (SerializationDescriptor)DATA_PTR(self);
97
- sd->has_one_associations = has_one_associations;
98
- return Qnil;
99
- }
100
-
101
- VALUE sd_has_one_associations_ref(VALUE self) {
102
- SerializationDescriptor sd = (SerializationDescriptor)DATA_PTR(self);
103
- return sd->has_one_associations;
104
- }
105
-
106
- VALUE sd_has_many_associations_set(VALUE self, VALUE has_many_associations) {
107
- SerializationDescriptor sd = (SerializationDescriptor)DATA_PTR(self);
108
- sd->has_many_associations = has_many_associations;
109
- return Qnil;
110
- }
111
-
112
- VALUE sd_has_many_associations_ref(VALUE self) {
113
- SerializationDescriptor sd = (SerializationDescriptor)DATA_PTR(self);
114
- return sd->has_many_associations;
115
- }
116
-
117
- VALUE sd_type_set(VALUE self, VALUE type) {
118
- SerializationDescriptor sd = (SerializationDescriptor)DATA_PTR(self);
119
- sd->serializer_type = type;
120
- return Qnil;
121
- }
122
-
123
- VALUE sd_type_aref(VALUE self) {
124
- SerializationDescriptor sd = (SerializationDescriptor)DATA_PTR(self);
125
- return sd->serializer_type;
126
- }
127
-
128
- VALUE sd_aliases_set(VALUE self, VALUE aliases) {
129
- SerializationDescriptor sd = (SerializationDescriptor)DATA_PTR(self);
130
- sd->aliases = aliases;
131
- return Qnil;
132
- }
133
-
134
- VALUE sd_aliases_aref(VALUE self) {
135
- SerializationDescriptor sd = (SerializationDescriptor)DATA_PTR(self);
136
- return sd->aliases;
137
- }
138
-
139
- void panko_init_serialization_descriptor(VALUE mPanko) {
140
- object_id = rb_intern("@object");
141
- sc_id = rb_intern("@sc");
142
-
143
- VALUE cSerializationDescriptor =
144
- rb_define_class_under(mPanko, "SerializationDescriptor", rb_cObject);
145
-
146
- rb_define_alloc_func(cSerializationDescriptor, sd_alloc);
147
- rb_define_method(cSerializationDescriptor, "serializer=", sd_serializer_set,
148
- 1);
149
- rb_define_method(cSerializationDescriptor, "serializer", sd_serializer_ref,
150
- 0);
151
-
152
- rb_define_method(cSerializationDescriptor, "attributes=", sd_attributes_set,
153
- 1);
154
- rb_define_method(cSerializationDescriptor, "attributes", sd_attributes_ref,
155
- 0);
156
-
157
- rb_define_method(cSerializationDescriptor,
158
- "method_fields=", sd_method_fields_set, 1);
159
- rb_define_method(cSerializationDescriptor, "method_fields",
160
- sd_method_fields_ref, 0);
161
-
162
- rb_define_method(cSerializationDescriptor,
163
- "has_one_associations=", sd_has_one_associations_set, 1);
164
- rb_define_method(cSerializationDescriptor, "has_one_associations",
165
- sd_has_one_associations_ref, 0);
166
-
167
- rb_define_method(cSerializationDescriptor,
168
- "has_many_associations=", sd_has_many_associations_set, 1);
169
- rb_define_method(cSerializationDescriptor, "has_many_associations",
170
- sd_has_many_associations_ref, 0);
171
-
172
- rb_define_method(cSerializationDescriptor, "type=", sd_type_set, 1);
173
- rb_define_method(cSerializationDescriptor, "type", sd_type_aref, 0);
174
-
175
- rb_define_method(cSerializationDescriptor, "aliases=", sd_aliases_set, 1);
176
- rb_define_method(cSerializationDescriptor, "aliases", sd_aliases_aref, 0);
177
- }
@@ -1,30 +0,0 @@
1
- #pragma once
2
-
3
- #include <ruby.h>
4
- #include <stdbool.h>
5
-
6
- #include "attributes_writer/attributes_writer.h"
7
-
8
- typedef struct _SerializationDescriptor {
9
- // type of the serializer, so we can create it later
10
- VALUE serializer_type;
11
- // Cached value of the serializer
12
- VALUE serializer;
13
-
14
- // Metadata
15
- VALUE attributes;
16
- VALUE aliases;
17
- VALUE method_fields;
18
- VALUE has_one_associations;
19
- VALUE has_many_associations;
20
-
21
- AttributesWriter attributes_writer;
22
- }* SerializationDescriptor;
23
-
24
- SerializationDescriptor sd_read(VALUE descriptor);
25
-
26
- void sd_mark(SerializationDescriptor data);
27
-
28
- void sd_set_writer(SerializationDescriptor sd, VALUE object);
29
-
30
- void panko_init_serialization_descriptor(VALUE mPanko);
@@ -1,41 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "activesupport", "~> 7.2.0"
6
- gem "activemodel", "~> 7.2.0"
7
- gem "activerecord", "~> 7.2.0", group: :test
8
- gem "trilogy"
9
- gem "sqlite3", "~> 1.4"
10
-
11
- group :benchmarks do
12
- gem "vernier"
13
- gem "stackprof"
14
- gem "pg"
15
- gem "benchmark-ips"
16
- gem "active_model_serializers", "~> 0.10"
17
- gem "terminal-table"
18
- gem "memory_profiler"
19
- end
20
-
21
- group :test do
22
- gem "faker"
23
- gem "temping"
24
- end
25
-
26
- group :development do
27
- gem "byebug"
28
- gem "rake"
29
- gem "rspec", "~> 3.0"
30
- gem "rake-compiler"
31
- end
32
-
33
- group :development, :test do
34
- gem "rubocop"
35
- gem "standard"
36
- gem "standard-performance"
37
- gem "rubocop-performance"
38
- gem "rubocop-rspec"
39
- end
40
-
41
- gemspec path: "../"
@@ -1,221 +0,0 @@
1
- PATH
2
- remote: ..
3
- specs:
4
- panko_serializer (0.8.3)
5
- activesupport
6
- oj (> 3.11.0, < 4.0.0)
7
-
8
- GEM
9
- remote: https://rubygems.org/
10
- specs:
11
- actionpack (7.2.3)
12
- actionview (= 7.2.3)
13
- activesupport (= 7.2.3)
14
- cgi
15
- nokogiri (>= 1.8.5)
16
- racc
17
- rack (>= 2.2.4, < 3.3)
18
- rack-session (>= 1.0.1)
19
- rack-test (>= 0.6.3)
20
- rails-dom-testing (~> 2.2)
21
- rails-html-sanitizer (~> 1.6)
22
- useragent (~> 0.16)
23
- actionview (7.2.3)
24
- activesupport (= 7.2.3)
25
- builder (~> 3.1)
26
- cgi
27
- erubi (~> 1.11)
28
- rails-dom-testing (~> 2.2)
29
- rails-html-sanitizer (~> 1.6)
30
- active_model_serializers (0.10.15)
31
- actionpack (>= 4.1)
32
- activemodel (>= 4.1)
33
- case_transform (>= 0.2)
34
- jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
35
- activemodel (7.2.3)
36
- activesupport (= 7.2.3)
37
- activerecord (7.2.3)
38
- activemodel (= 7.2.3)
39
- activesupport (= 7.2.3)
40
- timeout (>= 0.4.0)
41
- activesupport (7.2.3)
42
- base64
43
- benchmark (>= 0.3)
44
- bigdecimal
45
- concurrent-ruby (~> 1.0, >= 1.3.1)
46
- connection_pool (>= 2.2.5)
47
- drb
48
- i18n (>= 1.6, < 2)
49
- logger (>= 1.4.2)
50
- minitest (>= 5.1)
51
- securerandom (>= 0.3)
52
- tzinfo (~> 2.0, >= 2.0.5)
53
- appraisal (2.5.0)
54
- bundler
55
- rake
56
- thor (>= 0.14.0)
57
- ast (2.4.3)
58
- base64 (0.3.0)
59
- benchmark (0.5.0)
60
- benchmark-ips (2.14.0)
61
- bigdecimal (3.3.1)
62
- builder (3.3.0)
63
- byebug (12.0.0)
64
- case_transform (0.2)
65
- activesupport
66
- cgi (0.5.0)
67
- concurrent-ruby (1.3.5)
68
- connection_pool (2.5.4)
69
- crass (1.0.6)
70
- diff-lcs (1.6.2)
71
- drb (2.2.3)
72
- erubi (1.13.1)
73
- faker (3.5.2)
74
- i18n (>= 1.8.11, < 2)
75
- i18n (1.14.7)
76
- concurrent-ruby (~> 1.0)
77
- json (2.13.2)
78
- jsonapi-renderer (0.2.2)
79
- language_server-protocol (3.17.0.5)
80
- lint_roller (1.1.0)
81
- logger (1.7.0)
82
- loofah (2.24.1)
83
- crass (~> 1.0.2)
84
- nokogiri (>= 1.12.0)
85
- memory_profiler (1.1.0)
86
- mini_portile2 (2.8.9)
87
- minitest (5.26.2)
88
- nokogiri (1.18.9-arm64-darwin)
89
- racc (~> 1.4)
90
- nokogiri (1.18.9-x86_64-linux-gnu)
91
- racc (~> 1.4)
92
- oj (3.16.11)
93
- bigdecimal (>= 3.0)
94
- ostruct (>= 0.2)
95
- ostruct (0.6.3)
96
- parallel (1.27.0)
97
- parser (3.3.9.0)
98
- ast (~> 2.4.1)
99
- racc
100
- pg (1.6.1-arm64-darwin)
101
- pg (1.6.1-x86_64-linux)
102
- prism (1.4.0)
103
- racc (1.8.1)
104
- rack (3.1.16)
105
- rack-session (2.1.1)
106
- base64 (>= 0.1.0)
107
- rack (>= 3.0.0)
108
- rack-test (2.2.0)
109
- rack (>= 1.3)
110
- rails-dom-testing (2.3.0)
111
- activesupport (>= 5.0.0)
112
- minitest
113
- nokogiri (>= 1.6)
114
- rails-html-sanitizer (1.6.2)
115
- loofah (~> 2.21)
116
- nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
117
- rainbow (3.1.1)
118
- rake (13.3.0)
119
- rake-compiler (1.3.0)
120
- rake
121
- regexp_parser (2.11.2)
122
- rspec (3.13.1)
123
- rspec-core (~> 3.13.0)
124
- rspec-expectations (~> 3.13.0)
125
- rspec-mocks (~> 3.13.0)
126
- rspec-core (3.13.5)
127
- rspec-support (~> 3.13.0)
128
- rspec-expectations (3.13.5)
129
- diff-lcs (>= 1.2.0, < 2.0)
130
- rspec-support (~> 3.13.0)
131
- rspec-mocks (3.13.5)
132
- diff-lcs (>= 1.2.0, < 2.0)
133
- rspec-support (~> 3.13.0)
134
- rspec-support (3.13.5)
135
- rubocop (1.75.8)
136
- json (~> 2.3)
137
- language_server-protocol (~> 3.17.0.2)
138
- lint_roller (~> 1.1.0)
139
- parallel (~> 1.10)
140
- parser (>= 3.3.0.2)
141
- rainbow (>= 2.2.2, < 4.0)
142
- regexp_parser (>= 2.9.3, < 3.0)
143
- rubocop-ast (>= 1.44.0, < 2.0)
144
- ruby-progressbar (~> 1.7)
145
- unicode-display_width (>= 2.4.0, < 4.0)
146
- rubocop-ast (1.46.0)
147
- parser (>= 3.3.7.2)
148
- prism (~> 1.4)
149
- rubocop-performance (1.25.0)
150
- lint_roller (~> 1.1)
151
- rubocop (>= 1.75.0, < 2.0)
152
- rubocop-ast (>= 1.38.0, < 2.0)
153
- rubocop-rspec (3.6.0)
154
- lint_roller (~> 1.1)
155
- rubocop (~> 1.72, >= 1.72.1)
156
- ruby-progressbar (1.13.0)
157
- securerandom (0.4.1)
158
- sqlite3 (1.7.3)
159
- mini_portile2 (~> 2.8.0)
160
- stackprof (0.2.27)
161
- standard (1.50.0)
162
- language_server-protocol (~> 3.17.0.2)
163
- lint_roller (~> 1.0)
164
- rubocop (~> 1.75.5)
165
- standard-custom (~> 1.0.0)
166
- standard-performance (~> 1.8)
167
- standard-custom (1.0.2)
168
- lint_roller (~> 1.0)
169
- rubocop (~> 1.50)
170
- standard-performance (1.8.0)
171
- lint_roller (~> 1.1)
172
- rubocop-performance (~> 1.25.0)
173
- temping (4.3.0)
174
- activerecord (>= 6.0, < 8.1)
175
- activesupport (>= 6.0, < 8.1)
176
- terminal-table (4.0.0)
177
- unicode-display_width (>= 1.1.1, < 4)
178
- thor (1.4.0)
179
- timeout (0.4.4)
180
- trilogy (2.9.0)
181
- tzinfo (2.0.6)
182
- concurrent-ruby (~> 1.0)
183
- unicode-display_width (3.1.5)
184
- unicode-emoji (~> 4.0, >= 4.0.4)
185
- unicode-emoji (4.0.4)
186
- useragent (0.16.11)
187
- vernier (1.8.0)
188
-
189
- PLATFORMS
190
- arm64-darwin
191
- x86_64-linux
192
-
193
- DEPENDENCIES
194
- active_model_serializers (~> 0.10)
195
- activemodel (~> 7.2.0)
196
- activerecord (~> 7.2.0)
197
- activesupport (~> 7.2.0)
198
- appraisal
199
- benchmark-ips
200
- byebug
201
- faker
202
- memory_profiler
203
- panko_serializer!
204
- pg
205
- rake
206
- rake-compiler
207
- rspec (~> 3.0)
208
- rubocop
209
- rubocop-performance
210
- rubocop-rspec
211
- sqlite3 (~> 1.4)
212
- stackprof
213
- standard
214
- standard-performance
215
- temping
216
- terminal-table
217
- trilogy
218
- vernier
219
-
220
- BUNDLED WITH
221
- 2.7.2