Skip to content

Commit e46090a

Browse files
committed
⚠️ Removes the upper restriciton on Faraday
This was discussed internally, and the reasoning is as follows: * It is known that faraday may introduce breaking changes with any minor, as long as they do not switch to 1.x * We add a warning of that fact to the README file and state, which versions of faraday are known to work. * If faraday introduces a breaking change, any user of cloudflair has to option to restrict faraday to a version known to work in their `Gemfile`. * This will allow to use any newer version of faraday when it becomes available, but still allows to restrict the version of faraday to any specific version should one choose to do so, but it would have to be done explicitly in their own `Gemfile`.
1 parent f3fe2ef commit e46090a

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

README.md

+16
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,22 @@ Or install it yourself as:
2323

2424
$ gem install cloudflair
2525

26+
## A Note on Faraday
27+
28+
We have decided to not tightly control the version of faraday (anymore). The versions of faraday that are known to work are listed below. If you want to update to a newer version, you're doing it at your own risk. (But if it works, which is usually when all specs pass, please send a PR to update the list below.)
29+
30+
To be on the safe side, we recommend to lock `faraday` to any of the versions listed below. This can be done like this:
31+
32+
```ruby
33+
gem 'cloudflair'
34+
gem 'faraday', '>=0.13', '<0.14'
35+
```
36+
37+
### Faraday Versions known to work
38+
39+
* `gem 'faraday', '>= 0.12', '<= 0.13'`
40+
* `gem 'faraday', '>= 0.13', '<= 0.14'` (starting with `gem 'cloudflair', '>= 0.2.0'`)
41+
2642
## Usage
2743

2844
### Configuration

cloudflair.gemspec

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# coding: utf-8
2+
23
lib = File.expand_path('../lib', __FILE__)
34
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
45
require 'cloudflair/version'
@@ -19,9 +20,9 @@ Gem::Specification.new do |spec|
1920
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
2021
spec.bindir = 'exe'
2122
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22-
spec.require_paths = %w(lib)
23+
spec.require_paths = %w[lib]
2324

24-
spec.add_runtime_dependency 'faraday', '>= 0.10.0', '< 0.14'
25+
spec.add_runtime_dependency 'faraday', '>= 0.10.0'
2526
spec.add_runtime_dependency 'faraday_middleware'
2627
spec.add_runtime_dependency 'dry-configurable', '~> 0.1'
2728
spec.add_runtime_dependency 'faraday-detailed_logger'

lib/cloudflair/connection.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def self.headers
2020
elsif !cloudflare_auth_config.user_service_key.nil?
2121
headers['X-Auth-User-Service-Key'] = cloudflare_auth_config.user_service_key
2222
else
23-
fail CloudflairError, 'Neither email & key nor user_service_key have been defined.'
23+
raise CloudflairError, 'Neither email & key nor user_service_key have been defined.'
2424
end
2525
headers
2626
end

0 commit comments

Comments
 (0)