gator 0.0.19.pre → 0.0.20.pre
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/gator.gemspec +2 -2
- data/lib/gator/command.rb +24 -4
- data/lib/gator/runner.rb +2 -1
- data/spec/runner_spec.rb +2 -1
- metadata +15 -15
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.20.pre
|
data/gator.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{gator}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.20.pre"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Dominic Graefen"]
|
12
|
-
s.date = %q{2011-08-
|
12
|
+
s.date = %q{2011-08-15}
|
13
13
|
s.default_executable = %q{gator}
|
14
14
|
s.description = %q{gator - the friendly code-generator}
|
15
15
|
s.email = %q{dominic.graefen@gmail.com}
|
data/lib/gator/command.rb
CHANGED
@@ -28,6 +28,11 @@ module Gator
|
|
28
28
|
nil
|
29
29
|
end
|
30
30
|
|
31
|
+
def resolve_subcommand(command,fallback=nil)
|
32
|
+
return nil unless parent
|
33
|
+
parent.resolve_subcommand(command,fallback)
|
34
|
+
end
|
35
|
+
|
31
36
|
end
|
32
37
|
|
33
38
|
module ActAsCommandCollection
|
@@ -51,15 +56,30 @@ module Gator
|
|
51
56
|
end
|
52
57
|
|
53
58
|
def get_subcommand(*args)
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
arg = args.shift
|
59
|
+
klass = self
|
60
|
+
args.each do |arg|
|
61
|
+
return nil unless klass.subcommand_classes.has_key? arg
|
58
62
|
klass = klass.subcommand_classes[arg]
|
59
63
|
end
|
60
64
|
klass
|
61
65
|
end
|
62
66
|
|
67
|
+
def resolve_subcommand(command,fallback=nil)
|
68
|
+
|
69
|
+
parent_klass = self
|
70
|
+
klass = parent_klass.get_subcommand *command
|
71
|
+
|
72
|
+
return klass unless klass.nil?
|
73
|
+
|
74
|
+
while parent_klass.parent
|
75
|
+
parent_klass = parent_klass.parent
|
76
|
+
klass = parent_klass.get_subcommand *command
|
77
|
+
return klass unless klass.nil?
|
78
|
+
end
|
79
|
+
|
80
|
+
resolve_subcommand fallback if fallback
|
81
|
+
end
|
82
|
+
|
63
83
|
end
|
64
84
|
|
65
85
|
end
|
data/lib/gator/runner.rb
CHANGED
data/spec/runner_spec.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.20.pre
|
5
5
|
prerelease: 7
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,12 +9,12 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-08-
|
12
|
+
date: 2011-08-15 00:00:00.000000000 +02:00
|
13
13
|
default_executable: gator
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: thor
|
17
|
-
requirement: &
|
17
|
+
requirement: &2158120480 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ~>
|
@@ -22,10 +22,10 @@ dependencies:
|
|
22
22
|
version: 0.14.6
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *2158120480
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: rspec
|
28
|
-
requirement: &
|
28
|
+
requirement: &2158119980 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
@@ -33,10 +33,10 @@ dependencies:
|
|
33
33
|
version: 2.3.0
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *2158119980
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: ci_reporter
|
39
|
-
requirement: &
|
39
|
+
requirement: &2158119440 !ruby/object:Gem::Requirement
|
40
40
|
none: false
|
41
41
|
requirements:
|
42
42
|
- - ~>
|
@@ -44,10 +44,10 @@ dependencies:
|
|
44
44
|
version: 1.6.5
|
45
45
|
type: :development
|
46
46
|
prerelease: false
|
47
|
-
version_requirements: *
|
47
|
+
version_requirements: *2158119440
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: bundler
|
50
|
-
requirement: &
|
50
|
+
requirement: &2158115740 !ruby/object:Gem::Requirement
|
51
51
|
none: false
|
52
52
|
requirements:
|
53
53
|
- - ~>
|
@@ -55,10 +55,10 @@ dependencies:
|
|
55
55
|
version: 1.0.0
|
56
56
|
type: :development
|
57
57
|
prerelease: false
|
58
|
-
version_requirements: *
|
58
|
+
version_requirements: *2158115740
|
59
59
|
- !ruby/object:Gem::Dependency
|
60
60
|
name: jeweler
|
61
|
-
requirement: &
|
61
|
+
requirement: &2158115200 !ruby/object:Gem::Requirement
|
62
62
|
none: false
|
63
63
|
requirements:
|
64
64
|
- - ~>
|
@@ -66,10 +66,10 @@ dependencies:
|
|
66
66
|
version: 1.6.2
|
67
67
|
type: :development
|
68
68
|
prerelease: false
|
69
|
-
version_requirements: *
|
69
|
+
version_requirements: *2158115200
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: rcov
|
72
|
-
requirement: &
|
72
|
+
requirement: &2158114640 !ruby/object:Gem::Requirement
|
73
73
|
none: false
|
74
74
|
requirements:
|
75
75
|
- - ! '>='
|
@@ -77,7 +77,7 @@ dependencies:
|
|
77
77
|
version: '0'
|
78
78
|
type: :development
|
79
79
|
prerelease: false
|
80
|
-
version_requirements: *
|
80
|
+
version_requirements: *2158114640
|
81
81
|
description: gator - the friendly code-generator
|
82
82
|
email: dominic.graefen@gmail.com
|
83
83
|
executables:
|
@@ -130,7 +130,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
130
130
|
version: '0'
|
131
131
|
segments:
|
132
132
|
- 0
|
133
|
-
hash:
|
133
|
+
hash: 382817011434397857
|
134
134
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
135
135
|
none: false
|
136
136
|
requirements:
|