flexunit 0.0.8.pre → 0.0.9.pre
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +5 -14
- data/Rakefile +37 -5
- data/lib/flexunit4/generators/templates/AIRApplication-app.xml +63 -137
- data/lib/flexunit4/generators/templates/AIRRakefile.rb +1 -2
- data/lib/flexunit4/generators/templates/AIRRunner-app.xml +27 -59
- data/lib/flexunit4/generators/templates/AIRRunner.mxml +24 -20
- data/lib/flexunit4/generators/templates/Gemfile +1 -1
- data/lib/flexunit4/module.rb +1 -1
- data/test/unit/air_project_generator_test.rb +1 -1
- metadata +6 -3
data/README.md
CHANGED
@@ -2,9 +2,9 @@
|
|
2
2
|
|
3
3
|
This [RubyGem](http://docs.rubygems.org/read/book/7) contains templates and
|
4
4
|
libraries to add support for [FlexUnit](http://flexunit.org) in
|
5
|
-
[Project Sprouts](http://projectsprouts.org).
|
6
|
-
|
7
|
-
|
5
|
+
[Project Sprouts](http://projectsprouts.org). Functionality includes the ability
|
6
|
+
to create ActionScript 3, Flex, and AIR projects that are integrated with the
|
7
|
+
Sprouts workflow
|
8
8
|
|
9
9
|
## Install
|
10
10
|
|
@@ -28,7 +28,7 @@ Generate a project with
|
|
28
28
|
|
29
29
|
Or edit your Gemfile to include
|
30
30
|
|
31
|
-
gem "flexunit", ">= 0.0.
|
31
|
+
gem "flexunit", ">= 0.0.9.pre"
|
32
32
|
|
33
33
|
This will mean that when you generate a class using:
|
34
34
|
|
@@ -36,20 +36,11 @@ This will mean that when you generate a class using:
|
|
36
36
|
|
37
37
|
The associated FlexUnit test case will automatically be created.
|
38
38
|
|
39
|
-
To build
|
40
|
-
needed:
|
39
|
+
To build the following Rake file edits may be needed:
|
41
40
|
|
42
|
-
* Replace `:asunit` references with `:flexunit4`.
|
43
41
|
* Manually convert the TestRunner.mxml to use your choice of FlexUnit runners.
|
44
42
|
* Switch the test task to use `amxmlc` in the Rake file (if appropriate).
|
45
43
|
|
46
|
-
## TODO
|
47
|
-
|
48
|
-
* SWC library linkage
|
49
|
-
* A working AIR project Rakefile
|
50
|
-
* Runner Templates for AS3, Flex, & AIR
|
51
|
-
* Rake examples
|
52
|
-
|
53
44
|
## Credit
|
54
45
|
|
55
46
|
To [Luke Bayes](http://github.com/lukebayes/) and [Kristopher Joseph](http://github.com/kristoferjoseph/) as similarity to the [FlashSDK](https://github.com/lukebayes/sprout-flashsdk) and [Robotlegs](http://github.com/kristoferjoseph/sprout-robotlegs)
|
data/Rakefile
CHANGED
@@ -1,11 +1,17 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
Bundler.require
|
1
|
+
lib = File.expand_path('lib', File.dirname(__FILE__))
|
2
|
+
$:.unshift lib unless $:.include?(lib)
|
5
3
|
|
4
|
+
require 'rubygems'
|
6
5
|
require 'rake'
|
7
6
|
require 'rake/clean'
|
8
7
|
require 'rake/testtask'
|
8
|
+
require 'flexunit'
|
9
|
+
|
10
|
+
#############################################################################
|
11
|
+
#
|
12
|
+
# Standard tasks
|
13
|
+
#
|
14
|
+
#############################################################################
|
9
15
|
|
10
16
|
Rake::TestTask.new(:test) do |t|
|
11
17
|
t.libs << "test/unit"
|
@@ -15,4 +21,30 @@ end
|
|
15
21
|
|
16
22
|
CLEAN.add '*.gem'
|
17
23
|
|
18
|
-
|
24
|
+
#############################################################################
|
25
|
+
#
|
26
|
+
# Packaging tasks
|
27
|
+
#
|
28
|
+
#############################################################################
|
29
|
+
|
30
|
+
task :release do
|
31
|
+
puts ""
|
32
|
+
print "Are you sure you want to relase FlexUnit #{FlexUnit::VERSION}? [y/N] "
|
33
|
+
exit unless STDIN.gets.index(/y/i) == 0
|
34
|
+
|
35
|
+
unless `git branch` =~ /^\* master$/
|
36
|
+
puts "You must be on the master branch to release!"
|
37
|
+
exit!
|
38
|
+
end
|
39
|
+
|
40
|
+
# Build gem and upload
|
41
|
+
sh "gem build flexunit.gemspec"
|
42
|
+
sh "gem push flexunit-#{FlexUnit::VERSION}.gem"
|
43
|
+
sh "rm flexunit-#{FlexUnit::VERSION}.gem"
|
44
|
+
|
45
|
+
# Commit
|
46
|
+
sh "git commit --allow-empty -a -m 'v#{FlexUnit::VERSION}'"
|
47
|
+
sh "git tag v#{FlexUnit::VERSION}"
|
48
|
+
sh "git push origin master"
|
49
|
+
sh "git push origin v#{FlexUnit::VERSION}"
|
50
|
+
end
|
@@ -1,138 +1,64 @@
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"
|
2
|
-
<application
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
<!-- <resizable></resizable> -->
|
65
|
-
|
66
|
-
<!-- The window's initial width. Optional. -->
|
67
|
-
<!-- <width></width> -->
|
68
|
-
|
69
|
-
<!-- The window's initial height. Optional. -->
|
70
|
-
<!-- <height></height> -->
|
71
|
-
|
72
|
-
<!-- The window's initial x position. Optional. -->
|
73
|
-
<!-- <x></x> -->
|
74
|
-
|
75
|
-
<!-- The window's initial y position. Optional. -->
|
76
|
-
<!-- <y></y> -->
|
77
|
-
|
78
|
-
<!-- The window's minimum size, specified as a width/height pair, such as "400 200". Optional. -->
|
79
|
-
<!-- <minSize></minSize> -->
|
80
|
-
|
81
|
-
<!-- The window's initial maximum size, specified as a width/height pair, such as "1600 1200". Optional. -->
|
82
|
-
<!-- <maxSize></maxSize> -->
|
83
|
-
</initialWindow>
|
84
|
-
|
85
|
-
<!-- The subpath of the standard default installation location to use. Optional. -->
|
86
|
-
<!-- <installFolder></installFolder> -->
|
87
|
-
|
88
|
-
<!-- The subpath of the Programs menu to use. (Ignored on operating systems without a Programs menu.) Optional. -->
|
89
|
-
<!-- <programMenuFolder></programMenuFolder> -->
|
90
|
-
|
91
|
-
<!-- The icon the system uses for the application. For at least one resolution,
|
92
|
-
specify the path to a PNG file included in the AIR package. Optional. -->
|
93
|
-
<!-- <icon>
|
94
|
-
<image16x16></image16x16>
|
95
|
-
<image32x32></image32x32>
|
96
|
-
<image48x48></image48x48>
|
97
|
-
<image128x128></image128x128>
|
98
|
-
</icon> -->
|
99
|
-
|
100
|
-
<!-- Whether the application handles the update when a user double-clicks an update version
|
101
|
-
of the AIR file (true), or the default AIR application installer handles the update (false).
|
102
|
-
Optional. Default false. -->
|
103
|
-
<!-- <customUpdateUI></customUpdateUI> -->
|
104
|
-
|
105
|
-
<!-- Whether the application can be launched when the user clicks a link in a web browser.
|
106
|
-
Optional. Default false. -->
|
107
|
-
<!-- <allowBrowserInvocation></allowBrowserInvocation> -->
|
108
|
-
|
109
|
-
<!-- Listing of file types for which the application can register. Optional. -->
|
110
|
-
<!-- <fileTypes> -->
|
111
|
-
|
112
|
-
<!-- Defines one file type. Optional. -->
|
113
|
-
<!-- <fileType> -->
|
114
|
-
|
115
|
-
<!-- The name that the system displays for the registered file type. Required. -->
|
116
|
-
<!-- <name></name> -->
|
117
|
-
|
118
|
-
<!-- The extension to register. Required. -->
|
119
|
-
<!-- <extension></extension> -->
|
120
|
-
|
121
|
-
<!-- The description of the file type. Optional. -->
|
122
|
-
<!-- <description></description> -->
|
123
|
-
|
124
|
-
<!-- The MIME content type. -->
|
125
|
-
<!-- <contentType></contentType> -->
|
126
|
-
|
127
|
-
<!-- The icon to display for the file type. Optional. -->
|
128
|
-
<!-- <icon>
|
129
|
-
<image16x16></image16x16>
|
130
|
-
<image32x32></image32x32>
|
131
|
-
<image48x48></image48x48>
|
132
|
-
<image128x128></image128x128>
|
133
|
-
</icon> -->
|
134
|
-
|
135
|
-
<!-- </fileType> -->
|
136
|
-
<!-- </fileTypes> -->
|
137
|
-
|
1
|
+
<?xml version="1.0" encoding="utf-8" ?>
|
2
|
+
<application
|
3
|
+
xmlns="http://ns.adobe.com/air/application/2.5"
|
4
|
+
minimumPatchLevel="0">
|
5
|
+
<!-- AIR Application Descriptor File. See http://www.adobe.com/go/learn_air_1.0_application_descriptor_en. -->
|
6
|
+
<id><%= package_name %>.<%= class_name %></id>
|
7
|
+
<name>
|
8
|
+
<text xml:lang="en"><%= project_name %></text>
|
9
|
+
</name>
|
10
|
+
<!-- A string value of the format <0-999>.<0-999>.<0-999> that represents application version which can be used to check for application upgrade.
|
11
|
+
Values can also be 1-part or 2-part. It is not necessary to have a 3-part value.
|
12
|
+
An updated version of application must have a versionNumber value higher than the previous version. Required for namespace >= 2.5 . -->
|
13
|
+
<versionNumber>0.0.1</versionNumber>
|
14
|
+
|
15
|
+
<!-- A string value (such as "v1", "2.5", or "Alpha 1") that represents the version of the application, as it should be shown to users. Optional. -->
|
16
|
+
<versionLabel>0.0.1</versionLabel>
|
17
|
+
<filename><%= project_name %></filename>
|
18
|
+
<description>
|
19
|
+
<text xml:lang="en">This is a sample Adobe AIR application built with Project Sprouts.</text>
|
20
|
+
</description>
|
21
|
+
<copyright>Copyright 2011</copyright>
|
22
|
+
<initialWindow>
|
23
|
+
<content><%= debug_swf_name %></content>
|
24
|
+
<!-- <title>Example Application</title> -->
|
25
|
+
<systemChrome>standard</systemChrome>
|
26
|
+
<transparent>false</transparent>
|
27
|
+
<visible>false</visible>
|
28
|
+
<minimizable>true</minimizable>
|
29
|
+
<maximizable>true</maximizable>
|
30
|
+
<resizable>true</resizable>
|
31
|
+
<width>800</width>
|
32
|
+
<height>500</height>
|
33
|
+
<x>150</x>
|
34
|
+
<y>150</y>
|
35
|
+
<minSize>300 300</minSize>
|
36
|
+
<maxSize>800 800</maxSize>
|
37
|
+
</initialWindow>
|
38
|
+
<!--
|
39
|
+
<installFolder>Example Company/Example Application</installFolder>
|
40
|
+
<programMenuFolder>Example Company/Example Application</programMenuFolder>
|
41
|
+
<icon>
|
42
|
+
<image16x16>icons/AIRApp_16.png</image16x16>
|
43
|
+
<image32x32>icons/AIRApp_32.png</image32x32>
|
44
|
+
<image48x48>icons/AIRApp_48.png</image48x48>
|
45
|
+
<image128x128>icons/AIRApp_128.png</image128x128>
|
46
|
+
</icon>
|
47
|
+
<customUpdateUI>false</customUpdateUI>
|
48
|
+
<allowBrowserInvocation>false</allowBrowserInvocation>
|
49
|
+
<fileTypes>
|
50
|
+
<fileType>
|
51
|
+
<name>com.example</name>
|
52
|
+
<extension>xmpl</extension>
|
53
|
+
<description>Example file</description>
|
54
|
+
<contentType>example/x-data-type</contentType>
|
55
|
+
<icon>
|
56
|
+
<image16x16>icons/AIRApp_16.png</image16x16>
|
57
|
+
<image32x32>icons/AIRApp_32.png</image32x32>
|
58
|
+
<image48x48>icons/AIRApp_48.png</image48x48>
|
59
|
+
<image128x128>icons/AIRApp_128.png</image128x128>
|
60
|
+
</icon>
|
61
|
+
</fileType>
|
62
|
+
</fileTypes>
|
63
|
+
-->
|
138
64
|
</application>
|
@@ -24,6 +24,7 @@ task :debug => "<%= bin %>/<%= debug_swf_name %>"
|
|
24
24
|
# Test
|
25
25
|
|
26
26
|
library :flexunit, :flexunit_flex
|
27
|
+
library :flexunit, :flexunit_uilistener
|
27
28
|
library :flexunit, :flexunit_cilistener #Compile fails if we don't have this.
|
28
29
|
library :flexunit, :flexunit_aircilistener
|
29
30
|
|
@@ -48,8 +49,6 @@ task :test => "<%= bin %>/<%= test_swf_name %>"
|
|
48
49
|
##############################
|
49
50
|
# Package
|
50
51
|
|
51
|
-
desc "Create AIR installer"
|
52
|
-
|
53
52
|
adt 'bin/<%= class_name %>.air' => 'bin/<%= class_name %>.swf' do |t|
|
54
53
|
t.package = true
|
55
54
|
t.package_input = '<%= class_name %>-app.xml'
|
@@ -1,64 +1,32 @@
|
|
1
1
|
<?xml version="1.0" encoding="utf-8" ?>
|
2
2
|
<application
|
3
|
-
|
4
|
-
|
5
|
-
<!-- AIR Application Descriptor File. See http://www.adobe.com/go/learn_air_1.0_application_descriptor_en. -->
|
6
|
-
<id><%= package_name %>.<%= test_runner_name %></id>
|
7
|
-
<name>
|
8
|
-
<text xml:lang="en"><%= test_runner_name %></text>
|
9
|
-
</name>
|
10
|
-
<!-- A string value of the format <0-999>.<0-999>.<0-999> that represents application version which can be used to check for application upgrade.
|
11
|
-
Values can also be 1-part or 2-part. It is not necessary to have a 3-part value.
|
12
|
-
An updated version of application must have a versionNumber value higher than the previous version. Required for namespace >= 2.5 . -->
|
13
|
-
<versionNumber>0.0.1</versionNumber>
|
3
|
+
xmlns="http://ns.adobe.com/air/application/2.5"
|
4
|
+
minimumPatchLevel="0">
|
14
5
|
|
15
|
-
|
6
|
+
<id><%= package_name %>.<%= test_runner_name %></id>
|
7
|
+
<name>
|
8
|
+
<text xml:lang="en"><%= test_runner_name %></text>
|
9
|
+
</name>
|
10
|
+
<versionNumber>0.0.1</versionNumber>
|
16
11
|
<versionLabel>0.0.1</versionLabel>
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
</initialWindow>
|
38
|
-
<!--
|
39
|
-
<installFolder>Example Company/Example Application</installFolder>
|
40
|
-
<programMenuFolder>Example Company/Example Application</programMenuFolder>
|
41
|
-
<icon>
|
42
|
-
<image16x16>icons/AIRApp_16.png</image16x16>
|
43
|
-
<image32x32>icons/AIRApp_32.png</image32x32>
|
44
|
-
<image48x48>icons/AIRApp_48.png</image48x48>
|
45
|
-
<image128x128>icons/AIRApp_128.png</image128x128>
|
46
|
-
</icon>
|
47
|
-
<customUpdateUI>false</customUpdateUI>
|
48
|
-
<allowBrowserInvocation>false</allowBrowserInvocation>
|
49
|
-
<fileTypes>
|
50
|
-
<fileType>
|
51
|
-
<name>com.example</name>
|
52
|
-
<extension>xmpl</extension>
|
53
|
-
<description>Example file</description>
|
54
|
-
<contentType>example/x-data-type</contentType>
|
55
|
-
<icon>
|
56
|
-
<image16x16>icons/AIRApp_16.png</image16x16>
|
57
|
-
<image32x32>icons/AIRApp_32.png</image32x32>
|
58
|
-
<image48x48>icons/AIRApp_48.png</image48x48>
|
59
|
-
<image128x128>icons/AIRApp_128.png</image128x128>
|
60
|
-
</icon>
|
61
|
-
</fileType>
|
62
|
-
</fileTypes>
|
63
|
-
-->
|
12
|
+
<filename><%= project_name %></filename>
|
13
|
+
<description>
|
14
|
+
<text xml:lang="en">This is a sample Adobe AIR application built with Project Sprouts.</text>
|
15
|
+
</description>
|
16
|
+
<copyright>Copyright 2011</copyright>
|
17
|
+
<initialWindow>
|
18
|
+
<content><%= test_swf_name %></content>
|
19
|
+
<systemChrome>standard</systemChrome>
|
20
|
+
<transparent>false</transparent>
|
21
|
+
<visible>false</visible>
|
22
|
+
<minimizable>true</minimizable>
|
23
|
+
<maximizable>true</maximizable>
|
24
|
+
<resizable>true</resizable>
|
25
|
+
<width>900</width>
|
26
|
+
<height>650</height>
|
27
|
+
<x>50</x>
|
28
|
+
<y>50</y>
|
29
|
+
<minSize>500 300</minSize>
|
30
|
+
<maxSize>1500 1000</maxSize>
|
31
|
+
</initialWindow>
|
64
32
|
</application>
|
@@ -1,26 +1,30 @@
|
|
1
1
|
<?xml version="1.0" encoding="utf-8"?>
|
2
|
-
<
|
3
|
-
|
4
|
-
|
5
|
-
|
2
|
+
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
|
3
|
+
xmlns:s="library://ns.adobe.com/flex/spark"
|
4
|
+
xmlns:fu="http://www.adobe.com/2009/flexUnitUIRunner"
|
5
|
+
creationComplete="creationCompleteHandler()">
|
6
6
|
|
7
|
-
<
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
7
|
+
<fx:Script>
|
8
|
+
<![CDATA[
|
9
|
+
import org.flexunit.internals.TraceListener;
|
10
|
+
import org.flexunit.listeners.AirCIListener;
|
11
|
+
import org.flexunit.listeners.UIListener;
|
12
|
+
import org.flexunit.runner.FlexUnitCore;
|
12
13
|
|
13
|
-
|
14
|
+
private var _core:FlexUnitCore;
|
14
15
|
|
15
|
-
|
16
|
-
|
17
|
-
|
16
|
+
protected function creationCompleteHandler():void
|
17
|
+
{
|
18
|
+
_core = new FlexUnitCore();
|
18
19
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
20
|
+
_core.addListener(new TraceListener());
|
21
|
+
_core.addListener(new AirCIListener());
|
22
|
+
_core.addListener(new UIListener(ui));
|
23
|
+
_core.run(AllTests);
|
24
|
+
}
|
25
|
+
]]>
|
26
|
+
</fx:Script>
|
25
27
|
|
26
|
-
|
28
|
+
<fu:TestRunnerBase id="ui" width="100%" height="100%"/>
|
29
|
+
|
30
|
+
</s:WindowedApplication>
|
data/lib/flexunit4/module.rb
CHANGED
@@ -5,7 +5,7 @@ module FlexUnit
|
|
5
5
|
# the intention is to have the Gem release match FlexUnit's Major Minor and
|
6
6
|
# Patch release numbers.
|
7
7
|
#
|
8
|
-
VERSION = '0.0.
|
8
|
+
VERSION = '0.0.9.pre'
|
9
9
|
ZIP = 'http://flexunit.org/releases/flexunit-4.1.0-8-4.1.0.16076.zip'
|
10
10
|
MD5 = '11b355d269be39c03e24aa1143ef4c1c'
|
11
11
|
end
|
@@ -34,7 +34,7 @@ class AIRProjectGeneratorTest < Test::Unit::TestCase
|
|
34
34
|
assert_matches '<s:Label text="SomeProject"', content
|
35
35
|
end
|
36
36
|
assert_file File.join(project, 'src', 'SomeProject-app.xml') do |content|
|
37
|
-
assert_matches '
|
37
|
+
assert_matches 'xmlns="http://ns.adobe.com/air/application/2.5"', content
|
38
38
|
end
|
39
39
|
assert_file File.join(project, 'src', 'SomeProjectRunner.mxml') do |content|
|
40
40
|
assert_matches /org.flexunit.runner.FlexUnitCore\b/, content
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: flexunit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease: 6
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.9.pre
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Simon Gregory
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-06-
|
13
|
+
date: 2011-06-05 00:00:00 +01:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -143,6 +143,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
143
143
|
requirements:
|
144
144
|
- - ">="
|
145
145
|
- !ruby/object:Gem::Version
|
146
|
+
hash: -2097053208915982117
|
147
|
+
segments:
|
148
|
+
- 0
|
146
149
|
version: "0"
|
147
150
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
148
151
|
none: false
|
@@ -152,7 +155,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
152
155
|
version: 1.3.7
|
153
156
|
requirements: []
|
154
157
|
|
155
|
-
rubyforge_project:
|
158
|
+
rubyforge_project:
|
156
159
|
rubygems_version: 1.6.2
|
157
160
|
signing_key:
|
158
161
|
specification_version: 3
|