Module: VersionLS

Defined in:
lib/vls.rb,
lib/vls/version.rb

Overview

The Version LiSt utility module.

Constant Summary collapse

STRING =
VERSION = "0.3.3"

Class Method Summary collapse

Class Method Details

.modulesObject

Get a list of modules that have VERSION info.



56
57
58
59
60
61
62
63
64
# File 'lib/vls.rb', line 56

def self.modules
  mods = ObjectSpace.each_object(Module).select do |mod|
    mod.const_defined?("VERSION")
  end.sort do
    |first, second| first.name <=> second.name
  end

  mods - [VersionLS]
end

.vlsObject

Execute the core of the vls command and return an array of

module, version

arrays.



43
44
45
46
47
48
49
50
51
52
53
# File 'lib/vls.rb', line 43

def self.vls
  modules.map do |mod|
    begin
      version = mod::VERSION
    rescue
      version = 'version ???'
    end

    [mod, version.to_vls_version_string]
  end
end