<commit_before>require 'toolshed/error'
require 'toolshed/password'
require 'toolshed/timeout'

require 'net/ssh'

module Toolshed
  module ServerAdministration
    # SSH class that can ssh to a host and perform commands
    class SSH
      include Toolshed::Password

      attr_accessor :channel, :commands, :data, :host, :keys, :password, :ssh_options, :sudo_password, :user # rubocop:disable LineLength
      attr_reader :silent, :timeout

      def initialize(options = nil) # rubocop:disable AbcSize, CyclomaticComplexity, PerceivedComplexity, LineLength
        options ||= {}
        @password = options[:password] || ''
        @sudo_password = options[:sudo_password] || ''
        @keys = options[:keys] || ''
        @host = options[:host] || ''
        @user = options[:user] || ''
        @ssh_options = options[:ssh_options] || {}
        @commands = options[:commands] || ''
        @password = options[:password] || ''
        @data = []
        @silent = options[:silent] || false
        @timeout = Toolshed::Timeout.new(timeout_period: 120)

        set_ssh_options
      end<commit_msg>Until timeout can be added as an option this should just use the default for now<commit_after>require 'toolshed/error'
require 'toolshed/password'
require 'toolshed/timeout'

require 'net/ssh'

module Toolshed
  module ServerAdministration
    # SSH class that can ssh to a host and perform commands
    class SSH
      include Toolshed::Password

      attr_accessor :channel, :commands, :data, :host, :keys, :password, :ssh_options, :sudo_password, :user # rubocop:disable LineLength
      attr_reader :silent, :timeout

      def initialize(options = nil) # rubocop:disable AbcSize, CyclomaticComplexity, PerceivedComplexity, LineLength
        options ||= {}
        @password = options[:password] || ''
        @sudo_password = options[:sudo_password] || ''
        @keys = options[:keys] || ''
        @host = options[:host] || ''
        @user = options[:user] || ''
        @ssh_options = options[:ssh_options] || {}
        @commands = options[:commands] || ''
        @password = options[:password] || ''
        @data = []
        @silent = options[:silent] || false
        timeout_period = options[:timeout_period] || 30
        @timeout = Toolshed::Timeout.new(timeout_period: options[:timeout_period])

        set_ssh_options
      end
{'fraction_non_alphanumeric': 0.12595419847328243, 'fraction_numerical': 0.0021204410517387615, 'mean_word_length': 3.2351885098743267, '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': '400246', 'n_tokens_mistral': 691, 'n_tokens_neox': 653, 'n_words': 169}