<commit_before>require 'generators/generic_api_rails/helpers'

module GenericApiRails
  module Generators
    class InstallGenerator < Rails::Generators::Base
      include GenericApiRails::Generators::Helpers

      source_root File.expand_path("../templates", __FILE__)

      desc "Mounts GenericApiRails into a rails app."

      def create_initializer
        template "initializer.rb", File.join('config','initializers','generic_api.rb')
      end

      def mount_engine
        inject_into_file routes_path, :after => "Application.routes.draw do\n" do
          "  mount GenericApiRails::Engine => '/api' \n"
        end
      end

    end
  end
end<commit_msg>Add the GAPI routes regardless of rails version<commit_after>require 'generators/generic_api_rails/helpers'

module GenericApiRails
  module Generators
    class InstallGenerator < Rails::Generators::Base
      include GenericApiRails::Generators::Helpers

      source_root File.expand_path("../templates", __FILE__)

      desc "Mounts GenericApiRails into a rails app."

      def create_initializer
        template "initializer.rb", File.join('config','initializers','generic_api.rb')
      end

      def mount_engine
        inject_into_file routes_path, :after => ".routes.draw do\n" do
          "  mount GenericApiRails::Engine => '/api' \n"
        end
      end

    end
  end
end
{'fraction_non_alphanumeric': 0.09257898603967671, 'fraction_numerical': 0.0, 'mean_word_length': 3.229813664596273, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '415978', 'n_tokens_mistral': 396, 'n_tokens_neox': 384, 'n_words': 94}