http.rb 1.3.0 → 1.3.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 06d8c18c5bfecb35e07a63571d9f4a874da28ae9c20a368781e2ecb01f3ebf7f
4
- data.tar.gz: f2f58d2f70bb3aeaa7b03d7a2ad3c234fe23536a0e53a8dec312b22da8f0f695
3
+ metadata.gz: f9b1a14689933d1d7a46f7ebf6619e5807369ed65455d6d0692f170689054c73
4
+ data.tar.gz: 4d2926d31cbf21835ee921f07561a7a3f895b468ffac5ed785d4229daef63e13
5
5
  SHA512:
6
- metadata.gz: 989858d90f01ab5b85678baf5241ff61a1e620a3c338442dd8ba512d11c5de81fa6cdb92abb39431e88d4e4372c9df4cd11883d06d111bc7a7e3bec91c1c8b55
7
- data.tar.gz: ace86800c9010db5b30b6d6814196ba0d689781757076f0fab6b1b0c0b235d2557e350180010b20e6e0face72d55eb2a2c8c9933ebaed51b9ec2c49a3f4b3fc7
6
+ metadata.gz: df0b85c36dac9788b1c84bae13536a49e4444dd6953b2a512121b38261137ef3d99328cdde7ab202013246846b7271c4cd888b3ee049754f562cbebb1dbc7dd6
7
+ data.tar.gz: 07ff77f55a32f39134cf410de9eafd92deb5359d5b8398fde310500c1e024464001eef150eef9aee140922bedfedd6d6c165394de98540826f60cea5d43ada9d
data/CHANGELOG CHANGED
@@ -1,5 +1,26 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 20260819
4
+
5
+ 1.3.2: ~ http.rb.gemspec: spec.files reordered, the globs first.
6
+
7
+ 1. ~ http.rb.gemspec: spec.files reordered, the two Dir globs first and the loose files alphabetically after them, as moby and measurand have it. The globs are what the gem is and the rest is paperwork, so adding a file to the paperwork now never disturbs them. This gemspec had been pinned first with the globs last, which namo shared and impuri left at its 0.12.1. The same 35 files ship, in the same gem; only the order in the source changes.
8
+ 2. ~ HTTP::VERSION: /1.3.1/1.3.2/
9
+
10
+
11
+ ## 20260713
12
+
13
+ 1.3.1: Use Thoran Namespace for URL-encoding extensions.
14
+
15
+ The String#url_encode and Hash#x_www_form_urlencode extensions reopened the core classes directly. Both now live in named modules under the Thoran:: namespace — Thoran::String::Urlencode and Thoran::Hash::XWwwFormUrlencode — mixed into String and Hash.
16
+
17
+ 1. + Thoran::String::Urlencode#urlencode
18
+ 2. - String#url_encode
19
+ 3. + Thoran::Hash::XWwwFormUrlencode#x_www_form_urlencode
20
+ 4. ~ Hash#x_www_form_urlencode: Requires the Thoran namespaced equivalent.
21
+ 5. ~ HTTP::VERSION: /1.3.0/1.3.1/
22
+ 6. ~ CHANGELOG: + 1.3.1 entry
23
+
3
24
  ## 20260610
4
25
 
5
26
  1.3.0: Rename VERBS to METHODS; VERBS retained as a deprecated alias.
data/http.rb.gemspec CHANGED
@@ -24,14 +24,14 @@ Gem::Specification.new do |spec|
24
24
  spec.require_paths = ['lib']
25
25
 
26
26
  spec.files = [
27
- 'http.rb.gemspec',
27
+ Dir['lib/**/*.rb'],
28
+ Dir['test/**/*.rb'],
28
29
  'CHANGELOG',
29
30
  'Gemfile',
31
+ 'http.rb.gemspec',
30
32
  'LICENSE',
31
33
  'Rakefile',
32
34
  'README.md',
33
- Dir['lib/**/*.rb'],
34
- Dir['test/**/*.rb'],
35
35
  ].flatten
36
36
 
37
37
  spec.development_dependencies = [
data/lib/HTTP/VERSION.rb CHANGED
@@ -2,5 +2,5 @@
2
2
  # HTTP::VERSION
3
3
 
4
4
  module HTTP
5
- VERSION = '1.3.0'
5
+ VERSION = '1.3.2'
6
6
  end
@@ -1,10 +1,7 @@
1
1
  # Hash/x_www_form_urlencode.rb
2
2
  # Hash#x_www_form_urlencode
3
3
 
4
- require_relative '../String/url_encode'
4
+ # 20260713
5
+ # 0.2.0
5
6
 
6
- class Hash
7
- def x_www_form_urlencode(joiner = '&')
8
- inject([]){|a,e| a << "#{e.first.to_s.url_encode.gsub(/ /, '+')}=#{e.last.to_s.url_encode.gsub(/ /, '+')}" unless e.last.nil?; a}.join(joiner)
9
- end
10
- end
7
+ require 'Thoran/Hash/XWwwFormUrlencode/x_www_form_urlencode'
@@ -0,0 +1,27 @@
1
+ # Thoran/Hash/XWwwFormUrlencode/x_www_form_urlencode.rb
2
+ # Thoran::Hash::XWwwFormUrlencode#x_www_form_urlencode
3
+
4
+ # 20260713
5
+ # 0.3.0
6
+
7
+ # Changes since 0.2:
8
+ # -/0: (The class name and the snake case name really are consistent now.)
9
+ # 1. /XWwwFormUrlEncode/XWwwFormUrlencode/
10
+ # 2. /url_encode/urlencode/
11
+
12
+ require 'Thoran/String/Urlencode/urlencode'
13
+
14
+ module Thoran
15
+ module Hash
16
+ module XWwwFormUrlencode
17
+
18
+ def x_www_form_urlencode(joiner = '&')
19
+ inject([]){|a,e| a << "#{e.first.to_s.urlencode}=#{e.last.to_s.urlencode}" unless e.last.nil?; a}.join(joiner)
20
+ end
21
+ alias_method :x_www_form_url_encode, :x_www_form_urlencode
22
+
23
+ end
24
+ end
25
+ end
26
+
27
+ Hash.send(:include, Thoran::Hash::XWwwFormUrlencode)
@@ -0,0 +1,29 @@
1
+ # Thoran/String/Urlencode/urlencode.rb
2
+ # Thoran::String::Urlencode#urlencode
3
+
4
+ # 20260713
5
+ # 0.4.0
6
+
7
+ # Acknowledgements: I've simply ripped off and refashioned the code from the CGI module!...
8
+
9
+ # Changes since 0.3:
10
+ # -/0: More consistent naming.
11
+ # 1. /UrlEncode/Urlencode/
12
+ # 2. /url_encode/urlencode/
13
+
14
+ module Thoran
15
+ module String
16
+ module Urlencode
17
+
18
+ def urlencode
19
+ self.gsub(/([^ a-zA-Z0-9_.-]+)/n) do
20
+ '%' + $1.unpack('H2' * $1.size).join('%').upcase
21
+ end.tr(' ', '+')
22
+ end
23
+ alias_method :url_encode, :urlencode
24
+
25
+ end
26
+ end
27
+ end
28
+
29
+ String.send(:include, Thoran::String::Urlencode)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: http.rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - thoran
@@ -93,7 +93,6 @@ files:
93
93
  - README.md
94
94
  - Rakefile
95
95
  - http.rb.gemspec
96
- - lib/HTTP.rb
97
96
  - lib/HTTP/METHODS.rb
98
97
  - lib/HTTP/RETRY.rb
99
98
  - lib/HTTP/VERSION.rb
@@ -104,8 +103,10 @@ files:
104
103
  - lib/Net/HTTP/set_options.rb
105
104
  - lib/Net/HTTPRequest/set_headers.rb
106
105
  - lib/Net/HTTPResponse/StatusPredicates.rb
107
- - lib/String/url_encode.rb
106
+ - lib/Thoran/Hash/XWwwFormUrlencode/x_www_form_urlencode.rb
107
+ - lib/Thoran/String/Urlencode/urlencode.rb
108
108
  - lib/URI/Generic/use_sslQ.rb
109
+ - lib/http.rb
109
110
  - test/HTTP/METHODS_test.rb
110
111
  - test/HTTP/RETRY_test.rb
111
112
  - test/HTTP/basic_auth_test.rb
@@ -139,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
140
  - !ruby/object:Gem::Version
140
141
  version: '0'
141
142
  requirements: []
142
- rubygems_version: 4.0.13
143
+ rubygems_version: 4.0.18
143
144
  specification_version: 4
144
145
  summary: HTTP made easy.
145
146
  test_files: []
@@ -1,24 +0,0 @@
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
File without changes