platform-api 1.0.0 → 1.0.1
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/.gitignore +2 -1
- data/.rspec +2 -0
- data/Gemfile.lock +28 -3
- data/README.md +4 -0
- data/Rakefile +7 -0
- data/config/client-config.rb +3 -1
- data/lib/platform-api.rb +1 -0
- data/lib/platform-api/version.rb +1 -1
- data/platform-api.gemspec +4 -1
- data/spec/acceptance/generated_client_spec.rb +70 -0
- data/spec/spec_helper.rb +20 -0
- metadata +49 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fbff6bff8a55c92ae1db28f25ced99f3e463f67c
|
4
|
+
data.tar.gz: c7d63a1522878e2961da7291f1e2e82ca3e5905c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 711ccc55ff40fdd4eaffb9841ef70a5ad38ef1b5dfec29ba204e7544f2bd833a2300d865fa33cec4a452a5ab94a023fc6a0f1d2df5123e87862d8fda334256f8
|
7
|
+
data.tar.gz: be18cf136fc794ea77b823a1f6b25e6770a9abcbd53d7c94078f27fbc8f59b74054920c4097fdfd95b824b2d624893368432ffaa9f0e15d4ea08874859ec9bd8
|
data/.gitignore
CHANGED
data/.rspec
ADDED
data/Gemfile.lock
CHANGED
@@ -1,22 +1,44 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
platform-api (1.0.
|
5
|
-
heroics (~> 0.0.
|
4
|
+
platform-api (1.0.1)
|
5
|
+
heroics (~> 0.0.21)
|
6
6
|
moneta (~> 0.8.1)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
+
coderay (1.1.1)
|
12
|
+
diff-lcs (1.3)
|
11
13
|
erubis (2.7.0)
|
12
14
|
excon (0.55.0)
|
13
|
-
heroics (0.0.
|
15
|
+
heroics (0.0.21)
|
14
16
|
erubis (~> 2.0)
|
15
17
|
excon
|
16
18
|
multi_json (>= 1.9.2)
|
19
|
+
method_source (0.8.2)
|
17
20
|
moneta (0.8.1)
|
18
21
|
multi_json (1.12.1)
|
22
|
+
netrc (0.11.0)
|
23
|
+
pry (0.10.4)
|
24
|
+
coderay (~> 1.1.0)
|
25
|
+
method_source (~> 0.8.1)
|
26
|
+
slop (~> 3.4)
|
19
27
|
rake (10.5.0)
|
28
|
+
rspec (3.5.0)
|
29
|
+
rspec-core (~> 3.5.0)
|
30
|
+
rspec-expectations (~> 3.5.0)
|
31
|
+
rspec-mocks (~> 3.5.0)
|
32
|
+
rspec-core (3.5.4)
|
33
|
+
rspec-support (~> 3.5.0)
|
34
|
+
rspec-expectations (3.5.0)
|
35
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
36
|
+
rspec-support (~> 3.5.0)
|
37
|
+
rspec-mocks (3.5.0)
|
38
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
39
|
+
rspec-support (~> 3.5.0)
|
40
|
+
rspec-support (3.5.0)
|
41
|
+
slop (3.6.0)
|
20
42
|
yard (0.8.7.6)
|
21
43
|
|
22
44
|
PLATFORMS
|
@@ -24,8 +46,11 @@ PLATFORMS
|
|
24
46
|
|
25
47
|
DEPENDENCIES
|
26
48
|
bundler (~> 1.3)
|
49
|
+
netrc
|
27
50
|
platform-api!
|
51
|
+
pry
|
28
52
|
rake
|
53
|
+
rspec
|
29
54
|
yard
|
30
55
|
|
31
56
|
BUNDLED WITH
|
data/README.md
CHANGED
@@ -312,6 +312,10 @@ Remember to commit and push the changes to Github.
|
|
312
312
|
|
313
313
|
* This project follows [semver](http://semver.org) from version 1.0.0. Please
|
314
314
|
be sure to keep this in mind if you're the project maintainer.
|
315
|
+
* Be sure to run the very basic acceptance rspecs. The rspecs will attempt
|
316
|
+
to parse your oauth token for `api.heroku.com` from your `.netrc`. You can
|
317
|
+
optionally use the `OAUTH_TOKEN` and `ACCOUNT_EMAIL` environment variables.
|
318
|
+
They don't mutate anything but they might in the future.
|
315
319
|
* Bump the version in `lib/platform-api/version.rb`
|
316
320
|
* `bundle install` to update Gemfile.lock
|
317
321
|
* `git commit -m 'vX.Y.Z' to stage the version and Gemfile.lock changes
|
data/Rakefile
CHANGED
data/config/client-config.rb
CHANGED
@@ -4,12 +4,14 @@ require 'heroics'
|
|
4
4
|
Heroics.default_configuration do |config|
|
5
5
|
config.base_url = 'https://api.heroku.com'
|
6
6
|
config.module_name = 'PlatformAPI'
|
7
|
-
config.schema_filepath = 'schema.json'
|
7
|
+
config.schema_filepath = File.join(File.expand_path('../..', __FILE__), 'schema.json')
|
8
8
|
|
9
9
|
config.headers = { 'Accept' => 'application/vnd.heroku+json; version=3' }
|
10
10
|
config.ruby_name_replacement_patterns = {
|
11
11
|
/add[^a-z]+on/i => 'addon',
|
12
12
|
/[\s-]+/ => '_',
|
13
13
|
}
|
14
|
+
# This needs to be in single quotes to avoid interpolation during the client
|
15
|
+
# build
|
14
16
|
config.cache_path = '#{Dir.home}/.heroics/platform-api'
|
15
17
|
end
|
data/lib/platform-api.rb
CHANGED
data/lib/platform-api/version.rb
CHANGED
data/platform-api.gemspec
CHANGED
@@ -22,7 +22,10 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.add_development_dependency 'bundler', '~> 1.3'
|
23
23
|
spec.add_development_dependency 'rake'
|
24
24
|
spec.add_development_dependency 'yard'
|
25
|
+
spec.add_development_dependency 'pry'
|
26
|
+
spec.add_development_dependency 'netrc'
|
27
|
+
spec.add_development_dependency 'rspec'
|
25
28
|
|
26
|
-
spec.add_dependency 'heroics', '~> 0.0.
|
29
|
+
spec.add_dependency 'heroics', '~> 0.0.21'
|
27
30
|
spec.add_dependency 'moneta', '~> 0.8.1'
|
28
31
|
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
require 'netrc'
|
2
|
+
require 'platform-api'
|
3
|
+
|
4
|
+
describe 'The generated platform api client' do
|
5
|
+
it "can get account info" do
|
6
|
+
expect(client.account.info(email)).not_to be_empty
|
7
|
+
end
|
8
|
+
|
9
|
+
it "can get addon info for an app" do
|
10
|
+
expect(client.addon.list_by_app(an_app['name'])).not_to be_empty
|
11
|
+
end
|
12
|
+
|
13
|
+
it "can list apps" do
|
14
|
+
expect(client.app.list).not_to be_empty
|
15
|
+
end
|
16
|
+
|
17
|
+
it "can get app info" do
|
18
|
+
expect(client.app.info(an_app['name'])).to eq an_app
|
19
|
+
end
|
20
|
+
|
21
|
+
it "can get build info" do
|
22
|
+
expect(client.build.list(an_app['name'])).not_to be_empty
|
23
|
+
end
|
24
|
+
|
25
|
+
it "can get config vars" do
|
26
|
+
expect(client.config_var.info_for_app(an_app['name'])).not_to be_empty
|
27
|
+
end
|
28
|
+
|
29
|
+
it "can get domain list and info" do
|
30
|
+
domains = client.domain.list(an_app['name'])
|
31
|
+
expect(domains).not_to be_empty
|
32
|
+
|
33
|
+
expect(client.domain.info(an_app['name'], domains.first['hostname'])).not_to be_empty
|
34
|
+
end
|
35
|
+
|
36
|
+
it "can get dyno sizes" do
|
37
|
+
expect(client.dyno_size.list).not_to be_empty
|
38
|
+
end
|
39
|
+
|
40
|
+
it "can get add-on plan info" do
|
41
|
+
expect(client.plan.list('heroku-postgresql')).not_to be_empty
|
42
|
+
end
|
43
|
+
|
44
|
+
it "can get release info" do
|
45
|
+
expect(client.release.list(an_app['name'])).not_to be_empty
|
46
|
+
end
|
47
|
+
|
48
|
+
def an_app
|
49
|
+
@app ||= client.app.list.first
|
50
|
+
end
|
51
|
+
|
52
|
+
def email
|
53
|
+
@email
|
54
|
+
end
|
55
|
+
|
56
|
+
def client
|
57
|
+
@client ||=
|
58
|
+
begin
|
59
|
+
entry = Netrc.read['api.heroku.com']
|
60
|
+
if entry
|
61
|
+
oauth_token = entry.password
|
62
|
+
@email = entry.login
|
63
|
+
else
|
64
|
+
oauth_token = ENV['OAUTH_TOKEN']
|
65
|
+
@email = ENV['ACCOUNT_EMAIL']
|
66
|
+
end
|
67
|
+
PlatformAPI.connect_oauth(oauth_token)
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'pry'
|
2
|
+
RSpec.configure do |config|
|
3
|
+
config.expect_with :rspec do |expectations|
|
4
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
5
|
+
end
|
6
|
+
|
7
|
+
config.mock_with :rspec do |mocks|
|
8
|
+
mocks.verify_partial_doubles = true
|
9
|
+
end
|
10
|
+
|
11
|
+
config.shared_context_metadata_behavior = :apply_to_host_groups
|
12
|
+
config.filter_run_when_matching :focus
|
13
|
+
config.example_status_persistence_file_path = "spec/examples.txt"
|
14
|
+
config.warnings = true
|
15
|
+
if config.files_to_run.one?
|
16
|
+
config.default_formatter = 'doc'
|
17
|
+
end
|
18
|
+
config.order = :random
|
19
|
+
Kernel.srand config.seed
|
20
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: platform-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jkakar
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-03-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -52,20 +52,62 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: pry
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: netrc
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rspec
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
55
97
|
- !ruby/object:Gem::Dependency
|
56
98
|
name: heroics
|
57
99
|
requirement: !ruby/object:Gem::Requirement
|
58
100
|
requirements:
|
59
101
|
- - "~>"
|
60
102
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.0.
|
103
|
+
version: 0.0.21
|
62
104
|
type: :runtime
|
63
105
|
prerelease: false
|
64
106
|
version_requirements: !ruby/object:Gem::Requirement
|
65
107
|
requirements:
|
66
108
|
- - "~>"
|
67
109
|
- !ruby/object:Gem::Version
|
68
|
-
version: 0.0.
|
110
|
+
version: 0.0.21
|
69
111
|
- !ruby/object:Gem::Dependency
|
70
112
|
name: moneta
|
71
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -88,6 +130,7 @@ extensions: []
|
|
88
130
|
extra_rdoc_files: []
|
89
131
|
files:
|
90
132
|
- ".gitignore"
|
133
|
+
- ".rspec"
|
91
134
|
- ".yardopts"
|
92
135
|
- CONTRIBUTING.md
|
93
136
|
- CONTRIBUTORS.md
|
@@ -103,6 +146,8 @@ files:
|
|
103
146
|
- lib/platform-api/version.rb
|
104
147
|
- platform-api.gemspec
|
105
148
|
- schema.json
|
149
|
+
- spec/acceptance/generated_client_spec.rb
|
150
|
+
- spec/spec_helper.rb
|
106
151
|
homepage: https://github.com/heroku/platform-api
|
107
152
|
licenses:
|
108
153
|
- MIT
|