http.rb 0.11.0 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/http.rb.gemspec +2 -2
- data/lib/HTTP.rb +4 -2
- data/lib/String/url_encode.rb +24 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cbf011f369bb382e03c0ec192cb6ab4d0cad2f0e
|
4
|
+
data.tar.gz: 0f6803e5073848ba81088f019cd70e3d10be1f66
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e2584ee7057eebefe3bea61cc7946b92e0a8b11032aceb3c512dff88c62069924233ef82384199f0eb82785d53df3a1b04499c584ac6e8fda2e150f394b9745
|
7
|
+
data.tar.gz: ec8300cb750bc3afd170a29a99de366b6d821a52d7f1ae26ff5d9ae5cd394dab0094cb90b8f866d7dbb2af43b4a94cf0bdd93b17da5b7bbd43531f39f672f7fc
|
data/http.rb.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'http.rb'
|
3
|
-
s.version = '0.11.
|
4
|
-
s.date = '2015-
|
3
|
+
s.version = '0.11.1'
|
4
|
+
s.date = '2015-05-18'
|
5
5
|
|
6
6
|
s.summary = "HTTP made easy."
|
7
7
|
s.description = "HTTP is the simplest HTTP mezzanine library for Ruby. Supply a URI, \
|
data/lib/HTTP.rb
CHANGED
@@ -1,13 +1,15 @@
|
|
1
1
|
# HTTP.rb
|
2
2
|
# HTTP
|
3
3
|
|
4
|
-
#
|
5
|
-
# 0.11.
|
4
|
+
# 20150518
|
5
|
+
# 0.11.1
|
6
6
|
|
7
7
|
# Changes since 0.10:
|
8
8
|
# 1. Removed HTTP/write.rb, since I wanted to reimplement it using standard File methods and not my custom written File.write. It may stay gone, but I'm not sure yet...
|
9
9
|
# 2. + HTTP.gemspec
|
10
10
|
# 3. + README.md
|
11
|
+
# 0/1
|
12
|
+
# 4. + String/url_encode, which was left out previously.
|
11
13
|
|
12
14
|
lib_dir = File.expand_path(File.join(__FILE__, '..'))
|
13
15
|
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# String/url_encode.rb
|
2
|
+
# String#url_encode
|
3
|
+
|
4
|
+
# 20130310
|
5
|
+
# 0.2.1
|
6
|
+
|
7
|
+
# Description: When I went looking for a means to url encode and decode strings, I wanted something which used extensions to the String class. Of course there are other means to do url encoding and decoding including using the CGI class, but I liked the approach of having this 'built-in' to strings, rather than the string being passed as a parameter as does CGI. Hence this String extender...
|
8
|
+
|
9
|
+
# Acknowledgements: I've simply ripped off and refashioned the code from the CGI module!...
|
10
|
+
|
11
|
+
# Changes since 0.1:
|
12
|
+
# 1. The url_encode and url_decode methods now are strictly demarcated.
|
13
|
+
# 0/1
|
14
|
+
# 2. A small reformat.
|
15
|
+
|
16
|
+
class String
|
17
|
+
|
18
|
+
def url_encode
|
19
|
+
self.gsub(/([^ a-zA-Z0-9_.-]+)/n) do
|
20
|
+
'%' + $1.unpack('H2' * $1.size).join('%').upcase
|
21
|
+
end.tr(' ', '+')
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: http.rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- thoran
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: HTTP is the simplest HTTP mezzanine library for Ruby. Supply a URI, some
|
14
14
|
optional query arguments, some optional headers, and some other SSL or Net::HTTP
|
@@ -27,6 +27,7 @@ files:
|
|
27
27
|
- lib/Hash/x_www_form_urlencode.rb
|
28
28
|
- lib/Net/HTTP/Get/set_headers.rb
|
29
29
|
- lib/Net/HTTP/Post/set_headers.rb
|
30
|
+
- lib/String/url_encode.rb
|
30
31
|
- lib/URI/Generic/use_sslQ.rb
|
31
32
|
- spec/HTTP.rb
|
32
33
|
- spec/HTTP/get_spec.rb
|