engineyard 0.2.9 → 0.2.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. data/lib/engineyard.rb +1 -17
  2. data/lib/engineyard/account.rb +13 -49
  3. data/lib/engineyard/account/app.rb +18 -0
  4. data/lib/engineyard/account/app_master.rb +12 -0
  5. data/lib/engineyard/account/environment.rb +31 -0
  6. data/lib/engineyard/account/log.rb +18 -0
  7. data/lib/engineyard/api.rb +4 -2
  8. data/lib/engineyard/cli.rb +34 -11
  9. data/lib/engineyard/cli/ui.rb +1 -1
  10. data/spec/engineyard/api_spec.rb +6 -6
  11. data/spec/engineyard/cli/api_spec.rb +1 -1
  12. data/spec/engineyard/config_spec.rb +9 -9
  13. data/spec/ey/deploy_spec.rb +40 -21
  14. data/spec/ey/logs_spec.rb +28 -0
  15. data/spec/spec_helper.rb +12 -13
  16. data/spec/support/fake_awsm.ru +251 -0
  17. data/spec/support/helpers.rb +50 -38
  18. data/spec/support/ruby_ext.rb +29 -0
  19. metadata +52 -102
  20. data/lib/vendor/thor.rb +0 -244
  21. data/lib/vendor/thor/actions.rb +0 -275
  22. data/lib/vendor/thor/actions/create_file.rb +0 -103
  23. data/lib/vendor/thor/actions/directory.rb +0 -91
  24. data/lib/vendor/thor/actions/empty_directory.rb +0 -134
  25. data/lib/vendor/thor/actions/file_manipulation.rb +0 -223
  26. data/lib/vendor/thor/actions/inject_into_file.rb +0 -104
  27. data/lib/vendor/thor/base.rb +0 -540
  28. data/lib/vendor/thor/core_ext/file_binary_read.rb +0 -9
  29. data/lib/vendor/thor/core_ext/hash_with_indifferent_access.rb +0 -75
  30. data/lib/vendor/thor/core_ext/ordered_hash.rb +0 -100
  31. data/lib/vendor/thor/error.rb +0 -30
  32. data/lib/vendor/thor/group.rb +0 -271
  33. data/lib/vendor/thor/invocation.rb +0 -180
  34. data/lib/vendor/thor/parser.rb +0 -4
  35. data/lib/vendor/thor/parser/argument.rb +0 -67
  36. data/lib/vendor/thor/parser/arguments.rb +0 -150
  37. data/lib/vendor/thor/parser/option.rb +0 -128
  38. data/lib/vendor/thor/parser/options.rb +0 -169
  39. data/lib/vendor/thor/rake_compat.rb +0 -66
  40. data/lib/vendor/thor/runner.rb +0 -314
  41. data/lib/vendor/thor/shell.rb +0 -83
  42. data/lib/vendor/thor/shell/basic.rb +0 -239
  43. data/lib/vendor/thor/shell/color.rb +0 -108
  44. data/lib/vendor/thor/task.rb +0 -102
  45. data/lib/vendor/thor/util.rb +0 -230
  46. data/lib/vendor/thor/version.rb +0 -3
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: engineyard
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 3
4
5
  prerelease: false
5
6
  segments:
6
7
  - 0
7
8
  - 2
8
- - 9
9
- version: 0.2.9
9
+ - 10
10
+ version: 0.2.10
10
11
  platform: ruby
11
12
  authors:
12
13
  - EY Cloud Team
@@ -14,130 +15,80 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2010-04-19 00:00:00 -07:00
18
+ date: 2010-04-28 00:00:00 -07:00
18
19
  default_executable: ey
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
21
22
  version_requirements: &id001 !ruby/object:Gem::Requirement
23
+ none: false
22
24
  requirements:
23
25
  - - ">="
24
26
  - !ruby/object:Gem::Version
27
+ hash: 3
25
28
  segments:
26
29
  - 0
27
30
  version: "0"
28
- name: fakeweb
29
- prerelease: false
31
+ name: termios
30
32
  requirement: *id001
31
- type: :development
33
+ prerelease: false
34
+ type: :runtime
32
35
  - !ruby/object:Gem::Dependency
33
36
  version_requirements: &id002 !ruby/object:Gem::Requirement
37
+ none: false
34
38
  requirements:
35
39
  - - ">="
36
40
  - !ruby/object:Gem::Version
41
+ hash: 3
37
42
  segments:
38
43
  - 0
39
44
  version: "0"
40
- name: termios
41
- prerelease: false
45
+ name: highline
42
46
  requirement: *id002
47
+ prerelease: false
43
48
  type: :runtime
44
49
  - !ruby/object:Gem::Dependency
45
50
  version_requirements: &id003 !ruby/object:Gem::Requirement
51
+ none: false
46
52
  requirements:
47
53
  - - ">="
48
54
  - !ruby/object:Gem::Version
55
+ hash: 3
49
56
  segments:
50
57
  - 0
51
58
  version: "0"
52
- name: fakefs
53
- prerelease: false
59
+ name: thor
54
60
  requirement: *id003
55
- type: :development
61
+ prerelease: false
62
+ type: :runtime
56
63
  - !ruby/object:Gem::Dependency
57
64
  version_requirements: &id004 !ruby/object:Gem::Requirement
65
+ none: false
58
66
  requirements:
59
67
  - - ">="
60
68
  - !ruby/object:Gem::Version
69
+ hash: 3
61
70
  segments:
62
71
  - 0
63
72
  version: "0"
64
- name: highline
65
- prerelease: false
73
+ name: json
66
74
  requirement: *id004
75
+ prerelease: false
67
76
  type: :runtime
68
77
  - !ruby/object:Gem::Dependency
69
78
  version_requirements: &id005 !ruby/object:Gem::Requirement
70
- requirements:
71
- - - ">="
72
- - !ruby/object:Gem::Version
73
- segments:
74
- - 0
75
- version: "0"
76
- name: rake
77
- prerelease: false
78
- requirement: *id005
79
- type: :development
80
- - !ruby/object:Gem::Dependency
81
- version_requirements: &id006 !ruby/object:Gem::Requirement
82
- requirements:
83
- - - ">="
84
- - !ruby/object:Gem::Version
85
- segments:
86
- - 0
87
- version: "0"
88
- name: rspec
89
- prerelease: false
90
- requirement: *id006
91
- type: :development
92
- - !ruby/object:Gem::Dependency
93
- version_requirements: &id007 !ruby/object:Gem::Requirement
79
+ none: false
94
80
  requirements:
95
81
  - - ~>
96
82
  - !ruby/object:Gem::Version
83
+ hash: 7
97
84
  segments:
98
85
  - 1
99
86
  - 4
100
87
  version: "1.4"
101
88
  name: rest-client
89
+ requirement: *id005
102
90
  prerelease: false
103
- requirement: *id007
104
- type: :runtime
105
- - !ruby/object:Gem::Dependency
106
- version_requirements: &id008 !ruby/object:Gem::Requirement
107
- requirements:
108
- - - ">="
109
- - !ruby/object:Gem::Version
110
- segments:
111
- - 0
112
- version: "0"
113
- name: json
114
- prerelease: false
115
- requirement: *id008
116
91
  type: :runtime
117
- - !ruby/object:Gem::Dependency
118
- version_requirements: &id009 !ruby/object:Gem::Requirement
119
- requirements:
120
- - - ">="
121
- - !ruby/object:Gem::Version
122
- segments:
123
- - 0
124
- version: "0"
125
- name: jeweler
126
- prerelease: false
127
- requirement: *id009
128
- type: :development
129
- - !ruby/object:Gem::Dependency
130
- version_requirements: &id010 !ruby/object:Gem::Requirement
131
- requirements:
132
- - - ">="
133
- - !ruby/object:Gem::Version
134
- segments:
135
- - 0
136
- version: "0"
137
- name: bundler
138
- prerelease: false
139
- requirement: *id010
140
- type: :development
141
92
  description: This gem allows you to deploy your rails application to the Engine Yard cloud directly from the command line.
142
93
  email: cloud@engineyard.com
143
94
  executables:
@@ -148,6 +99,10 @@ extra_rdoc_files: []
148
99
 
149
100
  files:
150
101
  - bin/ey
102
+ - lib/engineyard/account/app.rb
103
+ - lib/engineyard/account/app_master.rb
104
+ - lib/engineyard/account/environment.rb
105
+ - lib/engineyard/account/log.rb
151
106
  - lib/engineyard/account.rb
152
107
  - lib/engineyard/api.rb
153
108
  - lib/engineyard/cli/api.rb
@@ -157,35 +112,23 @@ files:
157
112
  - lib/engineyard/config.rb
158
113
  - lib/engineyard/repo.rb
159
114
  - lib/engineyard.rb
160
- - lib/vendor/thor/actions/create_file.rb
161
- - lib/vendor/thor/actions/directory.rb
162
- - lib/vendor/thor/actions/empty_directory.rb
163
- - lib/vendor/thor/actions/file_manipulation.rb
164
- - lib/vendor/thor/actions/inject_into_file.rb
165
- - lib/vendor/thor/actions.rb
166
- - lib/vendor/thor/base.rb
167
- - lib/vendor/thor/core_ext/file_binary_read.rb
168
- - lib/vendor/thor/core_ext/hash_with_indifferent_access.rb
169
- - lib/vendor/thor/core_ext/ordered_hash.rb
170
- - lib/vendor/thor/error.rb
171
- - lib/vendor/thor/group.rb
172
- - lib/vendor/thor/invocation.rb
173
- - lib/vendor/thor/parser/argument.rb
174
- - lib/vendor/thor/parser/arguments.rb
175
- - lib/vendor/thor/parser/option.rb
176
- - lib/vendor/thor/parser/options.rb
177
- - lib/vendor/thor/parser.rb
178
- - lib/vendor/thor/rake_compat.rb
179
- - lib/vendor/thor/runner.rb
180
- - lib/vendor/thor/shell/basic.rb
181
- - lib/vendor/thor/shell/color.rb
182
- - lib/vendor/thor/shell.rb
183
- - lib/vendor/thor/task.rb
184
- - lib/vendor/thor/util.rb
185
- - lib/vendor/thor/version.rb
186
- - lib/vendor/thor.rb
187
115
  - LICENSE
188
116
  - README.rdoc
117
+ - spec/engineyard/api_spec.rb
118
+ - spec/engineyard/cli/api_spec.rb
119
+ - spec/engineyard/cli_spec.rb
120
+ - spec/engineyard/config_spec.rb
121
+ - spec/engineyard/repo_spec.rb
122
+ - spec/engineyard_spec.rb
123
+ - spec/ey/deploy_spec.rb
124
+ - spec/ey/ey_spec.rb
125
+ - spec/ey/logs_spec.rb
126
+ - spec/spec.opts
127
+ - spec/spec_helper.rb
128
+ - spec/support/bundled_ey
129
+ - spec/support/fake_awsm.ru
130
+ - spec/support/helpers.rb
131
+ - spec/support/ruby_ext.rb
189
132
  has_rdoc: true
190
133
  homepage: http://engineyard.com
191
134
  licenses: []
@@ -196,23 +139,27 @@ rdoc_options: []
196
139
  require_paths:
197
140
  - lib
198
141
  required_ruby_version: !ruby/object:Gem::Requirement
142
+ none: false
199
143
  requirements:
200
144
  - - ">="
201
145
  - !ruby/object:Gem::Version
146
+ hash: 3
202
147
  segments:
203
148
  - 0
204
149
  version: "0"
205
150
  required_rubygems_version: !ruby/object:Gem::Requirement
151
+ none: false
206
152
  requirements:
207
153
  - - ">="
208
154
  - !ruby/object:Gem::Version
155
+ hash: 3
209
156
  segments:
210
157
  - 0
211
158
  version: "0"
212
159
  requirements: []
213
160
 
214
161
  rubyforge_project:
215
- rubygems_version: 1.3.6
162
+ rubygems_version: 1.3.7.pre.1
216
163
  signing_key:
217
164
  specification_version: 3
218
165
  summary: Command-line deployment for the Engine Yard cloud
@@ -225,7 +172,10 @@ test_files:
225
172
  - spec/engineyard_spec.rb
226
173
  - spec/ey/deploy_spec.rb
227
174
  - spec/ey/ey_spec.rb
175
+ - spec/ey/logs_spec.rb
228
176
  - spec/spec.opts
229
177
  - spec/spec_helper.rb
230
178
  - spec/support/bundled_ey
179
+ - spec/support/fake_awsm.ru
231
180
  - spec/support/helpers.rb
181
+ - spec/support/ruby_ext.rb
data/lib/vendor/thor.rb DELETED
@@ -1,244 +0,0 @@
1
- require 'thor/base'
2
-
3
- # TODO: Update thor to allow for git-style CLI (git bisect run)
4
- class Thor
5
- class << self
6
- # Sets the default task when thor is executed without an explicit task to be called.
7
- #
8
- # ==== Parameters
9
- # meth<Symbol>:: name of the defaut task
10
- #
11
- def default_task(meth=nil)
12
- case meth
13
- when :none
14
- @default_task = 'help'
15
- when nil
16
- @default_task ||= from_superclass(:default_task, 'help')
17
- else
18
- @default_task = meth.to_s
19
- end
20
- end
21
-
22
- # Defines the usage and the description of the next task.
23
- #
24
- # ==== Parameters
25
- # usage<String>
26
- # description<String>
27
- #
28
- def desc(usage, description, options={})
29
- if options[:for]
30
- task = find_and_refresh_task(options[:for])
31
- task.usage = usage if usage
32
- task.description = description if description
33
- else
34
- @usage, @desc = usage, description
35
- end
36
- end
37
-
38
- # Maps an input to a task. If you define:
39
- #
40
- # map "-T" => "list"
41
- #
42
- # Running:
43
- #
44
- # thor -T
45
- #
46
- # Will invoke the list task.
47
- #
48
- # ==== Parameters
49
- # Hash[String|Array => Symbol]:: Maps the string or the strings in the array to the given task.
50
- #
51
- def map(mappings=nil)
52
- @map ||= from_superclass(:map, {})
53
-
54
- if mappings
55
- mappings.each do |key, value|
56
- if key.respond_to?(:each)
57
- key.each {|subkey| @map[subkey] = value}
58
- else
59
- @map[key] = value
60
- end
61
- end
62
- end
63
-
64
- @map
65
- end
66
-
67
- # Declares the options for the next task to be declared.
68
- #
69
- # ==== Parameters
70
- # Hash[Symbol => Object]:: The hash key is the name of the option and the value
71
- # is the type of the option. Can be :string, :array, :hash, :boolean, :numeric
72
- # or :required (string). If you give a value, the type of the value is used.
73
- #
74
- def method_options(options=nil)
75
- @method_options ||= {}
76
- build_options(options, @method_options) if options
77
- @method_options
78
- end
79
-
80
- # Adds an option to the set of method options. If :for is given as option,
81
- # it allows you to change the options from a previous defined task.
82
- #
83
- # def previous_task
84
- # # magic
85
- # end
86
- #
87
- # method_option :foo => :bar, :for => :previous_task
88
- #
89
- # def next_task
90
- # # magic
91
- # end
92
- #
93
- # ==== Parameters
94
- # name<Symbol>:: The name of the argument.
95
- # options<Hash>:: Described below.
96
- #
97
- # ==== Options
98
- # :desc - Description for the argument.
99
- # :required - If the argument is required or not.
100
- # :default - Default value for this argument. It cannot be required and have default values.
101
- # :aliases - Aliases for this option.
102
- # :type - The type of the argument, can be :string, :hash, :array, :numeric or :boolean.
103
- # :banner - String to show on usage notes.
104
- #
105
- def method_option(name, options={})
106
- scope = if options[:for]
107
- find_and_refresh_task(options[:for]).options
108
- else
109
- method_options
110
- end
111
-
112
- build_option(name, options, scope)
113
- end
114
-
115
- # Parses the task and options from the given args, instantiate the class
116
- # and invoke the task. This method is used when the arguments must be parsed
117
- # from an array. If you are inside Ruby and want to use a Thor class, you
118
- # can simply initialize it:
119
- #
120
- # script = MyScript.new(args, options, config)
121
- # script.invoke(:task, first_arg, second_arg, third_arg)
122
- #
123
- def start(original_args=ARGV, config={})
124
- super do |given_args|
125
- meth = normalize_task_name(given_args.shift)
126
- task = all_tasks[meth]
127
-
128
- if task
129
- args, opts = Thor::Options.split(given_args)
130
- config.merge!(:task_options => task.options)
131
- else
132
- args, opts = given_args, {}
133
- end
134
-
135
- task ||= Thor::Task::Dynamic.new(meth)
136
- trailing = args[Range.new(arguments.size, -1)]
137
- new(args, opts, config).invoke(task, trailing || [])
138
- end
139
- end
140
-
141
- # Prints help information for the given task.
142
- #
143
- # ==== Parameters
144
- # shell<Thor::Shell>
145
- # task_name<String>
146
- #
147
- def task_help(shell, task_name)
148
- meth = normalize_task_name(task_name)
149
- task = all_tasks[meth]
150
- handle_no_task_error(meth) unless task
151
-
152
- shell.say "Usage:"
153
- shell.say " #{banner(task)}"
154
- shell.say
155
- class_options_help(shell, nil => task.options.map { |_, o| o })
156
- shell.say task.description
157
- end
158
-
159
- # Prints help information for this class.
160
- #
161
- # ==== Parameters
162
- # shell<Thor::Shell>
163
- #
164
- def help(shell)
165
- list = printable_tasks
166
- Thor::Util.thor_classes_in(self).each do |klass|
167
- list += klass.printable_tasks(false)
168
- end
169
- list.sort!{ |a,b| a[0] <=> b[0] }
170
-
171
- shell.say "Tasks:"
172
- shell.print_table(list, :ident => 2, :truncate => true)
173
- shell.say
174
- class_options_help(shell)
175
- end
176
-
177
- # Returns tasks ready to be printed.
178
- def printable_tasks(all=true)
179
- (all ? all_tasks : tasks).map do |_, task|
180
- item = []
181
- item << banner(task)
182
- item << (task.description ? "# #{task.description.gsub(/\s+/m,' ')}" : "")
183
- item
184
- end
185
- end
186
-
187
- def handle_argument_error(task, error) #:nodoc:
188
- raise InvocationError, "#{task.name.inspect} was called incorrectly. Call as #{task.formatted_usage(self, banner_base == "thor").inspect}."
189
- end
190
-
191
- protected
192
-
193
- # The banner for this class. You can customize it if you are invoking the
194
- # thor class by another ways which is not the Thor::Runner. It receives
195
- # the task that is going to be invoked and a boolean which indicates if
196
- # the namespace should be displayed as arguments.
197
- #
198
- def banner(task)
199
- "#{banner_base} #{task.formatted_usage(self, banner_base == "thor")}"
200
- end
201
-
202
- def baseclass #:nodoc:
203
- Thor
204
- end
205
-
206
- def create_task(meth) #:nodoc:
207
- if @usage && @desc
208
- tasks[meth.to_s] = Thor::Task.new(meth, @desc, @usage, method_options)
209
- @usage, @desc, @method_options = nil
210
- true
211
- elsif self.all_tasks[meth.to_s] || meth.to_sym == :method_missing
212
- true
213
- else
214
- puts "[WARNING] Attempted to create task #{meth.inspect} without usage or description. " <<
215
- "Call desc if you want this method to be available as task or declare it inside a " <<
216
- "no_tasks{} block. Invoked from #{caller[1].inspect}."
217
- false
218
- end
219
- end
220
-
221
- def initialize_added #:nodoc:
222
- class_options.merge!(method_options)
223
- @method_options = nil
224
- end
225
-
226
- # Receives a task name (can be nil), and try to get a map from it.
227
- # If a map can't be found use the sent name or the default task.
228
- #
229
- def normalize_task_name(meth) #:nodoc:
230
- mapping = map[meth.to_s]
231
- meth = mapping || meth || default_task
232
- meth.to_s.gsub('-','_') # treat foo-bar > foo_bar
233
- end
234
- end
235
-
236
- include Thor::Base
237
-
238
- map HELP_MAPPINGS => :help
239
-
240
- desc "help [TASK]", "Describe available tasks or one specific task"
241
- def help(task=nil)
242
- task ? self.class.task_help(shell, task) : self.class.help(shell)
243
- end
244
- end