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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 88df2d437658efbb3a909d1700f6cdd9ec6dcf37
4
- data.tar.gz: 72e69b42813a4e4c39dcf324b3184e5873a02b93
3
+ metadata.gz: aec2fe53e12c211774bfe6bce5058635b4960b53
4
+ data.tar.gz: d7ecbd97ac416f395a7dce1faab55f2a595c642f
5
5
  SHA512:
6
- metadata.gz: 5edb8f512045919b20630d7d55bbacc1b6d08a4b1667c8f535570e16ea6b64b4d89f83e0c3bcd825af979f3e430b9d67b3668aec1dcb7e4ba70270cb0a75e095
7
- data.tar.gz: 791b7e8f737499a53416920b4a1435d60bd6f1184a40ea4ce20b9d0ba01f6863990202d1516e712b46f8712d72d6b0263bf7aff1f7486778da50ca8ab02d4ea5
6
+ metadata.gz: bf2943dd2d58a472ae671f16ae920966a09996b98d8910bb629a4690fef7dd33a3615c0f64ea0bfe02d74bea234393ec6a9dd0f98339996a5671191fdd52b4e7
7
+ data.tar.gz: 0714a09309de96885fc25dd63246a1c9322979fb8cb62d1f63295f8fbd3566a7e05614d3590ee99a338ccfde2cddbfa0d9f8b79ab6c282ed2d21a3a8beb21123
data/README.md CHANGED
File without changes
@@ -1,3 +1,8 @@
1
+ 0.4.0 11/17/2015
2
+ ================
3
+
4
+ add buildpack methods
5
+
1
6
  0.3.22 12/17/2014
2
7
  =================
3
8
  add two factor capabilities
@@ -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.44'
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'
@@ -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"
@@ -66,6 +66,5 @@ module Heroku
66
66
  :query => app_params(params)
67
67
  )
68
68
  end
69
-
70
69
  end
71
70
  end
@@ -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
@@ -1,6 +1,7 @@
1
1
  require 'heroku/api/mock/addons'
2
2
  require 'heroku/api/mock/apps'
3
3
  require 'heroku/api/mock/attachments'
4
+ require 'heroku/api/mock/buildpacks'
4
5
  require 'heroku/api/mock/collaborators'
5
6
  require 'heroku/api/mock/config_vars'
6
7
  require 'heroku/api/mock/domains'
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Heroku
2
2
  class API
3
- VERSION = "0.3.23"
3
+ VERSION = "0.4.0"
4
4
  end
5
5
  end
@@ -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.3.23
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-03-19 00:00:00.000000000 Z
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.44'
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.44'
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: