<commit_before># recursive_replace 

* A ruby gem for recursively replacing text in multiple files and directories. 
* Use with shell executable or in code. 
* It auto-escapes *most* characters, so you can replace code syntax and special characters easily without using regular expressions.
* Comes with a rspec testing suite for replacement verification of special characters, expressions and code syntax.
  
## Installation

```bash
gem install recursive_replace
```

## Examples

### From Console/Terminal

```bash
recursive_replace [original] [replacement] [optional_path] 
```

Replace *foo* with *bar* in current directory and its subdirectories: 

```bash
recursive_replace "foo" "bar"
```

Replace *foo* with *bar* in a specific file: 

```bash
recursive_replace "foo" "bar" file
```

Replace erb syntax:

```bash
recursive_replace "<%= @object[:foo] %>" "<%= @new_object[:bar] %>" 
```

Replacing a backslash is the only time you'll actually need to escape an input character.  

```bash
recursive_replace "\\" "_" somedirectory/ 
```

### From Code

```ruby
require "recursive_replace"
file = File.join("home", "bob", "Documents")
RecursiveReplace.replace("bad", "good", :path => file)
```<commit_msg>Added testing section to README<commit_after># recursive_replace 

* A ruby gem for recursively replacing text in multiple files and directories. 
* Use with shell executable or in code. 
* It auto-escapes *most* characters, so you can replace code syntax and special characters easily without using regular expressions.
* Comes with a rspec testing suite for replacement verification of special characters, expressions and code syntax.
  
## Installation

```bash
gem install recursive_replace
```

## Examples

### From Console/Terminal

```bash
recursive_replace [original] [replacement] [optional_path] 
```

Replace *foo* with *bar* in current directory and its subdirectories: 

```bash
recursive_replace "foo" "bar"
```

Replace *foo* with *bar* in a specific file: 

```bash
recursive_replace "foo" "bar" file
```

Replace erb syntax:

```bash
recursive_replace "<%= @object[:foo] %>" "<%= @new_object[:bar] %>" 
```

Replacing a backslash is the only time you'll actually need to escape an input character.  

```bash
recursive_replace "\\" "_" somedirectory/ 
```

### From Code

```ruby
require "recursive_replace"
file = File.join("home", "bob", "Documents")
RecursiveReplace.replace("bad", "good", :path => file)
```

## Testing

Want to add a test to see how recursive_replace performs with a specific situation or programming language? Pull the recursive_replace and run its rspec testing suite:

```bash
git clone git://github.com/hulihanapplications/recursive_replace.git
cd recursive_replace
rspec spec/
```
{'fraction_non_alphanumeric': 0.11769005847953216, 'fraction_numerical': 0.0, 'mean_word_length': 5.1923076923076925, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '5227596', 'n_tokens_mistral': 872, 'n_tokens_neox': 773, 'n_words': 305}