Class: Tack::Adapters::Adapter

Inherits:
Object
  • Object
show all
Defined in:
lib/tack/adapters/adapter.rb

Class Method Summary collapse

Class Method Details

.for(path) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/tack/adapters/adapter.rb', line 7

def self.for(path)
  # Using a simple path-based heuristic for now
  case path
  when /test.rb$/ 
    TestUnitAdapter.new
  when /spec.rb$/
    RSpecAdapter.new
  else
    raise "Cannot determine an adapter for path #{path}"
  end
end