panko_serializer 0.7.2 → 0.7.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -1
  3. data/.travis.yml +3 -3
  4. data/README.md +4 -4
  5. data/benchmarks/bm_panko_json.rb +5 -1
  6. data/benchmarks/setup.rb +3 -1
  7. data/benchmarks/type_casts/bm_panko.rb +2 -2
  8. data/docs/.DS_Store +0 -0
  9. data/docs/README.md +195 -8
  10. data/docs/core/Footer.js +81 -0
  11. data/docs/{associations.md → docs/associations.md} +5 -1
  12. data/docs/{attributes.md → docs/attributes.md} +6 -2
  13. data/docs/{design-choices.md → docs/design-choices.md} +5 -1
  14. data/docs/{getting-started.md → docs/getting-started.md} +5 -1
  15. data/docs/docs/introduction.md +13 -0
  16. data/docs/{docpress.json → docs/panko/docpress.json} +0 -0
  17. data/docs/{performance.md → docs/performance.md} +11 -7
  18. data/docs/{response-bag.md → docs/response-bag.md} +5 -1
  19. data/docs/i18n/en.json +50 -0
  20. data/docs/package-lock.json +9636 -0
  21. data/docs/package.json +14 -0
  22. data/docs/sidebars.json +15 -0
  23. data/docs/siteConfig.js +79 -0
  24. data/docs/static/.DS_Store +0 -0
  25. data/docs/static/css/custom.css +51 -0
  26. data/docs/static/img/favicon.ico +0 -0
  27. data/docs/static/img/oss_logo.png +0 -0
  28. data/docs/static/img/undraw_code_review.svg +1 -0
  29. data/docs/static/img/undraw_monitor.svg +1 -0
  30. data/docs/static/img/undraw_note_list.svg +1 -0
  31. data/docs/static/img/undraw_online.svg +1 -0
  32. data/docs/static/img/undraw_open_source.svg +1 -0
  33. data/docs/static/img/undraw_operating_system.svg +1 -0
  34. data/docs/static/img/undraw_react.svg +1 -0
  35. data/docs/static/img/undraw_tweetstorm.svg +1 -0
  36. data/docs/static/img/undraw_youtube_tutorial.svg +1 -0
  37. data/docs/static/index.html +14 -0
  38. data/ext/panko_serializer/attributes_writer/active_record.c +6 -5
  39. data/ext/panko_serializer/attributes_writer/common.h +1 -1
  40. data/ext/panko_serializer/attributes_writer/hash.c +2 -4
  41. data/ext/panko_serializer/attributes_writer/plain.c +2 -3
  42. data/ext/panko_serializer/attributes_writer/type_cast/type_cast.c +54 -21
  43. data/ext/panko_serializer/attributes_writer/type_cast/type_cast.h +1 -2
  44. data/ext/panko_serializer/panko_serializer.c +15 -7
  45. data/lib/panko/object_writer.rb +8 -0
  46. data/lib/panko/version.rb +1 -1
  47. metadata +31 -9
@@ -33,6 +33,14 @@ class Panko::ObjectWriter
33
33
  @values.last[key] = value.as_json
34
34
  end
35
35
 
36
+ def push_json(value, key = nil)
37
+ if value.is_a?(String)
38
+ value = Oj.load(value) rescue nil
39
+ end
40
+
41
+ push_value(value, key)
42
+ end
43
+
36
44
  def pop
37
45
  result = @values.pop
38
46
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Panko
4
- VERSION = "0.7.2"
4
+ VERSION = "0.7.3"
5
5
  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.7.2
4
+ version: 0.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yosi Attias
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-13 00:00:00.000000000 Z
11
+ date: 2020-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oj
@@ -59,14 +59,36 @@ files:
59
59
  - benchmarks/type_casts/bm_active_record.rb
60
60
  - benchmarks/type_casts/bm_panko.rb
61
61
  - benchmarks/type_casts/support.rb
62
+ - docs/.DS_Store
62
63
  - docs/README.md
63
- - docs/associations.md
64
- - docs/attributes.md
65
- - docs/design-choices.md
66
- - docs/docpress.json
67
- - docs/getting-started.md
68
- - docs/performance.md
69
- - docs/response-bag.md
64
+ - docs/core/Footer.js
65
+ - docs/docs/associations.md
66
+ - docs/docs/attributes.md
67
+ - docs/docs/design-choices.md
68
+ - docs/docs/getting-started.md
69
+ - docs/docs/introduction.md
70
+ - docs/docs/panko/docpress.json
71
+ - docs/docs/performance.md
72
+ - docs/docs/response-bag.md
73
+ - docs/i18n/en.json
74
+ - docs/package-lock.json
75
+ - docs/package.json
76
+ - docs/sidebars.json
77
+ - docs/siteConfig.js
78
+ - docs/static/.DS_Store
79
+ - docs/static/css/custom.css
80
+ - docs/static/img/favicon.ico
81
+ - docs/static/img/oss_logo.png
82
+ - docs/static/img/undraw_code_review.svg
83
+ - docs/static/img/undraw_monitor.svg
84
+ - docs/static/img/undraw_note_list.svg
85
+ - docs/static/img/undraw_online.svg
86
+ - docs/static/img/undraw_open_source.svg
87
+ - docs/static/img/undraw_operating_system.svg
88
+ - docs/static/img/undraw_react.svg
89
+ - docs/static/img/undraw_tweetstorm.svg
90
+ - docs/static/img/undraw_youtube_tutorial.svg
91
+ - docs/static/index.html
70
92
  - ext/panko_serializer/attributes_writer/active_record.c
71
93
  - ext/panko_serializer/attributes_writer/active_record.h
72
94
  - ext/panko_serializer/attributes_writer/attributes_writer.c