def slice(target, filters = {}, format, &block)
      validate_target(target)
      validate_filters(filters)
      validate_format(format)

      begin
        target = File.directory?(target) ? CukeModeler::Directory.new(target) : CukeModeler::FeatureFile.new(target)
      rescue => e
        if e.message =~ /lexing|parsing/i
          raise(ArgumentError, "A syntax or lexing problem was encountered while trying to parse #{target}")
        else
          raise e
        end

      end

      if target.is_a?(CukeModeler::Directory)
        sliced_tests = DirectoryExtractor.new.extract(target, filters, format, &block)
      else
        sliced_tests = FileExtractor.new.extract(target, filters, format, &block)
      end

      sliced_tests
    end
def slice(target, filters = {}, format, &block)
      validate_target(target)
      validate_filters(filters)
      validate_format(format)

      begin
        target = File.directory?(target) ? CukeModeler::Directory.new(target) : CukeModeler::FeatureFile.new(target)
      rescue => e
        if e.message =~ /lexing|parsing/i
          raise(ArgumentError, "A syntax or lexing problem was encountered while trying to parse #{target}")
        else
          raise e
        end

      end

      if target.is_a?(CukeModeler::Directory)
        sliced_tests = DirectoryExtractor.new.extract(target, filters, format, &block)
      else
        sliced_tests = FileExtractor.new.extract(target, filters, format, &block)
      end

      sliced_tests
    end
Slices up the given location into individual test cases.

 The location chosen for slicing can be a file or directory path. Optional filters can be provided in order to
 ignore certain kinds of test cases. See #known_filters for the available option types. Most options are either a
 string or regular expression, although arrays of the same can be given instead if more than one filter is desired.

 A block can be provided as a filter which can allow for maximal filtering flexibility. Note, however, that this
 exposes the underlying modeling objects and knowledge of how they work is then required to make good use of the
 filter.

 Finally, the test cases can be provided as a collection of file:line strings or as a collection of the object
 types used to represent test cases by the underlying modeling library.

 @param target [String] the location that will be sliced up
 @param filters [Hash] the filters that will be applied to the sliced test cases
 @param format [Symbol] the type of output: :file_line or :test_object