Skip to content

Commit

Permalink
changed over to ember-cli addon format
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Marcum committed Sep 19, 2014
1 parent 8db9baf commit 1066c06
Show file tree
Hide file tree
Showing 67 changed files with 894 additions and 3,005 deletions.
3 changes: 2 additions & 1 deletion .bowerrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"directory": "vendor"
"directory": "bower_components",
"analytics": false
}
33 changes: 33 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true


[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 2

[*.js]
indent_style = space
indent_size = 2

[*.hbs]
indent_style = space
indent_size = 2

[*.css]
indent_style = space
indent_size = 2

[*.html]
indent_style = space
indent_size = 2

[*.md]
trim_trailing_whitespace = false
21 changes: 17 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
tmp
node_modules
vendor
doc
# See http://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist
/tmp

# dependencies
/node_modules
/bower_components/*

# misc
/.sass-cache
/connect.lock
/coverage/*
/libpeerconnection.log
npm-debug.log
testem.log
101 changes: 0 additions & 101 deletions .jscsrc

This file was deleted.

16 changes: 16 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
language: node_js

sudo: false

cache:
directories:
- node_modules

install:
- npm install -g bower
- npm install
- bower install

script:
- npm test
35 changes: 19 additions & 16 deletions Brocfile.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
var filterES6Modules = require('broccoli-es6-module-filter');
var broconcat = require('broccoli-concat');
/* global require, module */

module.exports = broconcat(
filterES6Modules('lib', {
moduleType: 'amd',
anonymous: false,
compatFix: true,
packageName: 'sl-model',
main: 'main'
}),
{
inputFiles: ['**/*.js'],
outputFile: '/sl-model.js',
wrapInEval: false
}
);
var EmberAddon = require('ember-cli/lib/broccoli/ember-addon');

var app = new EmberAddon();

// Use `app.import` to add additional libraries to the generated
// output files.
//
// If you need to use different assets in different
// environments, specify an object as the first parameter. That
// object's keys should be the environment name and the values
// should be the asset to use in that environment.
//
// If the library that you are including contains AMD or ES6
// modules that you would like to import into your application
// please specify an object with the list of modules as keys
// along with the exports of each module as its value.

module.exports = app.toTree();
6 changes: 0 additions & 6 deletions CHANGELOG.md

This file was deleted.

4 changes: 0 additions & 4 deletions TODO.md

This file was deleted.

File renamed without changes.
3 changes: 2 additions & 1 deletion lib/adapter.js → addon/adapter.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import ModelizeMixin from 'sl-modelize';
import Ember from 'ember';
import ModelizeMixin from 'sl-modelize/mixins/modelize';

/**
* SL-Model/adapter
Expand Down
9 changes: 2 additions & 7 deletions lib/adapters/ajax.js → addon/adapters/ajax.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,8 @@ export default Adapter.extend({
find: function ( type, id, options, findOne ){

var url,
cacheKey,
cachedModel,
results,
cachedRequest,
promise,
initialObj = {},
queryObj,
store = this.get( 'store' ),
model = store.modelFor( type );
Expand Down Expand Up @@ -149,8 +145,7 @@ export default Adapter.extend({
* @return {object} Promise
*/
save: function( url, content ) {
var promise,
result;
var promise;

Ember.assert('A url property is required to save a model', url);

Expand All @@ -167,7 +162,7 @@ export default Adapter.extend({

}.bind( this ), null, 'sl-model:save - then' )

.catch( function ajaxAdapterSaveCatch( jqxhr, textStatus, error ) {
.catch( function ajaxAdapterSaveCatch( jqxhr ) {
var errorData = {
'statusCode' : jqxhr.status,
'statusText' : jqxhr.statusText,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ var LocalStorageAdapter = Adapter.extend({
promise = new Ember.RSVP.Promise( function( resolve, reject){
//todo actual localStorage query
var db,
modelKey,
records,
response,
finalResult;
Expand Down Expand Up @@ -174,7 +173,7 @@ var LocalStorageAdapter = Adapter.extend({

Ember.assert('A url is required to delete a model', url);

promise = new Ember.RSVP.Promise( function( resolve, reject ){
promise = new Ember.RSVP.Promise( function( resolve ){
var db,
records,
recordIndex;
Expand Down
Loading

0 comments on commit 1066c06

Please sign in to comment.