Sha256: 9556ce6cbad227fbdfafc3c962d76bf7c19740e92548186e6796f84950d0de6a

Contents?: true

Size: 955 Bytes

Versions: 6

Compression:

Stored size: 955 Bytes

Contents

# Generate a new ActionScript 3.0 class,
# test case and test suite.
#
# This generator can be executed as follows:
# 
#   sprout -n as3 SomeProject
#   cd SomeProject
#   script/generator class utils.MathUtil
#
# Be sure to check out NamedBase to learn more about what kinds of class names
# can be accepted.
#
# If the class name passed into this generator ends with 'Test', only a test case
# and test suite will be generated.
#
class ClassGenerator < Sprout::Generator::NamedBase  # :nodoc:

  def manifest
    record do |m|
#      m.class_collisions class_dir, "#{class_name}Controller", "#{class_name}ControllerTest", "#{class_name}Helper"

      if(!user_requested_test)
        m.directory full_class_dir
        m.template 'Class.as', full_class_path
      end
 
      m.directory full_test_dir
      m.template 'TestCase.as', full_test_case_path
      
      m.template 'TestSuite.as', File.join(test_dir, 'AllTests.as')
    end
  end
    
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
sprout-as2-bundle-0.1.26 lib/sprout/generators/class/class_generator.rb
sprout-as2-bundle-0.1.21 lib/sprout/generators/class/class_generator.rb
sprout-as2-bundle-0.1.20 lib/sprout/generators/class/class_generator.rb
sprout-as2-bundle-0.1.13 lib/sprout/generators/class/class_generator.rb
sprout-as2-bundle-0.1.18 lib/sprout/generators/class/class_generator.rb
sprout-as2-bundle-0.1.23 lib/sprout/generators/class/class_generator.rb