<commit_before>require 'pathname'

module Rails
  module AppRailsLoader
    RUBY = File.join(*RbConfig::CONFIG.values_at("bindir", "ruby_install_name")) + RbConfig::CONFIG["EXEEXT"]
    EXECUTABLES = ['bin/rails', 'script/rails']

    def self.exec_app_rails
      cwd   = Dir.pwd

      exe   = find_executable
      exe ||= find_executable_in_parent_path
      return unless exe

      if File.read(exe) =~ /(APP|ENGINE)_PATH/
        # This is a Rails-generated binstub, let's use it
        exec RUBY, exe, *ARGV if find_executable
        Dir.chdir("..") do
          # Recurse in a chdir block: if the search fails we want to be sure
          # the application is generated in the original working directory.
          exec_app_rails unless cwd == Dir.pwd
        end
      elsif exe.match(%r(bin/rails$))
        # this is a Bundler binstub, so we load the app ourselves
        Object.const_set(:APP_PATH, File.expand_path('config/application',  Dir.pwd))
        require File.expand_path('../boot', APP_PATH)
        puts "Your bin/rails file has been overwritten by Bundler."
        puts "To update your bin/rails for Rails 4, please run: `bundle " \
          "config --delete binstubs`, then `rm -rf bin`, then `rake " \
          "rails:update:bin`, then add bin/ to your source control."
        require 'rails/commands'<commit_msg>need to delete bin, not binstub, update wording<commit_after>require 'pathname'

module Rails
  module AppRailsLoader
    RUBY = File.join(*RbConfig::CONFIG.values_at("bindir", "ruby_install_name")) + RbConfig::CONFIG["EXEEXT"]
    EXECUTABLES = ['bin/rails', 'script/rails']

    def self.exec_app_rails
      cwd   = Dir.pwd

      exe   = find_executable
      exe ||= find_executable_in_parent_path
      return unless exe

      if File.read(exe) =~ /(APP|ENGINE)_PATH/
        # This is a Rails-generated binstub, let's use it
        exec RUBY, exe, *ARGV if find_executable
        Dir.chdir("..") do
          # Recurse in a chdir block: if the search fails we want to be sure
          # the application is generated in the original working directory.
          exec_app_rails unless cwd == Dir.pwd
        end
      elsif exe.match(%r(bin/rails$))
        # this is a Bundler binstub, so we load the app ourselves
        Object.const_set(:APP_PATH, File.expand_path('config/application',  Dir.pwd))
        require File.expand_path('../boot', APP_PATH)
        puts "Rails 4 no longer supports Bundler's --binstub option. You " \
          "will need to disable it and update your bin/rails file.\n" \
          "Please run: `bundle config --delete bin && rm -rf bin`, then " \
          "`rake rails:update:bin` and add the resulting bin/ to git."
        require 'rails/commands'
{'fraction_non_alphanumeric': 0.10434148121123678, 'fraction_numerical': 0.0007296607077708865, 'mean_word_length': 2.626984126984127, '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': '4924040', 'n_tokens_mistral': 891, 'n_tokens_neox': 833, 'n_words': 266}