dockyard/es6_module_transpiler-rails — pull request #3 by rjackson (2013-11-28 16:07:43+00:00)
Title: Refactor `prefix_pattern` API.

Add ability to match multiple patterns. This also allows easy customization without have to maintain a single regex pattern.

Using the following initial prefix (using the current API):

```ruby
ES6ModuleTranspiler.prefix_pattern = [/^(controllers|models|views|helpers|routes|router|adapter)/, 'appkit']
```

Adding a new pattern to be matched (and using multiple prefixes):

```ruby
ES6ModuleTranspiler.prefix_pattern = [/^(controllers|models|views|helpers|routes|router|adapter)/, 'appkit']

config.ember_appkit.add_prefix_pattern /^components/, 'appkit'
config.ember_appkit.add_prefix_pattern /^gui-helpers/, 'gui'
```

This makes it much easier to slightly tweak the pattern (to add an extra folder or prefix for example).

The previous API (using `ES6ModuleTranspiler.prefix_pattern=`) is still fully functional, and a test has been added to ensure it works properly.