Sha256: 35b527bb92de16716f82832b80a6ed47dd35a951f8c5bb9c553d4a38c9058353

Contents?: true

Size: 726 Bytes

Versions: 11

Compression:

Stored size: 726 Bytes

Contents

require_relative "transformer/in_memory"
require_relative "transformer/temp_table"

module DirectoryDiff
  class Transform
    attr_reader :current_directory

    def initialize(current_directory)
      @current_directory = current_directory
    end

    def into(new_directory, options = {})
      processor_class = processor_for(options[:processor])
      processor_class.new(current_directory).into(new_directory, options)
    end

    private

    def processor_for(processor)
      case processor
      when nil, :in_memory
        Transformer::InMemory
      when :temp_table
        Transformer::TempTable
      else
        raise ArgumentError, "unsupported processor #{processor.inspect}"
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
directory_diff-0.4.14 lib/directory_diff/transform.rb
directory_diff-0.4.13 lib/directory_diff/transform.rb
directory_diff-0.4.12 lib/directory_diff/transform.rb
directory_diff-0.4.11 lib/directory_diff/transform.rb
directory_diff-0.4.10 lib/directory_diff/transform.rb
directory_diff-0.4.9 lib/directory_diff/transform.rb
directory_diff-0.4.8 lib/directory_diff/transform.rb
directory_diff-0.4.7 lib/directory_diff/transform.rb
directory_diff-0.4.6 lib/directory_diff/transform.rb
directory_diff-0.4.5 lib/directory_diff/transform.rb
directory_diff-0.4.4 lib/directory_diff/transform.rb