Class: InstrumentalComponents::VersionChecker

Inherits:
Object
  • Object
show all
Defined in:
lib/instrumental-components/version_checker.rb

Instance Method Summary collapse

Instance Method Details

#checkObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/instrumental-components/version_checker.rb', line 7

def check
  # Load .env file if it exists (for local development only)
  if File.exist?('.env')
    Dotenv.load
  end

  latest_version = fetch_latest_version
  current_version = get_current_version

  if current_version == latest_version
    puts "You're on the latest version!"
  else
    puts "You're running version #{current_version}. To update to the latest version (#{latest_version}), run:\nbundle exec install-instrumental"
  end
end