Class: GlooLang::App::Info

Inherits:
Object
  • Object
show all
Defined in:
lib/gloo_lang/app/info.rb

Direct Known Subclasses

RubyInfo

Constant Summary collapse

VERSION =
GlooLang::App::Info.get_version
APP_NAME =
'Gloo Engine'.freeze

Class Method Summary collapse

Class Method Details

.display_titleObject

Get the application display title.



35
36
37
# File 'lib/gloo_lang/app/info.rb', line 35

def self.display_title
  return "#{APP_NAME}, version #{VERSION}"
end

.full_versionObject

Get the full application version information, including engine version.



43
44
45
46
47
48
49
50
51
# File 'lib/gloo_lang/app/info.rb', line 43

def self.full_version
  str = "#{display_title}"
  if $infos
    $infos.each do |o|
      str << "\n#{o.display_title}"
    end
  end
  return str
end

.get_versionObject

Load the version from the VERSION file.



22
23
24
25
26
27
# File 'lib/gloo_lang/app/info.rb', line 22

def self.get_version
  f = File.dirname( File.absolute_path( __FILE__ ) )
  f = File.dirname( File.dirname( f ) )
  f = File.join( f, 'VERSION' )
  return File.read( f )
end

.inherited(subclass) ⇒ Object

Register other Info classes when they are loaded.



14
15
16
17
# File 'lib/gloo_lang/app/info.rb', line 14

def self.inherited( subclass )
  $infos = [] unless $infos
  $infos << subclass
end