<commit_before>require "cuiabout/version"

module Cuiabout
  class CLI

    ROOT_PATH = 'http://cui-about.me'

    def self.run *args
      command = args.shift || 'help'
      send(command, *args)
    end

    def self.help *args
      system "curl #{ROOT_PATH}"
    end

    def self.show *args
      abort "Please specify hacker's name." if args.empty?

      name = args.shift
      system "curl #{ROOT_PATH}/#{name}"
    end

  end
end<commit_msg>Download profiles only with username<commit_after>require "cuiabout/version"

module Cuiabout
  class CLI

    ROOT_PATH = 'http://cui-about.me'

    class << self

      def run *args
        command = args.shift || 'help'
        send(command, *args)
      end

      def help *args
        system "curl #{ROOT_PATH}"
      end
      alias :me :help

      def show *args
        abort "ERROR: Please specify hacker's name" if args.empty?

        name = args.shift
        system "curl #{ROOT_PATH}/#{name}"
      end

      def method_missing method_or_name, *args
        if listed? method_or_name
          show method_or_name
        else
          abort 'ERROR: Unknown command'
        end
      end

      def listed? name
        names = `curl --silent #{ROOT_PATH}/users`
        names.split($/).include?(name.to_s)
      end

    end

  end
end
{'fraction_non_alphanumeric': 0.10007639419404125, 'fraction_numerical': 0.0, 'mean_word_length': 2.0184331797235022, 'pattern_counts': {'":': 0, '<': 5, '<?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': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3548953', 'n_tokens_mistral': 427, 'n_tokens_neox': 402, 'n_words': 119}