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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7bf3b3a1ecdcf50e770990c51d35f6be706407a5
4
- data.tar.gz: d9869e1e84f959ede37c7114bdbed44ccd159e5e
3
+ metadata.gz: 5f7b07b6a0fac5738b738c9297a932f101e3dc78
4
+ data.tar.gz: 4aaead028eefb8c1d2bdbe95bfc14f02076de102
5
5
  SHA512:
6
- metadata.gz: 094b8be97ce303da51dcdc5b5a8cc8c337092733f50194437a38e872b5cee8c8d978a045317a6632c2125256f27ec4d0f3b10fe503e399e9e6b32c01ee335d99
7
- data.tar.gz: cb78861951938689b65012148a9ed0837fe55e498337bef1d311eb4848d044cfe5306de7505ba5984f92aa34d3636d387295ca044429f2c540048489b5864960
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 "cloudflair"
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
- TODO: Write usage instructions here
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
- Along the lines of `Cloudflair.new_connection.zone('zone_id').some_action`
68
+ A good reference are also the specs.
46
69
 
47
70
  ## Development
48
71
 
@@ -1,3 +1,5 @@
1
+ require 'cloudflair/communication'
2
+
1
3
  module Cloudflair
2
4
  class DevelopmentMode
3
5
  include Cloudflair::Communication
@@ -1,5 +1,6 @@
1
1
  require 'cloudflair/error/cloudflare_error'
2
2
  require 'cloudflair/error/cloudflair_error'
3
+ require 'cloudflair/connection'
3
4
 
4
5
  module Cloudflair
5
6
  module Communication
@@ -1,3 +1,3 @@
1
1
  module Cloudflair
2
- VERSION = '0.0.1'.freeze
2
+ VERSION = '0.0.2'.freeze
3
3
  end
data/lib/cloudflair.rb CHANGED
@@ -1,3 +1,6 @@
1
+ require 'cloudflair/api/zone'
2
+ require 'cloudflair/communication'
3
+ require 'cloudflair/connection'
1
4
  require 'cloudflair/version'
2
5
  require 'dry-configurable'
3
6
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudflair
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christian Mäder