<commit_before>#!/usr/bin/env ruby
require "jekyll"

task default: ["helloworld"]

desc "this is a demo test"
task :helloworld do
  puts 'hello word'
end

namespace :deploy do
  # Usage:
  # bundle exec rake deploy:ghpages
  # bundle exec rake deploy:web3

  desc 'deploy to OSC servers'
  task :web3 do
    puts 'Make sure you are up-to-date with origin/master'
    system 'grunt build --env=production'
    if $? == 0
      system 'rsync -rlptv --delete _site/ <EMAIL>:/var/www/new-site -e "ssh -p 922"'
    else
      echo "Something went wrong while building. Check the grunt output and try again"
    end
  end

  desc 'deploy to Github Pages'
  task :ghpages do
    `grunt build --env=staging`
    origin = `git config --get remote.origin.url`

    Dir.mktmpdir do |tmp|
      cp_r '_site/.', tmp
      Dir.chdir tmp
      system 'rm -rf downloads'
      system 'git init'
      system "git add . && git commit -m 'Site updated at #{Time.now.utc}'"
      system "git remote add origin #{origin}"
      system 'git push origin master:refs/heads/gh-pages --force'
    end
  end
end<commit_msg>make deploy to web3 check for rsync (closes #171)<commit_after>#!/usr/bin/env ruby
require "jekyll"

task default: ["helloworld"]

desc "this is a demo test"
task :helloworld do
  puts 'hello word'
end

namespace :deploy do
  # Usage:
  # bundle exec rake deploy:ghpages
  # bundle exec rake deploy:web3

  desc 'deploy to OSC servers'
  task :web3 do
    # Check for rsync before building
    system('which rsync')
    if ($? != 0)
      print "The deploy requires rsync, please install it and try again."
      exit(255)
    end

    puts 'Make sure you are up-to-date with origin/master!'
    sleep(3)

    system 'grunt build --env=production'
    if $? == 0
      system 'rsync -rlptv --delete _site/ <EMAIL>:/var/www/new-site -e "ssh -p 922"'
    else
      echo "Something went wrong while building. Check the grunt output and try again"
    end
  end

  desc 'deploy to Github Pages'
  task :ghpages do
    `grunt build --env=staging`
    origin = `git config --get remote.origin.url`

    Dir.mktmpdir do |tmp|
      cp_r '_site/.', tmp
      Dir.chdir tmp
      system 'rm -rf downloads'
      system 'git init'
      system "git add . && git commit -m 'Site updated at #{Time.now.utc}'"
      system "git remote add origin #{origin}"
      system 'git push origin master:refs/heads/gh-pages --force'
    end
  end
end
{'fraction_non_alphanumeric': 0.10762886597938144, 'fraction_numerical': 0.00865979381443299, 'mean_word_length': 2.6426426426426426, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3565234', 'n_tokens_mistral': 835, 'n_tokens_neox': 794, 'n_words': 302}