visionmedia-commander 3.1.4 → 3.1.5

Sign up to get free protection for your applications and to get access to all the features.
data/History.rdoc CHANGED
@@ -1,4 +1,10 @@
1
1
 
2
+ === 3.1.5 / 2009-03-22
3
+
4
+ * Added Options#__hash__ to access the internal hash table
5
+ * Refactored Options struct to function much like an OpenStruct
6
+ * Updated commander exec init help description
7
+
2
8
  === 3.1.4 / 2009-03-20
3
9
 
4
10
  * Gemspec typo
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, allowing extremely quick creation of commader executables.'
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.4"
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-20}
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}
@@ -1,6 +1,8 @@
1
1
 
2
- # TODO: remove when 1.9.x compatible, utilize BasicObject conditionally
3
-
4
- class BlankSlate
5
- instance_methods.each { |m| undef_method m unless m =~ /^__/ }
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
@@ -10,14 +10,19 @@ module Commander
10
10
  ##
11
11
  # Options struct.
12
12
 
13
- class Options < BlankSlate
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
- if meth.to_s =~ /=$/
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 = {}
@@ -1,4 +1,4 @@
1
1
 
2
2
  module Commander
3
- VERSION = '3.1.4'
3
+ VERSION = '3.1.5'
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.1.4
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-20 00:00:00 -07:00
12
+ date: 2009-03-22 00:00:00 -07:00
13
13
  default_executable: commander
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency