Sha256: e6a7b6ceb377635f776ee60474b05ebc47c0f658e40310a3a97e900773e43311

Contents?: true

Size: 980 Bytes

Versions: 3

Compression:

Stored size: 980 Bytes

Contents

module Skyline
  # The defines the current Skyline version. 
  # 
  #
  # @private
  module VERSION
    MAJOR = 3
    MINOR = 0
    TINY = 8
    BUILD = 0

    # Some hackery to determine if we're on a development branch or not
    # this sets BUILD to a timestamp 
    begin
      git_dir = File.dirname(__FILE__) + "/../../.git"
      if File.exist?(git_dir)
        if `git --git-dir=#{git_dir} describe --tags HEAD` =~ /^v\d+\.\d+\.\d+(\.\d+)?$/
          build = nil
        else
          build = `git --git-dir=#{git_dir} show HEAD --format=format:"%ct" --quiet 2>&1`
          if build =~ /\d+/
            build = Time.at(build.to_i).strftime("%Y%m%d") 
          else
            build = nil
          end
        end
      end
    rescue RuntimeError => e
    end
    
    # If no BUILD can be determined or we're on a version, it takes the last number
    build = build || BUILD
 
    STRING = [MAJOR, MINOR, TINY, build == 0 ? nil : build].compact.join('.')
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
westarete-skylinecms-3.0.8.20100329 lib/skyline/version.rb
westarete-skylinecms-3.0.8.20100330 lib/skyline/version.rb
skylinecms-3.0.8 lib/skyline/version.rb