Sha256: 7038b806206bff2221650e213c4dfc9c8b7d3ebf5eeac0e937256838a133c26c

Contents?: true

Size: 421 Bytes

Versions: 10

Compression:

Stored size: 421 Bytes

Contents

#!/usr/bin/env ruby
# -*- encoding: utf-8 -*-
# Copyright muflax <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

10 entries across 10 versions & 1 rubygems

Version Path
muflax-0.3.0 lib/muflax/regex.rb
muflax-0.2.6 lib/muflax/regex.rb
muflax-0.2.5 lib/muflax/regex.rb
muflax-0.2.4 lib/muflax/regex.rb
muflax-0.2.3 lib/muflax/regex.rb
muflax-0.2.2 lib/muflax/regex.rb
muflax-0.2.1 lib/muflax/regex.rb
muflax-0.2.0 lib/muflax/regex.rb
muflax-0.1.35 lib/muflax/regex.rb
muflax-0.1.34 lib/muflax/regex.rb