<commit_before>module FuckingScriptsDigitalOcean
  class Server
    ServerNotFound = Class.new(StandardError)
    MissingDropletName = Class.new(StandardError)

    attr_reader :server

    def initialize(connection, options)
      @connection, @options = connection, options
    end

    def configure
      get(options[:droplet_name]) if server.nil?
      raise ServerNotFound, "Unable to find server. Try specifying the server ID." if server.nil?

      FuckingScriptsDigitalOcean::SCP.new(server, options).to_server
      server.ssh(options.fetch(:scripts))
    end

    private

    attr_reader :options, :connection

    def get(droplet_name)
      if droplet_name.nil?
        raise FuckingScriptsDigitalOcean::Server::MissingDropletName ,
          "Please specify the Droplet Name using the --droplet-name option."
      end
      @server = connection.servers.detect { |server| server.name == droplet_name }
      if options.has_key?(:private_key_path)
        @server.private_key_path = options.fetch(:private_key_path)
      end
      @server
    end

    def name
      "#{options.fetch(:name).downcase.sub(/ /, '-')}-#{Time.now.strftime("%y-%m-%d-%H-%M")}"
    end
  end
end<commit_msg>Change the message when server is not found. Add some byebug<commit_after>module FuckingScriptsDigitalOcean
  class Server
    ServerNotFound = Class.new(StandardError)
    MissingDropletName = Class.new(StandardError)

    attr_reader :server

    def initialize(connection, options)
      @connection, @options = connection, options
    end

    def configure
      require 'byebug'; byebug
      get(options[:droplet_name]) if server.nil?
      raise ServerNotFound, "Unable to find server with Droplet name #{options[:droplet_name]}." if server.nil?

      FuckingScriptsDigitalOcean::SCP.new(server, options).to_server
      server.ssh(options.fetch(:scripts))
    end

    private

    attr_reader :options, :connection

    def get(droplet_name)
      if droplet_name.nil?
        raise FuckingScriptsDigitalOcean::Server::MissingDropletName ,
          "Please specify the Droplet Name using the --droplet-name option."
      end
      require 'byebug'; byebug
      @server = connection.servers.detect { |server| server.name == droplet_name }
      if options.has_key?(:private_key_path)
        @server.private_key_path = options.fetch(:private_key_path)
      end
      @server
    end

    def name
      "#{options.fetch(:name).downcase.sub(/ /, '-')}-#{Time.now.strftime("%y-%m-%d-%H-%M")}"
    end
  end
end
{'fraction_non_alphanumeric': 0.1063070210234034, 'fraction_numerical': 0.0, 'mean_word_length': 3.2315436241610738, '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': '6334634', 'n_tokens_mistral': 771, 'n_tokens_neox': 747, 'n_words': 172}