<commit_before># -*- encoding : utf-8 -*-
module Forma

  module FieldHelper
    def text_field(name, opts={})
      opts[:name] = name
      add_field(Forma::TextField.new(opts))
    end

    def password_field(name, opts={})
      opts[:password] = true
      text_field(name, opts)
    end
  end

  # Form.
  class Form
    include Forma::Html
    include Forma::FieldHelper

    def initialize(h = {})
      h = h.symbolize_keys
      # general
      @id = h[:id]
      @theme = h[:theme] || 'blue'
      # title properties
      @title = h[:title]
      @icon = h[:icon]
      @collapsible = h[:collapsible]
      @collapsed = h[:collapsed]
      # submit options
      @url = h[:url]
      @submit = h[:submit] || 'Save'
      @method = h[:method] || 'get'
      @auth_token = h[:auth_token]
      # tabs
      @tabs = h[:tabs] || []
      @selected_tab = h[:selected_tab] || 0<commit_msg>post method is default<commit_after># -*- encoding : utf-8 -*-
module Forma

  module FieldHelper
    def text_field(name, opts={})
      opts[:name] = name
      add_field(Forma::TextField.new(opts))
    end

    def password_field(name, opts={})
      opts[:password] = true
      text_field(name, opts)
    end
  end

  # Form.
  class Form
    include Forma::Html
    include Forma::FieldHelper

    def initialize(h = {})
      h = h.symbolize_keys
      # general
      @id = h[:id]
      @theme = h[:theme] || 'blue'
      # title properties
      @title = h[:title]
      @icon = h[:icon]
      @collapsible = h[:collapsible]
      @collapsed = h[:collapsed]
      # submit options
      @url = h[:url]
      @submit = h[:submit] || 'Save'
      @method = h[:method] || 'post'
      @auth_token = h[:auth_token]
      # tabs
      @tabs = h[:tabs] || []
      @selected_tab = h[:selected_tab] || 0
{'fraction_non_alphanumeric': 0.15222222222222223, 'fraction_numerical': 0.0022222222222222222, 'mean_word_length': 2.2864963503649633, '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': '5785781', 'n_tokens_mistral': 610, 'n_tokens_neox': 599, 'n_words': 138}