Sha256: 33310066042ded77a4d37c45bf84718a0527c440b35a133c9a4f2570f45bfa52

Contents?: true

Size: 207 Bytes

Versions: 27

Compression:

Stored size: 207 Bytes

Contents

class String
  alias original_percent %

  def %(arg, *args)
    if arg.is_a?(Hash)
      gsub(/%\{(\w+)\}/) do
        arg[$1.to_sym]
      end
    else
      original_percent(arg, *args)
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
parser-2.0.0.pre2 lib/parser/compatibility/ruby1_8.rb
parser-2.0.0.pre1 lib/parser/compatibility/ruby1_8.rb
parser-2.0.0.beta10 lib/parser/compatibility/ruby1_8.rb
parser-2.0.0.beta9 lib/parser/compatibility/ruby1_8.rb
parser-1.4.2 lib/parser/compatibility/ruby1_8.rb
parser-2.0.0.beta8 lib/parser/compatibility/ruby1_8.rb
parser-2.0.0.beta7 lib/parser/compatibility/ruby1_8.rb
parser-2.0.0.beta6 lib/parser/compatibility/ruby1_8.rb
parser-2.0.0.beta5 lib/parser/compatibility/ruby1_8.rb
parser-2.0.0.beta4 lib/parser/compatibility/ruby1_8.rb
parser-1.4.1 lib/parser/compatibility/ruby1_8.rb
parser-2.0.0.beta3 lib/parser/compatibility/ruby1_8.rb
parser-2.0.0.beta2 lib/parser/compatibility/ruby1_8.rb
parser-2.0.0.beta1 lib/parser/compatibility/ruby1_8.rb
parser-1.4.0 lib/parser/compatibility/ruby1_8.rb
parser-1.3.4 lib/parser/compatibility/ruby1_8.rb
parser-1.3.3 lib/parser/compatibility/ruby1_8.rb
parser-1.3.2 lib/parser/compatibility/ruby1_8.rb
parser-1.3.1 lib/parser/compatibility/ruby1_8.rb
parser-1.3.0 lib/parser/compatibility/ruby1_8.rb