http.rb 1.6.0 → 1.7.0

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: 2483f99ec13020c1e1c780b84c7dcddc68437687b1176e7fb88ba228adf084af
4
- data.tar.gz: 710dd8eed5142ac832553595e581bd2597174dd1131fb14a7c51d4e7f17f4992
3
+ metadata.gz: 9a0a461fdf56bdea8f5f4b1940f0af469ef67e3fd7bd1319cc33245ff50641bb
4
+ data.tar.gz: 45e533a1a9cf2934d78cc8b6f29e58e4a73e8d26485a1cef12ad98f4be04b9e7
5
5
  SHA512:
6
- metadata.gz: dbe519101ddbd07038de07ca7bbcb28bbb2b7c53d0f650df86092433271469da3491326dce2d9c3698f78cb381de5a9f48b57054b0b8b8301adc1118e2cead87
7
- data.tar.gz: 87e66da4b78467b289dafc3a280a7f9592af77e39f6878128c3586a0ea7ade24e2589239e8beb35d43c8e52e31ca79626f04d1ee1f31347b55f5ddf41945145a
6
+ metadata.gz: 73bc96382cf88af02f52f48e36d004e9b1dfee91e658700495f712632d55793f1543e253bdcccca09c6bda7fc71c59d61448818f89b8b8fc1a355becfd5d3ffb
7
+ data.tar.gz: 814f7dcd3026a55a675c87d311b8e724f843895768c996c4e4c5f3283c38a81f46d03934256fa832835135229a042439655261a649bccec07cb5e8189006a010
data/CHANGELOG CHANGED
@@ -1,4 +1,14 @@
1
- # CHANGELOG
1
+ # http/CHANGELOG
2
+
3
+ ## 20261018
4
+
5
+ 1.7.0: lib/HTTP.rb --> lib/http.rb
6
+
7
+ 1. lib/HTTP.rb --> lib/http.rb, so that it resolves the same on case-sensitive filesystems.
8
+ 2. + test/loading_test.rb: lib/ carries http.rb, and require 'http.rb' in a fresh process defines HTTP and HTTP::VERSION.
9
+ 3. ~ test/helper.rb: + skip_webmocks_http_rb_adapter()
10
+ 4. ~ HTTP::VERSION: /1.6.0/1.7.0/
11
+
2
12
 
3
13
  ## 20261011
4
14
 
data/lib/HTTP/VERSION.rb CHANGED
@@ -2,5 +2,5 @@
2
2
  # HTTP::VERSION
3
3
 
4
4
  module HTTP
5
- VERSION = '1.6.0'
5
+ VERSION = '1.7.0'
6
6
  end
@@ -1,4 +1,4 @@
1
- # HTTP.rb
1
+ # http.rb
2
2
  # HTTP
3
3
 
4
4
  require 'HTTP/METHODS'
data/test/helper.rb CHANGED
@@ -3,16 +3,19 @@
3
3
  lib_dir = File.expand_path(File.join(__FILE__, '..', '..', 'lib'))
4
4
  $LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
5
5
 
6
- # Skip webmock's http_rb adapter: it auto-requires 'http', which collides
7
- # with this gem's lib/HTTP.rb on case-insensitive filesystems and crashes
8
- # while trying to monkey-patch the wrong HTTP module.
6
+ # webmock's http_rb adapter's require 'http' finds this gem's lib/http.rb,
7
+ # takes HTTP::VERSION for the http gem's, and crashes trying to
8
+ # monkey-patch an HTTP::Client which isn't there.
9
+ def skip_webmocks_http_rb_adapter
10
+ gem 'webmock'
9
11
 
10
- gem 'webmock'
12
+ $LOADED_FEATURES << File.join(
13
+ Gem.loaded_specs['webmock'].full_gem_path,
14
+ 'lib/webmock/http_lib_adapters/http_rb_adapter.rb'
15
+ )
16
+ end
11
17
 
12
- $LOADED_FEATURES << File.join(
13
- Gem.loaded_specs['webmock'].full_gem_path,
14
- 'lib/webmock/http_lib_adapters/http_rb_adapter.rb'
15
- )
18
+ skip_webmocks_http_rb_adapter
16
19
 
17
20
  require 'minitest/autorun'
18
21
  require 'minitest/mock'
@@ -0,0 +1,30 @@
1
+ # test/loading_test.rb
2
+
3
+ require 'minitest/autorun'
4
+
5
+ require_relative '../lib/http'
6
+
7
+ # In its own process, since this one has loaded the file directly and so could
8
+ # not tell what requiring the gem by its own name would bring.
9
+ describe 'loading' do
10
+ def ruby(source)
11
+ lib = File.expand_path('../lib', __dir__)
12
+ IO.popen(['ruby', "-I#{lib}", '-e', source], err: [:child, :out]){|io| io.read}.strip
13
+ end
14
+
15
+ # The gem is http.rb, so require 'http.rb' reads lib/http.rb. A capitalised
16
+ # load file answers that only on a case-insensitive filesystem. Dir.entries
17
+ # reports the name as stored, so this asks what a case-sensitive filesystem
18
+ # would ask.
19
+ it "carries the lowercase file the gem's name asks for" do
20
+ _(Dir.entries(File.expand_path('../lib', __dir__))).must_include 'http.rb'
21
+ end
22
+
23
+ it "defines HTTP upon requiring the gem by name" do
24
+ _(ruby('require "http.rb"; print defined?(HTTP)')).must_equal 'constant'
25
+ end
26
+
27
+ it "defines the version too" do
28
+ _(ruby('require "http.rb"; print HTTP::VERSION')).must_equal HTTP::VERSION
29
+ end
30
+ end
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.6.0
4
+ version: 1.7.0
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/REDIRECT.rb
99
98
  - lib/HTTP/RETRY.rb
@@ -108,6 +107,7 @@ files:
108
107
  - lib/Thoran/Hash/XWwwFormUrlencode/x_www_form_urlencode.rb
109
108
  - lib/Thoran/String/Urlencode/urlencode.rb
110
109
  - lib/URI/Generic/use_sslQ.rb
110
+ - lib/http.rb
111
111
  - test/HTTP/METHODS_test.rb
112
112
  - test/HTTP/REDIRECT_test.rb
113
113
  - test/HTTP/RETRY_test.rb
@@ -126,6 +126,7 @@ files:
126
126
  - test/Net/HTTPResponse/StatusPredicates_test.rb
127
127
  - test/Thoran/String/Urlencode/urlencode_test.rb
128
128
  - test/helper.rb
129
+ - test/loading_test.rb
129
130
  homepage: https://github.com/thoran/http
130
131
  licenses:
131
132
  - MIT