<commit_before>module Roxanne
  class InstallGenerator < Rails::Generators::Base
    source_root File.expand_path("../templates", __FILE__)

    desc "include javascript and stylesheets for roxanne"
    def add_assets
      append_to_file "app/assets/javascripts/application.js", "//= require roxanne/application\n"
      insert_into_file "app/assets/stylesheets/application.css", " *= require 'roxanne/roxanne'\n", :before => '*/'
      insert_into_file "app/assets/stylesheets/application.css", " *= require 'roxanne/toolbar'\n", :before => '*/'
    end

    desc "enables authentication"
    def add_authentication
      copy_file "sorcery.rb", "config/initializers/sorcery.rb"
      insert_into_file "app/controllers/application_controller.rb", "  before_filter :protected_controllers\n", :before => "end"
    end

    desc "prepare views"
    def prepare_views
      remove_file "app/views/layouts/application.html.erb"
      copy_file "application.html.haml", "app/views/layouts/application.html.haml"
      copy_file "mercury.html.erb", "app/views/layouts/mercury.html.erb"
      directory "contents", "app/views/contents/"
      directory "pages", "app/views/pages/"
      empty_directory "app/views/templates"
    end

    desc "add Roxanne routes"
    def mount
      route "mount Roxanne::Engine => '/roxanne'"
    end

    desc "migrate database"
    def migrate_database
      rake "roxanne:install:migrations"
    	rake "db:migrate"
    end

    desc "load seeds"
    def load_seeds
      rake "roxanne:seed"
    end

    desc "remove defaults"
    def remove_defaults
      remove_file 'public/index.html'
      remove_file 'app/assets/images/rails.png'
    end

  end
end<commit_msg>add templates subdirectories to generator install<commit_after>module Roxanne
  class InstallGenerator < Rails::Generators::Base
    source_root File.expand_path("../templates", __FILE__)

    desc "include javascript and stylesheets for roxanne"
    def add_assets
      append_to_file "app/assets/javascripts/application.js", "//= require roxanne/application\n"
      insert_into_file "app/assets/stylesheets/application.css", " *= require 'roxanne/roxanne'\n", :before => '*/'
      insert_into_file "app/assets/stylesheets/application.css", " *= require 'roxanne/toolbar'\n", :before => '*/'
    end

    desc "enables authentication"
    def add_authentication
      copy_file "sorcery.rb", "config/initializers/sorcery.rb"
      insert_into_file "app/controllers/application_controller.rb", "  before_filter :protected_controllers\n", :before => "end"
    end

    desc "prepare views"
    def prepare_views
      remove_file "app/views/layouts/application.html.erb"
      copy_file "application.html.haml", "app/views/layouts/application.html.haml"
      copy_file "mercury.html.erb", "app/views/layouts/mercury.html.erb"
      directory "contents", "app/views/contents/"
      directory "pages", "app/views/pages/"
      empty_directory "app/views/templates"
      empty_directory "app/views/templates/snippets"
      empty_directory "app/views/templates/sections"
      empty_directory "app/views/templates/lists"
    end

    desc "add Roxanne routes"
    def mount
      route "mount Roxanne::Engine => '/roxanne'"
    end

    desc "migrate database"
    def migrate_database
      rake "roxanne:install:migrations"
    	rake "db:migrate"
    end

    desc "load seeds"
    def load_seeds
      rake "roxanne:seed"
    end

    desc "remove defaults"
    def remove_defaults
      remove_file 'public/index.html'
      remove_file 'app/assets/images/rails.png'
    end

  end
end
{'fraction_non_alphanumeric': 0.11337047353760446, 'fraction_numerical': 0.0, 'mean_word_length': 3.3633049817739975, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '6075026', 'n_tokens_mistral': 1148, 'n_tokens_neox': 1108, 'n_words': 230}