visionmedia-commander 3.1.4 → 3.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.rdoc +6 -0
- data/Todo.rdoc +3 -0
- data/bin/commander +2 -1
- data/commander.gemspec +2 -2
- data/lib/commander/blank.rb +6 -4
- data/lib/commander/command.rb +12 -7
- data/lib/commander/version.rb +1 -1
- metadata +2 -2
data/History.rdoc
CHANGED
data/Todo.rdoc
CHANGED
@@ -1,12 +1,15 @@
|
|
1
1
|
|
2
2
|
== Major
|
3
3
|
|
4
|
+
* Change Options to use hash @table ... open struct
|
5
|
+
* Add to_hash or __hash__ method to Options, revise rbind
|
4
6
|
* Finish global --trace
|
5
7
|
* 1.9.x compatability
|
6
8
|
* Publish RDoc on mini page / screencasts
|
7
9
|
|
8
10
|
== Minor
|
9
11
|
|
12
|
+
* Better custom shell support ... Highline stuff is not very nice
|
10
13
|
* Prevent global options from overriding sub-command level options
|
11
14
|
* Add arbitrary help blocks to sub-commands as well
|
12
15
|
* Spec for changing out formatters (mock formatter)
|
data/bin/commander
CHANGED
@@ -10,7 +10,8 @@ program :description, 'Commander utility program.'
|
|
10
10
|
command :init do |c|
|
11
11
|
c.syntax = 'commander init <file>'
|
12
12
|
c.summary = 'Initialize a commander template'
|
13
|
-
c.description = 'Initialize an empty <file> with a commander template,
|
13
|
+
c.description = 'Initialize an empty <file> with a commander template,
|
14
|
+
allowing very quick creation of commander executables.'
|
14
15
|
c.example 'Create a new file with a commander template.', 'commander init bin/my_executable'
|
15
16
|
c.when_called do |args, options|
|
16
17
|
file = args.shift || abort('file argument required.')
|
data/commander.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{commander}
|
5
|
-
s.version = "3.1.
|
5
|
+
s.version = "3.1.5"
|
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-03-
|
9
|
+
s.date = %q{2009-03-22}
|
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}
|
data/lib/commander/blank.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
2
|
+
module Blank
|
3
|
+
def self.included base
|
4
|
+
base.class_eval do
|
5
|
+
instance_methods.each { |m| undef_method m unless m =~ /^__/ }
|
6
|
+
end
|
7
|
+
end
|
6
8
|
end
|
data/lib/commander/command.rb
CHANGED
@@ -10,14 +10,19 @@ module Commander
|
|
10
10
|
##
|
11
11
|
# Options struct.
|
12
12
|
|
13
|
-
class Options
|
13
|
+
class Options
|
14
|
+
include Blank
|
15
|
+
|
16
|
+
def initialize
|
17
|
+
@table = {}
|
18
|
+
end
|
19
|
+
|
20
|
+
def __hash__
|
21
|
+
@table
|
22
|
+
end
|
23
|
+
|
14
24
|
def method_missing meth, *args, &block
|
15
|
-
|
16
|
-
metaclass = class << self; self end
|
17
|
-
metaclass.send :define_method, meth.to_s.chop do
|
18
|
-
args.first
|
19
|
-
end
|
20
|
-
end
|
25
|
+
meth.to_s =~ /=$/ ? @table[meth.to_s.chop] = args.first : @table[meth.to_s]
|
21
26
|
end
|
22
27
|
|
23
28
|
def default defaults = {}
|
data/lib/commander/version.rb
CHANGED
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.1.
|
4
|
+
version: 3.1.5
|
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-03-
|
12
|
+
date: 2009-03-22 00:00:00 -07:00
|
13
13
|
default_executable: commander
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|