Sha256: 1356d87ba3454aa73969e305d4f336b5a2f6f87652962964e30bfb7154f4d4fe

Contents?: true

Size: 652 Bytes

Versions: 3

Compression:

Stored size: 652 Bytes

Contents

require 'tap/generator/base'

module Tap
  module Generator
    
    # Methods used by the generate and destroy commands.
    module Exe
      
      def run(mod, argv=ARGV)
        if argv.empty? || argv == ['--help']
          yield
        end
        
        name = argv.shift
        env, const = eeek('generator', name)
        
        unless const
          raise "unknown generator: #{name}"
        end
        
        generator, argv = const.constantize.parse(argv)
        generator.template_dir = env.class_path(:templates, generator) {|dir| File.directory?(dir) }
        generator.extend(mod).process(*argv)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
tap-gen-0.1.1 lib/tap/generator/exe.rb
tap-gen-0.1.2 lib/tap/generator/exe.rb
tap-gen-0.1.0 lib/tap/generator/exe.rb