<commit_before>module Refinery
  module Pages
    class Type

      attr_accessor :name, :parts, :template

      def parts
        @parts ||= []
      end

      def template
        @template ||= "refinery/pages/#{name}"
      end

    end
  end
end
<commit_msg>Update Refinery::Pages::Type#parts= writer to rewrite arrays of string part titles and print a deprecation notice<commit_after>module Refinery
  module Pages
    class Type

      attr_accessor :name, :parts, :template

      def parts=(new_parts)
        @parts = if new_parts.all? { |v| v.is_a?(String) }
          new_syntax = new_parts.map do |part|
            { title: part, slug: part.downcase.gsub(" ", "_") }
          end
          Refinery.deprecate(
            "Change Refinery::Pages.default_parts= from #{@parts} to #{new_syntax}",
            when: "4.1.0"
          )
          new_syntax
        else
          new_parts
        end
      end

      def parts
        @parts ||= []
      end

      def template
        @template ||= "refinery/pages/#{name}"
      end

    end
  end
end

{'fraction_non_alphanumeric': 0.10373831775700934, 'fraction_numerical': 0.002803738317757009, 'mean_word_length': 1.8636363636363635, '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': '7298287', 'n_tokens_mistral': 336, 'n_tokens_neox': 319, 'n_words': 88}