<commit_before>def rubies = ["2.1.6", "2.2.2"]
def platforms = ["osx", "linux-x86", "linux-x86_64"]

rubies.each { ruby ->
  job("ruby-${ruby}-unit-test") {
    description("Unit test against Ruby version ${ruby}")

    scm {
      git {
	remote {
	  github("jdenen/dow")
	}
	extensions {
	  cleanBeforeCheckout()
	}
      }
    }

    triggers {
      scm("H/5 * * * *")
    }

    wrappers {
      rbenv("${ruby}") {
	ignoreLocalVersion()
	gems("bundler", "rake")
      }
    }

    steps {
      shell("bundle check || bundle install")
      shell("bundle exec rspec -f RspecJunitFormatter -o result/ruby-${ruby}-unit-test.xml -f progress")
    }

    publishers {
      archiveJunit("result/*.xml")
      mailer('', true, true)
    }
    
    platforms.each { pf ->
      publishers {
        downstream("ruby-${ruby}-${pf}-build", "SUCCESS")
      }
    }  
  }

  platforms.each { pf ->
    job("ruby-${ruby}-${pf}-build") {
      description("Build for Ruby ${ruby} on ${pf}")
<commit_msg>Add Jenkins smoke test job for OSX builds<commit_after>def rubies = ["2.1.6", "2.2.2"]
def platforms = ["osx", "linux-x86", "linux-x86_64"]

rubies.each { ruby ->
  job("ruby-${ruby}-unit-test") {
    description("Unit test against Ruby version ${ruby}")

    scm {
      git {
	remote {
	  github("jdenen/dow")
	}
	extensions {
	  cleanBeforeCheckout()
	}
      }
    }

    triggers {
      scm("H/5 * * * *")
    }

    wrappers {
      rbenv("${ruby}") {
	ignoreLocalVersion()
	gems("bundler", "rake")
      }
    }

    steps {
      shell("bundle check || bundle install")
      shell("bundle exec rspec -f RspecJunitFormatter -o result/ruby-${ruby}-unit-test.xml -f progress")
    }

    publishers {
      archiveJunit("result/*.xml")
      mailer('', true, true)
    }
    
    platforms.each { pf ->
      publishers {
        downstream("ruby-${ruby}-${pf}-build", "SUCCESS")
      }
    }  
  }

  job("ruby-${ruby}-osx-smoke-test") {
    description("Smoke test the build artifact on OSX")

    scm {
      git {
	remote {
	  github("jdenen/dow")
	}
	extensions {
	  cleanBeforeCheckout()
	}
      }
    }

    steps {
      copyArtifacts("ruby-${ruby}-osx-build") {
	includePatterns("*.gz")
	buildSelector {
	  latestSuccessful(true)
	}
      }
      shell("mkdir spec/support")
      shell("tar -xzf dow-${ruby}-osx.tar.gz")
      shell("mv dow-${ruby}-osx/* spec/support")
      shell("bundle check || bundle install")
      shell("TEST_ARTIFACT=1 bundle exec rspec -f RspecJunitFormatter -o result/dow-${ruby}-osx-smoke-test.xml -f progress")
    }

    publishers {
      archiveJunit("result/*.xml")
      mailer('', true, true)
    }
  }

  platforms.each { pf ->
    job("ruby-${ruby}-${pf}-build") {
      description("Build for Ruby ${ruby} on ${pf}")

{'fraction_non_alphanumeric': 0.17863587152652471, 'fraction_numerical': 0.009743774810537712, 'mean_word_length': 2.36, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, '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': '1332849', 'n_tokens_mistral': 1043, 'n_tokens_neox': 981, 'n_words': 181}