Sha256: fac9fcfcd3358c01c8005700c99b95c4207891dbdb94fbdeccc03a2ca65bfa12

Contents?: true

Size: 818 Bytes

Versions: 6

Compression:

Stored size: 818 Bytes

Contents

class InstallShouldaGenerator < RubiGen::Base
  attr_reader :gem_name, :module_name
  
  def initialize(runtime_args, runtime_options = {})
    super
    @destination_root = File.expand_path(destination_root)
    @gem_name = base_name
    @module_name  = @gem_name.gsub('-','_').camelize
  end

  def manifest
    record do |m|
      # Ensure appropriate folder(s) exists
      m.directory 'test'
      m.directory 'tasks'

      m.template 'test/test.rb', "test/test_#{gem_name}.rb"
      m.template "test/test_helper.rb", "test/test_helper.rb"
      
      m.file_copy_each %w( shoulda.rake ), 'tasks'
    end
  end

  protected
    def banner
      <<-EOS
Install Shoulda testing support. 

Includes a rake task (tasks/shoulda.rake) to be loaded by the root Rakefile,
which provides a "test" task.

EOS
    end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
newgem-1.5.3 rubygems_generators/install_shoulda/install_shoulda_generator.rb
newgem-1.5.0 rubygems_generators/install_shoulda/install_shoulda_generator.rb
newgem-1.5.1 rubygems_generators/install_shoulda/install_shoulda_generator.rb
newgem-1.5.2 rubygems_generators/install_shoulda/install_shoulda_generator.rb
newgem-1.4.0 rubygems_generators/install_shoulda/install_shoulda_generator.rb
newgem-1.4.1 rubygems_generators/install_shoulda/install_shoulda_generator.rb