gator-as3-robotlegs 0.0.2.pre → 0.0.3.pre
Sign up to get free protection for your applications and to get access to all the features.
- data/.rakeTasks +1 -1
- data/Gemfile +3 -3
- data/Gemfile.lock +2 -4
- data/README.rdoc +51 -2
- data/Rakefile +4 -4
- data/VERSION +1 -1
- data/gator-as3-robotlegs.gemspec +111 -0
- data/gator-as3-robotlegs.tmproj +48 -0
- data/lib/gator/as3/robotlegs/generators.rb +1 -0
- data/lib/gator/as3/robotlegs/generators/command.rb +7 -38
- data/lib/gator/as3/robotlegs/generators/context.rb +15 -42
- data/lib/gator/as3/robotlegs/generators/generator.rb +31 -0
- data/lib/gator/as3/robotlegs/generators/mediator.rb +13 -40
- data/lib/gator/as3/robotlegs/generators/model.rb +16 -42
- data/lib/gator/as3/robotlegs/generators/service.rb +9 -35
- data/lib/gator/as3/robotlegs/generators/test/asunit4/collection.rb +0 -2
- data/lib/gator/as3/robotlegs/generators/test/asunit4/command.rb +12 -40
- data/lib/gator/as3/robotlegs/generators/test/asunit4/mediator.rb +10 -39
- data/lib/gator/as3/robotlegs/generators/test/asunit4/view.rb +7 -35
- data/lib/gator/as3/robotlegs/generators/view.rb +7 -38
- data/lib/gator/as3/robotlegs/generators/view_with_mediator.rb +3 -8
- data/lib/gator/as3/robotlegs/{generators → templates/as3/robotlegs}/command.as.tt +0 -0
- data/lib/gator/as3/robotlegs/{generators → templates/as3/robotlegs}/context.as.tt +0 -0
- data/lib/gator/as3/robotlegs/{generators → templates/as3/robotlegs}/mediator.as.tt +0 -0
- data/lib/gator/as3/robotlegs/{generators → templates/as3/robotlegs}/model.as.tt +0 -0
- data/lib/gator/as3/robotlegs/{generators → templates/as3/robotlegs}/service.as.tt +0 -0
- data/lib/gator/as3/robotlegs/{generators → templates/as3/robotlegs}/test/asunit4/command.as.tt +1 -0
- data/lib/gator/as3/robotlegs/{generators → templates/as3/robotlegs}/test/asunit4/mediator.as.tt +5 -0
- data/lib/gator/as3/robotlegs/{generators → templates/as3/robotlegs}/test/asunit4/view.as.tt +0 -1
- data/lib/gator/as3/robotlegs/{generators → templates/as3/robotlegs}/view.as.tt +0 -0
- data/lib/gator/mxml/robotlegs/generators.rb +4 -0
- data/lib/gator/mxml/robotlegs/generators/application.rb +19 -0
- data/lib/gator/mxml/robotlegs/generators/collection.rb +21 -0
- data/lib/gator/mxml/robotlegs/generators/generator.rb +34 -0
- data/lib/gator/mxml/robotlegs/generators/module.rb +19 -0
- data/lib/gator/mxml/robotlegs/generators/module_application.rb +19 -0
- data/lib/gator/mxml/robotlegs/templates/mxml/application.mxml.tt +30 -0
- data/lib/gator/mxml/robotlegs/templates/mxml/module.mxml.tt +34 -0
- data/lib/gator/mxml/robotlegs/templates/mxml/module_application.mxml.tt +31 -0
- data/spec/generators/command_spec.rb +1 -1
- metadata +34 -36
- data/lib/gator/as3/robotlegs/generators/test/asunit4/runner.as.tt +0 -21
- data/lib/gator/as3/robotlegs/generators/test/asunit4/suite.as.tt +0 -8
- data/lib/gator/as3/robotlegs/generators/test/asunit4/suite.rb +0 -43
data/.rakeTasks
CHANGED
@@ -4,4 +4,4 @@ You are allowed to:
|
|
4
4
|
1. Remove rake task
|
5
5
|
2. Add existing rake tasks
|
6
6
|
To add existing rake tasks automatically delete this file and reload the project.
|
7
|
-
--><RakeGroup description="" fullCmd="" taksId="rake"
|
7
|
+
--><RakeGroup description="" fullCmd="" taksId="rake" /></Settings>
|
data/Gemfile
CHANGED
@@ -3,7 +3,7 @@ source "http://rubygems.org"
|
|
3
3
|
# Example:
|
4
4
|
# gem "activesupport", ">= 2.3.5"
|
5
5
|
|
6
|
-
gem "gator", "~> 0.0.
|
6
|
+
gem "gator", "~> 0.0.21.pre"
|
7
7
|
gem "gator-as3", "~> 0.0.7.pre"
|
8
8
|
|
9
9
|
# Add dependencies to develop your gem here.
|
@@ -12,9 +12,9 @@ group :development do
|
|
12
12
|
gem "shoulda", ">= 0"
|
13
13
|
gem "bundler", "~> 1.0.0"
|
14
14
|
gem "jeweler", "~> 1.6.4"
|
15
|
-
gem "rcov", ">= 0"
|
15
|
+
#gem "rcov", ">= 0"
|
16
16
|
gem "rspec", "~> 2.3.0"
|
17
17
|
gem "ci_reporter", "~> 1.6.5"
|
18
|
-
gem "gator", "~> 0.0.
|
18
|
+
gem "gator", "~> 0.0.21.pre"
|
19
19
|
gem "gator-as3", "~> 0.0.7.pre"
|
20
20
|
end
|
data/Gemfile.lock
CHANGED
@@ -5,7 +5,7 @@ GEM
|
|
5
5
|
ci_reporter (1.6.5)
|
6
6
|
builder (>= 2.1.2)
|
7
7
|
diff-lcs (1.1.2)
|
8
|
-
gator (0.0.
|
8
|
+
gator (0.0.21.pre)
|
9
9
|
thor (~> 0.14.6)
|
10
10
|
gator-as3 (0.0.7.pre)
|
11
11
|
gator (~> 0.0.20.pre)
|
@@ -15,7 +15,6 @@ GEM
|
|
15
15
|
git (>= 1.2.5)
|
16
16
|
rake
|
17
17
|
rake (0.9.2)
|
18
|
-
rcov (0.9.10)
|
19
18
|
rspec (2.3.0)
|
20
19
|
rspec-core (~> 2.3.0)
|
21
20
|
rspec-expectations (~> 2.3.0)
|
@@ -33,9 +32,8 @@ PLATFORMS
|
|
33
32
|
DEPENDENCIES
|
34
33
|
bundler (~> 1.0.0)
|
35
34
|
ci_reporter (~> 1.6.5)
|
36
|
-
gator (~> 0.0.
|
35
|
+
gator (~> 0.0.21.pre)
|
37
36
|
gator-as3 (~> 0.0.7.pre)
|
38
37
|
jeweler (~> 1.6.4)
|
39
|
-
rcov
|
40
38
|
rspec (~> 2.3.0)
|
41
39
|
shoulda
|
data/README.rdoc
CHANGED
@@ -9,6 +9,56 @@ For FlexUnit4 test generators add:
|
|
9
9
|
For ASUnit4 test generators add:
|
10
10
|
require "gator/as3/robotlegs/generators/test/asunit4"
|
11
11
|
|
12
|
+
== List of commands
|
13
|
+
|
14
|
+
* <b>For a class that extends org.robotlegs.mvcs.Context</b> <i>Generates src/com/funk/ApplicationContext.as</i>:
|
15
|
+
|
16
|
+
<tt>gator g as3 rl context com.funk.Application</tt>
|
17
|
+
|
18
|
+
* <b>For a class that extends org.robotlegs.mvcs.Command</b> <i>Generates src/com/funk/controller/StartupCommand.as</i>:
|
19
|
+
|
20
|
+
<tt>gator g as3 rl command com.funk.controller.Startup</tt>
|
21
|
+
|
22
|
+
* <b>For a class that extends org.robotlegs.mvcs.Mediator</b> <i>Generates src/com/funk/views/mediators/ExampleViewMediator.as</i>:
|
23
|
+
|
24
|
+
<tt>gator g as3 rl mediator com.funk.views.ExampleView</tt>
|
25
|
+
|
26
|
+
* <b>For a class that extends flash.display.Sprite</b> <i>Generates src/com/funk/views/components/Example.as</i>:
|
27
|
+
|
28
|
+
<tt>gator g as3 rl view com.funk.views.Example</tt>
|
29
|
+
|
30
|
+
* <b>For a class that extends flash.display.Sprite + a class that extends org.robotlegs.mvcs.Mediator</b> <i>Generates src/com/funk/views/mediators/ExampleMediator.as + src/com/funk/views/components/Example.as</i>:
|
31
|
+
|
32
|
+
<tt>gator g as3 rl view_with_mediator com.funk.views.Example</tt>
|
33
|
+
|
34
|
+
* <b>For a class that extends org.robotlegs.mvcs.Actor</b> <i>Generates src/com/funk/models/ExampleModel.as</i>:
|
35
|
+
|
36
|
+
<tt>gator g as3 rl model com.funk.models.Example</tt>
|
37
|
+
|
38
|
+
* <b>For a class that extends org.robotlegs.mvcs.Actor</b> <i>Generates src/com/funk/services/ExampleService.as</i>:
|
39
|
+
|
40
|
+
<tt>gator g as3 rl service com.funk.services.Example</tt>
|
41
|
+
|
42
|
+
=== mxml
|
43
|
+
|
44
|
+
* <b>For a class that extends s:Application</b> <i>Generates src/Main.mxml</i>:
|
45
|
+
|
46
|
+
<tt>gator g mxml rl app Main</tt>
|
47
|
+
|
48
|
+
* <b>For a class that extends s:Module</b> <i>Generates src/com/funk/module/one/Example.mxml</i>:
|
49
|
+
|
50
|
+
<tt>gator g mxml rl module com.funk.module.one.Example</tt>
|
51
|
+
|
52
|
+
* <b>For a class that extends s:Module</b> <i>Generates src/com/funk/module/one/Example.mxml</i>:
|
53
|
+
|
54
|
+
<tt>gator g mxml rl module_application com.funk.module.one.Example</tt>
|
55
|
+
|
56
|
+
=== test
|
57
|
+
|
58
|
+
<b>For a the test class only prepend the generator command with 'test'</b> <i>Generates test/MainExampleCommandTest.as test/AllTests.as test/ASUnit4Runner.as</i>:
|
59
|
+
|
60
|
+
<tt>gator g as3 rl test command MainExample</tt>
|
61
|
+
|
12
62
|
== Contributing to gator-as3-robotlegs
|
13
63
|
|
14
64
|
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
@@ -22,5 +72,4 @@ For ASUnit4 test generators add:
|
|
22
72
|
== Copyright
|
23
73
|
|
24
74
|
Copyright (c) 2011 devboy. See LICENSE.txt for
|
25
|
-
further details.
|
26
|
-
|
75
|
+
further details.
|
data/Rakefile
CHANGED
@@ -36,10 +36,10 @@ end
|
|
36
36
|
|
37
37
|
task :spec => "ci:setup:rspec"
|
38
38
|
|
39
|
-
RSpec::Core::RakeTask.new(:rcov) do |spec|
|
40
|
-
spec.pattern = 'spec/**/*_spec.rb'
|
41
|
-
spec.rcov = true
|
42
|
-
end
|
39
|
+
#RSpec::Core::RakeTask.new(:rcov) do |spec|
|
40
|
+
# spec.pattern = 'spec/**/*_spec.rb'
|
41
|
+
# spec.rcov = true
|
42
|
+
#end
|
43
43
|
|
44
44
|
task :test => :spec
|
45
45
|
task :default => :spec
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.3.pre
|
@@ -0,0 +1,111 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{gator-as3-robotlegs}
|
8
|
+
s.version = "0.0.3.pre"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["devboy", "newtriks"]
|
12
|
+
s.date = %q{2011-09-01}
|
13
|
+
s.description = %q{Gator Generators for RobotLegs}
|
14
|
+
s.email = %q{simon@newtriks.com}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE.txt",
|
17
|
+
"README.rdoc"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".document",
|
21
|
+
".rakeTasks",
|
22
|
+
"Gemfile",
|
23
|
+
"Gemfile.lock",
|
24
|
+
"LICENSE.txt",
|
25
|
+
"README.rdoc",
|
26
|
+
"Rakefile",
|
27
|
+
"VERSION",
|
28
|
+
"gator-as3-robotlegs.gemspec",
|
29
|
+
"gator-as3-robotlegs.tmproj",
|
30
|
+
"lib/gator/as3/robotlegs/generators.rb",
|
31
|
+
"lib/gator/as3/robotlegs/generators/collection.rb",
|
32
|
+
"lib/gator/as3/robotlegs/generators/command.rb",
|
33
|
+
"lib/gator/as3/robotlegs/generators/context.rb",
|
34
|
+
"lib/gator/as3/robotlegs/generators/generator.rb",
|
35
|
+
"lib/gator/as3/robotlegs/generators/mediator.rb",
|
36
|
+
"lib/gator/as3/robotlegs/generators/model.rb",
|
37
|
+
"lib/gator/as3/robotlegs/generators/service.rb",
|
38
|
+
"lib/gator/as3/robotlegs/generators/test/asunit4.rb",
|
39
|
+
"lib/gator/as3/robotlegs/generators/test/asunit4/collection.rb",
|
40
|
+
"lib/gator/as3/robotlegs/generators/test/asunit4/command.rb",
|
41
|
+
"lib/gator/as3/robotlegs/generators/test/asunit4/mediator.rb",
|
42
|
+
"lib/gator/as3/robotlegs/generators/test/asunit4/view.rb",
|
43
|
+
"lib/gator/as3/robotlegs/generators/view.rb",
|
44
|
+
"lib/gator/as3/robotlegs/generators/view_with_mediator.rb",
|
45
|
+
"lib/gator/as3/robotlegs/templates/as3/robotlegs/command.as.tt",
|
46
|
+
"lib/gator/as3/robotlegs/templates/as3/robotlegs/context.as.tt",
|
47
|
+
"lib/gator/as3/robotlegs/templates/as3/robotlegs/mediator.as.tt",
|
48
|
+
"lib/gator/as3/robotlegs/templates/as3/robotlegs/model.as.tt",
|
49
|
+
"lib/gator/as3/robotlegs/templates/as3/robotlegs/service.as.tt",
|
50
|
+
"lib/gator/as3/robotlegs/templates/as3/robotlegs/test/asunit4/command.as.tt",
|
51
|
+
"lib/gator/as3/robotlegs/templates/as3/robotlegs/test/asunit4/mediator.as.tt",
|
52
|
+
"lib/gator/as3/robotlegs/templates/as3/robotlegs/test/asunit4/view.as.tt",
|
53
|
+
"lib/gator/as3/robotlegs/templates/as3/robotlegs/view.as.tt",
|
54
|
+
"lib/gator/mxml/robotlegs/generators.rb",
|
55
|
+
"lib/gator/mxml/robotlegs/generators/application.rb",
|
56
|
+
"lib/gator/mxml/robotlegs/generators/collection.rb",
|
57
|
+
"lib/gator/mxml/robotlegs/generators/generator.rb",
|
58
|
+
"lib/gator/mxml/robotlegs/generators/module.rb",
|
59
|
+
"lib/gator/mxml/robotlegs/generators/module_application.rb",
|
60
|
+
"lib/gator/mxml/robotlegs/templates/mxml/application.mxml.tt",
|
61
|
+
"lib/gator/mxml/robotlegs/templates/mxml/module.mxml.tt",
|
62
|
+
"lib/gator/mxml/robotlegs/templates/mxml/module_application.mxml.tt",
|
63
|
+
"spec/gator.rb",
|
64
|
+
"spec/generators/collection_spec.rb",
|
65
|
+
"spec/generators/command_spec.rb",
|
66
|
+
"spec/sandbox/gator.rb",
|
67
|
+
"spec/spec_helper.rb"
|
68
|
+
]
|
69
|
+
s.homepage = %q{http://github.com/newtriks/gator-as3-robotlegs}
|
70
|
+
s.licenses = ["MIT"]
|
71
|
+
s.require_paths = ["lib"]
|
72
|
+
s.rubygems_version = %q{1.6.2}
|
73
|
+
s.summary = %q{Gator Generators for RobotLegs}
|
74
|
+
|
75
|
+
if s.respond_to? :specification_version then
|
76
|
+
s.specification_version = 3
|
77
|
+
|
78
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
79
|
+
s.add_runtime_dependency(%q<gator>, ["~> 0.0.21.pre"])
|
80
|
+
s.add_runtime_dependency(%q<gator-as3>, ["~> 0.0.7.pre"])
|
81
|
+
s.add_development_dependency(%q<shoulda>, [">= 0"])
|
82
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
83
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
|
84
|
+
s.add_development_dependency(%q<rspec>, ["~> 2.3.0"])
|
85
|
+
s.add_development_dependency(%q<ci_reporter>, ["~> 1.6.5"])
|
86
|
+
s.add_development_dependency(%q<gator>, ["~> 0.0.21.pre"])
|
87
|
+
s.add_development_dependency(%q<gator-as3>, ["~> 0.0.7.pre"])
|
88
|
+
else
|
89
|
+
s.add_dependency(%q<gator>, ["~> 0.0.21.pre"])
|
90
|
+
s.add_dependency(%q<gator-as3>, ["~> 0.0.7.pre"])
|
91
|
+
s.add_dependency(%q<shoulda>, [">= 0"])
|
92
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
93
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
94
|
+
s.add_dependency(%q<rspec>, ["~> 2.3.0"])
|
95
|
+
s.add_dependency(%q<ci_reporter>, ["~> 1.6.5"])
|
96
|
+
s.add_dependency(%q<gator>, ["~> 0.0.21.pre"])
|
97
|
+
s.add_dependency(%q<gator-as3>, ["~> 0.0.7.pre"])
|
98
|
+
end
|
99
|
+
else
|
100
|
+
s.add_dependency(%q<gator>, ["~> 0.0.21.pre"])
|
101
|
+
s.add_dependency(%q<gator-as3>, ["~> 0.0.7.pre"])
|
102
|
+
s.add_dependency(%q<shoulda>, [">= 0"])
|
103
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
104
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
105
|
+
s.add_dependency(%q<rspec>, ["~> 2.3.0"])
|
106
|
+
s.add_dependency(%q<ci_reporter>, ["~> 1.6.5"])
|
107
|
+
s.add_dependency(%q<gator>, ["~> 0.0.21.pre"])
|
108
|
+
s.add_dependency(%q<gator-as3>, ["~> 0.0.7.pre"])
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
@@ -0,0 +1,48 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
3
|
+
<plist version="1.0">
|
4
|
+
<dict>
|
5
|
+
<key>currentDocument</key>
|
6
|
+
<string>VERSION</string>
|
7
|
+
<key>documents</key>
|
8
|
+
<array>
|
9
|
+
<dict>
|
10
|
+
<key>expanded</key>
|
11
|
+
<true/>
|
12
|
+
<key>name</key>
|
13
|
+
<string>gator-as3-robotlegs</string>
|
14
|
+
<key>regexFolderFilter</key>
|
15
|
+
<string>!.*/(\.[^/]*|CVS|_darcs|_MTN|\{arch\}|blib|.*~\.nib|.*\.(framework|app|pbproj|pbxproj|xcode(proj)?|bundle))$</string>
|
16
|
+
<key>sourceDirectory</key>
|
17
|
+
<string></string>
|
18
|
+
</dict>
|
19
|
+
</array>
|
20
|
+
<key>fileHierarchyDrawerWidth</key>
|
21
|
+
<integer>316</integer>
|
22
|
+
<key>metaData</key>
|
23
|
+
<dict>
|
24
|
+
<key>VERSION</key>
|
25
|
+
<dict>
|
26
|
+
<key>caret</key>
|
27
|
+
<dict>
|
28
|
+
<key>column</key>
|
29
|
+
<integer>9</integer>
|
30
|
+
<key>line</key>
|
31
|
+
<integer>0</integer>
|
32
|
+
</dict>
|
33
|
+
<key>firstVisibleColumn</key>
|
34
|
+
<integer>0</integer>
|
35
|
+
<key>firstVisibleLine</key>
|
36
|
+
<integer>0</integer>
|
37
|
+
</dict>
|
38
|
+
</dict>
|
39
|
+
<key>openDocuments</key>
|
40
|
+
<array>
|
41
|
+
<string>VERSION</string>
|
42
|
+
</array>
|
43
|
+
<key>showFileHierarchyDrawer</key>
|
44
|
+
<true/>
|
45
|
+
<key>windowFrame</key>
|
46
|
+
<string>{{0, 152}, {915, 626}}</string>
|
47
|
+
</dict>
|
48
|
+
</plist>
|
@@ -2,52 +2,21 @@ module Gator
|
|
2
2
|
module AS3
|
3
3
|
module RobotLegs
|
4
4
|
|
5
|
-
class CommandGenerator <
|
5
|
+
class CommandGenerator < Gator::AS3::KlassGenerator
|
6
6
|
include Gator::Project
|
7
|
+
include WithRobotLegsTemplates
|
8
|
+
include ActAsRobotLegsKlassGenerator
|
7
9
|
|
8
10
|
define :command => "command",
|
9
11
|
:usage => "generate as3 rl command CLASS_NAME", :description => "Creates RobotLegs Command class."
|
10
12
|
|
11
|
-
|
12
|
-
|
13
|
-
class_option :test, :default => false
|
14
|
-
|
15
|
-
def self.source_root
|
16
|
-
File.dirname __FILE__
|
13
|
+
def template_file
|
14
|
+
"as3/robotlegs/command.as.tt"
|
17
15
|
end
|
18
16
|
|
19
17
|
def generate
|
20
|
-
|
21
|
-
|
22
|
-
@class_name += "Command"
|
23
|
-
src = File.join(src, @package_name.split(".").join(File::SEPARATOR)) unless @package_name == ""
|
24
|
-
template "command.as.tt", File.join(src, "#{@class_name}.as")
|
25
|
-
end
|
26
|
-
|
27
|
-
def generate_test
|
28
|
-
return unless options[:test]
|
29
|
-
invoke resolve_subcommand(["test", "command"],["test","klass"])
|
30
|
-
end
|
31
|
-
|
32
|
-
no_tasks {
|
33
|
-
|
34
|
-
def package_name
|
35
|
-
@package_name
|
36
|
-
end
|
37
|
-
|
38
|
-
def class_name
|
39
|
-
@class_name
|
40
|
-
end
|
41
|
-
|
42
|
-
}
|
43
|
-
|
44
|
-
protected
|
45
|
-
|
46
|
-
def split_class_name(class_name)
|
47
|
-
pieces = class_name.split "."
|
48
|
-
class_name = pieces.pop
|
49
|
-
package_name = pieces.join "."
|
50
|
-
return package_name, class_name
|
18
|
+
@class_name += "Command" unless @class_name.match(/Command$/)
|
19
|
+
super
|
51
20
|
end
|
52
21
|
|
53
22
|
end
|
@@ -2,53 +2,26 @@ module Gator
|
|
2
2
|
module AS3
|
3
3
|
module RobotLegs
|
4
4
|
|
5
|
-
class ContextGenerator <
|
5
|
+
class ContextGenerator < Gator::AS3::KlassGenerator
|
6
6
|
include Gator::Project
|
7
|
+
include WithRobotLegsTemplates
|
7
8
|
|
8
9
|
define :command => "context",
|
9
10
|
:usage => "generate as3 rl context CLASS_NAME", :description => "Creates RobotLegs Context class."
|
10
11
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
template "context.as.tt", File.join(src, "#{@class_name}.as")
|
25
|
-
end
|
26
|
-
|
27
|
-
def generate_test
|
28
|
-
return unless options[:test]
|
29
|
-
invoke resolve_subcommand(["test", "context"],["test","klass"])
|
30
|
-
end
|
31
|
-
|
32
|
-
no_tasks {
|
33
|
-
|
34
|
-
def package_name
|
35
|
-
@package_name
|
36
|
-
end
|
37
|
-
|
38
|
-
def class_name
|
39
|
-
@class_name
|
40
|
-
end
|
41
|
-
|
42
|
-
}
|
43
|
-
|
44
|
-
protected
|
45
|
-
|
46
|
-
def split_class_name(class_name)
|
47
|
-
pieces = class_name.split "."
|
48
|
-
class_name = pieces.pop
|
49
|
-
package_name = pieces.join "."
|
50
|
-
return package_name, class_name
|
51
|
-
end
|
12
|
+
def template_file
|
13
|
+
"as3/robotlegs/context.as.tt"
|
14
|
+
end
|
15
|
+
|
16
|
+
def generate
|
17
|
+
@class_name += "Context" unless @class_name.match(/Context$/)
|
18
|
+
super
|
19
|
+
end
|
20
|
+
|
21
|
+
def generate_test
|
22
|
+
return unless options[:test]
|
23
|
+
invoke resolve_subcommand(generate_test_command_fallback), ["#{package_and_class}Context"]
|
24
|
+
end
|
52
25
|
|
53
26
|
end
|
54
27
|
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module Gator
|
2
|
+
module AS3
|
3
|
+
module RobotLegs
|
4
|
+
module WithRobotLegsTemplates
|
5
|
+
def self.included(base)
|
6
|
+
base.extend(ClassMethods)
|
7
|
+
end
|
8
|
+
|
9
|
+
module ClassMethods
|
10
|
+
def template_root
|
11
|
+
File.dirname(__FILE__) + "/../templates"
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
module ActAsRobotLegsKlassGenerator
|
16
|
+
def generate_test_command
|
17
|
+
super.unshift "robotlegs"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
module ActAsRobotLegsTestGenerator
|
21
|
+
def generate_klass_command
|
22
|
+
["robotlegs", definition[:command]]
|
23
|
+
end
|
24
|
+
|
25
|
+
def update_suite
|
26
|
+
invoke resolve_subcommand(["test", "suite"])
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|