Class: FlashSDK::ClassGenerator

Inherits:
Sprout::Generator::Base
  • Object
show all
Includes:
FlashHelper
Defined in:
lib/flashsdk/generators/class_generator.rb

Overview

This Generator will create a new ActionScript class based on the ActionScript3Class.as template.

This Generator should only be executed from within a project that has a Gemfile. If your Gemfile loads the “asunit4” gem, a test case and test suite will also be created whenever this generator is run.

You can run this generator as follows:

$ sprout-class utils.MathUtil

You can prevent the creation of a test case and test suite by sending in the --no-test parameter as follows:

$ sprout-class utils.MathUtil --no-test

Direct Known Subclasses

CitrusProjectGenerator, ProjectGenerator

Instance Method Summary collapse

Instance Method Details

#assetsString



31
# File 'lib/flashsdk/generators/class_generator.rb', line 31

add_param :assets, String, { :default => 'assets' }

#binString



47
# File 'lib/flashsdk/generators/class_generator.rb', line 47

add_param :bin, String, { :default => 'bin' }

#docString



55
# File 'lib/flashsdk/generators/class_generator.rb', line 55

add_param :doc, String, { :default => 'doc' }

#libString



43
# File 'lib/flashsdk/generators/class_generator.rb', line 43

add_param :lib, String, { :default => 'lib' }

#manifestObject



61
62
63
64
65
66
67
68
69
70
71
# File 'lib/flashsdk/generators/class_generator.rb', line 61

def manifest
  if(!input.match(/Test$/))
    directory class_directory do
      template "#{class_name}.as", 'ActionScript3Class.as'
    end
  end

  if test_class
    generator :test_class, :input => "#{fully_qualified_class_name}Test"
  end
end

#packageString



27
# File 'lib/flashsdk/generators/class_generator.rb', line 27

add_param :package, String, { :default => ""}

#skinsString



35
# File 'lib/flashsdk/generators/class_generator.rb', line 35

add_param :skins, String, { :default => 'skins' }

#srcString



51
# File 'lib/flashsdk/generators/class_generator.rb', line 51

add_param :src, String, { :default => 'src' }

#testString



39
# File 'lib/flashsdk/generators/class_generator.rb', line 39

add_param :test, String, { :default => 'test' }

#test_classBoolean



59
# File 'lib/flashsdk/generators/class_generator.rb', line 59

add_param :test_class, Boolean, { :default => true }