rack-app 9.0.0 → 11.0.0

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: d6895f4a62b9e5714c7f31f100ffdd705dfb3af6d4e73f823b99fca71526602f
4
- data.tar.gz: 8377e012c98cc1010ffb9af5cca8ae46d79d9bb4dd8ad80799eb2e02fef2aff9
3
+ metadata.gz: 34010813828ea95f84bf7fb0958b0d2e8912e246891e8bbf46e7af1bea541f84
4
+ data.tar.gz: '0356991e9ef33ff15deb572465913d9dde5bf89a877e7895be02e00f0b28d90a'
5
5
  SHA512:
6
- metadata.gz: 21c9910e0cea0f738cab34e536cd9c180ef29f611ceaa54cb1909feddb6e0749ad6791bec4ef2a97d17d5da2267d28371773d77e70b4c8c813d79ac776bc836b
7
- data.tar.gz: 2ad9151b5b2570acab5b52631ec8298ac48182fc4869075ba30a42f706f666f5580143fb3fbae7332145431cee1d08e2df87538df46337f96ce1699c7a88be83
6
+ metadata.gz: 134584de369514bf63204d4700e0f0a79a316fa2b446cc29c3f6ed81484dbdda4babb9d7fd9da53e2d40bede390673ed77319e466c7ba8e67a64beb436117a6e
7
+ data.tar.gz: 59ed4ddd0c05094f5b608bdb6f237b9d0a80c194b13b4405d9e9482ed75f2f323f9b249564c8556cb31287b0afcb14ea95cab6e93a8b43ad8ed76c7890f6733a
data/VERSION CHANGED
@@ -1 +1 @@
1
- 9.0.0
1
+ 11.0.0
@@ -45,7 +45,7 @@ module Rack::App::Constants
45
45
  SERIALIZER = 'rack-app.serializer'.freeze
46
46
  CONTENT_TYPE = 'CONTENT_TYPE'.freeze
47
47
 
48
- PARAMS_GETTER = 'rack-app.params.getter'
48
+ PARAMS_GETTER = 'rack-app.params.getter'.freeze
49
49
  PARAMS = 'rack-app.params.object'.freeze
50
50
 
51
51
  MERGED_PARAMS = 'rack-app.params.merged'.freeze
@@ -1,10 +1,9 @@
1
1
  module Rack::App::InstanceMethods::HTTPStatus
2
2
 
3
- def http_status!(code, desc=nil)
3
+ def http_status!(code, body=nil)
4
4
  raise unless code.is_a?(Integer)
5
5
  response.status = code
6
- response.write(desc || Rack::App::Constants::HTTP_STATUS_CODES[code] || raise)
7
- finish!
6
+ respond_with(body || Rack::App::Constants::HTTP_STATUS_CODES[code] || raise)
8
7
  end
9
8
 
10
9
  end
@@ -24,7 +24,7 @@ class Rack::App::Middlewares::Configuration
24
24
  protected
25
25
 
26
26
  def setup_handler(env)
27
- request = ::Rack::Request.new(env)
27
+ request = ::Rack::App::Request.new(env)
28
28
  response = ::Rack::Response.new
29
29
  h = @handler_class.new
30
30
  h.env = env
@@ -0,0 +1,16 @@
1
+ require "rack/request"
2
+ class Rack::App::Request < ::Rack::Request
3
+
4
+ def params
5
+ @env[::Rack::App::Constants::ENV::PARAMS].to_hash
6
+ end
7
+
8
+ def path_segments_params
9
+ @env[::Rack::App::Constants::ENV::PARAMS].path_segments_params
10
+ end
11
+
12
+ def query_string_params
13
+ @env[::Rack::App::Constants::ENV::PARAMS].query_string_params
14
+ end
15
+
16
+ end
data/lib/rack/app.rb CHANGED
@@ -15,6 +15,7 @@ class Rack::App
15
15
  require 'rack/app/logger'
16
16
  require 'rack/app/params'
17
17
  require 'rack/app/router'
18
+ require 'rack/app/request'
18
19
  require 'rack/app/payload'
19
20
  require 'rack/app/handlers'
20
21
  require 'rack/app/endpoint'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-app
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.0.0
4
+ version: 11.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Luzsi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-06 00:00:00.000000000 Z
11
+ date: 2023-09-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -155,6 +155,7 @@ files:
155
155
  - lib/rack/app/payload/parser.rb
156
156
  - lib/rack/app/payload/parser/builder.rb
157
157
  - lib/rack/app/payload/parser/builder/formats.rb
158
+ - lib/rack/app/request.rb
158
159
  - lib/rack/app/request_configurator.rb
159
160
  - lib/rack/app/request_stream.rb
160
161
  - lib/rack/app/router.rb