qeweney 0.15 → 0.16

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: a776c09a368fd3b348a685f43dcffb40320e6d181529427f7659e56815994735
4
- data.tar.gz: 9ba936914a124c9a21923c147cf5d90b76cb6ea4dde46cbeeb558d99909a9d86
3
+ metadata.gz: e47873e013c1c06c36014fdc550160b271e22328a906ee95b86fe9d16aaffb81
4
+ data.tar.gz: 0e6628b1948c1aff876e08822712e22e46083861dcf1c7467d540ba15cd6d3c8
5
5
  SHA512:
6
- metadata.gz: 9f49f57a3c037646789565e1adb8c5ba129b1ed7e3f7b2ddbc3ec6a11c150d9e946728fcb2912af84c69070c1cefab00be707aed104b5eda2a7a9845cc14c5b8
7
- data.tar.gz: 214702b726cb0c4c18fd380f3d4d985955002bad65a7e80ac0072da78d2014eea8a0c604256deefaab9c5adbb77fec0c155397df9dbcd868b2410f13a884e89a
6
+ metadata.gz: dfdf28acfa73a50c7f3a42808a406a0b23b332e04e039fe22d67883f9b31f3cc93e54eba273251cca6f38b90a737e0d3e143814cb1907428d9e9606da0a412b0
7
+ data.tar.gz: cb61de0b69e783ddd1f817fe606d4ce32a007efeea0d3afb5e259ed9a51f3351ed5f55ffa8316dc6fa0ccded957036f6c163d89644046beae913f0919e49a9d5
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 0.16 2022-01-22
2
+
3
+ - Use frozen empty hash as default headers in response methods
4
+ - Add `text` key in registered MIME types
5
+
1
6
  ## 0.15 2022-01-08
2
7
 
3
8
  - Add `TestAdapter` class for testing requests and responses
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- qeweney (0.15)
4
+ qeweney (0.16)
5
5
  escape_utils (~> 1.2.1)
6
6
 
7
7
  GEM
@@ -8,6 +8,7 @@ module Qeweney
8
8
  'css' => 'text/css',
9
9
  'js' => 'application/javascript',
10
10
  'txt' => 'text/plain',
11
+ 'text' => 'text/plain',
11
12
 
12
13
  'gif' => 'image/gif',
13
14
  'jpg' => 'image/jpeg',
@@ -68,12 +68,14 @@ module Qeweney
68
68
  @adapter.complete?(self)
69
69
  end
70
70
 
71
- def respond(body, headers = {})
71
+ EMPTY_HEADERS = {}.freeze
72
+
73
+ def respond(body, headers = EMPTY_HEADERS)
72
74
  @adapter.respond(self, body, headers)
73
75
  @headers_sent = true
74
76
  end
75
77
 
76
- def send_headers(headers = {}, empty_response = false)
78
+ def send_headers(headers = EMPTY_HEADERS, empty_response = false)
77
79
  return if @headers_sent
78
80
 
79
81
  @headers_sent = true
@@ -61,7 +61,6 @@ module Qeweney
61
61
  def parse_query(query)
62
62
  query.split('&').each_with_object({}) do |kv, h|
63
63
  k, v = kv.match(QUERY_KV_REGEXP)[1..2]
64
- # k, v = kv.split('=')
65
64
  h[k.to_sym] = v ? URI.decode_www_form_component(v) : true
66
65
  end
67
66
  end
@@ -7,7 +7,8 @@ module Qeweney
7
7
 
8
8
  module RoutingMethods
9
9
  def route(&block)
10
- (@path_parts ||= path.split('/'))[@path_parts_idx ||= 1]
10
+ @path_parts ||= path.split('/')
11
+ @path_parts_idx ||= 1
11
12
  res = catch(:stop) { yield self }
12
13
  return if res == :found
13
14
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Qeweney
4
- VERSION = '0.15'
4
+ VERSION = '0.16'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qeweney
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.15'
4
+ version: '0.16'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sharon Rosner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-08 00:00:00.000000000 Z
11
+ date: 2022-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: escape_utils