Skip to content
This repository has been archived by the owner on Mar 24, 2018. It is now read-only.

Commit

Permalink
Define Protobuf::Version.
Browse files Browse the repository at this point in the history
  • Loading branch information
macks committed Jun 3, 2010
1 parent e0b3a6c commit dde04e6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bin/rprotoc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions lib/protobuf/common/util.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.