<commit_before>module CustomAttributes
	module Mapper
    class Configuration
      Map = {
        "textfield" => "CustomAttributes::Textfield",
        "textarea" => "CustomAttributes::Textarea",
        "datefield" => "CustomAttributes::Datefield"
      }

      def self.available_fields
        Map.keys
      end

      def self.custom_value_type(field_type)
        Map[field_type]
      end
    end

    module ViewHelpers
      def form_element_custom_value(form,form_type,options)
        case form_type
        when "textfield" then form.text_field :value, {:"data-custom-attribute-type"=>"string"}.merge(options[:input_options] || nil)
        when "datefield" then form.text_field :value, {:"data-custom-attribute-type"=>"date"}.merge(options[:input_options] || nil)
        when "textarea"  then form.text_area :value,  {:"data-custom-attribute-type"=>"text"}.merge(options[:input_options] || nil)
        end
      end
    end 
	end
end<commit_msg>removed bootstrap datepicker dependency and enable overiding the default input template<commit_after>module CustomAttributes
	module Mapper
    class Configuration
      Map = {
        "textfield" => "CustomAttributes::Textfield",
        "textarea" => "CustomAttributes::Textarea",
        "datefield" => "CustomAttributes::Datefield"
      }

      def self.available_fields
        Map.keys
      end

      def self.custom_value_type(field_type)
        Map[field_type]
      end
    end

    module ViewHelpers
      def form_element_custom_value(form,form_type,options)
        if self.public_methods.include?(:"custom_attribute_#{form_type}")
          self.send(:"custom_attribute_#{form_type}", form, options)
        else
          case form_type
          when "textfield" then form.text_field :value, {:"data-custom-attribute-type"=>"string"}.merge(options[:input_options] || nil)
          when "datefield" then form.text_field :value, {:"data-custom-attribute-type"=>"date"}.merge(options[:input_options] || nil)
          when "textarea"  then form.text_area :value,  {:"data-custom-attribute-type"=>"text"}.merge(options[:input_options] || nil)
          end
        end
      end
    end 
	end
end
{'fraction_non_alphanumeric': 0.1184573002754821, 'fraction_numerical': 0.0, 'mean_word_length': 3.119092627599244, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '1532542', 'n_tokens_mistral': 643, 'n_tokens_neox': 630, 'n_words': 124}