cloudflair 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +26 -3
- data/lib/cloudflair/api/zone/settings/development_mode.rb +2 -0
- data/lib/cloudflair/communication.rb +1 -0
- data/lib/cloudflair/version.rb +1 -1
- data/lib/cloudflair.rb +3 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f7b07b6a0fac5738b738c9297a932f101e3dc78
|
4
|
+
data.tar.gz: 4aaead028eefb8c1d2bdbe95bfc14f02076de102
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 46d9cbe6c1f217fc1cfbaa781340ab568653b00cd8fe0de0fbc43af9d235fb77495899772a8544e97af29f02781e8c77a47a70956f3c93cba115cf40a5d4e907
|
7
|
+
data.tar.gz: f24eda1248e1c86f68980f9eb08c83b06a676739cf47493207f9af999a6762d7a92276e569aa9c5e9d3f9cf1ad609d0dd23da7b14669f829b1288138a67b4279
|
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# Cloudflair
|
2
2
|
|
3
3
|
[![Build Status](https://travis-ci.org/ninech/cloudflair.svg?branch=master)](https://travis-ci.org/ninech/cloudflair)
|
4
|
+
[![Gem Version](https://badge.fury.io/rb/cloudflair.svg)](https://badge.fury.io/rb/cloudflair)
|
4
5
|
|
5
6
|
**UNDER CONSTRUCTION**
|
6
7
|
|
@@ -26,8 +27,13 @@ Or install it yourself as:
|
|
26
27
|
|
27
28
|
## Usage
|
28
29
|
|
30
|
+
### Configuration
|
31
|
+
|
32
|
+
Put this somewhere, where it runs, before any call to anything else of Cloudflair.
|
33
|
+
If you are using Rails, then this would probably be somewhere beneath `/config`.
|
34
|
+
|
29
35
|
```ruby
|
30
|
-
require
|
36
|
+
require 'cloudflair'
|
31
37
|
Cloudflair.configure do |config|
|
32
38
|
config.cloudflare.auth.key = 'YOUR_API_KEY'
|
33
39
|
config.cloudflare.auth.email = 'YOUR_ACCOUNT_EMAIL'
|
@@ -40,9 +46,26 @@ Cloudflair.configure do |config|
|
|
40
46
|
end
|
41
47
|
```
|
42
48
|
|
43
|
-
|
49
|
+
### Call An API Endpoint
|
50
|
+
|
51
|
+
This gem is organized along the URL schema of cloudflair.
|
52
|
+
|
53
|
+
```ruby
|
54
|
+
require 'cloudflair'
|
55
|
+
|
56
|
+
# https://api.cloudflare.com/client/v4/zones/cd7d068de3012345da9420df9514dad0
|
57
|
+
Cloudflair.zone('023e105f4ecef8ad9ca31a8372d0c353').name
|
58
|
+
# :=> "blog.example.com"
|
59
|
+
|
60
|
+
# https://api.cloudflare.com/client/v4/zones/cd7d068de3012345da9420df9514dad0/settings/development_mode
|
61
|
+
Cloudflair.zone('023e105f4ecef8ad9ca31a8372d0c353').settings.development_mode.value
|
62
|
+
# :=> "on"
|
63
|
+
# :=> "off"
|
64
|
+
```
|
65
|
+
|
66
|
+
You can use any field that Cloudflare's API returns. If a field is covered by some internal field, use `_field`.
|
44
67
|
|
45
|
-
|
68
|
+
A good reference are also the specs.
|
46
69
|
|
47
70
|
## Development
|
48
71
|
|
data/lib/cloudflair/version.rb
CHANGED
data/lib/cloudflair.rb
CHANGED