visionmedia-commander 3.2.7 → 3.2.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,10 @@
1
1
 
2
+ === 3.2.8 / 2009-04-09
3
+
4
+ * Added auto-loading support of visionmedia-growl convenience methods when the gem is available
5
+ * Changed; growl related methods are now part of visionmedia-growl
6
+ * Fixed doc typos
7
+
2
8
  === 3.2.7 / 2009-04-08
3
9
 
4
10
  * Added #notify, #notify_ok, #notify_warning, #notify_info and #notify_error
data/Manifest CHANGED
@@ -15,10 +15,6 @@ lib/commander/help_formatters/terminal_compact/command_help.erb
15
15
  lib/commander/help_formatters/terminal_compact/help.erb
16
16
  lib/commander/help_formatters/terminal_compact.rb
17
17
  lib/commander/help_formatters.rb
18
- lib/commander/images/error.png
19
- lib/commander/images/info.png
20
- lib/commander/images/ok.png
21
- lib/commander/images/warning.png
22
18
  lib/commander/runner.rb
23
19
  lib/commander/user_interaction.rb
24
20
  lib/commander/version.rb
@@ -21,7 +21,7 @@ features, and an elegant API.
21
21
  * Multi-word command name support such as 'drupal module install MOD', rather than 'drupal module_install MOD'
22
22
  * Sexy paging for long bodies of text
23
23
  * Sub-command aliasing (very powerful, as both switches and arguments can be used)
24
- * Support for MacOS Growl notifications
24
+ * Growl notification support for MacOS
25
25
  * Use the 'commander' executable to initialize a commander driven program
26
26
 
27
27
  == Example
@@ -154,7 +154,7 @@ simplify common tasks using the following methods:
154
154
  # Ask editor, supplying initial text
155
155
  ask_editor 'previous data to update'
156
156
 
157
- # Display a generic Growl notification r
157
+ # Display a generic Growl notification
158
158
  notify 'Something happened'
159
159
 
160
160
  # Display an 'info' status notification
@@ -2,17 +2,17 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{commander}
5
- s.version = "3.2.7"
5
+ s.version = "3.2.8"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["TJ Holowaychuk"]
9
- s.date = %q{2009-04-08}
9
+ s.date = %q{2009-04-09}
10
10
  s.default_executable = %q{commander}
11
11
  s.description = %q{The complete solution for Ruby command-line executables}
12
12
  s.email = %q{tj@vision-media.ca}
13
13
  s.executables = ["commander"]
14
- s.extra_rdoc_files = ["bin/commander", "lib/commander/blank.rb", "lib/commander/command.rb", "lib/commander/core_ext/array.rb", "lib/commander/core_ext/object.rb", "lib/commander/core_ext/string.rb", "lib/commander/core_ext.rb", "lib/commander/help_formatters/base.rb", "lib/commander/help_formatters/terminal/command_help.erb", "lib/commander/help_formatters/terminal/help.erb", "lib/commander/help_formatters/terminal.rb", "lib/commander/help_formatters/terminal_compact/command_help.erb", "lib/commander/help_formatters/terminal_compact/help.erb", "lib/commander/help_formatters/terminal_compact.rb", "lib/commander/help_formatters.rb", "lib/commander/images/error.png", "lib/commander/images/info.png", "lib/commander/images/ok.png", "lib/commander/images/warning.png", "lib/commander/runner.rb", "lib/commander/user_interaction.rb", "lib/commander/version.rb", "lib/commander.rb", "README.rdoc", "tasks/docs.rake", "tasks/gemspec.rake", "tasks/spec.rake"]
15
- s.files = ["bin/commander", "commander.gemspec", "History.rdoc", "lib/commander/blank.rb", "lib/commander/command.rb", "lib/commander/core_ext/array.rb", "lib/commander/core_ext/object.rb", "lib/commander/core_ext/string.rb", "lib/commander/core_ext.rb", "lib/commander/help_formatters/base.rb", "lib/commander/help_formatters/terminal/command_help.erb", "lib/commander/help_formatters/terminal/help.erb", "lib/commander/help_formatters/terminal.rb", "lib/commander/help_formatters/terminal_compact/command_help.erb", "lib/commander/help_formatters/terminal_compact/help.erb", "lib/commander/help_formatters/terminal_compact.rb", "lib/commander/help_formatters.rb", "lib/commander/images/error.png", "lib/commander/images/info.png", "lib/commander/images/ok.png", "lib/commander/images/warning.png", "lib/commander/runner.rb", "lib/commander/user_interaction.rb", "lib/commander/version.rb", "lib/commander.rb", "Manifest", "Rakefile", "README.rdoc", "spec/command_spec.rb", "spec/core_ext/array_spec.rb", "spec/core_ext/object_spec.rb", "spec/core_ext/string_spec.rb", "spec/help_formatters/base_spec.rb", "spec/help_formatters/terminal_spec.rb", "spec/runner_spec.rb", "spec/spec_helper.rb", "tasks/docs.rake", "tasks/gemspec.rake", "tasks/spec.rake"]
14
+ s.extra_rdoc_files = ["bin/commander", "lib/commander/blank.rb", "lib/commander/command.rb", "lib/commander/core_ext/array.rb", "lib/commander/core_ext/object.rb", "lib/commander/core_ext/string.rb", "lib/commander/core_ext.rb", "lib/commander/help_formatters/base.rb", "lib/commander/help_formatters/terminal/command_help.erb", "lib/commander/help_formatters/terminal/help.erb", "lib/commander/help_formatters/terminal.rb", "lib/commander/help_formatters/terminal_compact/command_help.erb", "lib/commander/help_formatters/terminal_compact/help.erb", "lib/commander/help_formatters/terminal_compact.rb", "lib/commander/help_formatters.rb", "lib/commander/runner.rb", "lib/commander/user_interaction.rb", "lib/commander/version.rb", "lib/commander.rb", "README.rdoc", "tasks/docs.rake", "tasks/gemspec.rake", "tasks/spec.rake"]
15
+ s.files = ["bin/commander", "commander.gemspec", "History.rdoc", "lib/commander/blank.rb", "lib/commander/command.rb", "lib/commander/core_ext/array.rb", "lib/commander/core_ext/object.rb", "lib/commander/core_ext/string.rb", "lib/commander/core_ext.rb", "lib/commander/help_formatters/base.rb", "lib/commander/help_formatters/terminal/command_help.erb", "lib/commander/help_formatters/terminal/help.erb", "lib/commander/help_formatters/terminal.rb", "lib/commander/help_formatters/terminal_compact/command_help.erb", "lib/commander/help_formatters/terminal_compact/help.erb", "lib/commander/help_formatters/terminal_compact.rb", "lib/commander/help_formatters.rb", "lib/commander/runner.rb", "lib/commander/user_interaction.rb", "lib/commander/version.rb", "lib/commander.rb", "Manifest", "Rakefile", "README.rdoc", "spec/command_spec.rb", "spec/core_ext/array_spec.rb", "spec/core_ext/object_spec.rb", "spec/core_ext/string_spec.rb", "spec/help_formatters/base_spec.rb", "spec/help_formatters/terminal_spec.rb", "spec/runner_spec.rb", "spec/spec_helper.rb", "tasks/docs.rake", "tasks/gemspec.rake", "tasks/spec.rake"]
16
16
  s.has_rdoc = true
17
17
  s.homepage = %q{http://visionmedia.github.com/commander}
18
18
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Commander", "--main", "README.rdoc"]
@@ -3,7 +3,7 @@ class Array
3
3
 
4
4
  ##
5
5
  # Split +string+ into an array. Used in
6
- # conjunection with Highline's ask, or ask_for_array
6
+ # conjunction with Highline's ask, or ask_for_array
7
7
  # methods, which must respond to #parse.
8
8
  #
9
9
  # === Highline example
@@ -26,4 +26,4 @@ class Array
26
26
  self.delete_if { |value| value.to_s =~ /^-/ }
27
27
  end
28
28
 
29
- end
29
+ end
@@ -118,7 +118,7 @@ module Commander
118
118
 
119
119
  ##
120
120
  # Creates and yields a command instance when a block is passed.
121
- # Otherise attempts to return the command, raising InvalidCommandError when
121
+ # Otherwise attempts to return the command, raising InvalidCommandError when
122
122
  # it does not exist.
123
123
  #
124
124
  # === Examples:
@@ -150,7 +150,7 @@ module Commander
150
150
  end
151
151
 
152
152
  ##
153
- # Alias command +name+ with +alias_name+. Optionallry +args+ may be passed
153
+ # Alias command +name+ with +alias_name+. Optionally +args+ may be passed
154
154
  # as if they were being passed straight to the original command via the command-line.
155
155
 
156
156
  def alias_command alias_name, name, *args
@@ -195,7 +195,7 @@ module Commander
195
195
  end
196
196
 
197
197
  ##
198
- # Attemps to locate a command name from within the arguments.
198
+ # Attempts to locate a command name from within the arguments.
199
199
  # Supports multi-word commands, using the largest possible match.
200
200
 
201
201
  def command_name_from_args
@@ -272,7 +272,7 @@ module Commander
272
272
 
273
273
  ##
274
274
  # Removes global options from args. This prevents an invalid
275
- # option error from ocurring when options are parsed
275
+ # option error from occurring when options are parsed
276
276
  # again for the sub-command.
277
277
 
278
278
  def remove_global_options
@@ -308,7 +308,7 @@ module Commander
308
308
 
309
309
  ##
310
310
  # Returns a proc allowing for sub-commands to inherit global options.
311
- # This functionality works weither a block is present for the global
311
+ # This functionality works whether a block is present for the global
312
312
  # option or not, so simple switches such as --verbose can be used
313
313
  # without a block, and used throughout all sub-commands.
314
314
 
@@ -331,7 +331,7 @@ module Commander
331
331
  end
332
332
 
333
333
  ##
334
- # Return switches and description seperated from the +args+ passed.
334
+ # Return switches and description separated from the +args+ passed.
335
335
 
336
336
  def self.seperate_switches_from_description *args
337
337
  switches = args.find_all { |arg| arg.to_s =~ /^-/ }
@@ -361,4 +361,4 @@ module Commander
361
361
  end
362
362
 
363
363
  end
364
- end
364
+ end
@@ -1,16 +1,28 @@
1
1
 
2
+
2
3
  module Commander
3
4
 
4
5
  ##
5
6
  # = User Interaction
6
7
  #
7
- # Commander's user interacton module mixes in common
8
+ # Commander's user interaction module mixes in common
8
9
  # methods which extend HighLine's functionality such
9
- # as a unified +password+ method rather than calling
10
- # +ask+ directly.
10
+ # as a +password+ method rather than calling +ask+ directly.
11
11
 
12
12
  module UI
13
13
 
14
+ #--
15
+ # Auto include growl when available.
16
+ #++
17
+
18
+ begin
19
+ require 'growl'
20
+ rescue LoadError
21
+ # Do nothing
22
+ else
23
+ include Growl
24
+ end
25
+
14
26
  ##
15
27
  # Ask the user for a password. Specify a custom
16
28
  # +message+ other than 'Password: ' or override the
@@ -79,32 +91,6 @@ module Commander
79
91
  end
80
92
  end
81
93
 
82
- ##
83
- # Send a Growl notification +message+. This method
84
- # requires that visionmedia-growl is installed and in the
85
- # loadpath stack.
86
- #
87
- # === Examples
88
- #
89
- # notify 'You have a new email', :title => 'Email'
90
- # notify_ok 'Gems updated'
91
- # notify_warning "Gem #{name} failed to install"
92
- # notify_error 'Failed to update gems'
93
- #
94
-
95
- def notify message, options = {}
96
- require 'growl'
97
- Growl({ :message => message.to_s, :title => program(:name) }.merge(options))
98
- end
99
-
100
- %w( ok info warning error ).each do |type|
101
- define_method :"notify_#{type}" do |message, *args|
102
- options = args.first || {}
103
- image = File.join File.expand_path(File.dirname(__FILE__)), 'images', "#{type}.png"
104
- notify message, options.merge(:image => image)
105
- end
106
- end
107
-
108
94
  ##
109
95
  # Implements ask_for_CLASS methods.
110
96
 
@@ -258,14 +244,14 @@ module Commander
258
244
  end
259
245
 
260
246
  ##
261
- # Weither or not the operation is complete, and we have finished.
247
+ # Whether or not the operation is complete, and we have finished.
262
248
 
263
249
  def finished?
264
250
  @step == @total_steps + 1
265
251
  end
266
252
 
267
253
  ##
268
- # Weither or not the operation has completed.
254
+ # Whether or not the operation has completed.
269
255
 
270
256
  def completed?
271
257
  @step == @total_steps
@@ -311,4 +297,4 @@ module Commander
311
297
 
312
298
  end
313
299
  end
314
- end
300
+ end
@@ -1,4 +1,4 @@
1
1
 
2
2
  module Commander
3
- VERSION = '3.2.7'
3
+ VERSION = '3.2.8'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: visionmedia-commander
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.7
4
+ version: 3.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - TJ Holowaychuk
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-04-08 00:00:00 -07:00
12
+ date: 2009-04-09 00:00:00 -07:00
13
13
  default_executable: commander
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -44,10 +44,6 @@ extra_rdoc_files:
44
44
  - lib/commander/help_formatters/terminal_compact/help.erb
45
45
  - lib/commander/help_formatters/terminal_compact.rb
46
46
  - lib/commander/help_formatters.rb
47
- - lib/commander/images/error.png
48
- - lib/commander/images/info.png
49
- - lib/commander/images/ok.png
50
- - lib/commander/images/warning.png
51
47
  - lib/commander/runner.rb
52
48
  - lib/commander/user_interaction.rb
53
49
  - lib/commander/version.rb
@@ -74,10 +70,6 @@ files:
74
70
  - lib/commander/help_formatters/terminal_compact/help.erb
75
71
  - lib/commander/help_formatters/terminal_compact.rb
76
72
  - lib/commander/help_formatters.rb
77
- - lib/commander/images/error.png
78
- - lib/commander/images/info.png
79
- - lib/commander/images/ok.png
80
- - lib/commander/images/warning.png
81
73
  - lib/commander/runner.rb
82
74
  - lib/commander/user_interaction.rb
83
75
  - lib/commander/version.rb
Binary file