<commit_before>module Derail::Generators
  class LayoutGenerator < Base
    source_root File.expand_path("../../../../templates/layout", __FILE__)

    def install_haml_and_compass
      insert_into_file "Gemfile", "gem 'haml-rails'\n", :after => "# Views helpers\n"

      # Make sure this goes above sass-rails so *_path helpers are overridden
      insert_into_file "Gemfile", "  gem 'compass', :git => 'git://github.com/chriseppstein/compass.git', :branch => 'rails31'\n", :before => /\n  gem 'sass-rails'/

      bundle_install
    end

    def remove_erb
      remove_file "app/views/layouts/application.html.erb"
    end

    def copy_sass_layout
      # Yes, we *do* want to override
      copy_file "application.css.sass", "app/assets/stylesheets/application.css.sass"
    end

    def copy_haml_layouts
      copy_file "application.html.haml", "app/views/layouts/application.html.haml"
      copy_file "canvas.html.haml", "app/views/layouts/canvas.html.haml"
    end
  end
end<commit_msg>Add default layout to ApplicationController<commit_after>module Derail::Generators
  class LayoutGenerator < Base
    source_root File.expand_path("../../../../templates/layout", __FILE__)

    def install_haml_and_compass
      insert_into_file "Gemfile", "gem 'haml-rails'\n", :after => "# Views helpers\n"

      # Make sure this goes above sass-rails so *_path helpers are overridden
      insert_into_file "Gemfile", "  gem 'compass', :git => 'git://github.com/chriseppstein/compass.git', :branch => 'rails31'\n", :before => /\n  gem 'sass-rails'/

      bundle_install
    end

    def remove_erb
      remove_file "app/views/layouts/application.html.erb"
    end

    def copy_sass_layout
      # Yes, we *do* want to override
      copy_file "application.css.sass", "app/assets/stylesheets/application.css.sass"
    end

    def copy_haml_layouts
      copy_file "application.html.haml", "app/views/layouts/application.html.haml"
      copy_file "canvas.html.haml", "app/views/layouts/canvas.html.haml"
    end

    def insert_layout_into_application_controller
      insert_into_file "app/controllers/application_controller.rb", "\n\n  layout 'canvas'", :before => "\nend"
    end
  end
end
{'fraction_non_alphanumeric': 0.12608101957214382, 'fraction_numerical': 0.0018206645425580337, 'mean_word_length': 3.326771653543307, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 12, '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': '127674', 'n_tokens_mistral': 745, 'n_tokens_neox': 710, 'n_words': 153}