Sha256: b629172f8af9d0c1eacf9e5fe2cf74e76a74b49c5724139ab74b82aa3f1db7ba

Contents?: true

Size: 1.06 KB

Versions: 1

Compression:

Stored size: 1.06 KB

Contents

module AssOle
  module Snippets
    module Shared
      # Mixin provides helpers for get 1C application platform version
      # compatibility
      module AppCompatibility
        is_ole_snippet

        # @return [Gem::Version] real version of 1C:Enterprise platform from
        #  +SystemInfo+ object
        def platform_version
          Gem::Version.new newObject('SystemInfo').AppVersion
        end

        # @return [String] application +CompatibilityMode+ as a string
        def app_compatibility_mode
          sTring(metaData.CompatibilityMode)
        end

        # @return [Gem::Version] application platform version compatibility
        def app_compatibility_version
          def app_compatibility_version_get
            return platform_version.segments.slice(0,3).join('.') if\
              app_compatibility_mode =~ %r{(НеИспользовать|DontUse)}i
            app_compatibility_mode.gsub(/(Версия|Version)/i,'').gsub(/_/,'.')
          end

          Gem::Version.new(app_compatibility_version_get)
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ass_ole-snippets-shared-0.5.0 lib/ass_ole/snippets/shared/app_compatibility.rb