main 2.9.2 → 2.9.3

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.
Files changed (4) hide show
  1. data/lib/main.rb +1 -1
  2. data/lib/main/mode.rb +36 -34
  3. data/main.gemspec +1 -1
  4. metadata +2 -2
@@ -2,7 +2,7 @@ module Main
2
2
  #
3
3
  # top level constants
4
4
  #
5
- Main::VERSION = '2.9.2' unless
5
+ Main::VERSION = '2.9.3' unless
6
6
  defined? Main::VERSION
7
7
  def self.version() Main::VERSION end
8
8
 
@@ -1,42 +1,44 @@
1
- class Mode < ::String
2
- class Error < ::StandardError; end
3
- class Duplicate < Error; end
4
- class Ambiguous < Error
5
- include Main::Softspoken
6
- end
7
-
8
- class List < ::Array
9
- def initialize *a, &b
10
- super
11
- ensure
12
- self.fields = []
13
- end
14
- def add klass
15
- mode_name = Mode.new klass.mode_name
16
- raise Duplicate, mode_name if has_key? mode_name
17
- self[mode_name] = klass
1
+ module Main
2
+ class Mode < ::String
3
+ class Error < ::StandardError; end
4
+ class Duplicate < Error; end
5
+ class Ambiguous < Error
6
+ include Main::Softspoken
18
7
  end
19
- def find_by_mode m, options = {}
20
- quiet = options['quiet'] || options[:quiet]
21
- each_pair do |mode, klass|
22
- return mode if mode == m
8
+
9
+ class List < ::Array
10
+ def initialize *a, &b
11
+ super
12
+ ensure
13
+ self.fields = []
23
14
  end
24
- candidates = []
25
- each_pair do |mode, klass|
26
- candidates << mode if mode.index(m) == 0
15
+ def add klass
16
+ mode_name = Mode.new klass.mode_name
17
+ raise Duplicate, mode_name if has_key? mode_name
18
+ self[mode_name] = klass
27
19
  end
28
- case candidates.size
29
- when 0
30
- nil
31
- when 1
32
- candidates.first
33
- else
34
- raise Ambiguous, "ambiguous mode: #{ m } = (#{ candidates.sort.join ' or ' })?"
20
+ def find_by_mode m, options = {}
21
+ quiet = options['quiet'] || options[:quiet]
22
+ each_pair do |mode, klass|
23
+ return mode if mode == m
24
+ end
25
+ candidates = []
26
+ each_pair do |mode, klass|
27
+ candidates << mode if mode.index(m) == 0
28
+ end
29
+ case candidates.size
30
+ when 0
31
+ nil
32
+ when 1
33
+ candidates.first
34
+ else
35
+ raise Ambiguous, "ambiguous mode: #{ m } = (#{ candidates.sort.join ' or ' })?"
36
+ end
35
37
  end
36
38
  end
37
- end
38
39
 
39
- def self.list *a, &b
40
- List.new *a, &b
40
+ def self.list *a, &b
41
+ List.new *a, &b
42
+ end
41
43
  end
42
44
  end
@@ -3,7 +3,7 @@
3
3
 
4
4
  Gem::Specification::new do |spec|
5
5
  spec.name = "main"
6
- spec.version = "2.9.2"
6
+ spec.version = "2.9.3"
7
7
  spec.platform = Gem::Platform::RUBY
8
8
  spec.summary = "main"
9
9
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: main
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.9.2
4
+ version: 2.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ara T. Howard
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-09-30 00:00:00 -06:00
12
+ date: 2009-10-01 00:00:00 -06:00
13
13
  default_executable:
14
14
  dependencies: []
15
15