Sha256: 9c3801f3e7ec82a3ee165d418cc6df2eafae8249d9175b0354d3f7a8d11e7849

Contents?: true

Size: 613 Bytes

Versions: 16

Compression:

Stored size: 613 Bytes

Contents

include AETK::OutputFormatters

def find_version(file)
  File.open(file) do |f|
    m = f.read.match(/return\s+"([\da-zA-Z\.\-)]+?)"\s*;/)
    version = m[1]
    if version and not version.strip.chomp.empty?
      two_cols('Abiquo Version:'.bold, version)
    else
      two_cols 'Abiquo Version:'.bold, 'Unknown'	
    end
  end
end

index_ee = tomcat_base_dir + '/webapps/client-premium/index.html'
index_ce = tomcat_base_dir + '/webapps/client/index.html'

if File.exist? index_ee
  find_version index_ee
elsif File.exist? index_ce
  find_version index_ce
else
  two_cols 'Abiquo Version:'.bold, 'Unknown'	
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
abiquo-etk-0.4.42 lib/checks/abiquo_version.rb
abiquo-etk-0.4.33 lib/checks/abiquo_version.rb
abiquo-etk-0.4.32 lib/checks/abiquo_version.rb
abiquo-etk-0.4.29 lib/checks/abiquo_version.rb
abiquo-etk-0.4.25 lib/checks/abiquo_version.rb
abiquo-etk-0.4.24 lib/checks/abiquo_version.rb
abiquo-etk-0.4.23 lib/checks/abiquo_version.rb
abiquo-etk-0.4.22 lib/checks/abiquo_version.rb
abiquo-etk-0.4.20 lib/checks/abiquo_version.rb
abiquo-etk-0.4.19 lib/checks/abiquo_version.rb
abiquo-etk-0.4.18 lib/checks/abiquo_version.rb
abiquo-etk-0.4.17 lib/checks/abiquo_version.rb
abiquo-etk-0.4.16 lib/checks/abiquo_version.rb
abiquo-etk-0.4.15 lib/checks/abiquo_version.rb
abiquo-etk-0.4.14 lib/checks/abiquo_version.rb
abiquo-etk-0.4.13 lib/checks/abiquo_version.rb