<commit_before>require "rails-routes-js-utils/version"
require "rails-routes-js-utils/engine"
require "regex"
module Rails
  module Routes
    module Js
      module Utils
        def self.generate
          all_routes = ENV['CONTROLLER'] ? Rails.Application.routes.select { |route| route.defaults[:controller] == ENV['CONTROLLER'] } : IMuaSam::Application.routes
          all_routes.routes.collect do |route|
            compiled_regex = route.path.to_regexp.to_javascript
            reqs = route.defaults.merge(parts: route.parts)
            if route.name
              "addRouteToEnv({name: '#{route.name}', path: #{compiled_regex} , reqs: #{reqs}});"
            end
          end.join("\n");
        end

      end
    end
  end
end<commit_msg>Use builtin routes implementation instead<commit_after>require "rails-routes-js-utils/version"
require "rails-routes-js-utils/engine"
require "regex"
module Rails
  module Routes
    module Js
      module Utils
        def self.generate
          all_routes = ENV['CONTROLLER'] ? Rails.Application.routes.select { |route| route.defaults[:controller] == ENV['CONTROLLER'] } : IMuaSam::Application.routes
          all_routes.routes.collect do |route|
            compiled_regex = route.path.to_regexp.to_javascript
            reqs = route.defaults.merge(parts: route.parts)
            if route.name
              "addRouteToEnv({name: '#{route.name}', path: #{compiled_regex} , reqs: #{reqs.to_json}});"
            end
          end.join("\n");
        end

      end
    end
  end
end
{'fraction_non_alphanumeric': 0.12012987012987013, 'fraction_numerical': 0.0, 'mean_word_length': 2.5671296296296298, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1334523', 'n_tokens_mistral': 470, 'n_tokens_neox': 473, 'n_words': 95}