Sha256: 633ee7be6101b3858d1eda2a1b6c678269886211df728800639f037fddb52db2
Contents?: true
Size: 1.08 KB
Versions: 1
Compression:
Stored size: 1.08 KB
Contents
module Rbbt VERSIONS = IndiferentHash.setup({}) def self.add_version(file) dir = Path.setup(Path.caller_lib_dir(file)) libname = File.basename(dir).sub('rbbt-','') return if VERSIONS.include? libname version = if dir.VERSION.exists? dir.VERSION.read elsif dir[".git"].exists? begin head = dir[".git"]["HEAD"].read.split(" ").last.strip dir[".git"][head].read.strip rescue nil end elsif libname.include?("-") name,_sep, v = libname.partition("-") if v =~ /^\d+\.\d+\.\d+$/ libname = name v else nil end else nil end return if version.nil? VERSIONS[libname] = version end def self.versions versions = Rbbt::VERSIONS Gem.loaded_specs.keys.each do |gem| next unless gem.include? 'rbbt' name = gem.sub('rbbt-','') next if versions.include? name version = Gem.loaded_specs[gem].version.version versions[name] = version end versions versions.merge(CMD.versions) end Rbbt.add_version(__FILE__) end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rbbt-util-5.26.151 | lib/rbbt/util/version.rb |