Sha256: 68b70f476034ca92c161b07875a27c999ab4fd2aabe1114053fc25945306d5fd

Contents?: true

Size: 460 Bytes

Versions: 16

Compression:

Stored size: 460 Bytes

Contents

# encoding: utf-8

# extend class String with a `prepend` method
class String
    if RUBY_VERSION =~ /^1\.8/
        def prepend(value)
            insert(0, value)
        end
    end

    def starts_with?(prefix)
        prefix = prefix.to_s
        self[0, prefix.length] == prefix
    end

    def double_delimiters
        gsub('\\', '\\\\\\')
    end

    def double_delimiters!
        replace(self.double_delimiters)
    end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
rake-delphi-0.0.26 lib/rake/helpers/string.rb
rake-delphi-0.0.25 lib/rake/helpers/string.rb
rake-delphi-0.0.24 lib/rake/helpers/string.rb
rake-delphi-0.0.23 lib/rake/helpers/string.rb
rake-delphi-0.0.22 lib/rake/helpers/string.rb
rake-delphi-0.0.21 lib/rake/helpers/string.rb
rake-delphi-0.0.20 lib/rake/helpers/string.rb
rake-delphi-0.0.19 lib/rake/helpers/string.rb
rake-delphi-0.0.18 lib/rake/helpers/string.rb
rake-delphi-0.0.17 lib/rake/helpers/string.rb
rake-delphi-0.0.16 lib/rake/helpers/string.rb
rake-delphi-0.0.15 lib/rake/helpers/string.rb
rake-delphi-0.0.14 lib/rake/helpers/string.rb
rake-delphi-0.0.13 lib/rake/helpers/string.rb
rake-delphi-0.0.12 lib/rake/helpers/string.rb
rake-delphi-0.0.11 lib/rake/helpers/string.rb