<commit_before>require 'heroku/api/spaces'
Excon.defaults[:ssl_verify_peer] = false
class Heroku::Command::Spaces < Heroku::Command::Base

  # spaces
  #
  # lists available spaces
  #
  def index
    validate_arguments!

    @spaces = api.get_spaces().body

    if @spaces.empty?
      display('You do not have any spaces.')
      return
    end

    display_header 'Spaces'
    cols = %w(Name Organization State)
    display_table(@spaces.map{|s| for_display(s)}, cols, cols)
  end

  # spaces:info
  #
  # show info about a space
  #
  # --space SPACE   # name of space
  #
  def info
    require_argument! :space
    validate_arguments!

    space = api.get_space(options[:space]).body
    style space
  end

  # spaces:create NAME
  #
  # create a new space
  #
  # -o --org ORGANIZATION
  #
  def create
    name = extract_name_arg!
    require_argument! :org
    validate_arguments!

    action("Creating space #{name} in organization #{options[:org]}") do
      @space = api.post_space(name: name, organization: options[:org]).body
    end
    style @space
  end

  # spaces:rename
  #
  # rename a space
  #
  # --space SPACE   # current name of space
  #
  def rename
    name = extract_name_arg!
    require_argument! :space
    validate_arguments!

    action("Renaming space #{options[:space]} to #{name}") do
      @space = api.patch_space(options[:space], name: name).body
    end
    style @space
  end


  # spaces:destroy
  #
  # destroy a space
  #
  # --space SPACE   # name of space
  #
  def destroy
    require_argument! :space
    validate_arguments!

    action("Destroying space #{options[:space]}") do
      @space = api.delete_space(options[:space]).body
    end
    style @space
  end
<commit_msg>Add confirmation to space destroy<commit_after>require 'heroku/api/spaces'
Excon.defaults[:ssl_verify_peer] = false
class Heroku::Command::Spaces < Heroku::Command::Base

  # spaces
  #
  # lists available spaces
  #
  def index
    validate_arguments!

    @spaces = api.get_spaces().body

    if @spaces.empty?
      display('You do not have any spaces.')
      return
    end

    display_header 'Spaces'
    cols = %w(Name Organization State)
    display_table(@spaces.map{|s| for_display(s)}, cols, cols)
  end

  # spaces:info
  #
  # show info about a space
  #
  # --space SPACE   # name of space
  #
  def info
    require_argument! :space
    validate_arguments!

    space = api.get_space(options[:space]).body
    style space
  end

  # spaces:create NAME
  #
  # create a new space
  #
  # -o --org ORGANIZATION
  #
  def create
    name = extract_name_arg!
    require_argument! :org
    validate_arguments!

    action("Creating space #{name} in organization #{options[:org]}") do
      @space = api.post_space(name: name, organization: options[:org]).body
    end
    style @space
  end

  # spaces:rename
  #
  # rename a space
  #
  # --space SPACE   # current name of space
  #
  def rename
    name = extract_name_arg!
    require_argument! :space
    validate_arguments!

    action("Renaming space #{options[:space]} to #{name}") do
      @space = api.patch_space(options[:space], name: name).body
    end
    style @space
  end


  # spaces:destroy
  #
  # destroy a space
  #
  # --space SPACE   # name of space
  #
  def destroy
    require_argument! :space
    validate_arguments!

    confirm
    action("Destroying space #{options[:space]}") do
      @space = api.delete_space(options[:space]).body
    end
    style @space
  end

{'fraction_non_alphanumeric': 0.11079219288174512, 'fraction_numerical': 0.0, 'mean_word_length': 2.8465783664459163, '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': '3429333', 'n_tokens_mistral': 1160, 'n_tokens_neox': 1111, 'n_words': 295}