ey_cli 0.1.2 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ey_cli (0.1.2)
4
+ ey_cli (0.2.0)
5
5
  faraday
6
6
  faraday-stack
7
7
  faraday_middleware
@@ -21,7 +21,7 @@ GEM
21
21
  faraday (0.7.4)
22
22
  addressable (~> 2.2.6)
23
23
  multipart-post (~> 1.1.0)
24
- rack (< 2, >= 1.1.0)
24
+ rack (>= 1.1.0, < 2)
25
25
  faraday-stack (0.1.3)
26
26
  faraday (~> 0.6)
27
27
  faraday_middleware (0.7.0)
@@ -31,7 +31,7 @@ GEM
31
31
  json (1.6.1)
32
32
  multi_json (1.0.3)
33
33
  multipart-post (1.1.3)
34
- rack (1.3.4)
34
+ rack (1.3.5)
35
35
  rake (0.9.2)
36
36
  rspec (2.6.0)
37
37
  rspec-core (~> 2.6.0)
@@ -13,8 +13,8 @@ Gem::Specification.new do |s|
13
13
  ## If your rubyforge_project name is different, then edit it and comment out
14
14
  ## the sub! line in the Rakefile
15
15
  s.name = 'ey_cli'
16
- s.version = '0.1.2'
17
- s.date = '2011-10-17'
16
+ s.version = '0.2.0'
17
+ s.date = '2011-11-18'
18
18
  s.rubyforge_project = 'ey_cli'
19
19
 
20
20
  ## Make sure your summary is short. The description may be as long
data/history.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.2.0 (11-18-2011)
2
+
3
+ - Allow to deploy Node.js applications
4
+
1
5
  ## 0.1.2 (10-17-2011)
2
6
 
3
7
  - Fix git uri label.
@@ -1,5 +1,5 @@
1
1
  module EYCli
2
- VERSION = '0.1.2'
2
+ VERSION = '0.2.0'
3
3
 
4
4
  require 'hashie/mash'
5
5
  require 'json'
@@ -68,6 +68,14 @@ module EYCli
68
68
  http_body = params.delete(:body)
69
69
  @auth_token ||= read_token || fetch_token if auth
70
70
 
71
+ if ENV['EY_DEBUG']
72
+ puts %Q{-- DEBUG --
73
+ PATH : #{path}
74
+ PARAMS : #{params.inspect}
75
+ HEADERS : #{headers.inspect}
76
+ }
77
+ end
78
+
71
79
  connection.send(http_method) do |req|
72
80
  req.path = path
73
81
  req.params.merge! params
@@ -76,7 +76,7 @@ EOF
76
76
  end
77
77
 
78
78
  def fill_create_env_options(options)
79
- opts = {:name => options[:name], :framework_env => options[:framework_env]}
79
+ opts = {:name => (options[:env_name] || options[:name]), :framework_env => options[:framework_env]}
80
80
  if options[:stack]
81
81
  case options[:stack].to_sym
82
82
  when :passenger then options[:stack] = 'nginx_passenger3'
@@ -24,15 +24,20 @@ module EYCli
24
24
  end
25
25
 
26
26
  def fetch_type(base)
27
- if File.exist?(File.join(base, 'config.ru')) && File.exist?(File.join(base, 'config', 'environment.rb'))
27
+ type = if File.exist?(File.join(base, 'config.ru')) && File.exist?(File.join(base, 'config', 'environment.rb'))
28
28
  :rails3
29
29
  elsif File.exist?(File.join(base, 'config', 'environment.rb'))
30
30
  :rails2
31
31
  elsif File.exist?(File.join(base, 'config.ru'))
32
32
  :rack
33
+ elsif File.exist?(File.join(base, 'package.json'))
34
+ :nodejs
33
35
  else # Raise unkown application type?
34
36
  :rails3
35
37
  end
38
+
39
+ EYCli.term.say "~> Registering #{type} application"
40
+ type
36
41
  end
37
42
 
38
43
  def fetch_app(account = nil, options = {}, base = Dir.pwd)
@@ -24,19 +24,7 @@ module EYCli
24
24
  end
25
25
 
26
26
  def deploy(app, options = {})
27
- if !app.environments? || app.environments.empty?
28
- EYCli.term.error <<-EOF
29
- You don't have any environment associated to this application.
30
- Try running `ey_cli create_env' to create your first environment.
31
- EOF
32
- elsif app.environments.size == 1
33
- env = app.environments.first
34
- else
35
- name = EYCli.term.choose_resource(app.environments,
36
- "I don't know which environment deploy on.",
37
- "Please, select and environment")
38
- env = EYCli::Model::Environment.find_by_name(name, app.environments)
39
- end
27
+ env = fetch_environment(app, options)
40
28
 
41
29
  if env
42
30
  deploy = env.deploy(app, options)
@@ -73,6 +61,22 @@ EOF
73
61
  custom['environment[ruby_version]'] = options[:ruby_version] if options[:ruby_version]
74
62
  custom
75
63
  end
64
+
65
+ def fetch_environment(app, options = {})
66
+ if !app.environments? || app.environments.empty?
67
+ EYCli.term.error <<-EOF
68
+ You don't have any environment associated to this application.
69
+ Try running `ey_cli create_env' to create your first environment.
70
+ EOF
71
+ elsif app.environments.size == 1
72
+ app.environments.first
73
+ else
74
+ name = EYCli.term.choose_resource(app.environments,
75
+ "I don't know which environment deploy on.",
76
+ "Please, select and environment")
77
+ EYCli::Model::Environment.find_by_name(name, app.environments)
78
+ end
79
+ end
76
80
  end
77
81
  end
78
82
  end
metadata CHANGED
@@ -1,201 +1,157 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: ey_cli
3
- version: !ruby/object:Gem::Version
4
- hash: 31
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 1
9
- - 2
10
- version: 0.1.2
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - David Calavera
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-10-17 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
21
- version_requirements: &id001 !ruby/object:Gem::Requirement
22
- none: false
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- hash: 3
27
- segments:
28
- - 0
29
- version: "0"
12
+ date: 2011-11-18 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
30
15
  name: faraday
16
+ requirement: &2157796660 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
31
22
  type: :runtime
32
23
  prerelease: false
33
- requirement: *id001
34
- - !ruby/object:Gem::Dependency
35
- version_requirements: &id002 !ruby/object:Gem::Requirement
36
- none: false
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- hash: 3
41
- segments:
42
- - 0
43
- version: "0"
24
+ version_requirements: *2157796660
25
+ - !ruby/object:Gem::Dependency
44
26
  name: faraday_middleware
27
+ requirement: &2157796080 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
45
33
  type: :runtime
46
34
  prerelease: false
47
- requirement: *id002
48
- - !ruby/object:Gem::Dependency
49
- version_requirements: &id003 !ruby/object:Gem::Requirement
50
- none: false
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- hash: 3
55
- segments:
56
- - 0
57
- version: "0"
35
+ version_requirements: *2157796080
36
+ - !ruby/object:Gem::Dependency
58
37
  name: faraday-stack
38
+ requirement: &2157795540 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
59
44
  type: :runtime
60
45
  prerelease: false
61
- requirement: *id003
62
- - !ruby/object:Gem::Dependency
63
- version_requirements: &id004 !ruby/object:Gem::Requirement
64
- none: false
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- hash: 3
69
- segments:
70
- - 0
71
- version: "0"
46
+ version_requirements: *2157795540
47
+ - !ruby/object:Gem::Dependency
72
48
  name: highline
49
+ requirement: &2157794940 !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
73
55
  type: :runtime
74
56
  prerelease: false
75
- requirement: *id004
76
- - !ruby/object:Gem::Dependency
77
- version_requirements: &id005 !ruby/object:Gem::Requirement
78
- none: false
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- hash: 3
83
- segments:
84
- - 0
85
- version: "0"
57
+ version_requirements: *2157794940
58
+ - !ruby/object:Gem::Dependency
86
59
  name: hashie
60
+ requirement: &2157794220 !ruby/object:Gem::Requirement
61
+ none: false
62
+ requirements:
63
+ - - ! '>='
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
87
66
  type: :runtime
88
67
  prerelease: false
89
- requirement: *id005
90
- - !ruby/object:Gem::Dependency
91
- version_requirements: &id006 !ruby/object:Gem::Requirement
92
- none: false
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- hash: 3
97
- segments:
98
- - 0
99
- version: "0"
68
+ version_requirements: *2157794220
69
+ - !ruby/object:Gem::Dependency
100
70
  name: json
71
+ requirement: &2157793500 !ruby/object:Gem::Requirement
72
+ none: false
73
+ requirements:
74
+ - - ! '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
101
77
  type: :runtime
102
78
  prerelease: false
103
- requirement: *id006
104
- - !ruby/object:Gem::Dependency
105
- version_requirements: &id007 !ruby/object:Gem::Requirement
106
- none: false
107
- requirements:
108
- - - ">="
109
- - !ruby/object:Gem::Version
110
- hash: 3
111
- segments:
112
- - 0
113
- version: "0"
79
+ version_requirements: *2157793500
80
+ - !ruby/object:Gem::Dependency
114
81
  name: multi_json
82
+ requirement: &2157793040 !ruby/object:Gem::Requirement
83
+ none: false
84
+ requirements:
85
+ - - ! '>='
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
115
88
  type: :runtime
116
89
  prerelease: false
117
- requirement: *id007
118
- - !ruby/object:Gem::Dependency
119
- version_requirements: &id008 !ruby/object:Gem::Requirement
120
- none: false
121
- requirements:
122
- - - ">="
123
- - !ruby/object:Gem::Version
124
- hash: 3
125
- segments:
126
- - 0
127
- version: "0"
90
+ version_requirements: *2157793040
91
+ - !ruby/object:Gem::Dependency
128
92
  name: slop
93
+ requirement: &2157792580 !ruby/object:Gem::Requirement
94
+ none: false
95
+ requirements:
96
+ - - ! '>='
97
+ - !ruby/object:Gem::Version
98
+ version: '0'
129
99
  type: :runtime
130
100
  prerelease: false
131
- requirement: *id008
132
- - !ruby/object:Gem::Dependency
133
- version_requirements: &id009 !ruby/object:Gem::Requirement
101
+ version_requirements: *2157792580
102
+ - !ruby/object:Gem::Dependency
103
+ name: rake
104
+ requirement: &2157791700 !ruby/object:Gem::Requirement
134
105
  none: false
135
- requirements:
106
+ requirements:
136
107
  - - ~>
137
- - !ruby/object:Gem::Version
138
- hash: 25
139
- segments:
140
- - 0
141
- - 9
142
- version: "0.9"
143
- name: rake
108
+ - !ruby/object:Gem::Version
109
+ version: '0.9'
144
110
  type: :development
145
111
  prerelease: false
146
- requirement: *id009
147
- - !ruby/object:Gem::Dependency
148
- version_requirements: &id010 !ruby/object:Gem::Requirement
149
- none: false
150
- requirements:
151
- - - ">="
152
- - !ruby/object:Gem::Version
153
- hash: 3
154
- segments:
155
- - 0
156
- version: "0"
112
+ version_requirements: *2157791700
113
+ - !ruby/object:Gem::Dependency
157
114
  name: rspec
115
+ requirement: &2157790760 !ruby/object:Gem::Requirement
116
+ none: false
117
+ requirements:
118
+ - - ! '>='
119
+ - !ruby/object:Gem::Version
120
+ version: '0'
158
121
  type: :development
159
122
  prerelease: false
160
- requirement: *id010
161
- - !ruby/object:Gem::Dependency
162
- version_requirements: &id011 !ruby/object:Gem::Requirement
163
- none: false
164
- requirements:
165
- - - ">="
166
- - !ruby/object:Gem::Version
167
- hash: 3
168
- segments:
169
- - 0
170
- version: "0"
123
+ version_requirements: *2157790760
124
+ - !ruby/object:Gem::Dependency
171
125
  name: webmock
126
+ requirement: &2157789700 !ruby/object:Gem::Requirement
127
+ none: false
128
+ requirements:
129
+ - - ! '>='
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
172
132
  type: :development
173
133
  prerelease: false
174
- requirement: *id011
175
- - !ruby/object:Gem::Dependency
176
- version_requirements: &id012 !ruby/object:Gem::Requirement
177
- none: false
178
- requirements:
179
- - - ">="
180
- - !ruby/object:Gem::Version
181
- hash: 3
182
- segments:
183
- - 0
184
- version: "0"
134
+ version_requirements: *2157789700
135
+ - !ruby/object:Gem::Dependency
185
136
  name: fakefs
137
+ requirement: &2157789200 !ruby/object:Gem::Requirement
138
+ none: false
139
+ requirements:
140
+ - - ! '>='
141
+ - !ruby/object:Gem::Version
142
+ version: '0'
186
143
  type: :development
187
144
  prerelease: false
188
- requirement: *id012
145
+ version_requirements: *2157789200
189
146
  description: More user friendly CLI for Engine Yard cloud. Use undocumented APIs
190
147
  email: david.calavera@gmail.com
191
- executables:
148
+ executables:
192
149
  - ey_cli
193
150
  extensions: []
194
-
195
- extra_rdoc_files:
151
+ extra_rdoc_files:
196
152
  - README.md
197
153
  - LICENSE
198
- files:
154
+ files:
199
155
  - Gemfile
200
156
  - Gemfile.lock
201
157
  - LICENSE
@@ -244,38 +200,33 @@ files:
244
200
  - spec/spec_helper.rb
245
201
  homepage: http://github.com/calavera/ey_cli
246
202
  licenses: []
247
-
248
203
  post_install_message:
249
- rdoc_options:
204
+ rdoc_options:
250
205
  - --charset=UTF-8
251
- require_paths:
206
+ require_paths:
252
207
  - lib
253
- required_ruby_version: !ruby/object:Gem::Requirement
208
+ required_ruby_version: !ruby/object:Gem::Requirement
254
209
  none: false
255
- requirements:
256
- - - ">="
257
- - !ruby/object:Gem::Version
258
- hash: 3
259
- segments:
210
+ requirements:
211
+ - - ! '>='
212
+ - !ruby/object:Gem::Version
213
+ version: '0'
214
+ segments:
260
215
  - 0
261
- version: "0"
262
- required_rubygems_version: !ruby/object:Gem::Requirement
216
+ hash: 1484874266169118057
217
+ required_rubygems_version: !ruby/object:Gem::Requirement
263
218
  none: false
264
- requirements:
265
- - - ">="
266
- - !ruby/object:Gem::Version
267
- hash: 3
268
- segments:
269
- - 0
270
- version: "0"
219
+ requirements:
220
+ - - ! '>='
221
+ - !ruby/object:Gem::Version
222
+ version: '0'
271
223
  requirements: []
272
-
273
224
  rubyforge_project: ey_cli
274
- rubygems_version: 1.8.6
225
+ rubygems_version: 1.8.10
275
226
  signing_key:
276
227
  specification_version: 2
277
228
  summary: More user friendly CLI for Engine Yard cloud
278
- test_files:
229
+ test_files:
279
230
  - spec/ey_cli/api_spec.rb
280
231
  - spec/ey_cli/command_manager_spec.rb
281
232
  - spec/ey_cli/commands/help_spec.rb