Permalink
Browse files

Define Protobuf::Version.

  • Loading branch information...
1 parent e0b3a6c commit dde04e6db1e24064793a2fa6efd8b662c89fccf4 @macks committed Jun 3, 2010
Showing with 8 additions and 0 deletions.
  1. +2 −0 bin/rprotoc
  2. +6 −0 lib/protobuf/common/util.rb
View
@@ -21,6 +21,8 @@ opts.on('-o', '--out <OUT_DIR>', 'Specify the directory in which Ruby source fil
opts.on_tail('-v', '--version', 'Show version.'){ puts(opts.ver); exit }
opts.on_tail('-h', '--help', 'Show this message.'){ puts(opts.help); exit }
+Version = Protobuf::Version
+
begin
opts.order!
rescue OptionParser::ParseError
@@ -14,4 +14,10 @@ def underscore(name)
name.to_s.gsub(/\B[A-Z]/, '_\&').downcase
end
end
+
+ begin
+ Version = File.read(File.dirname(__FILE__) + '/../../../VERSION')
+ rescue
+ Version = 'unknown'
+ end
end

0 comments on commit dde04e6

Please sign in to comment.