Sha256: 226cb3e1f0d29093a288f36982f89d256e73ededf18f7fdc1733b9fea2d97825

Contents?: true

Size: 569 Bytes

Versions: 28

Compression:

Stored size: 569 Bytes

Contents

module Deface
  module Actions
    class Surround < SurroundAction
      def execute(target_range)
        original_placeholders.each do |placeholder|
          start = target_range[0].clone(1)
          placeholder.replace start

          target_range[1..-1].each do |element|
            element = element.clone(1)
            start.after element
            start = element
          end
        end
        target_range.first.before(source_element)
        target_range.map(&:remove)
      end

      def range_compatible?
        true
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 2 rubygems

Version Path
solidus_backend-1.0.0.pre2 vendor/bundle/gems/deface-1.0.1/lib/deface/actions/surround.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/deface-1.0.1/lib/deface/actions/surround.rb
deface-1.0.1 lib/deface/actions/surround.rb
deface-1.0.0 lib/deface/actions/surround.rb
deface-1.0.0.rc4 lib/deface/actions/surround.rb
deface-1.0.0.rc3 lib/deface/actions/surround.rb
deface-1.0.0.rc2 lib/deface/actions/surround.rb
deface-1.0.0.rc1 lib/deface/actions/surround.rb