<commit_before>Welcome to the 'cuke-patterns' gem

Change your step definition files from this:

    When /^(\w+) withdraws \$(\d+\(?:\.\d+)?)$/ do |name, amount|
      customer = Bank::Customer.find_by_name(name)
      amount = BigDecimal.new(amount)
      Bank::Teller.withdraw_for(customer, amount)
    end

Into this:

    When ":customer withdraws :dollar_amount" do |customer, amount|
      Bank::Teller.withdraw_for(customer, amount)
    end

    Pattern :customer, /(\w+)/ do |name|
      Bank::Customer.find_by_name(name)
    end

    Pattern :dollar_amount, /\$(\d+\(?:.\d+)?)/ do |amount|
      BigDecimal.new(amount)
    end

Patterns are kind of like Transforms in cucumber, except Patterns are designed to be
referenced in Step definitions by name as opposed to recognized by form automatically.<commit_msg>Added README.<commit_after># cuke-patterns

Makes cucumber step definitions more focused, understandable, searchable and awesomeable.

Author: <NAME> <<EMAIL>>
Github: http://github.com/brendan/cuke-patterns

## What does it do?

Change your step definition files from this:

    When /^(\w+) withdraws \$(\d+\(?:\.\d+)?)$/ do |name, amount|
      customer = Bank::Customer.find_by_name(name)
      amount = BigDecimal.new(amount)
      Bank::Teller.withdraw_for(customer, amount)
    end

Into this:

    When ":customer withdraws :dollar_amount" do |customer, amount|
      Bank::Teller.withdraw_for(customer, amount)
    end

    Pattern :customer, /(\w+)/ do |name|
      Bank::Customer.find_by_name(name)
    end

    Pattern :dollar_amount, /\$(\d+\(?:.\d+)?)/ do |amount|
      BigDecimal.new(amount)
    end

Patterns are kind of like Transforms in cucumber, except Patterns are designed to be
referenced in Step definitions by name as opposed to recognized by form automatically.

To use it, just pop this in your app's support/env.rb which gets loaded by cucumber:

    require 'rubygems'
    require 'cuke-patterns'
{'fraction_non_alphanumeric': 0.12378017462763226, 'fraction_numerical': 0.0, 'mean_word_length': 3.572769953051643, 'pattern_counts': {'":': 2, '<': 6, '<?xml version=': 0, '>': 6, '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': '7099981', 'n_tokens_mistral': 621, 'n_tokens_neox': 592, 'n_words': 193}