sprout 1.0.35.pre → 1.1.2.pre

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of sprout might be problematic. Click here for more details.

Files changed (234) hide show
  1. data/Gemfile +1 -1
  2. data/Gemfile.lock +0 -2
  3. data/README.textile +1 -1
  4. data/VERSION +1 -1
  5. data/lib/sprout/concern.rb +5 -7
  6. data/lib/sprout/daemon.rb +183 -143
  7. data/lib/sprout/executable/base.rb +564 -0
  8. data/lib/sprout/executable.rb +1 -550
  9. data/lib/sprout/generator/base.rb +2 -3
  10. data/lib/sprout/generator.rb +2 -1
  11. data/lib/sprout/generators/ruby/templates/ruby_base.rb +1 -2
  12. data/lib/sprout/library.rb +3 -3
  13. data/lib/sprout/output_buffer.rb +35 -0
  14. data/lib/sprout/process_runner.rb +68 -17
  15. data/lib/sprout/progress_bar.rb +5 -5
  16. data/lib/sprout/remote_file_target.rb +1 -1
  17. data/lib/sprout/system/base_system.rb +3 -3
  18. data/lib/sprout/system/unix_system.rb +1 -1
  19. data/lib/sprout/{test/sprout_test_case.rb → test_helper.rb} +214 -14
  20. data/lib/sprout/version.rb +1 -1
  21. data/lib/sprout.rb +133 -2
  22. data/rakefile.rb +2 -0
  23. data/test/fixtures/examples/echo_inputs.rb +1 -2
  24. data/test/fixtures/executable/fdb.rb +7 -9
  25. data/test/fixtures/executable/flex3sdk_gem/fdb +49 -18
  26. data/test/fixtures/executable/mxmlc.rb +1 -2
  27. data/test/fixtures/executable/subclass/executable_subclass.rb +0 -1
  28. data/test/fixtures/executable/subclass/executable_superclass.rb +1 -2
  29. data/test/fixtures/specification/flex4sdk.rb +35 -24
  30. data/test/unit/archive_unpacker_test.rb +1 -1
  31. data/test/unit/boolean_param_test.rb +1 -1
  32. data/test/unit/daemon_test.rb +35 -3
  33. data/test/unit/executable_option_parser_test.rb +2 -3
  34. data/test/unit/executable_param_test.rb +1 -1
  35. data/test/unit/executable_test.rb +8 -15
  36. data/test/unit/fake_other_executable.rb +1 -2
  37. data/test/unit/file_param_test.rb +1 -1
  38. data/test/unit/file_target_test.rb +1 -1
  39. data/test/unit/files_param_test.rb +1 -1
  40. data/test/unit/generator_generator_test.rb +1 -1
  41. data/test/unit/generator_test.rb +1 -1
  42. data/test/unit/library_generator_test.rb +1 -1
  43. data/test/unit/library_test.rb +1 -1
  44. data/test/unit/osx_system_test.rb +1 -1
  45. data/test/unit/path_param_test.rb +1 -1
  46. data/test/unit/paths_param_test.rb +1 -1
  47. data/test/unit/platform_test.rb +1 -1
  48. data/test/unit/process_runner_test.rb +1 -1
  49. data/test/unit/rdoc_parser_test.rb +1 -1
  50. data/test/unit/remote_file_loader_test.rb +1 -1
  51. data/test/unit/remote_file_target_test.rb +1 -1
  52. data/test/unit/ruby_feature_test.rb +1 -1
  53. data/test/unit/ruby_generator_test.rb +1 -1
  54. data/test/unit/specification_test.rb +8 -1
  55. data/test/unit/sprout_test.rb +2 -2
  56. data/test/unit/string_param_test.rb +1 -1
  57. data/test/unit/string_test.rb +1 -1
  58. data/test/unit/strings_param_test.rb +1 -1
  59. data/test/unit/test_helper.rb +33 -1
  60. data/test/unit/tool_generator_test.rb +1 -1
  61. data/test/unit/unix_system_test.rb +1 -1
  62. data/test/unit/user_test.rb +1 -1
  63. data/test/unit/vista_system_test.rb +1 -1
  64. data/test/unit/win_nix_system_test.rb +1 -1
  65. data/test/unit/win_system_test.rb +1 -1
  66. data/test-stderr.log +1 -0
  67. data/test-stdout.log +237 -0
  68. metadata +15 -190
  69. data/doc/Dir.html +0 -288
  70. data/doc/Rake/Task.html +0 -184
  71. data/doc/Sprout/ArchiveUnpacker.html +0 -1246
  72. data/doc/Sprout/Base/ClassMethods.html +0 -434
  73. data/doc/Sprout/Base.html +0 -126
  74. data/doc/Sprout/Concern.html +0 -353
  75. data/doc/Sprout/Daemon/ClassMethods.html +0 -244
  76. data/doc/Sprout/Daemon/InstanceMethods.html +0 -601
  77. data/doc/Sprout/Daemon.html +0 -166
  78. data/doc/Sprout/Errors/ArchiveUnpackerError.html +0 -125
  79. data/doc/Sprout/Errors/DestinationExistsError.html +0 -133
  80. data/doc/Sprout/Errors/DuplicateMemberError.html +0 -132
  81. data/doc/Sprout/Errors/ExecutableError.html +0 -125
  82. data/doc/Sprout/Errors/ExecutableRegistrationError.html +0 -132
  83. data/doc/Sprout/Errors/ExecutionError.html +0 -121
  84. data/doc/Sprout/Errors/GeneratorError.html +0 -125
  85. data/doc/Sprout/Errors/InvalidArgumentError.html +0 -132
  86. data/doc/Sprout/Errors/LoadError.html +0 -121
  87. data/doc/Sprout/Errors/MissingArgumentError.html +0 -132
  88. data/doc/Sprout/Errors/MissingExecutableError.html +0 -132
  89. data/doc/Sprout/Errors/MissingGeneratorError.html +0 -132
  90. data/doc/Sprout/Errors/MissingTemplateError.html +0 -132
  91. data/doc/Sprout/Errors/ProcessRunnerError.html +0 -121
  92. data/doc/Sprout/Errors/RemoteFileLoaderError.html +0 -110
  93. data/doc/Sprout/Errors/SproutError.html +0 -114
  94. data/doc/Sprout/Errors/UnknownArchiveType.html +0 -122
  95. data/doc/Sprout/Errors/UsageError.html +0 -121
  96. data/doc/Sprout/Errors/ValidationError.html +0 -121
  97. data/doc/Sprout/Errors/VersionRequirementNotMetError.html +0 -121
  98. data/doc/Sprout/Errors.html +0 -101
  99. data/doc/Sprout/Executable/Boolean.html +0 -483
  100. data/doc/Sprout/Executable/ClassMethods.html +0 -417
  101. data/doc/Sprout/Executable/CollectionParam.html +0 -483
  102. data/doc/Sprout/Executable/FileParam.html +0 -484
  103. data/doc/Sprout/Executable/Files.html +0 -292
  104. data/doc/Sprout/Executable/InstanceMethods.html +0 -2006
  105. data/doc/Sprout/Executable/Number.html +0 -141
  106. data/doc/Sprout/Executable/Param.html +0 -2818
  107. data/doc/Sprout/Executable/ParameterFactory.html +0 -232
  108. data/doc/Sprout/Executable/Path.html +0 -223
  109. data/doc/Sprout/Executable/Paths.html +0 -253
  110. data/doc/Sprout/Executable/StringParam.html +0 -213
  111. data/doc/Sprout/Executable/Strings.html +0 -167
  112. data/doc/Sprout/Executable/Url.html +0 -160
  113. data/doc/Sprout/Executable/Urls.html +0 -170
  114. data/doc/Sprout/Executable.html +0 -173
  115. data/doc/Sprout/FileTarget.html +0 -1109
  116. data/doc/Sprout/Generator/Base.html +0 -1626
  117. data/doc/Sprout/Generator/Command.html +0 -690
  118. data/doc/Sprout/Generator/DirectoryManifest.html +0 -476
  119. data/doc/Sprout/Generator/FileManifest.html +0 -572
  120. data/doc/Sprout/Generator/Manifest.html +0 -377
  121. data/doc/Sprout/Generator/TemplateManifest.html +0 -196
  122. data/doc/Sprout/Generator.html +0 -689
  123. data/doc/Sprout/GeneratorGenerator.html +0 -1018
  124. data/doc/Sprout/Library.html +0 -1141
  125. data/doc/Sprout/LibraryGenerator.html +0 -309
  126. data/doc/Sprout/Log.html +0 -496
  127. data/doc/Sprout/MXMLC.html +0 -6373
  128. data/doc/Sprout/Platform.html +0 -714
  129. data/doc/Sprout/ProcessRunner.html +0 -1352
  130. data/doc/Sprout/ProgressBar.html +0 -376
  131. data/doc/Sprout/ProgressBarImpl.html +0 -2119
  132. data/doc/Sprout/ProgressBarManager.html +0 -434
  133. data/doc/Sprout/ProgressBarOutputStream.html +0 -416
  134. data/doc/Sprout/RDocParser.html +0 -211
  135. data/doc/Sprout/RemoteFileLoader.html +0 -172
  136. data/doc/Sprout/RemoteFileTarget.html +0 -679
  137. data/doc/Sprout/ReversedProgressBar.html +0 -194
  138. data/doc/Sprout/RubyFeature/ClassMethods.html +0 -1065
  139. data/doc/Sprout/RubyFeature.html +0 -155
  140. data/doc/Sprout/RubyGenerator.html +0 -764
  141. data/doc/Sprout/Specification.html +0 -767
  142. data/doc/Sprout/System/BaseSystem.html +0 -1455
  143. data/doc/Sprout/System/JavaSystem.html +0 -122
  144. data/doc/Sprout/System/OSXSystem.html +0 -335
  145. data/doc/Sprout/System/ThreadMock.html +0 -193
  146. data/doc/Sprout/System/UnixSystem.html +0 -584
  147. data/doc/Sprout/System/VistaSystem.html +0 -251
  148. data/doc/Sprout/System/WinNixSystem.html +0 -325
  149. data/doc/Sprout/System/WinSystem.html +0 -571
  150. data/doc/Sprout/System.html +0 -191
  151. data/doc/Sprout/ToolGenerator.html +0 -931
  152. data/doc/Sprout/VERSION.html +0 -128
  153. data/doc/Sprout.html +0 -144
  154. data/doc/SproutTestCase.html +0 -1412
  155. data/doc/String.html +0 -286
  156. data/doc/_index.html +0 -1035
  157. data/doc/class_list.html +0 -36
  158. data/doc/css/common.css +0 -1
  159. data/doc/css/full_list.css +0 -53
  160. data/doc/css/style.css +0 -310
  161. data/doc/file.README.html +0 -96
  162. data/doc/file.archive_unpacker.html +0 -288
  163. data/doc/file.base.html +0 -208
  164. data/doc/file.base_system.html +0 -278
  165. data/doc/file.boolean.html +0 -135
  166. data/doc/file.collection_param.html +0 -139
  167. data/doc/file.command.html +0 -126
  168. data/doc/file.concern.html +0 -136
  169. data/doc/file.daemon.html +0 -309
  170. data/doc/file.dir.html +0 -76
  171. data/doc/file.directory_manifest.html +0 -122
  172. data/doc/file.errors.html +0 -147
  173. data/doc/file.executable.html +0 -638
  174. data/doc/file.file_manifest.html +0 -109
  175. data/doc/file.file_param.html +0 -120
  176. data/doc/file.file_target.html +0 -140
  177. data/doc/file.files.html +0 -85
  178. data/doc/file.generator.html +0 -296
  179. data/doc/file.generator_class.html +0 -72
  180. data/doc/file.generator_generator.html +0 -137
  181. data/doc/file.generator_test.html +0 -92
  182. data/doc/file.generator_test_helper.html +0 -67
  183. data/doc/file.java_system.html +0 -62
  184. data/doc/file.library.html +0 -291
  185. data/doc/file.library_generator.html +0 -74
  186. data/doc/file.log.html +0 -100
  187. data/doc/file.manifest.html +0 -67
  188. data/doc/file.mxmlc.html +0 -740
  189. data/doc/file.number.html +0 -67
  190. data/doc/file.osx_system.html +0 -79
  191. data/doc/file.param.html +0 -491
  192. data/doc/file.parameter_factory.html +0 -119
  193. data/doc/file.path.html +0 -81
  194. data/doc/file.paths.html +0 -80
  195. data/doc/file.platform.html +0 -124
  196. data/doc/file.process_runner.html +0 -224
  197. data/doc/file.progress_bar.html +0 -390
  198. data/doc/file.rdoc_parser.html +0 -145
  199. data/doc/file.remote_file_loader.html +0 -117
  200. data/doc/file.remote_file_target.html +0 -176
  201. data/doc/file.ruby_base.html +0 -64
  202. data/doc/file.ruby_feature.html +0 -244
  203. data/doc/file.ruby_generator.html +0 -118
  204. data/doc/file.ruby_input.html +0 -62
  205. data/doc/file.ruby_test_case.html +0 -78
  206. data/doc/file.ruby_test_helper.html +0 -61
  207. data/doc/file.specification.html +0 -248
  208. data/doc/file.sprout.html +0 -64
  209. data/doc/file.sprout_test_case.html +0 -280
  210. data/doc/file.string.html +0 -72
  211. data/doc/file.string_param.html +0 -76
  212. data/doc/file.strings.html +0 -71
  213. data/doc/file.system.html +0 -86
  214. data/doc/file.template_manifest.html +0 -67
  215. data/doc/file.tool.html +0 -92
  216. data/doc/file.tool_generator.html +0 -90
  217. data/doc/file.unix_system.html +0 -128
  218. data/doc/file.url.html +0 -71
  219. data/doc/file.urls.html +0 -70
  220. data/doc/file.version.html +0 -71
  221. data/doc/file.vista_system.html +0 -69
  222. data/doc/file.win_nix_system.html +0 -88
  223. data/doc/file.win_system.html +0 -129
  224. data/doc/file_list.html +0 -230
  225. data/doc/frames.html +0 -13
  226. data/doc/index.html +0 -96
  227. data/doc/js/app.js +0 -202
  228. data/doc/js/full_list.js +0 -149
  229. data/doc/js/jquery.js +0 -154
  230. data/doc/method_list.html +0 -3355
  231. data/doc/top-level-namespace.html +0 -192
  232. data/lib/sprout/base.rb +0 -121
  233. data/lib/sprout/log.rb +0 -46
  234. data/test/unit/sprout_test_helper.rb +0 -33
data/lib/sprout.rb CHANGED
@@ -1,9 +1,140 @@
1
+
1
2
  lib = File.expand_path File.dirname(__FILE__)
2
3
  $:.unshift lib unless $:.include?(lib)
3
4
 
4
- require 'sprout/base'
5
+ # External tools and std libs:
6
+ require 'rake'
7
+ require 'delegate'
8
+ require 'logger'
9
+
10
+ # Core, Process and Platform support:
11
+ require 'sprout/version'
12
+ require 'sprout/output_buffer'
13
+ require 'sprout/progress_bar'
14
+ require 'sprout/dir'
15
+ require 'sprout/string'
16
+ require 'sprout/errors'
17
+ require 'sprout/platform'
18
+ require 'sprout/process_runner'
19
+ require 'sprout/system'
20
+ require 'sprout/concern'
21
+ require 'sprout/ruby_feature'
22
+
23
+ ##
24
+ # This is a fix for Issue #106
25
+ # http://code.google.com/p/projectsprouts/issues/detail?id=106
26
+ # Which is created because the new version (1.0.1) of RubyGems
27
+ # includes open-uri, while older versions do not.
28
+ # When open-uri is included twice, we get a bunch of nasty
29
+ # warnings because constants are being overwritten.
30
+ gem_version = Gem::Version.new(Gem::RubyGemsVersion)
31
+ if(gem_version != Gem::Version.new('1.0.1'))
32
+ require 'open-uri'
33
+ end
34
+
35
+ # File, Archive and Network support:
36
+ require 'sprout/archive_unpacker'
37
+ require 'sprout/file_target'
38
+ require 'sprout/remote_file_loader'
39
+ require 'sprout/remote_file_target'
40
+
41
+ # External Packaging and distribution support:
42
+ require 'sprout/rdoc_parser'
43
+ require 'sprout/specification'
44
+ require 'sprout/executable'
45
+ require 'sprout/daemon'
46
+
47
+ # Generators
48
+ require 'sprout/generator'
49
+
50
+ # Libraries
51
+ require 'sprout/library'
5
52
 
6
53
  module Sprout
7
- include Base
54
+
55
+ class << self
56
+
57
+ ##
58
+ # @return [Dir] The system-specific path to the writeable cache directory
59
+ # where Sprouts will look for downloaded archives.
60
+ #
61
+ # puts ">> Sprout Cache: #{Sprout.cache}"
62
+ #
63
+ def cache
64
+ File.join(home, 'cache')
65
+ end
66
+
67
+ ##
68
+ # @return [Dir] The location where the currently-running version of Sprouts
69
+ # will write files and generators and their templates.
70
+ #
71
+ # puts ">> Sprout home: #{Sprout.home}"
72
+ #
73
+ def home
74
+ File.join(current_system.application_home('sprouts'), Sprout::VERSION::MAJOR_MINOR)
75
+ end
76
+
77
+ ##
78
+ # @return [Dir] The location where Sprouts will look for generators and their
79
+ # templates.
80
+ #
81
+ # puts ">> Generator Cache: #{Sprout.generator_cache}"
82
+ #
83
+ def generator_cache
84
+ File.join cache, 'generators'
85
+ end
86
+
87
+ ##
88
+ # @return [Sprout::System] That is currently being used to
89
+ # determine features like the cache path and how external processes
90
+ # are executed.
91
+ #
92
+ # system = Sprout.current_system
93
+ # puts ">> System: #{system.inspect}"
94
+ #
95
+ def current_system
96
+ Sprout::System.create
97
+ end
98
+
99
+ def stdout=(out)
100
+ @stdout = out
101
+ end
102
+
103
+ def stdout
104
+ @stdout ||= $stdout
105
+ end
106
+
107
+ def stdout_test
108
+ OutputBuffer.new 'test-stdout.log'
109
+ end
110
+
111
+ def stderr=(err)
112
+ @stderr = err
113
+ end
114
+
115
+ def stderr
116
+ @stderr ||= $stderr
117
+ end
118
+
119
+ def stderr_test
120
+ OutputBuffer.new 'test-stderr.log'
121
+ end
122
+
123
+ ##
124
+ # @return [File] Path to the file from the 'caller' property of
125
+ # a Ruby exception.
126
+ #
127
+ # Note: It's a real bummer that this string is colon delimited -
128
+ # The value on Windows often includes a colon...
129
+ # Once again, Windows is dissed by fundamental Ruby decisions.
130
+ def file_from_caller caller_string
131
+ parts = caller_string.split(':')
132
+ str = parts.shift
133
+ while(parts.size > 0 && !File.exists?(str))
134
+ str << ":#{parts.shift}"
135
+ end
136
+ str
137
+ end
138
+ end
8
139
  end
9
140
 
data/rakefile.rb CHANGED
@@ -18,6 +18,8 @@ require 'rake/testtask'
18
18
  # yard
19
19
  #
20
20
 
21
+ CLEAN.add 'doc'
22
+
21
23
  namespace :test do
22
24
  Rake::TestTask.new(:units) do |t|
23
25
  t.libs << "test/unit"
@@ -5,8 +5,7 @@ require 'sprout'
5
5
 
6
6
  class CustomParameter < Sprout::Executable::Param; end
7
7
 
8
- class EchoInputs
9
- include Sprout::Executable
8
+ class EchoInputs < Sprout::Executable::Base
10
9
 
11
10
  ##
12
11
  # A boolean parameter that will be set to true if present.
@@ -1,11 +1,7 @@
1
1
 
2
2
  module Sprout
3
3
 
4
- class FDB
5
-
6
- ####################################
7
- # Begin Executable Configuration
8
- include Executable
4
+ class FDB < Daemon
9
5
 
10
6
  set :default_prefix, '-'
11
7
 
@@ -21,12 +17,14 @@ module Sprout
21
17
  # The default executable target
22
18
  set :executable, :fdb
23
19
 
24
- ####################################
25
- # Begin Daemon Configuration
26
- include Daemon
27
-
20
+ ##
21
+ # The regex for when input can be accepted again.
28
22
  set :prompt, /^\(fdb\) |\(y or n\) /
29
23
 
24
+ ##
25
+ # Force the fake to write to stderr:
26
+ add_action :run_with_error
27
+
30
28
  ##
31
29
  # Print a backtrace of all stack frames
32
30
  add_action :backtrace
@@ -13,22 +13,33 @@ class FakeFDB
13
13
  def gather_input
14
14
  $stdout.flush
15
15
  command = $stdin.gets.chomp!
16
- if command == "run"
17
- handle_run
18
- elsif command == "continue"
19
- handle_continue
20
- elsif command == "kill"
21
- handle_kill
22
- elsif command == "quit"
23
- handle_quit
16
+ parts = command.split(' ')
17
+ name = parts.shift
18
+
19
+ case name
20
+ when "run"
21
+ handle_run parts
22
+ when "break"
23
+ handle_break parts
24
+ when "continue"
25
+ handle_continue parts
26
+ when "kill"
27
+ handle_kill parts
28
+ when "y"
29
+ handle_confirmation parts
30
+ when "quit"
31
+ handle_quit parts
32
+ when "run_with_error"
33
+ handle_run_with_error parts
24
34
  else
25
- puts ""
26
- raise "Don't know how to respond to #{command}"
35
+ puts "FAKE FDB doesn't know how to respond to #{command}"
36
+ exit 1
27
37
  end
38
+
28
39
  gather_input
29
40
  end
30
41
 
31
- def handle_run
42
+ def handle_run args
32
43
  str = "Waiting for Player to connect\n"
33
44
  str << "Player connected; session starting.\n"
34
45
  str << "Set breakpoints and then type 'continue' to resume the session.\n"
@@ -37,24 +48,44 @@ class FakeFDB
37
48
  printf str
38
49
  end
39
50
 
40
- def handle_continue
51
+ def handle_break args
41
52
  str = "Breakpoint 1, AsUnitRunner() at AsUnitRunner.as:12\n"
42
53
  str << "12 core = new TextCore();\n"
43
54
  str << "(fdb) "
44
55
  printf str
45
56
  end
46
57
 
47
- def handle_kill
58
+ def handle_continue args
59
+ str = "Continuing now\n"
60
+ str << "(fdb) "
61
+ printf str
62
+ end
63
+
64
+ def handle_kill args
48
65
  printf "Kill the program being debugged? (y or n) "
49
66
  end
50
67
 
51
- def handle_quit
52
- puts ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
53
- puts ">> EXITING NOW!"
54
- exit
68
+ def handle_confirmation args
69
+ str = "Confirmation accepted\n"
70
+ str << "(fdb) "
71
+ printf str
72
+ end
73
+
74
+ def handle_run_with_error args
75
+ str = "This is an error!\n"
76
+ str << "This is more details about the error!\n"
77
+ str << "Here are even more details!\n"
78
+ $stderr.printf str
79
+ printf "(fdb) "
80
+ end
81
+
82
+ def handle_quit args
83
+ str << ">> EXITING NOW!\n"
84
+ puts str
85
+ exit! 0
55
86
  end
56
87
 
57
88
  end
58
89
 
59
- fdb = FakeFDB.new
90
+ fake_fdb = FakeFDB.new
60
91
 
@@ -33,8 +33,7 @@ module Sprout
33
33
  # Interface and descriptions found here:
34
34
  # http://livedocs.adobe.com/flex/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00001481.html
35
35
  #
36
- class MXMLC
37
- include Sprout::Executable
36
+ class MXMLC < Sprout::Executable::Base
38
37
 
39
38
  ##
40
39
  # Enables accessibility features when compiling the Flex application or SWC file. The default value is false.
@@ -1,6 +1,5 @@
1
1
 
2
2
  class ExecutableSubclass < ExecutableSuperclass
3
- include Sprout::Executable
4
3
 
5
4
  add_param :subclass_param, String
6
5
  end
@@ -1,6 +1,5 @@
1
1
 
2
- class ExecutableSuperclass
3
- include Sprout::Executable
2
+ class ExecutableSuperclass < Sprout::Executable::Base
4
3
 
5
4
  set :default_prefix, '---'
6
5
 
@@ -1,31 +1,42 @@
1
- # This is a sample Sprout Specification.
2
- #
3
- # This document describes the Flex 4 SDK in terms of the libraries and executables
4
- # that is provides.
5
- #
6
- # Whenever this file is loaded (required) by a Ruby application that has already loaded
7
- # the core sprout files, the remote_file_target will be downloaded and installed,
8
- # and each executable and library will be available to any interested rake
9
- # tasks.
10
- #
11
- # An example of how one might retrieve a path to the downloaded MXMLC executable is
12
- # as follows:
13
- #
14
- # Sprout.get_executable :mxmlc, 'flex4sdk', '>= 4.0.pre'
15
- #
16
- Sprout::Specification.new do |s|
17
1
 
18
- s.name = 'flex4sdk'
19
- s.version = '4.0.pre'
2
+ Sprout::Specification.new do |s|
3
+ # This is the Specification that loads the Flex 4 SDK,
4
+ # To use the Flex 4 SDK from your build tasks, you can
5
+ # simply update the pkg_name parameter of your build
6
+ # task as follows:
7
+ #
8
+ # mxmlc 'bin/SomeProject.swf' do |t|
9
+ # t.input = 'src/SomeProject.as'
10
+ # t.pkg_name = 'flex4'
11
+ # end
12
+ #
13
+ # If you'd like to consume any of the libraries that
14
+ # are included with the Flex SDK, you can embed them
15
+ # from your Rakefile as follows:
16
+ #
17
+ # library :f_textlayout
18
+ #
19
+ # mxmlc 'bin/SomeProject.swf' => :f_textlayout do |t|
20
+ # t.input = 'src/SomeProject.as'
21
+ # end
22
+ #
23
+ # If you'd like to consume one of the localized frameworks
24
+ # you can set that up as follows:
25
+ #
26
+ # library 'flex_4_es_ES'
27
+ #
28
+ # mxmlc 'bin/SomeProject.swf' => 'flex_4_es_ES' do |t|
29
+ # t.input = 'src/SomeProject.as'
30
+ # end
31
+ #
32
+ s.name = 'flex4'
33
+ s.version = '4.1.0.16076'
20
34
 
21
35
  s.add_remote_file_target do |t|
22
- # Apply the windows-specific configuration:
23
- t.platform = :universal
24
- # Apply the shared platform configuration:
25
- # Remote Archive:
36
+ t.platform = :universal
26
37
  t.archive_type = :zip
27
- t.url = "http://download.macromedia.com/pub/labs/flex/4/flex4sdk_b2_100509.zip"
28
- t.md5 = "6a0838c5cb33145fe88933778ddb966d"
38
+ t.url = "http://fpdownload.adobe.com/pub/flex/sdk/builds/flex4/flex_sdk_4.1.0.16076.zip"
39
+ t.md5 = "4c5f3d3fa4e1f5be244679210cd852c0"
29
40
 
30
41
  # Executables: (add .exe suffix if it was passed in)
31
42
  t.add_executable :aasdoc, "bin/aasdoc"
@@ -1,7 +1,7 @@
1
1
  require 'test_helper'
2
2
 
3
3
  class ArchiveUnpackerTest < Test::Unit::TestCase
4
- include SproutTestCase
4
+ include Sprout::TestHelper
5
5
 
6
6
  def setup
7
7
  super
@@ -1,7 +1,7 @@
1
1
  require 'test_helper'
2
2
 
3
3
  class BooleanParamTest < Test::Unit::TestCase
4
- include SproutTestCase
4
+ include Sprout::TestHelper
5
5
 
6
6
  context "a new, simple BooleanParam" do
7
7
 
@@ -2,18 +2,20 @@ require 'test_helper'
2
2
  require 'fixtures/executable/fdb'
3
3
 
4
4
  class DaemonTest < Test::Unit::TestCase
5
- include SproutTestCase
5
+ include Sprout::TestHelper
6
6
 
7
7
  context "a new daemon delegate" do
8
8
 
9
9
  setup do
10
- # Uncomment to see actual output:
11
- #Sprout::Log.debug = false
12
10
  configure_fdb_fake
13
11
  end
14
12
 
15
13
  should "execute without shell params" do
16
14
  @fdb = Sprout::FDB.new
15
+ # For some reason, using mocha expectations are
16
+ # actually stubbing the methods and breaking this
17
+ # test. Not sure what I'm doing wrong here...
18
+ #@fdb.expects(:execute_action).at_least(6)
17
19
  @fdb.run
18
20
  @fdb.break "AsUnitRunner:12"
19
21
  @fdb.continue
@@ -23,6 +25,36 @@ class DaemonTest < Test::Unit::TestCase
23
25
  @fdb.execute
24
26
  end
25
27
 
28
+ should "open and wait for real-time interactions" do
29
+ @fdb = Sprout::FDB.new
30
+ # For some reason, using mocha expectations are
31
+ # actually stubbing the methods and breaking this
32
+ # test. Not sure what I'm doing wrong here...
33
+ #@fdb.expects(:execute_action).at_least(6)
34
+ @fdb.execute false
35
+ @fdb.run
36
+ @fdb.break "AsUnitRunner:12"
37
+ @fdb.continue
38
+ @fdb.kill
39
+ @fdb.confirm
40
+ @fdb.quit
41
+ @fdb.wait # wait for actions to finish.
42
+ end
43
+
44
+ =begin
45
+ should "print errors" do
46
+ @fdb = Sprout::FDB.new
47
+ # For some reason, using mocha expectations are
48
+ # actually stubbing the methods and breaking this
49
+ # test. Not sure what I'm doing wrong here...
50
+ #@fdb.expects(:execute_action).at_least(6)
51
+ @fdb.execute false
52
+ @fdb.run_with_error
53
+ @fdb.quit
54
+ @fdb.wait # wait for actions to finish.
55
+ end
56
+ =end
57
+
26
58
  should "execute from rake task" do
27
59
  f = fdb :fdb_debug do |t|
28
60
  t.run
@@ -2,7 +2,7 @@ require 'test_helper'
2
2
  require 'fixtures/examples/echo_inputs'
3
3
 
4
4
  class ExecutableOptionParserTest < Test::Unit::TestCase
5
- include SproutTestCase
5
+ include Sprout::TestHelper
6
6
 
7
7
  context "a new ruby executable" do
8
8
 
@@ -109,8 +109,7 @@ class ExecutableOptionParserTest < Test::Unit::TestCase
109
109
 
110
110
  # Define the class in a place
111
111
  # where only these tests can use it.
112
- class SomeExecutable
113
- include Sprout::Executable
112
+ class SomeExecutable < Sprout::Executable::Base
114
113
  add_param :debug, Boolean
115
114
  add_param :input, String, { :hidden_name => true }
116
115
  end
@@ -1,7 +1,7 @@
1
1
  require 'test_helper'
2
2
 
3
3
  class ExecutableParamTest < Test::Unit::TestCase
4
- include SproutTestCase
4
+ include Sprout::TestHelper
5
5
 
6
6
  context "a new, simple Executable::Param" do
7
7
 
@@ -5,7 +5,7 @@ require 'fixtures/executable/subclass/executable_superclass'
5
5
  require 'fixtures/executable/subclass/executable_subclass'
6
6
 
7
7
  class ExecutableTest < Test::Unit::TestCase
8
- include SproutTestCase
8
+ include Sprout::TestHelper
9
9
 
10
10
  context "a new executable delegate" do
11
11
 
@@ -74,8 +74,7 @@ class ExecutableTest < Test::Unit::TestCase
74
74
 
75
75
  should "raise UsageError with unknown type" do
76
76
  assert_raises Sprout::Errors::UsageError do
77
- class BrokenExecutable
78
- include Sprout::Executable
77
+ class BrokenExecutable < Sprout::Executable::Base
79
78
  add_param :broken_param, nil
80
79
  end
81
80
 
@@ -85,8 +84,7 @@ class ExecutableTest < Test::Unit::TestCase
85
84
 
86
85
  should "raise Error if type is not a Class" do
87
86
  assert_raises Sprout::Errors::UsageError do
88
- class BrokenExecutable2
89
- include Sprout::Executable
87
+ class BrokenExecutable2 < Sprout::Executable::Base
90
88
  add_param :some_name, :string
91
89
  end
92
90
  end
@@ -94,8 +92,7 @@ class ExecutableTest < Test::Unit::TestCase
94
92
 
95
93
  should "raise Error when requested param name already exists" do
96
94
  assert_raises Sprout::Errors::DuplicateMemberError do
97
- class BrokenExecutable3
98
- include Sprout::Executable
95
+ class BrokenExecutable3 < Sprout::Executable::Base
99
96
  attr_accessor :existing_method
100
97
 
101
98
  add_param :existing_method, String
@@ -105,8 +102,7 @@ class ExecutableTest < Test::Unit::TestCase
105
102
 
106
103
  should "raise Error if a block is provided to add_param" do
107
104
  assert_raises Sprout::Errors::UsageError do
108
- class BrokenExecutable4
109
- include Sprout::Executable
105
+ class BrokenExecutable4 < Sprout::Executable::Base
110
106
  add_param :name, String do
111
107
  # this is no longer how it's done...
112
108
  end
@@ -115,8 +111,7 @@ class ExecutableTest < Test::Unit::TestCase
115
111
  end
116
112
 
117
113
  should "define a new method" do
118
- class WorkingTool
119
- include Sprout::Executable
114
+ class WorkingTool < Sprout::Executable::Base
120
115
  add_param :custom_name, String
121
116
  end
122
117
 
@@ -130,8 +125,7 @@ class ExecutableTest < Test::Unit::TestCase
130
125
  end
131
126
 
132
127
  should "accept custom reader" do
133
- class WorkingTool
134
- include Sprout::Executable
128
+ class WorkingTool < Sprout::Executable::Base
135
129
  add_param :custom1, String, { :reader => :read_custom }
136
130
  def read_custom
137
131
  "#{@custom1} world"
@@ -144,8 +138,7 @@ class ExecutableTest < Test::Unit::TestCase
144
138
  end
145
139
 
146
140
  should "accept custom writer" do
147
- class WorkingTool
148
- include Sprout::Executable
141
+ class WorkingTool < Sprout::Executable::Base
149
142
  add_param :custom2, String, { :writer => :write_custom }
150
143
  def write_custom(value)
151
144
  @custom2 = "#{value} world"
@@ -1,8 +1,7 @@
1
1
 
2
2
  class CustomFakeParameter < Sprout::Executable::StringParam; end
3
3
 
4
- class FakeOtherExecutableTask
5
- include Sprout::Executable
4
+ class FakeOtherExecutableTask < Sprout::Executable::Base
6
5
 
7
6
  add_param :boolean_param, Boolean
8
7
  add_param :custom_param, CustomFakeParameter
@@ -1,7 +1,7 @@
1
1
  require 'test_helper'
2
2
 
3
3
  class FileParamTest < Test::Unit::TestCase
4
- include SproutTestCase
4
+ include Sprout::TestHelper
5
5
 
6
6
  context "a new FileParam" do
7
7
 
@@ -1,7 +1,7 @@
1
1
  require 'test_helper'
2
2
 
3
3
  class FileTargetTest < Test::Unit::TestCase
4
- include SproutTestCase
4
+ include Sprout::TestHelper
5
5
 
6
6
  context "a file target" do
7
7
  setup do
@@ -1,7 +1,7 @@
1
1
  require 'test_helper'
2
2
 
3
3
  class FilesParamTest < Test::Unit::TestCase
4
- include SproutTestCase
4
+ include Sprout::TestHelper
5
5
 
6
6
  context "a new FilesParam" do
7
7
 
@@ -3,7 +3,7 @@ require 'test_helper'
3
3
  require 'sprout/generators/generator/generator_generator'
4
4
 
5
5
  class GeneratorGeneratorTest < Test::Unit::TestCase
6
- include SproutTestCase
6
+ include Sprout::TestHelper
7
7
 
8
8
  context "A new generator generator" do
9
9
 
@@ -1,7 +1,7 @@
1
1
  require 'test_helper'
2
2
 
3
3
  class GeneratorTest < Test::Unit::TestCase
4
- include SproutTestCase
4
+ include Sprout::TestHelper
5
5
 
6
6
  context "The Sprout::Generator" do
7
7
 
@@ -2,7 +2,7 @@ require 'test_helper'
2
2
  require 'sprout/generators/library/library_generator'
3
3
 
4
4
  class LibraryGeneratorTest < Test::Unit::TestCase
5
- include SproutTestCase
5
+ include Sprout::TestHelper
6
6
 
7
7
  context "A generated library" do
8
8
 
@@ -1,7 +1,7 @@
1
1
  require 'test_helper'
2
2
 
3
3
  class LibraryTest < Test::Unit::TestCase
4
- include SproutTestCase
4
+ include Sprout::TestHelper
5
5
 
6
6
  context "a new archive library" do
7
7
  setup do
@@ -1,7 +1,7 @@
1
1
  require 'test_helper'
2
2
 
3
3
  class OSXSystemTest < Test::Unit::TestCase
4
- include SproutTestCase
4
+ include Sprout::TestHelper
5
5
 
6
6
  context "new osx system" do
7
7
 
@@ -1,7 +1,7 @@
1
1
  require 'test_helper'
2
2
 
3
3
  class PathParamTest < Test::Unit::TestCase
4
- include SproutTestCase
4
+ include Sprout::TestHelper
5
5
 
6
6
  context "a new PathParam" do
7
7