Permalink
Browse files

Remove new version available check.

Change-Id: I735b1cb915a4b2598cccac82326835d76847b270
  • Loading branch information...
1 parent ec55123 commit 3d2d00aaa9746d237025c2740b742a2e418e2caf @mmb mmb committed Oct 5, 2012
Showing with 2 additions and 35 deletions.
  1. +1 −5 micro/lib/micro/console.rb
  2. +1 −3 micro/lib/micro/identity.rb
  3. +0 −27 micro/lib/micro/version.rb
@@ -54,7 +54,7 @@ def console
# TODO add a timeout so the console will be auto-refreshed
while true
clear
- say(" Welcome to VMware Micro Cloud Foundry version #{VCAP::Micro::Version::VERSION}\n\n")
+ say("Welcome to VMware Micro Cloud Foundry version #{VCAP::Micro::Version::VERSION}\n\n")
status
menu
end
@@ -75,10 +75,6 @@ def status
if @identity.api_host != Identity::DEFAULT_API_HOST
say("Using API host: #{@identity.api_host}\n".yellow)
end
- if Version.should_update?(@identity.version)
- url = "http://cloudfoundry.com/micro"
- say("Version #{@identity.latest_version} is available for download at #{url}\n".yellow)
- end
if @identity.configured?
say("Current Configuration:")
say(" Identity: #{@identity.subdomain} (#{dns_status})")
@@ -5,7 +5,7 @@ module VCAP
module Micro
class Identity
attr_accessor :admins, :ip, :nonce, :version
- attr_reader :name, :cloud, :version, :api_host, :proxy, :latest_version
+ attr_reader :name, :cloud, :version, :api_host, :proxy
DEFAULT_API_HOST = "mcapi.cloudfoundry.com"
URL = "https://%s/api/v1/micro"
@@ -170,8 +170,6 @@ def update_dns(silent=false)
response = Yajl::Parser.new.parse(json)
if response
- # latest is the file name - micro-1.0.0_rc2.tgz
- @latest_version = Version.file2version(response["latest"])
@version = response["version"] if response["version"]
values = response.collect {|k,v| "#{k} = #{v}"}.join("\n")
@logger.info("got following response from DNS update:\n#{values}")
View
@@ -2,33 +2,6 @@ module VCAP
module Micro
class Version
VERSION = "1.2.0"
- FILE_REGEXP = /micro-(\d+\.\d+\.*\d*_*\S*)\.tgz/
- VERSION_REGEXP = /(\d+)\.(\d+)\.*(\d+)*_*(\S*)/
-
- # converts the full filename to just version number, e.g.
- # "micro-1.0.0_rc2.tgz" -> "1.0.0 rc2""
- def self.file2version(filename)
- return nil if filename.nil?
- if version = filename.match(FILE_REGEXP)
- if matches = version[1].match(VERSION_REGEXP)
- v = "#{matches[1]}"
- v += ".#{matches[2]}" if matches[2]
- v += ".#{matches[3]}" if matches[3]
- v += " #{matches[4]}" if matches[4] && !matches[4].empty?
- v
- end
- end
- end
-
- def self.should_update?(matcher, installed=VERSION)
- inst = installed.match(VERSION_REGEXP)
- m = matcher.match(VERSION_REGEXP)
- ok = true
- ok = (inst[1] >= m[1]) if m[1]
- ok = ok && (inst[2] >= m[2]) if m[2]
- ok = ok && (inst[3] >= m[3]) if m[3]
- !ok
- end
end
end
end

0 comments on commit 3d2d00a

Please sign in to comment.