<commit_before>class Rafters::ComponentGenerator < Rails::Generators::NamedBase
  source_root File.expand_path("../templates", __FILE__)
  class_option :stylesheet, type: :boolean, default: true, description: "Include stylesheet file"
  class_option :javascript, type: :boolean, default: true, description: "Include Javascript file"

  def create_directories
    empty_directory "#{base_directory}"
    empty_directory "#{base_directory}/assets"
    empty_directory "#{base_directory}/assets/javascripts"
    empty_directory "#{base_directory}/assets/stylesheets"
    empty_directory "#{base_directory}/assets/images"
    empty_directory "#{base_directory}/sources"
    empty_directory "#{base_directory}/views"
  end

  def create_gitkeeps
    create_file "#{base_directory}/assets/images/.gitkeep"
  end

  def create_files
    template "component.rb.erb", "#{base_directory}/#{file_name}_component.rb"
    template "assets/javascripts/component.js.erb", "#{base_directory}/assets/javascripts/#{file_name}_component.js" if options.javascript?
    template "assets/stylesheets/component.scss.erb", "#{base_directory}/assets/stylesheets/#{file_name}_component.scss" if options.stylesheet?
    template "views/component.html.erb", "#{base_directory}/views/#{file_name}_component.html.erb"
  end<commit_msg>Add .gitkeeps for stylesheet and javascript directories<commit_after>class Rafters::ComponentGenerator < Rails::Generators::NamedBase
  source_root File.expand_path("../templates", __FILE__)
  class_option :stylesheet, type: :boolean, default: true, description: "Include stylesheet file"
  class_option :javascript, type: :boolean, default: true, description: "Include Javascript file"

  def create_directories
    empty_directory "#{base_directory}"
    empty_directory "#{base_directory}/assets"
    empty_directory "#{base_directory}/assets/javascripts"
    empty_directory "#{base_directory}/assets/stylesheets"
    empty_directory "#{base_directory}/assets/images"
    empty_directory "#{base_directory}/sources"
    empty_directory "#{base_directory}/views"
  end

  def create_gitkeeps
    create_file "#{base_directory}/assets/images/.gitkeep"
    create_file "#{base_directory}/assets/stylesheets/.gitkeep"
    create_file "#{base_directory}/assets/javascripts/.gitkeep"
  end

  def create_files
    template "component.rb.erb", "#{base_directory}/#{file_name}_component.rb"
    template "assets/javascripts/component.js.erb", "#{base_directory}/assets/javascripts/#{file_name}_component.js" if options.javascript?
    template "assets/stylesheets/component.scss.erb", "#{base_directory}/assets/stylesheets/#{file_name}_component.scss" if options.stylesheet?
    template "views/component.html.erb", "#{base_directory}/views/#{file_name}_component.html.erb"
  end
{'fraction_non_alphanumeric': 0.12697841726618705, 'fraction_numerical': 0.0, 'mean_word_length': 6.094387755102041, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '5996807', 'n_tokens_mistral': 825, 'n_tokens_neox': 804, 'n_words': 143}