Sha256: 8a66cb7217230938cd1dff43ef42c4451d392819bb345daf52d56e11789391d9

Contents?: true

Size: 625 Bytes

Versions: 17

Compression:

Stored size: 625 Bytes

Contents

class Errata
  class Erratum
    class Delete < Erratum
      attr_accessor :matching_expression, :backfill
      
      def initialize(errata, options = {})
        super
        set_matching_expression(options)
        # otherwise abbr(X) will kill the characters before and after the match
        @backfill = /\Aabbr\((.*)\)\z/.match(options[:x]) ? '\1\2' : ''
      end
      
      def inspect
        super + " matching_expression=#{matching_expression}>"
      end
      
      def correct!(row)
        super(row) do
          row[column].gsub!(matching_expression, backfill)
        end
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 3 rubygems

Version Path
seamusabshere-errata-0.1.0 lib/erratum/delete.rb
seamusabshere-errata-0.1.1 lib/erratum/delete.rb
seamusabshere-errata-0.1.2 lib/erratum/delete.rb
seamusabshere-errata-0.1.3 lib/erratum/delete.rb
seamusabshere-errata-0.1.4 lib/erratum/delete.rb
errata-0.2.4 lib/erratum/delete.rb
errata-ruby19-0.2.3 lib/erratum/delete.rb
errata-0.2.3 lib/erratum/delete.rb
errata-0.2.2 lib/erratum/delete.rb
errata-0.2.1 lib/erratum/delete.rb
errata-0.2.0 lib/erratum/delete.rb
errata-0.1.9 lib/erratum/delete.rb
errata-0.1.8 lib/erratum/delete.rb
errata-0.1.7 lib/erratum/delete.rb
errata-0.1.6 lib/erratum/delete.rb
errata-0.1.5 lib/erratum/delete.rb
errata-0.1.4 lib/erratum/delete.rb