aptible-api 0.1.1 → 0.1.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 +2 -2
- data/lib/aptible/api.rb +3 -1
- data/lib/aptible/api/version.rb +1 -1
- data/spec/aptible/api_spec.rb +8 -0
- data/spec/shared/set_env.rb +10 -0
- data/spec/spec_helper.rb +4 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dfdcc30829f257c5b6d98ad8ede2ea34b7a5f328
|
4
|
+
data.tar.gz: 79ce495635673d2b54c9e60d142fb7b2d27f13fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d435190c8b3dff583848b19285a2e50ef7d06bb7a1c9f10e8cd276eaa00e444e851e34a8da4c7a39f32d4674a771efd89c8d5b1675bad2534abcf639b85a9b26
|
7
|
+
data.tar.gz: 36a56dadd99b38fa76a6558fd598fee051f798fa41b0e3fcd018b2a2d8ec1a8564ea73ca56642daa65ff86d7f4b6af37408651bdfa0d38e79ff5732fc7e2f49f
|
data/README.md
CHANGED
@@ -46,9 +46,9 @@ client.href
|
|
46
46
|
|
47
47
|
| Parameter | Description | Default |
|
48
48
|
| --------- | ----------- | --------------- |
|
49
|
-
| `root_url` | Root URL of the
|
49
|
+
| `root_url` | Root URL of the API server | `ENV['APTIBLE_API_ROOT_URL']` or [https://api.aptible.com](https://api.aptible.com) |
|
50
50
|
|
51
|
-
To point the client at a different
|
51
|
+
To point the client at a different API server (e.g., during development), add the following to your application's initializers (or set the `APTIBLE_API_ROOT_URL` environment variable):
|
52
52
|
|
53
53
|
```ruby
|
54
54
|
Aptible::Api.configure do |config|
|
data/lib/aptible/api.rb
CHANGED
@@ -8,7 +8,9 @@ module Aptible
|
|
8
8
|
include GemConfig::Base
|
9
9
|
|
10
10
|
with_configuration do
|
11
|
-
has :root_url,
|
11
|
+
has :root_url,
|
12
|
+
classes: [String],
|
13
|
+
default: ENV['APTIBLE_API_ROOT_URL'] || 'https://api.aptible.com'
|
12
14
|
end
|
13
15
|
end
|
14
16
|
end
|
data/lib/aptible/api/version.rb
CHANGED
data/spec/aptible/api_spec.rb
CHANGED
@@ -6,4 +6,12 @@ describe Aptible::Api do
|
|
6
6
|
expect(config).to be_a GemConfig::Configuration
|
7
7
|
expect(config.root_url).to eq 'https://api.aptible.com'
|
8
8
|
end
|
9
|
+
|
10
|
+
pending 'uses ENV["APTIBLE_API_ROOT_URL"] if defined' do
|
11
|
+
config = described_class.configuration
|
12
|
+
set_env 'APTIBLE_API_ROOT_URL', 'http://foobar.com' do
|
13
|
+
config.reset
|
14
|
+
expect(config.root_url).to eq 'http://foobar.com'
|
15
|
+
end
|
16
|
+
end
|
9
17
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aptible-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Frank Macreery
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
11
|
+
date: 2014-02-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gem_config
|
@@ -156,6 +156,7 @@ files:
|
|
156
156
|
- lib/aptible/api/version.rb
|
157
157
|
- spec/aptible/api/client_spec.rb
|
158
158
|
- spec/aptible/api_spec.rb
|
159
|
+
- spec/shared/set_env.rb
|
159
160
|
- spec/spec_helper.rb
|
160
161
|
homepage: https://github.com/aptible/aptible-api
|
161
162
|
licenses:
|
@@ -184,4 +185,5 @@ summary: Ruby client for api.aptible.com
|
|
184
185
|
test_files:
|
185
186
|
- spec/aptible/api/client_spec.rb
|
186
187
|
- spec/aptible/api_spec.rb
|
188
|
+
- spec/shared/set_env.rb
|
187
189
|
- spec/spec_helper.rb
|