<commit_before>require "pave/version"

module Pave
  class Concrete
    include Methadone::CLILogging
    include Methadone::SH

    attr_accessor :name

    def self.create(name)
      info ""
      info "Setting up Concrete5 in folder #{name}."
      new(name).setup
      0
    end

    def initialize(name)
      @name = name
    end

    def setup
      clone_concrete5
      set_up_app_folder
      initialize_git
      create_virtual_host
    end

    def clone_concrete5
      info "* Downloading Concrete5 version 5.6.2.1..."
      sh "curl http://www.concrete5.org/download_file/-/view/58379/8497 -o c5.zip > /dev/null"
      info "* Download complete. Unzipping..."
      sh "unzip c5.zip"
      sh "rm c5.zip"
      sh "mv concrete5.6.2.1 #{name}"
      info "* Concrete5 downloaded and unzipped into ./#{name}."
    end

    def set_up_app_folder
      info "* Setting up folders..."
      sh "mkdir #{name}/app"

      symlink_folders
      remove_extra_folders
    end

    def initialize_git
      info "* Setting up git..."<commit_msg>Formatting changes, return Pave::Concrete instance from setup<commit_after>require "pave/version"

module Pave
  class Concrete
    include Methadone::CLILogging
    include Methadone::SH

    attr_accessor :name

    def self.create(name)
      info ""
      info "Setting up Concrete5 in folder #{name}."
      new(name).setup
    end

    def initialize(name)
      @name = name
    end

    def setup
      clone_concrete5
      set_up_app_folder
      initialize_git
      create_virtual_host
      self
    end

    def clone_concrete5
      info "* Downloading Concrete5 version 5.6.2.1..."
      sh "curl http://www.concrete5.org/download_file/-/view/58379/8497 -o c5.zip > /dev/null"
      info ""
      info "* Unzipping..."
      sh "unzip c5.zip"
      sh "rm c5.zip"
      sh "mv concrete5.6.2.1 #{name}"
      info "* Concrete5 downloaded and unzipped into ./#{name}."
    end

    def set_up_app_folder
      info "* Setting up folders..."
      sh "mkdir #{name}/app"

      symlink_folders
      remove_extra_folders
    end

    def initialize_git
      info "* Setting up git..."
{'fraction_non_alphanumeric': 0.0986046511627907, 'fraction_numerical': 0.024651162790697675, 'mean_word_length': 2.172566371681416, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 7, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1485914', 'n_tokens_mistral': 732, 'n_tokens_neox': 689, 'n_words': 184}