<commit_before>require 'rainbow'

module AppStore; end

module AppStore::Emigrant
  
  # Represents the command line interface
  class CLI
    
    # Initializes CLI instance with given arguments
    def initialize args
      
      # Extract the path (if any)
      path, = args
      
      # Use the default library on this system when no path is specified
      library = path ? Library.new(path) : Library.default
      
      # Loop through all applications
      library.apps.each do |app|
        
        # And print their name, version and whether it's outdated
        print app.name + ' @ ' + "v#{app.version}".foreground(app.outdated? ? :red : :green)
        if app.outdated?
          print " (v#{app.cloudversion} available in the cloud)" 
        end
        puts
        
        sleep(0.75)
      end
      
    end
    
  end
  
end<commit_msg>Enhanced CLI to load data in bulk as well as validating apps correctly<commit_after>require 'rainbow'

module AppStore; end

module AppStore::Emigrant
  
  # Represents the command line interface
  class CLI
    
    # Initializes CLI instance with given arguments
    def initialize args
      
      # Extract the path (if any)
      path, = args
      
      # Use the default library on this system when no path is specified
      library = path ? Library.new(path) : Library.default
      
      # Load cloud data in bulk
      library.clouddata!
      
      # Loop through all applications
      library.apps.each do |app|
        
        if app.valid?
          
          # Print their name, version and whether it's outdated
          print app.name + ' @ ' + "v#{app.version}".foreground(app.outdated? ? :red : :green)
          if app.outdated?
            print " (v#{app.cloudversion} available in the cloud)" 
          end
        else
          print app.filename + ' is invalid (metadata, id or name missing)'
        end
        
        puts
        
      end
      
    end
    
  end
  
end
{'fraction_non_alphanumeric': 0.07027300303336703, 'fraction_numerical': 0.0015166835187057635, 'mean_word_length': 1.8433908045977012, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7194713', 'n_tokens_mistral': 559, 'n_tokens_neox': 544, 'n_words': 192}