<commit_before>require "set"

require_relative "../../shared/authenticated_controller_base"
require_relative "../../services/services"

module FastlaneCI
  # A CRUD controller to manage users
  class EnvironmentVariablesController < AuthenticatedControllerBase
    HOME = "/environment_variables_erb"

    get HOME do
      locals = { title: "Environment Variables" }
      erb(:environment_variables, locals: locals, layout: FastlaneCI.default_layout)
    end

    # When the `/environment_variables/create` form is submitted:
    #
    # - creates a new ENV variables
    get "#{HOME}/create" do
      if valid_params?(params, post_parameter_list_for_validation)
        Services.environment_variable_service.create_environment_variable!(
          key: params[:key],
          value: params[:value]
        )
      end

      redirect(HOME)
    end<commit_msg>Creating an ENV variable is a POST request now<commit_after>require "set"

require_relative "../../shared/authenticated_controller_base"
require_relative "../../services/services"

module FastlaneCI
  # A CRUD controller to manage users
  class EnvironmentVariablesController < AuthenticatedControllerBase
    HOME = "/environment_variables_erb"

    get HOME do
      locals = { title: "Environment Variables" }
      erb(:environment_variables, locals: locals, layout: FastlaneCI.default_layout)
    end

    # When the `/environment_variables/create` form is submitted:
    #
    # - creates a new ENV variables
    post "#{HOME}/create" do
      if valid_params?(params, post_parameter_list_for_validation)
        Services.environment_variable_service.create_environment_variable!(
          key: params[:key],
          value: params[:value]
        )
      end

      redirect(HOME)
    end
{'fraction_non_alphanumeric': 0.08863636363636364, 'fraction_numerical': 0.0, 'mean_word_length': 3.3915211970074814, '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': '4941221', 'n_tokens_mistral': 476, 'n_tokens_neox': 467, 'n_words': 121}