<commit_before># Read about factories at https://github.com/thoughtbot/factory_girl

# Event examples pulled from http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CCsQFjAA&url=http%3A%2F%2Fwww.oclc.org%2Fresearch%2Fprojects%2Fpmwg%2Fpremis-examples.pdf&ei=JzCOUuuOAufLsASTgIKACA&usg=AFQjCNF3rVZ8JTF2IQEdWHCWZFC9eivcVQ&bvm=bv.56988011,d.cWc&cad=rja

FactoryGirl.define do

  factory :premis_event_ingest, class: PremisEventsMetadata do
    type { 'ingest' }
    date_time { "#{Time.now}" }
    detail { "copy to s3 preservation bucket aptrust_preservation" }
    outcome { "success" }
    outcome_detail { "Copied with MD5 put confirmation." }
    outcome_information { "Put using hash #{SecureRandom.hex(16)}" }
    object { "https://github.com/APTrust/fluctus" }
    # agent { "ruby s3 copy library" }
  end

  factory :premis_event_validation, class: PremisEventsMetadata do
    type { 'validation' }
    date_time { "#{Time.now}" }
    detail { "Check against bag manifest checksum" }
    outcome { "success" }
    object { "https://github.com/APTrust/bagins" }
    # agent { "ruby s3 copy library" }
  end

  factory :premis_event_fixity_generation, class: PremisEventsMetadata do
    type { 'fixity_generation' }
    date_time { "#{Time.now}" }
    detail { "Generation on file prior to copy to S3" }
    outcome { "sha256:#{SecureRandom.hex(32)}" }
    object { "https://github.com/APTrust/bagins" }
  end

  factory :premis_event_fixity_check, class: PremisEventsMetadata do
    type { 'fixity_check' }
    date_time { "#{Time.now}" }
    #detail { "copy to s3 preservation bucket aptrust_preservation" }
    outcome { "success" }
    # outcome_detail { "Copied with MD5 put confirmation." }
    # outcome_information { "Put using hash #{SecureRandom.hex(16)}" }
    object { "https://github.com/APTrust/fluctus" }
    # agent { "ruby s3 copy library" }
  end

  factory :premis_event_identifier, class: PremisEventsMetadata do
    type { 'identifier_assignment' }
    date_time { "#{Time.now}" }
    detail { "#{SecureRandom.hex(32)}" }
    outcome { "success" }
    outcome_detail { "Generated by factory for test purposes" }
    outcome_information { "" }
    #object { "https://github.com/APTrust/fluctus" }
    agent { "ruby SecureRandom.hex" }
  end

end<commit_msg>Better premis events factories with more accurate examples.<commit_after># Read about factories at https://github.com/thoughtbot/factory_girl

# Event examples pulled from http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CCsQFjAA&url=http%3A%2F%2Fwww.oclc.org%2Fresearch%2Fprojects%2Fpmwg%2Fpremis-examples.pdf&ei=JzCOUuuOAufLsASTgIKACA&usg=AFQjCNF3rVZ8JTF2IQEdWHCWZFC9eivcVQ&bvm=bv.56988011,d.cWc&cad=rja

FactoryGirl.define do

  factory :premis_event_ingest, class: PremisEventsMetadata do
    type { 'ingest' }
    date_time { "#{Time.now}" }
    detail { "Completed copy to S3 storage" }
    outcome { "success" }
    outcome_detail { "MD5:#{SecureRandom.hex(16)}" }
    outcome_information { "Multipart Put using md5 checksum" }
    object { "ruby aws-s3 gem" }
    agent { "https://github.com/marcel/aws-s3/tree/master" }
  end

  factory :premis_event_validation, class: PremisEventsMetadata do
    type { 'validation' }
    date_time { "#{Time.now}" }
    detail { "Check against bag manifest checksum" }
    outcome { "success" }
    object { "https://github.com/APTrust/bagins" }
    # agent { "ruby s3 copy library" }
  end

  factory :premis_event_fixity_generation, class: PremisEventsMetadata do
    type { 'fixity_generation' }
    date_time { "#{Time.now}" }
    detail { "Calculated new fixity value" }
    outcome { "success" }
    outcome_detail { "sha256:#{SecureRandom.hex(64)}" }
    object { "Go language cryptohash" }
    agent {"http://golang.org"}
  end

  factory :premis_event_fixity_check, class: PremisEventsMetadata do
    type { 'fixity_check' }
    date_time { "#{Time.now}" }
    detail { "Fixity check against registered hash" }
    outcome { "success" }
    outcome_detail { "SHA256:#{SecureRandom.hex(64)}" }
    outcome_information { "Fixity matches" }
    object { "Go language cryptohash" }
    agent { "http://golang.org/" }
  end

  factory :premis_event_identifier, class: PremisEventsMetadata do
    type { 'identifier_assignment' }
    date_time { "#{Time.now}" }
    detail { "S3 key generated for file" }
    outcome { "success" }
    outcome_detail { "#{SecureRandom.uuid()}" }
    outcome_information { "Generated with ruby SecureRandom.uuid()" }
    object { "Ruby 2.0.1" }
    agent { "http://www.ruby-doc.org/" }
    agent { "http://www.ruby-doc.org/" }
  end

end
{'fraction_non_alphanumeric': 0.1320673284419508, 'fraction_numerical': 0.017911091929218817, 'mean_word_length': 3.909957627118644, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 9, 'lorem ipsum': 0, 'www.': 6, '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': '2125112', 'n_tokens_mistral': 1719, 'n_tokens_neox': 1635, 'n_words': 326}