<commit_before>= AdCopy

Author::		<NAME>
Info::			http://www.adcopy.com
Documentation::	http://rdoc.info/projects/atomon/adcopy

== Installation

Currently AdCopy can only be installed as a rails plugin (gem coming soon):

  script/plugin install git://github.com/atomon/adcopy.git

== API Keys

Your AdCopy API keys should be stored in <tt>config/adcopy_config.yml</tt>, which can be generated by running

  script/generate adcopy_config

Don't forget to edit the generated file to contain your API keys.

== Adding An AdCopy Puzzle To A View

Displaying an AdCopy Puzzle is as simple as calling +adcopy_puzzle+ inside a form within your view. For example:

  <% form_for(@user) do |f| %>
    # ...
    <p>
      <%= adcopy_puzzle %>
    </p>
    # ...
  <% end %>

The appearance of the puzzle can be adjusted by passing options to +adcopy_puzzle+. For a full list of options, see the documentation.

== Verifying The Input To An AdCopy Puzzle In A Controller

The +verify_adcopy_puzzle+ method verifies the user's input and returns +true+ if the user provided the correct input. In the simplest case, verification could be performed as follows:

  respond_to do |format|
    if verify_adcopy_puzzle && @user.save
      # ...
    else
      # ...
    end
  end

+verify_adcopy_puzzle+ can also be used to add an error to a model object if the verification fails:

  respond_to do |format|
    if verify_adcopy_puzzle(:model => @user, :error_message => 'AdCopy puzzle input is invalid') && @user.save
      # ...
    else
      # ...
    end
  end

See the documentation for a full list of options accepted by +verify_adcopy_puzzle+.<commit_msg>Updated documentation for installation as a gem<commit_after>= AdCopy

Author::		<NAME>
Info::			http://www.adcopy.com
Documentation::	http://rdoc.info/projects/atomon/adcopy

== Installation

AdCopy can be installed as a gem by adding the following line to your <tt>environment.rb</tt> file:

  config.gem "adcopy"

And then running the following to install the gem:

  sudo rake gems:install

Alternatively you can install AdCopy as a plugin

  script/plugin install git://github.com/atomon/adcopy.git

== API Keys

Your AdCopy API keys should be stored in <tt>config/adcopy_config.yml</tt>, which can be generated by running

  script/generate adcopy_config

Don't forget to edit the generated file to contain your API keys.

== Adding An AdCopy Puzzle To A View

Displaying an AdCopy Puzzle is as simple as calling +adcopy_puzzle+ inside a form within your view. For example:

  <% form_for(@user) do |f| %>
    # ...
    <p>
      <%= adcopy_puzzle %>
    </p>
    # ...
  <% end %>

The appearance of the puzzle can be adjusted by passing options to +adcopy_puzzle+. For a full list of options, see the documentation.

== Verifying The Input To An AdCopy Puzzle In A Controller

The +verify_adcopy_puzzle+ method verifies the user's input and returns +true+ if the user provided the correct input. In the simplest case, verification could be performed as follows:

  respond_to do |format|
    if verify_adcopy_puzzle && @user.save
      # ...
    else
      # ...
    end
  end

+verify_adcopy_puzzle+ can also be used to add an error to a model object if the verification fails:

  respond_to do |format|
    if verify_adcopy_puzzle(:model => @user, :error_message => 'AdCopy puzzle input is invalid') && @user.save
      # ...
    else
      # ...
    end
  end

See the documentation for a full list of options accepted by +verify_adcopy_puzzle+.
{'fraction_non_alphanumeric': 0.0870682272337996, 'fraction_numerical': 0.0, 'mean_word_length': 3.3527950310559005, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2516627', 'n_tokens_mistral': 1100, 'n_tokens_neox': 1030, 'n_words': 432}