civo 0.5.8 → 0.6.0
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 +4 -4
- data/app/models/civo/base.rb +21 -2
- data/lib/civo/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f400a8bdc064187e6eaf1f3a8cd88f7c8c11bd06
|
4
|
+
data.tar.gz: 7684ca5090ef694fba2f51bff23dafb3e48afe52
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5eded1cd62419433edb0e45ca84463724c1a4b7f9721118f0625aca0aa02fc8df23fefc0418d1d21d387a8ac8e898a34dcdaab93a603957e17d1a261e982bdd5
|
7
|
+
data.tar.gz: c474d73cddfcec284e8c5bc121ab1b4c505e23be1ac4d971993b01afe1f8cb004633f5db478db51ca81367d263b5855b7675513538197bb21ff82f06866a2c65
|
data/app/models/civo/base.rb
CHANGED
@@ -1,10 +1,29 @@
|
|
1
1
|
module Civo
|
2
2
|
class Base < ::Flexirest::Base
|
3
|
-
before_request
|
3
|
+
before_request :authorization_token
|
4
|
+
|
5
|
+
if ENV["CIVO_API_VERSION"] == "2"
|
6
|
+
before_request :administration_set_user
|
7
|
+
end
|
8
|
+
|
9
|
+
private
|
10
|
+
|
11
|
+
def authorization_token(name, request)
|
4
12
|
request.headers["Authorization"] = "bearer #{ENV["CIVO_TOKEN"]}"
|
5
13
|
end
|
14
|
+
|
15
|
+
def administration_set_user(name, request)
|
16
|
+
user_id = request.post_params[:user_id] # Don't delete the param in case it's needed by an action
|
17
|
+
if user_id.present?
|
18
|
+
request.headers["X-Civo-UserID"] = user_id
|
19
|
+
end
|
20
|
+
account_id = request.post_params[:account_id] # Don't delete the param in case it's needed by an action
|
21
|
+
if account_id.present?
|
22
|
+
request.headers["X-Civo-AccountID"] = account_id
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
6
26
|
end
|
7
27
|
end
|
8
28
|
|
9
29
|
Flexirest::Base.base_url = ENV["CIVO_URL"]
|
10
|
-
Flexirest::Base.verbose! if ENV["CIVO_VERBOSE"]
|
data/lib/civo/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: civo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Jeffries
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: flexirest
|