<commit_before><%
ace_gem_path = Bundler.rubygems.find_name('ace-rails-ap').first.full_gem_path
ace_workers = Dir[ace_gem_path + '/vendor/assets/javascripts/ace/worker-*.js'].sort.map do |file|
  File.basename(file, '.js').sub(/^worker-/, '')
end
ace_modes = Dir[ace_gem_path + '/vendor/assets/javascripts/ace/mode-*.js'].sort.map do |file|
  File.basename(file, '.js').sub(/^mode-/, '')
end
%>

(function() {
  window.gon = window.gon || {};
  var basePath = (window.gon.relative_url_root || '').replace(/\/$/, '') + '/assets/ace';
  ace.config.set('basePath', basePath);

  // configure paths for all worker modules
<% ace_workers.each do |worker| %>
  ace.config.setModuleUrl('ace/mode/<%= worker %>_worker', basePath + '/worker-<%= worker %>.js');
<% end %>

  // configure paths for all mode modules
<% ace_modes.each do |mode| %>
  ace.config.setModuleUrl('ace/mode/<%= mode %>', basePath + '/mode-<%= mode %>.js');
<% end %>
})();<commit_msg>fix ace editor modules to include asset digest in production<commit_after><%
ace_gem_path = Bundler.rubygems.find_name('ace-rails-ap').first.full_gem_path
ace_workers = Dir[ace_gem_path + '/vendor/assets/javascripts/ace/worker-*.js'].sort.map do |file|
  File.basename(file, '.js').sub(/^worker-/, '')
end
ace_modes = Dir[ace_gem_path + '/vendor/assets/javascripts/ace/mode-*.js'].sort.map do |file|
  File.basename(file, '.js').sub(/^mode-/, '')
end
%>

(function() {
  window.gon = window.gon || {};
  var basePath = (window.gon.relative_url_root || '').replace(/\/$/, '') + '/assets/ace';
  ace.config.set('basePath', basePath);

  // configure paths for all worker modules
<% ace_workers.each do |worker| %>
  <% filename = File.basename(asset_path("ace/worker-#{worker}.js")) %>
  ace.config.setModuleUrl('ace/mode/<%= worker %>_worker', basePath + '/<%= filename %>');
<% end %>

  // configure paths for all mode modules
<% ace_modes.each do |mode| %>
  <% filename = File.basename(asset_path("ace/mode-#{mode}.js")) %>
  ace.config.setModuleUrl('ace/mode/<%= mode %>', basePath + '/<%= filename %>');
<% end %>
})();
{'fraction_non_alphanumeric': 0.22479498311625662, 'fraction_numerical': 0.0, 'mean_word_length': 4.317948717948718, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, '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': '5996222', 'n_tokens_mistral': 764, 'n_tokens_neox': 723, 'n_words': 133}