camille 0.5.12 → 0.5.14

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 321511ba40eb05246be9d567a74ac7c753287088b22e282207d6affe5cd2c7b6
4
- data.tar.gz: 4f7bec2b9a36f8dec419131cbbd1a98e3d4735f20155320b2419e6e2fe6600e4
3
+ metadata.gz: f2c6dd8d04bd084f86bdfb6dc20b8e7272f3bea5f041c39ff5c48f07c1d8184b
4
+ data.tar.gz: 7feb388c52715c48fc602bcc58274a9e667c6ac59290d8c3c7b52ff928def0d1
5
5
  SHA512:
6
- metadata.gz: 676055618b2b681f821b3a2d0fa87bf0f60f52e0416aad2dbdbc51eb4186bd19c699f4a121265cba56d5a1128f241f1e9f3bd32a9d1779dca58cc902b888fd71
7
- data.tar.gz: e6545da7d1c98881b0fac58802b16c2a50ad2447039b9802d3617caf5f89d3ce68e67aaa2871f338b636fc463fb813f21ef1a040d13f5f43e70bf9ee890e2b29
6
+ metadata.gz: 6d2e64d5caa85962f42f04d19b9bec5b7573166616b415f899a69e1752698f10d85961ac270c6397f78377d635904dad884fa62135c58c9c8060e0e5a57a4d0a
7
+ data.tar.gz: c6920ed8114a4807c837e8deeb813653ccb20efc44fe246cae3139d09068f16497d3ff378d97282207a6f21df7837fdf668a9ccf44d1c918cb9e4d144caec55b
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.5.14
4
+
5
+ ### Fixed
6
+
7
+ * Fixed support for `render json: false`
8
+
9
+ ## 0.5.13
10
+
11
+ ### Fixed
12
+
13
+ * Fixed that `Omit` and `Pick` did not preserve optional fields
14
+
3
15
  ## 0.5.12
4
16
 
5
17
  ### Added
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- camille (0.5.12)
4
+ camille (0.5.13)
5
5
  rails (>= 6.1, < 8)
6
6
 
7
7
  GEM
@@ -75,11 +75,11 @@ GEM
75
75
  builder (3.2.4)
76
76
  concurrent-ruby (1.2.2)
77
77
  crass (1.0.6)
78
- date (3.3.3)
78
+ date (3.3.4)
79
79
  diff-lcs (1.5.0)
80
80
  erubi (1.12.0)
81
- globalid (1.1.0)
82
- activesupport (>= 5.0)
81
+ globalid (1.2.1)
82
+ activesupport (>= 6.1)
83
83
  i18n (1.12.0)
84
84
  concurrent-ruby (~> 1.0)
85
85
  loofah (2.19.1)
@@ -92,18 +92,18 @@ GEM
92
92
  net-smtp
93
93
  marcel (1.0.2)
94
94
  method_source (1.0.0)
95
- mini_mime (1.1.2)
95
+ mini_mime (1.1.5)
96
96
  minitest (5.17.0)
97
- net-imap (0.3.4)
97
+ net-imap (0.4.7)
98
98
  date
99
99
  net-protocol
100
100
  net-pop (0.1.2)
101
101
  net-protocol
102
- net-protocol (0.2.1)
102
+ net-protocol (0.2.2)
103
103
  timeout
104
- net-smtp (0.3.3)
104
+ net-smtp (0.4.0)
105
105
  net-protocol
106
- nio4r (2.5.9)
106
+ nio4r (2.6.1)
107
107
  nokogiri (1.14.2-x86_64-linux)
108
108
  racc (~> 1.4)
109
109
  racc (1.6.2)
@@ -159,10 +159,10 @@ GEM
159
159
  rspec-support (~> 3.11)
160
160
  rspec-support (3.12.0)
161
161
  thor (1.2.1)
162
- timeout (0.3.2)
162
+ timeout (0.4.1)
163
163
  tzinfo (2.0.6)
164
164
  concurrent-ruby (~> 1.0)
165
- websocket-driver (0.7.5)
165
+ websocket-driver (0.7.6)
166
166
  websocket-extensions (>= 0.1.0)
167
167
  websocket-extensions (0.1.5)
168
168
  zeitwerk (2.6.7)
@@ -17,7 +17,8 @@ module Camille
17
17
  render_options = args.last
18
18
  intended_status = render_options[:status] || 200
19
19
  if intended_status == 200 || intended_status == :ok
20
- if value = render_options[:json]
20
+ if render_options.has_key? :json
21
+ value = render_options[:json]
21
22
  error, transformed = endpoint.response_type.transform_and_check(value)
22
23
  if error
23
24
  string_io = StringIO.new
@@ -2,7 +2,7 @@ module Camille
2
2
  module Types
3
3
  class Object < Camille::BasicType
4
4
  class ArgumentError < ::ArgumentError; end
5
- attr_reader :fields
5
+ attr_reader :fields, :optional_keys
6
6
 
7
7
  def initialize fields
8
8
  @optional_keys = []
@@ -12,6 +12,13 @@ module Camille
12
12
 
13
13
  def processed_object
14
14
  fields = @target_object.fields.reject{|k, _| @keys.include?(k)}
15
+ fields.transform_keys! do |k,_|
16
+ if @target_object.optional_keys.include?(k)
17
+ "#{k}?".to_sym
18
+ else
19
+ k
20
+ end
21
+ end
15
22
  Camille::Types::Object.new(fields)
16
23
  end
17
24
 
@@ -12,6 +12,13 @@ module Camille
12
12
 
13
13
  def processed_object
14
14
  fields = @target_object.fields.select{|k, _| @keys.include?(k)}
15
+ fields.transform_keys! do |k,_|
16
+ if @target_object.optional_keys.include?(k)
17
+ "#{k}?".to_sym
18
+ else
19
+ k
20
+ end
21
+ end
15
22
  Camille::Types::Object.new(fields)
16
23
  end
17
24
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Camille
4
- VERSION = "0.5.12"
4
+ VERSION = "0.5.14"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: camille
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.12
4
+ version: 0.5.14
5
5
  platform: ruby
6
6
  authors:
7
- - 辻彩
7
+ - Alyssa
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-06-13 00:00:00.000000000 Z
11
+ date: 2024-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '8'
33
33
  description: ''
34
34
  email:
35
- - cichol@live.cn
35
+ - git@alyssa.fm
36
36
  executables: []
37
37
  extensions: []
38
38
  extra_rdoc_files: []