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 +4 -4
- data/.gitignore +1 -0
- data/.ruby-version +1 -1
- data/Gemfile +1 -1
- data/VERSION +1 -1
- data/lib/rack/app/params.rb +19 -7
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cad14178359dceac489ae805f37311a2e3ad94df
|
4
|
+
data.tar.gz: 1998a8d3712146d3b616f2df5349dc479d6ec1db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a095e9a6cf6d2a86dab1b93d85ea4f39700c73d86d8ad9582d786db6934eb04ee54ed534115f9a9db80964a925f8a90e606ca54cdd3a56b34cca4e8ce1c61707
|
7
|
+
data.tar.gz: 9ea4d0301bee2df34c1e7f8d1778cfee04d6a0f128c7ddcf69cc72b39f11f1dc4d0635f26899335566f19018bc9c56fbd54afc18578bbe9aed0e294903ade76a
|
data/.gitignore
CHANGED
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.4.0
|
data/Gemfile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
6.
|
1
|
+
6.6.0
|
data/lib/rack/app/params.rb
CHANGED
@@ -27,22 +27,34 @@ class Rack::App::Params
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def generate_query_params
|
30
|
-
|
31
|
-
params_collection[k.sub(/\[\]$/, '')] =
|
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?(
|
41
|
+
single_paramter_value?(value) && !key.end_with?('[]') ? value[0] : value
|
38
42
|
end
|
39
43
|
|
40
|
-
def
|
41
|
-
|
44
|
+
def query_string
|
45
|
+
@env[::Rack::QUERY_STRING]
|
42
46
|
end
|
43
47
|
|
44
|
-
def
|
45
|
-
|
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.
|
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-
|
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.
|
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!
|