¶ ↑
ractionscriptProgrammatically generate ActionScript3 source code from within Ruby.
¶ ↑
SynopsisWrite this:
¶ ↑
simple_builder.as3.rb # build a class definition class!("MyActionScriptClass") { # build a function definition function!("doSomething") { args! :x => :int, :y => :int return_type! :int comment! "do something awesome" exp! 'x + y' } # with the full power of ruby! 3.times do |i| function!("doSomething#{i}") { args! :x => :int, :y => :int return_type! :int comment! "return x plus y times some compile time constant" exp! "return(x + y * #{i})" } end }
Get this:
¶ ↑
MyActionScriptClass.as3 package bar.baz.notimplemented { public class MyActionScriptClass { public function doSomething(x:int, y:int):int { //do something awesome x + y; } public function doSomething0(x:int, y:int):int { //return x plus y times some compile time constant return(x + y * 0); } public function doSomething1(x:int, y:int):int { //return x plus y times some compile time constant return(x + y * 1); } public function doSomething2(x:int, y:int):int { //return x plus y times some compile time constant return(x + y * 2); } } }
¶ ↑
Contributing to ractionscript-
Check out the latest master to make sure the feature hasn’t been implemented or the bug hasn’t been fixed yet
-
Check out the issue tracker to make sure someone already hasn’t requested it and/or contributed it
-
Fork the project
-
Start a feature/bugfix branch
-
Commit and push until you are happy with your contribution
-
Make sure to add tests for it. This is important so I don’t break it in a future version unintentionally.
-
Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
¶ ↑
CopyrightCopyright © 2011 Blake Miller. See LICENSE.txt for further details.