Sha256: 419c5e972a23524a3b07823aa8202db4e14ceb4201affe940e2b091891b90043

Contents?: true

Size: 428 Bytes

Versions: 5

Compression:

Stored size: 428 Bytes

Contents

module Protobuf
  module Util
    module_function

    def camelize(name)
      name.to_s.gsub(/(?:\A|_)(\w)/) { $1.upcase }
    end

    def modulize(name)
      name.to_s.sub(/\A[a-z]/) {|c| c.upcase }
    end

    def underscore(name)
      name.to_s.gsub(/\B[A-Z]/, '_\&').downcase
    end
  end

  begin
    Version = File.read(File.dirname(__FILE__) + '/../../../VERSION').strip
  rescue
    Version = 'unknown'
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ruby_protobuf-0.4.11 lib/protobuf/common/util.rb
ruby_protobuf-0.4.10 lib/protobuf/common/util.rb
ruby_protobuf-0.4.9 lib/protobuf/common/util.rb
ruby_protobuf-0.4.8 lib/protobuf/common/util.rb
ruby_protobuf-0.4.7 lib/protobuf/common/util.rb