heroku-api 0.2.7 → 0.2.8
Sign up to get free protection for your applications and to get access to all the features.
- data/changelog.txt +5 -0
- data/lib/heroku/api.rb +5 -31
- data/lib/heroku/api/config_vars.rb +1 -1
- data/lib/heroku/api/mock.rb +3 -3
- data/lib/heroku/api/mock/addons.rb +12 -12
- data/lib/heroku/api/mock/apps.rb +8 -8
- data/lib/heroku/api/mock/collaborators.rb +1 -1
- data/lib/heroku/api/mock/config_vars.rb +3 -3
- data/lib/heroku/api/mock/domains.rb +2 -2
- data/lib/heroku/api/mock/features.rb +7 -7
- data/lib/heroku/api/mock/keys.rb +1 -1
- data/lib/heroku/api/mock/processes.rb +9 -9
- data/lib/heroku/api/mock/releases.rb +3 -3
- data/lib/heroku/api/mock/stacks.rb +3 -3
- data/lib/heroku/api/version.rb +1 -1
- data/test/test_addons.rb +1 -1
- data/test/test_features.rb +2 -2
- data/test/test_user.rb +1 -1
- metadata +10 -10
data/changelog.txt
CHANGED
data/lib/heroku/api.rb
CHANGED
@@ -9,6 +9,8 @@ unless $LOAD_PATH.include?(__LIB_DIR__)
|
|
9
9
|
$LOAD_PATH.unshift(__LIB_DIR__)
|
10
10
|
end
|
11
11
|
|
12
|
+
require "heroku/api/vendor/okjson"
|
13
|
+
|
12
14
|
require "heroku/api/errors"
|
13
15
|
require "heroku/api/mock"
|
14
16
|
require "heroku/api/version"
|
@@ -32,36 +34,6 @@ srand
|
|
32
34
|
module Heroku
|
33
35
|
class API
|
34
36
|
|
35
|
-
begin
|
36
|
-
|
37
|
-
require('json')
|
38
|
-
|
39
|
-
def self.json_decode(json)
|
40
|
-
JSON.parse(json)
|
41
|
-
rescue
|
42
|
-
json
|
43
|
-
end
|
44
|
-
|
45
|
-
def self.json_encode(object)
|
46
|
-
JSON.dump(object)
|
47
|
-
end
|
48
|
-
|
49
|
-
rescue LoadError
|
50
|
-
|
51
|
-
require('heroku/api/vendor/okjson')
|
52
|
-
|
53
|
-
def self.json_decode(json)
|
54
|
-
Heroku::API::OkJson.decode(json)
|
55
|
-
rescue
|
56
|
-
json
|
57
|
-
end
|
58
|
-
|
59
|
-
def self.json_encode(object)
|
60
|
-
Heroku::API::OkJson.encode(object)
|
61
|
-
end
|
62
|
-
|
63
|
-
end
|
64
|
-
|
65
37
|
def initialize(options={})
|
66
38
|
@api_key = options.delete(:api_key) || ENV['HEROKU_API_KEY']
|
67
39
|
user_pass = ":#{@api_key}"
|
@@ -109,7 +81,9 @@ module Heroku
|
|
109
81
|
response.body = Zlib::GzipReader.new(StringIO.new(response.body)).read
|
110
82
|
end
|
111
83
|
begin
|
112
|
-
response.body = Heroku::API.
|
84
|
+
response.body = Heroku::API::OkJson.decode(response.body)
|
85
|
+
rescue
|
86
|
+
# leave non-JSON body as is
|
113
87
|
end
|
114
88
|
end
|
115
89
|
|
data/lib/heroku/api/mock.rb
CHANGED
@@ -72,7 +72,7 @@ module Heroku
|
|
72
72
|
def self.get_mock_addon(mock_data, addon)
|
73
73
|
@addons ||= begin
|
74
74
|
data = File.read("#{File.dirname(__FILE__)}/mock/cache/get_addons.json")
|
75
|
-
Heroku::API.
|
75
|
+
Heroku::API::OkJson.decode(data)
|
76
76
|
end
|
77
77
|
@addons.detect {|addon_data| addon_data['name'] == addon}
|
78
78
|
end
|
@@ -106,7 +106,7 @@ module Heroku
|
|
106
106
|
def self.get_mock_feature(mock_data, feature)
|
107
107
|
@features ||= begin
|
108
108
|
data = File.read("#{File.dirname(__FILE__)}/mock/cache/get_features.json")
|
109
|
-
Heroku::API.
|
109
|
+
Heroku::API::OkJson.decode(data)
|
110
110
|
end
|
111
111
|
@features.detect {|feature_data| feature_data['name'] == feature}
|
112
112
|
end
|
@@ -139,7 +139,7 @@ module Heroku
|
|
139
139
|
|
140
140
|
parsed = params.dup
|
141
141
|
begin # try to JSON decode
|
142
|
-
parsed[:body] &&= Heroku::API.
|
142
|
+
parsed[:body] &&= Heroku::API::OkJson.decode(parsed[:body])
|
143
143
|
rescue # else leave as is
|
144
144
|
end
|
145
145
|
|
@@ -14,7 +14,7 @@ module Heroku
|
|
14
14
|
# addon is currently installed
|
15
15
|
remove_mock_app_addon(mock_data, app, addon)
|
16
16
|
{
|
17
|
-
:body => Heroku::API.
|
17
|
+
:body => Heroku::API::OkJson.encode({
|
18
18
|
"message" => nil,
|
19
19
|
"price" => get_mock_addon_price(mock_data, addon),
|
20
20
|
"status" => 'Uninstalled'
|
@@ -24,14 +24,14 @@ module Heroku
|
|
24
24
|
else
|
25
25
|
# addon is not currently installed
|
26
26
|
{
|
27
|
-
:body => Heroku::API.
|
27
|
+
:body => Heroku::API::OkJson.encode({'error' => "The add-on #{addon} is not installed for this app. Did you mean:\n\t#{addon_names.join("\n\t")}"}),
|
28
28
|
:status => 422
|
29
29
|
}
|
30
30
|
end
|
31
31
|
else
|
32
32
|
# addon does not exist
|
33
33
|
{
|
34
|
-
:body => Heroku::API.
|
34
|
+
:body => Heroku::API::OkJson.encode({'error' => "Could not find add-on #{addon}. Did you mean:\n\t#{addon_names.join("\n\t")}"}),
|
35
35
|
:status => 422
|
36
36
|
}
|
37
37
|
end
|
@@ -53,7 +53,7 @@ module Heroku
|
|
53
53
|
app, _ = request_params[:captures][:path]
|
54
54
|
with_mock_app(mock_data, app) do
|
55
55
|
{
|
56
|
-
:body => Heroku::API.
|
56
|
+
:body => Heroku::API::OkJson.encode(mock_data[:addons][app].map {|addon| addon['configured'] = true; addon}),
|
57
57
|
:status => 200
|
58
58
|
}
|
59
59
|
end
|
@@ -72,7 +72,7 @@ module Heroku
|
|
72
72
|
# addon is not currently installed
|
73
73
|
add_mock_app_addon(mock_data, app, addon)
|
74
74
|
{
|
75
|
-
:body => Heroku::API.
|
75
|
+
:body => Heroku::API::OkJson.encode({
|
76
76
|
"message" => nil,
|
77
77
|
"price" => get_mock_addon_price(mock_data, addon),
|
78
78
|
"status" => 'Installed'
|
@@ -82,21 +82,21 @@ module Heroku
|
|
82
82
|
else
|
83
83
|
# addon is currently installed
|
84
84
|
{
|
85
|
-
:body => Heroku::API.
|
85
|
+
:body => Heroku::API::OkJson.encode({'error' => "Add-on already installed."}),
|
86
86
|
:status => 422
|
87
87
|
}
|
88
88
|
end
|
89
89
|
else
|
90
90
|
# addon of same type exists
|
91
91
|
{
|
92
|
-
:body => Heroku::API.
|
92
|
+
:body => Heroku::API::OkJson.encode({'error' => "#{app_addon_type_data['name']} add-on already added.\nTo upgrade, use addons:upgrade instead.\n"}),
|
93
93
|
:status => 422
|
94
94
|
}
|
95
95
|
end
|
96
96
|
else
|
97
97
|
# addon does not exist
|
98
98
|
{
|
99
|
-
:body => Heroku::API.
|
99
|
+
:body => Heroku::API::OkJson.encode({'error' => "Add-on not found."}),
|
100
100
|
:status => 404
|
101
101
|
}
|
102
102
|
end
|
@@ -117,7 +117,7 @@ module Heroku
|
|
117
117
|
mock_data[:addons][app].delete(app_addon_data)
|
118
118
|
add_mock_app_addon(mock_data, app, addon)
|
119
119
|
{
|
120
|
-
:body => Heroku::API.
|
120
|
+
:body => Heroku::API::OkJson.encode({
|
121
121
|
"message" => 'Plan upgraded',
|
122
122
|
"price" => get_mock_addon_price(mock_data, addon),
|
123
123
|
"status" => 'Updated'
|
@@ -127,21 +127,21 @@ module Heroku
|
|
127
127
|
else
|
128
128
|
# addon is currently installed
|
129
129
|
{
|
130
|
-
:body => Heroku::API.
|
130
|
+
:body => Heroku::API::OkJson.encode({'error' => "Add-on already installed."}),
|
131
131
|
:status => 422
|
132
132
|
}
|
133
133
|
end
|
134
134
|
else
|
135
135
|
# addon of same type not installed
|
136
136
|
{
|
137
|
-
:body => Heroku::API.
|
137
|
+
:body => Heroku::API::OkJson.encode({'error' => "Can't upgrade, no #{addon.split(':').join(' ')} add-on has been added.\nTo add, use addons:add instead.\n"}),
|
138
138
|
:status => 422
|
139
139
|
}
|
140
140
|
end
|
141
141
|
else
|
142
142
|
# addon does not exist
|
143
143
|
{
|
144
|
-
:body => Heroku::API.
|
144
|
+
:body => Heroku::API::OkJson.encode({'error' => "Add-on not found."}),
|
145
145
|
:status => 404
|
146
146
|
}
|
147
147
|
end
|
data/lib/heroku/api/mock/apps.rb
CHANGED
@@ -15,7 +15,7 @@ module Heroku
|
|
15
15
|
mock_data[:ps].delete(app)
|
16
16
|
mock_data[:releases].delete(app)
|
17
17
|
{
|
18
|
-
:body => Heroku::API.
|
18
|
+
:body => Heroku::API::OkJson.encode({}),
|
19
19
|
:status => 200
|
20
20
|
}
|
21
21
|
end
|
@@ -25,7 +25,7 @@ module Heroku
|
|
25
25
|
Excon.stub(:expects => 200, :method => :get, :path => '/apps') do |params|
|
26
26
|
request_params, mock_data = parse_stub_params(params)
|
27
27
|
{
|
28
|
-
:body => Heroku::API.
|
28
|
+
:body => Heroku::API::OkJson.encode(mock_data[:apps]),
|
29
29
|
:status => 200
|
30
30
|
}
|
31
31
|
end
|
@@ -36,7 +36,7 @@ module Heroku
|
|
36
36
|
app, _ = request_params[:captures][:path]
|
37
37
|
with_mock_app(mock_data, app) do |app_data|
|
38
38
|
{
|
39
|
-
:body => Heroku::API.
|
39
|
+
:body => Heroku::API::OkJson.encode(app_data),
|
40
40
|
:status => 200
|
41
41
|
}
|
42
42
|
end
|
@@ -49,7 +49,7 @@ module Heroku
|
|
49
49
|
|
50
50
|
if get_mock_app(mock_data, app)
|
51
51
|
{
|
52
|
-
:body => Heroku::API.
|
52
|
+
:body => Heroku::API::OkJson.encode('error' => 'Name is already taken'),
|
53
53
|
:status => 422
|
54
54
|
}
|
55
55
|
else
|
@@ -112,7 +112,7 @@ module Heroku
|
|
112
112
|
end
|
113
113
|
|
114
114
|
{
|
115
|
-
:body => Heroku::API.
|
115
|
+
:body => Heroku::API::OkJson.encode(app_data),
|
116
116
|
:status => 202
|
117
117
|
}
|
118
118
|
end
|
@@ -157,12 +157,12 @@ module Heroku
|
|
157
157
|
end
|
158
158
|
if email && !collaborator
|
159
159
|
{
|
160
|
-
:body => Heroku::API.
|
160
|
+
:body => Heroku::API::OkJson.encode('error' => 'Only existing collaborators can receive ownership for an app'),
|
161
161
|
:status => 422
|
162
162
|
}
|
163
163
|
else
|
164
164
|
{
|
165
|
-
:body => Heroku::API.
|
165
|
+
:body => Heroku::API::OkJson.encode('name' => app_data['name']),
|
166
166
|
:status => 200
|
167
167
|
}
|
168
168
|
end
|
@@ -176,7 +176,7 @@ module Heroku
|
|
176
176
|
|
177
177
|
with_mock_app(mock_data, app) do |app_data|
|
178
178
|
{
|
179
|
-
:body => Heroku::API.
|
179
|
+
:body => Heroku::API::OkJson.encode({}),
|
180
180
|
:status => 201
|
181
181
|
}
|
182
182
|
end
|
@@ -25,7 +25,7 @@ module Heroku
|
|
25
25
|
app, _ = request_params[:captures][:path]
|
26
26
|
with_mock_app(mock_data, app) do
|
27
27
|
{
|
28
|
-
:body => Heroku::API.
|
28
|
+
:body => Heroku::API::OkJson.encode(mock_data[:collaborators][app]),
|
29
29
|
:status => 200
|
30
30
|
}
|
31
31
|
end
|
@@ -10,7 +10,7 @@ module Heroku
|
|
10
10
|
mock_data[:config_vars][app].delete(key)
|
11
11
|
add_mock_release(mock_data, app, {'descr' => "Config remove #{key}"})
|
12
12
|
{
|
13
|
-
:body => Heroku::API.
|
13
|
+
:body => Heroku::API::OkJson.encode(mock_data[:config_vars][app]),
|
14
14
|
:status => 200
|
15
15
|
}
|
16
16
|
end
|
@@ -22,7 +22,7 @@ module Heroku
|
|
22
22
|
app, _ = request_params[:captures][:path]
|
23
23
|
with_mock_app(mock_data, app) do
|
24
24
|
{
|
25
|
-
:body => Heroku::API.
|
25
|
+
:body => Heroku::API::OkJson.encode(mock_data[:config_vars][app]),
|
26
26
|
:status => 200
|
27
27
|
}
|
28
28
|
end
|
@@ -37,7 +37,7 @@ module Heroku
|
|
37
37
|
mock_data[:config_vars][app].merge!(new_config_vars)
|
38
38
|
add_mock_release(mock_data, app, {'descr' => "Config add #{new_config_vars.keys.join(', ')}"})
|
39
39
|
{
|
40
|
-
:body => Heroku::API.
|
40
|
+
:body => Heroku::API::OkJson.encode(mock_data[:config_vars][app]),
|
41
41
|
:status => 200
|
42
42
|
}
|
43
43
|
end
|
@@ -42,7 +42,7 @@ module Heroku
|
|
42
42
|
app, _ = request_params[:captures][:path]
|
43
43
|
with_mock_app(mock_data, app) do |app_data|
|
44
44
|
{
|
45
|
-
:body => Heroku::API.
|
45
|
+
:body => Heroku::API::OkJson.encode(mock_data[:domains][app]),
|
46
46
|
:status => 200
|
47
47
|
}
|
48
48
|
end
|
@@ -66,7 +66,7 @@ module Heroku
|
|
66
66
|
}
|
67
67
|
end
|
68
68
|
{
|
69
|
-
:body => Heroku::API.
|
69
|
+
:body => Heroku::API::OkJson.encode('domain' => domain),
|
70
70
|
:status => 201
|
71
71
|
}
|
72
72
|
end
|
@@ -16,20 +16,20 @@ module Heroku
|
|
16
16
|
when 'app'
|
17
17
|
mock_data[:features][:app][app].delete(feature_data)
|
18
18
|
{
|
19
|
-
:body => Heroku::API.
|
19
|
+
:body => Heroku::API::OkJson.encode(feature_data.merge('enabled' => false)),
|
20
20
|
:status => 200
|
21
21
|
}
|
22
22
|
when 'user'
|
23
23
|
mock_data[:features][:user].delete(feature_data.merge('enabled' => false))
|
24
24
|
{
|
25
|
-
:body => Heroku::API.
|
25
|
+
:body => Heroku::API::OkJson.encode(feature_data),
|
26
26
|
:status => 200
|
27
27
|
}
|
28
28
|
end
|
29
29
|
else
|
30
30
|
# feature does not exist
|
31
31
|
{
|
32
|
-
:body => Heroku::API.
|
32
|
+
:body => Heroku::API::OkJson.encode({'error' => "Feature not found."}),
|
33
33
|
:status => 404
|
34
34
|
}
|
35
35
|
end
|
@@ -56,13 +56,13 @@ module Heroku
|
|
56
56
|
feature, _ = request_params[:captures][:path]
|
57
57
|
if feature_data = get_mock_feature(mock_data, feature)
|
58
58
|
{
|
59
|
-
:body => Heroku::API.
|
59
|
+
:body => Heroku::API::OkJson.encode(feature_data),
|
60
60
|
:status => 200
|
61
61
|
}
|
62
62
|
else
|
63
63
|
# feature does not exist
|
64
64
|
{
|
65
|
-
:body => Heroku::API.
|
65
|
+
:body => Heroku::API::OkJson.encode({'error' => "Feature not found."}),
|
66
66
|
:status => 404
|
67
67
|
}
|
68
68
|
end
|
@@ -82,7 +82,7 @@ module Heroku
|
|
82
82
|
when 'app'
|
83
83
|
mock_data[:features][:app][app] << feature_data
|
84
84
|
{
|
85
|
-
:body => Heroku::API.
|
85
|
+
:body => Heroku::API::OkJson.encode(feature_data),
|
86
86
|
:status => 200
|
87
87
|
}
|
88
88
|
when 'user'
|
@@ -95,7 +95,7 @@ module Heroku
|
|
95
95
|
else
|
96
96
|
# feature does not exist
|
97
97
|
{
|
98
|
-
:body => Heroku::API.
|
98
|
+
:body => Heroku::API::OkJson.encode({'error' => "Feature not found."}),
|
99
99
|
:status => 404
|
100
100
|
}
|
101
101
|
end
|
data/lib/heroku/api/mock/keys.rb
CHANGED
@@ -26,7 +26,7 @@ module Heroku
|
|
26
26
|
Excon.stub(:expects => 200, :method => :get, :path => %r{^/user/keys}) do |params|
|
27
27
|
request_params, mock_data = parse_stub_params(params)
|
28
28
|
{
|
29
|
-
:body => Heroku::API.
|
29
|
+
:body => Heroku::API::OkJson.encode(mock_data[:keys]),
|
30
30
|
:status => 200
|
31
31
|
}
|
32
32
|
end
|
@@ -8,7 +8,7 @@ module Heroku
|
|
8
8
|
app, _ = request_params[:captures][:path]
|
9
9
|
with_mock_app(mock_data, app) do |app_data|
|
10
10
|
{
|
11
|
-
:body => Heroku::API.
|
11
|
+
:body => Heroku::API::OkJson.encode(get_mock_processes(mock_data, app)),
|
12
12
|
:status => 200
|
13
13
|
}
|
14
14
|
end
|
@@ -43,7 +43,7 @@ module Heroku
|
|
43
43
|
}
|
44
44
|
mock_data[:ps][app] << data
|
45
45
|
{
|
46
|
-
:body => Heroku::API.
|
46
|
+
:body => Heroku::API::OkJson.encode(data),
|
47
47
|
:status => 200,
|
48
48
|
}
|
49
49
|
end
|
@@ -117,13 +117,13 @@ module Heroku
|
|
117
117
|
}
|
118
118
|
else
|
119
119
|
{
|
120
|
-
:body => Heroku::API.
|
120
|
+
:body => Heroku::API::OkJson.encode('error' => "No such type as #{type}") ,
|
121
121
|
:status => 422
|
122
122
|
}
|
123
123
|
end
|
124
124
|
else
|
125
125
|
{
|
126
|
-
:body => Heroku::API.
|
126
|
+
:body => Heroku::API::OkJson.encode('error' => "That feature is not available on this app's stack"),
|
127
127
|
:status => 422
|
128
128
|
}
|
129
129
|
end
|
@@ -139,7 +139,7 @@ module Heroku
|
|
139
139
|
type = request_params[:query].has_key?('type') && request_params[:query]['type']
|
140
140
|
if !ps && !type
|
141
141
|
{
|
142
|
-
:body => Heroku::API.
|
142
|
+
:body => Heroku::API::OkJson.encode({'error' => 'Missing process argument'}),
|
143
143
|
:status => 422
|
144
144
|
}
|
145
145
|
else
|
@@ -160,12 +160,12 @@ module Heroku
|
|
160
160
|
unless app_data['stack'] == 'cedar'
|
161
161
|
app_data['dynos'] = dynos
|
162
162
|
{
|
163
|
-
:body => Heroku::API.
|
163
|
+
:body => Heroku::API::OkJson.encode({'name' => app, 'dynos' => dynos}),
|
164
164
|
:status => 200
|
165
165
|
}
|
166
166
|
else
|
167
167
|
{
|
168
|
-
:body => Heroku::API.
|
168
|
+
:body => Heroku::API::OkJson.encode({'error' => "For Cedar apps, use `heroku scale web=#{dynos}`"}),
|
169
169
|
:status => 422
|
170
170
|
}
|
171
171
|
end
|
@@ -181,12 +181,12 @@ module Heroku
|
|
181
181
|
unless app_data['stack'] == 'cedar'
|
182
182
|
app_data['workers'] = workers
|
183
183
|
{
|
184
|
-
:body => Heroku::API.
|
184
|
+
:body => Heroku::API::OkJson.encode({'name' => app, 'workers' => workers}),
|
185
185
|
:status => 200
|
186
186
|
}
|
187
187
|
else
|
188
188
|
{
|
189
|
-
:body => Heroku::API.
|
189
|
+
:body => Heroku::API::OkJson.encode({'error' => "For Cedar apps, use `heroku scale worker=#{workers}`"}),
|
190
190
|
:status => 422
|
191
191
|
}
|
192
192
|
end
|
@@ -8,7 +8,7 @@ module Heroku
|
|
8
8
|
app, _ = request_params[:captures][:path]
|
9
9
|
with_mock_app(mock_data, app) do |app_data|
|
10
10
|
{
|
11
|
-
:body => Heroku::API.
|
11
|
+
:body => Heroku::API::OkJson.encode(mock_data[:releases][app]),
|
12
12
|
:status => 200
|
13
13
|
}
|
14
14
|
end
|
@@ -22,7 +22,7 @@ module Heroku
|
|
22
22
|
releases = mock_data[:releases][app]
|
23
23
|
if release_data = (release_name == 'current' && releases.last) || releases.detect {|release| release['name'] == release_name}
|
24
24
|
{
|
25
|
-
:body => Heroku::API.
|
25
|
+
:body => Heroku::API::OkJson.encode(release_data),
|
26
26
|
:status => 200
|
27
27
|
}
|
28
28
|
else
|
@@ -51,7 +51,7 @@ module Heroku
|
|
51
51
|
}
|
52
52
|
else
|
53
53
|
{
|
54
|
-
:body => Heroku::API.
|
54
|
+
:body => Heroku::API::OkJson.encode({'error' => 'Cannot rollback to a release that had a different set of addons installed'}),
|
55
55
|
:status => 422
|
56
56
|
}
|
57
57
|
end
|
@@ -37,7 +37,7 @@ module Heroku
|
|
37
37
|
stack_data = Marshal::load(Marshal.dump(STACKS))
|
38
38
|
stack_data.detect {|stack| stack['name'] == app_data['stack']}['current'] = true
|
39
39
|
{
|
40
|
-
:body => Heroku::API.
|
40
|
+
:body => Heroku::API::OkJson.encode(stack_data),
|
41
41
|
:status => 200
|
42
42
|
}
|
43
43
|
end
|
@@ -65,13 +65,13 @@ BODY
|
|
65
65
|
}
|
66
66
|
else
|
67
67
|
{
|
68
|
-
:body => Heroku::API.
|
68
|
+
:body => Heroku::API::OkJson.encode('error' => 'Stack not found'),
|
69
69
|
:status => 404
|
70
70
|
}
|
71
71
|
end
|
72
72
|
else
|
73
73
|
{
|
74
|
-
:body => Heroku::API.
|
74
|
+
:body => Heroku::API::OkJson.encode('error' => 'Stack migration to/from Cedar is not available. Create a new app with --stack cedar instead.'),
|
75
75
|
:status => 422
|
76
76
|
}
|
77
77
|
end
|
data/lib/heroku/api/version.rb
CHANGED
data/test/test_addons.rb
CHANGED
@@ -43,7 +43,7 @@ class TestAddons < MiniTest::Unit::TestCase
|
|
43
43
|
data = File.read("#{File.dirname(__FILE__)}/../lib/heroku/api/mock/cache/get_addons.json")
|
44
44
|
|
45
45
|
assert_equal(200, response.status)
|
46
|
-
assert_equal(Heroku::API.
|
46
|
+
assert_equal(Heroku::API::OkJson.decode(data), response.body)
|
47
47
|
end
|
48
48
|
|
49
49
|
def test_get_addons_with_app
|
data/test/test_features.rb
CHANGED
@@ -5,7 +5,7 @@ class TestFeatures < MiniTest::Unit::TestCase
|
|
5
5
|
def setup
|
6
6
|
@feature_data ||= begin
|
7
7
|
data = File.read("#{File.dirname(__FILE__)}/../lib/heroku/api/mock/cache/get_features.json")
|
8
|
-
features_data = Heroku::API.
|
8
|
+
features_data = Heroku::API::OkJson.decode(data)
|
9
9
|
features_data.detect {|feature| feature['name'] == 'user_env_compile'}
|
10
10
|
end
|
11
11
|
end
|
@@ -40,7 +40,7 @@ class TestFeatures < MiniTest::Unit::TestCase
|
|
40
40
|
data = File.read("#{File.dirname(__FILE__)}/../lib/heroku/api/mock/cache/get_features.json")
|
41
41
|
|
42
42
|
assert_equal(200, response.status)
|
43
|
-
assert_equal(Heroku::API.
|
43
|
+
assert_equal(Heroku::API::OkJson.decode(data), response.body)
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
data/test/test_user.rb
CHANGED
@@ -7,7 +7,7 @@ class TestUser < MiniTest::Unit::TestCase
|
|
7
7
|
data = File.read("#{File.dirname(__FILE__)}/../lib/heroku/api/mock/cache/get_user.json")
|
8
8
|
|
9
9
|
assert_equal(200, response.status)
|
10
|
-
assert_equal(Heroku::API.
|
10
|
+
assert_equal(Heroku::API::OkJson.decode(data), response.body)
|
11
11
|
end
|
12
12
|
|
13
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.2.
|
4
|
+
version: 0.2.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-07-
|
12
|
+
date: 2012-07-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: excon
|
16
|
-
requirement: &
|
16
|
+
requirement: &70218833874580 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 0.14.3
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70218833874580
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: minitest
|
27
|
-
requirement: &
|
27
|
+
requirement: &70218833873800 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70218833873800
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rake
|
38
|
-
requirement: &
|
38
|
+
requirement: &70218833885800 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70218833885800
|
47
47
|
description: Ruby Client for the Heroku API
|
48
48
|
email:
|
49
49
|
- wesley@heroku.com
|
@@ -121,7 +121,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
121
121
|
version: '0'
|
122
122
|
segments:
|
123
123
|
- 0
|
124
|
-
hash:
|
124
|
+
hash: 4155132943236382125
|
125
125
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
126
126
|
none: false
|
127
127
|
requirements:
|
@@ -130,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
130
130
|
version: '0'
|
131
131
|
segments:
|
132
132
|
- 0
|
133
|
-
hash:
|
133
|
+
hash: 4155132943236382125
|
134
134
|
requirements: []
|
135
135
|
rubyforge_project:
|
136
136
|
rubygems_version: 1.8.15
|