http.rb 0.11.0 → 0.11.1

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
  SHA1:
3
- metadata.gz: 1aa084204b33f143035faeb227200b624899c909
4
- data.tar.gz: fed0d738b0d4482348b74e136388ae96520f9353
3
+ metadata.gz: cbf011f369bb382e03c0ec192cb6ab4d0cad2f0e
4
+ data.tar.gz: 0f6803e5073848ba81088f019cd70e3d10be1f66
5
5
  SHA512:
6
- metadata.gz: 700033cbab49f2cd006e9d35a0c38ad46f90487877e6929957f8339d045d4e9c92f841665839c5617dceb9c71252f1f03837d17840c4611683453f3b3a511ff0
7
- data.tar.gz: 301840cf8085e1b47ff4a6ec7c099032351099fe9da205a8a6e8a14d3bbde5b2a71b9f2fc5244c7e3687e9424f3e10d4929151d69570bce51e73f7f30318458e
6
+ metadata.gz: 0e2584ee7057eebefe3bea61cc7946b92e0a8b11032aceb3c512dff88c62069924233ef82384199f0eb82785d53df3a1b04499c584ac6e8fda2e150f394b9745
7
+ data.tar.gz: ec8300cb750bc3afd170a29a99de366b6d821a52d7f1ae26ff5d9ae5cd394dab0094cb90b8f866d7dbb2af43b4a94cf0bdd93b17da5b7bbd43531f39f672f7fc
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'http.rb'
3
- s.version = '0.11.0'
4
- s.date = '2015-03-19'
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, \
@@ -1,13 +1,15 @@
1
1
  # HTTP.rb
2
2
  # HTTP
3
3
 
4
- # 20150319
5
- # 0.11.0
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.0
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-03-19 00:00:00.000000000 Z
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