nice_http 1.10.0 → 1.10.1

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: 1059fecf29256a3b57fbe27257398501830f3385e947c7d2922cdc57c4aab031
4
- data.tar.gz: 7961065317e4fc908cdc2d9a258e6a6b1614872a203254fa8a8f98bb9368feda
3
+ metadata.gz: eba012b6fef9f47963dc8d88eef3f56138ce1ccdbd90a781d4aa0c399069b71f
4
+ data.tar.gz: 0a0c45f8082eb7fe65a6aa68eec0a7af0425502a911ec60d972e5621a2b9d7b9
5
5
  SHA512:
6
- metadata.gz: 34e4639b8c9a3b8c3dc25c4515d95e52d0ebe0dda4c2895bb4ef67a8db56401a06d0e9cc152d680b11e12aab4f29299fba3f17c0b924aa3851607f936a4bb1ef
7
- data.tar.gz: 782a12d030df576799172bad7f46f01949940d8f4521fe4842a9f3379becb5628caff7b85f7c6a695a2e59946b0ee70692a5d3ec1fc1e044065daecf8a638682
6
+ metadata.gz: 0ee35fad14ffd5afee69bad03e927c860495d92b6772ab3060572e3353d07a124bf46ae366fa82217b6a076c693d10135cc40dc26f9c69368c72de31e591ef79
7
+ data.tar.gz: b67acb7553b2968bec31567578da6513e3819d274ae443a2f6ab30b9614bbe2782c81d0684324c4a3cd15f7ba01b0656fa0bbda0c8a59f03885df695180597b7
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # NiceHttp
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/nice_http.svg)](https://rubygems.org/gems/nice_http)
4
- [![Build Status](https://travis-ci.com/MarioRuiz/nice_http.svg?branch=master)](https://github.com/MarioRuiz/nice_http)
4
+ [![CI](https://github.com/MarioRuiz/nice_http/actions/workflows/ci.yml/badge.svg)](https://github.com/MarioRuiz/nice_http/actions/workflows/ci.yml)
5
5
  [![Coverage Status](https://coveralls.io/repos/github/MarioRuiz/nice_http/badge.svg?branch=master)](https://coveralls.io/github/MarioRuiz/nice_http?branch=master)
6
6
  ![Gem](https://img.shields.io/gem/dt/nice_http)
7
7
  ![GitHub commit activity](https://img.shields.io/github/commit-activity/y/MarioRuiz/nice_http)
@@ -83,7 +83,16 @@ module NiceHttpManageRequest
83
83
  }
84
84
  headers_t["Cookie"] = cookies_to_set_str
85
85
 
86
- method_s = caller[0].to_s().scan(/:in `(.*)'/).join
86
+ method_s = caller_locations(1, 10).map(&:base_label).find do |label|
87
+ %w[get post put patch delete head send_request].include?(label)
88
+ end
89
+ if method_s == "send_request" && arguments.size == 1 && arguments[0].kind_of?(Hash) && arguments[0].key?(:method)
90
+ method_s = arguments[0][:method].to_s
91
+ end
92
+ if method_s.to_s == ""
93
+ method_s = caller[0].to_s().scan(/:in `(.*)'/).join
94
+ end
95
+ method_s = "request" if method_s.to_s == ""
87
96
  @request[:method] = method_s.upcase
88
97
  self.class.request[:method] = @request[:method]
89
98
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nice_http
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.0
4
+ version: 1.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mario Ruiz