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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6ac5dc1c7b3c8e0c0e6db720d7c3e6c5d716ee4d954702f99f94457c90cfec3a
4
- data.tar.gz: da09daf131c30241e6b9c0518ecdb1b7dcea3ddcdf0402235a7ff7ad006b83fc
3
+ metadata.gz: 6c5839148e12cf89cbdc454de6155fd7d9a7a515208bdd83ffba741388591dc7
4
+ data.tar.gz: 58bb3176945607e04975f4132da07900deeda442d8709d0e458cdb4c093c621e
5
5
  SHA512:
6
- metadata.gz: d8595b25b59ddc3262447ae1489b2af0bb1e54a809c33c1fe9ad2f7490998a2f4aa73d48290109e2bccf00dee4b2dd77d6e1e9d4d10e1c1140b1960a4933511e
7
- data.tar.gz: 7160f346668a6428c021824f435359c928060c0eb8541441efc1ccd034a6a46c67d85243a4ddcf1d71b9fbd426d484a5f1ce1d4d9013c3e8a2bf9c4340f2f13a
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://secure.travis-ci.com/socketry/protocol-http.svg)](http://travis-ci.com/socketry/protocol-http)
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 = base.split('/', -1)
155
- path.pop
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 = relative.split('/')
167
+ parts = split(relative)
158
168
 
159
169
  parts.each do |part|
160
170
  if part == '..'
@@ -20,6 +20,6 @@
20
20
 
21
21
  module Protocol
22
22
  module HTTP
23
- VERSION = "0.5.0"
23
+ VERSION = "0.6.0"
24
24
  end
25
25
  end
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.5.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-23 00:00:00.000000000 Z
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.2
126
+ rubygems_version: 3.0.3
127
127
  signing_key:
128
128
  specification_version: 4
129
129
  summary: Provides abstractions to handle HTTP protocols.