sprout 1.0.32.pre → 1.0.35.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 (208) hide show
  1. data/Gemfile +2 -1
  2. data/Gemfile.lock +4 -2
  3. data/README.textile +12 -13
  4. data/VERSION +1 -0
  5. data/doc/Dir.html +288 -0
  6. data/doc/Rake/Task.html +184 -0
  7. data/doc/Sprout.html +144 -0
  8. data/doc/Sprout/ArchiveUnpacker.html +1246 -0
  9. data/doc/Sprout/Base.html +126 -0
  10. data/doc/Sprout/Base/ClassMethods.html +434 -0
  11. data/doc/Sprout/Concern.html +353 -0
  12. data/doc/Sprout/Daemon.html +166 -0
  13. data/doc/Sprout/Daemon/ClassMethods.html +244 -0
  14. data/doc/Sprout/Daemon/InstanceMethods.html +601 -0
  15. data/doc/Sprout/Errors.html +101 -0
  16. data/doc/Sprout/Errors/ArchiveUnpackerError.html +125 -0
  17. data/doc/Sprout/Errors/DestinationExistsError.html +133 -0
  18. data/doc/Sprout/Errors/DuplicateMemberError.html +132 -0
  19. data/doc/Sprout/Errors/ExecutableError.html +125 -0
  20. data/doc/Sprout/Errors/ExecutableRegistrationError.html +132 -0
  21. data/doc/Sprout/Errors/ExecutionError.html +121 -0
  22. data/doc/Sprout/Errors/GeneratorError.html +125 -0
  23. data/doc/Sprout/Errors/InvalidArgumentError.html +132 -0
  24. data/doc/Sprout/Errors/LoadError.html +121 -0
  25. data/doc/Sprout/Errors/MissingArgumentError.html +132 -0
  26. data/doc/Sprout/Errors/MissingExecutableError.html +132 -0
  27. data/doc/Sprout/Errors/MissingGeneratorError.html +132 -0
  28. data/doc/Sprout/Errors/MissingTemplateError.html +132 -0
  29. data/doc/Sprout/Errors/ProcessRunnerError.html +121 -0
  30. data/doc/Sprout/Errors/RemoteFileLoaderError.html +110 -0
  31. data/doc/Sprout/Errors/SproutError.html +114 -0
  32. data/doc/Sprout/Errors/UnknownArchiveType.html +122 -0
  33. data/doc/Sprout/Errors/UsageError.html +121 -0
  34. data/doc/Sprout/Errors/ValidationError.html +121 -0
  35. data/doc/Sprout/Errors/VersionRequirementNotMetError.html +121 -0
  36. data/doc/Sprout/Executable.html +173 -0
  37. data/doc/Sprout/Executable/Boolean.html +483 -0
  38. data/doc/Sprout/Executable/ClassMethods.html +417 -0
  39. data/doc/Sprout/Executable/CollectionParam.html +483 -0
  40. data/doc/Sprout/Executable/FileParam.html +484 -0
  41. data/doc/Sprout/Executable/Files.html +292 -0
  42. data/doc/Sprout/Executable/InstanceMethods.html +2006 -0
  43. data/doc/Sprout/Executable/Number.html +141 -0
  44. data/doc/Sprout/Executable/Param.html +2818 -0
  45. data/doc/Sprout/Executable/ParameterFactory.html +232 -0
  46. data/doc/Sprout/Executable/Path.html +223 -0
  47. data/doc/Sprout/Executable/Paths.html +253 -0
  48. data/doc/Sprout/Executable/StringParam.html +213 -0
  49. data/doc/Sprout/Executable/Strings.html +167 -0
  50. data/doc/Sprout/Executable/Url.html +160 -0
  51. data/doc/Sprout/Executable/Urls.html +170 -0
  52. data/doc/Sprout/FileTarget.html +1109 -0
  53. data/doc/Sprout/Generator.html +689 -0
  54. data/doc/Sprout/Generator/Base.html +1626 -0
  55. data/doc/Sprout/Generator/Command.html +690 -0
  56. data/doc/Sprout/Generator/DirectoryManifest.html +476 -0
  57. data/doc/Sprout/Generator/FileManifest.html +572 -0
  58. data/doc/Sprout/Generator/Manifest.html +377 -0
  59. data/doc/Sprout/Generator/TemplateManifest.html +196 -0
  60. data/doc/Sprout/GeneratorGenerator.html +1018 -0
  61. data/doc/Sprout/Library.html +1141 -0
  62. data/doc/Sprout/LibraryGenerator.html +309 -0
  63. data/doc/Sprout/Log.html +496 -0
  64. data/doc/Sprout/MXMLC.html +6373 -0
  65. data/doc/Sprout/Platform.html +714 -0
  66. data/doc/Sprout/ProcessRunner.html +1352 -0
  67. data/doc/Sprout/ProgressBar.html +376 -0
  68. data/doc/Sprout/ProgressBarImpl.html +2119 -0
  69. data/doc/Sprout/ProgressBarManager.html +434 -0
  70. data/doc/Sprout/ProgressBarOutputStream.html +416 -0
  71. data/doc/Sprout/RDocParser.html +211 -0
  72. data/doc/Sprout/RemoteFileLoader.html +172 -0
  73. data/doc/Sprout/RemoteFileTarget.html +679 -0
  74. data/doc/Sprout/ReversedProgressBar.html +194 -0
  75. data/doc/Sprout/RubyFeature.html +155 -0
  76. data/doc/Sprout/RubyFeature/ClassMethods.html +1065 -0
  77. data/doc/Sprout/RubyGenerator.html +764 -0
  78. data/doc/Sprout/Specification.html +767 -0
  79. data/doc/Sprout/System.html +191 -0
  80. data/doc/Sprout/System/BaseSystem.html +1455 -0
  81. data/doc/Sprout/System/JavaSystem.html +122 -0
  82. data/doc/Sprout/System/OSXSystem.html +335 -0
  83. data/doc/Sprout/System/ThreadMock.html +193 -0
  84. data/doc/Sprout/System/UnixSystem.html +584 -0
  85. data/doc/Sprout/System/VistaSystem.html +251 -0
  86. data/doc/Sprout/System/WinNixSystem.html +325 -0
  87. data/doc/Sprout/System/WinSystem.html +571 -0
  88. data/doc/Sprout/ToolGenerator.html +931 -0
  89. data/doc/Sprout/VERSION.html +128 -0
  90. data/doc/SproutTestCase.html +1412 -0
  91. data/doc/String.html +286 -0
  92. data/doc/_index.html +1035 -0
  93. data/doc/class_list.html +36 -0
  94. data/doc/css/common.css +1 -0
  95. data/doc/css/full_list.css +53 -0
  96. data/doc/css/style.css +310 -0
  97. data/doc/file.README.html +96 -0
  98. data/doc/file.archive_unpacker.html +288 -0
  99. data/doc/file.base.html +208 -0
  100. data/doc/file.base_system.html +278 -0
  101. data/doc/file.boolean.html +135 -0
  102. data/doc/file.collection_param.html +139 -0
  103. data/doc/file.command.html +126 -0
  104. data/doc/file.concern.html +136 -0
  105. data/doc/file.daemon.html +309 -0
  106. data/doc/file.dir.html +76 -0
  107. data/doc/file.directory_manifest.html +122 -0
  108. data/doc/file.errors.html +147 -0
  109. data/doc/file.executable.html +638 -0
  110. data/doc/file.file_manifest.html +109 -0
  111. data/doc/file.file_param.html +120 -0
  112. data/doc/file.file_target.html +140 -0
  113. data/doc/file.files.html +85 -0
  114. data/doc/file.generator.html +296 -0
  115. data/doc/file.generator_class.html +72 -0
  116. data/doc/file.generator_generator.html +137 -0
  117. data/doc/file.generator_test.html +92 -0
  118. data/doc/file.generator_test_helper.html +67 -0
  119. data/doc/file.java_system.html +62 -0
  120. data/doc/file.library.html +291 -0
  121. data/doc/file.library_generator.html +74 -0
  122. data/doc/file.log.html +100 -0
  123. data/doc/file.manifest.html +67 -0
  124. data/doc/file.mxmlc.html +740 -0
  125. data/doc/file.number.html +67 -0
  126. data/doc/file.osx_system.html +79 -0
  127. data/doc/file.param.html +491 -0
  128. data/doc/file.parameter_factory.html +119 -0
  129. data/doc/file.path.html +81 -0
  130. data/doc/file.paths.html +80 -0
  131. data/doc/file.platform.html +124 -0
  132. data/doc/file.process_runner.html +224 -0
  133. data/doc/file.progress_bar.html +390 -0
  134. data/doc/file.rdoc_parser.html +145 -0
  135. data/doc/file.remote_file_loader.html +117 -0
  136. data/doc/file.remote_file_target.html +176 -0
  137. data/doc/file.ruby_base.html +64 -0
  138. data/doc/file.ruby_feature.html +244 -0
  139. data/doc/file.ruby_generator.html +118 -0
  140. data/doc/file.ruby_input.html +62 -0
  141. data/doc/file.ruby_test_case.html +78 -0
  142. data/doc/file.ruby_test_helper.html +61 -0
  143. data/doc/file.specification.html +248 -0
  144. data/doc/file.sprout.html +64 -0
  145. data/doc/file.sprout_test_case.html +280 -0
  146. data/doc/file.string.html +72 -0
  147. data/doc/file.string_param.html +76 -0
  148. data/doc/file.strings.html +71 -0
  149. data/doc/file.system.html +86 -0
  150. data/doc/file.template_manifest.html +67 -0
  151. data/doc/file.tool.html +92 -0
  152. data/doc/file.tool_generator.html +90 -0
  153. data/doc/file.unix_system.html +128 -0
  154. data/doc/file.url.html +71 -0
  155. data/doc/file.urls.html +70 -0
  156. data/doc/file.version.html +71 -0
  157. data/doc/file.vista_system.html +69 -0
  158. data/doc/file.win_nix_system.html +88 -0
  159. data/doc/file.win_system.html +129 -0
  160. data/doc/file_list.html +230 -0
  161. data/doc/frames.html +13 -0
  162. data/doc/index.html +96 -0
  163. data/doc/js/app.js +202 -0
  164. data/doc/js/full_list.js +149 -0
  165. data/doc/js/jquery.js +154 -0
  166. data/doc/method_list.html +3355 -0
  167. data/doc/top-level-namespace.html +192 -0
  168. data/lib/sprout/archive_unpacker.rb +203 -137
  169. data/lib/sprout/base.rb +38 -11
  170. data/lib/sprout/concern.rb +51 -0
  171. data/lib/sprout/daemon.rb +256 -0
  172. data/lib/sprout/executable.rb +40 -11
  173. data/lib/sprout/executable/boolean.rb +47 -1
  174. data/lib/sprout/executable/collection_param.rb +33 -1
  175. data/lib/sprout/executable/file_param.rb +16 -3
  176. data/lib/sprout/executable/files.rb +5 -0
  177. data/lib/sprout/executable/number.rb +5 -1
  178. data/lib/sprout/executable/param.rb +232 -16
  179. data/lib/sprout/executable/parameter_factory.rb +39 -1
  180. data/lib/sprout/executable/path.rb +7 -1
  181. data/lib/sprout/executable/paths.rb +6 -1
  182. data/lib/sprout/executable/string_param.rb +8 -1
  183. data/lib/sprout/executable/strings.rb +7 -1
  184. data/lib/sprout/executable/url.rb +8 -1
  185. data/lib/sprout/executable/urls.rb +7 -1
  186. data/lib/sprout/file_target.rb +11 -11
  187. data/lib/sprout/generator.rb +244 -0
  188. data/lib/sprout/generator/base.rb +0 -94
  189. data/lib/sprout/generators/generator/generator_generator.rb +35 -1
  190. data/lib/sprout/generators/generator/templates/generator_class.rb +3 -3
  191. data/lib/sprout/library.rb +75 -0
  192. data/lib/sprout/log.rb +11 -12
  193. data/lib/sprout/process_runner.rb +29 -9
  194. data/lib/sprout/remote_file_target.rb +20 -9
  195. data/lib/sprout/system/base_system.rb +11 -3
  196. data/lib/sprout/test/sprout_test_case.rb +1 -0
  197. data/lib/sprout/version.rb +7 -11
  198. data/rakefile.rb +7 -12
  199. data/script/add_param_handler.rb +43 -0
  200. data/sprout.gemspec +2 -3
  201. data/test/fixtures/executable/fdb.rb +764 -0
  202. data/test/fixtures/executable/flex3sdk_gem/fdb +60 -0
  203. data/test/fixtures/executable/mxmlc.rb +9 -11
  204. data/test/unit/daemon_test.rb +61 -0
  205. data/test/unit/process_runner_test.rb +21 -0
  206. data/test/unit/remote_file_target_test.rb +45 -11
  207. data/test/unit/sprout_test_helper.rb +1 -1
  208. metadata +210 -29
data/sprout.gemspec CHANGED
@@ -4,11 +4,10 @@ $:.unshift lib unless $:.include?(lib)
4
4
 
5
5
  require 'bundler'
6
6
  require 'rake'
7
- require 'sprout/version'
8
7
 
9
8
  Gem::Specification.new do |s|
10
- s.name = Sprout::NAME
11
- s.version = Sprout::VERSION::STRING
9
+ s.name = 'sprout'
10
+ s.version = File.read('VERSION').strip
12
11
  s.platform = Gem::Platform::RUBY
13
12
  s.authors = ["Luke Bayes"]
14
13
  s.email = "projectsprouts@googlegroups.com"
@@ -0,0 +1,764 @@
1
+
2
+ module Sprout
3
+
4
+ class FDB
5
+
6
+ ####################################
7
+ # Begin Executable Configuration
8
+ include Executable
9
+
10
+ set :default_prefix, '-'
11
+
12
+ ##
13
+ # The default gem name
14
+ set :pkg_name, 'flex4'
15
+
16
+ ##
17
+ # The default gem version
18
+ set :pkg_version, '>= 4.1.0.pre'
19
+
20
+ ##
21
+ # The default executable target
22
+ set :executable, :fdb
23
+
24
+ ####################################
25
+ # Begin Daemon Configuration
26
+ include Daemon
27
+
28
+ set :prompt, /^\(fdb\) |\(y or n\) /
29
+
30
+ ##
31
+ # Print a backtrace of all stack frames
32
+ add_action :backtrace
33
+ add_action_alias :bt, :backtrace
34
+ add_action_alias :where, :backtrace
35
+
36
+ ##
37
+ # Set a breakpoint at specified line or function
38
+ #
39
+ # @example Sets a breakpoint at line 87 of the current file.
40
+ # break 87
41
+ #
42
+ # @example Sets a breakpoint at line 56 of myapp.mxml
43
+ # break myapp.mxml:56
44
+ #
45
+ # @example Sets a breakpoint at line 29 of file #3
46
+ # break #3:29
47
+ #
48
+ # @example Sets a breakpoint at function doThis() in the current file
49
+ # break doThis
50
+ #
51
+ # @example Sets a breakpoint at function doThat() in file myapp.mxml
52
+ # break myapp.mxml:doThat
53
+ #
54
+ # @example Sets a breakpoint at function doOther() in file #3
55
+ # break #3:doOther
56
+ #
57
+ # @example Sets a breakpoint at the current execution address in the
58
+ # current stack frame. This is useful for breaking on return
59
+ # to a stack frame.
60
+ # break
61
+ #
62
+ # To see file names and numbers, do 'info sources' or 'info files'.
63
+ # To see function names, do 'info functions'.
64
+ # Abbreviated file names and function names are accepted if unambiguous.
65
+ # If line number is specified, break at start of code for that line.
66
+ # If function is specified, break at start of code for that function.
67
+ # See 'commands' and 'condition' for further breakpoint control.
68
+ add_action :break, Strings
69
+
70
+ ##
71
+ # Halt when an exception is thrown. This only affects caught
72
+ # exceptions -- that is, exceptions that are going to be handled
73
+ # by a "catch" block. Uncaught exceptions always halt in the
74
+ # debugger.
75
+ #
76
+ # Use the "delete" command to delete a catchpoint.
77
+ #
78
+ # Examples:
79
+ #
80
+ # catch *
81
+ #
82
+ # Halts when any exception is thrown.
83
+ #
84
+ # catch ReferenceError
85
+ #
86
+ # Halts whenever a ReferenceError is thrown
87
+ #
88
+ add_action :catch, String
89
+ add_action_alias :ca, :catch
90
+
91
+ ##
92
+ #
93
+ # Display the name and number of the current file
94
+ # or change the current file.
95
+ # Examples:
96
+ #
97
+ # cf
98
+ #
99
+ # Displays the name and number of the current file.
100
+ #
101
+ # cf myapp.mxml
102
+ #
103
+ # Changes the current file to myapp.mxml.
104
+ #
105
+ # cf #29
106
+ #
107
+ # Changes the current file to file #29.
108
+ # To see file names and numbers, do 'info sources' or 'info files'.
109
+ # Abbreviated file names are accepted if unambiguous.
110
+ # Listing a file with 'list' also makes that file the current file.
111
+ #
112
+ add_action :cf, String
113
+
114
+ ##
115
+ # Clear breakpoint at specified line or function.
116
+ # Examples:
117
+ #
118
+ # clear 87
119
+ #
120
+ # Clears the breakpoint at line 87 of the current file.
121
+ #
122
+ # clear myapp.mxml:56
123
+ #
124
+ # Clears the breakpoint at line 56 of myapp.mxml.
125
+ #
126
+ # clear #3:29
127
+ #
128
+ # Clears the breakpoint at line 29 of file #3.
129
+ #
130
+ # clear doThis
131
+ #
132
+ # Clears the breakpoint at function doThis() in the current file.
133
+ #
134
+ # clear myapp.mxml:doThat
135
+ #
136
+ # Clears the breakpoint at function doThat() in file myapp.mxml.
137
+ #
138
+ # clear #3:doOther
139
+ #
140
+ # Clears the breakpoint at function doOther() in file #3.
141
+ #
142
+ # clear
143
+ #
144
+ # Clears breakpoint of the current line in the current file.
145
+ # To see file names and numbers, do 'info sources' or 'info files'.
146
+ # To see function names, do 'info functions'.
147
+ # Abbreviated file names and function names are accepted if unambiguous.
148
+ # If line number is specified, all breakpoints in that line are cleared.
149
+ # If function is specified, breakpoints at beginning of function are cleared.
150
+ add_action :clear, Strings
151
+ add_action_alias :cl, :clear
152
+
153
+ ##
154
+ # Continue execution after stopping at a breakpoint
155
+ # Specify breakpoint number N to break only if COND is true.
156
+ # Usage is `condition N COND', where N is an integer and COND is an
157
+ # expression to be evaluated whenever breakpoint N is reached.
158
+ add_action :condition, String
159
+
160
+ ##
161
+ # Provide an affirmative response to a confirmation screen.
162
+ #
163
+ # See also: unconfirm
164
+ add_action :confirm
165
+
166
+ ##
167
+ # Continue execution after stopping at breakpoint.
168
+ # This command takes no arguments.
169
+ add_action :continue
170
+ add_action_alias :c, :continue
171
+
172
+ ##
173
+ # Set commands to be executed when a breakpoint is hit.
174
+ # Give breakpoint number as argument after `commands`.
175
+ # With no argument, the targeted breakpoint is the last one set.
176
+ # The commands themselves follow starting on the next line.
177
+ # Type a line containing "end" to indicate the end of them.
178
+ # Give "silent" as the first line to make the breakpoint silent;
179
+ # then no output is printed when it is hit, except what the commands print.
180
+ #
181
+ # Example:
182
+ #
183
+ # (fdb) commands
184
+ # Type commands for when breakpoint 1 is hit, one per line.
185
+ # End with a line saying just 'end'.
186
+ # >w
187
+ # >end
188
+ add_action :commands, String
189
+
190
+ ##
191
+ # Delete one or more breakpoints.
192
+ #
193
+ # Examples:
194
+ #
195
+ # delete
196
+ #
197
+ # Deletes all breakpoints.
198
+ #
199
+ # delete 2 5
200
+ #
201
+ # Deletes breakpoints #2 and #5.
202
+ #
203
+ # To see breakpoint numbers, do 'info breakpoints'.
204
+ add_action :delete, Strings
205
+ add_action_alias :d, :delete
206
+
207
+ ##
208
+ # Modify the list of directories in which fdb searches for source files.
209
+ #
210
+ # Examples:
211
+ #
212
+ # directory
213
+ #
214
+ # Restores list to the default, which is the directory in which the source
215
+ # file was compiled into object code, followed by the current working
216
+ # directory.
217
+ #
218
+ # directory C:\MySource (Windows)
219
+ # directory /MySource (Mac)
220
+ #
221
+ # Adds the specified directory to the beginning of the list of directories
222
+ # which will be searched for source. When looking for the source for class
223
+ # mypackage.MyClass, for example, the debugger would look for both
224
+ # C:\MySource\mypackage\MyClass.as and C:\MySource\MyClass.as.
225
+ #
226
+ # directory C:\Dir1;C:\Dir2 (Windows -- use ';' as separator)
227
+ # directory /Dir1:/Dir2 (Mac -- use ':' as separator)
228
+ #
229
+ # Adds several directories to the beginning of the list of directories
230
+ # which will be searched for source.
231
+ #
232
+ # To see the current list, do 'show directories'.
233
+ add_action :directory, Path
234
+ add_action_alias :dir, :directory
235
+
236
+ ##
237
+ # Disable one or more breakpoints or auto-display expressions.
238
+ #
239
+ # Examples:
240
+ #
241
+ # disable
242
+ #
243
+ # disable breakpoints
244
+ #
245
+ # Disables all breakpoints.
246
+ #
247
+ # disable 2 5
248
+ #
249
+ # disable breakpoints 2 5
250
+ #
251
+ # Disables breakpoints #2 and #5.
252
+ #
253
+ # disable display
254
+ #
255
+ # Disables all auto-display expressions.
256
+ #
257
+ # disable display 1 3
258
+ #
259
+ # Disables auto-display expressions #1 and #3.
260
+ #
261
+ # To see breakpoint numbers, do 'info breakpoints'.
262
+ # To see auto-display expression numbers, do 'info display'.
263
+ add_action :disable, String
264
+ add_action_alias :disab, :disable
265
+
266
+ ##
267
+ # (ActionScript 2 only; not supported when debugging ActionScript 3)
268
+ #
269
+ # Disassemble a specified portion of source code.
270
+ # The default is the current listing line.
271
+ # Arguments supported are the same as with the list command
272
+ #
273
+ # Examples:
274
+ #
275
+ # disassemble 87
276
+ #
277
+ # Disassembles line 87 in the current file.
278
+ #
279
+ # disassemble 87 102
280
+ # disassembles lines 87 to 102 in current file.
281
+ # disassemble doThis
282
+ #
283
+ # Disassembles the function doThis() in the current file.
284
+ #
285
+ # In addition to using simple line numbers as above, you can specify lines
286
+ # in additional ways:
287
+ #
288
+ # myapp.mxml
289
+ # Line 1 in myapp.mxml.
290
+ # myapp.mxml:doThat
291
+ # The first line of function doThat() in myapp.mxml.
292
+ # myapp.mxml:56
293
+ # Line 56 in myapp.mxml.
294
+ # #3
295
+ # Line 1 in file #3.
296
+ # #3:doOther
297
+ # The line in file #3 where the function doOther() begins.
298
+ # #3:29
299
+ # Line 29 in file #3.
300
+ add_action :disassemble, String
301
+ add_action_alias :disas, :disassemble
302
+
303
+ ##
304
+ # Add an auto-display expression
305
+ # Add an expression to the list of auto-display expressions.
306
+ #
307
+ # Example:
308
+ #
309
+ # display employee.name
310
+ #
311
+ # Add 'employee.name' to the list of auto-display expressions.
312
+ # Every time fdb stops, the value of employee.name will be displayed.
313
+ # The argument for this command is similar to that for 'print'.
314
+ # To see the list of auto-display expressions and their numbers,
315
+ # do 'info display'.
316
+ #
317
+ # NOTE: Removed because the base class adds this param for some reason.
318
+ # Investigate duplicate add_action calls.
319
+ #add_action :display, String
320
+ #add_action_alias :disp, :display
321
+
322
+ ##
323
+ # Enable breakpoints or auto-display expressions
324
+ add_action :enable
325
+ add_action_alias :e, :enable
326
+
327
+ ##
328
+ # Specify an application to be debugged, without starting it.
329
+ #
330
+ # Examples:
331
+ #
332
+ # file http://www.mysite.com/myapp.mxml
333
+ #
334
+ # Specify an MXML application to be debugged.
335
+ #
336
+ # file myapp.swf
337
+ #
338
+ # Specify a local SWF file to be debugged, in the current directory.
339
+ # In this case myapp.swd (the file containing the debugging information)
340
+ # must also exist in the current directory.
341
+ #
342
+ # This command does not actually cause the application to start;
343
+ # use the 'run' command with no argument to start debugging the application.
344
+ #
345
+ # Instead of using 'file <target>' and then 'run', you can simply specify the
346
+ # application to be debugged as an argument of 'run':
347
+ #
348
+ # run http://mysite.com/myapp.mxml
349
+ # run myapp.swf
350
+ #
351
+ # You can also specify the application to be debugged
352
+ # as a command-line argument when you start fdb:
353
+ #
354
+ # fdb http://www.mysite.com/myapp.mxml
355
+ #
356
+ # fdb myapp.swf
357
+ #
358
+ # In this case you do not need to use either 'file' or 'run'.
359
+ # If you 'run' without specifying an application to debug,
360
+ # (fdb)
361
+ #
362
+ # will wait for any application to connect to it.
363
+ add_action :file, File, { :hidden_name => true }
364
+ add_action_alias :fil, :file
365
+
366
+ ##
367
+ # Execute until current function returns.
368
+ # This command takes no arguments.
369
+ add_action :finish
370
+ add_action_alias :f, :finish
371
+
372
+ ##
373
+ # Specify how fdb should handle a fault in the Flash Player.
374
+ #
375
+ # Examples:
376
+ #
377
+ # handle recursion_limit stop
378
+ #
379
+ # When a recursion_limit fault occurs, display message in fdb
380
+ # and stop as if at breakpoint.
381
+ #
382
+ # handle all print nostop
383
+ #
384
+ # When any kind of fault occurs, display message in fdb but don't stop.
385
+ # First argument is a fault name or 'all'.
386
+ # Additional arguments are actions that apply to that fault.
387
+ # To see fault names, do 'info handle'.
388
+ #
389
+ # Actions are print/noprint and stop/nostop.
390
+ # 'print' means print a message if this fault happens.
391
+ # 'stop' means reenter debugger if this fault happens. Implies 'print'.
392
+ add_action :handle, String
393
+ add_action_alias :han, :handle
394
+
395
+ ##
396
+ # Display help on FDB commands
397
+ # New to fdb? Do 'tutorial' for basic info.
398
+ # List of fdb commands:
399
+ # bt (bt) Print backtrace of all stack frames
400
+ # break (b) Set breakpoint at specified line or function
401
+ # catch (ca) Halt when an exception is thrown
402
+ # cf (cf) Display the name and number of the current file
403
+ # clear (cl) Clear breakpoint at specified line or function
404
+ # condition (cond) Apply/remove conditional expression to a breakpoint
405
+ # continue (c) Continue execution after stopping at breakpoint
406
+ # commands (com) Sets commands to execute when breakpoint hit
407
+ # delete (d) Delete breakpoints or auto-display expressions
408
+ # directory (dir) Add a directory to the search path for source files
409
+ # disable (disab) Disable breakpoints or auto-display expressions
410
+ # disassemble (disas) Disassemble source lines or functions
411
+ # display (disp) Add an auto-display expressions
412
+ # enable (e) Enable breakpoints or auto-display expressions
413
+ # file (fil) Specify application to be debugged.
414
+ # finish (f) Execute until current function returns
415
+ # handle (han) Specify how to handle a fault
416
+ # help (h) Display help on fdb commands
417
+ # home (ho) Set listing location to where execution is halted
418
+ # info (i) Display information about the program being debugged
419
+ # kill (k) Kill execution of program being debugged
420
+ # list (l) List specified function or line
421
+ # next (n) Step program
422
+ # print (p) Print value of variable EXP
423
+ # pwd (pw) Print working directory
424
+ # quit (q) Exit fdb
425
+ # run (r) Start debugged program
426
+ # set (se) Set the value of a variable
427
+ # source (so) Read fdb commands from a file
428
+ # step (s) Step program until it reaches a different source line
429
+ # tutorial (t) Display a tutorial on how to use fdb
430
+ # undisplay (u) Remove an auto-display expression
431
+ # viewswf (v) Set or clear filter for file listing based on swf
432
+ # watch (wa) Add a watchpoint on a given variable
433
+ # what (wh) Displays the context of a variable
434
+ # where (w) Same as bt
435
+ # Type 'help' followed by command name for full documentation.
436
+ add_action :help
437
+ add_action_alias :h, :help
438
+
439
+ ##
440
+ # Set listing location to where execution is halted
441
+ add_action :home, Path
442
+ add_action_alias :ho, :home
443
+
444
+ ##
445
+ # Generic command for showing things about the program being debugged.
446
+ # List of info subcommands:
447
+ # info arguments (i a) Argument variables of current stack frame
448
+ # info breakpoints (i b) Status of user-settable breakpoints
449
+ # info display (i d) Display list of auto-display expressions
450
+ # info files (i f) Names of targets and files being debugged
451
+ # info functions (i fu) All function names
452
+ # info handle (i h) How to handle a fault
453
+ # info locals (i l) Local variables of current stack frame
454
+ # info scopechain (i sc) Scope chain of current stack frame
455
+ # info sources (i so) Source files in the program
456
+ # info stack (i s) Backtrace of the stack
457
+ # info swfs (i sw) List of swfs in this session
458
+ # info targets(i t) Application being debugged
459
+ # info variables (i v) All global and static variable names
460
+ # Type 'help info' followed by info subcommand name for full documentation.
461
+ add_action :info, String
462
+ add_action_alias :i, :info
463
+
464
+ ##
465
+ # Kill execution of program being debugged
466
+ # This command takes no arguments.
467
+ add_action :kill
468
+ add_action_alias :k, :kill
469
+
470
+ ##
471
+ # List lines of code in a source file.
472
+ #
473
+ # Examples:
474
+ #
475
+ # list
476
+ #
477
+ # Lists ten more lines in current file after or around previous listing.
478
+ #
479
+ # list -
480
+ #
481
+ # Lists the ten lines in current file before a previous listing.
482
+ #
483
+ # list 87
484
+ #
485
+ # Lists ten lines in current file around line 87.
486
+ #
487
+ # list 87 102
488
+ #
489
+ # Lists lines 87 to 102 in current file.
490
+ #
491
+ # In addition to using simple line numbers as above, you can specify lines
492
+ # in seven additional ways:
493
+ #
494
+ # doThis
495
+ #
496
+ # The first line of function doThis() in the current file.
497
+ #
498
+ # myapp.mxml
499
+ #
500
+ # Line 1 in myapp.mxml.
501
+ #
502
+ # myapp.mxml:doThat
503
+ #
504
+ # The first line of function doThat() in myapp.mxml.
505
+ #
506
+ # myapp.mxml:56
507
+ #
508
+ # Line 56 in myapp.mxml.
509
+ #
510
+ # #3
511
+ #
512
+ # Line 1 in file #3.
513
+ #
514
+ # #3:doOther
515
+ #
516
+ # The line in file #3 where the function doOther() begins.
517
+ #
518
+ # #3:29
519
+ #
520
+ # Line 29 in file #3.
521
+ #
522
+ # To see file names and numbers, do 'info sources' or 'info files'.
523
+ # To see function names, do 'info functions'.
524
+ # Abbreviated file names and function names are accepted if unambiguous.
525
+ # Listing a file makes that file the current file. (See 'cf' command.)
526
+ add_action :list, String
527
+ add_action_alias :l, :list
528
+
529
+ ##
530
+ # Step program, proceeding through subroutine calls.
531
+ #
532
+ # next
533
+ #
534
+ # Step once.
535
+ #
536
+ # next 3
537
+ #
538
+ # Step 3 times, or until the program stops for another reason.
539
+ #
540
+ # Like the 'step' command as long as subroutine calls do not happen;
541
+ # when they do, the call is treated as one instruction.
542
+ add_action :next, String
543
+ add_action_alias :n, :next
544
+
545
+ ##
546
+ # Print value of variable or expression.
547
+ #
548
+ # Examples:
549
+ #
550
+ # print i
551
+ #
552
+ # Print the value of 'i'.
553
+ #
554
+ # print employee.name
555
+ #
556
+ # Print the value of 'employee.name'.
557
+ #
558
+ # print employee
559
+ #
560
+ # Print the value of the 'employee' Object.
561
+ #
562
+ # This may simplay display something like [Object 10378].
563
+ #
564
+ # print employee.
565
+ #
566
+ # Print the values of all the properties of the 'employee' Object.
567
+ #
568
+ # print *employee
569
+ #
570
+ # Print the values of all the properties of the 'employee' Object.
571
+ # The prefix * operator is the prefix alternative to the postfix . operator.
572
+ #
573
+ # print #10378.
574
+ #
575
+ # Print the values of all the properties of Object #10378.
576
+ # Variables accessible are those of the lexical environment of the selected
577
+ # stack frame, plus all those whose scope is global or an entire file.
578
+ add_action :print, String
579
+ add_action_alias :p, :print
580
+
581
+ ##
582
+ # Print the current working directory.
583
+ # This is the directory from which fdb was launched; it cannot be
584
+ # changed within fdb. The argument for 'run' and 'source' can be
585
+ # specified relative to this directory.
586
+ # This command takes no arguments.
587
+ add_action :pwd
588
+ add_action_alias :pw, :pwd
589
+
590
+ ##
591
+ # Exit FDB
592
+ add_action :quit
593
+ add_action_alias :q, :quit
594
+
595
+ ##
596
+ # Start a debugging session.
597
+ #
598
+ # Examples:
599
+ #
600
+ # run http://www.mysite.com/myapp.mxml
601
+ #
602
+ # Runs the specified MXML application.
603
+ #
604
+ # run myapp.swf
605
+ # run mydir\myapp.swf
606
+ # run c:\mydir\myapp.swf
607
+ #
608
+ # Runs the local SWF file myapp.swf, which can be specified
609
+ # either relative to the current directory (see 'pwd' command)
610
+ # or using an absolute path. In these cases, myapp.swd
611
+ # (the file containing the debugging information) must also
612
+ # exist in the same directory as myapp.swf.
613
+ #
614
+ # run
615
+ #
616
+ # Run the application previously specified by the 'file' command.
617
+ # If no application has been specified, fdb will wait for one
618
+ # to connect to it, and time out if none does so.
619
+ # 'run' will start the application in a browser or standalone Flash Player.
620
+ # As soon as the application starts, it will break into fdb so that you can
621
+ # set breakpoints, etc.
622
+ #
623
+ # On the Macintosh, the only supported form of the command is 'run' with no
624
+ # arguments. You must then manually launch the Flash player.
625
+ add_action :run, String
626
+ add_action_alias :r, :run
627
+
628
+ ##
629
+ # Set the value of a variable or a convenience variable.
630
+ # Convenience variables are variables that exist entirely
631
+ # within fdb; they are not part of your program.
632
+ # Convenience variables are prefixed with '$' and can
633
+ # be any name that does not conflict with any existing
634
+ # variable. For example, $myVar. Convenience variables
635
+ # are also used to control various aspects of fdb.
636
+ #
637
+ # The following convenience variables are used by fdb.
638
+ # $listsize - number of source lines to display for 'list'
639
+ # $columnwrap - column number on which output will wrap
640
+ # $infostackshowthis - if 0, does not display 'this' in stack backtrace
641
+ # $invokegetters - if 0, prevents fdb from firing getter functions
642
+ # $bpnum - the last defined breakpoint number
643
+ # $displayattributes - if 1, 'print var.' displays all attributes of members
644
+ # of 'var' (e.g. private, static)
645
+ #
646
+ # Examples:
647
+ #
648
+ # set i = 3
649
+ #
650
+ # Sets the variable 'i' to the number 3.
651
+ #
652
+ # set employee.name = "Susan"
653
+ #
654
+ # Sets the variable 'employee.name' to the string "Susan".
655
+ #
656
+ # set $myVar = 20
657
+ #
658
+ # Sets the convenience variable '$myVar' to the number 20
659
+ add_action :set, String
660
+ add_action_alias :se, :set
661
+
662
+ ##
663
+ # Read fdb commands from a file and execute them.
664
+ #
665
+ # source mycommands.txt
666
+ # source mydir\mycommands.txt
667
+ # source c:\mydir\mycommands.txt
668
+ #
669
+ # Reads mycommands.txt and executes the fdb commands in it.
670
+ # The file containing the commands can be specified either
671
+ # relative to the current directory (see 'pwd' command)
672
+ # or using an absolute path.
673
+ #
674
+ # The file .fdbinit is read automatically in this way when fdb is started.
675
+ # Only the current directory is searched for .fdbinit. This means that
676
+ # you can have set up multiple .fdbinit files for different projects.
677
+ add_action :source, File
678
+ add_action_alias :so, :source
679
+
680
+ ##
681
+ # Step program until it reaches a different source line.
682
+ #
683
+ # Examples:
684
+ #
685
+ # step
686
+ #
687
+ # Step once.
688
+ #
689
+ # step 3
690
+ #
691
+ # Step 3 times, or until the program stops for another reason.
692
+ add_action :step, Number
693
+ add_action_alias :s, :step
694
+
695
+ ##
696
+ # Display a tutorial on how to use fdb.
697
+ # This command takes no arguments.
698
+ add_action :tutorial
699
+ add_action_alias :t, :tutorial
700
+
701
+ ##
702
+ # Provide a negative response to a confirmation screen.
703
+ #
704
+ # See also: confirm
705
+ add_action :unconfirm
706
+
707
+ ##
708
+ # Remove one or more auto-display expressions.
709
+ #
710
+ # Examples:
711
+ #
712
+ # undisplay
713
+ #
714
+ # Remove all auto-display expressions.
715
+ #
716
+ # undisplay 2 7
717
+ #
718
+ # Remove auto-display expressions #2 and #7.
719
+ #
720
+ # To see the list of auto-display expressions and their numbers,
721
+ # do 'info display'.
722
+ add_action :undisplay, String
723
+ add_action_alias :u, :undisplay
724
+
725
+ ##
726
+ # Set or clear a filter for file listing based on SWF
727
+ add_action :viewswf
728
+ add_action_alias :v, :viewswf
729
+
730
+ ##
731
+ # Add a watchpoint on a given variable. The debugger will halt
732
+ # execution when the variable's value changes.
733
+ #
734
+ # Example:
735
+ #
736
+ # watch foo
737
+ #
738
+ add_action :watch, String
739
+ add_action_alias :wa, :watch
740
+
741
+ ##
742
+ # Displays the context in which a variable is resolved.
743
+ add_action :what
744
+ add_action_alias :wh, :what
745
+
746
+ end
747
+ end
748
+
749
+ ##
750
+ # Rake task helper that delegates to
751
+ # the FDB executable.
752
+ #
753
+ # fdb 'bin/SomeProject.swf' do |t|
754
+ # t.break << 'com/foo/bar/SomeClass.as:23'
755
+ # t.continue
756
+ # t.run
757
+ # end
758
+ #
759
+ def fdb *args, &block
760
+ fdb_tool = Sprout::FDB.new
761
+ fdb_tool.to_rake *args, &block
762
+ fdb_tool
763
+ end
764
+