<commit_before># Frequent

Frequent is a little Ruby metaprogramming demo gem that can keep track of what's
happening during your Ruby program's execution - specifically, how many times a
targeted method is called.

## Usage

To use frequent, install the gem, then `require 'frequent'` in one of your source
files and set the `COUNT_CALLS_TO` environment variable to the name of the
method you'd like to count calls to. Like this:

```
require 'frequent'

100.times do
  puts "hello, frequent".split(',').inspect
end
```

```
$ COUNT_CALLS_TO='String#split' ruby test.rb
...
String#split called 100 times
```

Following Ruby conventions, instance methods are identified with a hash
(e.g. `String#split`), and class methods are identified with a period
(e.g. `File.join`).

### API

You can also use the `Frequent` module to manually place probes in your code:<commit_msg>Add a note about required Ruby version to README<commit_after># Frequent

Frequent is a little Ruby metaprogramming demo gem that can keep track of what's
happening during your Ruby program's execution - specifically, how many times a
targeted method is called.

## Requirements

You'll need Ruby 1.9 to use Frequent. The author has tested thus far only on MRI
1.9.2 and 1.9.3.

## Usage

To use frequent, install the gem, then `require 'frequent'` in one of your source
files and set the `COUNT_CALLS_TO` environment variable to the name of the
method you'd like to count calls to. Like this:

```
require 'frequent'

100.times do
  puts "hello, frequent".split(',').inspect
end
```

```
$ COUNT_CALLS_TO='String#split' ruby test.rb
...
String#split called 100 times
```

Following Ruby conventions, instance methods are identified with a hash
(e.g. `String#split`), and class methods are identified with a period
(e.g. `File.join`).

### API

You can also use the `Frequent` module to manually place probes in your code:
{'fraction_non_alphanumeric': 0.08980454305335446, 'fraction_numerical': 0.010565240359218173, 'mean_word_length': 4.45821325648415, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5946651', 'n_tokens_mistral': 603, 'n_tokens_neox': 546, 'n_words': 265}