FineLinePrototyping/angularjs-rails-resource — pull request #71 by simeonwillbanks (2013-09-26 20:06:13+00:00)
Title: Removes Sprockets Directives From Compiled Source

Fixes #70

Add `grunt-contrib-concat` custom process function which removes [Sprockets directives](https://github.com/sstephenson/sprockets#the-directive-processor) from compiled `angularjs-rails-resource/angularjs-rails-resource.js`

```
❯ grunt concat
Running "concat:dist" (concat) task
File ".//angularjs-rails-resource.js" created.

Done, without errors.
```

```diff
diff --git a/Gruntfile.js b/Gruntfile.js
index 78d30c5..a10510f 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -26,7 +26,12 @@ module.exports = function(grunt) {
},
dist: {
src: srcFiles,
- dest: '<%= dirs.dest %>/<%= pkg.name %>.js'
+ dest: '<%= dirs.dest %>/<%= pkg.name %>.js',
+ options: {
+ process: function(src, filepath) {
+ return src.replace(/^\/\/= require.*\n/gm, '');
+ },
+ },
}
},
zip: {
diff --git a/angularjs-rails-resource.js b/angularjs-rails-resource.js
index 8f5af32..52a261b 100644
--- a/angularjs-rails-resource.js
+++ b/angularjs-rails-resource.js
@@ -1,13 +1,9 @@
/**
* A resource factory inspired by $resource from AngularJS
- * @version v0.2.2 - 2013-08-12
+ * @version v0.2.2 - 2013-09-26
* @link https://github.com/FineLinePrototyping/angularjs-rails-resource.git
* @author
*/
-//= require_self
-//= require_tree ./utils
-//= require ./serialization
-//= require ./resource

(function (undefined) {
angular.module('rails', ['ng']);

```