<commit_before>require File.expand_path("../base", __FILE__)

module VagrantPlugins
  module Chef
    module Config
      class ChefSolo < Base
        attr_accessor :cookbooks_path
        attr_accessor :roles_path
        attr_accessor :data_bags_path
        attr_accessor :recipe_url
        attr_accessor :nfs
        attr_accessor :encrypted_data_bag_secret_key_path
        attr_accessor :encrypted_data_bag_secret

        def initialize
          super

          @cookbooks_path            = UNSET_VALUE
          @data_bags_path            = UNSET_VALUE
          @recipe_url                = UNSET_VALUE
          @roles_path                = UNSET_VALUE
          @encrypted_data_bag_secret = UNSET_VALUE
          @encrypted_data_bag_secret_key_path = UNSET_VALUE
          @nfs                       = UNSET_VALUE
        end

        def finalize!
          if @cookbooks_path == UNSET_VALUE
            @cookbooks_path = [[:host, "cookbooks"], [:vm, "cookbooks"]]
          end

          # Make sure all the paths are the proper format
          @cookbooks_path.map! do |path|
            path = [:host, path] if !path.is_a?(Array)
            path
          end

          @data_bags_path = [] if @data_bags_path == UNSET_VALUE
          @encrypted_data_bag_secret = "/tmp/encrypted_data_bag_secret" if \
            @encrypted_data_bag_secret == UNSET_VALUE<commit_msg>Fix a regression where cookbooks path must be an array<commit_after>require File.expand_path("../base", __FILE__)

module VagrantPlugins
  module Chef
    module Config
      class ChefSolo < Base
        attr_accessor :cookbooks_path
        attr_accessor :roles_path
        attr_accessor :data_bags_path
        attr_accessor :recipe_url
        attr_accessor :nfs
        attr_accessor :encrypted_data_bag_secret_key_path
        attr_accessor :encrypted_data_bag_secret

        def initialize
          super

          @cookbooks_path            = UNSET_VALUE
          @data_bags_path            = UNSET_VALUE
          @recipe_url                = UNSET_VALUE
          @roles_path                = UNSET_VALUE
          @encrypted_data_bag_secret = UNSET_VALUE
          @encrypted_data_bag_secret_key_path = UNSET_VALUE
          @nfs                       = UNSET_VALUE
        end

        def finalize!
          if @cookbooks_path == UNSET_VALUE
            @cookbooks_path = [[:host, "cookbooks"], [:vm, "cookbooks"]]
          end

          # Make sure the path is an array.
          @cookbooks_path = [@cookbooks_path] if \
            !@cookbooks_path.is_a?(Array) || @cookbooks_path.first.is_a?(Symbol)

          # Make sure all the paths are the proper format
          @cookbooks_path.map! do |path|
            path = [:host, path] if !path.is_a?(Array)
            path
          end

          @data_bags_path = [] if @data_bags_path == UNSET_VALUE
          @encrypted_data_bag_secret = "/tmp/encrypted_data_bag_secret" if \
            @encrypted_data_bag_secret == UNSET_VALUE
{'fraction_non_alphanumeric': 0.06608811748998665, 'fraction_numerical': 0.0, 'mean_word_length': 1.9324853228962817, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3861449', 'n_tokens_mistral': 911, 'n_tokens_neox': 903, 'n_words': 186}