2 CONSTANT
= "MogileFS::VERSION"
3 RVF
= "lib/mogilefs/version.rb"
7 # First see if there is a version file (included in release tarballs),
8 # then try git-describe, then default.
10 describe
= `git describe --abbrev=4 HEAD 2>/dev/null`.strip
14 system(*%w(git update-index
-q
--refresh
))
15 unless `git diff-index --name-only HEAD --`.chomp
.empty
?
22 vn
= vn
.sub
!(/\Av/, "")
23 new_ruby_version
= "#{CONSTANT} = '#{vn}'\n"
24 cur_ruby_version
= File
.read(RVF
) rescue nil
25 if new_ruby_version
!= cur_ruby_version
26 File
.open(RVF
, "w") { |fp
| fp
.write(new_ruby_version
) }
28 puts vn
if $0 == __FILE__