ru.Bee 2.5.1 → 2.5.3

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: 47aeb2d5c2977b5a43aa3e316548b391ded4310aa5687fc41ccc6526fbf72320
4
- data.tar.gz: 5b913ab15c67a441e494d5fa79f693e7a4985b787c6fd71dd0655a3e0ed2045c
3
+ metadata.gz: b2980ab80a3e09b743f886ebca2979a25d9fe83e80c896563bd85b44117d89cc
4
+ data.tar.gz: 17712faa18a1411215ed677a8e866dd4d7db75859a0b6b3824b697b2fc2d246f
5
5
  SHA512:
6
- metadata.gz: e6c6c022f4427f76b1e6a68caed12382f2881205fc1e90331e1722d97947b92539dfecb0cbb4210b72fb388a5cb2afd3a4646767ea6ec1464c4ba8b2f8217977
7
- data.tar.gz: '0905fe0144ac5cdb68214afd2dfcb89b60e22a8728fce5e0b910857428fda4be9bd9c8ac062c84bc1b9329cf38316c9234b7672b22d6d52f04d6d1f7bc86e70a'
6
+ metadata.gz: 20f33eca0c8fd727828d7543932cdc353e7cd9ee8e01348569eaa7d58c53fd8c6fe9a6384df50c668514bcd2488ada08f55820406047a365199ed7317b590d2b
7
+ data.tar.gz: 9537d25178c47e96fed39badbf50f36eabd30ab387800004f8a47992980e627225c49e82f5b229ddd4e379d1b77959baa8210098e8347ffe2ecfefe0f33b2688
data/lib/db/test.db CHANGED
Binary file
@@ -113,12 +113,10 @@ module Rubee
113
113
  end
114
114
 
115
115
  def params
116
- # Read raw input safely (only once)
117
- raw_input = @request.body.read.to_s.strip
116
+ raw_input = @request.body&.read&.to_s&.strip
118
117
  @request.body.rewind if @request.body.respond_to?(:rewind)
119
118
 
120
- # Try parsing JSON first, fall back to form-encoded data
121
- parsed_input =
119
+ parsed_input = if raw_input
122
120
  begin
123
121
  JSON.parse(raw_input)
124
122
  rescue StandardError
@@ -128,6 +126,9 @@ module Rubee
128
126
  {}
129
127
  end
130
128
  end
129
+ else
130
+ {}
131
+ end
131
132
 
132
133
  # Combine route params, request params, and body
133
134
  @params ||= extract_params(@request.path, @route[:path])
@@ -21,7 +21,13 @@ module Rubee
21
21
  def to_h
22
22
  instance_variables.each_with_object({}) do |var, hash|
23
23
  attr_name = var.to_s.delete('@')
24
- hash[attr_name] = instance_variable_get(var) unless attr_name.start_with?('__')
24
+ next if attr_name.start_with?('__')
25
+ instance_var = instance_variable_get(var)
26
+ hash[attr_name] = if instance_var.respond_to?(:to_h)
27
+ instance_var.to_h
28
+ else
29
+ instance_variable_get(var)
30
+ end
25
31
  end
26
32
  end
27
33
  end
data/lib/rubee.rb CHANGED
@@ -20,7 +20,7 @@ module Rubee
20
20
  RUBEE_SUPPORT = { "Rubee::Support::Hash" => Hash, "Rubee::Support::String" => String }
21
21
  end
22
22
 
23
- VERSION = '2.5.1'
23
+ VERSION = '2.5.3'
24
24
 
25
25
  require_relative 'rubee/router'
26
26
  require_relative 'rubee/logger'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ru.Bee
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.1
4
+ version: 2.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oleg Saltykov