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

Returns The path where assets will be created.

Returns:

  • (String)

    The path where assets will be created.



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

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

#binString

Returns The path where binaries should be created.

Returns:

  • (String)

    The path where binaries should be created.



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

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

#docString

Returns The path where documentation should be created.

Returns:

  • (String)

    The path where documentation should be created.



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

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

#libString

Returns The path where libraries should be added.

Returns:

  • (String)

    The path where libraries should be added.



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

Returns The default package to use.

Returns:

  • (String)

    The default package to use.



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

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

#skinsString

Returns The path where skins will be created.

Returns:

  • (String)

    The path where skins will be created.



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

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

#srcString

Returns The path where source files should be created.

Returns:

  • (String)

    The path where source files should be created.



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

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

#testString

Returns The path where test cases should be created.

Returns:

  • (String)

    The path where test cases should be created.



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

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

#test_classBoolean

Returns Call the TestClassGenerator after creating class.

Returns:

  • (Boolean)

    Call the TestClassGenerator after creating class.



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

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