heroku-api 0.3.23 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +0 -0
- data/changelog.txt +5 -0
- data/heroku-api.gemspec +1 -1
- data/lib/heroku/api.rb +1 -0
- data/lib/heroku/api/apps.rb +0 -1
- data/lib/heroku/api/buildpacks.rb +25 -0
- data/lib/heroku/api/mock.rb +1 -0
- data/lib/heroku/api/mock/buildpacks.rb +19 -0
- data/lib/heroku/api/version.rb +1 -1
- data/test/test_buildpacks.rb +13 -0
- metadata +10 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aec2fe53e12c211774bfe6bce5058635b4960b53
|
4
|
+
data.tar.gz: d7ecbd97ac416f395a7dce1faab55f2a595c642f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf2943dd2d58a472ae671f16ae920966a09996b98d8910bb629a4690fef7dd33a3615c0f64ea0bfe02d74bea234393ec6a9dd0f98339996a5671191fdd52b4e7
|
7
|
+
data.tar.gz: 0714a09309de96885fc25dd63246a1c9322979fb8cb62d1f63295f8fbd3566a7e05614d3590ee99a338ccfde2cddbfa0d9f8b79ab6c282ed2d21a3a8beb21123
|
data/README.md
CHANGED
File without changes
|
data/changelog.txt
CHANGED
data/heroku-api.gemspec
CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
|
|
17
17
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
18
18
|
s.require_paths = ["lib"]
|
19
19
|
|
20
|
-
s.add_runtime_dependency 'excon', '~>0.
|
20
|
+
s.add_runtime_dependency 'excon', '~>0.45'
|
21
21
|
s.add_runtime_dependency 'multi_json', '~>1.8'
|
22
22
|
|
23
23
|
s.add_development_dependency 'minitest'
|
data/lib/heroku/api.rb
CHANGED
@@ -18,6 +18,7 @@ require "heroku/api/version"
|
|
18
18
|
require "heroku/api/addons"
|
19
19
|
require "heroku/api/apps"
|
20
20
|
require "heroku/api/attachments"
|
21
|
+
require "heroku/api/buildpacks"
|
21
22
|
require "heroku/api/collaborators"
|
22
23
|
require "heroku/api/config_vars"
|
23
24
|
require "heroku/api/domains"
|
data/lib/heroku/api/apps.rb
CHANGED
@@ -0,0 +1,25 @@
|
|
1
|
+
module Heroku
|
2
|
+
class API
|
3
|
+
|
4
|
+
# PUT /apps/:buildpack
|
5
|
+
def put_buildpacks(app, buildpacks=[])
|
6
|
+
request(
|
7
|
+
:headers => {'Accept' => "application/vnd.heroku+json; version=3", 'Conent-Type' => 'application/json'},
|
8
|
+
:expects => 200,
|
9
|
+
:method => :put,
|
10
|
+
:path => "/apps/#{app}/buildpack-installations",
|
11
|
+
:body => MultiJson.dump({"updates" => buildpacks.map{|bp| {"buildpack"=>bp}}})
|
12
|
+
)
|
13
|
+
end
|
14
|
+
|
15
|
+
def get_buildpacks(app)
|
16
|
+
request(
|
17
|
+
:headers => {'Accept' => "application/vnd.heroku+json; version=3", 'Conent-Type' => 'application/json'},
|
18
|
+
:expects => 200,
|
19
|
+
:method => :get,
|
20
|
+
:path => "/apps/#{app}/buildpack-installations"
|
21
|
+
)
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
data/lib/heroku/api/mock.rb
CHANGED
@@ -0,0 +1,19 @@
|
|
1
|
+
module Heroku
|
2
|
+
class API
|
3
|
+
module Mock
|
4
|
+
|
5
|
+
# stub PUT /apps/:app/buildpack-installations
|
6
|
+
Excon.stub(:expects => 200, :method => :put, :path => %r{^/apps/([^/]+)/buildpack-installations$}) do |params|
|
7
|
+
request_params, mock_data = parse_stub_params(params)
|
8
|
+
app, _ = request_params[:captures][:path]
|
9
|
+
|
10
|
+
with_mock_app(mock_data, app) do |app_data|
|
11
|
+
{
|
12
|
+
:body => "",
|
13
|
+
:status => 200
|
14
|
+
}
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/lib/heroku/api/version.rb
CHANGED
@@ -0,0 +1,13 @@
|
|
1
|
+
require File.expand_path("#{File.dirname(__FILE__)}/test_helper")
|
2
|
+
|
3
|
+
class TestApps < Minitest::Test
|
4
|
+
|
5
|
+
def test_put_buildpacks
|
6
|
+
with_app do |app_data|
|
7
|
+
response = heroku.put_buildpacks(app_data['name'], ["heroku/ruby"])
|
8
|
+
|
9
|
+
assert_equal(200, response.status)
|
10
|
+
assert_equal("", response.body)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: heroku-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- geemus (Wesley Beary)
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-11-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: excon
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: '0.
|
20
|
+
version: '0.45'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: '0.
|
27
|
+
version: '0.45'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: multi_json
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -87,6 +87,7 @@ files:
|
|
87
87
|
- lib/heroku/api/addons.rb
|
88
88
|
- lib/heroku/api/apps.rb
|
89
89
|
- lib/heroku/api/attachments.rb
|
90
|
+
- lib/heroku/api/buildpacks.rb
|
90
91
|
- lib/heroku/api/collaborators.rb
|
91
92
|
- lib/heroku/api/config_vars.rb
|
92
93
|
- lib/heroku/api/domains.rb
|
@@ -99,6 +100,7 @@ files:
|
|
99
100
|
- lib/heroku/api/mock/addons.rb
|
100
101
|
- lib/heroku/api/mock/apps.rb
|
101
102
|
- lib/heroku/api/mock/attachments.rb
|
103
|
+
- lib/heroku/api/mock/buildpacks.rb
|
102
104
|
- lib/heroku/api/mock/cache/get_addons.json
|
103
105
|
- lib/heroku/api/mock/cache/get_features.json
|
104
106
|
- lib/heroku/api/mock/cache/get_user.json
|
@@ -124,6 +126,7 @@ files:
|
|
124
126
|
- test/test_addons.rb
|
125
127
|
- test/test_apps.rb
|
126
128
|
- test/test_attachments.rb
|
129
|
+
- test/test_buildpacks.rb
|
127
130
|
- test/test_collaborators.rb
|
128
131
|
- test/test_config_vars.rb
|
129
132
|
- test/test_domains.rb
|
@@ -159,7 +162,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
159
162
|
version: '0'
|
160
163
|
requirements: []
|
161
164
|
rubyforge_project:
|
162
|
-
rubygems_version: 2.4.5
|
165
|
+
rubygems_version: 2.4.5.1
|
163
166
|
signing_key:
|
164
167
|
specification_version: 4
|
165
168
|
summary: Ruby Client for the Heroku API
|
@@ -169,6 +172,7 @@ test_files:
|
|
169
172
|
- test/test_addons.rb
|
170
173
|
- test/test_apps.rb
|
171
174
|
- test/test_attachments.rb
|
175
|
+
- test/test_buildpacks.rb
|
172
176
|
- test/test_collaborators.rb
|
173
177
|
- test/test_config_vars.rb
|
174
178
|
- test/test_domains.rb
|
@@ -184,3 +188,4 @@ test_files:
|
|
184
188
|
- test/test_ssl_endpoints.rb
|
185
189
|
- test/test_stacks.rb
|
186
190
|
- test/test_user.rb
|
191
|
+
has_rdoc:
|