<commit_before>namespace :deploy do
  desc "Create the java installation package"
  task :java do
    pkg_name = "rubyrep-#{RR::VERSION::STRING}"

    system "rm -rf /tmp/#{pkg_name}"
    system "hg archive /tmp/#{pkg_name}"
    system "mkdir -p /tmp/#{pkg_name}/jruby"
    system "cp -r #{JRUBY_HOME}/* /tmp/#{pkg_name}/jruby/"
    system "cd /tmp/#{pkg_name}/jruby; rm -rf samples share/ri lib/ruby/gems/1.8/doc"
    File.open("/tmp/#{pkg_name}/rubyrep", 'w') do |f|
      f.write(<<EOS)
#!/bin/bash

script_dir="`dirname \"$0\"`"

jruby_path="$script_dir"/jruby/bin/jruby
rubyrep_path="$script_dir"/bin/rubyrep

$jruby_path $rubyrep_path $*
EOS
    end
    system "chmod a+x /tmp/#{pkg_name}/rubyrep"
    system "cd /tmp; rm -f #{pkg_name}.tar.gz; tar -czf #{pkg_name}.tar.gz #{pkg_name}"
    system "mkdir -p pkg"
    system "cp /tmp/#{pkg_name}.tar.gz pkg"
  end
end<commit_msg>Improvements to packaging of jruby version: adding of Windows BAT file; default specification of jruby option "--server" (higher performance, slower startup).<commit_after>namespace :deploy do

  BASH_FILE_CONTENT = <<'EOS'
#!/bin/bash

script_dir="`dirname \"$0\"`"

jruby_path="$script_dir"/jruby/bin/jruby
rubyrep_path="$script_dir"/bin/rubyrep

$jruby_path --server $rubyrep_path $*
EOS

  BAT_FILE_CONTENT = <<'EOS'.gsub(/^(.*)$/,"\\1\r")
@echo off
set jruby_path=%~dp0jruby\bin\jruby.bat
set rubyrep_path=%~dp0bin\rubyrep
%jruby_path% --server %rubyrep_path% %1 %2 %3 %4 %5 %6 %7 %8 %9
EOS

  desc "Create the java installation package"
  task :java do
    pkg_name = "rubyrep-#{RR::VERSION::STRING}"

    system "rm -rf /tmp/#{pkg_name}"
    system "hg archive /tmp/#{pkg_name}"
    system "mkdir -p /tmp/#{pkg_name}/jruby"
    system "cp -r #{JRUBY_HOME}/* /tmp/#{pkg_name}/jruby/"
    system "cd /tmp/#{pkg_name}/jruby; rm -rf samples share/ri lib/ruby/gems/1.8/doc"
    File.open("/tmp/#{pkg_name}/rubyrep.bat", 'w') {|f| f.write(BAT_FILE_CONTENT)}
    File.open("/tmp/#{pkg_name}/rubyrep", 'w') {|f| f.write(BASH_FILE_CONTENT)}
    system "chmod a+x /tmp/#{pkg_name}/rubyrep"
    system "cd /tmp; rm -f #{pkg_name}.zip; zip -r #{pkg_name}.zip #{pkg_name} >/dev/null"
    system "mkdir -p pkg"
    system "cp /tmp/#{pkg_name}.zip pkg"
  end
end
{'fraction_non_alphanumeric': 0.18730442556995977, 'fraction_numerical': 0.008046490835940992, 'mean_word_length': 3.782051282051282, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 4, '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': '3549605', 'n_tokens_mistral': 954, 'n_tokens_neox': 880, 'n_words': 200}