engineyard 1.3.25 → 1.3.28

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module EY
2
- VERSION = '1.3.25'
2
+ VERSION = '1.3.28'
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: engineyard
3
3
  version: !ruby/object:Gem::Version
4
- hash: 41
4
+ hash: 35
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 3
9
- - 25
10
- version: 1.3.25
9
+ - 28
10
+ version: 1.3.28
11
11
  platform: ruby
12
12
  authors:
13
13
  - EY Cloud Team
@@ -15,10 +15,11 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-09-12 00:00:00 -07:00
19
- default_executable: ey
18
+ date: 2011-09-14 00:00:00 Z
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
21
+ name: thor
22
+ prerelease: false
22
23
  requirement: &id001 !ruby/object:Gem::Requirement
23
24
  none: false
24
25
  requirements:
@@ -30,11 +31,11 @@ dependencies:
30
31
  - 14
31
32
  - 6
32
33
  version: 0.14.6
33
- name: thor
34
- prerelease: false
35
34
  type: :runtime
36
35
  version_requirements: *id001
37
36
  - !ruby/object:Gem::Dependency
37
+ name: rest-client
38
+ prerelease: false
38
39
  requirement: &id002 !ruby/object:Gem::Requirement
39
40
  none: false
40
41
  requirements:
@@ -46,11 +47,11 @@ dependencies:
46
47
  - 6
47
48
  - 0
48
49
  version: 1.6.0
49
- name: rest-client
50
- prerelease: false
51
50
  type: :runtime
52
51
  version_requirements: *id002
53
52
  - !ruby/object:Gem::Dependency
53
+ name: highline
54
+ prerelease: false
54
55
  requirement: &id003 !ruby/object:Gem::Requirement
55
56
  none: false
56
57
  requirements:
@@ -62,11 +63,11 @@ dependencies:
62
63
  - 6
63
64
  - 1
64
65
  version: 1.6.1
65
- name: highline
66
- prerelease: false
67
66
  type: :runtime
68
67
  version_requirements: *id003
69
68
  - !ruby/object:Gem::Dependency
69
+ name: json_pure
70
+ prerelease: false
70
71
  requirement: &id004 !ruby/object:Gem::Requirement
71
72
  none: false
72
73
  requirements:
@@ -76,11 +77,11 @@ dependencies:
76
77
  segments:
77
78
  - 0
78
79
  version: "0"
79
- name: json_pure
80
- prerelease: false
81
80
  type: :runtime
82
81
  version_requirements: *id004
83
82
  - !ruby/object:Gem::Dependency
83
+ name: escape
84
+ prerelease: false
84
85
  requirement: &id005 !ruby/object:Gem::Requirement
85
86
  none: false
86
87
  requirements:
@@ -92,11 +93,11 @@ dependencies:
92
93
  - 0
93
94
  - 4
94
95
  version: 0.0.4
95
- name: escape
96
- prerelease: false
97
96
  type: :runtime
98
97
  version_requirements: *id005
99
98
  - !ruby/object:Gem::Dependency
99
+ name: engineyard-serverside-adapter
100
+ prerelease: false
100
101
  requirement: &id006 !ruby/object:Gem::Requirement
101
102
  none: false
102
103
  requirements:
@@ -108,11 +109,11 @@ dependencies:
108
109
  - 4
109
110
  - 1
110
111
  version: 1.4.1
111
- name: engineyard-serverside-adapter
112
- prerelease: false
113
112
  type: :runtime
114
113
  version_requirements: *id006
115
114
  - !ruby/object:Gem::Dependency
115
+ name: net-ssh
116
+ prerelease: false
116
117
  requirement: &id007 !ruby/object:Gem::Requirement
117
118
  none: false
118
119
  requirements:
@@ -124,11 +125,11 @@ dependencies:
124
125
  - 1
125
126
  - 0
126
127
  version: 2.1.0
127
- name: net-ssh
128
- prerelease: false
129
128
  type: :runtime
130
129
  version_requirements: *id007
131
130
  - !ruby/object:Gem::Dependency
131
+ name: launchy
132
+ prerelease: false
132
133
  requirement: &id008 !ruby/object:Gem::Requirement
133
134
  none: false
134
135
  requirements:
@@ -140,11 +141,11 @@ dependencies:
140
141
  - 0
141
142
  - 5
142
143
  version: 2.0.5
143
- name: launchy
144
- prerelease: false
145
144
  type: :runtime
146
145
  version_requirements: *id008
147
146
  - !ruby/object:Gem::Dependency
147
+ name: rspec
148
+ prerelease: false
148
149
  requirement: &id009 !ruby/object:Gem::Requirement
149
150
  none: false
150
151
  requirements:
@@ -156,11 +157,11 @@ dependencies:
156
157
  - 3
157
158
  - 0
158
159
  version: 1.3.0
159
- name: rspec
160
- prerelease: false
161
160
  type: :development
162
161
  version_requirements: *id009
163
162
  - !ruby/object:Gem::Dependency
163
+ name: rake
164
+ prerelease: false
164
165
  requirement: &id010 !ruby/object:Gem::Requirement
165
166
  none: false
166
167
  requirements:
@@ -170,11 +171,11 @@ dependencies:
170
171
  segments:
171
172
  - 0
172
173
  version: "0"
173
- name: rake
174
- prerelease: false
175
174
  type: :development
176
175
  version_requirements: *id010
177
176
  - !ruby/object:Gem::Dependency
177
+ name: fakeweb
178
+ prerelease: false
178
179
  requirement: &id011 !ruby/object:Gem::Requirement
179
180
  none: false
180
181
  requirements:
@@ -184,11 +185,11 @@ dependencies:
184
185
  segments:
185
186
  - 0
186
187
  version: "0"
187
- name: fakeweb
188
- prerelease: false
189
188
  type: :development
190
189
  version_requirements: *id011
191
190
  - !ruby/object:Gem::Dependency
191
+ name: fakeweb-matcher
192
+ prerelease: false
192
193
  requirement: &id012 !ruby/object:Gem::Requirement
193
194
  none: false
194
195
  requirements:
@@ -198,11 +199,11 @@ dependencies:
198
199
  segments:
199
200
  - 0
200
201
  version: "0"
201
- name: fakeweb-matcher
202
- prerelease: false
203
202
  type: :development
204
203
  version_requirements: *id012
205
204
  - !ruby/object:Gem::Dependency
205
+ name: fakefs
206
+ prerelease: false
206
207
  requirement: &id013 !ruby/object:Gem::Requirement
207
208
  none: false
208
209
  requirements:
@@ -212,11 +213,11 @@ dependencies:
212
213
  segments:
213
214
  - 0
214
215
  version: "0"
215
- name: fakefs
216
- prerelease: false
217
216
  type: :development
218
217
  version_requirements: *id013
219
218
  - !ruby/object:Gem::Dependency
219
+ name: sinatra
220
+ prerelease: false
220
221
  requirement: &id014 !ruby/object:Gem::Requirement
221
222
  none: false
222
223
  requirements:
@@ -226,11 +227,11 @@ dependencies:
226
227
  segments:
227
228
  - 0
228
229
  version: "0"
229
- name: sinatra
230
- prerelease: false
231
230
  type: :development
232
231
  version_requirements: *id014
233
232
  - !ruby/object:Gem::Dependency
233
+ name: realweb
234
+ prerelease: false
234
235
  requirement: &id015 !ruby/object:Gem::Requirement
235
236
  none: false
236
237
  requirements:
@@ -242,11 +243,11 @@ dependencies:
242
243
  - 1
243
244
  - 6
244
245
  version: 0.1.6
245
- name: realweb
246
- prerelease: false
247
246
  type: :development
248
247
  version_requirements: *id015
249
248
  - !ruby/object:Gem::Dependency
249
+ name: open4
250
+ prerelease: false
250
251
  requirement: &id016 !ruby/object:Gem::Requirement
251
252
  none: false
252
253
  requirements:
@@ -258,8 +259,6 @@ dependencies:
258
259
  - 0
259
260
  - 1
260
261
  version: 1.0.1
261
- name: open4
262
- prerelease: false
263
262
  type: :development
264
263
  version_requirements: *id016
265
264
  description: This gem allows you to deploy your rails application to the Engine Yard cloud directly from the command line.
@@ -298,7 +297,6 @@ files:
298
297
  - lib/engineyard/ruby_ext.rb
299
298
  - lib/engineyard/thor.rb
300
299
  - lib/engineyard/version.rb
301
- - lib/engineyard-api-client.rb
302
300
  - lib/engineyard.rb
303
301
  - LICENSE
304
302
  - README.rdoc
@@ -336,7 +334,6 @@ files:
336
334
  - spec/support/ruby_ext.rb
337
335
  - spec/support/scenarios.rb
338
336
  - spec/support/shared_behavior.rb
339
- has_rdoc: true
340
337
  homepage: http://github.com/engineyard/engineyard
341
338
  licenses: []
342
339
 
@@ -378,7 +375,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
378
375
  requirements: []
379
376
 
380
377
  rubyforge_project:
381
- rubygems_version: 1.5.0
378
+ rubygems_version: 1.8.8
382
379
  signing_key:
383
380
  specification_version: 3
384
381
  summary: Command-line deployment for the Engine Yard cloud
@@ -1,135 +0,0 @@
1
- require 'engineyard/model'
2
-
3
- module EngineYard
4
- class APIClient
5
- attr_reader :token
6
-
7
- USER_AGENT_STRING = "EngineYardAPIClient/#{VERSION}"
8
-
9
- def initialize(token = nil)
10
- @token ||= token
11
- @token ||= self.class.read_token
12
- raise ArgumentError, "EY Cloud API token required" unless @token
13
- end
14
-
15
- def ==(other)
16
- raise ArgumentError unless other.is_a?(self.class)
17
- self.token == other.token
18
- end
19
-
20
- def request(url, opts={})
21
- opts[:headers] ||= {}
22
- opts[:headers]["X-EY-Cloud-Token"] = token
23
- EY.ui.debug("Token", token)
24
- self.class.request(url, opts)
25
- end
26
-
27
- def environments
28
- @environments ||= Environment.from_array(request('/environments')["environments"], :api => self)
29
- end
30
-
31
- def apps
32
- @apps ||= App.from_array(request('/apps')["apps"], :api => self)
33
- end
34
-
35
- def resolver
36
- @resolver ||= Resolver.new(self)
37
- end
38
-
39
- def apps_for_repo(repo)
40
- repo.fail_on_no_remotes!
41
- apps.find_all {|a| repo.has_remote?(a.repository_uri) }
42
- end
43
-
44
- class InvalidCredentials < EY::AppCloudClient::Error; end
45
- class RequestFailed < EY::AppCloudClient::Error; end
46
-
47
- def self.request(path, opts={})
48
- require 'rest_client'
49
- require 'json'
50
-
51
- url = EY.config.endpoint + "api/v2#{path}"
52
- method = (opts.delete(:method) || 'get').to_s.downcase.to_sym
53
- params = opts.delete(:params) || {}
54
- headers = opts.delete(:headers) || {}
55
- headers["Accept"] ||= "application/json"
56
- headers["User-Agent"] = USER_AGENT_STRING
57
-
58
- begin
59
- EY.ui.debug("Request", "#{method.to_s.upcase} #{url}")
60
- case method
61
- when :get, :delete, :head
62
- url.query = RestClient::Payload::UrlEncoded.new(params).to_s
63
- resp = RestClient.send(method, url.to_s, headers)
64
- else
65
- resp = RestClient.send(method, url.to_s, params, headers)
66
- end
67
- rescue RestClient::Unauthorized
68
- raise InvalidCredentials
69
- rescue Errno::ECONNREFUSED
70
- raise RequestFailed, "Could not reach the cloud API"
71
- rescue RestClient::ResourceNotFound
72
- raise RequestFailed, "The requested resource could not be found"
73
- rescue RestClient::BadGateway
74
- raise RequestFailed, "AppCloud API is temporarily unavailable. Please try again soon."
75
- rescue RestClient::RequestFailed => e
76
- raise RequestFailed, "#{e.message} #{e.response}"
77
- rescue OpenSSL::SSL::SSLError
78
- raise RequestFailed, "SSL is misconfigured on your cloud"
79
- end
80
-
81
- if resp.body.empty?
82
- data = ''
83
- elsif resp.headers[:content_type] =~ /application\/json/
84
- begin
85
- data = JSON.parse(resp.body)
86
- EY.ui.debug("Response", data)
87
- rescue JSON::ParserError
88
- EY.ui.debug("Raw response", resp.body)
89
- raise RequestFailed, "Response was not valid JSON."
90
- end
91
- else
92
- data = resp.body
93
- end
94
-
95
- data
96
- end
97
-
98
- def self.fetch_token(email, password)
99
- api_token = request("/authenticate", :method => "post",
100
- :params => { :email => email, :password => password })["api_token"]
101
- save_token(api_token)
102
- api_token
103
- end
104
-
105
- def self.read_token(file = nil)
106
- file ||= ENV['EYRC'] || File.expand_path("~/.eyrc")
107
- return false unless File.exists?(file)
108
-
109
- require 'yaml'
110
-
111
- data = YAML.load_file(file)
112
- if EY.config.default_endpoint?
113
- data["api_token"]
114
- else
115
- (data[EY.config.endpoint.to_s] || {})["api_token"]
116
- end
117
- end
118
-
119
- def self.save_token(token, file = nil)
120
- file ||= ENV['EYRC'] || File.expand_path("~/.eyrc")
121
- require 'yaml'
122
-
123
- data = File.exists?(file) ? YAML.load_file(file) : {}
124
- if EY.config.default_endpoint?
125
- data.merge!("api_token" => token)
126
- else
127
- data.merge!(EY.config.endpoint.to_s => {"api_token" => token})
128
- end
129
-
130
- File.open(file, "w"){|f| YAML.dump(data, f) }
131
- true
132
- end
133
-
134
- end # API
135
- end # EY