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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1cb6ffe1146cced4e3a576fcb776e13143be9a51e04352b421bec43eb18ca495
4
- data.tar.gz: d071d8653cc3b7ad160a3e556a045d4441b425a1830b1c60ddef64703feab641
3
+ metadata.gz: 208c9a4755a3fe8a5a5567458d470fb9c7725dc987c9949c314978d1dbe1ec07
4
+ data.tar.gz: 248c91da8c2c7b14f63a28c147f147aef924bbabdf80a05624b9db33822edb0f
5
5
  SHA512:
6
- metadata.gz: fa509ffb0416b20cbb3cde6820d69a4daa6560f741ce69088dda99ed55b61394ec6964608a7a3156fb8cd17cdae7fc48b5d3d912efb5981f6658ddfc429faedb
7
- data.tar.gz: 4c1b2ce423984fe8c5c043360fd40196bc9e79007182b6b6d2fce605948ac2e166b8ef9d4a6028e7687044164b323a397f02573d3c6885e8b226e4c2e708d04f
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
@@ -75,10 +75,6 @@ class Simple::HTTP
75
75
  perform_request!(:HEAD, url, nil, headers)
76
76
  end
77
77
 
78
- def head!(url, headers = {})
79
- perform_request!(:HEAD, url, nil, headers)
80
- end
81
-
82
78
  def get(url, headers = {})
83
79
  perform_request!(:GET, url, nil, headers)
84
80
  end
@@ -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.5
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-02-18 00:00:00.000000000 Z
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.4
82
+ rubygems_version: 3.0.6
82
83
  signing_key:
83
84
  specification_version: 4
84
85
  summary: Simple code for simple HTTP requests