Skip to content

Commit

Permalink
Merge pull request #12 from irnc/expose-correct-app-helpers
Browse files Browse the repository at this point in the history
Expose helpers under app/helpers/ directory to allow auto-registering them in 1.13
  • Loading branch information
jmurphyau committed Aug 10, 2015
2 parents 886c969 + 06e0041 commit 77d67a3
Show file tree
Hide file tree
Showing 11 changed files with 48 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/helpers/and.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import Ember from 'ember';
import { andHelper } from 'ember-truth-helpers/helpers/and';

export default Ember.Helper.helper(andHelper);
4 changes: 4 additions & 0 deletions app/helpers/eq.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import Ember from 'ember';
import { equalHelper } from 'ember-truth-helpers/helpers/equal';

export default Ember.Helper.helper(equalHelper);
4 changes: 4 additions & 0 deletions app/helpers/gt.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import Ember from 'ember';
import { gtHelper } from 'ember-truth-helpers/helpers/gt';

export default Ember.Helper.helper(gtHelper);
4 changes: 4 additions & 0 deletions app/helpers/gte.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import Ember from 'ember';
import { gteHelper } from 'ember-truth-helpers/helpers/gte';

export default Ember.Helper.helper(gteHelper);
4 changes: 4 additions & 0 deletions app/helpers/is-array.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import Ember from 'ember';
import { isArrayHelper } from 'ember-truth-helpers/helpers/is-array';

export default Ember.Helper.helper(isArrayHelper);
4 changes: 4 additions & 0 deletions app/helpers/lt.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import Ember from 'ember';
import { ltHelper } from 'ember-truth-helpers/helpers/lt';

export default Ember.Helper.helper(ltHelper);
4 changes: 4 additions & 0 deletions app/helpers/lte.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import Ember from 'ember';
import { lteHelper } from 'ember-truth-helpers/helpers/lte';

export default Ember.Helper.helper(lteHelper);
4 changes: 4 additions & 0 deletions app/helpers/not-eq.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import Ember from 'ember';
import { notEqualHelper } from 'ember-truth-helpers/helpers/not-equal';

export default Ember.Helper.helper(notEqualHelper);
4 changes: 4 additions & 0 deletions app/helpers/not.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import Ember from 'ember';
import { notHelper } from 'ember-truth-helpers/helpers/not';

export default Ember.Helper.helper(notHelper);
4 changes: 4 additions & 0 deletions app/helpers/or.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import Ember from 'ember';
import { orHelper } from 'ember-truth-helpers/helpers/or';

export default Ember.Helper.helper(orHelper);
8 changes: 8 additions & 0 deletions app/initializers/truth-helpers.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Ember from 'ember';
import { registerHelper } from 'ember-truth-helpers/utils/register-helper';

import { andHelper } from 'ember-truth-helpers/helpers/and';
Expand All @@ -12,6 +13,13 @@ import { ltHelper } from 'ember-truth-helpers/helpers/lt';
import { lteHelper } from 'ember-truth-helpers/helpers/lte';

export function initialize(/* container, application */) {

// Do not register helpers from Ember 1.13 onwards, starting from 1.13 they
// will be auto-discovered.
if (Ember.Helper) {
return;
}

registerHelper('and', andHelper);
registerHelper('or', orHelper);
registerHelper('eq', equalHelper);
Expand Down

0 comments on commit 77d67a3

Please sign in to comment.