<commit_before>require 'rails/generators'
require 'rails'

module Uswds
  module Generators
    class InstallGenerator < Rails::Generators::Base

      desc "This generator installs USWDS framework to Asset Pipeline"
      def add_assets
        js_inject = " //= require uswds"
        app_js = File.join(Rails.root, 'app', 'assets', 'javascripts', 'application.js')
        css_inject = " *= require uswds"
        app_scss = File.join(Rails.root, 'app', 'assets', 'stylesheets', 'application.scss')
        app_css = File.join(Rails.root, 'app', 'assets', 'stylesheets', 'application.css')

        if File.exist?(app_js)
          insert_into_file app_js, js_inject, :after => "require jjquery\n"
        else
          say_status('','Nor application.js could not be found!')
        end

        if File.exist?(app_scss)
          insert_into_file app_scss, css_inject, :after => "require_self\n"
        elsif File.exist?(app_css)
          insert_into_file app_css, css_inject, :after => "require_self\n"
        else
          say_status('','Nor application.css/application.scss could not be found!')
        end
      end
    end
  end
end
<commit_msg>Update install generator - unfortunate typo.<commit_after>require 'rails/generators'
require 'rails'

module Uswds
  module Generators
    class InstallGenerator < Rails::Generators::Base

      desc "This generator installs USWDS framework to Asset Pipeline"
      def add_assets
        js_inject = " //= require uswds"
        app_js = File.join(Rails.root, 'app', 'assets', 'javascripts', 'application.js')
        css_inject = " *= require uswds"
        app_scss = File.join(Rails.root, 'app', 'assets', 'stylesheets', 'application.scss')
        app_css = File.join(Rails.root, 'app', 'assets', 'stylesheets', 'application.css')

        if File.exist?(app_js)
          insert_into_file app_js, js_inject, :after => "require jquery\n"
        else
          say_status('','Nor application.js could not be found!')
        end

        if File.exist?(app_scss)
          insert_into_file app_scss, css_inject, :after => "require_self\n"
        elsif File.exist?(app_css)
          insert_into_file app_css, css_inject, :after => "require_self\n"
        else
          say_status('','Nor application.css/application.scss could not be found!')
        end
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.11649659863945579, 'fraction_numerical': 0.0, 'mean_word_length': 2.8322475570032575, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2006375', 'n_tokens_mistral': 747, 'n_tokens_neox': 729, 'n_words': 180}