<commit_before>require 'generators/backbonify/resource_helpers'

module Backbonify
  module Generators
    class InstallGenerator < Rails::Generators::Base
      include Backbonify::Generators::ResourceHelpers

      source_root File.expand_path("../templates", __FILE__)
      desc "This generator installs backbone.js with a default folder layout in app/assets/javascripts/backbone"
      class_option :skip_git, :type => :boolean, :aliases => "-G", :default => true,
                              :desc => "Skip Git ignores and keeps"

      def copy_javascripts_libs_to_vendor
        directory("../../../../../lib/assets/javascripts/", "vendor/assets/javascripts/", :recursive => true)
      end


      def inject_backbone
        inject_into_file "app/assets/javascripts/application.js", :before => "//= require_tree" do
a = %{
//= require json2<commit_msg>skip_require useful for vendor/updates<commit_after>require 'generators/backbonify/resource_helpers'

module Backbonify
  module Generators
    class InstallGenerator < Rails::Generators::Base
      include Backbonify::Generators::ResourceHelpers

      source_root File.expand_path("../templates", __FILE__)
      desc "This generator installs backbone.js with a default folder layout in app/assets/javascripts/backbone"
      class_option :skip_git, :type => :boolean, :aliases => "-G", :default => true,
                   :desc => "Skip Git ignores and keeps"
      class_option :skip_require, :type => :boolean, :aliases => "-R", :default => true,
                   :desc => "Skip injection of requires in app.js (-U), usefeul for updates"

      def copy_javascripts_libs_to_vendor
        directory("../../../../../lib/assets/javascripts/", "vendor/assets/javascripts/", :recursive => true)
      end


      def inject_backbone
        return if options[:skip_requires]
        inject_into_file "app/assets/javascripts/application.js", :before => "//= require_tree" do
a = %{
//= require json2
{'fraction_non_alphanumeric': 0.12512716174974567, 'fraction_numerical': 0.001017293997965412, 'mean_word_length': 3.202991452991453, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, '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': '5103488', 'n_tokens_mistral': 560, 'n_tokens_neox': 540, 'n_words': 138}