<commit_before>require_relative '../feature/ruby/merge_gem'

module IronWorkerNG
  class Builder < Code

    def initialize(src)
      @features = []
      @base_dir = ''
      @dest_dir = ''

      @name = nil
      @exec = nil

      runtime 'ruby'

      gem 'iron_worker_ng'

      file(File.open(Dir.mktmpdir + '/__builder__.sh') do |f|
             f <<BUILDER_SH
# iron_worker_ng-#{IronWorkerNG.full_version}
#{src.remote_build_command}
BUILDER_SH
           end.path)

      exec(File.open(Dir.mktmpdir + '/__builder__.rb', 'w') do |f|
             f <<BUILDER_RUBY
# iron_worker_ng-#{IronWorkerNG.full_version}

require 'iron_worker_ng'
require 'json'

exit 1 unless system('cd __build__ && sh ../__builder__.sh && cd ..')

Dir.chdir('__build__')

code = IronWorkerNG::Code.new do
  runtime '#{src.runtime}'
  name '#{src.code_name}'
  exec '#{src.exec}'
  dir '.'
end

client = IronWorkerNG::Client.new(:token => params[:iron_token], :project_id => params[:iron_project_id])

res = client.codes.create(code, JSON.parse(params[:codes_create_options]))

client.tasks.set_progress(iron_task_id, :msg => res.marshal_dump.to_json)
BUILDER_RUBY
           end.path)
    end
  end
end<commit_msg>builder quickfix<commit_after>require_relative '../feature/ruby/merge_gem'

module IronWorkerNG
  class Builder < Code

    def initialize(src)
      @features = []
      @base_dir = ''
      @dest_dir = ''

      @name = nil
      @exec = nil

      runtime 'ruby'

      gem 'iron_worker_ng'

      file(File.open(Dir.mktmpdir + '/__builder__.sh') do |f|
             f <<BUILDER_SH
# iron_worker_ng-#{IronWorkerNG.full_version}
#{src.remote_build_command}
BUILDER_SH
           end.path)

      exec(File.open(Dir.mktmpdir + '/__builder__.rb', 'w') do |f|
             f <<BUILDER_RUBY
# iron_worker_ng-#{IronWorkerNG.full_version}

require 'iron_worker_ng'
require 'json'

exit 1 unless system('cd __build__ && sh ../__builder__.sh && cd ..')

Dir.chdir('__build__')

code = IronWorkerNG::Code.new do
  runtime '#{src.runtime}'
  name '#{src.name}'
  exec '#{src.exec}'
  dir '.'
end

client = IronWorkerNG::Client.new(:token => params[:iron_token], :project_id => params[:iron_project_id])

res = client.codes.create(code, JSON.parse(params[:codes_create_options]))

client.tasks.set_progress(iron_task_id, :msg => res.marshal_dump.to_json)
BUILDER_RUBY
           end.path)
    end
  end
end
{'fraction_non_alphanumeric': 0.14440734557595994, 'fraction_numerical': 0.0008347245409015025, 'mean_word_length': 3.3267148014440435, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 9, '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': '5376266', 'n_tokens_mistral': 863, 'n_tokens_neox': 846, 'n_words': 156}