Sha256: daec5674e588b8b72a5422a5de84c1bd43d5ebee3a7be645031a93b0162e3e7d

Contents?: true

Size: 583 Bytes

Versions: 1

Compression:

Stored size: 583 Bytes

Contents

module TmpRails
  class << self    
    attr_accessor :root
    
    def root_dir path, options = {}
      @root = options == :custom ? custom_root_dir(path) : default_root_dir(path)      
    end

    protected

    def default_root_dir path
      File.expand_path(File.join(File.dirname(path), '..', 'tmp'))      
    end

    def custom_root_dir path
      File.expand_path(path)
    end
  end
end  
  
module Rails
  def self.root
    @root ||= File.join(Rails.application.config.root_dir, 'rails')
  end
end

class TestApp < Rails::Application
end

Rails.application = TestApp

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
generator-spec-0.4.4 lib/generator_spec/helpers/configure_rails.rb