protocol-http 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/protocol/http/reference.rb +13 -3
- data/lib/protocol/http/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c5839148e12cf89cbdc454de6155fd7d9a7a515208bdd83ffba741388591dc7
|
4
|
+
data.tar.gz: 58bb3176945607e04975f4132da07900deeda442d8709d0e458cdb4c093c621e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a71227da852e031044b11bb2a6f6eb7b362129144394eacae489cf7bf14576705ed221eac73b4fa6020a80fb959842719858714f8537b978c35dd1da881454f
|
7
|
+
data.tar.gz: 34ab52b88c502e04b72df8373a23256d3a290efc9cfe933e28d9b4ea87f95242acf1de9a271426cc7eb10fb6e15cb14779be19ebef08855014c542a53ecd3e29
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Provides abstractions for working with the HTTP protocol.
|
4
4
|
|
5
|
-
[![Build Status](https://
|
5
|
+
[![Build Status](https://travis-ci.com/socketry/protocol-http.svg?branch=master)](http://travis-ci.com/socketry/protocol-http)
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
@@ -147,14 +147,24 @@ module Protocol
|
|
147
147
|
|
148
148
|
private
|
149
149
|
|
150
|
+
def split(path)
|
151
|
+
if path.empty?
|
152
|
+
[path]
|
153
|
+
else
|
154
|
+
path.split('/', -1)
|
155
|
+
end
|
156
|
+
end
|
157
|
+
|
150
158
|
def expand_path(base, relative)
|
151
159
|
if relative.start_with? '/'
|
152
160
|
return relative
|
153
161
|
else
|
154
|
-
path =
|
155
|
-
path.
|
162
|
+
path = split(base)
|
163
|
+
# drop the last path element for relative computations, e.g.
|
164
|
+
# /foo/bar/index.html -> /foo/bar/#{relative}
|
165
|
+
path.pop
|
156
166
|
|
157
|
-
parts =
|
167
|
+
parts = split(relative)
|
158
168
|
|
159
169
|
parts.each do |part|
|
160
170
|
if part == '..'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: protocol-http
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-05-
|
11
|
+
date: 2019-05-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: covered
|
@@ -123,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
125
|
requirements: []
|
126
|
-
rubygems_version: 3.0.
|
126
|
+
rubygems_version: 3.0.3
|
127
127
|
signing_key:
|
128
128
|
specification_version: 4
|
129
129
|
summary: Provides abstractions to handle HTTP protocols.
|