cloudflare 4.1.2 → 4.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +8 -0
- data/Gemfile +2 -0
- data/cloudflare.gemspec +1 -1
- data/lib/cloudflare.rb +3 -3
- data/lib/cloudflare/paginate.rb +1 -1
- data/lib/cloudflare/rspec/connection.rb +13 -1
- data/lib/cloudflare/version.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 626ea2f798763660de19bc89189844304761b3db0c7db35f7bf8db5910844df6
|
4
|
+
data.tar.gz: 206a3f3f19a7b0db41371f63a151b3e626fd2686f02b9f4bd7118d612bc48c06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67914afda228ba0a5a1d3ce5e51ef38e7c7ccf38a69015d8b82408f620f48a32874ba008f5172915300826c2c461c115d029bf8ac8862547c486952d623f918e
|
7
|
+
data.tar.gz: 8ec079ac0dd5de6bfa9d74db9a0ff987579bb37b2a93b52ef2ba3265dfa543b1898c1b898045065ab561645082f360f6d5471d38f81707d51f8c465f5cde3370
|
data/.travis.yml
CHANGED
@@ -2,6 +2,11 @@ language: ruby
|
|
2
2
|
dist: xenial
|
3
3
|
cache: bundler
|
4
4
|
|
5
|
+
addons:
|
6
|
+
apt:
|
7
|
+
packages:
|
8
|
+
- squid
|
9
|
+
|
5
10
|
matrix:
|
6
11
|
include:
|
7
12
|
- rvm: 2.4
|
@@ -13,6 +18,9 @@ matrix:
|
|
13
18
|
env: JRUBY_OPTS="--debug -X+O"
|
14
19
|
- rvm: truffleruby
|
15
20
|
- rvm: ruby-head
|
21
|
+
- rvm: 2.6
|
22
|
+
env: CLOUDFLARE_PROXY=http://localhost:3128
|
23
|
+
before_script: sudo service squid start
|
16
24
|
allow_failures:
|
17
25
|
- rvm: ruby-head
|
18
26
|
- rvm: jruby-head
|
data/Gemfile
CHANGED
data/cloudflare.gemspec
CHANGED
data/lib/cloudflare.rb
CHANGED
@@ -25,10 +25,10 @@ require 'async'
|
|
25
25
|
require_relative 'cloudflare/connection'
|
26
26
|
|
27
27
|
module Cloudflare
|
28
|
-
|
28
|
+
DEFAULT_ENDPOINT = Async::HTTP::Endpoint.parse('https://api.cloudflare.com/client/v4')
|
29
29
|
|
30
|
-
def self.connect(key: nil, email: nil)
|
31
|
-
representation = Connection.for(
|
30
|
+
def self.connect(endpoint = DEFAULT_ENDPOINT, key: nil, email: nil)
|
31
|
+
representation = Connection.for(endpoint)
|
32
32
|
|
33
33
|
if key
|
34
34
|
representation = representation.authenticated(key, email)
|
data/lib/cloudflare/paginate.rb
CHANGED
@@ -21,6 +21,8 @@
|
|
21
21
|
# THE SOFTWARE.
|
22
22
|
|
23
23
|
require 'async/rspec'
|
24
|
+
require 'async/http/proxy'
|
25
|
+
|
24
26
|
require_relative '../../cloudflare'
|
25
27
|
|
26
28
|
module Cloudflare
|
@@ -35,10 +37,20 @@ module Cloudflare
|
|
35
37
|
let(:email) {ENV['CLOUDFLARE_EMAIL']}
|
36
38
|
let(:key) {ENV['CLOUDFLARE_KEY']}
|
37
39
|
|
38
|
-
let(:connection)
|
40
|
+
let(:connection) do
|
41
|
+
if proxy_url = ENV['CLOUDFLARE_PROXY']
|
42
|
+
proxy_endpoint = Async::HTTP::Endpoint.parse(proxy_url)
|
43
|
+
@client = Async::HTTP::Client.new(proxy_endpoint)
|
44
|
+
@connection = Cloudflare.connect(@client.proxied_endpoint(DEFAULT_ENDPOINT), key: key, email: email)
|
45
|
+
else
|
46
|
+
@client = nil
|
47
|
+
@connection = Cloudflare.connect(key: key, email: email)
|
48
|
+
end
|
49
|
+
end
|
39
50
|
|
40
51
|
after do
|
41
52
|
@connection&.close
|
53
|
+
@client&.close
|
42
54
|
end
|
43
55
|
end
|
44
56
|
end
|
data/lib/cloudflare/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -72,7 +72,7 @@ RSpec.configure do |config|
|
|
72
72
|
end
|
73
73
|
account.kv_namespaces.to_a
|
74
74
|
rescue Cloudflare::RequestError => e
|
75
|
-
if e.message.include?('your account is not
|
75
|
+
if e.message.include?('your account is not entitled')
|
76
76
|
puts 'Disabling KV specs due to no access'
|
77
77
|
disabled_specs[:kv_spec] = true
|
78
78
|
else
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloudflare
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.1.
|
4
|
+
version: 4.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marcin Prokop
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-
|
12
|
+
date: 2019-08-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: async-rest
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 0.
|
20
|
+
version: 0.10.0
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: 0.
|
27
|
+
version: 0.10.0
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: async-rspec
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|