README.md in cuco-0.1.0 vs README.md in cuco-0.1.1
- old
+ new
@@ -1,11 +1,12 @@
# Cuco
[![Gem Version](https://badge.fury.io/rb/cuco.png)](http://badge.fury.io/rb/cuco)
[![GEM Downloads](https://img.shields.io/gem/dt/cuco?color=168AFE&logo=ruby&logoColor=FE1616)](https://rubygems.org/gems/cuco)
+[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](http://choosealicense.com/licenses/mit/)
-*Cuco* watch files in a directory and take an action when they change.
+*Cuco* watches files in a directory and take an action when they change.
*Cuco* is controlled by a user-supplied script file.
Intermixed "watch" commands specify what to do
for the particular modified files.
@@ -36,12 +37,15 @@
```
will monitor files in the current directory tree
and react to events on those files in accordance with the script.
-## A simple example of a script file (using Minitest):
+## A simple example of a script file
+This sample script is intended for testing purposes with Minitest.
+*md* is the match-data (see Ruby regular expressions).
+
```ruby
watch( 'test/.*_test\.rb$' ) { |md| run_it(md[0]) }
watch( 'lib/(.*)\.rb$' ) { |md| run_it("test/#{md[1]}_test.rb") }
def run_it(file)
@@ -57,10 +61,9 @@
Scripts are pure Ruby.
Intermixed are "watch" rules that match observed files to an action.
The matching is achieved by a pattern (a regular expression) parameter.
The action is specified by a block (see above sample).
-*md* is the match-data.
Updates to script files are picked up on the fly (no need to restart *cuco*)
so experimenting is painless.
It's easy to see why *cuco* is so flexible,