<commit_before>require 'hoboku/cli'
require 'hoboku/app'

module Hoboku
  module CLI
    class Apps < Base
      desc "create [APP_NAME]", "Create the hoboku app"
      option :remote, desc: "Name of the git remote to assign", aliases: '-r', default: 'hoboku'
      def create(app_name=nil)
        params.app ||= app_name

        if app.exists?
          raise Thor::Error, "App already exists. Use `hoboku destroy` if you'd like to destroy it and re-create it."
        end

        say "Creating #{app.name}... "
        app.create
        say "done."
        say app.http_uri + ' | ' + app.git.dir
        app.git.add_remote params.remote
      end

      desc "destroy [APP_NAME]", "Destroy the hoboku app"
      option :confirm, desc: "Confirm the destruction of the app by passing the app name"
      def destroy(app_name=nil)
        params.app ||= app_name

        unless app.exists?
          raise Thor::Error, "You must specify an app to destroy."
        end

        if params.confirm != app.name
          say <<-WARNING, :red

      ! WARNING: Potentially Destructive Action
      ! This command will destroy #{app.name} (including all add-ons).
      ! To proceed, type \"#{app.name}\" or re-run this command with --confirm #{app.name}
          WARNING
          confirm = ask '>'
          if confirm != app.name
            raise Thor::Error, "Confirmation did not match #{app.name}. Aborted."
          end
        end<commit_msg>Make destroy command more in line with Heroku's<commit_after>require 'hoboku/cli'
require 'hoboku/app'

module Hoboku
  module CLI
    class Apps < Base
      desc "create [APP_NAME]", "Create the hoboku app"
      option :remote, desc: "Name of the git remote to assign", aliases: '-r', default: 'hoboku'
      def create(app_name=nil)
        params.app ||= app_name

        if app.exists?
          raise Thor::Error, "App already exists. Use `hoboku destroy` if you'd like to destroy it and re-create it."
        end

        say "Creating #{app.name}... "
        app.create
        say "done."
        say app.http_uri + ' | ' + app.git.dir
        app.git.add_remote params.remote
      end

      desc "destroy", "Destroy the hoboku app"
      option :confirm, desc: "Confirm the destruction of the app by passing the app name"
      def destroy
        unless app.exists?
          raise Thor::Error, "You must specify an app to destroy using the -a|--app option."
        end

        if params.confirm != app.name
          say <<-WARNING, :red

      ! WARNING: Potentially Destructive Action
      ! This command will destroy #{app.name} (including all add-ons).
      ! To proceed, type \"#{app.name}\" or re-run this command with --confirm #{app.name}
          WARNING
          confirm = ask '>'
          if confirm != app.name
            raise Thor::Error, "Confirmation did not match #{app.name}. Aborted."
          end
        end
{'fraction_non_alphanumeric': 0.10660247592847318, 'fraction_numerical': 0.0, 'mean_word_length': 2.131324004305705, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 5, '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': '6502009', 'n_tokens_mistral': 851, 'n_tokens_neox': 826, 'n_words': 307}