pincers 0.7.1 → 0.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pincers/core/root_context.rb +2 -1
- data/lib/pincers/http/utils.rb +4 -1
- data/lib/pincers/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5aaa42341e45a15e71098302b79cf2ebc4527f4
|
4
|
+
data.tar.gz: f2f0ea340f2dfa35028634b95f79e880e74b7941
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad04a3a48bd9694b635a50e565396d92539b15750e160c3897d3b12f89a5378b193be903dffcc777c7c891dbfc7a2ca9b24cbcf7fa63dd59fcfb450556e96a40
|
7
|
+
data.tar.gz: f98a91908ee6bf5a5811746bfb22c9f94ba2c8896ff822beef8ec9444280200af989d107b6005d0fa39f6ac04f4fedb5102b6935f0a72166ae94d625800c8eed
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'pincers/core/cookies'
|
2
2
|
require 'pincers/core/search_context'
|
3
|
+
require 'pincers/http/utils'
|
3
4
|
|
4
5
|
module Pincers::Core
|
5
6
|
class RootContext < SearchContext
|
@@ -41,7 +42,7 @@ module Pincers::Core
|
|
41
42
|
end
|
42
43
|
|
43
44
|
def uri
|
44
|
-
|
45
|
+
Pincers::Http::Utils.parse_uri url
|
45
46
|
end
|
46
47
|
|
47
48
|
def title
|
data/lib/pincers/http/utils.rb
CHANGED
@@ -1,9 +1,12 @@
|
|
1
|
+
require 'uri'
|
2
|
+
|
1
3
|
module Pincers::Http
|
2
4
|
module Utils
|
3
5
|
extend self
|
4
6
|
|
5
7
|
FORM_URLENCODED = 'application/x-www-form-urlencoded'
|
6
8
|
FORM_MULTIPART = 'multipart/form-data'
|
9
|
+
URI_PARSER = URI::Parser.new(:UNRESERVED => URI::REGEXP::PATTERN::UNRESERVED + '|')
|
7
10
|
|
8
11
|
def encode_urlencoded(_pairs)
|
9
12
|
_pairs = hash_to_pairs _pairs if _pairs.is_a? Hash
|
@@ -19,7 +22,7 @@ module Pincers::Http
|
|
19
22
|
end
|
20
23
|
|
21
24
|
def parse_uri(_url)
|
22
|
-
|
25
|
+
URI_PARSER.parse _url
|
23
26
|
end
|
24
27
|
|
25
28
|
private
|
data/lib/pincers/version.rb
CHANGED