version.rb 356 Bytes
Newer Older
lauren j's avatar
lauren j committed
1 2 3
require 'memoist'

module ReConnect
lauren j's avatar
lauren j committed
4
  VERSION = "1.2.0"
lauren j's avatar
lauren j committed
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

  class << self
    extend Memoist

    def version
      gitrev = `sh -c 'command -v git >/dev/null && git describe --always --tags --abbrev --dirty'`.strip
      if gitrev != ""
        "v#{VERSION} rev #{gitrev}"
      else
        "v#{VERSION}"
      end
    end

    memoize :version
  end
end