<commit_before># Guard::CoffeeScript

![travis-ci](http://travis-ci.org/netzpirat/guard-coffeescript.png)

Guard::CoffeeScript compiles or validates your CoffeeScripts automatically when files are modified.

Tested on MRI Ruby 1.8.7, 1.9.2 and the latest versions of JRuby & Rubinius.

If you have any questions please join us on our [Google group](http://groups.google.com/group/guard-dev) or on `#guard`
(irc.freenode.net).

## Install

Please be sure to have [Guard](https://github.com/guard/guard) installed.

Install the gem:

```bash
$ gem install guard-coffeescript
```

Add it to your `Gemfile`, preferably inside the development group:

```ruby
gem 'guard-coffeescript'
```

Add guard definition to your `Guardfile` by running this command:

```bash
$ guard init coffeescript
```

## JSON

The JSON library is also required but is not explicitly stated as a gem dependency. If you're on Ruby 1.8 you'll need
to install the `json` or `json_pure` gem. On Ruby 1.9, JSON is included in the standard library.

## CoffeeScript

Guard::CoffeeScript uses [Ruby CoffeeScript](https://github.com/josh/ruby-coffee-script/) to compile the CoffeeScripts,
that in turn uses [ExecJS](https://github.com/sstephenson/execjs) to pick the best runtime to evaluate the JavaScript.

## Choose a runtime

### CoffeeScript executable on node.js

Please refer to the [CoffeeScript documentation](http://jashkenas.github.com/coffee-script/) for more information about
how to install the latest CoffeeScript version on [node.js](http://nodejs.org/).

### V8 JavaScript Engine

To use the [V8 JavaScript Engine](http://code.google.com/p/v8/), simple add `therubyracer` to your `Gemfile`.
The Ruby Racer acts as a bridge between Ruby and the V8 engine, that will be automatically installed by the Ruby Racer.

```ruby
group :development do
  gem 'therubyracer'
end
```

Another alternative is [Mustang](https://github.com/nu7hatch/mustang), a Ruby proxy library for the awesome Google V8
JavaScript engine. Just add `mustang` to your `Gemfile`:

```ruby
group :development do
  gem 'mustang'
end
```

### Mozilla SpiderMonkey

To use [Mozilla SpiderMonkey](https://developer.mozilla.org/en/SpiderMonkey), simple add `johnson` to your `Gemfile`.
Johnson embeds the Mozilla SpiderMonkey JavaScript runtime as a C extension.

```ruby
group :development do
  gem 'johnson'
end
```

### Mozilla Rhino

If you're using JRuby, you can embed the [Mozilla Rhino](http://www.mozilla.org/rhino/) runtime by adding `therubyrhino`
to your `Gemfile`:

```ruby
group :development do
  gem 'therubyrhino'
end
```

### Apple JavaScriptCore

JavaScriptCore is only available on Mac OS X. To use JavaScript Core you don't have to install anything, because
JavaScriptCore is packaged with Mac OS X.

### Microsoft Windows Script Host

[Microsoft Windows Script Host](http://msdn.microsoft.com/en-us/library/9bbdkx3k.aspx) is available on any Microsoft
Windows operating systems.

## Usage

Please read the [Guard usage documentation](https://github.com/guard/guard#readme).

## Guardfile

Guard::CoffeeScript can be adapted to all kind of projects. Please read the
[Guard documentation](https://github.com/guard/guard#readme) for more information about the Guardfile DSL.

### Standard Ruby gem

In a custom Ruby project you want to configure your `:input` and `:output` directories.

```ruby
guard 'coffeescript', :input => 'coffeescripts', :output => 'javascripts'
```

If your output directory is the same as the input directory, you can simply skip it:

```ruby
guard 'coffeescript', :input => 'javascripts'
```

### Rails app with the asset pipeline

With the introduction of the [asset pipeline](http://guides.rubyonrails.org/asset_pipeline.html) in Rails 3.1 there is
no need to compile your CoffeeScripts with this Guard. However if you like to have instant validation feedback
(preferably with a Growl notification) directly after you save a change, then you may want still use this Guard and just
skip the generation of the output file:

```ruby
guard 'coffeescript', :input => 'app/assets/javascripts', :noop => true
```
<commit_msg>Be more consistent in describing input and output directories.<commit_after># Guard::CoffeeScript

![travis-ci](http://travis-ci.org/netzpirat/guard-coffeescript.png)

Guard::CoffeeScript compiles or validates your CoffeeScripts automatically when files are modified.

Tested on MRI Ruby 1.8.7, 1.9.2 and the latest versions of JRuby & Rubinius.

If you have any questions please join us on our [Google group](http://groups.google.com/group/guard-dev) or on `#guard`
(irc.freenode.net).

## Install

Please be sure to have [Guard](https://github.com/guard/guard) installed.

Install the gem:

```bash
$ gem install guard-coffeescript
```

Add it to your `Gemfile`, preferably inside the development group:

```ruby
gem 'guard-coffeescript'
```

Add guard definition to your `Guardfile` by running this command:

```bash
$ guard init coffeescript
```

## JSON

The JSON library is also required but is not explicitly stated as a gem dependency. If you're on Ruby 1.8 you'll need
to install the `json` or `json_pure` gem. On Ruby 1.9, JSON is included in the standard library.

## CoffeeScript

Guard::CoffeeScript uses [Ruby CoffeeScript](https://github.com/josh/ruby-coffee-script/) to compile the CoffeeScripts,
that in turn uses [ExecJS](https://github.com/sstephenson/execjs) to pick the best runtime to evaluate the JavaScript.

## Choose a runtime

### CoffeeScript executable on node.js

Please refer to the [CoffeeScript documentation](http://jashkenas.github.com/coffee-script/) for more information about
how to install the latest CoffeeScript version on [node.js](http://nodejs.org/).

### V8 JavaScript Engine

To use the [V8 JavaScript Engine](http://code.google.com/p/v8/), simple add `therubyracer` to your `Gemfile`.
The Ruby Racer acts as a bridge between Ruby and the V8 engine, that will be automatically installed by the Ruby Racer.

```ruby
group :development do
  gem 'therubyracer'
end
```

Another alternative is [Mustang](https://github.com/nu7hatch/mustang), a Ruby proxy library for the awesome Google V8
JavaScript engine. Just add `mustang` to your `Gemfile`:

```ruby
group :development do
  gem 'mustang'
end
```

### Mozilla SpiderMonkey

To use [Mozilla SpiderMonkey](https://developer.mozilla.org/en/SpiderMonkey), simple add `johnson` to your `Gemfile`.
Johnson embeds the Mozilla SpiderMonkey JavaScript runtime as a C extension.

```ruby
group :development do
  gem 'johnson'
end
```

### Mozilla Rhino

If you're using JRuby, you can embed the [Mozilla Rhino](http://www.mozilla.org/rhino/) runtime by adding `therubyrhino`
to your `Gemfile`:

```ruby
group :development do
  gem 'therubyrhino'
end
```

### Apple JavaScriptCore

JavaScriptCore is only available on Mac OS X. To use JavaScript Core you don't have to install anything, because
JavaScriptCore is packaged with Mac OS X.

### Microsoft Windows Script Host

[Microsoft Windows Script Host](http://msdn.microsoft.com/en-us/library/9bbdkx3k.aspx) is available on any Microsoft
Windows operating systems.

## Usage

Please read the [Guard usage documentation](https://github.com/guard/guard#readme).

## Guardfile

Guard::CoffeeScript can be adapted to all kind of projects. Please read the
[Guard documentation](https://github.com/guard/guard#readme) for more information about the Guardfile DSL.

### Standard Ruby gem

In a custom Ruby project you want to configure your input and output directories.

```ruby
guard 'coffeescript', :input => 'coffeescripts', :output => 'javascripts'
```

If your output directory is the same as the input directory, you can simply skip it:

```ruby
guard 'coffeescript', :input => 'javascripts'
```

### Rails app with the asset pipeline

With the introduction of the [asset pipeline](http://guides.rubyonrails.org/asset_pipeline.html) in Rails 3.1 there is
no need to compile your CoffeeScripts with this Guard. However if you like to have instant validation feedback
(preferably with a Growl notification) directly after you save a change, then you may want still use this Guard and just
skip the generation of the output file:

```ruby
guard 'coffeescript', :input => 'app/assets/javascripts', :noop => true
```

{'fraction_non_alphanumeric': 0.10308903694730466, 'fraction_numerical': 0.004845548152634767, 'mean_word_length': 4.789621318373071, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 14, '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': '1606734', 'n_tokens_mistral': 2566, 'n_tokens_neox': 2388, 'n_words': 990}