"Fossies" - the Fresh Open Source Software Archive

Member "redmine-4.1.1/lib/redmine/version.rb" (6 Apr 2020, 1001 Bytes) of package /linux/www/redmine-4.1.1.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "version.rb": 4.1.0_vs_4.1.1.

    1 # frozen_string_literal: true
    2 
    3 require 'redmine/scm/adapters/subversion_adapter'
    4 
    5 module Redmine
    6   # @private
    7   module VERSION
    8     MAJOR = 4
    9     MINOR = 1
   10     TINY  = 1
   11 
   12     # Branch values:
   13     # * official release: nil
   14     # * stable branch:    stable
   15     # * trunk:            devel
   16     BRANCH = 'stable'
   17 
   18     # Retrieves the revision from the working copy
   19     def self.revision
   20       if File.directory?(File.join(Rails.root, '.svn'))
   21         begin
   22           path = Redmine::Scm::Adapters::AbstractAdapter.shell_quote(Rails.root.to_s)
   23           if `#{Redmine::Scm::Adapters::SubversionAdapter.client_command} info --xml #{path}` =~ /commit\s+revision="(\d+)"/
   24             return $1.to_i
   25           end
   26         rescue
   27           # Could not find the current revision
   28         end
   29       end
   30       nil
   31     end
   32 
   33     REVISION = self.revision
   34     ARRAY    = [MAJOR, MINOR, TINY, BRANCH, REVISION].compact
   35     STRING   = ARRAY.join('.')
   36 
   37     def self.to_a; ARRAY  end
   38     def self.to_s; STRING end
   39   end
   40 end