Class: VCR::HttpStubbingAdapters::Base
- Inherits:
-
Object
- Object
- VCR::HttpStubbingAdapters::Base
- Defined in:
- lib/vcr/http_stubbing_adapters/base.rb
Class Method Summary collapse
- .meets_version_requirement?(version, required_version) ⇒ Boolean
- .with_http_connections_allowed_set_to(value) ⇒ Object
Class Method Details
.meets_version_requirement?(version, required_version) ⇒ Boolean
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/vcr/http_stubbing_adapters/base.rb', line 18 def meets_version_requirement?(version, required_version) major, minor, patch = *version.split('.').map { |v| v.to_i } req_major, req_minor, req_patch = *required_version.split('.').map { |v| v.to_i } return false if major < req_major return true if major > req_major return false if minor < req_minor return true if minor > req_minor patch >= req_patch end |
.with_http_connections_allowed_set_to(value) ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/vcr/http_stubbing_adapters/base.rb', line 8 def with_http_connections_allowed_set_to(value) original_value = http_connections_allowed? self.http_connections_allowed = value begin yield ensure self.http_connections_allowed = original_value end end |