cloudflair 0.2.4 → 0.2.5

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: 7cfdfacba32e8e3fa0b53c0f472bf5f706ec1552c69cd95291cd5acdbd0093d2
4
- data.tar.gz: b146dae0686831ae491373af3139cff87371188df5e429696b4f9c64c016cfe1
3
+ metadata.gz: a2a69b1e26a488661affa4013c362307968f083f6e688bc3d63519de57415b58
4
+ data.tar.gz: c3383bd0be796d11c49e11da606fbe4bbc6e2ae75c89a20c159b3479ebf9f629
5
5
  SHA512:
6
- metadata.gz: 0b2938de46e0630f15747dcae745ba414a3fdff19d1a8a9732cd0ad921b7b895a0f8a05c9e931f825952e1a4c09f61bc65cff4184478ce02305906153b7ab0be
7
- data.tar.gz: c42ff156eaca3ecc1c8e83bf4793e2362c823fdb91ca5bafebf34e45a73079ed76ce89a267c1f7a6a891e7a33e9a68954d0d669beeede30c8fa4fa7fc5c40e15
6
+ metadata.gz: 130d30780e3df7779780f9240371fe936e24e99c4ba5e97203a3b15af88a978d1ad85a39d1738786068d1431cd9cc93fb2ab49e186a342b231f8360bbca26c9b
7
+ data.tar.gz: 1d4737127f23eac7423dcf43f6be698e379d91fcd1402607477efd1fad7c6949897b3946962c6ca8803d8d28d2c0d3f0808ec3184d16ba593c741d886e587aca
data/README.md CHANGED
@@ -112,6 +112,7 @@ A good reference on how to use this wrapper are also the Rspecs.
112
112
  * `/zones/:zone_id/available_plans` GET
113
113
  * `/zones/:zone_id/available_plans/:plan_id` GET
114
114
  * `/zones/:zone_id/available_rate_plans`
115
+ * `/zones/:zone_id/custom_hostnames` GET, POST, PATCH
115
116
  * `/zones/:zone_id/dns_records` GET, POST
116
117
  * `/zones/:zone_id/dns_records/:record_id` GET, DELETE (PUT not implemented)
117
118
  * `/zones/:zone_id/purge_cache` POST
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.4
1
+ 0.2.5
@@ -0,0 +1,17 @@
1
+ require 'cloudflair/entity'
2
+
3
+ module Cloudflair
4
+ class CustomHostname
5
+ include Cloudflair::Entity
6
+
7
+ attr_reader :zone_id, :custom_hostname_id
8
+ deletable true
9
+ patchable_fields :ssl, :custom_origin_server, :custom_metadata
10
+ path 'zones/:zone_id/custom_hostnames/:custom_hostname_id'
11
+
12
+ def initialize(zone_id, custom_hostname_id)
13
+ @zone_id = zone_id
14
+ @custom_hostname_id = custom_hostname_id
15
+ end
16
+ end
17
+ end
@@ -12,6 +12,7 @@ module Cloudflair
12
12
  require 'cloudflair/api/zone__dns_records'
13
13
  require 'cloudflair/api/zone__available_plans'
14
14
  require 'cloudflair/api/zone__railguns'
15
+ require 'cloudflair/api/zone__custom_hostnames'
15
16
 
16
17
  attr_reader :zone_id
17
18
 
@@ -0,0 +1,29 @@
1
+ require 'cloudflair/api/zone/custom_hostname'
2
+
3
+ module Cloudflair
4
+ class Zone
5
+ def custom_hostnames(filter = {})
6
+ raw_hostnames = response connection.get("#{path}/custom_hostnames", filter)
7
+
8
+ raw_hostnames.map { |raw_hostname| build_custom_hostname(raw_hostname) }
9
+ end
10
+
11
+ def custom_hostname(custom_hostname_id)
12
+ Cloudflair::CustomHostname.new zone_id, custom_hostname_id
13
+ end
14
+
15
+ def new_custom_hostname(hostname_data)
16
+ raw_hostname = response connection.post("#{path}/custom_hostnames", hostname_data)
17
+
18
+ build_custom_hostname raw_hostname
19
+ end
20
+
21
+ private
22
+
23
+ def build_custom_hostname(raw_hostname)
24
+ hostname = custom_hostname raw_hostname['id']
25
+ hostname.data = raw_hostname
26
+ hostname
27
+ end
28
+ end
29
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudflair
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
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: 2019-04-12 00:00:00.000000000 Z
11
+ date: 2019-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -177,6 +177,7 @@ files:
177
177
  - lib/cloudflair/api/zone/analytics.rb
178
178
  - lib/cloudflair/api/zone/available_plan.rb
179
179
  - lib/cloudflair/api/zone/available_rate_plan.rb
180
+ - lib/cloudflair/api/zone/custom_hostname.rb
180
181
  - lib/cloudflair/api/zone/dns_record.rb
181
182
  - lib/cloudflair/api/zone/purge_cache.rb
182
183
  - lib/cloudflair/api/zone/railgun.rb
@@ -212,6 +213,7 @@ files:
212
213
  - lib/cloudflair/api/zone/settings/waf.rb
213
214
  - lib/cloudflair/api/zone/settings/websockets.rb
214
215
  - lib/cloudflair/api/zone__available_plans.rb
216
+ - lib/cloudflair/api/zone__custom_hostnames.rb
215
217
  - lib/cloudflair/api/zone__dns_records.rb
216
218
  - lib/cloudflair/api/zone__railguns.rb
217
219
  - lib/cloudflair/communication.rb
@@ -240,8 +242,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
240
242
  - !ruby/object:Gem::Version
241
243
  version: '0'
242
244
  requirements: []
243
- rubyforge_project:
244
- rubygems_version: 2.7.7
245
+ rubygems_version: 3.0.3
245
246
  signing_key:
246
247
  specification_version: 4
247
248
  summary: Wrapper to CloudFlare's v4 REST API.