Sha256: c4718ee814ba2755cff3b74dfe8027671e8a4691e6eeade9a47394a5746efe4f

Contents?: true

Size: 424 Bytes

Versions: 3

Compression:

Stored size: 424 Bytes

Contents

#!/usr/bin/env ruby
# -*- encoding: utf-8 -*-
# Copyright Steffie Dorn <mail@muflax.com>, 2013
# License: GNU GPL 3 <http://www.gnu.org/copyleft/gpl.html>

class String
  def mgsub replacements={}
    str = self.dup

    str.mgsub! replacements

    str
  end
  alias :gsub_all :mgsub

  def mgsub! replacements={}
    replacements.each do |a, b|
      self.gsub! a, b
    end

    self
  end
  alias :gsub_all! :mgsub!
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
muflax-0.5.5 lib/muflax/regex.rb
muflax-0.5.3 lib/muflax/regex.rb
muflax-0.5.2 lib/muflax/regex.rb