<commit_before>require 'chef/knife'
require 'knife-solo/ssh_command'
require 'knife-solo/kitchen_command'
require 'knife-solo/node_config_command'

class Chef
  class Knife
    # Approach ported from littlechef (https://github.com/tobami/littlechef)
    # Copyright 2010, 2011, <NAME> <<EMAIL>>
    class SoloPrepare < Knife
      include KnifeSolo::SshCommand
      include KnifeSolo::KitchenCommand
      include KnifeSolo::NodeConfigCommand

      deps do
        require 'knife-solo/bootstraps'
        KnifeSolo::SshCommand.load_deps
        KnifeSolo::NodeConfigCommand.load_deps
      end

      banner "knife solo prepare [USER@]HOSTNAME [JSON] (options)"

      option :omnibus_url,
        :long        => '--omnibus-url URL',
        :description => 'URL to download install.sh from'

      option :omnibus_options,
        :long        => '--omnibus-options "OPTIONS"',
        :description => 'Pass options to the install.sh script'

      option :omnibus_version,
        :long        => '--omnibus-version VERSION',
        :description => 'The version of Omnibus to install'

      def run
        if config[:omnibus_version]
          config[:omnibus_options] = "#{config[:omnibus_options]} -v #{config[:omnibus_version]}".strip
        end

        validate!
        bootstrap.bootstrap!
        generate_node_config
      end

      def validate!
        validate_first_cli_arg_is_a_hostname!
        validate_kitchen!
      end

      def bootstrap
        ui.msg "Bootstrapping Chef..."
        KnifeSolo::Bootstraps.class_for_operating_system(operating_system()).new(self)
      end

      def operating_system
        @operating_system ||= run_command('uname -s').stdout.strip
      end
    end<commit_msg>Remove singleton instance variable for #operating_system<commit_after>require 'chef/knife'
require 'knife-solo/ssh_command'
require 'knife-solo/kitchen_command'
require 'knife-solo/node_config_command'

class Chef
  class Knife
    # Approach ported from littlechef (https://github.com/tobami/littlechef)
    # Copyright 2010, 2011, <NAME> <<EMAIL>>
    class SoloPrepare < Knife
      include KnifeSolo::SshCommand
      include KnifeSolo::KitchenCommand
      include KnifeSolo::NodeConfigCommand

      deps do
        require 'knife-solo/bootstraps'
        KnifeSolo::SshCommand.load_deps
        KnifeSolo::NodeConfigCommand.load_deps
      end

      banner "knife solo prepare [USER@]HOSTNAME [JSON] (options)"

      option :omnibus_url,
        :long        => '--omnibus-url URL',
        :description => 'URL to download install.sh from'

      option :omnibus_options,
        :long        => '--omnibus-options "OPTIONS"',
        :description => 'Pass options to the install.sh script'

      option :omnibus_version,
        :long        => '--omnibus-version VERSION',
        :description => 'The version of Omnibus to install'

      def run
        if config[:omnibus_version]
          config[:omnibus_options] = "#{config[:omnibus_options]} -v #{config[:omnibus_version]}".strip
        end

        validate!
        bootstrap.bootstrap!
        generate_node_config
      end

      def validate!
        validate_first_cli_arg_is_a_hostname!
        validate_kitchen!
      end

      def bootstrap
        ui.msg "Bootstrapping Chef..."
        KnifeSolo::Bootstraps.class_for_operating_system(operating_system).new(self)
      end

      def operating_system
        run_command('uname -s').stdout.strip
      end
    end
{'fraction_non_alphanumeric': 0.09634742594190394, 'fraction_numerical': 0.004601668104687949, 'mean_word_length': 2.6457023060796647, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 21, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2861270', 'n_tokens_mistral': 1134, 'n_tokens_neox': 1062, 'n_words': 227}