Module: RubiGen

Defined in:
lib/rubigen/base.rb,
lib/rubigen.rb,
lib/rubigen/spec.rb,
lib/rubigen/options.rb,
lib/rubigen/scripts.rb,
lib/rubigen/commands.rb,
lib/rubigen/manifest.rb,
lib/rubigen/simple_logger.rb,
lib/rubigen/generated_attribute.rb,
lib/rubigen/helpers/generator_test_helper.rb,
lib/rubigen/lookup.rb

Overview

RubiGen is a code generation platform Ruby frameworks.

Generators are easily invoked within Ruby framework instances to add and remove components such as library and test files.

New generators are easy to create and may be distributed within RubyGems, user home directory, or within each Ruby framework that uses RubiGen.

For example, newgem uses RubiGen to generate new RubyGems. Those generated RubyGems can then use RubiGen (via a generated script/generate application) to generate tests and executable apps, etc, for the RubyGem.

Generators may subclass other generators to provide variations that require little or no new logic but replace the template files.

For a RubyGem, put your generator classes and templates within subfolders of the generators directory.

The layout of generator files can be seen in the built-in test_unit generator:

test_unit_generators/
  test_unit/
    test_unit_generator.rb
    templates/
      test_unit.rb

The directory name (test_unit) matches the name of the generator file (test_unit_generator.rb) and class (TestUnitGenerator). The files that will be copied or used as templates are stored in the templates directory.

The filenames of the templates don’t matter, but choose something that will be self-explanatory since you will be referencing these in the manifest method inside your generator subclass.

Defined Under Namespace

Modules: Commands, GeneratorTestHelper, Lookup, Options, Scripts Classes: AbstractGemSource, Base, GemPathSource, GeneratedAttribute, GeneratorError, Manifest, PathFilteredSource, PathSource, SimpleLogger, Source, Spec, UsageError

Constant Summary collapse

VERSION =
'1.5.4'