simple-http 0.3.5 → 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/console +16 -0
- data/lib/simple/http.rb +0 -4
- data/lib/simple/http/checked_response.rb +5 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 208c9a4755a3fe8a5a5567458d470fb9c7725dc987c9949c314978d1dbe1ec07
|
4
|
+
data.tar.gz: 248c91da8c2c7b14f63a28c147f147aef924bbabdf80a05624b9db33822edb0f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c75e8f51182f3306a571c29ed68c7f09a2ebe00da85b5baac81657f022187fbc706db2f207a979fe5a2510d730c4ee06e0930ae2dfb0451b88ef662d474b7f8
|
7
|
+
data.tar.gz: c7c7d42adfc4c5a2dd2d1484d59d7d1fe911883f8c9d8cdd538a37a418235bfefe41ab5fe5c8cc9146c126d8dcaae13c79f1f8328eb3b8fa789ba0c2348efdfc
|
data/bin/console
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
root=File.expand_path "#{File.dirname(__FILE__)}/.."
|
3
|
+
$: << "#{root}/lib"
|
4
|
+
|
5
|
+
require "bundler"
|
6
|
+
Bundler.require
|
7
|
+
|
8
|
+
require "simple-http"
|
9
|
+
|
10
|
+
STDERR.puts <<~MSG
|
11
|
+
# example
|
12
|
+
Simple::HTTP.new.get("https://httpbin.org/get")
|
13
|
+
MSG
|
14
|
+
|
15
|
+
require "pry"
|
16
|
+
pry
|
data/lib/simple/http.rb
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
module Simple::HTTP::CheckedResponse
|
2
2
|
SELF = self
|
3
3
|
|
4
|
+
def head!(url, headers = {})
|
5
|
+
response = perform_request!(:HEAD, url, nil, headers)
|
6
|
+
response.check_response_status!
|
7
|
+
end
|
8
|
+
|
4
9
|
def get!(url, headers = {}, into: nil)
|
5
10
|
response = perform_request!(:GET, url, nil, headers)
|
6
11
|
response.checked_content(into: into)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple-http
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- radiospiel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: expectation
|
@@ -37,6 +37,7 @@ extensions: []
|
|
37
37
|
extra_rdoc_files: []
|
38
38
|
files:
|
39
39
|
- README.md
|
40
|
+
- bin/console
|
40
41
|
- lib/simple-http.rb
|
41
42
|
- lib/simple/http.rb
|
42
43
|
- lib/simple/http/caching.rb
|
@@ -78,7 +79,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
78
79
|
- !ruby/object:Gem::Version
|
79
80
|
version: '0'
|
80
81
|
requirements: []
|
81
|
-
rubygems_version: 3.0.
|
82
|
+
rubygems_version: 3.0.6
|
82
83
|
signing_key:
|
83
84
|
specification_version: 4
|
84
85
|
summary: Simple code for simple HTTP requests
|