<commit_before># required gems
require 'active_support'
require 'active_support/core_ext/class'
require 'active_support/core_ext/object/blank'
require 'active_support/core_ext/object/try'
require 'active_support/core_ext/string/inflections'

# files for this gem
require 'skinny_controllers/default_verbs'
require 'skinny_controllers/policy/base'
require 'skinny_controllers/operation/policy_helpers'
require 'skinny_controllers/operation/model_helpers'
require 'skinny_controllers/operation/base'
require 'skinny_controllers/operation/default'
require 'skinny_controllers/diet'
require 'skinny_controllers/version'

module SkinnyControllers
  # Tells the Diet what namespace of the controller
  # isn't going to be part of the model name
  #
  # @example
  #  # config/initializers/skinny_controllers.rb
  #  SkinnyControllers.controller_namespace = 'API'
  #  # 'API::' would be removed from 'API::Namespace::ObjectNamesController'
  cattr_accessor :controller_namespace

  #
  cattr_accessor :operation_namespace do
    'Operation'.freeze
  end

  cattr_accessor :allow_by_default do
    true
  end

  cattr_accessor :accessible_to_method do
    :is_accessible_to?
  end

  # the diet uses ActionController::Base's
  # `action_name` method to get the current action.
  # From that action, we map what verb we want to use for our operation
  #
  # If an action is not be listed, the action name will be
  # manipulated to fit the verb naming convention.
  #
  # @example POST controller#send_receipt will use 'SendReceipt' for the verb
  cattr_accessor :action_map do
    {
      'default'.freeze => DefaultVerbs::Read,
      'create'.freeze => DefaultVerbs::Create,
      'index'.freeze => DefaultVerbs::ReadAll,
      'destroy'.freeze => DefaultVerbs::Delete,
      'update'.freeze => DefaultVerbs::Update
    }
  end
end<commit_msg>add comment about create and update verbs<commit_after># required gems
require 'active_support'
require 'active_support/core_ext/class'
require 'active_support/core_ext/object/blank'
require 'active_support/core_ext/object/try'
require 'active_support/core_ext/string/inflections'

# files for this gem
require 'skinny_controllers/default_verbs'
require 'skinny_controllers/policy/base'
require 'skinny_controllers/operation/policy_helpers'
require 'skinny_controllers/operation/model_helpers'
require 'skinny_controllers/operation/base'
require 'skinny_controllers/operation/default'
require 'skinny_controllers/diet'
require 'skinny_controllers/version'

module SkinnyControllers
  # Tells the Diet what namespace of the controller
  # isn't going to be part of the model name
  #
  # @example
  #  # config/initializers/skinny_controllers.rb
  #  SkinnyControllers.controller_namespace = 'API'
  #  # 'API::' would be removed from 'API::Namespace::ObjectNamesController'
  cattr_accessor :controller_namespace

  #
  cattr_accessor :operation_namespace do
    'Operation'.freeze
  end

  cattr_accessor :allow_by_default do
    true
  end

  cattr_accessor :accessible_to_method do
    :is_accessible_to?
  end

  # the diet uses ActionController::Base's
  # `action_name` method to get the current action.
  # From that action, we map what verb we want to use for our operation
  #
  # If an action is not be listed, the action name will be
  # manipulated to fit the verb naming convention.
  #
  # @example POST controller#send_receipt will use 'SendReceipt' for the verb
  cattr_accessor :action_map do
    {
      'default'.freeze => DefaultVerbs::Read,
      'index'.freeze => DefaultVerbs::ReadAll,
      'destroy'.freeze => DefaultVerbs::Delete,
      # these two are redundant, as the action will be
      # converted to a verb via inflection
      'create'.freeze => DefaultVerbs::Create,
      'update'.freeze => DefaultVerbs::Update
    }
  end
end
{'fraction_non_alphanumeric': 0.08289473684210526, 'fraction_numerical': 0.0, 'mean_word_length': 4.65625, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '3068937', 'n_tokens_mistral': 1183, 'n_tokens_neox': 1159, 'n_words': 314}