Sha256: 97ed336c22e3ad72ec4329a109bc25dee22cb5c70c137dd7494e518e4f456c15

Contents?: true

Size: 483 Bytes

Versions: 19

Compression:

Stored size: 483 Bytes

Contents

module Deface
  module Sources
    class Copy < Source
      def self.execute(override)
        copy = override.args[:copy]
        if copy.is_a? Hash
          range = Deface::Matchers::Range.new('Copy', copy[:start], copy[:end]).matches(override.parsed_document).first
          Deface::Parser.undo_erb_markup! range.map(&:to_s).join
        else
          Deface::Parser.undo_erb_markup! override.parsed_document.css(copy).first.to_s.clone
        end
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
deface-1.9.0 lib/deface/sources/copy.rb
deface-1.8.2 lib/deface/sources/copy.rb
deface-1.8.1 lib/deface/sources/copy.rb
deface-1.8.0 lib/deface/sources/copy.rb
deface-1.7.0 lib/deface/sources/copy.rb
deface-1.6.2 lib/deface/sources/copy.rb
deface-1.6.1 lib/deface/sources/copy.rb
deface-1.6.0 lib/deface/sources/copy.rb
deface-1.5.3 lib/deface/sources/copy.rb
deface-1.5.2 lib/deface/sources/copy.rb
deface-1.5.1 lib/deface/sources/copy.rb
deface-1.5.0 lib/deface/sources/copy.rb
deface-1.4.0 lib/deface/sources/copy.rb
deface-1.3.2 lib/deface/sources/copy.rb
deface-1.3.1 lib/deface/sources/copy.rb
deface-1.3.0 lib/deface/sources/copy.rb
deface-1.2.0 lib/deface/sources/copy.rb
deface-1.1.0 lib/deface/sources/copy.rb
deface-1.0.2 lib/deface/sources/copy.rb