uri-query_params 0.7.2 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +4 -7
- data/ChangeLog.md +8 -0
- data/Gemfile +1 -0
- data/LICENSE.txt +1 -1
- data/README.md +26 -15
- data/gemspec.yml +9 -0
- data/lib/uri/query_params/core_ext/addressable/uri.rb +11 -0
- data/lib/uri/query_params/core_ext/uri/generic.rb +58 -0
- data/lib/uri/query_params/core_ext/uri.rb +1 -0
- data/lib/uri/query_params/core_ext.rb +2 -0
- data/lib/uri/query_params/extensions/addressable/uri.rb +1 -11
- data/lib/uri/query_params/extensions/uri/generic.rb +1 -58
- data/lib/uri/query_params/extensions/uri.rb +1 -1
- data/lib/uri/query_params/extensions.rb +1 -2
- data/lib/uri/query_params/mixin.rb +2 -2
- data/lib/uri/query_params/query_params.rb +9 -24
- data/lib/uri/query_params/version.rb +1 -1
- data/spec/{extensions → core_ext}/addressable/uri_spec.rb +1 -1
- data/spec/core_ext/uri/generic_spec.rb +9 -0
- data/spec/{extensions → core_ext}/uri/http_spec.rb +1 -1
- data/spec/extensions/addressable/uri.rb +13 -0
- data/spec/extensions/uri/generic_spec.rb +9 -5
- data/spec/extensions/uri_spec.rb +11 -0
- data/spec/extensions_spec.rb +11 -0
- data/uri-query_params.gemspec +39 -105
- metadata +28 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da86f32384123e5240b11aae3767b48770696604afb3eee3c4a04351badaa585
|
4
|
+
data.tar.gz: c469674aa5d7f20e72f19dd6fb2eac80917182638706390fe1cc2e60d89ecb98
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 62031ef7a85c4e0d17205964f3d2b14c0596d42da4c04f583faedd83f8a7f3c861bddfefdae6e4c36055913e2a59738a93021d943bd0447d91cf360d3762b8b3
|
7
|
+
data.tar.gz: af4ad8d768e9114636279f4abe2d197b439f856474bab5dbb5269388e8f5ad7aaa0a780858e16c797d77f68874f696d3c2e58e486dfada640bcbe19b826b4e3e
|
data/.github/workflows/ruby.yml
CHANGED
@@ -1,10 +1,6 @@
|
|
1
1
|
name: CI
|
2
2
|
|
3
|
-
on:
|
4
|
-
push:
|
5
|
-
branches: [ master ]
|
6
|
-
pull_request:
|
7
|
-
branches: ['**']
|
3
|
+
on: [ push, pull_request ]
|
8
4
|
|
9
5
|
jobs:
|
10
6
|
tests:
|
@@ -13,11 +9,12 @@ jobs:
|
|
13
9
|
fail-fast: false
|
14
10
|
matrix:
|
15
11
|
ruby:
|
16
|
-
- 2.4
|
17
|
-
- 2.5
|
18
12
|
- 2.6
|
19
13
|
- 2.7
|
14
|
+
- '3.0'
|
15
|
+
- 3.1
|
20
16
|
- jruby
|
17
|
+
- truffleruby
|
21
18
|
name: Ruby ${{ matrix.ruby }}
|
22
19
|
steps:
|
23
20
|
- uses: actions/checkout@v2
|
data/ChangeLog.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
### 0.8.0 / 2022-01-14
|
2
|
+
|
3
|
+
* Require [ruby] >= 2.0.0.
|
4
|
+
* Renamed `uri/query_params/extensions` to `uri/query_params/core_ext`.
|
5
|
+
* Removed legacy [ruby] 1.8 code.
|
6
|
+
* Fix instance variable warnings in `uri/query_params/mixin`.
|
7
|
+
|
1
8
|
### 0.7.2 / 2020-11-29
|
2
9
|
|
3
10
|
* Use `URI::DEFAULT_PARSER.escape` / `.unescape` instead of the deprecated
|
@@ -70,3 +77,4 @@
|
|
70
77
|
|
71
78
|
* Initial release.
|
72
79
|
|
80
|
+
[ruby]: https://www.ruby-lang.org/
|
data/Gemfile
CHANGED
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -3,7 +3,6 @@
|
|
3
3
|
* [Source](https://github.com/postmodern/uri-query_params)
|
4
4
|
* [Issues](https://github.com/postmodern/uri-query_params/issues)
|
5
5
|
* [Documentation](http://rubydoc.info/gems/uri-query_params/frames)
|
6
|
-
* [Email](mailto:postmodern.mod3 at gmail.com)
|
7
6
|
|
8
7
|
## Description
|
9
8
|
|
@@ -14,26 +13,36 @@ to `$_GET` from PHP, except available on any Ruby URI object.
|
|
14
13
|
|
15
14
|
Inspecting the URI query_params:
|
16
15
|
|
17
|
-
|
18
|
-
|
19
|
-
url = URI('http://www.google.com/search?hl=en&client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&hs=1HY&q=bob+ross&btnG=Search')
|
20
|
-
url.query_params
|
21
|
-
# => {"btnG"=>"Search", "hs"=>"1HY", "rls"=>"org.mozilla:en-US:official", "client"=>"firefox-a", "hl"=>"en", "q"=>"bob+ross"}
|
16
|
+
```ruby
|
17
|
+
require 'uri/query_params'
|
22
18
|
|
23
|
-
|
24
|
-
|
19
|
+
url = URI('http://www.google.com/search?hl=en&client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&hs=1HY&q=bob+ross&btnG=Search')
|
20
|
+
url.query_params
|
21
|
+
# => {"btnG"=>"Search", "hs"=>"1HY", "rls"=>"org.mozilla:en-US:official", "client"=>"firefox-a", "hl"=>"en", "q"=>"bob+ross"}
|
22
|
+
|
23
|
+
url.query_params['q']
|
24
|
+
# => "bob+ross"
|
25
|
+
```
|
25
26
|
|
26
27
|
Setting the URI query_params:
|
27
28
|
|
28
|
-
|
29
|
-
|
30
|
-
|
29
|
+
```ruby
|
30
|
+
url.query_params['q'] = 'Upright Citizens Brigade'
|
31
|
+
url.to_s
|
32
|
+
# => "http://www.google.com/search?btnG=Search&hs=1HY&rls=org.mozilla:en-US:official&client=firefox-a&hl=en&q=Upright%20Citizens%20Brigade"
|
33
|
+
```
|
31
34
|
|
32
35
|
Parsing URI query_params embedded within the Fragment Identifier:
|
33
36
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
+
```ruby
|
38
|
+
url = URI('https://twitter.com/#!/download?lang=en&logged_out=1')
|
39
|
+
URI(url.fragment).query_params
|
40
|
+
# => {"logged_out"=>"1", "lang"=>"en"}
|
41
|
+
```
|
42
|
+
|
43
|
+
## Requirements
|
44
|
+
|
45
|
+
* [ruby] >= 2.0.0
|
37
46
|
|
38
47
|
## Install
|
39
48
|
|
@@ -41,6 +50,8 @@ Parsing URI query_params embedded within the Fragment Identifier:
|
|
41
50
|
|
42
51
|
## License
|
43
52
|
|
44
|
-
Copyright (c) 2010-
|
53
|
+
Copyright (c) 2010-2022 Hal Brodigan
|
45
54
|
|
46
55
|
See {file:LICENSE.txt} for license information.
|
56
|
+
|
57
|
+
[ruby]: https://www.ruby-lang.org/
|
data/gemspec.yml
CHANGED
@@ -7,5 +7,14 @@ authors: Postmodern
|
|
7
7
|
email: postmodern.mod3@gmail.com
|
8
8
|
has_yard: true
|
9
9
|
|
10
|
+
metadata:
|
11
|
+
documentation_uri: https://rubydoc.info/gems/uri-query_params
|
12
|
+
source_code_uri: https://github.com/postmodern/uri-query_params.rb
|
13
|
+
bug_tracker_uri: https://github.com/postmodern/uri-query_params.rb/issues
|
14
|
+
changelog_uri: https://github.com/postmodern/uri-query_params.rb/blob/master/ChangeLog.md
|
15
|
+
rubygems_mfa_required: 'true'
|
16
|
+
|
17
|
+
required_ruby_version: ">= 2.0.0"
|
18
|
+
|
10
19
|
development_dependencies:
|
11
20
|
bundler: ~> 2.0
|
@@ -0,0 +1,58 @@
|
|
1
|
+
require 'uri/query_params/mixin'
|
2
|
+
|
3
|
+
require 'uri/generic'
|
4
|
+
|
5
|
+
module URI
|
6
|
+
class Generic
|
7
|
+
|
8
|
+
include URI::QueryParams::Mixin
|
9
|
+
|
10
|
+
#
|
11
|
+
# Constructs String from URI
|
12
|
+
#
|
13
|
+
# @note
|
14
|
+
# This is the `URI::Generic#to_s` method from Ruby 2.2.0, with the minor
|
15
|
+
# modification of calling the `query` method overrode by
|
16
|
+
# {URI::QueryParams::Mixin}, instead of `@query`.
|
17
|
+
#
|
18
|
+
# @see https://github.com/ruby/ruby/blob/v2_2_0/lib/uri/generic.rb#L1338-L1376
|
19
|
+
#
|
20
|
+
def to_s
|
21
|
+
str = ''
|
22
|
+
if @scheme
|
23
|
+
str << @scheme
|
24
|
+
str << ':'.freeze
|
25
|
+
end
|
26
|
+
|
27
|
+
if @opaque
|
28
|
+
str << @opaque
|
29
|
+
else
|
30
|
+
if @host
|
31
|
+
str << '//'.freeze
|
32
|
+
end
|
33
|
+
if self.userinfo
|
34
|
+
str << self.userinfo
|
35
|
+
str << '@'.freeze
|
36
|
+
end
|
37
|
+
if @host
|
38
|
+
str << @host
|
39
|
+
end
|
40
|
+
if @port && @port != self.default_port
|
41
|
+
str << ':'.freeze
|
42
|
+
str << @port.to_s
|
43
|
+
end
|
44
|
+
str << @path
|
45
|
+
if query
|
46
|
+
str << '?'.freeze
|
47
|
+
str << query
|
48
|
+
end
|
49
|
+
end
|
50
|
+
if @fragment
|
51
|
+
str << '#'.freeze
|
52
|
+
str << @fragment
|
53
|
+
end
|
54
|
+
str
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'uri/query_params/core_ext/uri/generic'
|
@@ -1,58 +1 @@
|
|
1
|
-
require 'uri/query_params/
|
2
|
-
|
3
|
-
require 'uri/generic'
|
4
|
-
|
5
|
-
module URI
|
6
|
-
class Generic
|
7
|
-
|
8
|
-
include URI::QueryParams::Mixin
|
9
|
-
|
10
|
-
#
|
11
|
-
# Constructs String from URI
|
12
|
-
#
|
13
|
-
# @note
|
14
|
-
# This is the `URI::Generic#to_s` method from Ruby 2.2.0, with the minor
|
15
|
-
# modification of calling the `query` method overrode by
|
16
|
-
# {URI::QueryParams::Mixin}, instead of `@query`.
|
17
|
-
#
|
18
|
-
# @see https://github.com/ruby/ruby/blob/v2_2_0/lib/uri/generic.rb#L1338-L1376
|
19
|
-
#
|
20
|
-
def to_s
|
21
|
-
str = ''
|
22
|
-
if @scheme
|
23
|
-
str << @scheme
|
24
|
-
str << ':'.freeze
|
25
|
-
end
|
26
|
-
|
27
|
-
if @opaque
|
28
|
-
str << @opaque
|
29
|
-
else
|
30
|
-
if @host
|
31
|
-
str << '//'.freeze
|
32
|
-
end
|
33
|
-
if self.userinfo
|
34
|
-
str << self.userinfo
|
35
|
-
str << '@'.freeze
|
36
|
-
end
|
37
|
-
if @host
|
38
|
-
str << @host
|
39
|
-
end
|
40
|
-
if @port && @port != self.default_port
|
41
|
-
str << ':'.freeze
|
42
|
-
str << @port.to_s
|
43
|
-
end
|
44
|
-
str << @path
|
45
|
-
if query
|
46
|
-
str << '?'.freeze
|
47
|
-
str << query
|
48
|
-
end
|
49
|
-
end
|
50
|
-
if @fragment
|
51
|
-
str << '#'.freeze
|
52
|
-
str << @fragment
|
53
|
-
end
|
54
|
-
str
|
55
|
-
end
|
56
|
-
|
57
|
-
end
|
58
|
-
end
|
1
|
+
require 'uri/query_params/core_ext/uri/generic'
|
@@ -1 +1 @@
|
|
1
|
-
require 'uri/query_params/
|
1
|
+
require 'uri/query_params/core_ext/uri'
|
@@ -1,2 +1 @@
|
|
1
|
-
require 'uri/query_params/
|
2
|
-
require 'uri/query_params/extensions/addressable/uri' if defined?(Addressable)
|
1
|
+
require 'uri/query_params/core_ext'
|
@@ -29,7 +29,7 @@ module URI
|
|
29
29
|
# @since 0.5.2
|
30
30
|
#
|
31
31
|
def query
|
32
|
-
if @query_params
|
32
|
+
if defined?(@query_params) && @query_params
|
33
33
|
URI::QueryParams.dump(@query_params)
|
34
34
|
else
|
35
35
|
raw_query
|
@@ -56,7 +56,7 @@ module URI
|
|
56
56
|
def query=(new_query)
|
57
57
|
new_query = (self.raw_query = new_query)
|
58
58
|
|
59
|
-
parse_query_params! if @query_params
|
59
|
+
parse_query_params! if defined?(@query_params) && @query_params
|
60
60
|
return new_query
|
61
61
|
end
|
62
62
|
end
|
@@ -50,10 +50,8 @@ module URI
|
|
50
50
|
next if param.empty?
|
51
51
|
|
52
52
|
name, value = param.split('=',2)
|
53
|
-
value = if value
|
54
|
-
|
55
|
-
else
|
56
|
-
''
|
53
|
+
value = if value then URI::DEFAULT_PARSER.unescape(value)
|
54
|
+
else ''
|
57
55
|
end
|
58
56
|
|
59
57
|
yield(name,value) if block_given?
|
@@ -79,14 +77,10 @@ module URI
|
|
79
77
|
#
|
80
78
|
def self.escape(value)
|
81
79
|
case value
|
82
|
-
when Array
|
83
|
-
|
84
|
-
when
|
85
|
-
|
86
|
-
when false, nil
|
87
|
-
''
|
88
|
-
else
|
89
|
-
URI::DEFAULT_PARSER.escape(value.to_s,UNSAFE)
|
80
|
+
when Array then URI::DEFAULT_PARSER.escape(value.join(' '),UNSAFE)
|
81
|
+
when true then 'active'
|
82
|
+
when false, nil then ''
|
83
|
+
else URI::DEFAULT_PARSER.escape(value.to_s,UNSAFE)
|
90
84
|
end
|
91
85
|
end
|
92
86
|
|
@@ -116,18 +110,9 @@ module URI
|
|
116
110
|
# @api semipublic
|
117
111
|
#
|
118
112
|
def self.dump(query_params)
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
query_params.rehash if RUBY_VERSION < '1.9'
|
123
|
-
|
124
|
-
query_params.each do |name,value|
|
125
|
-
value = escape(value)
|
126
|
-
|
127
|
-
query << "#{name}=#{value}"
|
128
|
-
end
|
129
|
-
|
130
|
-
return query.join('&')
|
113
|
+
query_params.map { |name,value|
|
114
|
+
"#{name}=#{escape(value)}"
|
115
|
+
}.join('&')
|
131
116
|
end
|
132
117
|
|
133
118
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
require 'query_params_mixin_examples'
|
3
|
-
require 'uri/query_params/
|
3
|
+
require 'uri/query_params/core_ext/addressable/uri'
|
4
4
|
|
5
5
|
describe Addressable::URI do
|
6
6
|
let(:uri) { described_class.parse('http://www.example.com/page.php') }
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'uri/query_params/extensions/addressable/uri'
|
3
|
+
|
4
|
+
describe 'uri/query_params/extensions/addressable/uri' do
|
5
|
+
let(:root) { File.expand_path(File.join('..','..','..'),__dir__) }
|
6
|
+
let(:path) do
|
7
|
+
File.join(root,'lib','uri','query_params','core_ext', 'addressable','uri.rb')
|
8
|
+
end
|
9
|
+
|
10
|
+
it "must require 'uri/query_params/core_ext/addressable/uri'" do
|
11
|
+
expect($LOADED_FEATURES).to include(path)
|
12
|
+
end
|
13
|
+
end
|
@@ -1,9 +1,13 @@
|
|
1
1
|
require 'spec_helper'
|
2
|
-
require '
|
3
|
-
require 'uri/query_params/extensions/uri'
|
2
|
+
require 'uri/query_params/extensions/uri/generic'
|
4
3
|
|
5
|
-
describe
|
6
|
-
let(:
|
4
|
+
describe 'uri/query_params/extensions/uri/generic' do
|
5
|
+
let(:root) { File.expand_path(File.join('..','..','..'),__dir__) }
|
6
|
+
let(:path) do
|
7
|
+
File.join(root,'lib','uri','query_params','core_ext', 'uri','generic.rb')
|
8
|
+
end
|
7
9
|
|
8
|
-
|
10
|
+
it "must require 'uri/query_params/core_ext/uri/generic'" do
|
11
|
+
expect($LOADED_FEATURES).to include(path)
|
12
|
+
end
|
9
13
|
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'uri/query_params/extensions/uri'
|
3
|
+
|
4
|
+
describe 'uri/query_params/extensions/uri' do
|
5
|
+
let(:root) { File.expand_path(File.join('..','..'),__dir__) }
|
6
|
+
let(:path) { File.join(root,'lib','uri','query_params','core_ext', 'uri.rb') }
|
7
|
+
|
8
|
+
it "must require 'uri/query_params/core_ext/uri'" do
|
9
|
+
expect($LOADED_FEATURES).to include(path)
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'uri/query_params/extensions'
|
3
|
+
|
4
|
+
describe 'uri/query_params/extensions' do
|
5
|
+
let(:root) { File.expand_path('..',__dir__) }
|
6
|
+
let(:path) { File.join(root,'lib','uri','query_params','core_ext.rb') }
|
7
|
+
|
8
|
+
it "must require 'uri/query_params/core_ext'" do
|
9
|
+
expect($LOADED_FEATURES).to include(path)
|
10
|
+
end
|
11
|
+
end
|
data/uri-query_params.gemspec
CHANGED
@@ -2,126 +2,60 @@
|
|
2
2
|
|
3
3
|
require 'yaml'
|
4
4
|
|
5
|
-
Gem::Specification.new do |
|
6
|
-
|
7
|
-
`git ls-files`.split($/)
|
8
|
-
elsif File.directory?('.hg')
|
9
|
-
`hg manifest`.split($/)
|
10
|
-
elsif File.directory?('.svn')
|
11
|
-
`svn ls -R`.split($/).select { |path| File.file?(path) }
|
12
|
-
else
|
13
|
-
Dir['{**/}{.*,*}'].select { |path| File.file?(path) }
|
14
|
-
end
|
5
|
+
Gem::Specification.new do |gem|
|
6
|
+
gemspec = YAML.load_file('gemspec.yml')
|
15
7
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
when String
|
21
|
-
(files & Dir[paths])
|
22
|
-
end
|
23
|
-
}
|
24
|
-
|
25
|
-
version = {
|
26
|
-
:file => 'lib/uri/query_params/version.rb',
|
27
|
-
:constant => 'URI::QueryParams::VERSION'
|
28
|
-
}
|
29
|
-
|
30
|
-
defaults = {
|
31
|
-
'name' => File.basename(File.dirname(__FILE__)),
|
32
|
-
'files' => files,
|
33
|
-
'executables' => filter_files['bin/*'].map { |path| File.basename(path) },
|
34
|
-
'test_files' => filter_files['{test/{**/}*_test.rb,spec/{**/}*_spec.rb}'],
|
35
|
-
'extra_doc_files' => filter_files['*.{txt,rdoc,md,markdown,tt,textile}'],
|
36
|
-
}
|
37
|
-
|
38
|
-
metadata = defaults.merge(YAML.load_file('gemspec.yml'))
|
39
|
-
|
40
|
-
gemspec.name = metadata.fetch('name',defaults[:name])
|
41
|
-
gemspec.version = if metadata['version']
|
42
|
-
metadata['version']
|
43
|
-
elsif File.file?(version[:file])
|
44
|
-
require File.join('.',version[:file])
|
45
|
-
eval(version[:constant])
|
46
|
-
end
|
47
|
-
|
48
|
-
gemspec.summary = metadata.fetch('summary',metadata['description'])
|
49
|
-
gemspec.description = metadata.fetch('description',metadata['summary'])
|
50
|
-
|
51
|
-
case metadata['license']
|
52
|
-
when Array
|
53
|
-
gemspec.licenses = metadata['license']
|
54
|
-
when String
|
55
|
-
gemspec.license = metadata['license']
|
56
|
-
end
|
57
|
-
|
58
|
-
case metadata['authors']
|
59
|
-
when Array
|
60
|
-
gemspec.authors = metadata['authors']
|
61
|
-
when String
|
62
|
-
gemspec.author = metadata['authors']
|
63
|
-
end
|
8
|
+
gem.name = gemspec.fetch('name')
|
9
|
+
gem.version = gemspec.fetch('version') do
|
10
|
+
lib_dir = File.join(File.dirname(__FILE__),'lib')
|
11
|
+
$LOAD_PATH << lib_dir unless $LOAD_PATH.include?(lib_dir)
|
64
12
|
|
65
|
-
|
66
|
-
|
13
|
+
require 'uri/query_params/version'
|
14
|
+
URI::QueryParams::VERSION
|
15
|
+
end
|
67
16
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
17
|
+
gem.summary = gemspec['summary']
|
18
|
+
gem.description = gemspec['description']
|
19
|
+
gem.licenses = Array(gemspec['license'])
|
20
|
+
gem.authors = Array(gemspec['authors'])
|
21
|
+
gem.email = gemspec['email']
|
22
|
+
gem.homepage = gemspec['homepage']
|
23
|
+
gem.metadata = gemspec['metadata'] if gemspec['metadata']
|
74
24
|
|
75
|
-
|
25
|
+
glob = lambda { |patterns| gem.files & Dir[*patterns] }
|
76
26
|
|
77
|
-
|
78
|
-
|
27
|
+
gem.files = `git ls-files`.split($/)
|
28
|
+
gem.files = glob[gemspec['files']] if gemspec['files']
|
79
29
|
|
80
|
-
|
81
|
-
|
30
|
+
gem.executables = gemspec.fetch('executables') do
|
31
|
+
glob['bin/*'].map { |path| File.basename(path) }
|
82
32
|
end
|
33
|
+
gem.default_executable = gem.executables.first if Gem::VERSION < '1.7.'
|
83
34
|
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
gemspec.extra_rdoc_files = metadata['extra_doc_files']
|
88
|
-
end
|
89
|
-
|
90
|
-
gemspec.post_install_message = metadata['post_install_message']
|
91
|
-
gemspec.requirements = metadata['requirements']
|
92
|
-
|
93
|
-
if gemspec.respond_to?(:required_ruby_version=)
|
94
|
-
gemspec.required_ruby_version = metadata['required_ruby_version']
|
95
|
-
end
|
35
|
+
gem.extensions = glob[gemspec['extensions'] || 'ext/**/extconf.rb']
|
36
|
+
gem.test_files = glob[gemspec['test_files'] || '{test/{**/}*_test.rb']
|
37
|
+
gem.extra_rdoc_files = glob[gemspec['extra_doc_files'] || '*.{txt,md}']
|
96
38
|
|
97
|
-
|
98
|
-
|
99
|
-
|
39
|
+
gem.require_paths = Array(gemspec.fetch('require_paths') {
|
40
|
+
%w[ext lib].select { |dir| File.directory?(dir) }
|
41
|
+
})
|
100
42
|
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
when String
|
106
|
-
versions.split(/,\s*/)
|
107
|
-
end
|
108
|
-
}
|
43
|
+
gem.requirements = gemspec['requirements']
|
44
|
+
gem.required_ruby_version = gemspec['required_ruby_version']
|
45
|
+
gem.required_rubygems_version = gemspec['required_rubygems_version']
|
46
|
+
gem.post_install_message = gemspec['post_install_message']
|
109
47
|
|
110
|
-
|
111
|
-
metadata['dependencies'].each do |name,versions|
|
112
|
-
gemspec.add_dependency(name,parse_versions[versions])
|
113
|
-
end
|
114
|
-
end
|
48
|
+
split = lambda { |string| string.split(/,\s*/) }
|
115
49
|
|
116
|
-
if
|
117
|
-
|
118
|
-
|
50
|
+
if gemspec['dependencies']
|
51
|
+
gemspec['dependencies'].each do |name,versions|
|
52
|
+
gem.add_dependency(name,split[versions])
|
119
53
|
end
|
120
54
|
end
|
121
55
|
|
122
|
-
if
|
123
|
-
|
124
|
-
|
56
|
+
if gemspec['development_dependencies']
|
57
|
+
gemspec['development_dependencies'].each do |name,versions|
|
58
|
+
gem.add_development_dependency(name,split[versions])
|
125
59
|
end
|
126
60
|
end
|
127
61
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uri-query_params
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Postmodern
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -28,7 +28,10 @@ description: Allows access to the query component of the URI as a Hash.
|
|
28
28
|
email: postmodern.mod3@gmail.com
|
29
29
|
executables: []
|
30
30
|
extensions: []
|
31
|
-
extra_rdoc_files:
|
31
|
+
extra_rdoc_files:
|
32
|
+
- ChangeLog.md
|
33
|
+
- LICENSE.txt
|
34
|
+
- README.md
|
32
35
|
files:
|
33
36
|
- ".document"
|
34
37
|
- ".github/workflows/ruby.yml"
|
@@ -42,6 +45,10 @@ files:
|
|
42
45
|
- Rakefile
|
43
46
|
- gemspec.yml
|
44
47
|
- lib/uri/query_params.rb
|
48
|
+
- lib/uri/query_params/core_ext.rb
|
49
|
+
- lib/uri/query_params/core_ext/addressable/uri.rb
|
50
|
+
- lib/uri/query_params/core_ext/uri.rb
|
51
|
+
- lib/uri/query_params/core_ext/uri/generic.rb
|
45
52
|
- lib/uri/query_params/extensions.rb
|
46
53
|
- lib/uri/query_params/extensions/addressable/uri.rb
|
47
54
|
- lib/uri/query_params/extensions/uri.rb
|
@@ -49,9 +56,13 @@ files:
|
|
49
56
|
- lib/uri/query_params/mixin.rb
|
50
57
|
- lib/uri/query_params/query_params.rb
|
51
58
|
- lib/uri/query_params/version.rb
|
52
|
-
- spec/
|
59
|
+
- spec/core_ext/addressable/uri_spec.rb
|
60
|
+
- spec/core_ext/uri/generic_spec.rb
|
61
|
+
- spec/core_ext/uri/http_spec.rb
|
62
|
+
- spec/extensions/addressable/uri.rb
|
53
63
|
- spec/extensions/uri/generic_spec.rb
|
54
|
-
- spec/extensions/
|
64
|
+
- spec/extensions/uri_spec.rb
|
65
|
+
- spec/extensions_spec.rb
|
55
66
|
- spec/query_params_mixin_examples.rb
|
56
67
|
- spec/query_params_spec.rb
|
57
68
|
- spec/spec_helper.rb
|
@@ -59,8 +70,13 @@ files:
|
|
59
70
|
homepage: https://github.com/postmodern/uri-query_params
|
60
71
|
licenses:
|
61
72
|
- MIT
|
62
|
-
metadata:
|
63
|
-
|
73
|
+
metadata:
|
74
|
+
documentation_uri: https://rubydoc.info/gems/uri-query_params
|
75
|
+
source_code_uri: https://github.com/postmodern/uri-query_params.rb
|
76
|
+
bug_tracker_uri: https://github.com/postmodern/uri-query_params.rb/issues
|
77
|
+
changelog_uri: https://github.com/postmodern/uri-query_params.rb/blob/master/ChangeLog.md
|
78
|
+
rubygems_mfa_required: 'true'
|
79
|
+
post_install_message:
|
64
80
|
rdoc_options: []
|
65
81
|
require_paths:
|
66
82
|
- lib
|
@@ -68,19 +84,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
68
84
|
requirements:
|
69
85
|
- - ">="
|
70
86
|
- !ruby/object:Gem::Version
|
71
|
-
version:
|
87
|
+
version: 2.0.0
|
72
88
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
73
89
|
requirements:
|
74
90
|
- - ">="
|
75
91
|
- !ruby/object:Gem::Version
|
76
92
|
version: '0'
|
77
93
|
requirements: []
|
78
|
-
rubygems_version: 3.
|
79
|
-
signing_key:
|
94
|
+
rubygems_version: 3.2.22
|
95
|
+
signing_key:
|
80
96
|
specification_version: 4
|
81
97
|
summary: Access the query parameters of a URI, just like $_GET in PHP.
|
82
|
-
test_files:
|
83
|
-
- spec/extensions/addressable/uri_spec.rb
|
84
|
-
- spec/extensions/uri/generic_spec.rb
|
85
|
-
- spec/extensions/uri/http_spec.rb
|
86
|
-
- spec/query_params_spec.rb
|
98
|
+
test_files: []
|