Skip to content
This repository has been archived by the owner on Jun 6, 2022. It is now read-only.

Commit

Permalink
v1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Exelord committed Jul 6, 2017
1 parent 73c3a4b commit d145051
Show file tree
Hide file tree
Showing 14 changed files with 748 additions and 17 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@ module.exports = {
browser: true
},
rules: {
},
globals: {
FastBoot: true
}
};
25 changes: 24 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,29 @@
# ember-md5

This README outlines the details of collaborating on this Ember addon.
This is the blueimp-md5 wrapper for EmberJS applications.

## Installation
```sh
ember install ember-md5
```

## Usage
```js
import md5 from 'ember-md5';

md5('Hash something' /* key, raw */);
```

or you can use built-in helper

```hbs
{{md5 'My String' 'My key' true}}
```
- `first parameter` - `string` - string to hash
- `second parameter` - `string` -key of the hash
- `third parameter` - `boolean` - raw value

# Contributions

## Installation

Expand Down
10 changes: 10 additions & 0 deletions addon/helpers/md5.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import Ember from 'ember';
import md5 from 'ember-md5';

const { Helper } = Ember;

export default Helper.extend({
compute: function([value, key, raw]) {
return md5(value, key, raw);
}
});
1 change: 1 addition & 0 deletions addon/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from 'blueimp-md5';
1 change: 1 addition & 0 deletions app/helpers/md5.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from 'ember-md5/helpers/md5';
21 changes: 21 additions & 0 deletions config/release.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/* eslint-env node */
// var RSVP = require('rsvp');

// For details on each option run `ember help release`
module.exports = {
// local: true,
// remote: 'some_remote',
// annotation: "Release %@",
// message: "Bumped version to %@",
// manifest: [ 'package.json', 'bower.json', 'someconfig.json' ],
// publish: true,
// strategy: 'date',
// format: 'YYYY-MM-DD',
// timezone: 'America/Los_Angeles',
//
// beforeCommit: function(project, versions) {
// return new RSVP.Promise(function(resolve, reject) {
// // Do custom things here...
// });
// }
};
25 changes: 24 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,29 @@
/* eslint-env node */
'use strict';

const path = require('path');
const Funnel = require('broccoli-funnel');
const mergeTrees = require('broccoli-merge-trees');

module.exports = {
name: 'ember-md5'
name: 'ember-md5',

included: function(app) {
this._super.included(app);

app.import('vendor/ember-md5/md5.js');
app.import('vendor/ember-md5/shims/md5-shim.js');
},

treeForVendor(tree) {
let trees = [tree];
let md5Path = path.join(this.app.project.nodeModulesPath, 'blueimp-md5', 'js');

trees.push(new Funnel(md5Path, {
destDir: 'ember-md5',
files: ['md5.js']
}));

return mergeTrees(trees);
}
};
Loading

0 comments on commit d145051

Please sign in to comment.