Files changed (63) hide show
  1. checksums.yaml +5 -5
  2. data/.rubocop.yml +38 -0
  3. data/.ruby-gemset +1 -0
  4. data/.ruby-version +1 -1
  5. data/.travis.yml +13 -2
  6. data/Gemfile +2 -0
  7. data/README.md +20 -8
  8. data/Rakefile +2 -0
  9. data/VERSION +1 -0
  10. data/cloudflair.gemspec +15 -11
  11. data/lib/cloudflair.rb +2 -0
  12. data/lib/cloudflair/api.rb +2 -0
  13. data/lib/cloudflair/api/railguns.rb +2 -0
  14. data/lib/cloudflair/api/zone.rb +3 -0
  15. data/lib/cloudflair/api/zone/analytics.rb +2 -0
  16. data/lib/cloudflair/api/zone/available_plan.rb +2 -0
  17. data/lib/cloudflair/api/zone/available_rate_plan.rb +2 -0
  18. data/lib/cloudflair/api/zone/custom_hostname.rb +19 -0
  19. data/lib/cloudflair/api/zone/dns_record.rb +3 -0
  20. data/lib/cloudflair/api/zone/purge_cache.rb +4 -2
  21. data/lib/cloudflair/api/zone/railgun.rb +2 -0
  22. data/lib/cloudflair/api/zone/settings.rb +30 -28
  23. data/lib/cloudflair/api/zone/settings/advanced_ddos.rb +2 -0
  24. data/lib/cloudflair/api/zone/settings/always_online.rb +2 -0
  25. data/lib/cloudflair/api/zone/settings/browser_cache_ttl.rb +2 -0
  26. data/lib/cloudflair/api/zone/settings/browser_check.rb +2 -0
  27. data/lib/cloudflair/api/zone/settings/cache_level.rb +2 -0
  28. data/lib/cloudflair/api/zone/settings/challenge_ttl.rb +2 -0
  29. data/lib/cloudflair/api/zone/settings/development_mode.rb +2 -0
  30. data/lib/cloudflair/api/zone/settings/email_obfuscation.rb +2 -0
  31. data/lib/cloudflair/api/zone/settings/hotlink_protection.rb +2 -0
  32. data/lib/cloudflair/api/zone/settings/ip_geolocation.rb +2 -0
  33. data/lib/cloudflair/api/zone/settings/ipv6.rb +2 -0
  34. data/lib/cloudflair/api/zone/settings/minify.rb +2 -0
  35. data/lib/cloudflair/api/zone/settings/mirage.rb +2 -0
  36. data/lib/cloudflair/api/zone/settings/mobile_redirect.rb +2 -0
  37. data/lib/cloudflair/api/zone/settings/origin_error_page_pass_thru.rb +2 -0
  38. data/lib/cloudflair/api/zone/settings/polish.rb +2 -0
  39. data/lib/cloudflair/api/zone/settings/prefetch_preload.rb +2 -0
  40. data/lib/cloudflair/api/zone/settings/response_buffering.rb +2 -0
  41. data/lib/cloudflair/api/zone/settings/rocket_loader.rb +2 -0
  42. data/lib/cloudflair/api/zone/settings/security_header.rb +2 -0
  43. data/lib/cloudflair/api/zone/settings/security_level.rb +2 -0
  44. data/lib/cloudflair/api/zone/settings/server_side_exclude.rb +2 -0
  45. data/lib/cloudflair/api/zone/settings/sort_query_string_for_cache.rb +2 -0
  46. data/lib/cloudflair/api/zone/settings/ssl.rb +2 -0
  47. data/lib/cloudflair/api/zone/settings/tls_1_2_only.rb +2 -0
  48. data/lib/cloudflair/api/zone/settings/tls_1_3.rb +2 -0
  49. data/lib/cloudflair/api/zone/settings/tls_client_auth.rb +2 -0
  50. data/lib/cloudflair/api/zone/settings/true_client_ip_header.rb +2 -0
  51. data/lib/cloudflair/api/zone/settings/waf.rb +2 -0
  52. data/lib/cloudflair/api/zone/settings/websockets.rb +2 -0
  53. data/lib/cloudflair/api/zone__available_plans.rb +2 -0
  54. data/lib/cloudflair/api/zone__custom_hostnames.rb +31 -0
  55. data/lib/cloudflair/api/zone__dns_records.rb +2 -2
  56. data/lib/cloudflair/api/zone__railguns.rb +2 -0
  57. data/lib/cloudflair/communication.rb +23 -20
  58. data/lib/cloudflair/connection.rb +21 -12
  59. data/lib/cloudflair/entity.rb +41 -44
  60. data/lib/cloudflair/error/cloudflair_error.rb +2 -0
  61. data/lib/cloudflair/error/cloudflare_error.rb +2 -0
  62. data/lib/cloudflair/version.rb +2 -1
  63. metadata +73 -27
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
---
2
- SHA1:
3
- metadata.gz: 0640657c68c426446004505f4a0d6267f33fce54
4
- data.tar.gz: f05ed55855749550cf313803694dcb098d957ae3
2
+ SHA256:
3
+ metadata.gz: a94ec96903e9723de8176769d1ca3fa0a3d51fda907b6d53b17b7ad163cb73b0
4
+ data.tar.gz: 73d08b577e5c0bbd77d8f79afec19cb407882c03c6775aefa2da37ced0e60f22
5
5
SHA512:
6
- metadata.gz: 4514e38db0d4502bbdebbd5fb6c6db83fd5b8c96a1251804c644ca416d7f817b1ea8d5e50c03fb8e08e8463bdfaf92878155dcd2fc246f8ef51a01ff80827eef
7
- data.tar.gz: c68a2f703a277480ac68e34da528f27c7c59ceea93456a2eb73715eba8980045ec194616e66feac598400df73bd648937c66955043b6db81515627c6802eae45
6
+ metadata.gz: 521bc18990e5dd9d733da59353377385d95dc9c7e3d3342a9e79ff6dde48fa07ccc91be13420456fd4fc823c1bfdd92e1b1c20187cc9b76e7b1be865edc9415b
7
+ data.tar.gz: 76e763b2a0ad7614217b214ff19521af5c75b6ccfe4235a09450ce0878499632e32d172149fe6e1b855d90ff6db71b4338173ed3ff7e562bdeab38551280d893
data/.rubocop.yml ADDED
@@ -0,0 +1,38 @@
1
+ require:
2
+ - rubocop-performance
3
+ - rubocop-rspec
4
+
5
+ AllCops:
6
+ Exclude:
7
+ - 'bin/**/*'
8
+ - 'db/**/*'
9
+ TargetRubyVersion: 2.6.1
10
+
11
+ Layout/AlignHash:
12
+ EnforcedColonStyle: table
13
+ EnforcedHashRocketStyle: table
14
+
15
+ Metrics/BlockLength:
16
+ Exclude:
17
+ - Guardfile
18
+ - 'spec/**/*spec.rb'
19
+
20
+ Metrics/LineLength:
21
+ Exclude:
22
+ - Guardfile
23
+ Max: 110
24
+
25
+ Rails:
26
+ Enabled: true
27
+
28
+ Rails/HttpPositionalArguments:
29
+ Exclude:
30
+
31
+ Rails/SkipsModelValidations:
32
+ Enabled: false
33
+
34
+ RSpec/MultipleExpectations:
35
+ Enabled: false
36
+
37
+ Style/Documentation:
38
+ Enabled: false
data/.ruby-gemset ADDED
@@ -0,0 +1 @@
1
+ cloudflair
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.3.1
1
+ 2.3.4
data/.travis.yml CHANGED
@@ -1,10 +1,21 @@
1
1
sudo: false
2
2
language: ruby
3
+ before_install: gem install bundler
3
4
rvm:
4
- - 2.3.1
5
- before_install: gem install bundler -v 1.12.5
5
+ - 2.3
6
+ - 2.4
6
7
notifications:
7
8
email:
8
9
on_success: never
9
10
slack:
10
11
secure: o1rlXNKZgQUIIfpzz//KpClcUS/ea5ECbbTaexQYHn84hqPNlsBdWhSrLg2s6MIJ1zSml4NBKQgwQJCV/6keel06XeNPvGPdQLVmSsBCWS4EJ/CvAAsXadghmSDYdsZlTaXvwa2ZdIaCHrM/SncZYi7I+KIiGsbV0KJgYVTlWGPWuN1kh3od1Ixw6W+TFUKONz8OqVFGo2yCr68zDtxUvrY8G/TNRRtWUINHPSIHL7+7JxzOtDZKOITptcLii8tmqi07HtmU7+78lDMlze8ejhchEDKoycTwVOQDRxjjLbDKZsV33nqG5XYRqW8FQv6zJ2c3eCfd2M2Lm+WkPe/ZBQ25Ok4/wK35T0oPt5lW6LKRNt202nQiI6vqn54489knOUpvA60z2r6taIgI3Os8kCdG8rX95Hob4gpU4zLqPNz26vqGiB0vz4DFSJWpRlYK15YT7SpEEMW2luPcTGHaclRSUFgjo/JkVH6zg+1rcMW4ZbKoxJZoNu+nmk9m1Xaz0r5tfJHBzB5XguRcKakRWkhb0rV4Nvo1as1PFtpxt9tiZsIXNTDNtf+upQeJs1Tevm6z4zBGXOIp//MIJEUyUkJ7Fkb+pyRbDOh30JSQJs0Z1y+/LA0rNkbQ+/jjeoKAepnFvawsXZF6UVWZxsBzAkIWTe+bwghnxX4Gm454RiI=
12
+ deploy:
13
+ provider: rubygems
14
+ api_key:
15
+ secure: GisVn77etjRfIwmjsktJVFU182lSuZqbQBsb8jkMoBr0/01fE/tWpZHOMNnKU5JoIaaQAGA0F1w+OXk/eAldvWHbu++074/XcgGerMBV5kxhBOpKEaSu5/cxUfgtGIi2eBBS4xe+GEwtlkI08c6BCiX9pUuUn8LwuUvN7NLNd7nLnZhhnawAoG75aWoMXnudqbIoX/1kGIem8XMuugWwxcr7PsnBy43Mj3yYXmtbO5IW4LC1sDywYc3O/lHmC7hner5yFJSa3kCNN9IMEieRW8/bZAlu3HncfJoORha3tZq37Po/kV8OBuYMoHwxQouCnrh0OW3QNrsmFF+tTy8z132GDjOIaNHwKZyvtXHgfmq4KXdSU5dTlDR5U4Z7jFTbOifc1+UuU1B3RHMHsrqtJgb5ihoXAjtZI8JSjQ7aI+bX9aSt3OpELymuAzoW1mV/Rf4kuNq23jmgDKBEhnR6YdQ864pFGnPL00kPhMUQ+iVX4OFQMZ2/eayYuNGz1LV1WDfFoFSsinZtr/erNnziYJHuzULfFdVg7+ZGMkmLFl7RHiRlphrylW+IN0K+hKEaTDFJ/yVYlLvr/OakR2l4kiPlxfQPXAtmh4MRe1vJdyT3RlGha9qecPddGuzWw3kG8A8bJv9H15YaplHRsu8HryMH5Zt5Tup8cnN37kMrILg=
16
+ gem: cloudflair
17
+ on:
18
+ tags: true
19
+ repo: ninech/cloudflair
20
+ condition: "$TRAVIS_RUBY_VERSION == 2.4"
21
+ skip_cleanup: true
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
source 'https://rubygems.org'
2
4
3
5
# Specify your gem's dependencies in cloudflair.gemspec
data/README.md CHANGED
@@ -5,8 +5,6 @@
5
5
6
6
A simple Ruby-wrapper around Cloudflare's v4 API.
7
7
8
- ![Animation of Homer Simpson using of a rescue flare.](https://media.giphy.com/media/n8A8omwp1mVAA/giphy.gif)
9
-
10
8
## Installation
11
9
12
10
Add this line to your application's Gemfile:
@@ -23,6 +21,22 @@ Or install it yourself as:
23
21
24
22
$ gem install cloudflair
25
23
24
+ ## A Note on Faraday
25
+
26
+ 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.)
27
+
28
+ To be on the safe side, we recommend to lock `faraday` to any of the versions listed below. This can be done like this:
29
+
30
+ ```ruby
31
+ gem 'cloudflair'
32
+ gem 'faraday', '>=0.13', '<0.14'
33
+ ```
34
+
35
+ ### Faraday Versions known to work
36
+
37
+ * `gem 'faraday', '>= 0.12', '<= 0.13'`
38
+ * `gem 'faraday', '>= 0.13', '<= 0.14'` (starting with `gem 'cloudflair', '>= 0.2.0'`)
39
+
26
40
## Usage
27
41
28
42
### Configuration
@@ -98,9 +112,10 @@ A good reference on how to use this wrapper are also the Rspecs.
98
112
* `/zones/:zone_id/available_plans` GET
99
113
* `/zones/:zone_id/available_plans/:plan_id` GET
100
114
* `/zones/:zone_id/available_rate_plans`
115
+ * `/zones/:zone_id/custom_hostnames` GET, POST, PATCH
101
116
* `/zones/:zone_id/dns_records` GET, POST
102
117
* `/zones/:zone_id/dns_records/:record_id` GET, DELETE (PUT not implemented)
103
- * `/zones/:zone_id/purge_cache` DELETE
118
+ * `/zones/:zone_id/purge_cache` POST
104
119
* `/zones/:zone_id/railguns` GET
105
120
* `/zones/:zone_id/railguns/:railgun_id` GET
106
121
* `/zones/:zone_id/railguns/:railgun_id/diagnose` GET, PATCH
@@ -157,7 +172,6 @@ Bug reports and pull requests are welcome on GitHub at [ninech/cloudflair](https
157
172
* Full API support
158
173
* Metrics reporting
159
174
* Rate Limit Tracking
160
- * (Global/Distributed) Rate Limit Tracking
161
175
162
176
## License
163
177
@@ -165,8 +179,6 @@ The gem is available as open source under the terms of the [MIT License](http://
165
179
166
180
## About
167
181
168
- This gem is currently maintained and funded by [nine.ch](https://nine.ch).
182
+ This gem is currently maintained and funded by [nine](https://nine.ch).
169
-
170
- [![nine.ch Logo](https://blog.nine.ch/assets/logo.png)](https://nine.ch)
171
183
172
- We run your Linux server infrastructure – without interruptions, around the clock.
184
+ [![logo of the company 'nine'](https://logo.apps.at-nine.ch/Dmqied_eSaoBMQwk3vVgn4UIgDo=/trim/500x0/logo_claim.png)](https://www.nine.ch)
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'bundler/gem_tasks'
2
4
require 'rspec/core/rake_task'
3
5
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.3.0
data/cloudflair.gemspec CHANGED
@@ -1,13 +1,14 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
1
+ # frozen_string_literal: true
2
+
3
+ lib = File.expand_path('lib', __dir__)
3
4
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
5
require 'cloudflair/version'
5
6
6
7
Gem::Specification.new do |spec|
7
8
spec.name = 'cloudflair'
8
- spec.version = Cloudflair::VERSION
9
+ spec.version = File.read('VERSION')
9
10
spec.authors = ['Christian Mäder']
10
- spec.email = %w(christian.maeder@nine.ch)
11
+ spec.email = %w[christian.maeder@nine.ch]
11
12
12
13
spec.summary = "Wrapper to CloudFlare's v4 REST API."
13
14
spec.description = "Cloudflair aims to provide easy access to CloudFlare's public API."
@@ -19,15 +20,18 @@ Gem::Specification.new do |spec|
19
20
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
20
21
spec.bindir = 'exe'
21
22
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
- spec.require_paths = %w(lib)
23
+ spec.require_paths = %w[lib]
23
24
24
- spec.add_runtime_dependency 'faraday', '~> 0.9.0'
25
- spec.add_runtime_dependency 'faraday_middleware', '~> 0.10.0'
26
25
spec.add_runtime_dependency 'dry-configurable', '~> 0.1'
27
- spec.add_runtime_dependency 'faraday-detailed_logger', '~> 2.1'
26
+ spec.add_runtime_dependency 'faraday', '>= 0.10.0'
27
+ spec.add_runtime_dependency 'faraday-detailed_logger'
28
+ spec.add_runtime_dependency 'faraday_middleware'
28
29
29
- spec.add_development_dependency 'bundler', '~> 1.12'
30
+ spec.add_development_dependency 'bundler', '~> 2.0.0'
30
- spec.add_development_dependency 'rake', '~> 10.0'
31
- spec.add_development_dependency 'rspec', '~> 3.0'
32
31
spec.add_development_dependency 'dotenv', '~> 2.1'
32
+ spec.add_development_dependency 'rake', '~> 12.0'
33
+ spec.add_development_dependency 'rspec', '~> 3.0'
34
+ spec.add_development_dependency 'rubocop', '~> 0.48'
35
+ spec.add_development_dependency 'rubocop-performance'
36
+ spec.add_development_dependency 'rubocop-rspec', '~> 1.15'
33
37
end
data/lib/cloudflair.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'cloudflair/api'
2
4
require 'cloudflair/version'
3
5
require 'dry-configurable'
data/lib/cloudflair/api.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'cloudflair/api/zone'
2
4
require 'cloudflair/api/railguns'
3
5
require 'cloudflair/communication'
data/lib/cloudflair/api/railguns.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'cloudflair/entity'
2
4
3
5
module Cloudflair
data/lib/cloudflair/api/zone.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'cloudflair/api/zone/analytics'
2
4
require 'cloudflair/api/zone/available_plan'
3
5
require 'cloudflair/api/zone/available_rate_plan'
@@ -12,6 +14,7 @@ module Cloudflair
12
14
require 'cloudflair/api/zone__dns_records'
13
15
require 'cloudflair/api/zone__available_plans'
14
16
require 'cloudflair/api/zone__railguns'
17
+ require 'cloudflair/api/zone__custom_hostnames'
15
18
16
19
attr_reader :zone_id
17
20
data/lib/cloudflair/api/zone/analytics.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'cloudflair/entity'
2
4
3
5
module Cloudflair
data/lib/cloudflair/api/zone/available_plan.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'cloudflair/entity'
2
4
3
5
module Cloudflair
data/lib/cloudflair/api/zone/available_rate_plan.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'cloudflair/entity'
2
4
3
5
module Cloudflair
data/lib/cloudflair/api/zone/custom_hostname.rb ADDED
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'cloudflair/entity'
4
+
5
+ module Cloudflair
6
+ class CustomHostname
7
+ include Cloudflair::Entity
8
+
9
+ attr_reader :zone_id, :custom_hostname_id
10
+ deletable true
11
+ patchable_fields :ssl, :custom_origin_server, :custom_metadata
12
+ path 'zones/:zone_id/custom_hostnames/:custom_hostname_id'
13
+
14
+ def initialize(zone_id, custom_hostname_id)
15
+ @zone_id = zone_id
16
+ @custom_hostname_id = custom_hostname_id
17
+ end
18
+ end
19
+ end
data/lib/cloudflair/api/zone/dns_record.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'cloudflair/entity'
2
4
3
5
module Cloudflair
@@ -6,6 +8,7 @@ module Cloudflair
6
8
7
9
attr_reader :zone_id, :record_id
8
10
deletable true
11
+ patchable_fields :content
9
12
path 'zones/:zone_id/dns_records/:record_id'
10
13
11
14
def initialize(zone_id, record_id)
data/lib/cloudflair/api/zone/purge_cache.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'cloudflair/communication'
2
4
3
5
module Cloudflair
@@ -13,7 +15,7 @@ module Cloudflair
13
15
##
14
16
# @param purge_everything must be set to true
15
17
def everything(purge_everything)
16
- resp = connection.delete(path) { |req| req.body = { purge_everything: purge_everything } }
18
+ resp = connection.post(path) { |req| req.body = { purge_everything: purge_everything } }
17
19
response resp
18
20
self
19
21
end
@@ -23,7 +25,7 @@ module Cloudflair
23
25
def selective(cache_identifier = {})
24
26
return self if cache_identifier.nil? || cache_identifier.empty?
25
27
26
- resp = connection.delete(path) { |req| req.body = cache_identifier }
28
+ resp = connection.post(path) { |req| req.body = cache_identifier }
27
29
response resp
28
30
self
29
31
end
data/lib/cloudflair/api/zone/railgun.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'cloudflair/entity'
2
4
3
5
module Cloudflair
data/lib/cloudflair/api/zone/settings.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'cloudflair/api/zone/settings/advanced_ddos'
2
4
require 'cloudflair/api/zone/settings/always_online'
3
5
require 'cloudflair/api/zone/settings/browser_cache_ttl'
@@ -38,36 +40,36 @@ module Cloudflair
38
40
end
39
41
40
42
{
41
- advanced_ddos: Cloudflair::AdvancedDdos,
42
- always_online: Cloudflair::AlwaysOnline,
43
- browser_cache_ttl: Cloudflair::BrowserCacheTtl,
44
- browser_check: Cloudflair::BrowserCheck,
45
- cache_level: Cloudflair::CacheLevel,
46
- challenge_ttl: Cloudflair::ChallengeTtl,
47
- development_mode: Cloudflair::DevelopmentMode,
48
- email_obfuscation: Cloudflair::EmailObfuscation,
49
- hotlink_protection: Cloudflair::HotlinkProtection,
50
- ip_geolocation: Cloudflair::IpGeolocation,
51
- ipv6: Cloudflair::Ipv6,
52
- minify: Cloudflair::Minify,
53
- mirage: Cloudflair::Mirage,
54
- mobile_redirect: Cloudflair::MobileRedirect,
43
+ advanced_ddos: Cloudflair::AdvancedDdos,
44
+ always_online: Cloudflair::AlwaysOnline,
45
+ browser_cache_ttl: Cloudflair::BrowserCacheTtl,
46
+ browser_check: Cloudflair::BrowserCheck,
47
+ cache_level: Cloudflair::CacheLevel,
48
+ challenge_ttl: Cloudflair::ChallengeTtl,
49
+ development_mode: Cloudflair::DevelopmentMode,
50
+ email_obfuscation: Cloudflair::EmailObfuscation,
51
+ hotlink_protection: Cloudflair::HotlinkProtection,
52
+ ip_geolocation: Cloudflair::IpGeolocation,
53
+ ipv6: Cloudflair::Ipv6,
54
+ minify: Cloudflair::Minify,
55
+ mirage: Cloudflair::Mirage,
56
+ mobile_redirect: Cloudflair::MobileRedirect,
55
57
origin_error_page_pass_thru: Cloudflair::OriginErrorPagePassThru,
56
- polish: Cloudflair::Polish,
57
- prefetch_preload: Cloudflair::PrefetchPreload,
58
- response_buffering: Cloudflair::ResponseBuffering,
59
- rocket_loader: Cloudflair::RocketLoader,
60
- security_header: Cloudflair::SecurityHeader,
61
- security_level: Cloudflair::SecurityLevel,
62
- server_side_exclude: Cloudflair::ServerSideExclude,
58
+ polish: Cloudflair::Polish,
59
+ prefetch_preload: Cloudflair::PrefetchPreload,
60
+ response_buffering: Cloudflair::ResponseBuffering,
61
+ rocket_loader: Cloudflair::RocketLoader,
62
+ security_header: Cloudflair::SecurityHeader,
63
+ security_level: Cloudflair::SecurityLevel,
64
+ server_side_exclude: Cloudflair::ServerSideExclude,
63
65
sort_query_string_for_cache: Cloudflair::SortQueryStringForCache,
64
- ssl: Cloudflair::Ssl,
65
- tls_client_auth: Cloudflair::TlsClientAuth,
66
- tls_1_2_only: Cloudflair::Tls12Only,
67
- tls_1_3: Cloudflair::Tls13,
68
- true_client_ip_header: Cloudflair::TrueClientIpHeader,
69
- waf: Cloudflair::Waf,
70
- websockets: Cloudflair::Websockets,
66
+ ssl: Cloudflair::Ssl,
67
+ tls_client_auth: Cloudflair::TlsClientAuth,
68
+ tls_1_2_only: Cloudflair::Tls12Only,
69
+ tls_1_3: Cloudflair::Tls13,
70
+ true_client_ip_header: Cloudflair::TrueClientIpHeader,
71
+ waf: Cloudflair::Waf,
72
+ websockets: Cloudflair::Websockets
71
73
}.each do |method, klass|
72
74
define_method method do
73
75
klass.new @zone_id
data/lib/cloudflair/api/zone/settings/advanced_ddos.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'cloudflair/entity'
2
4
3
5
module Cloudflair
data/lib/cloudflair/api/zone/settings/always_online.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'cloudflair/entity'
2
4
3
5
module Cloudflair
data/lib/cloudflair/api/zone/settings/browser_cache_ttl.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'cloudflair/entity'
2
4
3
5
module Cloudflair
data/lib/cloudflair/api/zone/settings/browser_check.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'cloudflair/entity'
2
4
3
5
module Cloudflair
data/lib/cloudflair/api/zone/settings/cache_level.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'cloudflair/entity'
2
4
3
5
module Cloudflair
data/lib/cloudflair/api/zone/settings/challenge_ttl.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'cloudflair/entity'
2
4
3
5
module Cloudflair
data/lib/cloudflair/api/zone/settings/development_mode.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'cloudflair/entity'
2
4
3
5
module Cloudflair
data/lib/cloudflair/api/zone/settings/email_obfuscation.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'cloudflair/entity'
2
4
3
5
module Cloudflair
data/lib/cloudflair/api/zone/settings/hotlink_protection.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'cloudflair/entity'
2
4
3
5
module Cloudflair
data/lib/cloudflair/api/zone/settings/ip_geolocation.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'cloudflair/entity'
2
4
3
5
module Cloudflair
data/lib/cloudflair/api/zone/settings/ipv6.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'cloudflair/entity'
2
4
3
5
module Cloudflair
data/lib/cloudflair/api/zone/settings/minify.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'cloudflair/entity'
2
4
3
5
module Cloudflair
data/lib/cloudflair/api/zone/settings/mirage.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'cloudflair/entity'
2
4
3
5
module Cloudflair
data/lib/cloudflair/api/zone/settings/mobile_redirect.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'cloudflair/entity'
2
4
3
5
module Cloudflair
data/lib/cloudflair/api/zone/settings/origin_error_page_pass_thru.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'cloudflair/entity'
2
4
3
5
module Cloudflair
data/lib/cloudflair/api/zone/settings/polish.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'cloudflair/entity'
2
4
3
5
module Cloudflair
data/lib/cloudflair/api/zone/settings/prefetch_preload.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'cloudflair/entity'
2
4
3
5
module Cloudflair
data/lib/cloudflair/api/zone/settings/response_buffering.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'cloudflair/entity'
2
4
3
5
module Cloudflair
data/lib/cloudflair/api/zone/settings/rocket_loader.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'cloudflair/entity'
2
4
3
5
module Cloudflair
data/lib/cloudflair/api/zone/settings/security_header.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'cloudflair/entity'
2
4
3
5
module Cloudflair
data/lib/cloudflair/api/zone/settings/security_level.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'cloudflair/entity'
2
4
3
5
module Cloudflair
data/lib/cloudflair/api/zone/settings/server_side_exclude.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'cloudflair/entity'
2
4
3
5
module Cloudflair
data/lib/cloudflair/api/zone/settings/sort_query_string_for_cache.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'cloudflair/entity'
2
4
3
5
module Cloudflair
data/lib/cloudflair/api/zone/settings/ssl.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'cloudflair/entity'
2
4
3
5
module Cloudflair
data/lib/cloudflair/api/zone/settings/tls_1_2_only.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'cloudflair/entity'
2
4
3
5
module Cloudflair
data/lib/cloudflair/api/zone/settings/tls_1_3.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'cloudflair/entity'
2
4
3
5
module Cloudflair
data/lib/cloudflair/api/zone/settings/tls_client_auth.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'cloudflair/entity'
2
4
3
5
module Cloudflair
data/lib/cloudflair/api/zone/settings/true_client_ip_header.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'cloudflair/entity'
2
4
3
5
module Cloudflair
data/lib/cloudflair/api/zone/settings/waf.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'cloudflair/entity'
2
4
3
5
module Cloudflair
data/lib/cloudflair/api/zone/settings/websockets.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'cloudflair/entity'
2
4
3
5
module Cloudflair
data/lib/cloudflair/api/zone__available_plans.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'cloudflair/api/zone/available_plan'
2
4
3
5
module Cloudflair
data/lib/cloudflair/api/zone__custom_hostnames.rb ADDED
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'cloudflair/api/zone/custom_hostname'
4
+
5
+ module Cloudflair
6
+ class Zone
7
+ def custom_hostnames(filter = {})
8
+ raw_hostnames = response connection.get("#{path}/custom_hostnames", filter)
9
+
10
+ raw_hostnames.map { |raw_hostname| build_custom_hostname(raw_hostname) }
11
+ end
12
+
13
+ def custom_hostname(custom_hostname_id)
14
+ Cloudflair::CustomHostname.new zone_id, custom_hostname_id
15
+ end
16
+
17
+ def new_custom_hostname(hostname_data)
18
+ raw_hostname = response connection.post("#{path}/custom_hostnames", hostname_data)
19
+
20
+ build_custom_hostname raw_hostname
21
+ end
22
+
23
+ private
24
+
25
+ def build_custom_hostname(raw_hostname)
26
+ hostname = custom_hostname raw_hostname['id']
27
+ hostname.data = raw_hostname
28
+ hostname
29
+ end
30
+ end
31
+ end
data/lib/cloudflair/api/zone__dns_records.rb CHANGED
@@ -1,10 +1,11 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'cloudflair/api/zone/dns_record'
2
4
3
5
module Cloudflair
4
6
class Zone
5
7
def dns_records(filter = {})
6
8
raw_records = response connection.get("#{path}/dns_records", filter)
7
-
8
9
raw_records.map { |raw_record| build_dns_record(raw_record) }
9
10
end
10
11
@@ -14,7 +15,6 @@ module Cloudflair
14
15
15
16
def new_dns_record(record_data)
16
17
raw_record = response connection.post("#{path}/dns_records", record_data)
17
-
18
18
build_dns_record raw_record
19
19
end
20
20
data/lib/cloudflair/api/zone__railguns.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'cloudflair/api/zone/railgun'
2
4
3
5
module Cloudflair
data/lib/cloudflair/communication.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'cloudflair/error/cloudflare_error'
2
4
require 'cloudflair/error/cloudflair_error'
3
5
require 'cloudflair/connection'
@@ -35,8 +37,9 @@ module Cloudflair
35
37
body = response.body
36
38
37
39
unless body['success']
38
- fail Cloudflair::CloudflairError, "Unrecognized response format: '#{body}'" unless body['errors']
39
- fail Cloudflair::CloudflareError, body['errors']
40
+ raise Cloudflair::CloudflairError, "Unrecognized response format: '#{body}'" unless body['errors']
41
+
42
+ raise Cloudflair::CloudflareError, body['errors']
40
43
end
41
44
42
45
body['result']
@@ -44,32 +47,32 @@ module Cloudflair
44
47
45
48
def raise_on_http_error(status)
46
49
case status
47
- when 200..399 then
48
- when 400..499 then
50
+ when 200..399
51
+ when 400..499
49
52
raise_on_http_client_error status
50
- when 500..599 then
51
- fail Cloudflair::CloudflairError, "#{status} Remote Error"
53
+ when 500..599
54
+ raise Cloudflair::CloudflairError, "#{status} Remote Error"
52
55
else
53
- fail Cloudflair::CloudflairError, "#{status} Unknown Error Code"
56
+ raise Cloudflair::CloudflairError, "#{status} Unknown Error Code"
54
57
end
55
58
end
56
59
57
60
def raise_on_http_client_error(status)
58
61
case status
59
- when 400 then
60
- fail Cloudflair::CloudflairError, '400 Bad Request'
61
- when 401 then
62
- fail Cloudflair::CloudflairError, '401 Unauthorized'
63
- when 403 then
64
- fail Cloudflair::CloudflairError, '403 Forbidden'
65
- when 405 then
66
- fail Cloudflair::CloudflairError, '405 Method Not Allowed'
67
- when 415 then
68
- fail Cloudflair::CloudflairError, '415 Unsupported Media Type'
69
- when 429 then
70
- fail Cloudflair::CloudflairError, '429 Too Many Requests'
62
+ when 400
63
+ raise Cloudflair::CloudflairError, '400 Bad Request'
64
+ when 401
65
+ raise Cloudflair::CloudflairError, '401 Unauthorized'
66
+ when 403
67
+ raise Cloudflair::CloudflairError, '403 Forbidden'
68
+ when 405
69
+ raise Cloudflair::CloudflairError, '405 Method Not Allowed'
70
+ when 415
71
+ raise Cloudflair::CloudflairError, '415 Unsupported Media Type'
72
+ when 429
73
+ raise Cloudflair::CloudflairError, '429 Too Many Requests'
71
74
else
72
- fail Cloudflair::CloudflairError, "#{status} Request Error"
75
+ raise Cloudflair::CloudflairError, "#{status} Request Error"
73
76
end
74
77
end
75
78
data/lib/cloudflair/connection.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'faraday'
2
4
require 'faraday_middleware'
3
5
require 'faraday/detailed_logger'
@@ -7,25 +9,32 @@ module Cloudflair
7
9
class Connection
8
10
def self.new
9
11
config = Cloudflair.config
10
-
11
12
new_faraday_from config
12
13
end
13
14
14
- def self.headers
15
+ def self.headers # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
15
- headers = {}
16
16
cloudflare_auth_config = Cloudflair.config.cloudflare.auth
17
- if !(cloudflare_auth_config.key.nil? || cloudflare_auth_config.email.nil?)
18
- headers['X-Auth-Key'] = cloudflare_auth_config.key
19
- headers['X-Auth-Email'] = cloudflare_auth_config.email
20
- elsif !cloudflare_auth_config.user_service_key.nil?
21
- headers['X-Auth-User-Service-Key'] = cloudflare_auth_config.user_service_key
22
- else
17
+
18
+ if !cloudflare_auth_config.key.nil? && !cloudflare_auth_config.email.nil?
19
+ return({
20
+ 'X-Auth-Key' => cloudflare_auth_config.key,
21
+ 'X-Auth-Email' => cloudflare_auth_config.email
22
+ })
23
- fail CloudflairError, 'Neither email & key nor user_service_key have been defined.'
24
23
end
25
- headers
24
+
25
+ unless cloudflare_auth_config.user_service_key.nil?
26
+ return({
27
+ 'Authorization' => "Bearer #{cloudflare_auth_config.user_service_key}"
28
+ })
29
+ end
30
+
31
+ raise(
32
+ CloudflairError,
33
+ 'Neither email & key nor user_service_key have been defined.'
34
+ )
26
35
end
27
36
28
- private_class_method def self.new_faraday_from(config)
37
+ private_class_method def self.new_faraday_from(config) # rubocop:disable Metrics/AbcSize
29
38
Faraday.new(url: config.cloudflare.api_base_url, headers: headers) do |faraday|
30
39
faraday.request :json
31
40
faraday.response config.faraday.logger if config.faraday.logger
data/lib/cloudflair/entity.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'cloudflair/communication'
2
4
3
5
module Cloudflair
@@ -13,18 +15,17 @@ module Cloudflair
13
15
@other_klass = other_klass
14
16
end
15
17
16
- attr_accessor :fields_wrapper_class
17
-
18
18
def patchable_fields(*fields)
19
19
return @patchable_fields if @patchable_fields
20
20
21
- if fields.nil?
22
- @patchable_fields = []
23
- elsif fields.is_a?(Array)
24
- @patchable_fields = fields.map(&:to_s)
25
- else
26
- @patchable_fields = [fields.to_s]
27
- end
21
+ @patchable_fields =
22
+ if fields.nil?
23
+ []
24
+ elsif fields.is_a?(Array)
25
+ fields.map(&:to_s)
26
+ else
27
+ [fields.to_s]
28
+ end
28
29
end
29
30
30
31
def deletable(deletable = false)
@@ -36,7 +37,7 @@ module Cloudflair
36
37
def path(path = nil)
37
38
return @path if @path
38
39
39
- fail ArgumentError, 'path is not defined' if path.nil?
40
+ raise ArgumentError, 'path is not defined' if path.nil?
40
41
41
42
@path = path
42
43
end
@@ -44,11 +45,12 @@ module Cloudflair
44
45
def object_fields(*fields)
45
46
return @object_fields if @object_fields
46
47
47
- if fields.nil? || fields.empty?
48
- @object_fields = []
49
- else
50
- @object_fields = fields.map(&:to_s)
51
- end
48
+ @object_fields =
49
+ if fields.nil? || fields.empty?
50
+ []
51
+ else
52
+ fields.map(&:to_s)
53
+ end
52
54
end
53
55
54
56
# allowed values:
@@ -71,17 +73,17 @@ module Cloudflair
71
73
end
72
74
73
75
def turn_all_items_into_a_single_hash(fields_to_class_map)
74
- fields_map = {}
75
- fields_to_class_map.each do |field_definition|
76
- if field_definition.is_a?(Hash)
77
- fields_to_class_map[0].each do |field, klass_or_proc|
78
- fields_map[field.to_s] = klass_or_proc
76
+ {}.tap do |fields_map|
77
+ fields_to_class_map.each do |field_definition|
78
+ if field_definition.is_a?(Hash)
79
+ fields_to_class_map[0].each do |field, klass_or_proc|
80
+ fields_map[field.to_s] = klass_or_proc
81
+ end
82
+ else
83
+ fields_map[field_definition.to_s] = nil
79
84
end
80
- else
81
- fields_map[field_definition.to_s] = nil
82
85
end
83
86
end
84
- fields_map
85
87
end
86
88
end
87
89
@@ -104,7 +106,7 @@ module Cloudflair
104
106
end
105
107
106
108
def delete
107
- fail Cloudflair::CloudflairError, "Can't delete unless deletable=true" unless deletable
109
+ raise Cloudflair::CloudflairError, "Can't delete unless deletable=true" unless deletable
108
110
return self if @deleted
109
111
110
112
@data = response connection.delete path
@@ -128,27 +130,23 @@ module Cloudflair
128
130
def method_missing(name_as_symbol, *args, &block)
129
131
name = normalize_accessor name_as_symbol
130
132
131
- return data if :_raw_data! == name_as_symbol
133
+ return data if name_as_symbol == :_raw_data!
132
134
133
135
if name.end_with?('=')
134
136
if patchable_fields.include?(name[0..-2])
135
137
dirty_data[name[0..-2]] = args[0]
136
138
return
137
- else
138
- super
139
139
end
140
- end
141
140
142
- # allow access to the unmodified data using 'zone.always_string!' or 'zone._name!'
141
+ super
143
- if name.end_with?('!') && data.keys.include?(name[0..-2])
144
- return data[name[0..2]]
145
142
end
146
143
144
+ # allow access to the unmodified data using 'zone.always_string!' or 'zone._name!'
145
+ return data[name[0..2]] if name.end_with?('!') && data.key?(name[0..-2])
147
146
return objectify(name) if object_fields.include? name
148
- return arrayify(name, array_object_fields[name]) if array_object_fields.keys.include? name
149
-
150
- return dirty_data[name] if dirty_data.keys.include? name
147
+ return arrayify(name, array_object_fields[name]) if array_object_fields.key?(name)
148
+ return dirty_data[name] if dirty_data.key?(name)
149
+ return data[name] if data.is_a?(Hash) && data.key?(name)
151
- return data[name] if data.is_a?(Hash) && data.keys.include?(name)
152
150
153
151
super
154
152
end
@@ -156,16 +154,13 @@ module Cloudflair
156
154
def respond_to_missing?(name_as_symbol, *args)
157
155
name = normalize_accessor name_as_symbol
158
156
159
- return true if :_raw_data! == name_as_symbol
157
+ return true if name_as_symbol == :_raw_data!
160
-
161
158
return true if name.end_with?('=') && patchable_fields.include?(name[0..-2])
162
- return true if name.end_with?('!') && data.keys.include?(name[0..-2])
159
+ return true if name.end_with?('!') && data.key?(name[0..-2])
163
-
164
160
return true if object_fields.include? name
165
- return true if array_object_fields.keys.include? name
166
-
167
- return true if dirty_data.keys.include? name
161
+ return true if array_object_fields.key?(name)
162
+ return true if dirty_data.key?(name)
163
+ return true if data.is_a?(Hash) && data.key?(name)
168
- return true if data.is_a?(Hash) && data.keys.include?(name)
169
164
170
165
super
171
166
end
@@ -237,9 +232,11 @@ module Cloudflair
237
232
238
233
def replace_path_variables_in(path)
239
234
interpreted_path = path.clone
235
+
240
236
path.scan(/:([a-zA-Z_][a-zA-Z0-9_]+[!?=]?)/) do |match, *|
241
- interpreted_path.gsub! ":#{match}", send(match).to_s
237
+ interpreted_path = interpreted_path.gsub ":#{match}", send(match).to_s
242
238
end
239
+
243
240
interpreted_path
244
241
end
245
242
data/lib/cloudflair/error/cloudflair_error.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
module Cloudflair
2
4
class CloudflairError < StandardError
3
5
end
data/lib/cloudflair/error/cloudflare_error.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
module Cloudflair
2
4
class CloudflareError < StandardError
3
5
attr_reader :cloudflare_errors
data/lib/cloudflair/version.rb CHANGED
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
2
+
1
3
module Cloudflair
2
- VERSION = '0.0.9'.freeze
3
4
end
metadata CHANGED
@@ -1,99 +1,113 @@
1
1
--- !ruby/object:Gem::Specification
2
2
name: cloudflair
3
3
version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.3.0
5
5
platform: ruby
6
6
authors:
7
7
- Christian Mäder
8
8
autorequire:
9
9
bindir: exe
10
10
cert_chain: []
11
- date: 2016-11-03 00:00:00.000000000 Z
11
+ date: 2019-09-11 00:00:00.000000000 Z
12
12
dependencies:
13
13
- !ruby/object:Gem::Dependency
14
- name: faraday
14
+ name: dry-configurable
15
15
requirement: !ruby/object:Gem::Requirement
16
16
requirements:
17
17
- - "~>"
18
18
- !ruby/object:Gem::Version
19
- version: 0.9.0
19
+ version: '0.1'
20
20
type: :runtime
21
21
prerelease: false
22
22
version_requirements: !ruby/object:Gem::Requirement
23
23
requirements:
24
24
- - "~>"
25
25
- !ruby/object:Gem::Version
26
- version: 0.9.0
26
+ version: '0.1'
27
27
- !ruby/object:Gem::Dependency
28
- name: faraday_middleware
28
+ name: faraday
29
29
requirement: !ruby/object:Gem::Requirement
30
30
requirements:
31
- - - "~>"
31
+ - - ">="
32
32
- !ruby/object:Gem::Version
33
33
version: 0.10.0
34
34
type: :runtime
35
35
prerelease: false
36
36
version_requirements: !ruby/object:Gem::Requirement
37
37
requirements:
38
- - - "~>"
38
+ - - ">="
39
39
- !ruby/object:Gem::Version
40
40
version: 0.10.0
41
41
- !ruby/object:Gem::Dependency
42
- name: dry-configurable
42
+ name: faraday-detailed_logger
43
43
requirement: !ruby/object:Gem::Requirement
44
44
requirements:
45
- - - "~>"
45
+ - - ">="
46
46
- !ruby/object:Gem::Version
47
- version: '0.1'
47
+ version: '0'
48
48
type: :runtime
49
49
prerelease: false
50
50
version_requirements: !ruby/object:Gem::Requirement
51
51
requirements:
52
- - - "~>"
52
+ - - ">="
53
53
- !ruby/object:Gem::Version
54
- version: '0.1'
54
+ version: '0'
55
55
- !ruby/object:Gem::Dependency
56
- name: faraday-detailed_logger
56
+ name: faraday_middleware
57
57
requirement: !ruby/object:Gem::Requirement
58
58
requirements:
59
- - - "~>"
59
+ - - ">="
60
60
- !ruby/object:Gem::Version
61
- version: '2.1'
61
+ version: '0'
62
62
type: :runtime
63
63
prerelease: false
64
64
version_requirements: !ruby/object:Gem::Requirement
65
65
requirements:
66
- - - "~>"
66
+ - - ">="
67
67
- !ruby/object:Gem::Version
68
- version: '2.1'
68
+ version: '0'
69
69
- !ruby/object:Gem::Dependency
70
70
name: bundler
71
71
requirement: !ruby/object:Gem::Requirement
72
72
requirements:
73
73
- - "~>"
74
74
- !ruby/object:Gem::Version
75
- version: '1.12'
75
+ version: 2.0.0
76
76
type: :development
77
77
prerelease: false
78
78
version_requirements: !ruby/object:Gem::Requirement
79
79
requirements:
80
80
- - "~>"
81
81
- !ruby/object:Gem::Version
82
- version: '1.12'
82
+ version: 2.0.0
83
+ - !ruby/object:Gem::Dependency
84
+ name: dotenv
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '2.1'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '2.1'
83
97
- !ruby/object:Gem::Dependency
84
98
name: rake
85
99
requirement: !ruby/object:Gem::Requirement
86
100
requirements:
87
101
- - "~>"
88
102
- !ruby/object:Gem::Version
89
- version: '10.0'
103
+ version: '12.0'
90
104
type: :development
91
105
prerelease: false
92
106
version_requirements: !ruby/object:Gem::Requirement
93
107
requirements:
94
108
- - "~>"
95
109
- !ruby/object:Gem::Version
96
- version: '10.0'
110
+ version: '12.0'
97
111
- !ruby/object:Gem::Dependency
98
112
name: rspec
99
113
requirement: !ruby/object:Gem::Requirement
@@ -109,19 +123,47 @@ dependencies:
109
123
- !ruby/object:Gem::Version
110
124
version: '3.0'
111
125
- !ruby/object:Gem::Dependency
112
- name: dotenv
126
+ name: rubocop
113
127
requirement: !ruby/object:Gem::Requirement
114
128
requirements:
115
129
- - "~>"
116
130
- !ruby/object:Gem::Version
117
- version: '2.1'
131
+ version: '0.48'
118
132
type: :development
119
133
prerelease: false
120
134
version_requirements: !ruby/object:Gem::Requirement
121
135
requirements:
122
136
- - "~>"
123
137
- !ruby/object:Gem::Version
124
- version: '2.1'
138
+ version: '0.48'
139
+ - !ruby/object:Gem::Dependency
140
+ name: rubocop-performance
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: rubocop-rspec
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: '1.15'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: '1.15'
125
167
description: Cloudflair aims to provide easy access to CloudFlare's public API.
126
168
email:
127
169
- christian.maeder@nine.ch
@@ -131,12 +173,15 @@ extra_rdoc_files: []
131
173
files:
132
174
- ".gitignore"
133
175
- ".rspec"
176
+ - ".rubocop.yml"
177
+ - ".ruby-gemset"
134
178
- ".ruby-version"
135
179
- ".travis.yml"
136
180
- Gemfile
137
181
- LICENSE.txt
138
182
- README.md
139
183
- Rakefile
184
+ - VERSION
140
185
- bin/cloudflair
141
186
- bin/console
142
187
- bin/setup
@@ -148,6 +193,7 @@ files:
148
193
- lib/cloudflair/api/zone/analytics.rb
149
194
- lib/cloudflair/api/zone/available_plan.rb
150
195
- lib/cloudflair/api/zone/available_rate_plan.rb
196
+ - lib/cloudflair/api/zone/custom_hostname.rb
151
197
- lib/cloudflair/api/zone/dns_record.rb
152
198
- lib/cloudflair/api/zone/purge_cache.rb
153
199
- lib/cloudflair/api/zone/railgun.rb
@@ -183,6 +229,7 @@ files:
183
229
- lib/cloudflair/api/zone/settings/waf.rb
184
230
- lib/cloudflair/api/zone/settings/websockets.rb
185
231
- lib/cloudflair/api/zone__available_plans.rb
232
+ - lib/cloudflair/api/zone__custom_hostnames.rb
186
233
- lib/cloudflair/api/zone__dns_records.rb
187
234
- lib/cloudflair/api/zone__railguns.rb
188
235
- lib/cloudflair/communication.rb
@@ -211,8 +258,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
211
258
- !ruby/object:Gem::Version
212
259
version: '0'
213
260
requirements: []
214
- rubyforge_project:
261
+ rubygems_version: 3.0.3
215
- rubygems_version: 2.6.7
216
262
signing_key:
217
263
specification_version: 4
218
264
summary: Wrapper to CloudFlare's v4 REST API.