<commit_before>class Shady < Property
  def self.evaluate(form,field,value)
    form.field_value('name') =~ /Capone/
  end
  def self.render(question_html,property_value,question,form)
    if property_value
      %Q|<div class="shady">#{question_html}</div>|
    else
      question_html
    end
  end
end

class SampleForm < Form
def setup
  
  labeling(:postfix => ':')
  
  def_fields :properties => [Shady] do
    f 'name', :label => 'Name', :type => 'string', :constraints => {"required"=>true}
    f 'due_date', :label => 'Due Date', :type => 'date'
    f 'education', :label => 'Post-secondary formal education (years)', :type => 'integer', :constraints => {"range"=>"0-14"}
    f 'occupation', :label => 'Occupation', :type => 'string'
    f 'field_with_default', :label => 'FWD', :type => 'string', :default=> 'fish'
    f 'indexed_field_no_default', :label => 'AF', :type => 'string', :indexed_default_from_null_index => true
    f 'indexed_field_with_default', :label => 'AFWD', :type => 'string', :default=> 'cow',:indexed_default_from_null_index => true
    fo = f('fruit_other', :label => 'Other fruit', :type => 'string', :constraints => {"required"=>"fruit=other"})
    f 'fruit', :label => '', :type => 'string', :constraints => {"enumeration"=>[{"apple_mac"=>"Macintosh Apple"}, {"apple_mutsu"=>"Mutsu"}, {"pear"=>"Pear"}, {"banana"=>"Banana"}, {"other"=>"Other...*"}, {"x"=>"XOther...*"}], "required"=>true}, :followups => {'/other|x/' => fo}
    f 'breastfeeding', :label => 'BF', :type => 'string', :indexed_default_from_null_index => true
    f 'reverse_name_and_job', :label => 'reversed name and occupation', :type => 'string', :calculated => {
      :proc => Proc.new { |form,index| (form.field_value('name',index).to_s+form.field_value('occupation',index).to_s).reverse}
    }
  end
        
#  def_workflows do 
    workflow 'standard',{'logged' => 'Form Logged','completed'=> 'Form Completed','verifying'=>{:label => 'Form in verification',:validate => true}} do
    	action 'create',[nil] do<commit_msg>updated worflow definition in spec<commit_after>class Shady < Property
  def self.evaluate(form,field,value)
    form.field_value('name') =~ /Capone/
  end
  def self.render(question_html,property_value,question,form)
    if property_value
      %Q|<div class="shady">#{question_html}</div>|
    else
      question_html
    end
  end
end

class SampleForm < Form
def setup
  
  labeling(:postfix => ':')
  
  def_fields :properties => [Shady] do
    f 'name', :label => 'Name', :type => 'string', :constraints => {"required"=>true}
    f 'due_date', :label => 'Due Date', :type => 'date'
    f 'education', :label => 'Post-secondary formal education (years)', :type => 'integer', :constraints => {"range"=>"0-14"}
    f 'occupation', :label => 'Occupation', :type => 'string'
    f 'field_with_default', :label => 'FWD', :type => 'string', :default=> 'fish'
    f 'indexed_field_no_default', :label => 'AF', :type => 'string', :indexed_default_from_null_index => true
    f 'indexed_field_with_default', :label => 'AFWD', :type => 'string', :default=> 'cow',:indexed_default_from_null_index => true
    fo = f('fruit_other', :label => 'Other fruit', :type => 'string', :constraints => {"required"=>"fruit=other"})
    f 'fruit', :label => '', :type => 'string', :constraints => {"enumeration"=>[{"apple_mac"=>"Macintosh Apple"}, {"apple_mutsu"=>"Mutsu"}, {"pear"=>"Pear"}, {"banana"=>"Banana"}, {"other"=>"Other...*"}, {"x"=>"XOther...*"}], "required"=>true}, :followups => {'/other|x/' => fo}
    f 'breastfeeding', :label => 'BF', :type => 'string', :indexed_default_from_null_index => true
    f 'reverse_name_and_job', :label => 'reversed name and occupation', :type => 'string', :calculated => {
      :proc => Proc.new { |form,index| (form.field_value('name',index).to_s+form.field_value('occupation',index).to_s).reverse}
    }
  end
        
#  def_workflows do 
    workflow 'standard',['logged', 'Form Logged','completed', 'Form Completed','verifying',{:label => 'Form in verification',:validate => true}] do
    	action 'create',[nil] do
{'fraction_non_alphanumeric': 0.21293800539083557, 'fraction_numerical': 0.001470227885322225, 'mean_word_length': 4.915942028985508, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 110, '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': '3934724', 'n_tokens_mistral': 1413, 'n_tokens_neox': 1376, 'n_words': 305}