Sha256: 211e507b9e22264f55f52641564691d46673775245351e5a8d8f2d586ee5e358

Contents?: true

Size: 784 Bytes

Versions: 10

Compression:

Stored size: 784 Bytes

Contents

require 'tap/generator/generators/task/task_generator'

module Tap::Generator::Generators
  
  # :startdoc::generator a file_task and test
  #
  # Generates a new Tap::FileTask and associated test files.
  class FileTaskGenerator < TaskGenerator
    
    def manifest(m, const_name)
      const = super
      
      if test
        test_dir = app.filepath('test', const.path, "test_#{const.basename}")
        
        m.directories test_dir, %W{
          input
          expected
        }
        
        m.template File.join(test_dir, 'input/file.txt'), "file.txt", :const => const, :test_dir => test_dir
        m.template File.join(test_dir, 'expected/result.yml'), "result.yml", :const => const, :test_dir => test_dir
      end
    end
    
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
bahuvrihi-tap-0.10.0 lib/tap/generator/generators/file_task/file_task_generator.rb
bahuvrihi-tap-0.10.1 lib/tap/generator/generators/file_task/file_task_generator.rb
bahuvrihi-tap-0.10.2 lib/tap/generator/generators/file_task/file_task_generator.rb
bahuvrihi-tap-0.10.3 lib/tap/generator/generators/file_task/file_task_generator.rb
bahuvrihi-tap-0.10.4 lib/tap/generator/generators/file_task/file_task_generator.rb
bahuvrihi-tap-0.10.5 lib/tap/generator/generators/file_task/file_task_generator.rb
bahuvrihi-tap-0.10.6 lib/tap/generator/generators/file_task/file_task_generator.rb
bahuvrihi-tap-0.10.7 lib/tap/generator/generators/file_task/file_task_generator.rb
tap-0.10.0 lib/tap/generator/generators/file_task/file_task_generator.rb
tap-0.10.1 lib/tap/generator/generators/file_task/file_task_generator.rb