rack-app 6.5.0 → 6.6.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
  SHA1:
3
- metadata.gz: 4dacbebee0057a6e067e03df4561ebee1c67a79f
4
- data.tar.gz: 926b31b67476555c9a6f6fe63f6c8df8dcf1f9a7
3
+ metadata.gz: cad14178359dceac489ae805f37311a2e3ad94df
4
+ data.tar.gz: 1998a8d3712146d3b616f2df5349dc479d6ec1db
5
5
  SHA512:
6
- metadata.gz: 99a4ec962ab5be3ba58699ec0bcd1d7224d934caf338bba4722ecab41dc28530135606addce7ddb1cb30ccff66d4f1888ba1379a881e065cbb936d353c7084f8
7
- data.tar.gz: 9652a7ce5a607bb8ccd6d06d9b965bdc4f0ff40d7f438ad149ada21f1fac427d2674ce03e821454e5ca6871cf080cb6ff0fe05838307705eb518e2657d2e1ad1
6
+ metadata.gz: a095e9a6cf6d2a86dab1b93d85ea4f39700c73d86d8ad9582d786db6934eb04ee54ed534115f9a9db80964a925f8a90e606ca54cdd3a56b34cca4e8ce1c61707
7
+ data.tar.gz: 9ea4d0301bee2df34c1e7f8d1778cfee04d6a0f128c7ddcf69cc72b39f11f1dc4d0635f26899335566f19018bc9c56fbd54afc18578bbe9aed0e294903ade76a
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
1
  /pkg/
2
2
  Gemfile.lock
3
3
  .vagrant/
4
+ .ruby-gemset
@@ -1 +1 @@
1
- 2.3.0
1
+ 2.4.0
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source 'https://rubygems.org'
1
+ source 'http://rubygems.org'
2
2
  gemspec
3
3
 
4
4
  if RUBY_VERSION < '2.2.2'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 6.5.0
1
+ 6.6.0
@@ -27,22 +27,34 @@ class Rack::App::Params
27
27
  end
28
28
 
29
29
  def generate_query_params
30
- raw_cgi_params.reduce({}) do |params_collection, (k, v)|
31
- params_collection[k.sub(/\[\]$/, '')] = formatted_value(k, v)
30
+ raw_rack_formatted_params.reduce({}) do |params_collection, (k, v)|
31
+ params_collection[k.sub(/\[\]$/, '')] = v
32
32
  params_collection
33
33
  end
34
34
  end
35
35
 
36
+ def single_paramter_value?(v)
37
+ v.is_a?(Array) && v.length === 1
38
+ end
39
+
36
40
  def formatted_value(key, value)
37
- single_paramter_value?(value) && !key.end_with?("[]") ? value[0] : value
41
+ single_paramter_value?(value) && !key.end_with?('[]') ? value[0] : value
38
42
  end
39
43
 
40
- def single_paramter_value?(v)
41
- v.is_a?(Array) and v.length === 1
44
+ def query_string
45
+ @env[::Rack::QUERY_STRING]
42
46
  end
43
47
 
44
- def raw_cgi_params
45
- CGI.parse(@env[::Rack::QUERY_STRING].to_s)
48
+ def raw_rack_formatted_params
49
+ ::Rack::Utils.parse_nested_query(query_string).merge!(params_that_presented_multiple_times)
46
50
  end
47
51
 
52
+ def params_that_presented_multiple_times
53
+ cgi_params = CGI.parse(query_string)
54
+ cgi_params.reject! { |k, v| v.length == 1 && k !~ /^\w+$/ }
55
+ cgi_params.reduce({}) do |result, (key, value)|
56
+ result[key] = formatted_value(key, value)
57
+ result
58
+ end
59
+ end
48
60
  end
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: 6.5.0
4
+ version: 6.6.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: 2017-04-12 00:00:00.000000000 Z
11
+ date: 2017-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -227,7 +227,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
227
227
  version: '0'
228
228
  requirements: []
229
229
  rubyforge_project:
230
- rubygems_version: 2.5.1
230
+ rubygems_version: 2.6.8
231
231
  signing_key:
232
232
  specification_version: 4
233
233
  summary: Your next favourite, performance designed micro framework!