flashsdk 1.0.1.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. data/Gemfile +9 -0
  2. data/README.textile +0 -0
  3. data/VERSION +1 -0
  4. data/bin/sprout-as3 +9 -0
  5. data/flashsdk.gemspec +23 -0
  6. data/lib/flashplayer/clix_flash_player.rb +91 -0
  7. data/lib/flashplayer/clix_wrapper.rb +22 -0
  8. data/lib/flashplayer/errors.rb +12 -0
  9. data/lib/flashplayer/log_file.rb +95 -0
  10. data/lib/flashplayer/mm_config.rb +96 -0
  11. data/lib/flashplayer/module.rb +50 -0
  12. data/lib/flashplayer/specification.rb +32 -0
  13. data/lib/flashplayer/task.legacy.rb +293 -0
  14. data/lib/flashplayer/task.rb +137 -0
  15. data/lib/flashplayer/trust.rb +45 -0
  16. data/lib/flashplayer.rb +8 -0
  17. data/lib/flashsdk/generators/class_generator.rb +43 -0
  18. data/lib/flashsdk/generators/flash_helper.rb +48 -0
  19. data/lib/flashsdk/generators/project_generator.rb +53 -0
  20. data/lib/flashsdk/generators/templates/ActionScript3Class.as +9 -0
  21. data/lib/flashsdk/generators/templates/ActionScript3MainClass.as +11 -0
  22. data/lib/flashsdk/generators/templates/DefaultProjectImage.png +0 -0
  23. data/lib/flashsdk/generators/templates/Gemfile +6 -0
  24. data/lib/flashsdk/generators/templates/rakefile.rb +17 -0
  25. data/lib/flashsdk/module.rb +9 -0
  26. data/lib/flashsdk/tasks/mxmlc.rb +687 -0
  27. data/lib/flashsdk/tasks/mxmlc_legacy.rb +135 -0
  28. data/lib/flashsdk.rb +12 -0
  29. data/lib/flex3.rb +53 -0
  30. data/lib/flex4.rb +58 -0
  31. data/rakefile.rb +20 -0
  32. data/test/fixtures/mxmlc/simple/SomeFile.as +11 -0
  33. data/test/unit/class_generator_test.rb +50 -0
  34. data/test/unit/flash_helper_test.rb +27 -0
  35. data/test/unit/flashplayer_test.rb +56 -0
  36. data/test/unit/log_file_test.rb +47 -0
  37. data/test/unit/mm_config_test.rb +74 -0
  38. data/test/unit/mxmlc_test.rb +45 -0
  39. data/test/unit/project_generator_test.rb +53 -0
  40. data/test/unit/task_test.rb +93 -0
  41. data/test/unit/test_helper.rb +16 -0
  42. data/test/unit/trust_test.rb +30 -0
  43. metadata +145 -0
@@ -0,0 +1,93 @@
1
+ require File.join(File.dirname(__FILE__), 'test_helper')
2
+
3
+ class TaskTest < Test::Unit::TestCase
4
+ include SproutTestCase
5
+
6
+ context "A FlashPlayerTask" do
7
+
8
+ setup do
9
+ # Force reload of the Specification on each
10
+ # test method b/c SproutTestCase calls
11
+ # Executable.clear_entities! but 'require'
12
+ # only runs once per VM run...
13
+ load 'flashplayer/specification.rb'
14
+ @swf = File.join(fixtures, 'AsUnit4.swf')
15
+ @missing_home = File.join(fixtures, 'missing_folder')
16
+ @config_path = File.join(@missing_home, 'fp_config', 'mm.cfg')
17
+ end
18
+
19
+ teardown do
20
+ remove_file @missing_home
21
+ end
22
+
23
+ =begin
24
+ should "wait for SWF even if clean system" do
25
+ # No creation of expected FlashPlayer folders...
26
+
27
+ FlashPlayer.stubs(:home).returns @missing_home
28
+ FlashPlayer::MMConfig.any_instance.stubs(:system_home).returns @missing_home
29
+ FlashPlayer::MMConfig.any_instance.stubs(:config_path).returns @config_path
30
+ FlashPlayer::MMConfig.any_instance.stubs(:user_confirmation?).returns false
31
+
32
+ as_a_mac_system do
33
+ t = flashplayer @swf
34
+ t.invoke
35
+ end
36
+ end
37
+ =end
38
+
39
+ should "work with swf as task name" do
40
+ t = flashplayer @swf
41
+ configure_task t
42
+ t.invoke
43
+ end
44
+
45
+ should "work with swf in block" do
46
+ t = flashplayer :run do |t|
47
+ t.input = @swf
48
+ end
49
+ file @swf
50
+ configure_task t
51
+ t.invoke
52
+ assert_equal @swf, t.input
53
+ end
54
+
55
+ should "work with swf as prerequisite" do
56
+ t = flashplayer :run => @swf
57
+ file @swf
58
+ configure_task t
59
+ t.invoke
60
+ assert_equal @swf, t.input
61
+ end
62
+
63
+ should "fire when declared as a dependency" do
64
+ t = flashplayer :run => @swf
65
+ file @swf
66
+ configure_task t
67
+ other = task :parent => :run
68
+ other.invoke
69
+ end
70
+ end
71
+
72
+ private
73
+
74
+ def configure_task t
75
+ t.logger = StringIO.new
76
+
77
+ # Comment following lines to really launch the player:
78
+ sys = FakeSystem.new
79
+ t.stubs(:current_system).returns sys
80
+ sys.expects(:open_flashplayer_with).returns Thread.new{}
81
+ end
82
+ end
83
+
84
+ class FakeSystem
85
+
86
+ def clean_path path
87
+ path
88
+ end
89
+
90
+ def open_flashplayer_with player, swf
91
+ end
92
+ end
93
+
@@ -0,0 +1,16 @@
1
+ require "rubygems"
2
+ require "bundler"
3
+
4
+ Bundler.setup :default, :development
5
+
6
+ # These require statments *must* be in this order:
7
+ # http://bit.ly/bCC0Ew
8
+ # Somewhat surprised they're not being required by Bundler...
9
+ require 'shoulda'
10
+ require 'mocha'
11
+ require 'test/unit'
12
+
13
+ require File.join(File.dirname(__FILE__), '..', '..', 'lib', 'flashsdk')
14
+ $:.unshift File.dirname(__FILE__)
15
+
16
+ require 'sprout/test/sprout_test_case'
@@ -0,0 +1,30 @@
1
+ require File.join(File.dirname(__FILE__), 'test_helper')
2
+
3
+ class TrustTest < Test::Unit::TestCase
4
+ include SproutTestCase
5
+
6
+ context "A Trust instance" do
7
+
8
+ setup do
9
+ @fixture = File.join fixtures, 'trust'
10
+ @file = File.join @fixture, 'trust.cfg'
11
+ @project = File.join fixtures, 'SomeProject'
12
+ @trust = FlashPlayer::Trust.new
13
+ @trust.logger = StringIO.new
14
+ @trust.stubs(:trust_file).returns @file
15
+ end
16
+
17
+ teardown do
18
+ remove_file @fixture
19
+ end
20
+
21
+ should "create and update trust config with provided path" do
22
+ @trust.add @project
23
+
24
+ assert_file @file do |content|
25
+ assert_matches File.expand_path(@project), content
26
+ end
27
+ end
28
+ end
29
+ end
30
+
metadata ADDED
@@ -0,0 +1,145 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: flashsdk
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: true
5
+ segments:
6
+ - 1
7
+ - 0
8
+ - 1
9
+ - pre
10
+ version: 1.0.1.pre
11
+ platform: ruby
12
+ authors:
13
+ - Luke Bayes
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2010-07-03 00:00:00 -07:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: sprout
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 1
29
+ - 0
30
+ - 15
31
+ - pre
32
+ version: 1.0.15.pre
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: *id001
36
+ - !ruby/object:Gem::Dependency
37
+ name: shoulda
38
+ requirement: &id002 !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ segments:
43
+ - 0
44
+ version: "0"
45
+ type: :development
46
+ prerelease: false
47
+ version_requirements: *id002
48
+ - !ruby/object:Gem::Dependency
49
+ name: mocha
50
+ requirement: &id003 !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ segments:
55
+ - 0
56
+ version: "0"
57
+ type: :development
58
+ prerelease: false
59
+ version_requirements: *id003
60
+ description: The Flash SDK Rubygem is brought to you by Project Sprouts (http://projectsprouts.org)
61
+ email: projectsprouts@googlegroups.com
62
+ executables:
63
+ - sprout-as3
64
+ extensions: []
65
+
66
+ extra_rdoc_files: []
67
+
68
+ files:
69
+ - bin/sprout-as3
70
+ - flashsdk.gemspec
71
+ - Gemfile
72
+ - lib/flashplayer/clix_flash_player.rb
73
+ - lib/flashplayer/clix_wrapper.rb
74
+ - lib/flashplayer/errors.rb
75
+ - lib/flashplayer/log_file.rb
76
+ - lib/flashplayer/mm_config.rb
77
+ - lib/flashplayer/module.rb
78
+ - lib/flashplayer/specification.rb
79
+ - lib/flashplayer/task.legacy.rb
80
+ - lib/flashplayer/task.rb
81
+ - lib/flashplayer/trust.rb
82
+ - lib/flashplayer.rb
83
+ - lib/flashsdk/generators/class_generator.rb
84
+ - lib/flashsdk/generators/flash_helper.rb
85
+ - lib/flashsdk/generators/project_generator.rb
86
+ - lib/flashsdk/generators/templates/ActionScript3Class.as
87
+ - lib/flashsdk/generators/templates/ActionScript3MainClass.as
88
+ - lib/flashsdk/generators/templates/DefaultProjectImage.png
89
+ - lib/flashsdk/generators/templates/Gemfile
90
+ - lib/flashsdk/generators/templates/rakefile.rb
91
+ - lib/flashsdk/module.rb
92
+ - lib/flashsdk/tasks/mxmlc.rb
93
+ - lib/flashsdk/tasks/mxmlc_legacy.rb
94
+ - lib/flashsdk.rb
95
+ - lib/flex3.rb
96
+ - lib/flex4.rb
97
+ - rakefile.rb
98
+ - README.textile
99
+ - test/fixtures/mxmlc/simple/SomeFile.as
100
+ - test/unit/class_generator_test.rb
101
+ - test/unit/flash_helper_test.rb
102
+ - test/unit/flashplayer_test.rb
103
+ - test/unit/log_file_test.rb
104
+ - test/unit/mm_config_test.rb
105
+ - test/unit/mxmlc_test.rb
106
+ - test/unit/project_generator_test.rb
107
+ - test/unit/task_test.rb
108
+ - test/unit/test_helper.rb
109
+ - test/unit/trust_test.rb
110
+ - VERSION
111
+ has_rdoc: true
112
+ homepage: http://www.adobe.com/products/flex
113
+ licenses: []
114
+
115
+ post_install_message:
116
+ rdoc_options: []
117
+
118
+ require_paths:
119
+ - lib
120
+ - lib
121
+ required_ruby_version: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - ">="
124
+ - !ruby/object:Gem::Version
125
+ segments:
126
+ - 0
127
+ version: "0"
128
+ required_rubygems_version: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - ">"
131
+ - !ruby/object:Gem::Version
132
+ segments:
133
+ - 1
134
+ - 3
135
+ - 1
136
+ version: 1.3.1
137
+ requirements: []
138
+
139
+ rubyforge_project:
140
+ rubygems_version: 1.3.6
141
+ signing_key:
142
+ specification_version: 3
143
+ summary: Adobe Flash SDK including mxmlc, compc, asdoc, adl, adt, optimizer and fdb
144
+ test_files: []
145
+