cirandas.net

ref: master

lib/noosfero/version.rb


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
module Noosfero
  PROJECT = 'noosfero'
  VERSION = '1.8.0'
end

root = File.expand_path(File.dirname(__FILE__) + '/../..')
if File.exist?(File.join(root, '.git')) && system('which git >/dev/null')
  git_version = Dir.chdir(root) { `git describe --tags 2>/dev/null`.to_s.strip.sub('-rc', '~rc') }
  if git_version != ''
    version_sort = IO.popen(['sort', '--version-sort'], 'w+')
    version_sort.puts(Noosfero::VERSION)
    version_sort.puts(git_version)
    version_sort.close_write
    new_version = version_sort.readlines.last.strip
    if new_version != Noosfero::VERSION
      Noosfero::VERSION.clear << git_version
    end
    version_sort.close
  end
end